Package jodd.proxetta.asm
Class MethodSignatureVisitor
- java.lang.Object
-
- jodd.asm9.signature.SignatureVisitor
-
- jodd.asm.TraceSignatureVisitor
-
- jodd.proxetta.asm.MethodSignatureVisitor
-
- All Implemented Interfaces:
MethodInfo
public class MethodSignatureVisitor extends TraceSignatureVisitor implements MethodInfo
Resolves method signature and holds all information. UsesTraceSignatureVisitorfrom ASM library.MethodSignature = ( visitFormalTypeParameter visitClassBound? visitInterfaceBound* )* ( visitParameterType* visitReturnType visitExceptionType* )
-
-
Field Summary
Fields Modifier and Type Field Description protected intaccessprotected AnnotationInfo[]annotationsprotected java.util.List<TypeInfoImpl>argumentsprotected intargumentsCountprotected java.util.List<java.lang.Integer>argumentsOffsetprotected intargumentsWordsprotected java.lang.StringasmMethodSignatureprotected java.lang.Stringclassnameprotected java.lang.StringdeclaredClassNameprotected java.util.Map<java.lang.String,java.lang.String>declaredTypeGenericprotected java.lang.Stringdescriptionprotected java.lang.String[]exceptionsArrayprotected java.util.Map<java.lang.String,java.lang.String>genericsprotected booleanisFinalprotected booleanisStaticprotected java.lang.StringmethodNameprotected TypeInforeturnTypeprotected java.lang.Stringsignatureprotected ClassInfotargetClassInfo-
Fields inherited from class jodd.asm.TraceSignatureVisitor
argumentStack, declaration, isInterface
-
Fields inherited from class jodd.asm9.signature.SignatureVisitor
api, EXTENDS, INSTANCEOF, SUPER
-
-
Constructor Summary
Constructors Constructor Description MethodSignatureVisitor(java.lang.String methodName, int access, java.lang.String classname, java.lang.String description, java.lang.String[] exceptions, java.lang.String signature, java.util.Map<java.lang.String,java.lang.String> declaredTypeGenerics, ClassInfo targetClassInfo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidendType()intgetAccessFlags()Returns methods access flags.intgetAllArgumentsSize()Returns the size of all arguments on stack.AnnotationInfo[]getAnnotations()Returns annotation information, if there is any.TypeInfoImplgetArgument(int ndx)Returns methods argument (1-indexed).intgetArgumentOffset(int index)Returns bytecode offset of an argument in local variables.intgetArgumentsCount()Returns the number of methods arguments.java.lang.StringgetAsmMethodSignature()ClassInfogetClassInfo()Returns targetclass informations.java.lang.StringgetClassname()Returns bytecode-like class name, where packages are separated by a slash.java.lang.StringgetCleanSignature()Returns a "clean" signature, that is ready for the comparison.java.lang.StringgetDeclaredClassName()Returns declared class name for inner methods orclassnamefor top-level methods.java.lang.StringgetDescription()Returns bytecode-like method description.java.lang.String[]getExceptions()Returns array of exceptions ornullif no exception is declared.java.lang.StringgetMethodName()Returns method name.TypeInfogetReturnType()Returns returntype information.java.lang.StringgetSignature()Returns java-like method signature ofdescription.booleanisTopLevelMethod()Returnstrueif method is declared in top-level class.voidsetDeclaredClassName(java.lang.String declaredClassName)protected voidstartType()java.lang.StringtoString()SignatureVisitorvisitArrayType()Visits a signature corresponding to an array type.voidvisitBaseType(char descriptor)Visits a signature corresponding to a primitive type.voidvisitClassType(java.lang.String name)Starts the visit of a signature corresponding to a class or interface type.SignatureVisitorvisitParameterType()Visits the type of a method parameter.SignatureVisitorvisitReturnType()Visits the return type of the method.-
Methods inherited from class jodd.asm.TraceSignatureVisitor
getDeclaration, visitClassBound, visitEnd, visitExceptionType, visitFormalTypeParameter, visitInnerClassType, visitInterface, visitInterfaceBound, visitSuperclass, visitTypeArgument, visitTypeArgument, visitTypeVariable
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jodd.proxetta.MethodInfo
getAnnotation, getDeclaration, getExceptionsAsString, hasAnnotation, hasNoArguments, hasNoReturnValue, hasOneArgument, hasReturnValue, isPrivateMethod, isPublicMethod, isRootMethod, matchClassName, matchMethodName
-
-
-
-
Field Detail
-
classname
protected final java.lang.String classname
-
methodName
protected final java.lang.String methodName
-
exceptionsArray
protected final java.lang.String[] exceptionsArray
-
isStatic
protected final boolean isStatic
-
isFinal
protected final boolean isFinal
-
targetClassInfo
protected final ClassInfo targetClassInfo
-
argumentsOffset
protected final java.util.List<java.lang.Integer> argumentsOffset
-
arguments
protected final java.util.List<TypeInfoImpl> arguments
-
access
protected final int access
-
description
protected final java.lang.String description
-
returnType
protected TypeInfo returnType
-
signature
protected java.lang.String signature
-
argumentsCount
protected int argumentsCount
-
argumentsWords
protected int argumentsWords
-
asmMethodSignature
protected java.lang.String asmMethodSignature
-
annotations
protected AnnotationInfo[] annotations
-
declaredClassName
protected java.lang.String declaredClassName
-
generics
protected final java.util.Map<java.lang.String,java.lang.String> generics
-
declaredTypeGeneric
protected final java.util.Map<java.lang.String,java.lang.String> declaredTypeGeneric
-
-
Constructor Detail
-
MethodSignatureVisitor
public MethodSignatureVisitor(java.lang.String methodName, int access, java.lang.String classname, java.lang.String description, java.lang.String[] exceptions, java.lang.String signature, java.util.Map<java.lang.String,java.lang.String> declaredTypeGenerics, ClassInfo targetClassInfo)
-
-
Method Detail
-
getSignature
public java.lang.String getSignature()
Description copied from interface:MethodInfoReturns java-like method signature ofdescription. Does not contain any generic information.- Specified by:
getSignaturein interfaceMethodInfo
-
getCleanSignature
public java.lang.String getCleanSignature()
Description copied from interface:MethodInfoReturns a "clean" signature, that is ready for the comparison. It does not have any generics information.- Specified by:
getCleanSignaturein interfaceMethodInfo
-
getAsmMethodSignature
public java.lang.String getAsmMethodSignature()
-
getMethodName
public java.lang.String getMethodName()
Description copied from interface:MethodInfoReturns method name.- Specified by:
getMethodNamein interfaceMethodInfo
-
getArgumentsCount
public int getArgumentsCount()
Description copied from interface:MethodInfoReturns the number of methods arguments.- Specified by:
getArgumentsCountin interfaceMethodInfo
-
getArgument
public TypeInfoImpl getArgument(int ndx)
Description copied from interface:MethodInfoReturns methods argument (1-indexed).- Specified by:
getArgumentin interfaceMethodInfo
-
getArgumentOffset
public int getArgumentOffset(int index)
Description copied from interface:MethodInfoReturns bytecode offset of an argument in local variables.- Specified by:
getArgumentOffsetin interfaceMethodInfo
-
getAllArgumentsSize
public int getAllArgumentsSize()
Description copied from interface:MethodInfoReturns the size of all arguments on stack. It is not equal to argument count, because some types takes 2 places, likelong.- Specified by:
getAllArgumentsSizein interfaceMethodInfo
-
getReturnType
public TypeInfo getReturnType()
Description copied from interface:MethodInfoReturns returntype information.- Specified by:
getReturnTypein interfaceMethodInfo
-
getAccessFlags
public int getAccessFlags()
Description copied from interface:MethodInfoReturns methods access flags.- Specified by:
getAccessFlagsin interfaceMethodInfo
-
getClassname
public java.lang.String getClassname()
Description copied from interface:MethodInfoReturns bytecode-like class name, where packages are separated by a slash. For example:org/jodd/Jodd- Specified by:
getClassnamein interfaceMethodInfo
-
getDescription
public java.lang.String getDescription()
Description copied from interface:MethodInfoReturns bytecode-like method description.- Specified by:
getDescriptionin interfaceMethodInfo- See Also:
MethodInfo.getSignature()
-
getAnnotations
public AnnotationInfo[] getAnnotations()
Description copied from interface:MethodInfoReturns annotation information, if there is any.- Specified by:
getAnnotationsin interfaceMethodInfo
-
getDeclaredClassName
public java.lang.String getDeclaredClassName()
Description copied from interface:MethodInfoReturns declared class name for inner methods orclassnamefor top-level methods.- Specified by:
getDeclaredClassNamein interfaceMethodInfo
-
setDeclaredClassName
public void setDeclaredClassName(java.lang.String declaredClassName)
-
isTopLevelMethod
public boolean isTopLevelMethod()
Description copied from interface:MethodInfoReturnstrueif method is declared in top-level class.- Specified by:
isTopLevelMethodin interfaceMethodInfo
-
getClassInfo
public ClassInfo getClassInfo()
Description copied from interface:MethodInfoReturns targetclass informations.- Specified by:
getClassInfoin interfaceMethodInfo
-
getExceptions
public java.lang.String[] getExceptions()
Description copied from interface:MethodInfoReturns array of exceptions ornullif no exception is declared.- Specified by:
getExceptionsin interfaceMethodInfo
-
visitParameterType
public SignatureVisitor visitParameterType()
Description copied from class:SignatureVisitorVisits the type of a method parameter.- Overrides:
visitParameterTypein classTraceSignatureVisitor- Returns:
- a non null visitor to visit the signature of the parameter type.
-
visitReturnType
public SignatureVisitor visitReturnType()
Description copied from class:SignatureVisitorVisits the return type of the method.- Overrides:
visitReturnTypein classTraceSignatureVisitor- Returns:
- a non null visitor to visit the signature of the return type.
-
visitArrayType
public SignatureVisitor visitArrayType()
Description copied from class:SignatureVisitorVisits a signature corresponding to an array type.- Overrides:
visitArrayTypein classTraceSignatureVisitor- Returns:
- a non null visitor to visit the signature of the array element type.
-
visitBaseType
public void visitBaseType(char descriptor)
Description copied from class:SignatureVisitorVisits a signature corresponding to a primitive type.- Overrides:
visitBaseTypein classTraceSignatureVisitor- Parameters:
descriptor- the descriptor of the primitive type, or 'V' forvoid.
-
visitClassType
public void visitClassType(java.lang.String name)
Description copied from class:SignatureVisitorStarts the visit of a signature corresponding to a class or interface type.- Overrides:
visitClassTypein classTraceSignatureVisitor- Parameters:
name- the internal name of the class or interface.
-
startType
protected void startType()
- Overrides:
startTypein classTraceSignatureVisitor
-
endType
protected void endType()
- Overrides:
endTypein classTraceSignatureVisitor
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-