javax.annotation.processing.ProcessingEnvironment#getElementUtils ( )源码实例Demo

下面列出了javax.annotation.processing.ProcessingEnvironment#getElementUtils ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: requery   文件: CodeGeneration.java
static void addGeneratedAnnotation(ProcessingEnvironment processingEnvironment,
                                   TypeSpec.Builder builder) {
    Elements elements = processingEnvironment.getElementUtils();
    SourceVersion sourceVersion = processingEnvironment.getSourceVersion();
    AnnotationSpec.Builder annotationBuilder = null;
    if (sourceVersion.compareTo(SourceVersion.RELEASE_8) > 0) {
        ClassName name = ClassName.bestGuess("javax.annotation.processing.Generated");
        annotationBuilder = AnnotationSpec.builder(name);
    } else {
        if (elements.getTypeElement(Generated.class.getCanonicalName()) != null) {
            annotationBuilder = AnnotationSpec.builder(Generated.class);
        }
    }

    if (annotationBuilder != null) {
        builder.addAnnotation(annotationBuilder
                .addMember("value", "$S",
                        EntityProcessor.class.getCanonicalName()).build());
    }
}
 
源代码2 项目: pandroid   文件: Processor.java
@Override
public synchronized void init(ProcessingEnvironment processingEnv) {
    super.init(processingEnv);
    mProcessingEnvironment = processingEnv;
    mElementsUtils = processingEnv.getElementUtils();
    mTypesUtils = processingEnv.getTypeUtils();


    processors = new ArrayList<BaseProcessor>();
    processors.add(new EventBusProcessor(mElementsUtils, mTypesUtils));
    processors.add(new LifecycleDelegateProcessor(mElementsUtils, mTypesUtils));
    processors.add(new RxWrapperProcessor(mElementsUtils, mTypesUtils));
    processors.add(new GeneratedClassMapperProcessor(mElementsUtils, mTypesUtils));

    duration = 0;

}
 
源代码3 项目: DataLoader   文件: DataLoaderProcessor.java
@Override
public synchronized void init(ProcessingEnvironment processingEnvironment) {
    super.init(processingEnvironment);
    filer = processingEnvironment.getFiler();
    types = processingEnvironment.getTypeUtils();
    elements = processingEnvironment.getElementUtils();
}
 
源代码4 项目: RetroFacebook   文件: BuilderSpec.java
BuilderSpec(
    TypeElement autoValueClass,
    ProcessingEnvironment processingEnv,
    ErrorReporter errorReporter) {
  this.autoValueClass = autoValueClass;
  this.elementUtils = processingEnv.getElementUtils();
  this.errorReporter = errorReporter;
}
 
源代码5 项目: vertx-codegen   文件: EnumModel.java
public EnumModel(ProcessingEnvironment env, TypeElement modelElt) {
  this.typeUtils = env.getTypeUtils();
  this.elementUtils = env.getElementUtils();
  this.typeMirrorFactory = new TypeMirrorFactory(elementUtils, typeUtils);
  this.docFactory = new Doc.Factory(env.getMessager(), elementUtils, typeUtils, typeMirrorFactory, modelElt);
  this.modelElt = modelElt;
  this.annotationValueInfoFactory = new AnnotationValueInfoFactory(typeMirrorFactory);
  this.deprecated = modelElt.getAnnotation(Deprecated.class) != null;
}
 
源代码6 项目: Kratos   文件: KratosProcessor.java
@Override
public synchronized void init(ProcessingEnvironment env) {
    super.init(env);
    elementUtils = env.getElementUtils();
    typeUtils = env.getTypeUtils();
    filer = env.getFiler();
}
 
源代码7 项目: EasyRouter   文件: BaseProcess.java
@Override
public synchronized void init(ProcessingEnvironment processingEnv) {
    super.init(processingEnv);
    typeUtils = processingEnv.getTypeUtils();
    elementUtils = processingEnv.getElementUtils();
    filer = processingEnv.getFiler();
    messager = processingEnv.getMessager();
}
 
