org.springframework.roo.classpath.details
Class DefaultPhysicalTypeMetadata

java.lang.Object
  extended by org.springframework.roo.metadata.AbstractMetadataItem
      extended by org.springframework.roo.classpath.details.DefaultPhysicalTypeMetadata
All Implemented Interfaces:
MemberHoldingTypeDetailsMetadataItem<ClassOrInterfaceTypeDetails>, PhysicalTypeMetadata, org.springframework.roo.metadata.MetadataItem

public class DefaultPhysicalTypeMetadata
extends org.springframework.roo.metadata.AbstractMetadataItem
implements PhysicalTypeMetadata

The default PhysicalTypeMetadata implementation.


Field Summary
 
Fields inherited from class org.springframework.roo.metadata.AbstractMetadataItem
valid
 
Constructor Summary
DefaultPhysicalTypeMetadata(String metadataIdentificationString, String physicalLocationCanonicalPath, ClassOrInterfaceTypeDetails cid)
          Constructor
 
Method Summary
 String getItdCanoncialPath(ItdMetadataProvider metadataProvider)
          Obtains the canonical file path to where an ITD can be emitted for this physical Java type.
 String getItdCanonicalPath(ItdMetadataProvider metadataProvider)
          Obtains the canonical file path to where an ITD can be emitted for this physical Java type.
 org.springframework.roo.model.JavaType getItdJavaType(ItdMetadataProvider metadataProvider)
          Obtains the JavaType which represents an ITD for this physical Java type.
 ClassOrInterfaceTypeDetails getMemberHoldingTypeDetails()
          Obtains the MemberHoldingTypeDetails, if available.
 String getPhysicalLocationCanonicalPath()
           
 org.springframework.roo.model.JavaType getType()
          Returns the Java type for this physical type
 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
 

Constructor Detail

DefaultPhysicalTypeMetadata

public DefaultPhysicalTypeMetadata(String metadataIdentificationString,
                                   String physicalLocationCanonicalPath,
                                   ClassOrInterfaceTypeDetails cid)
Constructor

Parameters:
metadataIdentificationString - the ID to assign this MetadataItem (must satisfy PhysicalTypeIdentifier.isValid(String))
physicalLocationCanonicalPath - the canonical path of the file containing this Java type (required)
cid - the details of this type (required)
Method Detail

getItdCanoncialPath

public String getItdCanoncialPath(ItdMetadataProvider metadataProvider)
Description copied from interface: PhysicalTypeMetadata
Obtains the canonical file path to where an ITD can be emitted for this physical Java type.

Specified by:
getItdCanoncialPath in interface PhysicalTypeMetadata
Parameters:
metadataProvider - so the ItdMetadataProvider.getItdUniquenessFilenameSuffix() can be queried (never null)
Returns:
a full file path that can be used to produce an ITD (never null)

getItdCanonicalPath

public String getItdCanonicalPath(ItdMetadataProvider metadataProvider)
Description copied from interface: PhysicalTypeMetadata
Obtains the canonical file path to where an ITD can be emitted for this physical Java type.

Specified by:
getItdCanonicalPath in interface PhysicalTypeMetadata
Parameters:
metadataProvider - the MetadataProvider that produces the ITD in question (never null)
Returns:
a full file path that can be used to produce an ITD (never null)

getItdJavaType

public org.springframework.roo.model.JavaType getItdJavaType(ItdMetadataProvider metadataProvider)
Description copied from interface: PhysicalTypeMetadata
Obtains the JavaType which represents an ITD for this physical Java type.

Specified by:
getItdJavaType in interface PhysicalTypeMetadata
Parameters:
metadataProvider - so the ItdMetadataProvider.getItdUniquenessFilenameSuffix() can be queried (never null)
Returns:
the JavaType applicable for this ITD (never null)

getMemberHoldingTypeDetails

public ClassOrInterfaceTypeDetails getMemberHoldingTypeDetails()
Description copied from interface: MemberHoldingTypeDetailsMetadataItem
Obtains the MemberHoldingTypeDetails, if available.

An MemberHoldingTypeDetails 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:
getMemberHoldingTypeDetails in interface MemberHoldingTypeDetailsMetadataItem<ClassOrInterfaceTypeDetails>
Returns:
the details, or null if the details are unavailable or no member details are required

getPhysicalLocationCanonicalPath

public String getPhysicalLocationCanonicalPath()
Specified by:
getPhysicalLocationCanonicalPath in interface PhysicalTypeMetadata
Returns:
the location of the disk file containing this resource, in canonical name format (never null)

getType

public org.springframework.roo.model.JavaType getType()
Description copied from interface: PhysicalTypeMetadata
Returns the Java type for this physical type

Specified by:
getType in interface PhysicalTypeMetadata
Returns:
a non-null type

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2009–2015. All rights reserved.