Package jodd.proxetta

Interface MethodInfo

  • All Known Implementing Classes:
    MethodSignatureVisitor

    public interface MethodInfo
    Method 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 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()
      • 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 or null if no exception is declared.
      • getSignature

        java.lang.String getSignature()
        Returns java-like method signature of description. 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, like long.
      • 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 or classname for top-level methods.
      • isTopLevelMethod

        boolean isTopLevelMethod()
        Returns true if method is declared in top-level class.
      • isPublicMethod

        default boolean isPublicMethod()
        Returns true if method is public.
      • isPrivateMethod

        default boolean isPrivateMethod()
        Returns true if method is private.
      • hasNoArguments

        default boolean hasNoArguments()
        Returns true if method has no argument.
      • hasOneArgument

        default boolean hasOneArgument()
        Returns true if method has only one argument.
      • isRootMethod

        default boolean isRootMethod()
        Returns true if method is declared in Object class (root class).
      • hasNoReturnValue

        default boolean hasNoReturnValue()
        Returns true if method's return type is void.
      • hasReturnValue

        default boolean hasReturnValue()
        Returns true if method has a return type.
      • matchMethodName

        default boolean matchMethodName​(java.lang.String wildcard)
        Match method name to provided Wildcard pattern.
      • matchClassName

        default boolean matchClassName​(java.lang.String wildcard)
        Match class name to provided Wildcard pattern.
      • hasAnnotation

        default boolean hasAnnotation​(java.lang.Class<? extends java.lang.annotation.Annotation>... an)
        Returns true if method is annotated with one of provided annotation.
      • getAnnotation

        default AnnotationInfo getAnnotation​(java.lang.Class<? extends java.lang.annotation.Annotation> an)
        Returns true if method is annotated with provided annotation.