當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。