本文整理汇总了Java中com.sun.tools.javac.model.AnnotationProxyMaker类的典型用法代码示例。如果您正苦于以下问题:Java AnnotationProxyMaker类的具体用法?Java AnnotationProxyMaker怎么用?Java AnnotationProxyMaker使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AnnotationProxyMaker类属于com.sun.tools.javac.model包,在下文中一共展示了AnnotationProxyMaker类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: annotationMap
import com.sun.tools.javac.model.AnnotationProxyMaker; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public static ImmutableClassToInstanceMap<Annotation> annotationMap(Symbol symbol) {
ImmutableClassToInstanceMap.Builder<Annotation> builder = ImmutableClassToInstanceMap.builder();
for (Compound compound : symbol.getAnnotationMirrors()) {
Name qualifiedAnnotationType =
((TypeElement) compound.getAnnotationType().asElement()).getQualifiedName();
try {
Class<? extends Annotation> annotationClazz =
Class.forName(qualifiedAnnotationType.toString()).asSubclass(Annotation.class);
builder.put((Class) annotationClazz,
AnnotationProxyMaker.generateAnnotation(compound, annotationClazz));
} catch (ClassNotFoundException e) {
throw new IllegalArgumentException("Unrecognized annotation type", e);
}
}
return builder.build();
}
开发者ID:sivakumar-kailasam,项目名称:refactor-faster,代码行数:18,代码来源:UTemplater.java
示例2: annotationMap
import com.sun.tools.javac.model.AnnotationProxyMaker; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public static ImmutableClassToInstanceMap<Annotation> annotationMap(Symbol symbol) {
ImmutableClassToInstanceMap.Builder<Annotation> builder = ImmutableClassToInstanceMap.builder();
for (Compound compound : symbol.getAnnotationMirrors()) {
Name qualifiedAnnotationType =
((TypeElement) compound.getAnnotationType().asElement()).getQualifiedName();
try {
Class<? extends Annotation> annotationClazz =
Class.forName(qualifiedAnnotationType.toString()).asSubclass(Annotation.class);
builder.put(
(Class) annotationClazz,
AnnotationProxyMaker.generateAnnotation(compound, annotationClazz));
} catch (ClassNotFoundException e) {
throw new IllegalArgumentException("Unrecognized annotation type", e);
}
}
return builder.build();
}
开发者ID:google,项目名称:error-prone,代码行数:19,代码来源:UTemplater.java
示例3: getAnnotation
import com.sun.tools.javac.model.AnnotationProxyMaker; //导入依赖的package包/类
public <A extends Annotation> A getAnnotation(Class<A> annoType) {
if (!annoType.isAnnotation())
throw new IllegalArgumentException("Not an annotation type: " + annoType);
Attribute.Compound c = getAttribute(annoType);
return c == null ? null : AnnotationProxyMaker.generateAnnotation(c, annoType);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:AnnoConstruct.java
示例4: getAnnotation
import com.sun.tools.javac.model.AnnotationProxyMaker; //导入依赖的package包/类
@DefinedBy(Api.LANGUAGE_MODEL)
public <A extends Annotation> A getAnnotation(Class<A> annoType) {
if (!annoType.isAnnotation())
throw new IllegalArgumentException("Not an annotation type: " + annoType);
Attribute.Compound c = getAttribute(annoType);
return c == null ? null : AnnotationProxyMaker.generateAnnotation(c, annoType);
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:10,代码来源:AnnoConstruct.java
注:本文中的com.sun.tools.javac.model.AnnotationProxyMaker类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论