public class JavaMethodDelegate extends Object implements JavaMethod
Constructor and Description |
---|
JavaMethodDelegate(JavaClass callingClass,
JavaMethod originalMethod) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
List<JavaAnnotation> |
getAnnotations()
Equivalent of
AnnotatedElement.getAnnotations() |
String |
getCallSignature() |
String |
getCodeBlock() |
String |
getComment()
Retrieve the javadoc comment of this annotated element.
|
String |
getDeclarationSignature(boolean withModifiers) |
JavaClass |
getDeclaringClass()
Equivalent of
Member.getDeclaringClass() |
List<JavaClass> |
getExceptions()
Equivalent of
Executable.getExceptionTypes() |
List<JavaType> |
getExceptionTypes() |
int |
getLineNumber()
The line number where this element started
|
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. |
String |
getName()
Equivalent of
Member.getName() |
String |
getNamedParameter(String tagName,
String parameterName)
Convenience method for
getTagByName(String).getNamedParameter(String)
that also checks for null tag. |
JavaParameter |
getParameterByName(String name) |
List<JavaParameter> |
getParameters()
Equivalent of
Executable.getParameterTypes() , where a JavaParameter also contains the original name if available. |
List<JavaType> |
getParameterTypes()
Equivalent of
Executable.getParameterTypes() |
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
|
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
|
String |
getSourceCode()
Get the original source code of the body of this method.
|
DocletTag |
getTagByName(String name)
Retrieve the doclettag by the specified name.
|
DocletTag |
getTagByName(String name,
boolean inherited) |
List<DocletTag> |
getTags()
Retrieve all defined doclet tags.
|
List<DocletTag> |
getTagsByName(String name)
Retrieve all doclettags with a specific name.
|
List<DocletTag> |
getTagsByName(String name,
boolean inherited) |
List<JavaTypeVariable<JavaMethod>> |
getTypeParameters()
Equivalent of
GenericDeclaration.getTypeParameters() |
int |
hashCode() |
boolean |
isAbstract()
Equivalent of
Modifier.isAbstract(int) |
boolean |
isDefault()
Equivalent
Method.isDefault() |
boolean |
isFinal()
Equivalent of
Modifier.isFinal(int) |
boolean |
isNative()
Equivalent of
Modifier.isNative(int) |
boolean |
isPrivate()
Equivalent of
Modifier.isPrivate(int) |
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. |
boolean |
isProtected()
Equivalent of
Modifier.isProtected(int) |
boolean |
isPublic()
Equivalent of
Modifier.isPublic(int) |
boolean |
isStatic()
Equivalent of
Modifier.isStatic(int) |
boolean |
isStrictfp()
Equivalent of
Modifier.isStrict(int) |
boolean |
isSynchronized()
Equivalent of
Modifier.isSynchronized(int) |
boolean |
isTransient()
Equivalent of
Modifier.isTransient(int) |
boolean |
isVarArgs()
Equivalent of
Executable.isVarArgs() |
boolean |
isVolatile()
Equivalent of
Modifier.isVolatile(int) |
boolean |
signatureMatches(String name,
List<JavaType> parameterTypes)
This method is NOT varArg aware.
|
boolean |
signatureMatches(String name,
List<JavaType> parameterTypes,
boolean varArg) |
String |
toString() |
public JavaMethodDelegate(JavaClass callingClass, JavaMethod originalMethod)
public JavaType getReturnType(boolean resolve)
JavaMethod
getReturnType
in interface JavaMethod
resolve
- define if generic should be resolvedpublic List<JavaType> getParameterTypes(boolean resolve)
getParameterTypes
in interface JavaExecutable
resolve
- true
if the resolved types should be returned, otherwise false
public List<JavaAnnotation> getAnnotations()
AnnotatedElement.getAnnotations()
getAnnotations
in interface JavaAnnotatedElement
null
public String getCallSignature()
getCallSignature
in interface JavaMethod
public String getCodeBlock()
getCodeBlock
in interface JavaModel
public String getComment()
getComment
in interface JavaAnnotatedElement
null
public JavaClass getDeclaringClass()
Member.getDeclaringClass()
getDeclaringClass
in interface JavaExecutable
getDeclaringClass
in interface JavaMember
public String getDeclarationSignature(boolean withModifiers)
getDeclarationSignature
in interface JavaMethod
withModifiers
- true
if modifiers should be added, otherwise false
public List<JavaClass> getExceptions()
Executable.getExceptionTypes()
getExceptions
in interface JavaExecutable
null
public List<JavaType> getExceptionTypes()
getExceptionTypes
in interface JavaExecutable
public boolean isDefault()
Method.isDefault()
isDefault
in interface JavaMethod
true
if this is a default method of an interface, otherwise false
public int getLineNumber()
getLineNumber
in interface JavaModel
public List<String> getModifiers()
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
in interface JavaMember
public String getName()
Member.getName()
getName
in interface JavaMember
public String getNamedParameter(String tagName, String parameterName)
getTagByName(String).getNamedParameter(String)
that also checks for null tag.getNamedParameter
in interface JavaAnnotatedElement
tagName
- the tag nameparameterName
- the parameter namenull
public JavaParameter getParameterByName(String name)
getParameterByName
in interface JavaExecutable
name
- the name of the parameterJavaParameter
matching the name, otherwise null
public List<JavaParameter> getParameters()
Executable.getParameterTypes()
, where a JavaParameter also contains the original name if available.getParameters
in interface JavaExecutable
null
public String getPropertyName()
getPropertyName
in interface JavaMethod
null
if this method
is not a property mutator or property accessor.public JavaType getPropertyType()
getPropertyType
in interface JavaMethod
null
if this method
is not a property mutator or property accessor.public JavaClass getReturns()
getReturns
in interface JavaMethod
public String getSourceCode()
getSourceCode
in interface JavaExecutable
public DocletTag getTagByName(String name, boolean inherited)
getTagByName
in interface JavaMethod
public DocletTag getTagByName(String name)
getTagByName
in interface JavaAnnotatedElement
name
- the name of the doclettag trying to retrievenull
public List<DocletTag> getTags()
getTags
in interface JavaAnnotatedElement
null
public List<DocletTag> getTagsByName(String name, boolean inherited)
getTagsByName
in interface JavaMethod
public List<DocletTag> getTagsByName(String name)
getTagsByName
in interface JavaAnnotatedElement
name
- the name of the doclet tagnull
public List<JavaTypeVariable<JavaMethod>> getTypeParameters()
GenericDeclaration.getTypeParameters()
getTypeParameters
in interface JavaGenericDeclaration
null
public boolean isAbstract()
Modifier.isAbstract(int)
isAbstract
in interface JavaMember
true
if this member is abstract
, otherwise false
public boolean isFinal()
Modifier.isFinal(int)
isFinal
in interface JavaMember
true
is this member is final
, otherwise false
public boolean isNative()
Modifier.isNative(int)
isNative
in interface JavaMember
true
if this member is native
, otherwise false
public boolean isPrivate()
Modifier.isPrivate(int)
isPrivate
in interface JavaMember
true
if this member is private
, otherwise false
public 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 JavaMethod
true
if this method is a Java Bean accessor, otherwise false
public 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 JavaMethod
true
if this method is a Java Bean mutator, otherwise false
public boolean isProtected()
Modifier.isProtected(int)
isProtected
in interface JavaMember
true
if this member is protected
; otherwise false
public boolean isPublic()
Modifier.isPublic(int)
isPublic
in interface JavaMember
true
if this member is public
, otherwise false
public boolean isStatic()
Modifier.isStatic(int)
isStatic
in interface JavaMember
true
if this member is static
, otherwise false
public boolean isStrictfp()
Modifier.isStrict(int)
isStrictfp
in interface JavaMember
true
if this member is strictfp
, otherwise false
public boolean isSynchronized()
Modifier.isSynchronized(int)
isSynchronized
in interface JavaMember
true
if this member is synchronized
, otherwise false
public boolean isTransient()
Modifier.isTransient(int)
isTransient
in interface JavaMember
true
if this member is transient
, otherwise false
public boolean isVarArgs()
Executable.isVarArgs()
isVarArgs
in interface JavaExecutable
true
if the final parameter is a varArg, otherwise false
public boolean isVolatile()
Modifier.isVolatile(int)
isVolatile
in interface JavaMember
true
if this member is volatile
, otherwise false
public boolean signatureMatches(String name, List<JavaType> parameterTypes, boolean varArg)
signatureMatches
in interface JavaMethod
name
- the name of the methodparameterTypes
- 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
public boolean signatureMatches(String name, List<JavaType> parameterTypes)
signatureMatches
in interface JavaMethod
name
- the name of the methodparameterTypes
- the parameter types of the method, can be null
true
if this method matches the signature, otherwise false
public JavaType getReturnType()
getReturnType
in interface JavaMethod
public List<JavaType> getParameterTypes()
Executable.getParameterTypes()
getParameterTypes
in interface JavaExecutable
null
Copyright © 2002–2017. All rights reserved.