类 JavaMethodDelegate

java.lang.Object
com.thoughtworks.qdox.model.impl.JavaMethodDelegate
所有已实现的接口:
JavaAnnotatedElement, JavaExecutable, JavaGenericDeclaration, JavaMember, JavaMethod, JavaModel, Serializable

public class JavaMethodDelegate extends Object implements JavaMethod
This class can be used to access overridden methods while keeping a reference to the original class. This is especially useful when trying to resolve generics
从以下版本开始:
1.12
作者:
Robert Scholte
另请参阅:
  • 构造器详细资料

    • JavaMethodDelegate

      public JavaMethodDelegate(JavaClass callingClass, JavaMethod originalMethod)
  • 方法详细资料

    • getReturnType

      public JavaType getReturnType(boolean resolve)
      从接口复制的说明: JavaMethod
      If a class inherits this method from a generic class or interface, you can use this method to get the resolved return type
      指定者:
      getReturnType 在接口中 JavaMethod
      参数:
      resolve - define if generic should be resolved
      返回:
      the return type
    • getParameterTypes

      public 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
      指定者:
      getParameterTypes 在接口中 JavaExecutable
      参数:
      resolve - true if the resolved types should be returned, otherwise false
      返回:
      the parameter types
    • equals

      public boolean equals(Object obj)
      覆盖:
      equals 在类中 Object
    • getAnnotations

      public List<JavaAnnotation> getAnnotations()
      指定者:
      getAnnotations 在接口中 JavaAnnotatedElement
      返回:
      a list of Annotations, never null
    • getCallSignature

      public String getCallSignature()
      指定者:
      getCallSignature 在接口中 JavaExecutable
      指定者:
      getCallSignature 在接口中 JavaMethod
      返回:
      the call signature
    • getCodeBlock

      public String getCodeBlock()
      指定者:
      getCodeBlock 在接口中 JavaModel
      返回:
      the codeblock
    • getComment

      public String getComment()
      Retrieve the javadoc comment of this annotated element. This is the part between /** and the */, but without the doclet tags
      指定者:
      getComment 在接口中 JavaAnnotatedElement
      返回:
      the comment, otherwise null
    • getDeclaringClass

      public JavaClass getDeclaringClass()
      指定者:
      getDeclaringClass 在接口中 JavaExecutable
      指定者:
      getDeclaringClass 在接口中 JavaMember
      返回:
      the declaring class
    • getDeclarationSignature

      public String getDeclarationSignature(boolean withModifiers)
      指定者:
      getDeclarationSignature 在接口中 JavaMethod
      参数:
      withModifiers - true if modifiers should be added, otherwise false
      返回:
      the declaration signature
    • getExceptions

      public List<JavaClass> getExceptions()
      指定者:
      getExceptions 在接口中 JavaExecutable
      返回:
      a list of Exceptions, never null
    • getExceptionTypes

      public List<JavaType> getExceptionTypes()
      指定者:
      getExceptionTypes 在接口中 JavaExecutable
    • isDefault

      public boolean isDefault()
      指定者:
      isDefault 在接口中 JavaMethod
      返回:
      true if this is a default method of an interface, otherwise false
    • getLineNumber

      public int getLineNumber()
      The line number where this element started
      指定者:
      getLineNumber 在接口中 JavaModel
      返回:
      the line number of this element
    • getModifiers

      public List<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.
      指定者:
      getModifiers 在接口中 JavaMember
      返回:
      all modifiers is this member
    • getName

      public String getName()
      Equivalent of Member.getName()
      指定者:
      getName 在接口中 JavaMember
      返回:
      the name of this member
    • getNamedParameter

      public String getNamedParameter(String tagName, String parameterName)
      Convenience method for getTagByName(String).getNamedParameter(String) that also checks for null tag.
      指定者:
      getNamedParameter 在接口中 JavaAnnotatedElement
      参数:
      tagName - the tag name
      parameterName - the parameter name
      返回:
      the value of the matching parameter, otherwise null
    • getParameterByName

      public JavaParameter getParameterByName(String name)
      指定者:
      getParameterByName 在接口中 JavaExecutable
      参数:
      name - the name of the parameter
      返回:
      the JavaParameter matching the name, otherwise null
    • getParameters

      public List<JavaParameter> getParameters()
      Equivalent of Executable.getParameterTypes(), where a JavaParameter also contains the original name if available.
      指定者:
      getParameters 在接口中 JavaExecutable
      返回:
      a list of JavaParameters, never null
    • getPropertyName

      public String getPropertyName()
      指定者:
      getPropertyName 在接口中 JavaMethod
      返回:
      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()
      指定者:
      getPropertyType 在接口中 JavaMethod
      返回:
      the type of the property this method represents, or null if this method is not a property mutator or property accessor.
    • getReturns

      public JavaClass getReturns()
      指定者:
      getReturns 在接口中 JavaMethod
      返回:
      the return type
    • getSourceCode

      public String getSourceCode()
      Get the original source code of the body of this method.
      指定者:
      getSourceCode 在接口中 JavaExecutable
      返回:
      Code as string.
    • getTagByName

      public DocletTag getTagByName(String name, boolean inherited)
      指定者:
      getTagByName 在接口中 JavaMethod
    • getTagByName

      public DocletTag getTagByName(String name)
      Retrieve the doclettag by the specified name. If there are more than one tags, only return the first one.
      指定者:
      getTagByName 在接口中 JavaAnnotatedElement
      参数:
      name - the name of the doclettag trying to retrieve
      返回:
      the first doclettag matching the name, otherwise null
    • getTags

      public List<DocletTag> getTags()
      Retrieve all defined doclet tags.
      指定者:
      getTags 在接口中 JavaAnnotatedElement
      返回:
      a list of DocletTags, never null
    • getTagsByName

      public List<DocletTag> getTagsByName(String name, boolean inherited)
      指定者:
      getTagsByName 在接口中 JavaMethod
    • getTagsByName

      public List<DocletTag> getTagsByName(String name)
      Retrieve all doclettags with a specific name.
      指定者:
      getTagsByName 在接口中 JavaAnnotatedElement
      参数:
      name - the name of the doclet tag
      返回:
      a list of doclettags, never null
    • getTypeParameters

      public List<JavaTypeVariable<JavaMethod>> getTypeParameters()
      指定者:
      getTypeParameters 在接口中 JavaGenericDeclaration
      返回:
      a list of typeParameters, never null
    • hashCode

      public int hashCode()
      覆盖:
      hashCode 在类中 Object
    • isAbstract

      public boolean isAbstract()
      指定者:
      isAbstract 在接口中 JavaMember
      返回:
      true if this member is abstract, otherwise false
    • isFinal

      public boolean isFinal()
      Equivalent of Modifier.isFinal(int)
      指定者:
      isFinal 在接口中 JavaMember
      返回:
      true is this member is final, otherwise false
    • isNative

      public boolean isNative()
      指定者:
      isNative 在接口中 JavaMember
      返回:
      true if this member is native, otherwise false
    • isPrivate

      public boolean isPrivate()
      指定者:
      isPrivate 在接口中 JavaMember
      返回:
      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
       
      指定者:
      isPropertyAccessor 在接口中 JavaMethod
      返回:
      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
       
      指定者:
      isPropertyMutator 在接口中 JavaMethod
      返回:
      true if this method is a Java Bean mutator, otherwise false
    • isProtected

      public boolean isProtected()
      指定者:
      isProtected 在接口中 JavaMember
      返回:
      true if this member is protected; otherwise false
    • isPublic

      public boolean isPublic()
      指定者:
      isPublic 在接口中 JavaMember
      返回:
      true if this member is public, otherwise false
    • isStatic

      public boolean isStatic()
      指定者:
      isStatic 在接口中 JavaMember
      返回:
      true if this member is static, otherwise false
    • isStrictfp

      public boolean isStrictfp()
      指定者:
      isStrictfp 在接口中 JavaMember
      返回:
      true if this member is strictfp, otherwise false
    • isSynchronized

      public boolean isSynchronized()
      指定者:
      isSynchronized 在接口中 JavaMember
      返回:
      true if this member is synchronized, otherwise false
    • isTransient

      public boolean isTransient()
      指定者:
      isTransient 在接口中 JavaMember
      返回:
      true if this member is transient, otherwise false
    • isVarArgs

      public boolean isVarArgs()
      指定者:
      isVarArgs 在接口中 JavaExecutable
      返回:
      true if the final parameter is a varArg, otherwise false
    • isVolatile

      public boolean isVolatile()
      指定者:
      isVolatile 在接口中 JavaMember
      返回:
      true if this member is volatile, otherwise false
    • signatureMatches

      public boolean signatureMatches(String name, List<JavaType> parameterTypes, boolean varArg)
      指定者:
      signatureMatches 在接口中 JavaMethod
      参数:
      name - the name of the method
      parameterTypes - the parameter types, can be null
      varArg - true is signature should match a varArg-method, otherwise false
      返回:
      true if this method matches the signature, otherwise false
    • signatureMatches

      public boolean signatureMatches(String name, List<JavaType> parameterTypes)
      This method is NOT varArg aware.
      指定者:
      signatureMatches 在接口中 JavaMethod
      参数:
      name - the name of the method
      parameterTypes - the parameter types of the method, can be null
      返回:
      true if this method matches the signature, otherwise false
    • toString

      public String toString()
      覆盖:
      toString 在类中 Object
    • getReturnType

      public JavaType getReturnType()
      Equivalent of java.lang.reflect.Method.getReturnType()
      指定者:
      getReturnType 在接口中 JavaMethod
      返回:
      the return type
    • getParameterTypes

      public List<JavaType> getParameterTypes()
      指定者:
      getParameterTypes 在接口中 JavaExecutable
      返回:
      a list of JavaParameters, never null