Package com.thoughtworks.qdox.model
Interface JavaMethod
- All Superinterfaces:
JavaAnnotatedElement
,JavaExecutable
,JavaGenericDeclaration
,JavaMember
,JavaModel
,Serializable
- All Known Implementing Classes:
DefaultJavaMethod
,JavaMethodDelegate
public interface JavaMethod
extends JavaAnnotatedElement, JavaMember, JavaModel, JavaGenericDeclaration, JavaExecutable
-
Method Summary
Modifier and TypeMethodDescriptiongetDeclarationSignature
(boolean withModifiers) Equivalent 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 typegetTagByName
(String string, boolean b) getTagsByName
(String name, boolean inherited) boolean
EquivalentMethod.isDefault()
boolean
Returnstrue
if this method follows the bean convention of being an accessor.boolean
Returnstrue
if this method follows the bean convention of being an mutator.boolean
signatureMatches
(String name, List<JavaType> parameterTypes) This method is NOT varArg aware.boolean
signatureMatches
(String name, List<JavaType> parameterTypes, boolean varArg) Methods inherited from interface com.thoughtworks.qdox.model.JavaAnnotatedElement
getAnnotations, getComment, getNamedParameter, getTagByName, getTags, getTagsByName
Methods inherited from interface com.thoughtworks.qdox.model.JavaExecutable
getDeclaringClass, getExceptions, getExceptionTypes, getParameterByName, getParameters, getParameterTypes, getParameterTypes, getSourceCode, isVarArgs
Methods inherited from interface com.thoughtworks.qdox.model.JavaGenericDeclaration
getTypeParameters
Methods inherited from interface com.thoughtworks.qdox.model.JavaMember
getModifiers, getName, isAbstract, isFinal, isNative, isPrivate, isProtected, isPublic, isStatic, isStrictfp, isSynchronized, isTransient, isVolatile
Methods inherited from interface com.thoughtworks.qdox.model.JavaModel
getCodeBlock, getLineNumber
-
Method Details
-
getReturns
JavaClass getReturns()- Returns:
- the return type
-
getDeclarationSignature
- Parameters:
withModifiers
-true
if modifiers should be added, otherwisefalse
- Returns:
- the declaration signature
- Since:
- 1.3
-
getCallSignature
String getCallSignature()- Specified by:
getCallSignature
in interfaceJavaExecutable
- Returns:
- the call signature
- Since:
- 1.3
-
signatureMatches
This method is NOT varArg aware.- Parameters:
name
- the name of the methodparameterTypes
- the parameter types of the method, can benull
- Returns:
true
if this method matches the signature, otherwisefalse
-
signatureMatches
- Parameters:
name
- the name of the methodparameterTypes
- the parameter types, can benull
varArg
-true
is signature should match a varArg-method, otherwisefalse
- Returns:
true
if this method matches the signature, otherwisefalse
-
isPropertyAccessor
boolean isPropertyAccessor()Returnstrue
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
- Returns:
true
if this method is a Java Bean accessor, otherwisefalse
- Since:
- 1.3
-
isPropertyMutator
boolean isPropertyMutator()Returnstrue
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
- Returns:
true
if this method is a Java Bean mutator, otherwisefalse
- Since:
- 1.3
-
getPropertyType
JavaType getPropertyType()- Returns:
- the type of the property this method represents, or
null
if this method is not a property mutator or property accessor. - Since:
- 1.3
-
getPropertyName
String getPropertyName()- Returns:
- the name of the property this method represents, or
null
if this method is not a property mutator or property accessor. - Since:
- 1.3
-
getTagsByName
-
getReturnType
JavaType getReturnType()Equivalent of java.lang.reflect.Method.getReturnType()- Returns:
- the return type
- Since:
- 1.12
-
getReturnType
If a class inherits this method from a generic class or interface, you can use this method to get the resolved return type- Parameters:
resolve
- define if generic should be resolved- Returns:
- the return type
- Since:
- 1.12
-
getTagByName
-
isDefault
boolean isDefault()EquivalentMethod.isDefault()
- Returns:
true
if this is a default method of an interface, otherwisefalse
- Since:
- 2.0
-