public class XMLTopologyParser extends XMLParser
XML document
that represents a Topology
.
This class is used through its parent class XMLParser
. It overrides parseRootElement(Element)
to
interpret the document as a Topology
.
The class does not create an new topology but populates an existing one passed to the constructor. The client code
is in charge of clearing the given topology.XMLParser.ElementVisitor, XMLParser.ParserException
Constructor and Description |
---|
XMLTopologyParser(Topology tp,
boolean validateDocument)
Construct a new topology parser.
|
Modifier and Type | Method and Description |
---|---|
void |
parseRootElement(Element element)
Interprets the root element of the document.
|
static void |
parseTopologyElement(Element topo,
Topology tp)
Interprets the root element of a topology and fulfilled the one passed as argument.
|
getVersion, mapElementChildrenOf, parse, parse, parseFromString
public void parseRootElement(Element element) throws XMLParser.ParserException
XMLParser
version
attribute of the root element.parseRootElement
in class XMLParser
element
- the element to be interpreted.XMLParser.ParserException
- raised if an IO error occurs or if the XML document is malformed.public static void parseTopologyElement(Element topo, Topology tp) throws XMLParser.ParserException
topo
- the root element
that describes the topologytp
- the topology
that is populated with XML data.ParserException
- is raised if the given XML document is malformed.XMLParser.ParserException