Android Open Source - ascent Writer Factory






From Project

Back to project page ascent.

License

The source code is released under:

Apache License

If you think the Android project ascent listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package net.jamesbaca.ascent.internal;
/*w  w w .  j a v  a 2s. c o  m*/
import java.io.IOException;
import javax.annotation.processing.Filer;
import javax.lang.model.element.TypeElement;
import javax.lang.model.util.Elements;
import javax.lang.model.util.Types;
import javax.tools.JavaFileObject;

class WriterFactory {
  private final Elements elementUtils;
  private final Types typeUtils;
  private final Filer filer;
  private final String suffix;

  public WriterFactory(Elements elementUtils, Types typeUtils, Filer filer, String suffix) {
    this.elementUtils = elementUtils;
    this.typeUtils = typeUtils;
    this.filer = filer;
    this.suffix = suffix;
  }

  public FontClassWriter writeClass(EnclosingClass enclosingClass) throws IOException {
    TypeElement classType = enclosingClass.getElement();
    String fqcn = enclosingClass.getClassPackage() + "." + enclosingClass.getClassName() + suffix;
    JavaFileObject jfo = filer.createSourceFile(fqcn, classType);
    return new FontClassWriter(jfo, suffix, enclosingClass);
  }
}




Java Source Code List

net.jamesbaca.ascent.Ascent.java
net.jamesbaca.ascent.FontHelper.java
net.jamesbaca.ascent.Font.java
net.jamesbaca.ascent.InjectedAscent.java
net.jamesbaca.ascent.demo.ApplicationTest.java
net.jamesbaca.ascent.demo.MainActivity.java
net.jamesbaca.ascent.internal.AnnotatedField.java
net.jamesbaca.ascent.internal.AnnotationsConverter.java
net.jamesbaca.ascent.internal.EnclosingClass.java
net.jamesbaca.ascent.internal.FontClassWriter.java
net.jamesbaca.ascent.internal.FontProcessor.java
net.jamesbaca.ascent.internal.WriterFactory.java
net.jamesbaca.ascent.mymodule.app.ApplicationTest.java
net.jamesbaca.ascent.mymodule.app.DemoApplicationModule.java
net.jamesbaca.ascent.mymodule.app.DemoApplication.java
net.jamesbaca.ascent.mymodule.app.MainActivity.java