|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.roo.classpath.layers.MemberTypeAdditions
public class MemberTypeAdditions
The required additions to a given type in order to invoke a given application
layer method, e.g. findAll(). Instances are immutable.
| Constructor Summary | |
|---|---|
MemberTypeAdditions(ClassOrInterfaceTypeDetailsBuilder builder,
String methodName,
String methodCall,
boolean isStatic,
List<MethodParameter> methodParameters)
Constructor that takes a pre-built method call. |
|
| Method Summary | |
|---|---|
void |
copyAdditionsTo(AbstractMemberHoldingTypeDetailsBuilder<?> targetBuilder,
ClassOrInterfaceTypeDetails governorClassOrInterfaceTypeDetails)
Copies this instance's additions (if any) into the given builder |
static MemberTypeAdditions |
getInstance(ClassOrInterfaceTypeDetailsBuilder builder,
String targetName,
String methodName,
boolean isStatic,
List<MethodParameter> parameters)
Factory method that builds the method call from the given target, method, and list of parameter names. |
static MemberTypeAdditions |
getInstance(ClassOrInterfaceTypeDetailsBuilder builder,
String targetName,
String methodName,
boolean isStatic,
MethodParameter... parameters)
Factory method that builds the method call from the given target, method, and array of parameter names. |
FieldMetadata |
getInvokedField()
Returns the field on which this method is invoked |
String |
getMethodCall()
Returns the snippet of Java code that calls the method in question, for example " personService.findAll()". |
String |
getMethodName()
Returns the bare name of the invoked method |
List<MethodParameter> |
getMethodParameters()
Returns the parameters taken by the invoked method |
boolean |
isStatic()
Indicates whether this is a static method call |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MemberTypeAdditions(ClassOrInterfaceTypeDetailsBuilder builder,
String methodName,
String methodCall,
boolean isStatic,
List<MethodParameter> methodParameters)
builder - stores any changes the caller should make in order to make
the given method call, e.g. the field that is the method
target; can be null if the caller requires no
changes other than the given method callmethodName - the bare name of the method being invoked (required)methodCall - a valid Java snippet that calls the method, including
any required target and parameters, for example "foo.bar(baz)"
(required)isStatic - whether the invoked method is staticmethodParameters - the parameters taken by the invoked method (can
be null)| Method Detail |
|---|
public static MemberTypeAdditions getInstance(ClassOrInterfaceTypeDetailsBuilder builder,
String targetName,
String methodName,
boolean isStatic,
List<MethodParameter> parameters)
builder - stores any changes the caller should make in order to make
the given method call, e.g. the field that is the method
target (required)targetName - the name of the object or class on which the method is
being invoked (if not blank, must be a valid Java name)methodName - the name of the method being invoked (must be a valid
Java name)isStatic - whether the invoked method is staticparameterNames - the names of any parameters passed to the method
(required)
public static MemberTypeAdditions getInstance(ClassOrInterfaceTypeDetailsBuilder builder,
String targetName,
String methodName,
boolean isStatic,
MethodParameter... parameters)
builder - stores any changes the caller should make in order to make
the given method call, e.g. the field that is the method
target (required)targetName - the name of the object or class on which the method is
being invoked (if not blank, must be a valid Java name)methodName - the name of the method being invoked (must be a valid
Java name)isStatic - whether the invoked method is staticparameterNames - the names of any parameters passed to the method
(required)
public void copyAdditionsTo(AbstractMemberHoldingTypeDetailsBuilder<?> targetBuilder,
ClassOrInterfaceTypeDetails governorClassOrInterfaceTypeDetails)
targetBuilder - the ITD builder to receive the additions (required)governorClassOrInterfaceTypeDetails - the
ClassOrInterfaceTypeDetails of the governor (required)public FieldMetadata getInvokedField()
null if it's a static method call
IllegalStateException - if there's more than one field in the
builderpublic String getMethodCall()
personService.findAll()".
public String getMethodName()
public List<MethodParameter> getMethodParameters()
null copy of this listpublic boolean isStatic()
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||