public class TargetClassInfoReader extends EmptyClassVisitor implements ClassInfo
Modifier and Type | Field and Description |
---|---|
protected java.util.Set<java.lang.String> |
allMethodSignatures |
protected AnnotationInfo[] |
annotations |
protected java.util.List<AnnotationInfo> |
classAnnotations |
protected java.lang.ClassLoader |
classLoader |
protected java.util.Map<java.lang.String,java.lang.String> |
generics |
protected boolean |
isTargetInterface |
protected java.util.Map<java.lang.String,MethodSignatureVisitor> |
methodSignatures |
protected java.util.Set<java.lang.String> |
nextInterfaces |
protected java.lang.String |
nextSupername |
protected java.lang.String[] |
superClasses |
protected java.util.List<ClassReader> |
superClassReaders |
protected java.lang.String |
superName |
protected java.lang.String |
targetClassname |
protected java.lang.String |
targetPackage |
protected java.lang.String |
thisReference |
api, cv
Constructor and Description |
---|
TargetClassInfoReader(java.lang.ClassLoader classLoader) |
Modifier and Type | Method and Description |
---|---|
protected MethodSignatureVisitor |
createMethodSignature(int access,
java.lang.String methodName,
java.lang.String description,
java.lang.String signature,
java.lang.String[] exceptions,
java.lang.String classname,
java.util.Map<java.lang.String,java.lang.String> declaredTypeGenerics)
Creates method signature from method name.
|
AnnotationInfo[] |
getAnnotations()
Returns annotation information or
null if target class has no annotations. |
java.lang.String |
getClassname()
Returns simple class name.
|
java.lang.String |
getPackage()
Returns package name.
|
java.lang.String |
getReference()
Returns class reference.
|
java.lang.String[] |
getSuperClasses()
Returns array of super classes.
|
java.lang.String |
getSuperName()
Returns super class reference.
|
MethodSignatureVisitor |
lookupMethodSignatureVisitor(int access,
java.lang.String name,
java.lang.String desc,
java.lang.String className)
Returns method signature for some method.
|
java.lang.String |
toString() |
void |
visit(int version,
int access,
java.lang.String name,
java.lang.String signature,
java.lang.String superName,
java.lang.String[] interfaces)
Visits the header of the class.
|
AnnotationVisitor |
visitAnnotation(java.lang.String desc,
boolean visible)
Visits an annotation of the class.
|
void |
visitEnd()
Stores signatures for all super public methods not already overridden by target class.
|
MethodVisitor |
visitMethod(int access,
java.lang.String name,
java.lang.String desc,
java.lang.String signature,
java.lang.String[] exceptions)
Stores method signature for target method.
|
visitAttribute, visitField, visitInnerClass, visitModule, visitNestHost, visitNestMember, visitOuterClass, visitSource, visitTypeAnnotation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getAnnotation, hasAnnotation
protected final java.util.Map<java.lang.String,MethodSignatureVisitor> methodSignatures
protected final java.util.List<ClassReader> superClassReaders
protected final java.util.Set<java.lang.String> allMethodSignatures
protected final java.lang.ClassLoader classLoader
protected java.lang.String targetPackage
protected java.lang.String targetClassname
protected java.lang.String superName
protected java.lang.String thisReference
protected java.lang.String nextSupername
protected java.lang.String[] superClasses
protected AnnotationInfo[] annotations
protected java.util.List<AnnotationInfo> classAnnotations
protected boolean isTargetInterface
protected java.util.Set<java.lang.String> nextInterfaces
protected java.util.Map<java.lang.String,java.lang.String> generics
public TargetClassInfoReader(java.lang.ClassLoader classLoader)
public MethodSignatureVisitor lookupMethodSignatureVisitor(int access, java.lang.String name, java.lang.String desc, java.lang.String className)
null
.
Founded signatures means that those method can be proxyfied.public java.lang.String getPackage()
ClassInfo
getPackage
in interface ClassInfo
public java.lang.String getClassname()
ClassInfo
getClassname
in interface ClassInfo
public java.lang.String getSuperName()
ClassInfo
getSuperName
in interface ClassInfo
public java.lang.String getReference()
ClassInfo
getReference
in interface ClassInfo
public java.lang.String[] getSuperClasses()
ClassInfo
getSuperClasses
in interface ClassInfo
public AnnotationInfo[] getAnnotations()
ClassInfo
null
if target class has no annotations.getAnnotations
in interface ClassInfo
public void visit(int version, int access, java.lang.String name, java.lang.String signature, java.lang.String superName, java.lang.String[] interfaces)
ClassVisitor
visit
in class ClassVisitor
version
- the class version. The minor version is stored in the 16 most significant bits,
and the major version in the 16 least significant bits.access
- the class's access flags (see Opcodes
). This parameter also indicates if
the class is deprecated.name
- the internal name of the class (see Type.getInternalName()
).signature
- the signature of this class. May be null if the class is not a
generic one, and does not extend or implement generic classes or interfaces.superName
- the internal of name of the super class (see Type.getInternalName()
).
For interfaces, the super class is Object
. May be null, but only for the
Object
class.interfaces
- the internal names of the class's interfaces (see Type.getInternalName()
). May be null.public AnnotationVisitor visitAnnotation(java.lang.String desc, boolean visible)
ClassVisitor
visitAnnotation
in class ClassVisitor
desc
- the class descriptor of the annotation class.visible
- true if the annotation is visible at runtime.public MethodVisitor visitMethod(int access, java.lang.String name, java.lang.String desc, java.lang.String signature, java.lang.String[] exceptions)
visitMethod
in class ClassVisitor
access
- the method's access flags (see Opcodes
). This parameter also indicates if
the method is synthetic and/or deprecated.name
- the method's name.desc
- the method's descriptor (see Type
).signature
- the method's signature. May be null if the method parameters,
return type and exceptions do not use generic types.exceptions
- the internal names of the method's exception classes (see Type.getInternalName()
). May be null.public void visitEnd()
visitEnd
in class ClassVisitor
protected MethodSignatureVisitor createMethodSignature(int access, java.lang.String methodName, java.lang.String description, java.lang.String signature, java.lang.String[] exceptions, java.lang.String classname, java.util.Map<java.lang.String,java.lang.String> declaredTypeGenerics)
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2003-present Jodd Team