SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool

com.solarmetric.rd.kodo.meta
Class ClassMetaDataImpl

java.lang.Object
  |
  +--com.solarmetric.rd.kodo.meta.ExtensionsImpl
        |
        +--com.solarmetric.rd.kodo.meta.ClassMetaDataImpl
All Implemented Interfaces:
ClassMetaData, java.lang.Comparable, Extensions, SourceTracker

public class ClassMetaDataImpl
extends ExtensionsImpl
implements ClassMetaData

Default ClassMetaData implementation.


Field Summary
 
Fields inherited from interface com.solarmetric.rd.kodo.meta.ClassMetaData
CAN_CACHE, ID_APPLICATION, ID_DATASTORE, ID_NONE
 
Constructor Summary
ClassMetaDataImpl()
          Default constructor.
ClassMetaDataImpl(java.lang.Class type)
          Constructor.
 
Method Summary
 void addDeclaredField(com.solarmetric.rd.kodo.meta.FieldMetaData field)
          Add a persistent or transactional field to this class.
protected  boolean cacheDeclaredFields()
           
 int compareTo(java.lang.Object other)
           
 boolean getCanCache()
          Return true if the ClassMetaData.CAN_CACHE extension key is true.
 com.solarmetric.rd.kodo.meta.FieldMetaData getDeclaredField(int index)
          Return the metadata for the persistent or transactional field with the given relative index.
 com.solarmetric.rd.kodo.meta.FieldMetaData getDeclaredField(java.lang.String name)
          Return the metadata for the persistent or transactional field with the given name, without including superclass fields.
 com.solarmetric.rd.kodo.meta.FieldMetaData[] getDeclaredFields()
          Return only the fields for this class, without superclass fields.
 com.solarmetric.rd.kodo.meta.FieldMetaData[] getDeclaredUnmanagedFields()
          Return any fields that were added as non-managed.
 java.lang.Class getDescribedType()
          Return the persistence capable class described by this metadata.
 com.solarmetric.rd.kodo.meta.FieldMetaData getField(int index)
          Return the metadata for the persistent or transactional field with the given absolute index.
 com.solarmetric.rd.kodo.meta.FieldMetaData getField(java.lang.String name)
          Return the metadata for the persistent or transactional field with the given name.
 com.solarmetric.rd.kodo.meta.FieldMetaData[] getFields()
          Return all field metadatas, including superclass fields.
 int getIdentityType()
          Return the type of JDO identity being used.
 java.lang.Class getObjectIdClass()
          Return the metadata-specified class to use for the object ID, or null if not specified.
 java.lang.Class getPCSuperclass()
          Return the persistence capable superclass of the described type, or null if the metadata did not specify one.
 com.solarmetric.rd.kodo.meta.ClassMetaData getPCSuperclassMetaData()
          Return the metadata for the persistence capable superclass of the described type, or null if the metadata did not specify one.
 java.lang.ClassLoader getPMClassLoader()
          The class persistence manager loader used when parsing this metadata.
 com.solarmetric.rd.kodo.meta.FieldMetaData[] getPrimaryKeyFields()
          Return primary key fields, or empty array if none.
 com.solarmetric.rd.kodo.meta.JDOMetaDataRepository getRepository()
          Return the owning repository.
 boolean getRequiresExtent()
          Return true if the type requires management via extent.
 java.io.File getSourceFile()
          Return the source file the metadata was parsed from, if any.
 boolean getValidate()
          Return true if the metadata will validate itself when resolved.
 void invalidateResolve()
          For implemntation use.
 boolean isEnhanced()
          Returns true if the class has been enhanced.
 boolean isInstanceCallbacks()
          Return true if the class implements InstanceCallbacks.
 boolean removeDeclaredField(com.solarmetric.rd.kodo.meta.FieldMetaData field)
          Remove the given field from management.
 boolean resolve()
          For implementation use.
 void setCanCache(boolean cacheable)
          Set the value of the ClassMetaData.CAN_CACHE standard extension.
 void setDescribedType(java.lang.Class type)
          Return the persistence capable class described by this metadata.
 void setIdentityType(int type)
          Set the type of JDO identity used by this class.
 void setObjectIdClass(java.lang.Class cls)
          Set the metadata-specified class to use for the object ID.
 void setPCSuperclass(java.lang.Class pc)
          Set the persistence capable superclass of the described type.
 void setPMClassLoader(java.lang.ClassLoader loader)
          The class persistence manager loader used when parsing this metadata.
 void setRepository(com.solarmetric.rd.kodo.meta.JDOMetaDataRepository repos)
          Set the owning repository.
 void setRequiresExtent(boolean req)
          Set whether the type requires extent management.
 void setSourceFile(java.io.File file)
          Set the source file the metadata was parsed from.
 void setValidate(boolean validate)
          Set to false to turn off validation on resolve.
 java.lang.String toString()
           
 
