当前位置: 首页>>代码示例>>Java>>正文


Java AnnotationVisitor类代码示例

本文整理汇总了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;
}
 
开发者ID:actframework,项目名称:actframework,代码行数:22,代码来源:EntityInfoByteCodeScanner.java

示例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;
}
 
开发者ID:actframework,项目名称:actframework,代码行数:24,代码来源:ClassDetector.java

示例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;
}
 
开发者ID:actframework,项目名称:act-storage,代码行数:10,代码来源:EntityClassEnhancer.java

示例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);
}
 
开发者ID:actframework,项目名称:actframework,代码行数:11,代码来源:RythmTransformerScanner.java

示例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;
}
 
开发者ID:actframework,项目名称:actframework,代码行数:30,代码来源:JobByteCodeScanner.java

示例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;
}
 
开发者ID:actframework,项目名称:actframework,代码行数:9,代码来源:EnvMatcher.java

示例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);
}
 
开发者ID:actframework,项目名称:actframework,代码行数:13,代码来源:EntityClassEnhancer.java

示例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);
}
 
开发者ID:actframework,项目名称:actframework,代码行数:10,代码来源:SingletonEnhancer.java

示例9: addAnnotation

import act.asm.AnnotationVisitor; //导入依赖的package包/类
private void addAnnotation() {
    AnnotationVisitor av = visitAnnotation(Type.getType(MappedSuperclass.class).getDescriptor(), true);
    av.visitEnd();
}
 
开发者ID:actframework,项目名称:act-ebean,代码行数:5,代码来源:ModelBaseEnhancer.java

示例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);
}
 
开发者ID:actframework,项目名称:actframework,代码行数:6,代码来源:JobByteCodeScanner.java

示例11: EnvAnnotationVisitor

import act.asm.AnnotationVisitor; //导入依赖的package包/类
public EnvAnnotationVisitor(AnnotationVisitor av, String desc) {
    super(ASM5, av);
    initType(desc);
}
 
开发者ID:actframework,项目名称:actframework,代码行数:5,代码来源:EnvMatcher.java

示例12: EnvAnnotationVisitor

import act.asm.AnnotationVisitor; //导入依赖的package包/类
public EnvAnnotationVisitor(AnnotationVisitor annotationVisitor, Class<? extends Annotation> c) {
    super(ASM5, annotationVisitor);
    this.type = c;
}
 
开发者ID:actframework,项目名称:actframework,代码行数:5,代码来源:EnvAnnotationVisitor.java

示例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);
}
 
开发者ID:actframework,项目名称:actframework,代码行数:7,代码来源:ClassInfoByteCodeScanner.java

示例14: ExtendedAnnotationVisitor

import act.asm.AnnotationVisitor; //导入依赖的package包/类
public ExtendedAnnotationVisitor(AnnotationVisitor av, String expected) {
    super(ASM5, av);
    this.expected = expected;
}
 
开发者ID:actframework,项目名称:actframework,代码行数:5,代码来源:ClassDetector.java

示例15: addAnnotationIfNeeded

import act.asm.AnnotationVisitor; //导入依赖的package包/类
private void addAnnotationIfNeeded() {
    if (shouldAddAnnotation) {
        AnnotationVisitor av = super.visitAnnotation(Type.getType(Singleton.class).getDescriptor(), true);
        av.visitEnd();
    }
}
 
开发者ID:actframework,项目名称:actframework,代码行数:7,代码来源:SingletonEnhancer.java


注:本文中的act.asm.AnnotationVisitor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。