|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscience.architecture.traffic.xml.XMLArray
public class XMLArray
Class to convert arrays of arbitrary dimensions from/to XML : Accepted componenttypes : - int,float,double,boolean,byte and their respective encapsulator classes, Strings and objects that accept XMLSerializable
| Field Summary | |
|---|---|
protected java.lang.String |
alias
DOCUMENT ME! |
protected static int |
BOOLEAN
DOCUMENT ME! |
protected static int |
BOOLEAN_CLASS
DOCUMENT ME! |
protected static int |
BYTE
DOCUMENT ME! |
protected static int |
BYTE_CLASS
DOCUMENT ME! |
protected static int |
CONTAINER_ARRAY
DOCUMENT ME! |
protected static int |
CONTAINER_LINKEDLIST
DOCUMENT ME! |
protected static int |
CONTAINER_VECTOR
DOCUMENT ME! |
protected int |
containerType
DOCUMENT ME! |
protected java.lang.Object |
data
DOCUMENT ME! |
protected java.lang.Class |
dataClass
DOCUMENT ME! |
protected static int |
DOUBLE
DOCUMENT ME! |
protected static int |
DOUBLE_CLASS
DOCUMENT ME! |
protected static int |
FLOAT
DOCUMENT ME! |
protected static int |
FLOAT_CLASS
DOCUMENT ME! |
protected static int |
INT
DOCUMENT ME! |
protected static int |
INT_CLASS
DOCUMENT ME! |
protected java.lang.String[] |
lookUpTable
DOCUMENT ME! |
protected static int |
OTHER_ARRAY
DOCUMENT ME! |
protected java.lang.String |
parentName
DOCUMENT ME! |
protected static int |
STRING
DOCUMENT ME! |
protected InstantiationAssistant |
watson
DOCUMENT ME! |
protected static int |
XMLSERIALIZABLE
DOCUMENT ME! |
| Constructor Summary | |
|---|---|
XMLArray()
Make a new XMLArray (constructor for loading) |
|
XMLArray(java.lang.Object input,
java.lang.String parentName)
Make a new XMLArray (constructor for saving) |
|
XMLArray(java.lang.Object input,
java.lang.String parentName,
java.lang.String alias)
Make a new XMLArray (constructor for saving) |
|
XMLArray(java.lang.String parentName)
Empty constructor for loading |
|
XMLArray(java.lang.String parentName,
InstantiationAssistant assistant)
Constructor for loading |
|
| Method Summary | |
|---|---|
protected int |
getComponentType()
This method tries to guess the component type of the data array. |
InstantiationAssistant |
getInstantiationAssistant()
DOCUMENT ME! |
java.lang.Object |
getResult()
Return the result array,Vector or LinkedList as an object. |
java.lang.Object |
getResult(java.lang.Class expectedClass)
Return the result array,Vector or LinkedList as an object. |
protected java.util.LinkedList |
getResultLinkedList()
Gets the result array in LinkedList form. |
protected java.util.Vector |
getResultVector()
Gets the result array in Vector form. |
java.lang.String |
getXMLName()
DOCUMENT ME! |
void |
load(XMLElement myElement,
XMLLoader loader)
DOCUMENT ME! |
static java.lang.Object |
loadArray(XMLSerializable parent,
XMLLoader loader)
Load an arbitrary array. |
static java.lang.Object |
loadArray(XMLSerializable parent,
XMLLoader loader,
java.lang.Class expectedClass)
Load an arbitrary array. |
static java.lang.Object |
loadArray(XMLSerializable parent,
XMLLoader loader,
InstantiationAssistant assistant)
Load an arbitrary array. |
static void |
saveArray(java.lang.Object array,
XMLSerializable parent,
XMLSaver saver)
Save an arbitrary array/vector/LinkedList |
static void |
saveArray(java.lang.Object array,
XMLSerializable parent,
XMLSaver saver,
java.lang.String description)
Save an arbitrary array/vector/LinkedList |
void |
saveChilds(XMLSaver saver)
DOCUMENT ME! |
XMLElement |
saveSelf()
DOCUMENT ME! |
void |
setInstantiationAssistant(InstantiationAssistant assistant)
Sets the InstantiationAssistant of this XMLArray |
void |
setParentName(java.lang.String parentName)
DOCUMENT ME! |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final int INT
protected static final int DOUBLE
protected static final int FLOAT
protected static final int BOOLEAN
protected static final int INT_CLASS
protected static final int DOUBLE_CLASS
protected static final int FLOAT_CLASS
protected static final int BOOLEAN_CLASS
protected static final int STRING
protected static final int XMLSERIALIZABLE
protected static final int OTHER_ARRAY
protected static final int BYTE
protected static final int BYTE_CLASS
protected static final int CONTAINER_ARRAY
protected static final int CONTAINER_VECTOR
protected static final int CONTAINER_LINKEDLIST
protected java.lang.Object data
protected java.lang.Class dataClass
protected int containerType
protected java.lang.String parentName
protected java.lang.String alias
protected InstantiationAssistant watson
protected java.lang.String[] lookUpTable
| Constructor Detail |
|---|
public XMLArray()
public XMLArray(java.lang.String parentName)
parentName - The XML name of the object that is going to load this
array.
public XMLArray(java.lang.String parentName,
InstantiationAssistant assistant)
parentName - The XML name of the object that is going to load this
array.assistant - The IntantiationAssistant to use when creating new
objects (this parameter is only meaningful for XMLArrays that
directly or indirectly contain XMLSerializable objects.)
public XMLArray(java.lang.Object input,
java.lang.String parentName)
throws XMLCannotSaveException
input - The array,Vector or LinkedList to saveparentName - The XML name of the object that is going to save this
array.
XMLCannotSaveException - If there is something wrong with the
input array.
public XMLArray(java.lang.Object input,
java.lang.String parentName,
java.lang.String alias)
throws XMLCannotSaveException
input - The array,Vector or LinkedList to saveparentName - The XML name of the object that is going to save this
array.alias - A short description of what this array contains. Mainly
useful for debugging.
XMLCannotSaveException - If there is something wrong with the
input array.| Method Detail |
|---|
public java.lang.Object getResult()
throws XMLInvalidInputException
XMLInvalidInputException - If the XMLArray was not loaded or if
there is an internal problem.protected java.util.Vector getResultVector()
protected java.util.LinkedList getResultLinkedList()
public InstantiationAssistant getInstantiationAssistant()
public void setInstantiationAssistant(InstantiationAssistant assistant)
assistant - new InstantiationAssistant
public java.lang.Object getResult(java.lang.Class expectedClass)
throws XMLInvalidInputException
expectedClass - The class with which the result has to match
XMLInvalidInputException - If the XMLArray was not loaded, if
there is an internal problem or if the result class doesn't
match the parameter class.protected int getComponentType()
public static void saveArray(java.lang.Object array,
XMLSerializable parent,
XMLSaver saver,
java.lang.String description)
throws java.io.IOException,
XMLCannotSaveException,
XMLTreeException
array - An array to save (Vectors and LinkedLists are also
accepted)parent - The object which is trying to save this arraysaver - The XMLSaver to which the array has to be saveddescription - A short description of the array
java.io.IOException - DOCUMENT ME!
XMLCannotSaveException - DOCUMENT ME!
XMLTreeException - DOCUMENT ME!
public static void saveArray(java.lang.Object array,
XMLSerializable parent,
XMLSaver saver)
throws java.io.IOException,
XMLCannotSaveException,
XMLTreeException
array - An array to save (Vectors and LinkedLists are also
accepted)parent - The object which is trying to save this arraysaver - The XMLSaver to which the array has to be saved
java.io.IOException - DOCUMENT ME!
XMLCannotSaveException - DOCUMENT ME!
XMLTreeException - DOCUMENT ME!
public static java.lang.Object loadArray(XMLSerializable parent,
XMLLoader loader,
java.lang.Class expectedClass)
throws XMLInvalidInputException,
XMLTreeException,
java.io.IOException
parent - The object that is loading this arrayloader - The XMLLoader to load this array fromexpectedClass - The expected class of the result
XMLInvalidInputException - DOCUMENT ME!
XMLTreeException - DOCUMENT ME!
java.io.IOException - DOCUMENT ME!
public static java.lang.Object loadArray(XMLSerializable parent,
XMLLoader loader)
throws XMLInvalidInputException,
XMLTreeException,
java.io.IOException
parent - The object that is loading this arrayloader - The XMLLoader to load this array from
XMLInvalidInputException - DOCUMENT ME!
XMLTreeException - DOCUMENT ME!
java.io.IOException - DOCUMENT ME!
public static java.lang.Object loadArray(XMLSerializable parent,
XMLLoader loader,
InstantiationAssistant assistant)
throws XMLInvalidInputException,
XMLTreeException,
java.io.IOException
parent - The object that is loading this arrayloader - The XMLLoader to load this array fromassistant - The InstantiationAssistant to use
XMLInvalidInputException - DOCUMENT ME!
XMLTreeException - DOCUMENT ME!
java.io.IOException - DOCUMENT ME!
public void load(XMLElement myElement,
XMLLoader loader)
throws XMLTreeException,
java.io.IOException,
XMLInvalidInputException
load in interface XMLSerializablemyElement - DOCUMENT ME!loader - DOCUMENT ME!
XMLTreeException - DOCUMENT ME!
java.io.IOException - DOCUMENT ME!
XMLInvalidInputException - DOCUMENT ME!
public XMLElement saveSelf()
throws XMLCannotSaveException
saveSelf in interface XMLSerializableXMLCannotSaveException - DOCUMENT ME!
public void saveChilds(XMLSaver saver)
throws XMLTreeException,
java.io.IOException,
XMLCannotSaveException
saveChilds in interface XMLSerializablesaver - DOCUMENT ME!
XMLTreeException - DOCUMENT ME!
java.io.IOException - DOCUMENT ME!
XMLCannotSaveException - DOCUMENT ME!public java.lang.String getXMLName()
getXMLName in interface XMLSerializablepublic void setParentName(java.lang.String parentName)
setParentName in interface XMLSerializableparentName - DOCUMENT ME!
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||