Package spoon.reflect.factory
Class ExecutableFactory
java.lang.Object
spoon.reflect.factory.SubFactory
spoon.reflect.factory.ExecutableFactory
- Direct Known Subclasses:
ConstructorFactory
,MethodFactory
The
CtExecutable
sub-factory.-
Field Summary
Fields inherited from class spoon.reflect.factory.SubFactory
factory
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateAnonymous(CtClass<?> target, CtBlock<Void> body)
Creates an anonymous executable (initializer block) in a target class).<T> CtParameter<T>
createParameter(CtExecutable<?> parent, CtTypeReference<T> type, String name)
Creates a new parameter.<T> CtParameterReference<T>
createParameterReference(CtParameter<T> parameter)
Creates a parameter reference from an existing parameter.<T> CtExecutableReference<T>
createReference(String signature)
Creates an executable reference from its signature, as defined by the executable reference's toString.<T> CtExecutableReference<T>
createReference(CtExecutable<T> e)
Creates an executable reference from an existing executable.<T> CtExecutableReference<T>
createReference(CtTypeReference<?> declaringType, boolean isStatic, CtTypeReference<T> type, String methodName, List<CtTypeReference<?>> parameterTypes)
Creates an executable reference.<T> CtExecutableReference<T>
createReference(CtTypeReference<?> declaringType, boolean isStatic, CtTypeReference<T> type, String methodName, CtTypeReference<?>... parameterTypes)
Creates an executable reference.<T> CtExecutableReference<T>
createReference(CtTypeReference<?> declaringType, CtTypeReference<T> type, String methodName, List<CtTypeReference<?>> parameterTypes)
Creates an executable reference.<T> CtExecutableReference<T>
createReference(CtTypeReference<?> declaringType, CtTypeReference<T> type, String methodName, CtTypeReference<?>... parameterTypes)
Creates an executable reference.
-
Constructor Details
-
ExecutableFactory
Creates a new executable sub-factory.- Parameters:
factory
- the parent factory
-
-
Method Details
-
createAnonymous
Creates an anonymous executable (initializer block) in a target class). -
createParameter
public <T> CtParameter<T> createParameter(CtExecutable<?> parent, CtTypeReference<T> type, String name)Creates a new parameter. -
createParameterReference
Creates a parameter reference from an existing parameter.- Type Parameters:
T
- the parameter's type- Parameters:
parameter
- the parameter
-
createReference
Creates an executable reference from an existing executable. -
createReference
public <T> CtExecutableReference<T> createReference(CtTypeReference<?> declaringType, CtTypeReference<T> type, String methodName, CtTypeReference<?>... parameterTypes)Creates an executable reference.- Parameters:
declaringType
- reference to the declaring typetype
- the executable's typemethodName
- simple nameparameterTypes
- list of parameter's types
-
createReference
public <T> CtExecutableReference<T> createReference(CtTypeReference<?> declaringType, boolean isStatic, CtTypeReference<T> type, String methodName, CtTypeReference<?>... parameterTypes)Creates an executable reference.- Parameters:
declaringType
- reference to the declaring typeisStatic
- if this reference references a static executabletype
- the return type of the executablemethodName
- simple nameparameterTypes
- list of parameter's types
-
createReference
public <T> CtExecutableReference<T> createReference(CtTypeReference<?> declaringType, boolean isStatic, CtTypeReference<T> type, String methodName, List<CtTypeReference<?>> parameterTypes)Creates an executable reference.- Parameters:
declaringType
- reference to the declaring typeisStatic
- if this reference references a static executabletype
- the return type of the executablemethodName
- simple nameparameterTypes
- list of parameter's types
-
createReference
public <T> CtExecutableReference<T> createReference(CtTypeReference<?> declaringType, CtTypeReference<T> type, String methodName, List<CtTypeReference<?>> parameterTypes)Creates an executable reference.- Parameters:
declaringType
- reference to the declaring typetype
- the return type of the executablemethodName
- simple nameparameterTypes
- list of parameter's types
-
createReference
Creates an executable reference from its signature, as defined by the executable reference's toString.
-