源代码8 项目: requery   文件: EntityPartGenerator.java
EntityPartGenerator(ProcessingEnvironment processingEnv,
                    EntityGraph graph,
                    EntityDescriptor entity) {
    this.processingEnv = processingEnv;
    this.graph = graph;
    this.entity = entity;
    this.elements = processingEnv.getElementUtils();
    this.types = processingEnv.getTypeUtils();
    nameResolver = new EntityNameResolver(graph);
    typeElement = entity.element();
    typeName = nameResolver.typeNameOf(entity);
}
 
源代码9 项目: barber   文件: BarberProcessor.java
@Override
public synchronized void init(ProcessingEnvironment processingEnv) {
    super.init(processingEnv);
    instance = this;
    typeUtils = processingEnv.getTypeUtils();
    elementUtils = processingEnv.getElementUtils();
    filer = processingEnv.getFiler();
    messager = processingEnv.getMessager();
}
 
源代码10 项目: FastAdapter   文件: FastModelProcessor.java
@Override
public synchronized void init(final ProcessingEnvironment pProcessingEnvironment) {
  super.init(pProcessingEnvironment);
  mMessager = pProcessingEnvironment.getMessager();
  mFiler = pProcessingEnvironment.getFiler();
  mElements = pProcessingEnvironment.getElementUtils();
}
 
源代码11 项目: OkDeepLink   文件: DeepLinkInjectProcessor.java
@Override
public synchronized void init(ProcessingEnvironment processingEnv) {
    super.init(processingEnv);
    logger = new Logger(processingEnv.getMessager());
    filer = processingEnv.getFiler();
    elements = processingEnv.getElementUtils();
    types = processingEnv.getTypeUtils();
}
 
源代码12 项目: WMRouter   文件: BaseProcessor.java
@Override
public synchronized void init(ProcessingEnvironment processingEnvironment) {
    super.init(processingEnvironment);
    filer = processingEnvironment.getFiler();
    types = processingEnvironment.getTypeUtils();
    elements = processingEnvironment.getElementUtils();
}
 
源代码13 项目: FABridge   文件: FabridgeProcess.java
@Override
public synchronized void init(ProcessingEnvironment processingEnv)
{
    super.init(processingEnv);

    typeUtils = processingEnv.getTypeUtils();
    elementUtils = processingEnv.getElementUtils();
    messager = processingEnv.getMessager();
}
 
public CustomExtendedTypeFactory(
        ProcessingEnvironment env,
        Set<Class<? extends Annotation>> annotations,
        TypeMappings typeMappings,
        QueryTypeFactory queryTypeFactory,
        Function<EntityType, String> variableNameFunction) {
    super(env, annotations, typeMappings, queryTypeFactory, variableNameFunction);
    this.elements = env.getElementUtils();
}
 
源代码15 项目: datafu   文件: EcjMultilineProcessor.java
@Override
public void init(final ProcessingEnvironment procEnv) {
  super.init(procEnv);
  this.elementUtils = procEnv.getElementUtils();
}
 
private static TypeMirror getErasure(ProcessingEnvironment processingEnv, final String className)
{
    final Types typeUtils = processingEnv.getTypeUtils();
    final Elements elementUtils = processingEnv.getElementUtils();
    return typeUtils.erasure(elementUtils.getTypeElement(className).asType());
}
 
源代码17 项目: immutables   文件: Introspection.java
Introspection(ProcessingEnvironment environment) {
  this.environment = environment;
  this.elements = environment.getElementUtils();
  this.types = environment.getTypeUtils();
  this.inEclipseCompiler = environment.getClass().getName().startsWith("org.eclipse.jdt");
}
 
源代码18 项目: FreeBuilder   文件: Analyser.java
Analyser(ProcessingEnvironment env, Messager messager) {
  this.env = env;
  this.elements = env.getElementUtils();
  this.messager = messager;
  this.types = env.getTypeUtils();
}
 
private static TypeMirror getErasure(ProcessingEnvironment processingEnv, final String className)
{
    final Types typeUtils = processingEnv.getTypeUtils();
    final Elements elementUtils = processingEnv.getElementUtils();
    return typeUtils.erasure(elementUtils.getTypeElement(className).asType());
}
 
源代码20 项目: openjdk-jdk9   文件: T6468404.java
@Override
public synchronized void init(ProcessingEnvironment processingEnv) {
    super.init(processingEnv);
    elements = processingEnv.getElementUtils();
}