org.sourceforge.jemm.lifecycle
Class ShadowData

java.lang.Object
  extended by org.sourceforge.jemm.lifecycle.ShadowData

public class ShadowData
extends java.lang.Object

The data store for the ShadowObject that is associated with an Enhanced class. Stores the ID of Shadowed Objects.

Author:
Paul Keeble

Constructor Summary
ShadowData(ID id, int version)
           
 
Method Summary
 void clearInitialisation(java.lang.Class<?> declaringClass, FieldType type, java.lang.String name)
          Removes the initialisation flag for a field.
 void clearInitialisations()
           
 ID getField(java.lang.Class declaringClass, FieldType type, java.lang.String name)
          Returns a field if it exists, otherwise throws an exception
 FieldInfo[] getFields()
          Returns an array of all the fields, which could be zero length if none exist.
 ID getID()
          Gets the Object ID the ShadowData is associated with.
 int getVersion()
          The version of the Object has defined by the Database that gave the ID to the enhanced object.
 boolean hasField(java.lang.Class<?> declaringClass, FieldType type, java.lang.String name)
           
 void initialiseField(java.lang.Class<?> declaringClass, FieldType type, java.lang.String name)
          Sets the status of a Field to say that it has already been initialised to the Entity.
 boolean isFieldInitialised(java.lang.Class<?> declaringClass, FieldType type, java.lang.String name)
          Returns the current known initialisation state of an Object.
 void setField(java.lang.Class declaringClass, FieldType type, java.lang.String name, ID value)
          Sets a field value.
 void setVersion(int newVersion)
          Sets the version to a new value.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ShadowData

public ShadowData(ID id,
                  int version)
Method Detail

setField

public void setField(java.lang.Class declaringClass,
                     FieldType type,
                     java.lang.String name,
                     ID value)
Sets a field value.

Parameters:
type - The type of the field
name - The name of the field
value - The value the field should take

getField

public ID getField(java.lang.Class declaringClass,
                   FieldType type,
                   java.lang.String name)
Returns a field if it exists, otherwise throws an exception

Parameters:
type - The class type of the field
name - The name of the field
Returns:
The value stored, which can be null
Throws:
java.lang.RuntimeException - if the field does not exist

getFields

public FieldInfo[] getFields()
Returns an array of all the fields, which could be zero length if none exist.

Returns:
The fields contained within this ShadowData

hasField

public boolean hasField(java.lang.Class<?> declaringClass,
                        FieldType type,
                        java.lang.String name)

getID

public ID getID()
Gets the Object ID the ShadowData is associated with.

Returns:
The ID

getVersion

public int getVersion()
The version of the Object has defined by the Database that gave the ID to the enhanced object.

Returns:
The version id.

setVersion

public void setVersion(int newVersion)
Sets the version to a new value.

Parameters:
newVersion - The new version parameter.

initialiseField

public void initialiseField(java.lang.Class<?> declaringClass,
                            FieldType type,
                            java.lang.String name)
Sets the status of a Field to say that it has already been initialised to the Entity.

Parameters:
declaringClass -
type -
name -

clearInitialisation

public void clearInitialisation(java.lang.Class<?> declaringClass,
                                FieldType type,
                                java.lang.String name)
Removes the initialisation flag for a field.

Parameters:
declaringClass -
type -
name -

clearInitialisations

public void clearInitialisations()

isFieldInitialised

public boolean isFieldInitialised(java.lang.Class<?> declaringClass,
                                  FieldType type,
                                  java.lang.String name)
Returns the current known initialisation state of an Object.

Parameters:
declaringClass -
type -
name -
Returns:
True if the object is currently initialised, otherwise false.

toString

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


Copyright © 2009. All Rights Reserved.