org.jbind.xml.instance.builder
Class DataContext

java.lang.Object
  extended byorg.jbind.xml.instance.builder.DataContext
All Implemented Interfaces:
IDataContext, IDataReferences, IDataStore

public class DataContext
extends java.lang.Object
implements IDataContext, IDataStore


Constructor Summary
DataContext(boolean anIsShared)
           
 
Method Summary
 void add(IDataReference anOpenReference)
          Adds a data reference that is resolved later by calling the resolveReferences method.
 IAnyTypeData getIndexedData(IRef anIndexRef, java.lang.Object aKey)
          Gets a data object from an index.
 boolean isShared()
          Indicates if the data context is shared, i.e. used for validation over several instances.
 void resolveReferences(IConstraintViolations aViolations)
          Resolve the data references.
 IAnyTypeData setIndexedData(IRef anIndexRef, java.lang.Object aKey, IAnyTypeData aData)
          Sets a data object in an index.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataContext

public DataContext(boolean anIsShared)
Method Detail

add

public void add(IDataReference anOpenReference)
Description copied from interface: IDataReferences
Adds a data reference that is resolved later by calling the resolveReferences method.

Specified by:
add in interface IDataReferences
Parameters:
anOpenReference - (required).

resolveReferences

public void resolveReferences(IConstraintViolations aViolations)
Description copied from interface: IDataReferences
Resolve the data references. References that can not be resolved are recorded as constraint violations. All references are removed by this method call.

Specified by:
resolveReferences in interface IDataReferences
Parameters:
aViolations - (required).

getIndexedData

public IAnyTypeData getIndexedData(IRef anIndexRef,
                                   java.lang.Object aKey)
Description copied from interface: IDataStore
Gets a data object from an index.

Specified by:
getIndexedData in interface IDataStore
Parameters:
anIndexRef - (required).
aKey - (required).
Returns:
(optional).

setIndexedData

public IAnyTypeData setIndexedData(IRef anIndexRef,
                                   java.lang.Object aKey,
                                   IAnyTypeData aData)
Description copied from interface: IDataStore
Sets a data object in an index.

Specified by:
setIndexedData in interface IDataStore
Parameters:
anIndexRef - (required).
aKey - (required).
aData - (required).
Returns:
(optional). The last data object that was stored at the same "address" is returned.

isShared

public boolean isShared()
Description copied from interface: IDataContext
Indicates if the data context is shared, i.e. used for validation over several instances. A validation context that is not shared clears its data store when its references are resolved whereas a data context that is shared keeps its data store.

Specified by:
isShared in interface IDataContext
Returns:
Returns true iff the validation context is shared.