@Test public void fqn() { String asmInternal = "com/test/Example"; String fqn = AsmUtil.getFqn(asmInternal); assertThat(fqn, is("com.test.Example")); }
@Test public void defaultPackage() { String asmInternal = "Example"; String fqn = AsmUtil.getFqn(asmInternal); assertThat(fqn, is("Example")); } }
this.type = new AnnotationType(AsmUtil.getFqn(name), hash, modifiers); } else if ((Opcodes.ACC_INTERFACE & access) > 0) { InterfaceType interfaceType = new InterfaceType(AsmUtil.getFqn(name), hash, modifiers); interfaceType.addSuperInterface(new InterfaceType(AsmUtil.getFqn(interfaceName))); } else { ClassType classType = new ClassType(AsmUtil.getFqn(name), hash, modifiers); ClassType superClassType = new ClassType(AsmUtil.getFqn(superName)); classType.addSuperClass(superClassType); classType.addInterface(new InterfaceType(AsmUtil.getFqn(interfaceName)));
/** * {@inheritDoc} */ @Override public AnnotationVisitor visitAnnotation(String desc, boolean visible) { // calling super to ensure the visitor pattern AnnotationVisitor annotationVisitor = super.visitAnnotation(desc, visible); // if we don't have correct type return if (!(type instanceof TypeWithAnnotations)) { LOG.error("Annotation visit failed as the analyzed type " + type + " is not implementing the TypeWithAnnotations interface."); return annotationVisitor; } String internalName = Type.getType(desc).getInternalName(); ((TypeWithAnnotations) type).addAnnotation(new AnnotationType(AsmUtil.getFqn(internalName))); return annotationVisitor; }
/** * {@inheritDoc} */ @Override public AnnotationVisitor visitAnnotation(String desc, boolean visible) { // calling super to ensure the visitor pattern AnnotationVisitor annotationVisitor = super.visitAnnotation(desc, visible); if (null == methodType) { return annotationVisitor; } String internalName = Type.getType(desc).getInternalName(); methodType.addAnnotation(new AnnotationType(AsmUtil.getFqn(internalName))); return annotationVisitor; }
methodType.addException(new ClassType(AsmUtil.getFqn(exceptionName)));