public class DefaultJavaMethod extends AbstractBaseMethod implements JavaMethod
| Constructor and Description |
|---|
DefaultJavaMethod()
The default constructor
|
DefaultJavaMethod(JavaClass returns,
String name)
Create a new method without parameters
|
DefaultJavaMethod(String name)
Create new method without parameters and return type
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
String |
getCallSignature() |
String |
getCodeBlock() |
String |
getDeclarationSignature(boolean withModifiers) |
JavaClass |
getGenericReturnType()
Equivalent of java.lang.reflect.Method.getGenericReturnType()
|
String |
getPropertyName() |
JavaType |
getPropertyType() |
JavaClass |
getReturns() |
JavaType |
getReturnType()
Equivalent of java.lang.reflect.Method.getReturnType()
|
JavaType |
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 type
|
List<JavaTypeVariable<JavaMethod>> |
getTypeParameters()
Equivalent of
GenericDeclaration.getTypeParameters() |
int |
hashCode() |
boolean |
isDefault()
Equivalent
Method.isDefault() |
boolean |
isPropertyAccessor()
Returns
true if this method follows the bean convention of being an accessor. |
boolean |
isPropertyMutator()
Returns
true if this method follows the bean convention of being an mutator. |
void |
setDefault(boolean defaultMethod) |
void |
setReturns(JavaClass returns)
Define the return type of this method
|
void |
setTypeParameters(List<JavaTypeVariable<JavaMethod>> typeParameters) |
boolean |
signatureMatches(String name,
List<JavaType> parameterTypes)
This method is NOT varArg aware.
|
boolean |
signatureMatches(String name,
List<JavaType> parameterTypes,
boolean varArg) |
String |
toString() |
getDeclaringClass, getExceptions, getExceptionTypes, getParameterByName, getParameters, getParameterTypes, getParameterTypes, getSourceCode, getTagsByName, isPublic, isVarArgs, setExceptions, setParameters, setSourceCode, signatureMatchesgetTagByNamegetModifiers, getName, getParentClass, isAbstract, isFinal, isNative, isPrivate, isProtected, isStatic, isStrictfp, isSynchronized, isTransient, isVolatile, setModifiers, setName, setParentClassgetAnnotations, getComment, getNamedParameter, getTagByName, getTags, getTagsByName, setAnnotations, setComment, setTagsgetLineNumber, getModelWriter, getSource, setLineNumber, setModelWriterFactory, setSourceclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetExceptions, getExceptionTypes, getParameterByName, getParameters, getParameterTypes, getParameterTypes, getParentClass, getSourceCode, getTagByName, getTagsByName, isVarArgsgetAnnotations, getComment, getNamedParameter, getTagByName, getTags, getTagsByNamegetDeclaringClass, getModifiers, getName, isAbstract, isFinal, isNative, isPrivate, isProtected, isPublic, isStatic, isStrictfp, isSynchronized, isTransient, isVolatilegetLineNumber, getSourcepublic DefaultJavaMethod()
public DefaultJavaMethod(String name)
name - the name of the methodpublic boolean isDefault()
Method.isDefault()isDefault in interface JavaMethodtrue if this is a default method of an interface, otherwise falsepublic void setDefault(boolean defaultMethod)
public JavaClass getReturns()
getReturns in interface JavaMethodpublic void setTypeParameters(List<JavaTypeVariable<JavaMethod>> typeParameters)
public List<JavaTypeVariable<JavaMethod>> getTypeParameters()
GenericDeclaration.getTypeParameters()getTypeParameters in interface JavaGenericDeclarationnullpublic String getCodeBlock()
getCodeBlock in interface JavaModelpublic String getDeclarationSignature(boolean withModifiers)
getDeclarationSignature in interface JavaMethodpublic String getCallSignature()
getCallSignature in interface JavaMethodpublic void setReturns(JavaClass returns)
returns - the return typepublic boolean isPropertyAccessor()
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 in interface JavaMethodtrue if this method is a Java Bean accessor, otherwise falsepublic boolean isPropertyMutator()
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 in interface JavaMethodtrue if this method is a Java Bean mutator, otherwise falsepublic JavaType getPropertyType()
getPropertyType in interface JavaMethodnull if this method
is not a property mutator or property accessor.public String getPropertyName()
getPropertyName in interface JavaMethodnull if this method
is not a property mutator or property accessor.public JavaClass getGenericReturnType()
getGenericReturnType in interface JavaMethodpublic JavaType getReturnType()
getReturnType in interface JavaMethodpublic JavaType getReturnType(boolean resolve)
getReturnType in interface JavaMethodresolve - define if generic should be resolvedpublic boolean signatureMatches(String name, List<JavaType> parameterTypes)
JavaMethodsignatureMatches in interface JavaMethodname - the name of the methodparameterTypes - the parameter types of the method, can be nulltrue if this method matches the signature, otherwise falsepublic boolean signatureMatches(String name, List<JavaType> parameterTypes, boolean varArg)
signatureMatches in interface JavaMethodname - the name of the methodparameterTypes - the parameter types, can be nullvarArg - true is signature should match a varArg-method, otherwise falsetrue if this method matches the signature, otherwise falseCopyright © 2002–2016. All rights reserved.