@Override public void visit(int version, int a, String n, String sig, String s, String[] i) { myTakeIntoAccount = notPrivate(a); myAccess = a; myName = myContext.get(n); mySignature = sig; mySuperClass = s; myInterfaces = i; myClassNameHolder.set(n); if (mySuperClass != null) { final int superclassName = myContext.get(mySuperClass); myUsages.add(UsageRepr.createClassUsage(myContext, superclassName)); myUsages.add(UsageRepr.createClassExtendsUsage(myContext, superclassName)); } if (myInterfaces != null) { for (String it : myInterfaces) { final int interfaceName = myContext.get(it); myUsages.add(UsageRepr.createClassUsage(myContext, interfaceName)); myUsages.add(UsageRepr.createClassExtendsUsage(myContext, interfaceName)); } } processSignature(sig); }
public void visitEnum(String name, String desc, String value) { final int methodName = myContext.get(name); final String methodDescr = "()" + desc; myUsages.add( UsageRepr.createMethodUsage(myContext, methodName, myType.myClassName, methodDescr)); myUsages.add( UsageRepr.createMetaMethodUsage( myContext, methodName, myType.myClassName, methodDescr)); myUsedArguments.add(methodName); }
@Override public void visitEnd() { for (Map.Entry<TypeRepr.ClassType, Set<ElemType>> entry : myAnnotationTargets.entrySet()) { final TypeRepr.ClassType type = entry.getKey(); final Set<ElemType> targets = entry.getValue(); final TIntHashSet usedArguments = myAnnotationArguments.get(type); myUsages.add(UsageRepr.createAnnotationUsage(myContext, type, usedArguments, targets)); } }
public void visit(String name, Object value) { final String methodDescr = getMethodDescr(value); final int methodName = myContext.get(name); if (value instanceof Type) { final String className = ((Type) value).getClassName().replace('.', '/'); if (className != null) { myUsages.add(UsageRepr.createClassUsage(myContext, myContext.get(className))); } } myUsages.add( UsageRepr.createMethodUsage(myContext, methodName, myType.myClassName, methodDescr)); myUsages.add( UsageRepr.createMetaMethodUsage( myContext, methodName, myType.myClassName, methodDescr)); myUsedArguments.add(methodName); }
private AnnotationCrawler(final TypeRepr.ClassType type, final ElemType target) { super(Opcodes.ASM4); this.myType = type; this.myTarget = target; final Set<ElemType> targets = myAnnotationTargets.get(type); if (targets == null) { myAnnotationTargets.put(type, EnumSet.of(target)); } else { targets.add(target); } myUsages.add(UsageRepr.createClassUsage(myContext, type.myClassName)); }
public void visitClassType(String name) { myUsages.add(UsageRepr.createClassUsage(myContext, myContext.get(name))); }