Class MethodSignatureVisitor

  • All Implemented Interfaces:
    MethodInfo

    public class MethodSignatureVisitor
    extends TraceSignatureVisitor
    implements MethodInfo
    Resolves method signature and holds all information. Uses TraceSignatureVisitor from ASM library.
     MethodSignature = ( visitFormalTypeParameter visitClassBound? visitInterfaceBound* )* ( visitParameterType* visitReturnType visitExceptionType* )
     
    • 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
      • 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: MethodInfo
        Returns java-like method signature of description. Does not contain any generic information.
        Specified by:
        getSignature in interface MethodInfo
      • getCleanSignature

        public java.lang.String getCleanSignature()
        Description copied from interface: MethodInfo
        Returns a "clean" signature, that is ready for the comparison. It does not have any generics information.
        Specified by:
        getCleanSignature in interface MethodInfo
      • getAsmMethodSignature

        public java.lang.String getAsmMethodSignature()
      • getMethodName

        public java.lang.String getMethodName()
        Description copied from interface: MethodInfo
        Returns method name.
        Specified by:
        getMethodName in interface MethodInfo
      • getArgumentsCount

        public int getArgumentsCount()
        Description copied from interface: MethodInfo
        Returns the number of methods arguments.
        Specified by:
        getArgumentsCount in interface MethodInfo
      • getArgumentOffset

        public int getArgumentOffset​(int index)
        Description copied from interface: MethodInfo
        Returns bytecode offset of an argument in local variables.
        Specified by:
        getArgumentOffset in interface MethodInfo
      • getAllArgumentsSize

        public int getAllArgumentsSize()
        Description copied from interface: MethodInfo
        Returns the size of all arguments on stack. It is not equal to argument count, because some types takes 2 places, like long.
        Specified by:
        getAllArgumentsSize in interface MethodInfo
      • getAccessFlags

        public int getAccessFlags()
        Description copied from interface: MethodInfo
        Returns methods access flags.
        Specified by:
        getAccessFlags in interface MethodInfo
      • getClassname

        public java.lang.String getClassname()
        Description copied from interface: MethodInfo
        Returns bytecode-like class name, where packages are separated by a slash. For example: org/jodd/Jodd
        Specified by:
        getClassname in interface MethodInfo
      • getDeclaredClassName

        public java.lang.String getDeclaredClassName()
        Description copied from interface: MethodInfo
        Returns declared class name for inner methods or classname for top-level methods.
        Specified by:
        getDeclaredClassName in interface MethodInfo
      • setDeclaredClassName

        public void setDeclaredClassName​(java.lang.String declaredClassName)
      • isTopLevelMethod

        public boolean isTopLevelMethod()
        Description copied from interface: MethodInfo
        Returns true if method is declared in top-level class.
        Specified by:
        isTopLevelMethod in interface MethodInfo
      • getExceptions

        public java.lang.String[] getExceptions()
        Description copied from interface: MethodInfo
        Returns array of exceptions or null if no exception is declared.
        Specified by:
        getExceptions in interface MethodInfo
      • visitBaseType

        public void visitBaseType​(char descriptor)
        Description copied from class: SignatureVisitor
        Visits a signature corresponding to a primitive type.
        Overrides:
        visitBaseType in class TraceSignatureVisitor
        Parameters:
        descriptor - the descriptor of the primitive type, or 'V' for void .
      • visitClassType

        public void visitClassType​(java.lang.String name)
        Description copied from class: SignatureVisitor
        Starts the visit of a signature corresponding to a class or interface type.
        Overrides:
        visitClassType in class TraceSignatureVisitor
        Parameters:
        name - the internal name of the class or interface.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object