org.springframework.roo.classpath.details
Class AbstractMemberHoldingTypeDetails

java.lang.Object
  extended by org.springframework.roo.model.AbstractCustomDataAccessorProvider
      extended by org.springframework.roo.classpath.details.AbstractIdentifiableJavaStructureProvider
          extended by org.springframework.roo.classpath.details.AbstractIdentifiableAnnotatedJavaStructureProvider
              extended by org.springframework.roo.classpath.details.AbstractMemberHoldingTypeDetails
All Implemented Interfaces:
IdentifiableAnnotatedJavaStructure, IdentifiableJavaStructure, MemberHoldingTypeDetails, PhysicalTypeDetails, org.springframework.roo.model.CustomDataAccessor
Direct Known Subclasses:
DefaultClassOrInterfaceTypeDetails, DefaultItdTypeDetails

public abstract class AbstractMemberHoldingTypeDetails
extends AbstractIdentifiableAnnotatedJavaStructureProvider
implements MemberHoldingTypeDetails

Convenient superclass for MemberHoldingTypeDetails implementations.

Since:
1.2.0
Author:
Andrew Swan

Constructor Summary
protected AbstractMemberHoldingTypeDetails(org.springframework.roo.model.CustomData customData, String declaredByMetadataId, int modifier, Collection<AnnotationMetadata> annotations)
          Constructor
 
Method Summary
 ConstructorMetadata getDeclaredConstructor(List<org.springframework.roo.model.JavaType> parameters)
          Locates the constructor with the specified parameter types.
 FieldMetadata getDeclaredField(org.springframework.roo.model.JavaSymbolName fieldName)
          Locates the specified field.
 ClassOrInterfaceTypeDetails getDeclaredInnerType(org.springframework.roo.model.JavaType typeName)
          Locates an inner type with the specified name.
 FieldMetadata getField(org.springframework.roo.model.JavaSymbolName fieldName)
          Searches up the inheritance hierarchy until the first field with the specified name is located.
 List<FieldMetadata> getFieldsWithAnnotation(org.springframework.roo.model.JavaType annotation)
          Searches up the inheritance hierarchy and locates all declared fields which are annotated with the specified annotation.
 List<org.springframework.roo.model.JavaType> getLayerEntities()
          If this is a layering component, for example a service or repository, returns the domain entities managed by this component, otherwise returns an empty list.
 MethodMetadata getMethod(org.springframework.roo.model.JavaSymbolName methodName)
          Searches up the inheritance hierarchy until the first method with the specified name is located; method parameters are not taken into account.
 MethodMetadata getMethod(org.springframework.roo.model.JavaSymbolName methodName, List<org.springframework.roo.model.JavaType> parameters)
          Searches up the inheritance hierarchy until the first method with the specified name and parameters is located.
 List<MethodMetadata> getMethods()
          Locates all methods on this class and its superclasses.
 org.springframework.roo.model.JavaSymbolName getUniqueFieldName(String proposedName)
          Generates a unique name for a field, starting from the given proposed name and adding underscores until it's unique.
 boolean implementsType(org.springframework.roo.model.JavaType interfaceType)
          Indicates whether this type implements the given interface.
 
Methods inherited from class org.springframework.roo.classpath.details.AbstractIdentifiableAnnotatedJavaStructureProvider
getAnnotation, getAnnotations, getTypeAnnotation
 
Methods inherited from class org.springframework.roo.classpath.details.AbstractIdentifiableJavaStructureProvider
getDeclaredByMetadataId, getModifier
 
Methods inherited from class org.springframework.roo.model.AbstractCustomDataAccessorProvider
getCustomData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.springframework.roo.classpath.details.MemberHoldingTypeDetails
extendsType, getDeclaredConstructors, getDeclaredFields, getDeclaredInitializers, getDeclaredInnerTypes, getDeclaredMethods, getDynamicFinderNames, getExtendsTypes, getImplementsTypes, implementsAny
 
Methods inherited from interface org.springframework.roo.classpath.PhysicalTypeDetails
getName, getPhysicalTypeCategory, getType
 
Methods inherited from interface org.springframework.roo.classpath.details.IdentifiableAnnotatedJavaStructure
getAnnotation, getAnnotations, getTypeAnnotation
 
Methods inherited from interface org.springframework.roo.classpath.details.IdentifiableJavaStructure
getDeclaredByMetadataId, getModifier
 
Methods inherited from interface org.springframework.roo.model.CustomDataAccessor
getCustomData
 

Constructor Detail

AbstractMemberHoldingTypeDetails

protected AbstractMemberHoldingTypeDetails(org.springframework.roo.model.CustomData customData,
                                           String declaredByMetadataId,
                                           int modifier,
                                           Collection<AnnotationMetadata> annotations)