Methods inherited from class com.solarmetric.rd.kodo.meta.ExtensionsImpl
addExtension, addExtension, getBooleanExtension, getBooleanExtension, getDoubleExtension, getDoubleExtension, getEmbeddedExtensions, getEmbeddedExtensions, getExtensionKeys, getExtensionKeys, getExtensionVendors, getIntExtension, getIntExtension, getObjectExtension, getObjectExtension, getStringExtension, getStringExtension, hasExtension, hasExtension, isEmpty, removeEmbeddedExtensions, removeEmbeddedExtensions, removeExtension, removeExtension
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.solarmetric.rd.kodo.meta.Extensions
addExtension, addExtension, getBooleanExtension, getBooleanExtension, getDoubleExtension, getDoubleExtension, getEmbeddedExtensions, getEmbeddedExtensions, getExtensionKeys, getExtensionKeys, getExtensionVendors, getIntExtension, getIntExtension, getObjectExtension, getObjectExtension, getStringExtension, getStringExtension, hasExtension, hasExtension, isEmpty, removeEmbeddedExtensions, removeEmbeddedExtensions, removeExtension, removeExtension
 

Constructor Detail

ClassMetaDataImpl

public ClassMetaDataImpl()
Default constructor.


ClassMetaDataImpl

public ClassMetaDataImpl(java.lang.Class type)
Constructor. Supply described type.

Method Detail

getPMClassLoader

public java.lang.ClassLoader getPMClassLoader()
Description copied from interface: ClassMetaData
The class persistence manager loader used when parsing this metadata. The class metadata should use this loader when loading metadata for its superclass and field types.

Specified by:
getPMClassLoader in interface ClassMetaData

setPMClassLoader

public void setPMClassLoader(java.lang.ClassLoader loader)
Description copied from interface: ClassMetaData
The class persistence manager loader used when parsing this metadata. The class metadata should use this loader when loading metadata for its superclass and field types.

Specified by:
setPMClassLoader in interface ClassMetaData

getValidate

public boolean getValidate()
Description copied from interface: ClassMetaData
Return true if the metadata will validate itself when resolved.

Specified by:
getValidate in interface ClassMetaData

setValidate

public void setValidate(boolean validate)
Description copied from interface: ClassMetaData
Set to false to turn off validation on resolve.

Specified by:
setValidate in interface ClassMetaData

getRepository

public com.solarmetric.rd.kodo.meta.JDOMetaDataRepository getRepository()
Description copied from interface: ClassMetaData
Return the owning repository.

Specified by:
getRepository in interface ClassMetaData

setRepository

public void setRepository(com.solarmetric.rd.kodo.meta.JDOMetaDataRepository repos)
Description copied from interface: ClassMetaData
Set the owning repository.

Specified by:
setRepository in interface ClassMetaData

getSourceFile

public java.io.File getSourceFile()
Description copied from interface: ClassMetaData
Return the source file the metadata was parsed from, if any.

Specified by:
getSourceFile in interface ClassMetaData

setSourceFile

public void setSourceFile(java.io.File file)
Description copied from interface: ClassMetaData
Set the source file the metadata was parsed from.

Specified by:
setSourceFile in interface ClassMetaData

getDescribedType

public java.lang.Class getDescribedType()
Description copied from interface: ClassMetaData
Return the persistence capable class described by this metadata.

Specified by:
getDescribedType in interface ClassMetaData

setDescribedType

public void setDescribedType(java.lang.Class type)
Description copied from interface: ClassMetaData
Return the persistence capable class described by this metadata.

Specified by:
setDescribedType in interface ClassMetaData

getPCSuperclass

public java.lang.Class getPCSuperclass()
Description copied from interface: ClassMetaData
Return the persistence capable superclass of the described type, or null if the metadata did not specify one.

Specified by:
getPCSuperclass in interface ClassMetaData

setPCSuperclass

public void setPCSuperclass(java.lang.Class pc)
Description copied from interface: ClassMetaData
Set the persistence capable superclass of the described type.

Specified by:
setPCSuperclass in interface ClassMetaData

getPCSuperclassMetaData

public com.solarmetric.rd.kodo.meta.ClassMetaData getPCSuperclassMetaData()
Description copied from interface: ClassMetaData
Return the metadata for the persistence capable superclass of the described type, or null if the metadata did not specify one.

Specified by:
getPCSuperclassMetaData in interface ClassMetaData

getIdentityType

public int getIdentityType()
Description copied from interface: ClassMetaData
Return the type of JDO identity being used. This will be one of: If unspecified, defaults to ClassMetaData.ID_DATASTORE.

Specified by:
getIdentityType in interface ClassMetaData

setIdentityType

public void setIdentityType(int type)
Description copied from interface: ClassMetaData
Set the type of JDO identity used by this class.

Specified by:
setIdentityType in interface ClassMetaData
See Also:
ClassMetaData.getIdentityType()

getObjectIdClass

public java.lang.Class getObjectIdClass()
Description copied from interface: ClassMetaData
Return the metadata-specified class to use for the object ID, or null if not specified.

Specified by:
getObjectIdClass in interface ClassMetaData

setObjectIdClass

public void setObjectIdClass(java.lang.Class cls)
Description copied from interface: ClassMetaData
Set the metadata-specified class to use for the object ID.

Specified by:
setObjectIdClass in interface ClassMetaData

getRequiresExtent

