org.jscience.architecture.traffic.xml
Interface XMLSerializable

All Known Subinterfaces:
Settings
All Known Implementing Classes:
ACGJ1, ACGJ2, ACGJ3, ACGJ3.ACGJ3Individual, ACGJ3.ACGJ3Population, ACGJ3FixedValue, ACGJ3FixedValue.ACGJ3FixedValueIndividual, ACGJ4, ACGJ4.Individual, ACGJ4.Population, ACGJ5, ACGJ5.Individual, ACGJ5.Population, AggressiveDP, Automobile, BestFirstTLC, Bicycle, Bus, Car, ColearnPolicy, Controller, CustomRoaduser, DestFrequency, Drivelane, DrivingPolicy, EdgeNode, EditController, EditModel, GeneralSettings, GenNeuralTLC, GenNeuralTLC.GenNeuralIndividual, GenNeuralTLC.GenNeuralPopulation, Infrastructure, Junction, LessSimpleInfra, LocalHillTLC, LongestQueueTLC, MainView, Model, MostCarsTLC, NetTunnel, Node, Node.NodeStatistics, NonTLJunction, NoSign, NumberDispenser, PacCar, RandomTLC, RelativeLongestQueueTLC, RLD2TLC, RLDTLC, Road, Roaduser, ShortestPathDP, Sign, SignController, SimController, SimModel, SimpleInfra, SL1TLC, SL1TLC.CountEntry, SL1TLC.PEntry, SL1TLC.Target, SL2TLC, SL2TLC.CountEntry, SL2TLC.PEntry, SL2TLC.Target, SL3TLC, SL3TLC.CountEntry, SL3TLC.PEntry, SL3TLC.Target, SL4TLC, SL4TLC.CountEntry, SL4TLC.PEntry, SL4TLC.Target, SL5TLC, SL5TLC.CountEntry, SL5TLC.PEntry, SL5TLC.Target, SL6TLC, SL6TLC.CountEntry, SL6TLC.PEntry, SL6TLC.Target, SmarterShortestPathDP, SpawnFrequency, SPData, SPData.Path, SpecialNode, StatisticsOverlay, TC1B1, TC1B1.CountEntry, TC1B1.PEntry, TC1B1.Target, TC1TLCDestless, TC1TLCDestless.CountEntry, TC1TLCDestless.PEntry, TC1TLCFix, TC1TLCFix.CountEntry, TC1TLCFix.PEntry, TC1TLCOpt, TC1TLCOpt.CountEntry, TC1TLCOpt.PEntry, TC2B1, TC2B1.CountEntry, TC2B1.PEntry, TC2B1.PKtlEntry, TC2B1.Target, TC2Final, TC2Final.CountEntry, TC2Final.PKtlEntry, TC2TLCDestless, TC2TLCDestless.CountEntry, TC2TLCDestless.PKtlEntry, TC2TLCOpt, TC2TLCOpt.CountEntry, TC2TLCOpt.PKtlEntry, TC3B1, TC3B1.CountEntry, TC3B1.PEntry, TC3B1.PKtlEntry, TC3B1.Target, TC3Opt, TC3Opt.CountEntry, TC3Opt.PEntry, TC3Opt.PKtlEntry, TC3Opt.Target, TC3TLCWorkInProgress, TC3TLCWorkInProgress.CountEntry, TC3TLCWorkInProgress.PKtlEntry, TLController, TLDecision, TrafficLight, Turn, View, XMLArray

public interface XMLSerializable

This interface has to be implemented by objects that want to be loaded and saved via the parser.


Method Summary
 java.lang.String getXMLName()
          DOCUMENT ME!
 void load(XMLElement myself, XMLLoader loader)
          Load this XMLSerializable
 void saveChilds(XMLSaver saver)
          This method gives an XMLSerializable the opportunity to save its child objects.
 XMLElement saveSelf()
          DOCUMENT ME!
 void setParentName(java.lang.String parentName)
          Sets a new parent name for this object
 

Method Detail

load

void load(XMLElement myself,
          XMLLoader loader)
          throws XMLTreeException,
                 java.io.IOException,
                 XMLInvalidInputException
Load this XMLSerializable

Parameters:
myself - The XMLElement which represents this object in the XML tree. It can contain attributes which hold information about the object.
loader - The XMLLoader which this XMLSerializable can use to load child objects.
Throws:
XMLTreeException - The parser can throw this exception if it is called by the XMLSerializable. The XMLSerializable should NOT throw this exception by itself and preferrably not catch it too.
java.io.IOException - Thrown in case of an read error in the XML file.
XMLInvalidInputException - The XMLSerializable can throw this exception if it cannot load itself or one of its child objects for whatever reason.

saveSelf

XMLElement saveSelf()
                    throws XMLCannotSaveException
DOCUMENT ME!

Returns:
The XMLElement which represents the internal datastate. This function is not meant to save child objects. That is done in void saveChilds()
Throws:
XMLCannotSaveException - The XMLSerializable can throw this exception if it cannot save itself or one of its child objects for whatever reason.

saveChilds

void saveChilds(XMLSaver saver)
                throws XMLTreeException,
                       java.io.IOException,
                       XMLCannotSaveException
This method gives an XMLSerializable the opportunity to save its child objects.

Parameters:
saver - The XMLSaver that the XMLSerializable can use to save its child objects.
Throws:
XMLTreeException - The parser can throw this exception if it is called by the XMLSerializable. The XMLSerializable should NOT throw this exception by itself and preferrably also not catch it too.
java.io.IOException - Thrown in case the parser cannot write to the file
XMLCannotSaveException - The XMLSerializable can throw this exception if it cannot save itself or one of its child objects for whatever reason.

getXMLName

java.lang.String getXMLName()
DOCUMENT ME!

Returns:
The tagname of the XML element in which information about this object is stored prepended by a dot separated list of the tagnames of the parents of this object. (e.g. "model.infrastructure.node")

setParentName

void setParentName(java.lang.String parentName)
                   throws XMLTreeException
Sets a new parent name for this object

Parameters:
parentName - The new parent name
Throws:
XMLTreeException - If this object does not support setting other parent names.