當前位置: 首頁>>代碼示例>>Java>>正文


Java ProcessingEnvironment.getTypeUtils方法代碼示例

本文整理匯總了Java中javax.annotation.processing.ProcessingEnvironment.getTypeUtils方法的典型用法代碼示例。如果您正苦於以下問題:Java ProcessingEnvironment.getTypeUtils方法的具體用法?Java ProcessingEnvironment.getTypeUtils怎麽用?Java ProcessingEnvironment.getTypeUtils使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.annotation.processing.ProcessingEnvironment的用法示例。


在下文中一共展示了ProcessingEnvironment.getTypeUtils方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: TypeMirrors

import javax.annotation.processing.ProcessingEnvironment; //導入方法依賴的package包/類
TypeMirrors(ProcessingEnvironment env) {
    final Types typeUtils = env.getTypeUtils();
    final Elements elementUtils = env.getElementUtils();

    STRING_MIRROR = elementUtils.getTypeElement("java.lang.String").asType();
    BINARY_MIRROR = typeUtils.getArrayType(typeUtils.getPrimitiveType(TypeKind.BYTE));
    BOOLEAN_MIRROR = elementUtils.getTypeElement(Boolean.class.getName()).asType();
    LONG_MIRROR = elementUtils.getTypeElement(Long.class.getName()).asType();
    INTEGER_MIRROR = elementUtils.getTypeElement(Integer.class.getName()).asType();
    SHORT_MIRROR = elementUtils.getTypeElement(Short.class.getName()).asType();
    BYTE_MIRROR = elementUtils.getTypeElement(Byte.class.getName()).asType();
    DOUBLE_MIRROR = elementUtils.getTypeElement(Double.class.getName()).asType();
    FLOAT_MIRROR = elementUtils.getTypeElement(Float.class.getName()).asType();
    DATE_MIRROR = elementUtils.getTypeElement(Date.class.getName()).asType();

    PRIMITIVE_LONG_MIRROR = typeUtils.getPrimitiveType(TypeKind.LONG);
    PRIMITIVE_INT_MIRROR = typeUtils.getPrimitiveType(TypeKind.INT);
    PRIMITIVE_SHORT_MIRROR = typeUtils.getPrimitiveType(TypeKind.SHORT);
    PRIMITIVE_BYTE_MIRROR = typeUtils.getPrimitiveType(TypeKind.BYTE);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:21,代碼來源:TypeMirrors.java

示例2: init

import javax.annotation.processing.ProcessingEnvironment; //導入方法依賴的package包/類
@Override
public synchronized void init(final ProcessingEnvironment processingEnvironment) {
	super.init(processingEnvironment);

	elementUtil = processingEnvironment.getElementUtils();
	messager = processingEnvironment.getMessager();
	filer = processingEnvironment.getFiler();

	final CoreHelpers coreHelpers = new CoreHelpers(
			processingEnvironment.getElementUtils(),
			processingEnvironment.getTypeUtils());

	companionGenerator = new CompanionGenerator(coreHelpers);
	basicValidator = new BasicValidator();
	typeValidator = new TypeValidator(coreHelpers);

	createRequiredFiles();
}
 
開發者ID:MatthewTamlin,項目名稱:Spyglass,代碼行數:19,代碼來源:MainProcessor.java

示例3: init

import javax.annotation.processing.ProcessingEnvironment; //導入方法依賴的package包/類
@Override
public synchronized void init(ProcessingEnvironment processingEnvironment) {
    super.init(processingEnvironment);

    this.elementUtils = processingEnvironment.getElementUtils();
    this.typeUtils = processingEnvironment.getTypeUtils();
    this.messager = processingEnvironment.getMessager();
    this.filer = processingEnvironment.getFiler();

    try {
        trees = Trees.instance(processingEnv);
    } catch (IllegalArgumentException ignored) { }
}
 
開發者ID:WellingtonCosta,項目名稱:convalida,代碼行數:14,代碼來源:ConvalidaProcessor.java

示例4: init

import javax.annotation.processing.ProcessingEnvironment; //導入方法依賴的package包/類
@Override
public synchronized void init(ProcessingEnvironment processingEnv) {
  super.init(processingEnv);
  elementUtils = processingEnv.getElementUtils();
  errorReporter = new ErrorReporter(processingEnv.getMessager());
  typesUtils = processingEnv.getTypeUtils();
  processorPipelines.addAll(getProcessorPipelines(this));
}
 
開發者ID:uber,項目名稱:RIBs,代碼行數:9,代碼來源:RibProcessor.java

示例5: init

import javax.annotation.processing.ProcessingEnvironment; //導入方法依賴的package包/類
@Override
public synchronized void init(ProcessingEnvironment processingEnv) {
	super.init(processingEnv);

	sMessager = processingEnv.getMessager();
	sTypeUtils = processingEnv.getTypeUtils();
	sElementUtils = processingEnv.getElementUtils();
	sOptions = processingEnv.getOptions();
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:10,代碼來源:MvpCompiler.java

示例6: init

import javax.annotation.processing.ProcessingEnvironment; //導入方法依賴的package包/類
@Override
public synchronized void init(ProcessingEnvironment processingEnv) {
    super.init(processingEnv);
    elementUtils = processingEnv.getElementUtils();
    filer = processingEnv.getFiler();
    messager = processingEnv.getMessager();
    typeUtils = processingEnv.getTypeUtils();
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:9,代碼來源:EasyMVPProcessor.java

示例7: init

import javax.annotation.processing.ProcessingEnvironment; //導入方法依賴的package包/類
@Override
public synchronized void init(ProcessingEnvironment processingEnv) {
    super.init(processingEnv);
    this.typeUtils=processingEnv.getTypeUtils();
    this.elementUtils=processingEnv.getElementUtils();
    this.filer=processingEnv.getFiler();
    this.messager=processingEnv.getMessager();
    this.elementFactory=new ElementFactory(elementUtils, typeUtils);
}
 
開發者ID:GwtDomino,項目名稱:domino,代碼行數:10,代碼來源:BaseProcessor.java

示例8: isValueSpecMarker

import javax.annotation.processing.ProcessingEnvironment; //導入方法依賴的package包/類
private static boolean isValueSpecMarker(
    TypeMirror returnType, ProcessingEnvironment processingEnvironment) {
  Types types = processingEnvironment.getTypeUtils();
  Elements elements = processingEnvironment.getElementUtils();

  return types.isSameType(
      returnType, elements.getTypeElement(dataenum_case.class.getCanonicalName()).asType());
}
 
開發者ID:spotify,項目名稱:dataenum,代碼行數:9,代碼來源:ValueParser.java

示例9: init

import javax.annotation.processing.ProcessingEnvironment; //導入方法依賴的package包/類
@Override
public synchronized void init(ProcessingEnvironment env) {
    super.init(env);

    mElementUtils = env.getElementUtils();
    mTypeUtils = env.getTypeUtils();
    mFiler = env.getFiler();
    mJsonObjectMap = new HashMap<>();
    mProcessors = Processor.allProcessors(processingEnv);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:11,代碼來源:JsonAnnotationProcessor.java

示例10: init

import javax.annotation.processing.ProcessingEnvironment; //導入方法依賴的package包/類
@Override
public synchronized void init(ProcessingEnvironment processingEnv) {
    super.init(processingEnv);
    mTypeUtils = processingEnv.getTypeUtils();
    mElementUtils = processingEnv.getElementUtils();
    mFiler = processingEnv.getFiler();
    mMessager = processingEnv.getMessager();
}
 
開發者ID:evernote,項目名稱:android-state,代碼行數:9,代碼來源:StateProcessor.java

示例11: init

import javax.annotation.processing.ProcessingEnvironment; //導入方法依賴的package包/類
@Override
public synchronized void init(ProcessingEnvironment env) {
  super.init(env);
  Types typeUtils = env.getTypeUtils();
  Elements elementUtils = env.getElementUtils();
  Filer filer = env.getFiler();
  messager = env.getMessager();
  ErrorMessages errorMessages = ErrorMessages.builder()
      .cycleInDefinitionSources("Cycle in @Configuration class @Imports {0}")
      .cycleInObjectDefinitions("Cycle in spring bean dependencies {0}")
      .duplicateObjectDefinitions("Duplicate in spring beans {0}")
      .nonLiteralStaticMemberVariables("Non literal static member variables can break class instantiation and leak state")
      .knownDamagingClass("Known damaging class import (contains non-literal static member variables)")
      .missingBeanDefinitions("Missing bean definitions for spring beans {0},"
         + " create definitions or list them in @Verified'''s expected field")
      .missingRelevantAnnotations("Missing @Verified or @Configuration on classes {0}")
      .unmatchedTypes("Unmatched types {0}")
      .duplicatedMatchingDependencies("Duplicated matching dependencies {0}")
      .duplicatedMatchingDefinitions("Duplicated matching definitions {0}")
      .noMatchingDefinition("No matching definition {0}")
      .unusedExpected("Expected bean name is unnecessary {0}")
      .couldNotStore("Could not store incremental build file for {0}")
      .couldNotRead("Could not read incremental build file for {0}")
      .dependencyShaMismatch("Sha256 mismatch of dependency model of prior analyzed @Configuration model")
      .rootNodeImported("@Verfied(root=true) may not be @Imported by other @Verified @Configuration classes: {0}")
      .build();
  definitionAggregator = new AptParsingContext(errorMessages, filer, elementUtils, typeUtils);
}
 
開發者ID:salesforce,項目名稱:AptSpring,代碼行數:29,代碼來源:VerifiedSpringConfiguration.java

示例12: init

import javax.annotation.processing.ProcessingEnvironment; //導入方法依賴的package包/類
@Override
public synchronized void init(final ProcessingEnvironment pe) {
    super.init(pe);

    logger = pe.getMessager();
    typesUtil = pe.getTypeUtils();
    elementsUtil = pe.getElementUtils();
    filer = pe.getFiler();
}
 
開發者ID:OleksandrKucherenko,項目名稱:autoproxy,代碼行數:10,代碼來源:AutoProxyProcessor.java

示例13: init

import javax.annotation.processing.ProcessingEnvironment; //導入方法依賴的package包/類
@Override
public synchronized void init(ProcessingEnvironment env) {
    super.init(env);

    elementUtils = env.getElementUtils();
    typeUtils = env.getTypeUtils();
    filer = env.getFiler();
}
 
開發者ID:zongwu233,項目名稱:Summer,代碼行數:9,代碼來源:ProtocolProcessor.java

示例14: EntityHandler

import javax.annotation.processing.ProcessingEnvironment; //導入方法依賴的package包/類
public EntityHandler(ProcessingEnvironment processingEnv) {
    this.elementUtils = processingEnv.getElementUtils();
    this.typeUtils = processingEnv.getTypeUtils();
    this.filer = processingEnv.getFiler();
    this.messager = processingEnv.getMessager();
    classEntityMap = new HashMap<>();
}
 
開發者ID:simplezhli,項目名稱:RxPay,代碼行數:8,代碼來源:EntityHandler.java

示例15: init

import javax.annotation.processing.ProcessingEnvironment; //導入方法依賴的package包/類
@Override
public synchronized void init(ProcessingEnvironment env) {
	super.init(env);

	ProcessorLog.init(env);

	mElementUtils = env.getElementUtils();
	mTypeUtils = env.getTypeUtils();
	mFiler = env.getFiler();
}
 
開發者ID:globulus,項目名稱:easyprefs,代碼行數:11,代碼來源:Processor.java


注:本文中的javax.annotation.processing.ProcessingEnvironment.getTypeUtils方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。