|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.roo.metadata.AbstractMetadataItem
org.springframework.roo.classpath.itd.AbstractItdTypeDetailsProvidingMetadataItem
public abstract class AbstractItdTypeDetailsProvidingMetadataItem
Abstract implementation of ItdTypeDetailsProvidingMetadataItem, which
assumes the subclass will require a non-null
ClassOrInterfaceTypeDetails representing the governor and wishes to
build an ITD via the ItdTypeDetailsBuilder mechanism.
| Field Summary | |
|---|---|
protected org.springframework.roo.model.JavaType |
aspectName
|
protected ItdTypeDetailsBuilder |
builder
|
protected org.springframework.roo.model.JavaType |
destination
|
protected PhysicalTypeMetadata |
governorPhysicalTypeMetadata
|
protected ClassOrInterfaceTypeDetails |
governorTypeDetails
|
protected ItdTypeDetails |
itdTypeDetails
|
| Fields inherited from class org.springframework.roo.metadata.AbstractMetadataItem |
|---|
valid |
| Constructor Summary | |
|---|---|
protected |
AbstractItdTypeDetailsProvidingMetadataItem(String identifier,
org.springframework.roo.model.JavaType aspectName,
PhysicalTypeMetadata governorPhysicalTypeMetadata)
Validates input and constructs a superclass that implements ItdTypeDetailsProvidingMetadataItem. |
| Method Summary | |
|---|---|
protected void |
buildItd()
Generates the ItdTypeDetails from the current contents of this
instance's ItdTypeDetailsBuilder. |
protected void |
ensureGovernorExtends(org.springframework.roo.model.JavaType javaType)
Ensures that the governor extends the given type, i.e. introduces that type as a supertype iff it's not already one |
protected void |
ensureGovernorImplements(org.springframework.roo.model.JavaType javaType)
Ensures that the governor implements the given type. |
protected MethodMetadataBuilder |
getAccessorMethod(FieldMetadata field)
|
protected MethodMetadataBuilder |
getAccessorMethod(FieldMetadata field,
InvocableMemberBodyBuilder bodyBuilder)
|
protected MethodMetadataBuilder |
getAccessorMethod(org.springframework.roo.model.JavaSymbolName fieldName,
org.springframework.roo.model.JavaType fieldType)
|
protected MethodMetadataBuilder |
getAccessorMethod(org.springframework.roo.model.JavaSymbolName fieldName,
org.springframework.roo.model.JavaType fieldType,
InvocableMemberBodyBuilder bodyBuilder)
|
org.springframework.roo.model.JavaType |
getAspectName()
Return current aspect name |
protected FieldMetadataBuilder |
getField(int modifier,
org.springframework.roo.model.JavaSymbolName fieldName,
org.springframework.roo.model.JavaType fieldType,
String fieldInitializer)
Convenience method for returning a simple private field based on the field name, type, and initializer. |
protected FieldMetadataBuilder |
getField(org.springframework.roo.model.JavaSymbolName fieldName,
org.springframework.roo.model.JavaType fieldType)
|
protected MethodMetadata |
getGovernorMethod(org.springframework.roo.model.JavaSymbolName methodName,
org.springframework.roo.model.JavaType... parameterTypes)
Returns the given method of the governor. |
protected MethodMetadata |
getGovernorMethod(org.springframework.roo.model.JavaSymbolName methodName,
List<org.springframework.roo.model.JavaType> parameterTypes)
Returns the given method of the governor. |
ItdTypeDetails |
getMemberHoldingTypeDetails()
Obtains the MemberHoldingTypeDetails, if available. |
protected MethodMetadataBuilder |
getMethod(int modifier,
org.springframework.roo.model.JavaSymbolName methodName,
org.springframework.roo.model.JavaType returnType,
List<org.springframework.roo.model.JavaType> parameterTypes,
List<org.springframework.roo.model.JavaSymbolName> parameterNames,
InvocableMemberBodyBuilder bodyBuilder)
Returns a public method given the method name, return type, parameter types, parameter names, and method body. |
protected MethodMetadataBuilder |
getMutatorMethod(org.springframework.roo.model.JavaSymbolName fieldName,
org.springframework.roo.model.JavaType parameterType)
|
protected MethodMetadataBuilder |
getMutatorMethod(org.springframework.roo.model.JavaSymbolName fieldName,
org.springframework.roo.model.JavaType parameterType,
InvocableMemberBodyBuilder bodyBuilder)
|
protected AnnotationMetadata |
getTypeAnnotation(org.springframework.roo.model.JavaType annotationType)
Returns the metadata for an annotation of the given type if the governor does not already have one. |
protected boolean |
governorHasMethod(org.springframework.roo.model.JavaSymbolName methodName,
org.springframework.roo.model.JavaType... parameterTypes)
Indicates whether the governor has a method with the given signature. |
protected boolean |
governorHasMethod(org.springframework.roo.model.JavaSymbolName methodName,
List<org.springframework.roo.model.JavaType> parameterTypes)
Indicates whether the governor has a method with the given signature. |
protected boolean |
governorHasMethodWithSameName(org.springframework.roo.model.JavaSymbolName methodName)
Indicates whether the governor has a method with the given method name regardless of method parameters. |
int |
hashCode()
|
protected boolean |
isImplementing(ClassOrInterfaceTypeDetails clazz,
org.springframework.roo.model.JavaType interfaceTarget)
Determines if the presented class (or any of its superclasses) implements the target interface. |
String |
toString()
|
| Methods inherited from class org.springframework.roo.metadata.AbstractMetadataItem |
|---|
getId, isValid |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.springframework.roo.metadata.MetadataItem |
|---|
getId, isValid |
| Field Detail |
|---|
protected org.springframework.roo.model.JavaType aspectName
protected ItdTypeDetailsBuilder builder
protected org.springframework.roo.model.JavaType destination
protected PhysicalTypeMetadata governorPhysicalTypeMetadata
protected ClassOrInterfaceTypeDetails governorTypeDetails
protected ItdTypeDetails itdTypeDetails
| Constructor Detail |
|---|
protected AbstractItdTypeDetailsProvidingMetadataItem(String identifier,
org.springframework.roo.model.JavaType aspectName,
PhysicalTypeMetadata governorPhysicalTypeMetadata)
ItdTypeDetailsProvidingMetadataItem.
Exposes the ClassOrInterfaceTypeDetails of the governor, if
available. If they are not available, ensures AbstractMetadataItem.isValid() returns
false.
Subclasses should generally return immediately if AbstractMetadataItem.isValid() is
false. Subclasses should also attempt to set the itdTypeDetails
to contain the output of their ITD where AbstractMetadataItem.isValid() is true.
identifier - the identifier for this item of metadata (required)aspectName - the Java type of the ITD (required)governorPhysicalTypeMetadata - the governor, which is expected to
contain a ClassOrInterfaceTypeDetails (required)| Method Detail |
|---|
protected void buildItd()
ItdTypeDetails from the current contents of this
instance's ItdTypeDetailsBuilder.
protected final void ensureGovernorExtends(org.springframework.roo.model.JavaType javaType)
javaType - the type to extend (required)protected final void ensureGovernorImplements(org.springframework.roo.model.JavaType javaType)
javaType - the type to implement (required)protected MethodMetadataBuilder getAccessorMethod(FieldMetadata field)
protected MethodMetadataBuilder getAccessorMethod(FieldMetadata field,
InvocableMemberBodyBuilder bodyBuilder)
protected MethodMetadataBuilder getAccessorMethod(org.springframework.roo.model.JavaSymbolName fieldName,
org.springframework.roo.model.JavaType fieldType)
protected MethodMetadataBuilder getAccessorMethod(org.springframework.roo.model.JavaSymbolName fieldName,
org.springframework.roo.model.JavaType fieldType,
InvocableMemberBodyBuilder bodyBuilder)
protected FieldMetadataBuilder getField(int modifier,
org.springframework.roo.model.JavaSymbolName fieldName,
org.springframework.roo.model.JavaType fieldType,
String fieldInitializer)
fieldName - the field namefieldType - the field typefieldInitializer - the string to initialize the field with
protected FieldMetadataBuilder getField(org.springframework.roo.model.JavaSymbolName fieldName,
org.springframework.roo.model.JavaType fieldType)
protected MethodMetadata getGovernorMethod(org.springframework.roo.model.JavaSymbolName methodName,
org.springframework.roo.model.JavaType... parameterTypes)
methodName - the name of the method for which to searchparameterTypes - the method's parameter types
MemberFindingUtils.getDeclaredMethod(org.springframework.roo.classpath.details.MemberHoldingTypeDetails,
JavaSymbolName, List)
protected MethodMetadata getGovernorMethod(org.springframework.roo.model.JavaSymbolName methodName,
List<org.springframework.roo.model.JavaType> parameterTypes)
methodName - the name of the method for which to searchparameterTypes - the method's parameter types
MemberFindingUtils.getDeclaredMethod(org.springframework.roo.classpath.details.MemberHoldingTypeDetails,
JavaSymbolName, List)public final ItdTypeDetails getMemberHoldingTypeDetails()
MemberHoldingTypeDetailsMetadataItemMemberHoldingTypeDetails, if available.
An MemberHoldingTypeDetails should be returned even if no members
should be introduced. Only return null if there was a failure during
parsing or other unexpected condition.
getMemberHoldingTypeDetails in interface MemberHoldingTypeDetailsMetadataItem<ItdTypeDetails>
protected MethodMetadataBuilder getMethod(int modifier,
org.springframework.roo.model.JavaSymbolName methodName,
org.springframework.roo.model.JavaType returnType,
List<org.springframework.roo.model.JavaType> parameterTypes,
List<org.springframework.roo.model.JavaSymbolName> parameterNames,
InvocableMemberBodyBuilder bodyBuilder)
methodName - the method namereturnType - the return typeparameterTypes - a list of parameter typesparameterNames - a list of parameter namesbodyBuilder - the method body
protected MethodMetadataBuilder getMutatorMethod(org.springframework.roo.model.JavaSymbolName fieldName,
org.springframework.roo.model.JavaType parameterType)
protected MethodMetadataBuilder getMutatorMethod(org.springframework.roo.model.JavaSymbolName fieldName,
org.springframework.roo.model.JavaType parameterType,
InvocableMemberBodyBuilder bodyBuilder)
protected AnnotationMetadata getTypeAnnotation(org.springframework.roo.model.JavaType annotationType)
annotationType - the type of annotation to generate (required)
null if the governor already has that annotation
protected boolean governorHasMethod(org.springframework.roo.model.JavaSymbolName methodName,
org.springframework.roo.model.JavaType... parameterTypes)
methodName - the name of the method for which to searchparameterTypes - the method's parameter types
protected boolean governorHasMethod(org.springframework.roo.model.JavaSymbolName methodName,
List<org.springframework.roo.model.JavaType> parameterTypes)
methodName - the name of the method for which to searchparameterTypes - the method's parameter types
protected boolean governorHasMethodWithSameName(org.springframework.roo.model.JavaSymbolName methodName)
methodName - the name of the method for which to search
public int hashCode()
hashCode in class Object
protected boolean isImplementing(ClassOrInterfaceTypeDetails clazz,
org.springframework.roo.model.JavaType interfaceTarget)
clazz - the cid to searchinterfaceTarget - the interface to locate
public String toString()
toString in class Objectpublic org.springframework.roo.model.JavaType getAspectName()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||