org.springframework.roo.classpath.itd
Class AbstractItdTypeDetailsProvidingMetadataItem

java.lang.Object
  extended by org.springframework.roo.metadata.AbstractMetadataItem
      extended by org.springframework.roo.classpath.itd.AbstractItdTypeDetailsProvidingMetadataItem
All Implemented Interfaces:
ItdTypeDetailsProvidingMetadataItem, org.springframework.roo.metadata.MetadataItem

public class AbstractItdTypeDetailsProvidingMetadataItem
extends org.springframework.roo.metadata.AbstractMetadataItem
implements ItdTypeDetailsProvidingMetadataItem

Abstract implementation of ItdTypeDetailsProvidingMetadataItem, which assumes the subclass will require a non-null ClassOrInterfaceTypeDetails representing the governor and wishes to build an ITD via the DefaultItdTypeDetailsBuilder mechanism.

Since:
1.0
Author:
Ben Alex

Field Summary
protected  org.springframework.roo.model.JavaType aspectName
           
protected  DefaultItdTypeDetailsBuilder builder
           
protected  org.springframework.roo.model.JavaType destination
           
protected  PhysicalTypeMetadata governorPhysicalTypeMetadata
           
protected  ClassOrInterfaceTypeDetails governorTypeDetails
           
protected  ItdTypeDetails itdTypeDetails
           
 
Fields inherited from class org.springframework.roo.metadata.AbstractMetadataItem
valid
 
Constructor Summary
AbstractItdTypeDetailsProvidingMetadataItem(String identifier, org.springframework.roo.model.JavaType aspectName, PhysicalTypeMetadata governorPhysicalTypeMetadata)
          Validates input and constructs a superclass that implements ItdTypeDetailsProvidingMetadataItem.
 
Method Summary
 ItdTypeDetails getItdTypeDetails()
          Obtains the ItdTypeDetails, if available.
 String toString()
           
 
Methods inherited from class org.springframework.roo.metadata.AbstractMetadataItem
getId, isValid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.springframework.roo.metadata.MetadataItem
getId, isValid
 

Field Detail

governorTypeDetails

protected ClassOrInterfaceTypeDetails governorTypeDetails

itdTypeDetails

protected ItdTypeDetails itdTypeDetails

destination

protected org.springframework.roo.model.JavaType destination

aspectName

protected org.springframework.roo.model.JavaType aspectName

governorPhysicalTypeMetadata

protected PhysicalTypeMetadata governorPhysicalTypeMetadata

builder

protected DefaultItdTypeDetailsBuilder builder
Constructor Detail

AbstractItdTypeDetailsProvidingMetadataItem

public AbstractItdTypeDetailsProvidingMetadataItem(String identifier,
                                                   org.springframework.roo.model.JavaType aspectName,
                                                   PhysicalTypeMetadata governorPhysicalTypeMetadata)
Validates input and constructs a superclass that implements ItdTypeDetailsProvidingMetadataItem.

Exposes the ClassOrInterfaceTypeDetails of the governor, if available. If they are not available, ensures AbstractMetadataItem.isValid() returns false.

Subclasses should generally return immediately if AbstractMetadataItem.isValid() is false. Subclasses should also attempt to set the itdTypeDetails to contain the output of their ITD where AbstractMetadataItem.isValid() is true.

Parameters:
identifier - the identifier for this item of metadata (required)
aspectName - the Java type of the ITD (required)
governorPhysicalTypeMetadata - the governor, which is expected to contain a ClassOrInterfaceTypeDetails (required)
Method Detail

getItdTypeDetails

public final ItdTypeDetails getItdTypeDetails()
Description copied from interface: ItdTypeDetailsProvidingMetadataItem
Obtains the ItdTypeDetails, if available.

An ItdTypeDetails should be returned even if no members should be introduced. Only return null if there was a failure during parsing or other unexpected condition.

Specified by:
getItdTypeDetails in interface ItdTypeDetailsProvidingMetadataItem
Returns:
the details, or null if the details are unavailable or no ITD is required

toString

public String toString()
Overrides:
toString in class Object


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