jodd.proxetta.asm
Class MethodSignatureVisitor

java.lang.Object
  extended by jodd.asm.TraceSignatureVisitor
      extended by jodd.proxetta.asm.MethodSignatureVisitor
All Implemented Interfaces:
AsmConsts, MethodInfo, org.objectweb.asm.signature.SignatureVisitor

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 Summary
protected  int access
           
protected  AnnotationInfo[] annotations
           
protected  int argumentsCount
           
protected  jodd.util.collection.IntArrayList argumentsOffset
           
protected  jodd.util.collection.IntArrayList argumentsOpcodeType
           
protected  java.util.List<java.lang.String> argumentsTypeNames
           
protected  int argumentsWords
           
protected  java.lang.String classname
           
protected  java.lang.String declaredClassName
           
protected  java.lang.String description
           
protected  int hierarchyLevel
           
protected  java.lang.String methodName
           
protected  jodd.mutable.MutableInteger returnOpcodeType
           
protected  java.lang.StringBuilder returnTypeName
           
protected  java.lang.String signature
           
protected  ClassInfo targetClassInfo
           
protected  boolean visitingArgument
           
 
Fields inherited from class jodd.asm.TraceSignatureVisitor
argumentStack, arrayStack, declaration, exceptions, isInterface, returnType, seenFormalParameter, seenInterface, seenInterfaceBound, seenParameter, separator
 
Fields inherited from interface jodd.proxetta.AsmConsts
ACC_ABSTRACT, ACC_ANNOTATION, ACC_BRIDGE, ACC_ENUM, ACC_FINAL, ACC_INTERFACE, ACC_NATIVE, ACC_PRIVATE, ACC_PROTECTED, ACC_PUBLIC, ACC_STATIC, ACC_STRICT, ACC_SUPER, ACC_SYNCHRONIZED, ACC_SYNTHETIC, ACC_TRANSIENT, ACC_VARARGS, ACC_VOLATILE, TYPE_ANNOTATION, TYPE_ARRAY, TYPE_BOOLEAN, TYPE_BYTE, TYPE_CHAR, TYPE_CLASS, TYPE_DOUBLE, TYPE_ENUM, TYPE_FLOAT, TYPE_INT, TYPE_LONG, TYPE_REFERENCE, TYPE_SHORT, TYPE_STRING, TYPE_VOID
 
Fields inherited from interface org.objectweb.asm.signature.SignatureVisitor
EXTENDS, INSTANCEOF, SUPER
 
Constructor Summary
MethodSignatureVisitor(java.lang.String description)
           
MethodSignatureVisitor(java.lang.String methodName, int access, java.lang.String classname, java.lang.String description, ClassInfo targetClassInfo)
           
 
Method Summary
 int getAccessFlags()
           
protected  int getAllArgumentsSize()
           
 AnnotationInfo[] getAnnotations()
          Returns annotation infos, if there is any.
protected  int getArgumentOffset(int i)
           
 int getArgumentOpcodeType(int index)
           
 int getArgumentsCount()
          Returns number of method arguments.
protected  java.lang.String getArgumentTypeName(int i)
           
 ClassInfo getClassInfo()
          Returns target class informations.
 java.lang.String getClassname()
          Returns bytecode-like class name.
 java.lang.String getDeclaredClassName()
          Returns declared class name for inner methods or classname for top-level methods.
 java.lang.String getDescription()
          Returns bytecode-like method description.
 int getHierarchyLevel()
          Returns hierarchy level, starting from top class as 1.
 java.lang.String getMethodName()
          Returns method name.
 int getReturnOpcodeType()
           
protected  java.lang.String getReturnTypeName()
           
 java.lang.String getSignature()
          Returns signature.
 boolean isTopLevelMethod()
          Returns true if method is declared in top-level class.
 void setDeclaredClassName(java.lang.String declaredClassName)
           
 java.lang.String toString()
           
 org.objectweb.asm.signature.SignatureVisitor visitArrayType()
          Visits a signature corresponding to an array type.
 void visitBaseType(char descriptor)
           
 void visitClassType(java.lang.String name)
          Starts the visit of a signature corresponding to a class or interface type.
 org.objectweb.asm.signature.SignatureVisitor visitExceptionType()
           
 org.objectweb.asm.signature.SignatureVisitor visitParameterType()
           
 org.objectweb.asm.signature.SignatureVisitor visitReturnType()
           
 void visitTypeVariable(java.lang.String name)
          Visits a signature corresponding to a type variable.
 
Methods inherited from class jodd.asm.TraceSignatureVisitor
getDeclaration, getExceptions, getReturnType, visitClassBound, visitEnd, visitFormalTypeParameter, visitInnerClassType, visitInterface, visitInterfaceBound, visitSuperclass, visitTypeArgument, visitTypeArgument
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jodd.proxetta.MethodInfo
getDeclaration, getExceptions, getReturnType
 

Field Detail

access

