public class DefaultJavaMethod extends DefaultJavaExecutable implements JavaMethod
| Constructor and Description |
|---|
DefaultJavaMethod()
The default constructor
|
DefaultJavaMethod(JavaClass returns,
java.lang.String name)
Create a new method without parameters
|
DefaultJavaMethod(java.lang.String name)
Create new method without parameters and return type
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getCodeBlock() |
java.lang.String |
getDeclarationSignature(boolean withModifiers) |
java.lang.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
|
java.util.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(java.util.List<JavaTypeVariable<JavaMethod>> typeParameters) |
boolean |
signatureMatches(java.lang.String name,
java.util.List<JavaType> parameterTypes)
This method is NOT varArg aware.
|
boolean |
signatureMatches(java.lang.String name,
java.util.List<JavaType> parameterTypes,
boolean varArg) |
java.lang.String |
toString() |
getCallSignature, getExceptions, getExceptionTypes, getParameterByName, getParameters, getParameterTypes, getParameterTypes, getSignature, getSourceCode, getTagsByName, isPublic, isVarArgs, setExceptions, setParameters, setSourceCode, signatureMatchesgetTagByNamegetDeclaringClass, getModifiers, getName, isAbstract, isFinal, isNative, isPrivate, isProtected, isStatic, isStrictfp, isSynchronized, isTransient, isVolatile, setDeclaringClass, setModifiers, setNamegetAnnotations, getComment, getNamedParameter, getSource, getTagByName, getTags, getTagsByName, setAnnotations, setComment, setSource, setTagsgetLineNumber, getModelWriter, setLineNumber, setModelWriterFactoryclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetCallSignature, getTagByName, getTagsByNamegetDeclaringClass, getExceptions, getExceptionTypes, getParameterByName, getParameters, getParameterTypes, getParameterTypes, getSourceCode, isVarArgsgetAnnotations, getComment, getNamedParameter, getTagByName, getTags, getTagsByNamegetModifiers, getName, isAbstract, isFinal, isNative, isPrivate, isProtected, isPublic, isStatic, isStrictfp, isSynchronized, isTransient, isVolatilepublic DefaultJavaMethod()
public DefaultJavaMethod(java.lang.String name)
name - the name of the methodpublic DefaultJavaMethod(JavaClass returns, java.lang.String name)
returns - the return typename - the name of this 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 JavaMethodgetReturns in class DefaultJavaExecutablepublic void setTypeParameters(java.util.List<JavaTypeVariable<JavaMethod>> typeParameters)
public java.util.List<JavaTypeVariable<JavaMethod>> getTypeParameters()
GenericDeclaration.getTypeParameters()getTypeParameters in interface JavaGenericDeclarationnullpublic java.lang.String getCodeBlock()
getCodeBlock in interface JavaModelpublic java.lang.String getDeclarationSignature(boolean withModifiers)
getDeclarationSignature in interface JavaMethodwithModifiers - true if modifiers should be added, otherwise falsepublic void setReturns(JavaClass returns)
returns - the return typepublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic 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 java.lang.String getPropertyName()
getPropertyName in interface JavaMethodnull if this method
is not a property mutator or property accessor.public java.lang.String toString()
toString in class java.lang.Objectpublic JavaType getReturnType()
getReturnType in interface JavaMethodpublic JavaType getReturnType(boolean resolve)
getReturnType in interface JavaMethodresolve - define if generic should be resolvedpublic boolean signatureMatches(java.lang.String name,
java.util.List<JavaType> parameterTypes)
signatureMatches 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(java.lang.String name,
java.util.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-2018. All Rights Reserved.