本文整理汇总了Java中act.asm.AnnotationVisitor类的典型用法代码示例。如果您正苦于以下问题:Java AnnotationVisitor类的具体用法?Java AnnotationVisitor怎么用?Java AnnotationVisitor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AnnotationVisitor类属于act.asm包,在下文中一共展示了AnnotationVisitor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visitAnnotation
import act.asm.AnnotationVisitor; //导入依赖的package包/类
@Override
public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
AnnotationVisitor av = super.visitAnnotation(desc, visible);
isEntity = DESC_ENTITY.equals(desc);
isMappedSuperClass = !isEntity && DESC_MAPPED_SUPERCLASS.endsWith(desc);
if (isEntity || isMappedSuperClass) {
repo.registerEntityOrMappedSuperClass(className);
if (isEntity) {
return new AnnotationVisitor(ASM5, av) {
@Override
public void visit(String name, Object value) {
if ("name".equals(name)) {
repo.registerEntityName(className, (String) value);
}
super.visit(name, value);
}
};
}
}
return av;
}
示例2: visitAnnotation
import act.asm.AnnotationVisitor; //导入依赖的package包/类
@Override
public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
AnnotationVisitor av = super.visitAnnotation(desc, visible);
if (found || skip) {
return av;
}
if (isExtendsAnnotation(desc)) {
Class<?> superType = filter.superType();
if (null != superType) {
return new ExtendedAnnotationVisitor(av, superType.getName());
} else {
return av;
}
}
Class<? extends Annotation> annoType = filter.annotationType();
if (null == annoType) {
return av;
}
if (isAnnotation(annoType, desc)) {
found = true;
}
return av;
}
示例3: addKeyField
import act.asm.AnnotationVisitor; //导入依赖的package包/类
private FieldVisitor addKeyField(String sobjField, boolean isCollection, DbHooker hooker, FieldVisitor fv) {
String fieldName = S.builder(sobjField).append("Key").toString();
String desc = isCollection ? "Ljava/util/Set;" : AsmTypes.STRING_DESC;
String signature = isCollection ? "Ljava/util/Set<Ljava/lang/String;>;" : null;
fv = null == fv ? cv.visitField(ACC_PRIVATE, fieldName, desc, signature, null) : fv;
AnnotationVisitor av = fv.visitAnnotation(Type.getType(hooker.transientAnnotationType()).getDescriptor(), true);
av.visitEnd();
return fv;
}
示例4: visitAnnotation
import act.asm.AnnotationVisitor; //导入依赖的package包/类
@Override
public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
if (!found) {
String className = Type.getType(desc).getClassName();
if (S.eq(TRANSFORMER, className)) {
found = true;
}
}
return super.visitAnnotation(desc, visible);
}
示例5: visitAnnotation
import act.asm.AnnotationVisitor; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
AnnotationVisitor av = super.visitAnnotation(desc, visible);
Type type = Type.getType(desc);
String className = type.getClassName();
try {
Class<? extends Annotation> c = (Class<? extends Annotation>)Class.forName(className);
if (JobClassMetaInfo.isActionAnnotation(c)) {
markRequireScan();
if (null == methodInfo) {
JobMethodMetaInfo tmp = new JobMethodMetaInfo(classInfo, paramTypes);
methodInfo = tmp;
classInfo.addAction(tmp);
this.aav = new ActionAnnotationVisitor(av, c, methodInfo);
} else {
this.aav.add(c);
}
return this.aav;
} else if (Env.isEnvAnnotation(c)) {
this.eav = new EnvAnnotationVisitor(av, c);
return this.eav;
}
} catch (Exception e) {
throw E.unexpected(e);
}
//markNotTargetClass();
return av;
}
示例6: visitAnnotation
import act.asm.AnnotationVisitor; //导入依赖的package包/类
@Override
public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
AnnotationVisitor av = super.visitAnnotation(desc, visible);
if (desc.startsWith("Lact/sys/Env$")) {
return new EnvAnnotationVisitor(av, desc);
}
return av;
}
示例7: visitAnnotation
import act.asm.AnnotationVisitor; //导入依赖的package包/类
@Override
public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
if (isModel) {
Type type = Type.getType(desc);
for (DbService dbService : dbm().registeredServices()) {
if (type.equals(Type.getType(dbService.entityAnnotationType()))) {
isEntityClass = true;
}
}
}
return super.visitAnnotation(desc, visible);
}
示例8: visitAnnotation
import act.asm.AnnotationVisitor; //导入依赖的package包/类
@Override
public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
Type type = Type.getType(desc);
if (Singleton.class.getName().equals(type.getClassName())) {
shouldAddAnnotation = false;
shouldEnhance = true;
}
return super.visitAnnotation(desc, visible);
}
示例9: addAnnotation
import act.asm.AnnotationVisitor; //导入依赖的package包/类
private void addAnnotation() {
AnnotationVisitor av = visitAnnotation(Type.getType(MappedSuperclass.class).getDescriptor(), true);
av.visitEnd();
}
示例10: ActionAnnotationVisitor
import act.asm.AnnotationVisitor; //导入依赖的package包/类
public ActionAnnotationVisitor(AnnotationVisitor av, Class<? extends Annotation> c, JobMethodMetaInfo methodMetaInfo) {
super(ASM5, av);
this.method = methodMetaInfo;
this.add(c);
}
示例11: EnvAnnotationVisitor
import act.asm.AnnotationVisitor; //导入依赖的package包/类
public EnvAnnotationVisitor(AnnotationVisitor av, String desc) {
super(ASM5, av);
initType(desc);
}
示例12: EnvAnnotationVisitor
import act.asm.AnnotationVisitor; //导入依赖的package包/类
public EnvAnnotationVisitor(AnnotationVisitor annotationVisitor, Class<? extends Annotation> c) {
super(ASM5, annotationVisitor);
this.type = c;
}
示例13: visitAnnotation
import act.asm.AnnotationVisitor; //导入依赖的package包/类
@Override
public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
String annotationType = Type.getType(desc).getClassName();
me.annotatedWith(annotationType);
return super.visitAnnotation(desc, visible);
}
示例14: ExtendedAnnotationVisitor
import act.asm.AnnotationVisitor; //导入依赖的package包/类
public ExtendedAnnotationVisitor(AnnotationVisitor av, String expected) {
super(ASM5, av);
this.expected = expected;
}
示例15: addAnnotationIfNeeded
import act.asm.AnnotationVisitor; //导入依赖的package包/类
private void addAnnotationIfNeeded() {
if (shouldAddAnnotation) {
AnnotationVisitor av = super.visitAnnotation(Type.getType(Singleton.class).getDescriptor(), true);
av.visitEnd();
}
}