|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||

java.lang.Objectspoon.reflect.factory.SubFactory
spoon.reflect.factory.ExecutableFactory
spoon.reflect.factory.MethodFactory
public class MethodFactory
The CtMethod sub-factory.
| Constructor Summary | |
|---|---|
MethodFactory(Factory factory)
Creates a new method sub-factory. |
|
| Method Summary | ||
|---|---|---|
|
create(CtClass<?> target,
java.util.Set<ModifierKind> modifiers,
CtTypeReference<R> returnType,
java.lang.String name,
java.util.List<CtParameter<?>> parameters,
java.util.Set<CtTypeReference<? extends java.lang.Throwable>> thrownTypes,
CtBlock<B> body)
Creates a method. |
|
|
create(CtType<?> target,
CtMethod<T> source,
boolean redirectReferences)
Creates a method by copying an existing method. |
|
|
create(CtType<?> target,
java.util.Set<ModifierKind> modifiers,
CtTypeReference<T> returnType,
java.lang.String name,
java.util.List<CtParameter<?>> parameters,
java.util.Set<CtTypeReference<? extends java.lang.Throwable>> thrownTypes)
Creates an empty method. |
|
|
createReference(CtMethod<T> m)
Creates a method reference. |
|
|
createReference(java.lang.reflect.Method method)
Creates a method reference from an actual method. |
|
java.util.Collection<CtMethod<java.lang.Void>> |
getMainMethods()
Gets all the main methods stored in this factory. |
|
| Methods inherited from class spoon.reflect.factory.ExecutableFactory |
|---|
createAnonymous, createParameter, createParameterReference, createReference, createReference, createReference, createReference, createReference, createReference |
| Methods inherited from class spoon.reflect.factory.SubFactory |
|---|
getFactory, setFactory, setParent |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MethodFactory(Factory factory)
factory - the parent factory| Method Detail |
|---|
public <R,B extends R> CtMethod<R> create(CtClass<?> target,
java.util.Set<ModifierKind> modifiers,
CtTypeReference<R> returnType,
java.lang.String name,
java.util.List<CtParameter<?>> parameters,
java.util.Set<CtTypeReference<? extends java.lang.Throwable>> thrownTypes,
CtBlock<B> body)
target - the class where the method is insertedmodifiers - the modifiersreturnType - the method's return typename - the method's nameparameters - the parametersthrownTypes - the thrown typesbody - the method's body
public <T> CtMethod<T> create(CtType<?> target,
CtMethod<T> source,
boolean redirectReferences)
T - the type of the methodtarget - the target type where the new method has to be inserted tosource - the source method to be copiedredirectReferences - tells if all the references to the owning type of the source
method should be redirected to the target type (true is
recommended for most uses)
public <T> CtMethod<T> create(CtType<?> target,
java.util.Set<ModifierKind> modifiers,
CtTypeReference<T> returnType,
java.lang.String name,
java.util.List<CtParameter<?>> parameters,
java.util.Set<CtTypeReference<? extends java.lang.Throwable>> thrownTypes)
target - the class where the method is insertedmodifiers - the modifiersreturnType - the method's return typename - the method's nameparameters - the parametersthrownTypes - the thrown typespublic <T> CtExecutableReference<T> createReference(CtMethod<T> m)
public <T> CtExecutableReference<T> createReference(java.lang.reflect.Method method)
public java.util.Collection<CtMethod<java.lang.Void>> getMainMethods()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||