org.jpox.metadata
Class MetaData

java.lang.Object
  extended byorg.jpox.metadata.MetaData
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ExtendableMetaData, FetchGroupMetaData

public class MetaData
extends java.lang.Object
implements java.io.Serializable

Base class for all MetaData. Provides state management for the MetaData. The states represent the lifecycle of a MetaData object. The lifecycle goes as follows :

  1. MetaData object is created (values passed in from a parsed file, or manually generated)
  2. MetaData object is populated (maybe pass in a class that it represents, creating any additional information that wasn't in the initial data).
  3. MetaData object is initialised (any internal arrays are set up, and additions of data is blocked from this point).
  4. MetaData object is added to with runtime information like actual column names and types in use.

Version:
$Revision: 1.7 $
See Also:
Serialized Form

Field Summary
protected static Localiser LOCALISER
           
static int METADATA_CREATED_STATE
          State representing the start state of MetaData, representing the initial values passed in.
static int METADATA_INITIALISED_STATE
          State reflecting that MetaData object has been initialised, setting up any internal information that is required.
static int METADATA_POPULATED_STATE
          State reflecting that MetaData object has been populated with the real class definition, adding in extra fields that weren't in the startup.
static int METADATA_USED_STATE
          State reflecting that MetaData object has been modified with usage information (e.g actual column names for the fields).
protected  int metaDataState
          State indicator for this MetaData object.
protected  MetaData parent
          Parent MetaData object.
 
Constructor Summary
MetaData(MetaData parent)
          Constructor.
 
Method Summary
 MetaData getParent()
          Accessor for the parent MetaData object.
 void initialise()
          Method to initialise the object.
 boolean isCreated()
          Accessor for whether the object state is "created".
 boolean isInitialised()
          Accessor for whether the object state is "initialised".
 boolean isPopulated()
          Accessor for whether the object state is "populated".
 boolean isUsed()
          Accessor for whether the object state is "used".
 void populate()
          Method to populate the object.
 void setInitialised()
          Utility to set the state as initialised.
 void setPopulated()
          Utility to set the state as populated.
 void setUsed()
          Utility to set the state as used.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCALISER

protected static Localiser LOCALISER

METADATA_CREATED_STATE

public static final int METADATA_CREATED_STATE
State representing the start state of MetaData, representing the initial values passed in.

See Also:
Constant Field Values

METADATA_POPULATED_STATE

public static final int METADATA_POPULATED_STATE
State reflecting that MetaData object has been populated with the real class definition, adding in extra fields that weren't in the startup.

See Also:
Constant Field Values

METADATA_INITIALISED_STATE

public static final int METADATA_INITIALISED_STATE
State reflecting that MetaData object has been initialised, setting up any internal information that is required.

See Also:
Constant Field Values

METADATA_USED_STATE

public static final int METADATA_USED_STATE
State reflecting that MetaData object has been modified with usage information (e.g actual column names for the fields).

See Also:
Constant Field Values

metaDataState

protected int metaDataState
State indicator for this MetaData object.


parent

protected MetaData parent
Parent MetaData object.

Constructor Detail

MetaData

public MetaData(MetaData parent)
Constructor. Taking the parent MetaData object (if any).

Parameters:
parent - The parent MetaData object.
Method Detail

populate

public void populate()
Method to populate the object. The state changes to "POPULATED" after this call.


initialise

public void initialise()
Method to initialise the object. The state changes to "INITIALISED" after this call.


setInitialised

public void setInitialised()
Utility to set the state as initialised.


setPopulated

public void setPopulated()
Utility to set the state as populated.


setUsed

public void setUsed()
Utility to set the state as used.


getParent

public MetaData getParent()
Accessor for the parent MetaData object.

Returns:
Parent MetaData object.

isCreated

public boolean isCreated()
Accessor for whether the object state is "created".

Returns:
Whether it is in "created" state

isPopulated

public boolean isPopulated()
Accessor for whether the object state is "populated".

Returns:
Whether it is populated.

isInitialised

public boolean isInitialised()
Accessor for whether the object state is "initialised".

Returns:
Whether it is initialised

isUsed

public boolean isUsed()
Accessor for whether the object state is "used".

Returns:
Whether it is used.


Copyright © -2007 . All Rights Reserved.