| java.lang.Object org.jpox.metadata.MetaData
All known Subclasses: org.jpox.metadata.InheritanceMetaData, org.jpox.metadata.TableGeneratorMetaData, org.jpox.metadata.DiscriminatorMetaData, org.jpox.metadata.QueryResultMetaData, org.jpox.metadata.AbstractElementMetaData, org.jpox.metadata.AbstractConstraintMetaData, org.jpox.metadata.JoinMetaData, org.jpox.metadata.IdentityMetaData, org.jpox.metadata.PersistenceUnitMetaData, org.jpox.metadata.ContainerMetaData, org.jpox.metadata.OrderMetaData, org.jpox.metadata.SequenceMetaData, org.jpox.metadata.QueryMetaData, org.jpox.metadata.PersistenceFileMetaData, org.jpox.metadata.FetchPlanMetaData, org.jpox.metadata.PrimaryKeyMetaData, org.jpox.metadata.FetchGroupMetaData, org.jpox.metadata.PackageMetaData, org.jpox.metadata.EmbeddedMetaData, org.jpox.metadata.AbstractMemberMetaData, org.jpox.metadata.AbstractClassMetaData, org.jpox.metadata.EventListenerMetaData, org.jpox.metadata.FileMetaData, org.jpox.metadata.VersionMetaData, org.jpox.metadata.ColumnMetaData, org.jpox.metadata.ImplementsMetaData,
MetaData | public class MetaData implements Serializable(Code) | | Base class for all MetaData.
MetaData Lifecycle
The states represent the lifecycle of a MetaData object. The lifecycle goes as follows :
- MetaData object is created (values passed in from a parsed file, or manually generated)
- MetaData object is populated (maybe pass in a class that it represents, creating any additional
information that wasn't in the initial data).
- MetaData object is initialised (any internal arrays are set up, and additions of data is blocked
from this point).
- MetaData object is added to with runtime information like actual column names and types in use.
MetaData Extensability
All MetaData elements are extensible with extensions for a "vendor-name". Extensions take the form
of a key and a value.
version: $Revision: 1.12 $ |
Field Summary | |
final public static String | JPOX_VENDOR_NAME Vendor name used by JPOX for extensions. | protected static Localiser | LOCALISER | final public static int | METADATA_CREATED_STATE State representing the start state of MetaData, representing the initial values passed in. | final public static int | METADATA_INITIALISED_STATE State reflecting that MetaData object has been initialised with any internal info required. | final public static int | METADATA_POPULATED_STATE State reflecting that MetaData has been populated with real class definition adding any defaulted info. | final public static int | METADATA_USED_STATE State reflecting that MetaData object has been modified with usage information (e.g defaulted column names). | protected Collection | extensions List of extensions for this MetaData element. | protected int | metaDataState State of the MetaData. | protected MetaData | parent Parent MetaData object, allowing hierarchical MetaData structure. |
JPOX_VENDOR_NAME | final public static String JPOX_VENDOR_NAME(Code) | | Vendor name used by JPOX for extensions.
|
METADATA_CREATED_STATE | final public static int METADATA_CREATED_STATE(Code) | | State representing the start state of MetaData, representing the initial values passed in.
|
METADATA_INITIALISED_STATE | final public static int METADATA_INITIALISED_STATE(Code) | | State reflecting that MetaData object has been initialised with any internal info required.
|
METADATA_POPULATED_STATE | final public static int METADATA_POPULATED_STATE(Code) | | State reflecting that MetaData has been populated with real class definition adding any defaulted info.
|
METADATA_USED_STATE | final public static int METADATA_USED_STATE(Code) | | State reflecting that MetaData object has been modified with usage information (e.g defaulted column names).
|
extensions | protected Collection extensions(Code) | | List of extensions for this MetaData element.
|
metaDataState | protected int metaDataState(Code) | | State of the MetaData.
|
parent | protected MetaData parent(Code) | | Parent MetaData object, allowing hierarchical MetaData structure.
|
MetaData | public MetaData(MetaData parent)(Code) | | Constructor. Taking the parent MetaData object (if any).
Parameters: parent - The parent MetaData object. |
addExtension | public void addExtension(String vendor, String key, String value)(Code) | | Append new Extension (for the specified vendor).
Will throw an InvalidMetaDataException if the input is invalid.
Parameters: vendor - vendor-name tag value Parameters: key - key tag value Parameters: value - value tag value |
addExtension | public void addExtension(String key, String value)(Code) | | Append new Extension (for JPOX).
Will throw an InvalidMetaDataException if the input is invalid.
Parameters: key - key tag value Parameters: value - value tag value |
getNoOfExtensions | public int getNoOfExtensions()(Code) | | Accessor for the number of extensions.
Number of extensions |
getParent | public MetaData getParent()(Code) | | Accessor for the parent MetaData object.
Parent MetaData object. |
getValueForExtension | public String getValueForExtension(String key)(Code) | | Accessor for the value of a particular extension (for JPOX).
Parameters: key - The key of the extension The value of the extension (null if not existing) |
getValuesForExtension | public String[] getValuesForExtension(String key)(Code) | | Accessor for the value of a particular extension (for JPOX), but
splitting it into separate parts. This is for extension tags that have a
value as comma separated.
Parameters: key - The key of the extension The value(s) of the extension (null if not existing) |
hasExtension | public boolean hasExtension(String key)(Code) | | Accessor for whether an extension exists (for JPOX).
Parameters: key - The key of the extension Whether the extension exists |
initialise | public void initialise()(Code) | | Method to initialise the object.
The state changes to "INITIALISED" after this call.
|
isInitialised | public boolean isInitialised()(Code) | | Accessor for whether the object state is "initialised" (at least).
Whether it is initialised |
isPopulated | public boolean isPopulated()(Code) | | Accessor for whether the object state is "populated" (at least).
Whether it is populated. |
isUsed | public boolean isUsed()(Code) | | Accessor for whether the object state is "used" (has been modified with usage info).
Whether it is used. |
populate | public void populate()(Code) | | Method to populate the object.
The state changes to "POPULATED" after this call.
|
removeExtension | public void removeExtension(String key)(Code) | | Method to remove a (JPOX) MetaData extension.
Parameters: key - Key of the tag |
setInitialised | public void setInitialised()(Code) | | Utility to set the state as initialised.
|
setParent | public void setParent(MetaData md)(Code) | | Convenience method to set the parent of this MetaData element.
Only valid for calling until the MetaData is populated/initialised and throws a JPOXException
thereafter.
Parameters: md - The parent |
setPopulated | public void setPopulated()(Code) | | Utility to set the state as populated.
|
setUsed | public void setUsed()(Code) | | Utility to set the state as used.
|
toString | public String toString()(Code) | | Accessor for a string representation of the object.
a string representation of the object. |
toString | public String toString(String prefix, String indent)(Code) | | Returns a string representation of the object.
Parameters: prefix - prefix string Parameters: indent - indent string a string representation of the object. |
|
|