org.springframework.roo.classpath.details
Interface MemberHoldingTypeDetails

All Superinterfaces:
org.springframework.roo.model.CustomDataAccessor, IdentifiableAnnotatedJavaStructure, IdentifiableJavaStructure, PhysicalTypeDetails
All Known Subinterfaces:
ClassOrInterfaceTypeDetails, ItdTypeDetails
All Known Implementing Classes:
AbstractMemberHoldingTypeDetails, DefaultClassOrInterfaceTypeDetails, DefaultItdTypeDetails

public interface MemberHoldingTypeDetails
extends PhysicalTypeDetails, IdentifiableAnnotatedJavaStructure

Immutable representation of the members of a class, interface, enum or aspect.

Since:
1.0
Author:
Ben Alex

Method Summary
 boolean extendsType(org.springframework.roo.model.JavaType type)
          Indicates whether this type extends the given type.
 ConstructorMetadata getDeclaredConstructor(List<org.springframework.roo.model.JavaType> parameters)
          Locates the constructor with the specified parameter types.
 List<? extends ConstructorMetadata> getDeclaredConstructors()
           
 FieldMetadata getDeclaredField(org.springframework.roo.model.JavaSymbolName fieldName)
          Locates the specified field.
 List<? extends FieldMetadata> getDeclaredFields()
           
 List<? extends InitializerMetadata> getDeclaredInitializers()
           
 ClassOrInterfaceTypeDetails getDeclaredInnerType(org.springframework.roo.model.JavaType typeName)
          Locates an inner type with the specified name.
 List<ClassOrInterfaceTypeDetails> getDeclaredInnerTypes()
           
 List<? extends MethodMetadata> getDeclaredMethods()
           
 List<String> getDynamicFinderNames()
          Returns the names of any dynamic finders
 List<org.springframework.roo.model.JavaType> getExtendsTypes()
          Lists the classes this type extends.
 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> getImplementsTypes()
          Lists the classes this type implements.
 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 implementsAny(org.springframework.roo.model.JavaType... type)
          Indicates whether this type implements the given types.
 boolean implementsType(org.springframework.roo.model.JavaType interfaceType)
          Indicates whether this type implements the given interface.
 
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
 

Method Detail

extendsType

boolean extendsType(org.springframework.roo.model.JavaType type)
Indicates whether this type extends the given type. Equivalent to calling getExtendsTypes() and checking whether the given type is in the returned list.

Parameters:
type - the supertype being checked for (required)
Returns:
see above

getDeclaredConstructor

ConstructorMetadata getDeclaredConstructor(List<org.springframework.roo.model.JavaType> parameters)
Locates the constructor with the specified parameter types.

Parameters:
parameters - to locate (can be null if there are no parameters)
Returns:
the constructor, or null if not found
Since:
1.2.0

getDeclaredConstructors

List<? extends ConstructorMetadata> getDeclaredConstructors()

getDeclaredField

FieldMetadata getDeclaredField(org.springframework.roo.model.JavaSymbolName fieldName)
Locates the specified field.

Parameters:
fieldName - to locate (can be null)
Returns:
the field, or null if not found
Since:
1.2.0

getDeclaredFields

List<? extends FieldMetadata> getDeclaredFields()

getDeclaredInitializers

List<? extends InitializerMetadata> getDeclaredInitializers()

getDeclaredInnerType

ClassOrInterfaceTypeDetails getDeclaredInnerType(org.springframework.roo.model.JavaType typeName)
Locates an inner type with the specified name.

Parameters:
typeName - to locate (required)
Since:
1.2.0

getDeclaredInnerTypes

List<ClassOrInterfaceTypeDetails> getDeclaredInnerTypes()

getDeclaredMethods

List<? extends MethodMetadata> getDeclaredMethods()

getDynamicFinderNames

List<String> getDynamicFinderNames()
Returns the names of any dynamic finders

Returns:
a non-null list
Since:
1.2.0

getExtendsTypes

List<org.springframework.roo.model.JavaType> getExtendsTypes()
Lists the classes this type extends. This may be empty. Always empty in the case of an enum.

While a List is used, normally in Java a class will only extend a single other class. A List is used to support interfaces, as well as support the special "declare parents: DestinationType extends SuperclassType" feature of ITDs which permits effectively multiple inheritance.

Returns:
an unmodifiable representation of classes this type extends (may be empty, but never null)

getField

FieldMetadata getField(org.springframework.roo.model.JavaSymbolName fieldName)
Searches up the inheritance hierarchy until the first field with the specified name is located.

Parameters:
fieldName - to locate (required)
Returns:
the field, or null if not found
Since:
1.2.0

getFieldsWithAnnotation

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.

Parameters:
annotation - to locate (required)
Returns:
all the located fields (never null, but may be empty)
Since:
1.2.0

getImplementsTypes

List<org.springframework.roo.model.JavaType> getImplementsTypes()
Lists the classes this type implements. Always empty in the case of an interface.

A List is used to support interfaces, as well as support the special "declare parents: DestinationType implements SomeInterfaceType" feature of ITDs.

Returns:
an unmodifiable representation of classes this type implements (may be empty, but never null)

getLayerEntities

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.

Returns:
a non-null list (may be empty)
Since:
1.2.0

getMethod

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.

Parameters:
methodName - to locate (required)
Returns:
the method, or null if not found
Since:
1.2.0

getMethod

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.

Parameters:
methodName - to locate (required)
parameters - to locate (can be null if there are no parameters)
Returns:
the method, or null if not found
Since:
1.2.0

getMethods

List<MethodMetadata> getMethods()
Locates all methods on this class and its superclasses.

Returns:
zero or more methods (never null)

getUniqueFieldName

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.

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

implementsAny

boolean implementsAny(org.springframework.roo.model.JavaType... type)
Indicates whether this type implements the given types. Equivalent to calling getImplementsTypes() and checking whether the given types are in the returned list.

Parameters:
type - the interfaces being checked for (required)
Returns:
see above

implementsType

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

Parameters:
type - the interface being checked for (required)
Returns:
see above


Copyright © 2009–2015. All rights reserved.