org.springframework.roo.classpath.details
Class DefaultClassOrInterfaceTypeDetails

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

public class DefaultClassOrInterfaceTypeDetails
extends Object
implements ClassOrInterfaceTypeDetails

Default representation of a ClassOrInterfaceTypeDetails.

Since:
1.0
Author:
Ben Alex

Constructor Summary
DefaultClassOrInterfaceTypeDetails(String declaredByMetadataId, org.springframework.roo.model.JavaType name, int modifier, PhysicalTypeCategory physicalTypeCategory, List<AnnotationMetadata> typeAnnotations)
           
DefaultClassOrInterfaceTypeDetails(String declaredByMetadataId, org.springframework.roo.model.JavaType name, int modifier, PhysicalTypeCategory physicalTypeCategory, List<ConstructorMetadata> declaredConstructors, List<FieldMetadata> declaredFields, List<MethodMetadata> declaredMethods, ClassOrInterfaceTypeDetails superclass, List<org.springframework.roo.model.JavaType> extendsTypes, List<org.springframework.roo.model.JavaType> implementsTypes, List<AnnotationMetadata> typeAnnotations, List<org.springframework.roo.model.JavaSymbolName> enumConstants)
           
 
Method Summary
 String getDeclaredByMetadataId()
          Obtains the physical type identifier that included this ClassOrInterfaceTypeDetails.
 List<? extends ConstructorMetadata> getDeclaredConstructors()
           
 List<? extends FieldMetadata> getDeclaredFields()
           
 List<? extends MethodMetadata> getDeclaredMethods()
           
 List<org.springframework.roo.model.JavaSymbolName> getEnumConstants()
          Lists the enum constants this type provides.
 List<org.springframework.roo.model.JavaType> getExtendsTypes()
          Lists the classes this type extends.
 List<org.springframework.roo.model.JavaType> getImplementsTypes()
          Lists the classes this type implements.
 int getModifier()
          Obtains the modifiers, in a format consistent with Modifier.
 org.springframework.roo.model.JavaType getName()
          If possible, indicates any type parameters.
 PhysicalTypeCategory getPhysicalTypeCategory()
           
 ClassOrInterfaceTypeDetails getSuperclass()
          Obtains the superclass if this is a class and it is available.
 List<? extends AnnotationMetadata> getTypeAnnotations()
          Lists the type-level annotations.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultClassOrInterfaceTypeDetails

public DefaultClassOrInterfaceTypeDetails(String declaredByMetadataId,
                                          org.springframework.roo.model.JavaType name,
                                          int modifier,
                                          PhysicalTypeCategory physicalTypeCategory,
                                          List<AnnotationMetadata> typeAnnotations)

DefaultClassOrInterfaceTypeDetails

public DefaultClassOrInterfaceTypeDetails(String declaredByMetadataId,
                                          org.springframework.roo.model.JavaType name,
                                          int modifier,
                                          PhysicalTypeCategory physicalTypeCategory,
                                          List<ConstructorMetadata> declaredConstructors,
                                          List<FieldMetadata> declaredFields,
                                          List<MethodMetadata> declaredMethods,
                                          ClassOrInterfaceTypeDetails superclass,
                                          List<org.springframework.roo.model.JavaType> extendsTypes,
                                          List<org.springframework.roo.model.JavaType> implementsTypes,
                                          List<AnnotationMetadata> typeAnnotations,
                                          List<org.springframework.roo.model.JavaSymbolName> enumConstants)
Method Detail

getDeclaredByMetadataId

public String getDeclaredByMetadataId()
Description copied from interface: ClassOrInterfaceTypeDetails
Obtains the physical type identifier that included this ClassOrInterfaceTypeDetails.

Specified by:
getDeclaredByMetadataId in interface ClassOrInterfaceTypeDetails
Returns:
the physical type identifier (never null)

getModifier

public int getModifier()
Description copied from interface: ClassOrInterfaceTypeDetails
Obtains the modifiers, in a format consistent with Modifier.

Specified by:
getModifier in interface ClassOrInterfaceTypeDetails
Returns:
the modifiers (zero means no modifiers)

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)

getDeclaredConstructors

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

getEnumConstants

public List<org.springframework.roo.model.JavaSymbolName> getEnumConstants()
Description copied from interface: ClassOrInterfaceTypeDetails
Lists the enum constants this type provides. Always empty except if an enum type.

Specified by:
getEnumConstants in interface ClassOrInterfaceTypeDetails
Returns:
the constants (may be empty, but never null)

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)

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)

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)

getSuperclass

public ClassOrInterfaceTypeDetails getSuperclass()
Description copied from interface: ClassOrInterfaceTypeDetails
Obtains the superclass if this is a class and it is available.

Specified by:
getSuperclass in interface ClassOrInterfaceTypeDetails
Returns:
the superclass, if available (null will be returned for interfaces, or if the class isn't available)

toString

public String toString()
Overrides:
toString in class Object


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