Constructor

Parameters:
customData -
declaredByMetadataId -
modifier -
annotations -
Method Detail

getDeclaredConstructor

public ConstructorMetadata getDeclaredConstructor(List<org.springframework.roo.model.JavaType> parameters)
Description copied from interface: MemberHoldingTypeDetails
Locates the constructor with the specified parameter types.

Specified by:
getDeclaredConstructor in interface MemberHoldingTypeDetails
Parameters:
parameters - to locate (can be null if there are no parameters)
Returns:
the constructor, or null if not found

getDeclaredField

public FieldMetadata getDeclaredField(org.springframework.roo.model.JavaSymbolName fieldName)
Description copied from interface: MemberHoldingTypeDetails
Locates the specified field.

Specified by:
getDeclaredField in interface MemberHoldingTypeDetails
Parameters:
fieldName - to locate (can be null)
Returns:
the field, or null if not found

getDeclaredInnerType

public ClassOrInterfaceTypeDetails getDeclaredInnerType(org.springframework.roo.model.JavaType typeName)
Description copied from interface: MemberHoldingTypeDetails
Locates an inner type with the specified name.

Specified by:
getDeclaredInnerType in interface MemberHoldingTypeDetails
Parameters:
typeName - to locate (required)

getField

public FieldMetadata getField(org.springframework.roo.model.JavaSymbolName fieldName)
Description copied from interface: MemberHoldingTypeDetails
Searches up the inheritance hierarchy until the first field with the specified name is located.

Specified by:
getField in interface MemberHoldingTypeDetails
Parameters:
fieldName - to locate (required)
Returns:
the field, or null if not found

getFieldsWithAnnotation

public List<FieldMetadata> getFieldsWithAnnotation(org.springframework.roo.model.JavaType annotation)
Description copied from interface: MemberHoldingTypeDetails
Searches up the inheritance hierarchy and locates all declared fields which are annotated with the specified annotation.

Specified by:
getFieldsWithAnnotation in interface MemberHoldingTypeDetails
Parameters:
annotation - to locate (required)
Returns:
all the located fields (never null, but may be empty)

getLayerEntities

public List<org.springframework.roo.model.JavaType> getLayerEntities()
Description copied from interface: MemberHoldingTypeDetails
If this is a layering component, for example a service or repository, returns the domain entities managed by this component, otherwise returns an empty list.

Specified by:
getLayerEntities in interface MemberHoldingTypeDetails
Returns:
a non-null list (may be empty)

getMethod

public MethodMetadata getMethod(org.springframework.roo.model.JavaSymbolName methodName)
Description copied from interface: MemberHoldingTypeDetails
Searches up the inheritance hierarchy until the first method with the specified name is located; method parameters are not taken into account.

Specified by:
getMethod in interface MemberHoldingTypeDetails
Parameters:
methodName - to locate (required)
Returns:
the method, or null if not found

getMethod

public MethodMetadata getMethod(org.springframework.roo.model.JavaSymbolName methodName,
                                List<org.springframework.roo.model.JavaType> parameters)
Description copied from interface: MemberHoldingTypeDetails
Searches up the inheritance hierarchy until the first method with the specified name and parameters is located.

Specified by:
getMethod in interface MemberHoldingTypeDetails
Parameters:
methodName - to locate (required)
parameters - to locate (can be null if there are no parameters)
Returns:
the method, or null if not found

getMethods

public List<MethodMetadata> getMethods()
Description copied from interface: MemberHoldingTypeDetails
Locates all methods on this class and its superclasses.

Specified by:
getMethods in interface MemberHoldingTypeDetails
Returns:
zero or more methods (never null)

getUniqueFieldName

public org.springframework.roo.model.JavaSymbolName getUniqueFieldName(String proposedName)
Description copied from interface: MemberHoldingTypeDetails
Generates a unique name for a field, starting from the given proposed name and adding underscores until it's unique.

Specified by:
getUniqueFieldName in interface MemberHoldingTypeDetails
Parameters:
proposedName - the proposed field name (required)
Returns:
a non-null name that's unique within the governor
See Also:
MemberFindingUtils.getField(org.springframework.roo.classpath.details.MemberHoldingTypeDetails, JavaSymbolName)

implementsType

public boolean implementsType(org.springframework.roo.model.JavaType interfaceType)
Description copied from interface: MemberHoldingTypeDetails
Indicates whether this type implements the given interface. Equivalent to calling MemberHoldingTypeDetails.getImplementsTypes() and checking whether the given type is in the returned list.

Specified by:
implementsType in interface MemberHoldingTypeDetails
Returns:
see above


Copyright © 2009–2015. All rights reserved.