protected int access

methodName

protected java.lang.String methodName

signature

protected java.lang.String signature

argumentsCount

protected int argumentsCount

argumentsWords

protected int argumentsWords

returnOpcodeType

protected jodd.mutable.MutableInteger returnOpcodeType

returnTypeName

protected java.lang.StringBuilder returnTypeName

classname

protected java.lang.String classname

description

protected java.lang.String description

annotations

protected AnnotationInfo[] annotations

visitingArgument

protected boolean visitingArgument

argumentsOpcodeType

protected jodd.util.collection.IntArrayList argumentsOpcodeType

argumentsOffset

protected jodd.util.collection.IntArrayList argumentsOffset

argumentsTypeNames

protected java.util.List<java.lang.String> argumentsTypeNames

declaredClassName

protected java.lang.String declaredClassName

targetClassInfo

protected ClassInfo targetClassInfo

hierarchyLevel

protected int hierarchyLevel
Constructor Detail

MethodSignatureVisitor

public MethodSignatureVisitor(java.lang.String description)

MethodSignatureVisitor

public MethodSignatureVisitor(java.lang.String methodName,
                              int access,
                              java.lang.String classname,
                              java.lang.String description,
                              ClassInfo targetClassInfo)
Method Detail

visitParameterType

public org.objectweb.asm.signature.SignatureVisitor visitParameterType()
Specified by:
visitParameterType in interface org.objectweb.asm.signature.SignatureVisitor
Overrides:
visitParameterType in class TraceSignatureVisitor

visitReturnType

public org.objectweb.asm.signature.SignatureVisitor visitReturnType()
Specified by:
visitReturnType in interface org.objectweb.asm.signature.SignatureVisitor
Overrides:
visitReturnType in class TraceSignatureVisitor

visitExceptionType

public org.objectweb.asm.signature.SignatureVisitor visitExceptionType()
Specified by:
visitExceptionType in interface org.objectweb.asm.signature.SignatureVisitor
Overrides:
visitExceptionType in class TraceSignatureVisitor

visitBaseType

public void visitBaseType(char descriptor)
Specified by:
visitBaseType in interface org.objectweb.asm.signature.SignatureVisitor
Overrides:
visitBaseType in class TraceSignatureVisitor

visitTypeVariable

public void visitTypeVariable(java.lang.String name)
Visits a signature corresponding to a type variable.

Specified by:
visitTypeVariable in interface org.objectweb.asm.signature.SignatureVisitor
Overrides:
visitTypeVariable in class TraceSignatureVisitor

visitArrayType

public org.objectweb.asm.signature.SignatureVisitor visitArrayType()
Visits a signature corresponding to an array type.

Specified by:
visitArrayType in interface org.objectweb.asm.signature.SignatureVisitor
Overrides:
visitArrayType in class TraceSignatureVisitor

visitClassType

public void visitClassType(java.lang.String name)
Starts the visit of a signature corresponding to a class or interface type.

Specified by:
visitClassType in interface org.objectweb.asm.signature.SignatureVisitor
Overrides:
visitClassType in class TraceSignatureVisitor

getSignature

public java.lang.String getSignature()
Returns signature.

Specified by:
getSignature in interface MethodInfo

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 number of method arguments.

Specified by:
getArgumentsCount in interface MethodInfo

getArgumentOpcodeType

public int getArgumentOpcodeType(int index)
Specified by:
getArgumentOpcodeType in interface MethodInfo
Parameters:
index - 1-base index

getArgumentTypeName

protected java.lang.String getArgumentTypeName(int i)

getArgumentOffset

protected int getArgumentOffset(int i)

getAllArgumentsSize

protected int getAllArgumentsSize()

getReturnOpcodeType

public int getReturnOpcodeType()
Specified by:
getReturnOpcodeType in interface MethodInfo

getReturnTypeName

protected java.lang.String getReturnTypeName()

getAccessFlags

public int getAccessFlags()
Specified by:
getAccessFlags in interface MethodInfo

getClassname

public java.lang.String getClassname()
Description copied from interface: MethodInfo
Returns bytecode-like class name.

Specified by:
getClassname in interface MethodInfo

getDescription

public java.lang.String getDescription()
Description copied from interface: MethodInfo
Returns bytecode-like method description.

Specified by:
getDescription in interface MethodInfo

getAnnotations

public AnnotationInfo[] getAnnotations()
Description copied from interface: MethodInfo
Returns annotation infos, if there is any.

Specified by:
getAnnotations 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

getClassInfo

public ClassInfo getClassInfo()
Description copied from interface: MethodInfo
Returns target class informations.

Specified by:
getClassInfo in interface MethodInfo

getHierarchyLevel

public int getHierarchyLevel()
Description copied from interface: MethodInfo
Returns hierarchy level, starting from top class as 1.

Specified by:
getHierarchyLevel in interface MethodInfo

toString

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


Copyright © 2003-2011 Jodd Team