Package jodd.proxetta
Interface MethodInfo
-
- All Known Implementing Classes:
MethodSignatureVisitor
public interface MethodInfoMethod info provides various information about a method. There are two types of information:- java-like, user-readable, that matches the java code, where, for example, packages in class names are separated with a dot;
- bytecode-related, where information is more suitable for bytecodes, where, for example, packages in class names are separated with a slash.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description intgetAccessFlags()Returns methods access flags.intgetAllArgumentsSize()Returns the size of all arguments on stack.default AnnotationInfogetAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> an)Returnstrueif method is annotated with provided annotation.AnnotationInfo[]getAnnotations()Returns annotation information, if there is any.TypeInfogetArgument(int index)Returns methods argument (1-indexed).intgetArgumentOffset(int index)Returns bytecode offset of an argument in local variables.intgetArgumentsCount()Returns the number of methods arguments.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.StringgetDeclaration()Returns full java-like declaration of method's arguments and return type.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.default java.lang.StringgetExceptionsAsString()Returns exceptions as a comma-seaprated string.java.lang.StringgetMethodName()Returns method name.TypeInfogetReturnType()Returns returntype information.java.lang.StringgetSignature()Returns java-like method signature ofdescription.default booleanhasAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation>... an)Returnstrueif method is annotated with one of provided annotation.default booleanhasNoArguments()Returnstrueif method has no argument.default booleanhasNoReturnValue()Returnstrueif method's return type isvoid.default booleanhasOneArgument()Returnstrueif method has only one argument.default booleanhasReturnValue()Returnstrueif method has a return type.default booleanisPrivateMethod()Returnstrueif method is private.default booleanisPublicMethod()Returnstrueif method is public.default booleanisRootMethod()Returnstrueif method is declared inObjectclass (root class).booleanisTopLevelMethod()Returnstrueif method is declared in top-level class.default booleanmatchClassName(java.lang.String wildcard)Match class name to providedWildcardpattern.default booleanmatchMethodName(java.lang.String wildcard)Match method name to providedWildcardpattern.
-
-
-
Method Detail
-
getDeclaration
java.lang.String getDeclaration()
Returns full java-like declaration of method's arguments and return type. For example:(long, java.lang.Integer)int.- See Also:
getSignature()
-
getReturnType
TypeInfo getReturnType()
Returns returntype information.
-
getExceptionsAsString
default java.lang.String getExceptionsAsString()
Returns exceptions as a comma-seaprated string.- See Also:
getExceptions()
-
getExceptions
java.lang.String[] getExceptions()
Returns array of exceptions ornullif no exception is declared.
-
getSignature
java.lang.String getSignature()
Returns java-like method signature ofdescription. Does not contain any generic information.
-
getCleanSignature
java.lang.String getCleanSignature()
Returns a "clean" signature, that is ready for the comparison. It does not have any generics information.
-
getMethodName
java.lang.String getMethodName()
Returns method name.
-
getArgumentsCount
int getArgumentsCount()
Returns the number of methods arguments.
-
getArgumentOffset
int getArgumentOffset(int index)
Returns bytecode offset of an argument in local variables.
-
getArgument
TypeInfo getArgument(int index)
Returns methods argument (1-indexed).
-
getAllArgumentsSize
int getAllArgumentsSize()
Returns the size of all arguments on stack. It is not equal to argument count, because some types takes 2 places, likelong.
-
getAccessFlags
int getAccessFlags()
Returns methods access flags.
-
getClassname
java.lang.String getClassname()
Returns bytecode-like class name, where packages are separated by a slash. For example:org/jodd/Jodd
-
getDescription
java.lang.String getDescription()
Returns bytecode-like method description.- See Also:
getSignature()
-
getAnnotations
AnnotationInfo[] getAnnotations()
Returns annotation information, if there is any.
-
getDeclaredClassName
java.lang.String getDeclaredClassName()
Returns declared class name for inner methods orclassnamefor top-level methods.
-
isTopLevelMethod
boolean isTopLevelMethod()
Returnstrueif method is declared in top-level class.
-
getClassInfo
ClassInfo getClassInfo()
Returns targetclass informations.
-
isPublicMethod
default boolean isPublicMethod()
Returnstrueif method is public.
-
isPrivateMethod
default boolean isPrivateMethod()
Returnstrueif method is private.
-
hasNoArguments
default boolean hasNoArguments()
Returnstrueif method has no argument.
-
hasOneArgument
default boolean hasOneArgument()
Returnstrueif method has only one argument.
-
isRootMethod
default boolean isRootMethod()
Returnstrueif method is declared inObjectclass (root class).
-
hasNoReturnValue
default boolean hasNoReturnValue()
Returnstrueif method's return type isvoid.
-
hasReturnValue
default boolean hasReturnValue()
Returnstrueif method has a return type.
-
matchMethodName
default boolean matchMethodName(java.lang.String wildcard)
Match method name to providedWildcardpattern.
-
matchClassName
default boolean matchClassName(java.lang.String wildcard)
Match class name to providedWildcardpattern.
-
hasAnnotation
default boolean hasAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation>... an)
Returnstrueif method is annotated with one of provided annotation.
-
getAnnotation
default AnnotationInfo getAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> an)
Returnstrueif method is annotated with provided annotation.
-
-