org.electrocodeogram.cpc.core.api.provider.xml
Class MappingStore

java.lang.Object
  extended by org.electrocodeogram.cpc.core.api.provider.xml.MappingStore

public class MappingStore
extends java.lang.Object

Simple input and output wrapper for IMappingProviders.

Author:
vw
See Also:
IMappingProvider

Field Summary
protected  java.util.List<IStatefulObject> statefulChildObjects
           
protected  IStatefulObject statefulParentObject
           
 
Constructor Summary
protected MappingStore()
          For use by sub classes only.
  MappingStore(ICloneFile cloneFile, java.util.List<IClone> clones)
          Creates a new MappingStore instance.
  MappingStore(IStatefulObject statefulObject)
          Creates a new MappingStore instance.
  MappingStore(IStatefulObject statefulParentObject, java.util.List<IStatefulObject> statefulChildObjects)
          Creates a new MappingStore instance.
  MappingStore(java.util.List<IStatefulObject> statefulObjects)
          Creates a new MappingStore instance.
 
Method Summary
 ICloneFile getCloneFile()
          Retrieves the ICloneFile which was stored as parent object in this mapping store.
 java.util.List<IClone> getClones()
          Retrieves the child objects as a list of IClone instances.
 java.util.List<IStatefulObject> getStatefulChildObjects()
          A list of IStatefulObjects which should be mapped to/where mapped from a string representation.
 IStatefulObject getStatefulParentObject()
          An additional parent IStatefulObject for the given child objects.
This value may be NULL.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

statefulParentObject

protected IStatefulObject statefulParentObject

statefulChildObjects

protected java.util.List<IStatefulObject> statefulChildObjects
Constructor Detail

MappingStore

protected MappingStore()
For use by sub classes only.


MappingStore

public MappingStore(IStatefulObject statefulObject)
Creates a new MappingStore instance.

Parameters:
statefulObject - a IStatefulObject, never null.

MappingStore

public MappingStore(java.util.List<IStatefulObject> statefulObjects)
Creates a new MappingStore instance.

Parameters:
statefulObjects - a list of IStatefulObjects, may be empty, never null.

MappingStore

public MappingStore(IStatefulObject statefulParentObject,
                    java.util.List<IStatefulObject> statefulChildObjects)
Creates a new MappingStore instance.

Parameters:
statefulParentObject - the parent IStatefulObject which all given child objects should be located under, never null. This is typically an ICloneFile instance.
statefulChildObjects - a list of IStatefulObjects which should be located within the given parent object, may be empty, never null. This is typically a list of IClone instances.

MappingStore

public MappingStore(ICloneFile cloneFile,
                    java.util.List<IClone> clones)
Creates a new MappingStore instance.
Convenience method.

Parameters:
cloneFile -
clones -
Method Detail

getStatefulParentObject

public IStatefulObject getStatefulParentObject()
An additional parent IStatefulObject for the given child objects.
This value may be NULL.

Returns:
the parent IStatefulObject, may be NULL.

getCloneFile

public ICloneFile getCloneFile()
                        throws MappingException
Retrieves the ICloneFile which was stored as parent object in this mapping store. This may fail if this mapping store has no designated parent object or if it has a different type.
Convenience method.

Returns:
an ICloneFile instance if the parent object exists, NULL otherwise.
Throws:
MappingException - if the parent object does not have type ICloneFile.
See Also:
getStatefulParentObject()

getStatefulChildObjects

public java.util.List<IStatefulObject> getStatefulChildObjects()
A list of IStatefulObjects which should be mapped to/where mapped from a string representation.
The list and its elements may not be modified.

Returns:
a list of IStatefulObjects, may be empty, never null.

getClones

public java.util.List<IClone> getClones()
                                 throws MappingException
Retrieves the child objects as a list of IClone instances. This may fail if this store does other types of classes.
Convenience method.

Returns:
a list of IClones, may be empty, never null.
Throws:
MappingException - if any of the getStatefulChildObjects() is not of type IClone.
See Also:
getStatefulChildObjects()

toString

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