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() |
List<JavaType> |
getExceptionTypes() |
JavaClass |
getGenericReturnType()
Equivalent of java.lang.reflect.Method.getGenericReturnType()
|
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() |
List<JavaType> |
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
|
JavaClass |
getParentClass() |
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
|
JavaSource |
getSource()
The compilation unit, which includes the imports, the public and anonymous classes
|
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
Method.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 JavaMethod
public List<JavaAnnotation> getAnnotations()
JavaAnnotatedElement
AnnotatedElement.getAnnotations()
getAnnotations
in interface JavaAnnotatedElement
null
public String getCallSignature()
getCallSignature
in interface JavaMethod
public String getCodeBlock()
getCodeBlock
in interface JavaModel
public String getComment()
JavaAnnotatedElement
getComment
in interface JavaAnnotatedElement
null
public JavaClass getDeclaringClass()
JavaMember
Member.getDeclaringClass()
getDeclaringClass
in interface JavaMember
public String getDeclarationSignature(boolean withModifiers)
getDeclarationSignature
in interface JavaMethod
public List<JavaClass> getExceptions()
getExceptions
in interface JavaMethod
public List<JavaType> getExceptionTypes()
getExceptionTypes
in interface JavaMethod
public boolean isDefault()
JavaMethod
Method.isDefault()
isDefault
in interface JavaMethod
true
if this is a default method of an interface, otherwise false
public int getLineNumber()
JavaModel
getLineNumber
in interface JavaModel
public List<String> getModifiers()
JavaMember
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()
JavaMember
Member.getName()
getName
in interface JavaMember
public String getNamedParameter(String tagName, String parameterName)
JavaAnnotatedElement
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 JavaMethod
public List<JavaParameter> getParameters()
getParameters
in interface JavaMethod
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 JavaSource getSource()
JavaModel
getSource
in interface JavaModel
JavaSource
of this elementpublic String getSourceCode()
JavaMethod
getSourceCode
in interface JavaMethod
public DocletTag getTagByName(String name, boolean inherited)
getTagByName
in interface JavaMethod
public DocletTag getTagByName(String name)
JavaAnnotatedElement
getTagByName
in interface JavaAnnotatedElement
name
- the name of the doclettag trying to retrievenull
public List<DocletTag> getTags()
JavaAnnotatedElement
getTags
in interface JavaAnnotatedElement
null
public List<DocletTag> getTagsByName(String name, boolean inherited)
getTagsByName
in interface JavaMethod
public List<DocletTag> getTagsByName(String name)
JavaAnnotatedElement
getTagsByName
in interface JavaAnnotatedElement
name
- the name of the doclet tagnull
public List<JavaTypeVariable<JavaMethod>> getTypeParameters()
JavaGenericDeclaration
GenericDeclaration.getTypeParameters()
getTypeParameters
in interface JavaGenericDeclaration
null
public boolean isAbstract()
JavaMember
Modifier.isAbstract(int)
isAbstract
in interface JavaMember
true
if this member is abstract
, otherwise false
public boolean isFinal()
JavaMember
Modifier.isFinal(int)
isFinal
in interface JavaMember
true
is this member is final
, otherwise false
public boolean isNative()
JavaMember
Modifier.isNative(int)
isNative
in interface JavaMember
true
if this member is native
, otherwise false
public boolean isPrivate()
JavaMember
Modifier.isPrivate(int)
isPrivate
in interface JavaMember
true
if this member is private
, otherwise false
public boolean isPropertyAccessor()
JavaMethod
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()
JavaMethod
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()
JavaMember
Modifier.isProtected(int)
isProtected
in interface JavaMember
true
if this member is protected
; otherwise false
public boolean isPublic()
JavaMember
Modifier.isPublic(int)
isPublic
in interface JavaMember
true
if this member is public
, otherwise false
public boolean isStatic()
JavaMember
Modifier.isStatic(int)
isStatic
in interface JavaMember
true
if this member is static
, otherwise false
public boolean isStrictfp()
JavaMember
Modifier.isStrict(int)
isStrictfp
in interface JavaMember
true
if this member is strictfp
, otherwise false
public boolean isSynchronized()
JavaMember
Modifier.isSynchronized(int)
isSynchronized
in interface JavaMember
true
if this member is synchronized
, otherwise false
public boolean isTransient()
JavaMember
Modifier.isTransient(int)
isTransient
in interface JavaMember
true
if this member is transient
, otherwise false
public boolean isVarArgs()
JavaMethod
Method.isVarArgs()
isVarArgs
in interface JavaMethod
true
if this method was declared to take a variable number of arguments,
otherwise false
public boolean isVolatile()
JavaMember
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)
JavaMethod
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()
JavaMethod
getReturnType
in interface JavaMethod
public List<JavaType> getParameterTypes()
getParameterTypes
in interface JavaMethod
public JavaClass getParentClass()
getParentClass
in interface JavaMethod
getParentClass
in interface ParameterDeclarator
public JavaClass getGenericReturnType()
JavaMethod
getGenericReturnType
in interface JavaMethod
Copyright © 2002–2014. All rights reserved.