java.lang.Object
com.thoughtworks.qdox.model.impl.JavaMethodDelegate
- 所有已实现的接口:
JavaAnnotatedElement,JavaExecutable,JavaGenericDeclaration,JavaMember,JavaMethod,JavaModel,Serializable
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
- 另请参阅:
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明booleanEquivalent ofAnnotatedElement.getAnnotations()Retrieve the javadoc comment of this annotated element.getDeclarationSignature(boolean withModifiers) Equivalent ofMember.getDeclaringClass()Equivalent ofExecutable.getExceptionTypes()intThe line number where this element startedEquivalent ofMember.getModifiers()This does not follow the java-api With the Member-class, getModifiers returns anint, which should be decoded with the Modifier.getName()Equivalent ofMember.getName()getNamedParameter(String tagName, String parameterName) Convenience method forgetTagByName(String).getNamedParameter(String)that also checks for null tag.getParameterByName(String name) Equivalent ofExecutable.getParameterTypes(), where a JavaParameter also contains the original name if available.Equivalent ofExecutable.getParameterTypes()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 typesEquivalent of java.lang.reflect.Method.getReturnType()getReturnType(boolean resolve) If a class inherits this method from a generic class or interface, you can use this method to get the resolved return typeGet the original source code of the body of this method.getTagByName(String name) Retrieve the doclettag by the specified name.getTagByName(String name, boolean inherited) getTags()Retrieve all defined doclet tags.getTagsByName(String name) Retrieve all doclettags with a specific name.getTagsByName(String name, boolean inherited) Equivalent ofGenericDeclaration.getTypeParameters()inthashCode()booleanEquivalent ofModifier.isAbstract(int)booleanEquivalentMethod.isDefault()booleanisFinal()Equivalent ofModifier.isFinal(int)booleanisNative()Equivalent ofModifier.isNative(int)booleanEquivalent ofModifier.isPrivate(int)booleanReturnstrueif this method follows the bean convention of being an accessor.booleanReturnstrueif this method follows the bean convention of being an mutator.booleanEquivalent ofModifier.isProtected(int)booleanisPublic()Equivalent ofModifier.isPublic(int)booleanisStatic()Equivalent ofModifier.isStatic(int)booleanEquivalent ofModifier.isStrict(int)booleanEquivalent ofModifier.isSynchronized(int)booleanEquivalent ofModifier.isTransient(int)booleanEquivalent ofExecutable.isVarArgs()booleanEquivalent ofModifier.isVolatile(int)booleansignatureMatches(String name, List<JavaType> parameterTypes) This method is NOT varArg aware.booleansignatureMatches(String name, List<JavaType> parameterTypes, boolean varArg) toString()
-
构造器详细资料
-
JavaMethodDelegate
-
-
方法详细资料
-
getReturnType
从接口复制的说明:JavaMethodIf 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
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-trueif the resolved types should be returned, otherwisefalse- 返回:
- the parameter types
-
equals
-
getAnnotations
Equivalent ofAnnotatedElement.getAnnotations()- 指定者:
getAnnotations在接口中JavaAnnotatedElement- 返回:
- a list of Annotations, never
null
-
getCallSignature
- 指定者:
getCallSignature在接口中JavaExecutable- 指定者:
getCallSignature在接口中JavaMethod- 返回:
- the call signature
-
getCodeBlock
- 指定者:
getCodeBlock在接口中JavaModel- 返回:
- the codeblock
-
getComment
Retrieve the javadoc comment of this annotated element. This is the part between/**and*/, but without the Standard doclet block tags. It may still contain Standard doclet inline tags, though.- 指定者:
getComment在接口中JavaAnnotatedElement- 返回:
- the comment, otherwise
null
-
getDeclaringClass
Equivalent ofMember.getDeclaringClass()- 指定者:
getDeclaringClass在接口中JavaExecutable- 指定者:
getDeclaringClass在接口中JavaMember- 返回:
- the declaring class
-
getDeclarationSignature
- 指定者:
getDeclarationSignature在接口中JavaMethod- 参数:
withModifiers-trueif modifiers should be added, otherwisefalse- 返回:
- the declaration signature
-
getExceptions
Equivalent ofExecutable.getExceptionTypes()- 指定者:
getExceptions在接口中JavaExecutable- 返回:
- a list of Exceptions, never
null
-
getExceptionTypes
- 指定者:
getExceptionTypes在接口中JavaExecutable
-
isDefault
public boolean isDefault()EquivalentMethod.isDefault()- 指定者:
isDefault在接口中JavaMethod- 返回:
trueif this is a default method of an interface, otherwisefalse
-
getLineNumber
public int getLineNumber()The line number where this element started- 指定者:
getLineNumber在接口中JavaModel- 返回:
- the line number of this element
-
getModifiers
Equivalent ofMember.getModifiers()This does not follow the java-api With the Member-class, getModifiers returns anint, 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
Equivalent ofMember.getName()- 指定者:
getName在接口中JavaMember- 返回:
- the name of this member
-
getNamedParameter
Convenience method forgetTagByName(String).getNamedParameter(String)that also checks for null tag.- 指定者:
getNamedParameter在接口中JavaAnnotatedElement- 参数:
tagName- the tag nameparameterName- the parameter name- 返回:
- the value of the matching parameter, otherwise
null
-
getParameterByName
- 指定者:
getParameterByName在接口中JavaExecutable- 参数:
name- the name of the parameter- 返回:
- the
JavaParametermatching the name, otherwisenull
-
getParameters
Equivalent ofExecutable.getParameterTypes(), where a JavaParameter also contains the original name if available.- 指定者:
getParameters在接口中JavaExecutable- 返回:
- a list of JavaParameters, never
null
-
getPropertyName
- 指定者:
getPropertyName在接口中JavaMethod- 返回:
- the name of the property this method represents, or
nullif this method is not a property mutator or property accessor.
-
getPropertyType
- 指定者:
getPropertyType在接口中JavaMethod- 返回:
- the type of the property this method represents, or
nullif this method is not a property mutator or property accessor.
-
getReturns
- 指定者:
getReturns在接口中JavaMethod- 返回:
- the return type
-
getSourceCode
Get the original source code of the body of this method.- 指定者:
getSourceCode在接口中JavaExecutable- 返回:
- Code as string.
-
getTagByName
- 指定者:
getTagByName在接口中JavaMethod
-
getTagByName
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
Retrieve all defined doclet tags.- 指定者:
getTags在接口中JavaAnnotatedElement- 返回:
- a list of DocletTags, never
null
-
getTagsByName
- 指定者:
getTagsByName在接口中JavaMethod
-
getTagsByName
Retrieve all doclettags with a specific name.- 指定者:
getTagsByName在接口中JavaAnnotatedElement- 参数:
name- the name of the doclet tag- 返回:
- a list of doclettags, never
null
-
getTypeParameters
Equivalent ofGenericDeclaration.getTypeParameters()- 指定者:
getTypeParameters在接口中JavaGenericDeclaration- 返回:
- a list of typeParameters, never
null
-
hashCode
public int hashCode() -
isAbstract
public boolean isAbstract()Equivalent ofModifier.isAbstract(int)- 指定者:
isAbstract在接口中JavaMember- 返回:
trueif this member isabstract, otherwisefalse
-
isFinal
public boolean isFinal()Equivalent ofModifier.isFinal(int)- 指定者:
isFinal在接口中JavaMember- 返回:
trueis this member isfinal, otherwisefalse
-
isNative
public boolean isNative()Equivalent ofModifier.isNative(int)- 指定者:
isNative在接口中JavaMember- 返回:
trueif this member isnative, otherwisefalse
-
isPrivate
public boolean isPrivate()Equivalent ofModifier.isPrivate(int)- 指定者:
isPrivate在接口中JavaMember- 返回:
trueif this member isprivate, otherwisefalse
-
isPropertyAccessor
public boolean isPropertyAccessor()Returnstrueif 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- 返回:
trueif this method is a Java Bean accessor, otherwisefalse
-
isPropertyMutator
public boolean isPropertyMutator()Returnstrueif 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- 返回:
trueif this method is a Java Bean mutator, otherwisefalse
-
isProtected
public boolean isProtected()Equivalent ofModifier.isProtected(int)- 指定者:
isProtected在接口中JavaMember- 返回:
trueif this member isprotected; otherwisefalse
-
isPublic
public boolean isPublic()Equivalent ofModifier.isPublic(int)- 指定者:
isPublic在接口中JavaMember- 返回:
trueif this member ispublic, otherwisefalse
-
isStatic
public boolean isStatic()Equivalent ofModifier.isStatic(int)- 指定者:
isStatic在接口中JavaMember- 返回:
trueif this member isstatic, otherwisefalse
-
isStrictfp
public boolean isStrictfp()Equivalent ofModifier.isStrict(int)- 指定者:
isStrictfp在接口中JavaMember- 返回:
trueif this member isstrictfp, otherwisefalse
-
isSynchronized
public boolean isSynchronized()Equivalent ofModifier.isSynchronized(int)- 指定者:
isSynchronized在接口中JavaMember- 返回:
trueif this member issynchronized, otherwisefalse
-
isTransient
public boolean isTransient()Equivalent ofModifier.isTransient(int)- 指定者:
isTransient在接口中JavaMember- 返回:
trueif this member istransient, otherwisefalse
-
isVarArgs
public boolean isVarArgs()Equivalent ofExecutable.isVarArgs()- 指定者:
isVarArgs在接口中JavaExecutable- 返回:
trueif the final parameter is a varArg, otherwisefalse
-
isVolatile
public boolean isVolatile()Equivalent ofModifier.isVolatile(int)- 指定者:
isVolatile在接口中JavaMember- 返回:
trueif this member isvolatile, otherwisefalse
-
signatureMatches
- 指定者:
signatureMatches在接口中JavaMethod- 参数:
name- the name of the methodparameterTypes- the parameter types, can benullvarArg-trueis signature should match a varArg-method, otherwisefalse- 返回:
trueif this method matches the signature, otherwisefalse
-
signatureMatches
This method is NOT varArg aware.- 指定者:
signatureMatches在接口中JavaMethod- 参数:
name- the name of the methodparameterTypes- the parameter types of the method, can benull- 返回:
trueif this method matches the signature, otherwisefalse
-
toString
-
getReturnType
Equivalent of java.lang.reflect.Method.getReturnType()- 指定者:
getReturnType在接口中JavaMethod- 返回:
- the return type
-
getParameterTypes
Equivalent ofExecutable.getParameterTypes()- 指定者:
getParameterTypes在接口中JavaExecutable- 返回:
- a list of JavaParameters, never
null
-