Class JavaMethodDelegate

    • Constructor Detail

      • JavaMethodDelegate

        public JavaMethodDelegate​(JavaClass callingClass,
                                  JavaMethod originalMethod)
    • Method Detail

      • getReturnType

        public JavaType getReturnType​(boolean resolve)
        Description copied from interface: JavaMethod
        If a class inherits this method from a generic class or interface, you can use this method to get the resolved return type
        Specified by:
        getReturnType in interface JavaMethod
        Parameters:
        resolve - define if generic should be resolved
        Returns:
        the return type
      • getParameterTypes

        public java.util.List<JavaType> getParameterTypes​(boolean resolve)
        If a class inherits this method from a generic class or interface, you can use this method to get the resolved parameter types
        Specified by:
        getParameterTypes in interface JavaExecutable
        Parameters:
        resolve - true if the resolved types should be returned, otherwise false
        Returns:
        the parameter types
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • getCodeBlock

        public java.lang.String getCodeBlock()
        Specified by:
        getCodeBlock in interface JavaModel
        Returns:
        the codeblock
      • getComment

        public java.lang.String getComment()
        Retrieve the javadoc comment of this annotated element. This is the part between /** and the */, but without the doclet tags
        Specified by:
        getComment in interface JavaAnnotatedElement
        Returns:
        the comment, otherwise null
      • getDeclarationSignature

        public java.lang.String getDeclarationSignature​(boolean withModifiers)
        Specified by:
        getDeclarationSignature in interface JavaMethod
        Parameters:
        withModifiers - true if modifiers should be added, otherwise false
        Returns:
        the declaration signature
      • getExceptions

        public java.util.List<JavaClass> getExceptions()
        Equivalent of Executable.getExceptionTypes()
        Specified by:
        getExceptions in interface JavaExecutable
        Returns:
        a list of Exceptions, never null
      • isDefault

        public boolean isDefault()
        Equivalent Method.isDefault()
        Specified by:
        isDefault in interface JavaMethod
        Returns:
        true if this is a default method of an interface, otherwise false
      • getLineNumber

        public int getLineNumber()
        The line number where this element started
        Specified by:
        getLineNumber in interface JavaModel
        Returns:
        the line number of this element
      • getModifiers

        public java.util.List<java.lang.String> getModifiers()
        Equivalent of Member.getModifiers() This does not follow the java-api With the Member-class, getModifiers returns an int, which should be decoded with the Modifier. If this member was extracted from a source, it will keep its order. Otherwise if will be in the preferred order of the java-api.
        Specified by:
        getModifiers in interface JavaMember
        Returns:
        all modifiers is this member
      • getName

        public java.lang.String getName()
        Equivalent of Member.getName()
        Specified by:
        getName in interface JavaMember
        Returns:
        the name of this member
      • getNamedParameter

        public java.lang.String getNamedParameter​(java.lang.String tagName,
                                                  java.lang.String parameterName)
        Convenience method for getTagByName(String).getNamedParameter(String) that also checks for null tag.
        Specified by:
        getNamedParameter in interface JavaAnnotatedElement
        Parameters:
        tagName - the tag name
        parameterName - the parameter name
        Returns:
        the value of the matching parameter, otherwise null
      • getParameters

        public java.util.List<JavaParameter> getParameters()
        Equivalent of Executable.getParameterTypes(), where a JavaParameter also contains the original name if available.
        Specified by:
        getParameters in interface JavaExecutable
        Returns:
        a list of JavaParameters, never null
      • getPropertyName

        public java.lang.String getPropertyName()
        Specified by:
        getPropertyName in interface JavaMethod
        Returns:
        the name of the property this method represents, or null if this method is not a property mutator or property accessor.
      • getPropertyType

        public JavaType getPropertyType()
        Specified by:
        getPropertyType in interface JavaMethod
        Returns:
        the type of the property this method represents, or null if this method is not a property mutator or property accessor.
      • getSourceCode

        public java.lang.String getSourceCode()
        Get the original source code of the body of this method.
        Specified by:
        getSourceCode in interface JavaExecutable
        Returns:
        Code as string.
      • getTagByName

        public DocletTag getTagByName​(java.lang.String name)
        Retrieve the doclettag by the specified name. If there are more than one tags, only return the first one.
        Specified by:
        getTagByName in interface JavaAnnotatedElement
        Parameters:
        name - the name of the doclettag trying to retrieve
        Returns:
        the first doclettag matching the name, otherwise null
      • getTags

        public java.util.List<DocletTag> getTags()
        Retrieve all defined doclet tags.
        Specified by:
        getTags in interface JavaAnnotatedElement
        Returns:
        a list of DocletTags, never null
      • getTagsByName

        public java.util.List<DocletTag> getTagsByName​(java.lang.String name,
                                                       boolean inherited)
        Specified by:
        getTagsByName in interface JavaMethod
      • getTagsByName

        public java.util.List<DocletTag> getTagsByName​(java.lang.String name)
        Retrieve all doclettags with a specific name.
        Specified by:
        getTagsByName in interface JavaAnnotatedElement
        Parameters:
        name - the name of the doclet tag
        Returns:
        a list of doclettags, never null
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • isAbstract

        public boolean isAbstract()
        Equivalent of Modifier.isAbstract(int)
        Specified by:
        isAbstract in interface JavaMember
        Returns:
        true if this member is abstract, otherwise false
      • isFinal

        public boolean isFinal()
        Equivalent of Modifier.isFinal(int)
        Specified by:
        isFinal in interface JavaMember
        Returns:
        true is this member is final, otherwise false
      • isNative

        public boolean isNative()
        Equivalent of Modifier.isNative(int)
        Specified by:
        isNative in interface JavaMember
        Returns:
        true if this member is native, otherwise false
      • isPrivate

        public boolean isPrivate()
        Equivalent of Modifier.isPrivate(int)
        Specified by:
        isPrivate in interface JavaMember
        Returns:
        true if this member is private, otherwise false
      • isPropertyAccessor

        public boolean isPropertyAccessor()
        Returns true if this method follows the bean convention of being an accessor.
           public String getName();             // true
           public boolean isValid()             // true
           public String getName( String def ); // false, it has a parameter
           public String gettingUp();           // false, 'get' is not followed by an uppercase character
           public boolean isolate();            // false, 'is' is not followed by an uppercase character
           public static String getName();      // false, it is static
         
        Specified by:
        isPropertyAccessor in interface JavaMethod
        Returns:
        true if this method is a Java Bean accessor, otherwise false
      • isPropertyMutator

        public boolean isPropertyMutator()
        Returns true if this method follows the bean convention of being an mutator.
          public void setName(String name);        // true
          public void setUp();                     // false, it has no parameter
          public void settingUp(String def);       // false, 'set' is not followed by an uppercase character
          public static void setName(String name); // false, it is static
         
        Specified by:
        isPropertyMutator in interface JavaMethod
        Returns:
        true if this method is a Java Bean mutator, otherwise false
      • isProtected

        public boolean isProtected()
        Equivalent of Modifier.isProtected(int)
        Specified by:
        isProtected in interface JavaMember
        Returns:
        true if this member is protected; otherwise false
      • isPublic

        public boolean isPublic()
        Equivalent of Modifier.isPublic(int)
        Specified by:
        isPublic in interface JavaMember
        Returns:
        true if this member is public, otherwise false
      • isStatic

        public boolean isStatic()
        Equivalent of Modifier.isStatic(int)
        Specified by:
        isStatic in interface JavaMember
        Returns:
        true if this member is static, otherwise false
      • isStrictfp

        public boolean isStrictfp()
        Equivalent of Modifier.isStrict(int)
        Specified by:
        isStrictfp in interface JavaMember
        Returns:
        true if this member is strictfp, otherwise false
      • isSynchronized

        public boolean isSynchronized()
        Equivalent of Modifier.isSynchronized(int)
        Specified by:
        isSynchronized in interface JavaMember
        Returns:
        true if this member is synchronized, otherwise false
      • isTransient

        public boolean isTransient()
        Equivalent of Modifier.isTransient(int)
        Specified by:
        isTransient in interface JavaMember
        Returns:
        true if this member is transient, otherwise false
      • isVarArgs

        public boolean isVarArgs()
        Equivalent of Executable.isVarArgs()
        Specified by:
        isVarArgs in interface JavaExecutable
        Returns:
        true if the final parameter is a varArg, otherwise false
      • isVolatile

        public boolean isVolatile()
        Equivalent of Modifier.isVolatile(int)
        Specified by:
        isVolatile in interface JavaMember
        Returns:
        true if this member is volatile, otherwise false
      • signatureMatches

        public boolean signatureMatches​(java.lang.String name,
                                        java.util.List<JavaType> parameterTypes,
                                        boolean varArg)
        Specified by:
        signatureMatches in interface JavaMethod
        Parameters:
        name - the name of the method
        parameterTypes - the parameter types, can be null
        varArg - true is signature should match a varArg-method, otherwise false
        Returns:
        true if this method matches the signature, otherwise false
      • signatureMatches

        public boolean signatureMatches​(java.lang.String name,
                                        java.util.List<JavaType> parameterTypes)
        This method is NOT varArg aware.
        Specified by:
        signatureMatches in interface JavaMethod
        Parameters:
        name - the name of the method
        parameterTypes - the parameter types of the method, can be null
        Returns:
        true if this method matches the signature, otherwise false
      • toString

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

        public JavaType getReturnType()
        Equivalent of java.lang.reflect.Method.getReturnType()
        Specified by:
        getReturnType in interface JavaMethod
        Returns:
        the return type
      • getParameterTypes

        public java.util.List<JavaType> getParameterTypes()
        Equivalent of Executable.getParameterTypes()
        Specified by:
        getParameterTypes in interface JavaExecutable
        Returns:
        a list of JavaParameters, never null