org.springframework.roo.classpath.details
Class DefaultItdTypeDetails

java.lang.Object
  extended by org.springframework.roo.classpath.details.DefaultItdTypeDetails
All Implemented Interfaces:
ItdTypeDetails, MemberHoldingTypeDetails, PhysicalTypeDetails

public class DefaultItdTypeDetails
extends Object
implements ItdTypeDetails

Default representation of an ItdTypeDetails.

Since:
1.0
Author:
Ben Alex, Stefan Schmidt

Constructor Summary
DefaultItdTypeDetails(ClassOrInterfaceTypeDetails governor, org.springframework.roo.model.JavaType aspect, boolean privilegedAspect, Set<org.springframework.roo.model.JavaType> registeredImports, List<ConstructorMetadata> declaredConstructors, List<FieldMetadata> declaredFields, List<MethodMetadata> declaredMethods, List<org.springframework.roo.model.JavaType> extendsTypes, List<org.springframework.roo.model.JavaType> implementsTypes, List<AnnotationMetadata> typeAnnotations, List<DeclaredFieldAnnotationDetails> fieldAnnotations, List<DeclaredMethodAnnotationDetails> methodAnnotations)
           
 
Method Summary
 org.springframework.roo.model.JavaType getAspect()
          Returns the name of type which holds the aspect itself.
static DefaultItdTypeDetailsBuilder getBuilder(String declaredByMetadataId, ClassOrInterfaceTypeDetails governor, org.springframework.roo.model.JavaType aspect, boolean privilegedAspect)
           
 List<? extends ConstructorMetadata> getDeclaredConstructors()
           
 List<? extends FieldMetadata> getDeclaredFields()
           
 List<? extends MethodMetadata> getDeclaredMethods()
           
 List<org.springframework.roo.model.JavaType> getExtendsTypes()
          Lists the classes this type extends.
 List<DeclaredFieldAnnotationDetails> getFieldAnnotations()
          Lists the field-level annotations.
 ClassOrInterfaceTypeDetails getGovernor()
           
 List<org.springframework.roo.model.JavaType> getImplementsTypes()
          Lists the classes this type implements.
 List<DeclaredMethodAnnotationDetails> getMethodAnnotations()
          Lists the method-level annotations.
 org.springframework.roo.model.JavaType getName()
          If possible, indicates any type parameters.
 PhysicalTypeCategory getPhysicalTypeCategory()
           
 Set<org.springframework.roo.model.JavaType> getRegisteredImports()
           
 List<? extends AnnotationMetadata> getTypeAnnotations()
          Lists the type-level annotations.
 boolean isPrivilegedAspect()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultItdTypeDetails

public DefaultItdTypeDetails(ClassOrInterfaceTypeDetails governor,
                             org.springframework.roo.model.JavaType aspect,
                             boolean privilegedAspect,
                             Set<org.springframework.roo.model.JavaType> registeredImports,
                             List<ConstructorMetadata> declaredConstructors,
                             List<FieldMetadata> declaredFields,
                             List<MethodMetadata> declaredMethods,
                             List<org.springframework.roo.model.JavaType> extendsTypes,
                             List<org.springframework.roo.model.JavaType> implementsTypes,
                             List<AnnotationMetadata> typeAnnotations,
                             List<DeclaredFieldAnnotationDetails> fieldAnnotations,
                             List<DeclaredMethodAnnotationDetails> methodAnnotations)
Method Detail

getBuilder

public static DefaultItdTypeDetailsBuilder getBuilder(String declaredByMetadataId,
                                                      ClassOrInterfaceTypeDetails governor,
                                                      org.springframework.roo.model.JavaType aspect,
                                                      boolean privilegedAspect)

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)

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)

getPhysicalTypeCategory

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

getName

public org.springframework.roo.model.JavaType getName()
Description copied from interface: PhysicalTypeDetails
If possible, indicates any type parameters.

Specified by:
getName 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)

getGovernor

public ClassOrInterfaceTypeDetails getGovernor()

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)

isPrivilegedAspect

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

getDeclaredConstructors

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

getDeclaredFields

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

getDeclaredMethods

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

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)

getTypeAnnotations

public List<? extends AnnotationMetadata> getTypeAnnotations()
Description copied from interface: MemberHoldingTypeDetails
Lists the type-level annotations.

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

Specified by:
getTypeAnnotations in interface MemberHoldingTypeDetails
Returns:
an unmodifiable representation of annotations declared on this type (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)

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)

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2009-2010 VMware, Inc. All Rights Reserved.