public boolean getRequiresExtent()
Description copied from interface: ClassMetaData
Return true if the type requires management via extent. If false, the PersistenceManager.getExtent(java.lang.Class, boolean) method cannot be used for this class. Defaults to true.

Specified by:
getRequiresExtent in interface ClassMetaData

setRequiresExtent

public void setRequiresExtent(boolean req)
Description copied from interface: ClassMetaData
Set whether the type requires extent management.

Specified by:
setRequiresExtent in interface ClassMetaData

getFields

public com.solarmetric.rd.kodo.meta.FieldMetaData[] getFields()
Description copied from interface: ClassMetaData
Return all field metadatas, including superclass fields.

Specified by:
getFields in interface ClassMetaData

getDeclaredFields

public com.solarmetric.rd.kodo.meta.FieldMetaData[] getDeclaredFields()
Description copied from interface: ClassMetaData
Return only the fields for this class, without superclass fields.

Specified by:
getDeclaredFields in interface ClassMetaData

getPrimaryKeyFields

public com.solarmetric.rd.kodo.meta.FieldMetaData[] getPrimaryKeyFields()
Description copied from interface: ClassMetaData
Return primary key fields, or empty array if none.

Specified by:
getPrimaryKeyFields in interface ClassMetaData

getField

public com.solarmetric.rd.kodo.meta.FieldMetaData getField(int index)
Description copied from interface: ClassMetaData
Return the metadata for the persistent or transactional field with the given absolute index.

Specified by:
getField in interface ClassMetaData
Returns:
the field's metadata, or null if not found

getDeclaredField

public com.solarmetric.rd.kodo.meta.FieldMetaData getDeclaredField(int index)
Description copied from interface: ClassMetaData
Return the metadata for the persistent or transactional field with the given relative index.

Specified by:
getDeclaredField in interface ClassMetaData
Returns:
the field's metadata, or null if not found

getField

public com.solarmetric.rd.kodo.meta.FieldMetaData getField(java.lang.String name)
Description copied from interface: ClassMetaData
Return the metadata for the persistent or transactional field with the given name. This method can only be used at runtime.

Specified by:
getField in interface ClassMetaData
Returns:
the field's metadata, or null if not found

getDeclaredField

public com.solarmetric.rd.kodo.meta.FieldMetaData getDeclaredField(java.lang.String name)
Description copied from interface: ClassMetaData
Return the metadata for the persistent or transactional field with the given name, without including superclass fields.

Specified by:
getDeclaredField in interface ClassMetaData
Returns:
the field's metadata, or null if not found

getDeclaredUnmanagedFields

public com.solarmetric.rd.kodo.meta.FieldMetaData[] getDeclaredUnmanagedFields()
Description copied from interface: ClassMetaData
Return any fields that were added as non-managed. All other methods to get fields return only those that are managed.

Specified by:
getDeclaredUnmanagedFields in interface ClassMetaData

addDeclaredField

public void addDeclaredField(com.solarmetric.rd.kodo.meta.FieldMetaData field)
Description copied from interface: ClassMetaData
Add a persistent or transactional field to this class.

Specified by:
addDeclaredField in interface ClassMetaData

removeDeclaredField

public boolean removeDeclaredField(com.solarmetric.rd.kodo.meta.FieldMetaData field)
Description copied from interface: ClassMetaData
Remove the given field from management.

Specified by:
removeDeclaredField in interface ClassMetaData
Returns:
true if the field was removed, false otherwise

getCanCache

public boolean getCanCache()
Description copied from interface: ClassMetaData
Return true if the ClassMetaData.CAN_CACHE extension key is true.

Specified by:
getCanCache in interface ClassMetaData

setCanCache

public void setCanCache(boolean cacheable)
Description copied from interface: ClassMetaData
Set the value of the ClassMetaData.CAN_CACHE standard extension.

Specified by:
setCanCache in interface ClassMetaData

isEnhanced

public boolean isEnhanced()
Description copied from interface: ClassMetaData
Returns true if the class has been enhanced.

Specified by:
isEnhanced in interface ClassMetaData

isInstanceCallbacks

public boolean isInstanceCallbacks()
Description copied from interface: ClassMetaData
Return true if the class implements InstanceCallbacks.

Specified by:
isInstanceCallbacks in interface ClassMetaData

compareTo

public int compareTo(java.lang.Object other)
Specified by:
compareTo in interface java.lang.Comparable

resolve

public boolean resolve()
Description copied from interface: ClassMetaData
For implementation use. This method resolves superclass information, caches fields, and resolves fields that might be other first class objects. It requires access to a respository. It is called automatically through operations that require resolution to complete.

Specified by:
resolve in interface ClassMetaData
Returns:
true if any subclasses should resolve their information too

invalidateResolve

public void invalidateResolve()
Description copied from interface: ClassMetaData
For implemntation use. Concrete implementations should call this method when changing something that requires the class to be re-resolved.

Specified by:
invalidateResolve in interface ClassMetaData

cacheDeclaredFields

protected boolean cacheDeclaredFields()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool

Copyright 2001,2002,2003 SolarMetric, Inc. All Rights Reserved.