org.springframework.roo.classpath.details
Class DefaultItdTypeDetails

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
                  extended by org.springframework.roo.classpath.details.DefaultItdTypeDetails
All Implemented Interfaces:
IdentifiableAnnotatedJavaStructure, IdentifiableJavaStructure, ItdTypeDetails, MemberHoldingTypeDetails, PhysicalTypeDetails, org.springframework.roo.model.CustomDataAccessor

public class DefaultItdTypeDetails
extends AbstractMemberHoldingTypeDetails
implements ItdTypeDetails

Default representation of an ItdTypeDetails.

Provides a basic hashCode() that is used for detecting significant changes in AbstractItdMetadataProvider and avoiding downstream notifications accordingly.

Since:
1.0
Author:
Ben Alex, Stefan Schmidt

Method Summary
 boolean extendsType(org.springframework.roo.model.JavaType type)
          Indicates whether this type extends the given type.
 org.springframework.roo.model.JavaType getAspect()
          Returns the name of type which holds the aspect itself.
 List<? extends ConstructorMetadata> getDeclaredConstructors()
           
 List<FieldMetadata> getDeclaredFields()
           
 List<InitializerMetadata> getDeclaredInitializers()
           
 List<ClassOrInterfaceTypeDetails> getDeclaredInnerTypes()
           
 List<MethodMetadata> getDeclaredMethods()
           
 Set<org.springframework.roo.model.JavaType> getDeclarePrecedence()
          Set of aspect declared on declare precedence AspectJ declaration.
 List<String> getDynamicFinderNames()
          Returns the names of any dynamic finders
 List<org.springframework.roo.model.JavaType> getExtendsTypes()
          Lists the classes this type extends.
 List<DeclaredFieldAnnotationDetails> getFieldAnnotations()
          Lists the field-level annotations.
 ClassOrInterfaceTypeDetails getGovernor()
          Returns the ClassOrInterfaceTypeDetails representing the governor of this ITD.
 List<org.springframework.roo.model.JavaType> getImplementsTypes()
          Lists the classes this type implements.
 List<ClassOrInterfaceTypeDetails> getInnerTypes()
          Lists the inner types.
 List<DeclaredMethodAnnotationDetails> getMethodAnnotations()
          Lists the method-level annotations.
 org.springframework.roo.model.JavaType getName()
           
 PhysicalTypeCategory getPhysicalTypeCategory()
           
 Set<org.springframework.roo.model.JavaType> getRegisteredImports()
           
 org.springframework.roo.model.JavaType getType()
          Returns the JavaType provided by this physical type.
 int hashCode()
           
 boolean implementsAny(org.springframework.roo.model.JavaType... types)
          Indicates whether this type implements the given types.
 boolean isPrivilegedAspect()
           
 String toString()
           
 
Methods inherited from class org.springframework.roo.classpath.details.AbstractMemberHoldingTypeDetails
getDeclaredConstructor, getDeclaredField, getDeclaredInnerType, getField, getFieldsWithAnnotation, getLayerEntities, getMethod, getMethod, getMethods, getUniqueFieldName, implementsType
 
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, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.springframework.roo.classpath.details.MemberHoldingTypeDetails
getDeclaredConstructor, getDeclaredField, getDeclaredInnerType, getField, getFieldsWithAnnotation, getLayerEntities, getMethod, getMethod, getMethods, getUniqueFieldName, implementsType
 
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

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

Specified by:
extendsType in interface MemberHoldingTypeDetails
Parameters:
type - the supertype being checked for (required)
Returns:
see above

getAspect

public org.springframework.roo.model.JavaType getAspect()
Description copied from interface: ItdTypeDetails
Returns the name of type which holds the aspect itself.

Note that the type receiving the introductions can be determined via PhysicalTypeDetails.getName().

Specified by:
getAspect in interface ItdTypeDetails
Returns:
the aspect JavaType (never null)

getDeclaredConstructors

public List<? extends ConstructorMetadata> getDeclaredConstructors()
Specified by:
getDeclaredConstructors in interface MemberHoldingTypeDetails

getDeclaredFields

public List<FieldMetadata> getDeclaredFields()
Specified by:
getDeclaredFields in interface MemberHoldingTypeDetails

getDeclaredInitializers

public List<InitializerMetadata> getDeclaredInitializers()
Specified by:
getDeclaredInitializers in interface MemberHoldingTypeDetails

getDeclaredInnerTypes

public List<ClassOrInterfaceTypeDetails> getDeclaredInnerTypes()
Specified by:
getDeclaredInnerTypes in interface MemberHoldingTypeDetails

getDeclaredMethods

public List<MethodMetadata> getDeclaredMethods()
Specified by:
getDeclaredMethods in interface MemberHoldingTypeDetails

getDynamicFinderNames

public List<String> getDynamicFinderNames()
Description copied from interface: MemberHoldingTypeDetails
Returns the names of any dynamic finders

Specified by:
getDynamicFinderNames in interface MemberHoldingTypeDetails
Returns:
a non-null list

getExtendsTypes

public List<org.springframework.roo.model.JavaType> getExtendsTypes()
Description copied from interface: MemberHoldingTypeDetails
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.

Specified by:
getExtendsTypes in interface MemberHoldingTypeDetails
Returns:
an unmodifiable representation of classes this type extends (may be empty, but never null)

getFieldAnnotations

public List<DeclaredFieldAnnotationDetails> getFieldAnnotations()
Description copied from interface: ItdTypeDetails
Lists the field-level annotations.

This includes those annotations declared on the field, together with those defined via the ITD "declare @field: DestinationType: @Annotation" feature.

Specified by:
getFieldAnnotations in interface ItdTypeDetails
Returns:
an unmodifiable representation of the field and the annotations declared on this field (may be empty, but never null)

getGovernor

public ClassOrInterfaceTypeDetails getGovernor()
Description copied from interface: ItdTypeDetails
Returns the ClassOrInterfaceTypeDetails representing the governor of this ITD.

Specified by:
getGovernor in interface ItdTypeDetails
Returns:
the governor ClassOrInterfaceTypeDetails (never null)

getImplementsTypes

public List<org.springframework.roo.model.JavaType> getImplementsTypes()
Description copied from interface: MemberHoldingTypeDetails
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.

Specified by:
getImplementsTypes in interface MemberHoldingTypeDetails
Returns:
an unmodifiable representation of classes this type implements (may be empty, but never null)

getInnerTypes

public List<ClassOrInterfaceTypeDetails> getInnerTypes()
Description copied from interface: ItdTypeDetails
Lists the inner types.

Specified by:
getInnerTypes in interface ItdTypeDetails
Returns:
an unmodifiable representation of the inner types (may be empty but never null)

getMethodAnnotations

public List<DeclaredMethodAnnotationDetails> getMethodAnnotations()
Description copied from interface: ItdTypeDetails
Lists the method-level annotations.

This includes those annotations declared on the method, together with those defined via the ITD "declare @field: DestinationType: @Annotation" feature.

Specified by:
getMethodAnnotations in interface ItdTypeDetails
Returns:
an unmodifiable representation of the method and the annotations declared on this method (may be empty, but never null)

getName

public org.springframework.roo.model.JavaType getName()
Specified by:
getName in interface PhysicalTypeDetails
See Also:
#getType(), which returns the same thing but is better named

getPhysicalTypeCategory

public PhysicalTypeCategory getPhysicalTypeCategory()
Specified by:
getPhysicalTypeCategory in interface PhysicalTypeDetails
Returns:
the category of Java type being provided by this PhysicalTypeDetails instance (never null)

getRegisteredImports

public Set<org.springframework.roo.model.JavaType> getRegisteredImports()
Specified by:
getRegisteredImports in interface ItdTypeDetails
Returns:
the explicitly-registered imports this user wishes to have defined in the ITD (cannot be null, but may be empty)

getType

public org.springframework.roo.model.JavaType getType()
Description copied from interface: PhysicalTypeDetails
Returns the JavaType provided by this physical type. If possible, indicates any type parameters.

Specified by:
getType in interface PhysicalTypeDetails
Returns:
the full name of the type that members will eventually be available from when compiled, including any available type parameters (may be null if unable to parse)

hashCode

public int hashCode()
Overrides:
hashCode in class Object

implementsAny

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

Specified by:
implementsAny in interface MemberHoldingTypeDetails
Parameters:
types - the interfaces being checked for (required)
Returns:
see above

isPrivilegedAspect

public boolean isPrivilegedAspect()
Specified by:
isPrivilegedAspect in interface ItdTypeDetails

getDeclarePrecedence

public Set<org.springframework.roo.model.JavaType> getDeclarePrecedence()
Description copied from interface: ItdTypeDetails
Set of aspect declared on declare precedence AspectJ declaration.

Specified by:
getDeclarePrecedence in interface ItdTypeDetails
Returns:
ordered aspect declared

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2009–2015. All rights reserved.