|
Forge - Parent 1.0.5-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.forge.parser.java.impl.MethodImpl<O>
public class MethodImpl<O extends JavaSource<O>>
Constructor Summary | |
---|---|
MethodImpl(O parent)
|
|
MethodImpl(O parent,
Object internal)
|
|
MethodImpl(O parent,
String method)
|
Method Summary | |
---|---|
Annotation<O> |
addAnnotation()
Add a new annotation instance to this T . |
Annotation<O> |
addAnnotation(Class<? extends Annotation> clazz)
Add a new annotation instance to this T , using the given Class as the annotation type. |
Annotation<O> |
addAnnotation(String className)
Add a new annotation instance to this T , using the given String className as the annotation type. |
Method<O> |
addThrows(Class<? extends Exception> type)
Add a thrown Exception to this method's signature. |
Method<O> |
addThrows(String type)
Add a thrown Exception to this method's signature. |
boolean |
equals(Object obj)
|
Annotation<O> |
getAnnotation(Class<? extends Annotation> type)
|
Annotation<O> |
getAnnotation(String type)
|
List<Annotation<O>> |
getAnnotations()
|
String |
getBody()
Get the inner body of this Method |
Object |
getInternal()
Returns the implementation-specific Object representing this . |
String |
getName()
|
O |
getOrigin()
|
List<Parameter> |
getParameters()
Get a list of this Method 's parameters. |
String |
getQualifiedReturnType()
Get the fully qualified return type of this Method or return null if the return type is void. |
String |
getReturnType()
Get the return type of this Method or return null if the return type is void. |
Type<O> |
getReturnTypeInspector()
Get the return Type of this Method or return null if the return type is void. |
List<String> |
getThrownExceptions()
Get a list of qualified (if possible) Exception class names thrown by this method. |
Visibility |
getVisibility()
|
boolean |
hasAnnotation(Class<? extends Annotation> type)
|
boolean |
hasAnnotation(String type)
|
int |
hashCode()
|
boolean |
isAbstract()
|
boolean |
isConstructor()
Return true if this Method is a constructor for the class in which it is defined. |
boolean |
isFinal()
|
boolean |
isPackagePrivate()
|
boolean |
isPrivate()
|
boolean |
isProtected()
|
boolean |
isPublic()
|
boolean |
isReturnTypeVoid()
Return true if this Method has a return type of 'void' |
boolean |
isStatic()
|
Method<O> |
removeAnnotation(Annotation<O> annotation)
|
Method<O> |
removeThrows(Class<? extends Exception> type)
Remove a thrown Exception to this method's signature. |
Method<O> |
removeThrows(String type)
Remove a thrown Exception to this method's signature. |
Method<O> |
setAbstract(boolean abstrct)
|
Method<O> |
setBody(String body)
Set the inner body of this Method |
Method<O> |
setConstructor(boolean constructor)
Toggle this method as a constructor. |
Method<O> |
setFinal(boolean finl)
|
Method<O> |
setName(String name)
Set the name of this Method |
Method<O> |
setPackagePrivate()
|
Method<O> |
setParameters(String parameters)
Set this Method 's parameters. |
Method<O> |
setPrivate()
|
Method<O> |
setProtected()
|
Method<O> |
setPublic()
|
Method<O> |
setReturnType(Class<?> type)
Set this Method to return the given type. |
Method<O> |
setReturnType(JavaSource<?> type)
Set this Method to return the given JavaSource type. |
Method<O> |
setReturnType(String typeName)
Set this Method to return the given type. |
Method<O> |
setReturnTypeVoid()
Set this Method to return 'void' |
Method<O> |
setStatic(boolean statc)
|
Method<O> |
setVisibility(Visibility scope)
|
String |
toSignature()
Convert this Method into a string representing its unique signature. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MethodImpl(O parent)
public MethodImpl(O parent, Object internal)
public MethodImpl(O parent, String method)
Method Detail |
---|
public String toSignature()
Method
Method
into a string representing its unique signature.
toSignature
in interface Method<O extends JavaSource<O>>
public Annotation<O> addAnnotation()
AnnotationTarget
T
. (Note that an import statement must be added manually if
required.)
addAnnotation
in interface AnnotationTarget<O extends JavaSource<O>,Method<O extends JavaSource<O>>>
public Annotation<O> addAnnotation(Class<? extends Annotation> clazz)
AnnotationTarget
T
, using the given Class
as the annotation type. Attempt to
add an import statement to this object's O
if required.
addAnnotation
in interface AnnotationTarget<O extends JavaSource<O>,Method<O extends JavaSource<O>>>
public Annotation<O> addAnnotation(String className)
AnnotationTarget
T
, using the given String
className as the annotation type.
Attempt to add an import statement to this object's O
if required. (Note that the given className must be
fully-qualified in order to properly import required classes)
addAnnotation
in interface AnnotationTarget<O extends JavaSource<O>,Method<O extends JavaSource<O>>>
public List<Annotation<O>> getAnnotations()
getAnnotations
in interface AnnotationTarget<O extends JavaSource<O>,Method<O extends JavaSource<O>>>
public boolean hasAnnotation(Class<? extends Annotation> type)
hasAnnotation
in interface AnnotationTarget<O extends JavaSource<O>,Method<O extends JavaSource<O>>>
public boolean hasAnnotation(String type)
hasAnnotation
in interface AnnotationTarget<O extends JavaSource<O>,Method<O extends JavaSource<O>>>
public Method<O> removeAnnotation(Annotation<O> annotation)
removeAnnotation
in interface AnnotationTarget<O extends JavaSource<O>,Method<O extends JavaSource<O>>>
public Annotation<O> getAnnotation(Class<? extends Annotation> type)
getAnnotation
in interface AnnotationTarget<O extends JavaSource<O>,Method<O extends JavaSource<O>>>
public Annotation<O> getAnnotation(String type)
getAnnotation
in interface AnnotationTarget<O extends JavaSource<O>,Method<O extends JavaSource<O>>>
public String getBody()
Method
Method
getBody
in interface Method<O extends JavaSource<O>>
public Method<O> setBody(String body)
Method
Method
setBody
in interface Method<O extends JavaSource<O>>
public Method<O> setConstructor(boolean constructor)
Method
Method
is not the same as the name of
its parent JavaClass
, update the name of the to match.
setConstructor
in interface Method<O extends JavaSource<O>>
public boolean isConstructor()
Method
Method
is a constructor for the class in which it is defined.
isConstructor
in interface Method<O extends JavaSource<O>>
public String getReturnType()
Method
Method
or return null if the return type is void.
getReturnType
in interface Method<O extends JavaSource<O>>
public String getQualifiedReturnType()
Method
Method
or return null if the return type is void.
getQualifiedReturnType
in interface Method<O extends JavaSource<O>>
public Type<O> getReturnTypeInspector()
Method
Type
of this Method
or return null if the return type is void.
getReturnTypeInspector
in interface Method<O extends JavaSource<O>>
public Method<O> setReturnType(Class<?> type)
Method
Method
to return the given type.
setReturnType
in interface Method<O extends JavaSource<O>>
public Method<O> setReturnType(String typeName)
Method
Method
to return the given type.
setReturnType
in interface Method<O extends JavaSource<O>>
public Method<O> setReturnType(JavaSource<?> type)
Method
Method
to return the given JavaSource
type.
setReturnType
in interface Method<O extends JavaSource<O>>
public boolean isReturnTypeVoid()
Method
Method
has a return type of 'void'
isReturnTypeVoid
in interface Method<O extends JavaSource<O>>
public Method<O> setReturnTypeVoid()
Method
Method
to return 'void'
setReturnTypeVoid
in interface Method<O extends JavaSource<O>>
public boolean isAbstract()
isAbstract
in interface Abstractable<Method<O extends JavaSource<O>>>
public Method<O> setAbstract(boolean abstrct)
setAbstract
in interface Abstractable<Method<O extends JavaSource<O>>>
public boolean isFinal()
isFinal
in interface Member<O extends JavaSource<O>,Method<O extends JavaSource<O>>>
public Method<O> setFinal(boolean finl)
setFinal
in interface Member<O extends JavaSource<O>,Method<O extends JavaSource<O>>>
public boolean isStatic()
isStatic
in interface Member<O extends JavaSource<O>,Method<O extends JavaSource<O>>>
public Method<O> setStatic(boolean statc)
setStatic
in interface Member<O extends JavaSource<O>,Method<O extends JavaSource<O>>>
public String getName()
getName
in interface Member<O extends JavaSource<O>,Method<O extends JavaSource<O>>>
public Method<O> setName(String name)
Method
Method
setName
in interface Method<O extends JavaSource<O>>
public Method<O> setParameters(String parameters)
Method
Method
's parameters.
setParameters
in interface Method<O extends JavaSource<O>>
public List<Parameter> getParameters()
Method
Method
's parameters.
getParameters
in interface Method<O extends JavaSource<O>>
public boolean isPackagePrivate()
isPackagePrivate
in interface VisibilityScoped<Method<O extends JavaSource<O>>>
public Method<O> setPackagePrivate()
setPackagePrivate
in interface VisibilityScoped<Method<O extends JavaSource<O>>>
public boolean isPublic()
isPublic
in interface VisibilityScoped<Method<O extends JavaSource<O>>>
public Method<O> setPublic()
setPublic
in interface VisibilityScoped<Method<O extends JavaSource<O>>>
public boolean isPrivate()
isPrivate
in interface VisibilityScoped<Method<O extends JavaSource<O>>>
public Method<O> setPrivate()
setPrivate
in interface VisibilityScoped<Method<O extends JavaSource<O>>>
public boolean isProtected()
isProtected
in interface VisibilityScoped<Method<O extends JavaSource<O>>>
public Method<O> setProtected()
setProtected
in interface VisibilityScoped<Method<O extends JavaSource<O>>>
public Visibility getVisibility()
getVisibility
in interface VisibilityScoped<Method<O extends JavaSource<O>>>
public Method<O> setVisibility(Visibility scope)
setVisibility
in interface VisibilityScoped<Method<O extends JavaSource<O>>>
public String toString()
toString
in class Object
public Object getInternal()
Internal
this
. Do not call this method unless
you are willing to risk breaking backwards compatibility if future versions do not use the same internal object
implementations.
getInternal
in interface Internal
public O getOrigin()
getOrigin
in interface Origin<O extends JavaSource<O>>
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
public Method<O> addThrows(Class<? extends Exception> type)
Method
Exception
to this method's signature.
addThrows
in interface Method<O extends JavaSource<O>>
public Method<O> addThrows(String type)
Method
Exception
to this method's signature.
addThrows
in interface Method<O extends JavaSource<O>>
public List<String> getThrownExceptions()
Method
Exception
class names thrown by this method.
getThrownExceptions
in interface Method<O extends JavaSource<O>>
public Method<O> removeThrows(Class<? extends Exception> type)
Method
Exception
to this method's signature.
removeThrows
in interface Method<O extends JavaSource<O>>
public Method<O> removeThrows(String type)
Method
Exception
to this method's signature.
removeThrows
in interface Method<O extends JavaSource<O>>
|
Forge - Parent 1.0.5-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |