本文整理匯總了Java中javax.annotation.processing.ProcessingEnvironment.getOptions方法的典型用法代碼示例。如果您正苦於以下問題:Java ProcessingEnvironment.getOptions方法的具體用法?Java ProcessingEnvironment.getOptions怎麽用?Java ProcessingEnvironment.getOptions使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.annotation.processing.ProcessingEnvironment
的用法示例。
在下文中一共展示了ProcessingEnvironment.getOptions方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: init
import javax.annotation.processing.ProcessingEnvironment; //導入方法依賴的package包/類
@Override
public synchronized void init(ProcessingEnvironment processingEnv) {
super.init(processingEnv);
routerNodes = new ArrayList<>();
mFiler = processingEnv.getFiler();
types = processingEnv.getTypeUtils();
elements = processingEnv.getElementUtils();
typeUtils = new TypeUtils(types, elements);
type_String = elements.getTypeElement("java.lang.String").asType();
logger = new Logger(processingEnv.getMessager());
Map<String, String> options = processingEnv.getOptions();
if (MapUtils.isNotEmpty(options)) {
host = options.get(KEY_HOST_NAME);
logger.info(">>> host is " + host + " <<<");
}
if (host == null || host.equals("")) {
host = "default";
}
logger.info(">>> RouteProcessor init. <<<");
}
示例2: init
import javax.annotation.processing.ProcessingEnvironment; //導入方法依賴的package包/類
@Override
public synchronized void init(ProcessingEnvironment processingEnvironment) {
super.init(processingEnvironment);
types = processingEnv.getTypeUtils(); // Get type utils.
elements = processingEnv.getElementUtils(); // Get class meta.
filter = processingEnvironment.getFiler();
messager = processingEnvironment.getMessager();
processingEnvironment.getOptions();
Map<String, String> options = processingEnv.getOptions();
if (options != null && !options.isEmpty()) {
moduleName = options.get(Constant.KEY_MODULE_NAME);
if (moduleName != null && moduleName.length() > 0) {
moduleName = ProcessorUtils.filterModuleName(moduleName);
}
}
}
示例3: init
import javax.annotation.processing.ProcessingEnvironment; //導入方法依賴的package包/類
@Override
public synchronized void init(ProcessingEnvironment processingEnvironment) {
super.init(processingEnvironment);
filter = processingEnvironment.getFiler();
messager = processingEnvironment.getMessager();
printValue("MRoute init-->" + this);
processingEnvironment.getOptions();
Map<String, String> options = processingEnv.getOptions();
if (options != null && !options.isEmpty()) {
moduleName = options.get(KEY_MODULE_NAME);
if (moduleName != null && moduleName.length() > 0) {
moduleName = moduleName.replaceAll("[^0-9a-zA-Z_]+", "");
}
printValue("moduleName-->" + moduleName);
}
}
示例4: 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();
}
示例5: init
import javax.annotation.processing.ProcessingEnvironment; //導入方法依賴的package包/類
@Override
public synchronized void init(ProcessingEnvironment processingEnvironment) {
super.init(processingEnvironment);
mLogger = new Logger(processingEnvironment.getMessager());
mElementUtils = processingEnvironment.getElementUtils();
mFiler = processingEnvironment.getFiler();
Map<String, String> options = processingEnvironment.getOptions();
if (options != null && !options.isEmpty()) {
mModuleName = options.get(Constants.KEY_XMODULE);
}
if (mModuleName != null && !mModuleName.isEmpty()) {
mModuleName = mModuleName.replaceAll("[^0-9a-zA-Z_]+", "");
mLogger.info("The user has configuration the XModule, it was [" + mModuleName + "]");
} else {
mLogger.error("These no XModule, at 'build.gradle', like :\n" +
"javaCompileOptions {\n" +
" annotationProcessorOptions {\n" +
" arguments = [\n" +
" XModule : moduleName\n" +
" ]\n" +
" }\n" +
" }");
throw new RuntimeException(Constants.PREFIX_OF_LOGGER + "No XModule, for more information, look at gradle log.");
}
mXModuleLoader = mElementUtils.getTypeElement(Constants.XMODULE_LOADER);
}
示例6: ModelContext
import javax.annotation.processing.ProcessingEnvironment; //導入方法依賴的package包/類
/**
* Creates a new model context with the specified processing environment for the specified generator.
* @param procEnv
* @param generatorId
*/
ModelContext(ProcessingEnvironment procEnv, String generatorId) {
super();
typeUtils = procEnv.getTypeUtils();
elementUtils = procEnv.getElementUtils();
filer = procEnv.getFiler();
messager = procEnv.getMessager();
moduleAnnotation = elementUtils.getTypeElement(AlvisNLPModule.class.getCanonicalName());
converterAnnotation = elementUtils.getTypeElement(Converter.class.getCanonicalName());
libraryAnnotation = elementUtils.getTypeElement(Library.class.getCanonicalName());
moduleBase = getModuleBase(typeUtils, elementUtils);
TypeElement fle = getTypeElement(elementUtils, FunctionLibrary.class);
for (ExecutableElement m : ElementFilter.methodsIn(fle.getEnclosedElements())) {
if (m.getSimpleName().toString().equals("resolveExpression")) {
resolveFunction = m;
break;
}
}
functionLibrary = fle.asType();
corpusModule = getCorpusModule(typeUtils, elementUtils);
element = getTypeMirror(elementUtils, fr.inra.maiage.bibliome.alvisnlp.core.corpus.Element.class);
evaluationContext = getTypeMirror(elementUtils, EvaluationContext.class);
libraryResolver = getTypeMirror(elementUtils, LibraryResolver.class);
evaluator = getTypeMirror(elementUtils, Evaluator.class);
expression = getTypeMirror(elementUtils, Expression.class);
string = getTypeMirror(elementUtils, String.class);
charSequence = getTypeMirror(elementUtils, CharSequence.class);
processingContext = typeUtils.erasure(getTypeMirror(elementUtils, ProcessingContext.class));
elementList = getElementList(typeUtils, elementUtils);
elementIterator = getElementIterator(typeUtils, elementUtils);
transformerFactory = TransformerFactory.newInstance();
options = procEnv.getOptions();
this.generatorId = generatorId;
version = new Versioned("fr.inra.maiage.bibliome.alvisnlp.core.app.AlvisNLPVersion");
}
示例7: AbstractPluginFileGenerator
import javax.annotation.processing.ProcessingEnvironment; //導入方法依賴的package包/類
protected AbstractPluginFileGenerator(ProcessingEnvironment procEnv, RoundEnvironment roundEnv) {
this.types = procEnv.getTypeUtils();
this.elements = procEnv.getElementUtils();
this.roundEnv = roundEnv;
this.msgr = procEnv.getMessager();
this.options = procEnv.getOptions();
}
示例8: init
import javax.annotation.processing.ProcessingEnvironment; //導入方法依賴的package包/類
@Override
public synchronized void init(ProcessingEnvironment processingEnv) {
super.init(processingEnv);
mFiler = processingEnv.getFiler();
mElementUtils = processingEnv.getElementUtils();
mMessager = processingEnv.getMessager();
mLocale = processingEnv.getLocale();
mOptions = processingEnv.getOptions();
mTypeUtils = processingEnv.getTypeUtils();
}