|
Higraph, v1.0, January 29, 2003 (02:21 PM) | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.ac.ed.inf.higraph.HigraphXml
XML wrapper for Higraph
- a bridge between
JDOM Element
s and Higraph
s.
Nested Class Summary | |
protected class |
HigraphXml.SAXErrorHandler
Extends MySAXErrorHandler by intercepting exceptions
signalling that the document does not conform to
the DTD and setting the dtdNotValid flag accordingly. |
Field Summary |
Constructor Summary | |
HigraphXml()
Creates a new HigraphXml instance
setting the value of this.higraph to a new
Higraph |
|
HigraphXml(File file)
Creates a new HigraphXml instance from the
XML representation stored in file . |
|
HigraphXml(Higraph higraph)
Creates a new HigraphXml instance
setting the value of this.higraph to higraph . |
Method Summary | |
Document |
getDocument()
Gets the value of document . |
Higraph |
getHigraph()
Gets the value of higraph . |
XMLOutputter |
getOutputter()
Returns a validating XMLOutputter , creating it
if it does not already exist. |
protected boolean |
isDtdNotValid()
Returns true when the parsed document does not conform to
HigraphConstants.HIGRAPH_DTD . |
void |
load(File file)
It displays the higraph stored as XML in file . |
Document |
parse(File file)
Parses file using SAXBuilder and
HigraphXml.SAXErrorHandler . |
protected void |
setBlobs(Element blobsEl)
Sets the blobs of higraph using blobsEl . |
protected void |
setDocument(Document v)
Sets the value of document . |
protected void |
setEdges(Element edgesEl)
Sets the edges of higraph using edgesEl . |
protected void |
setHigraph(Higraph v)
Sets the value of higraph . |
void |
storeTo(File file)
Builds the XML document corresponding to higraph
and saves it to file . |
Document |
toXmlDocument()
Builds and returns the XML Document corresponding
to higraph . |
Element |
toXmlElement()
Returns the XML Element corresponding
to higraph by taking the root element
of toXmlDocument() . |
String |
toXmlString()
Returns the String corresponding to
the XML Element produced by
toXmlElement() . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public HigraphXml(Higraph higraph)
HigraphXml
instance
setting the value of this.higraph
to higraph
.
higraph
- a Higraph
valuepublic HigraphXml()
HigraphXml
instance
setting the value of this.higraph
to a new
Higraph
public HigraphXml(File file) throws MyXmlLoadException
HigraphXml
instance from the
XML representation stored in file
.
file
- a File
value consisting of an XML document
MyXmlLoadException
- if an error occursMethod Detail |
public Document getDocument()
document
.
document
.protected void setDocument(Document v)
document
.
v
- Value to assign to document
.public Higraph getHigraph()
higraph
.
higraph
.protected void setHigraph(Higraph v)
higraph
.
v
- Value to assign to higraph
.protected boolean isDtdNotValid()
true
when the parsed document does not conform to
HigraphConstants.HIGRAPH_DTD
.
true
when the parsed document does not conform to
HigraphConstants.HIGRAPH_DTD
.public XMLOutputter getOutputter()
XMLOutputter
, creating it
if it does not already exist.
XMLOutputter
, creating it
if it does not already existpublic void load(File file) throws MyXmlLoadException
file
.
Bug: it does not handle edges properly yet!
file
- a File
consisting of an XML document
MyXmlLoadException
- if an error occurspublic Document parse(File file) throws JDOMException
file
using SAXBuilder
and
HigraphXml.SAXErrorHandler
.
file
- a File
value
Document
value
JDOMException
- if an error occursprotected void setBlobs(Element blobsEl)
higraph
using blobsEl
.
blobsEl
- an Element
valueprotected void setEdges(Element edgesEl)
higraph
using edgesEl
.
edgesEl
- an Element
valuepublic Document toXmlDocument()
Document
corresponding
to higraph
.
Document
corresponding
to higraph
public String toXmlString()
String
corresponding to
the XML Element
produced by
toXmlElement()
.
String
corresponding to
the XML Element
produced by
toXmlElement()
public Element toXmlElement()
Element
corresponding
to higraph
by taking the root element
of toXmlDocument()
.
Element
corresponding
to higraph
public void storeTo(File file) throws MyXmlStoreException
higraph
and saves it to file
. If file
exists
the file is first backed up in emacs style.
file
- the File
where the higraph is stored
MyXmlStoreException
- if an error occurs
|
Higraph, v1.0, January 29, 2003 (02:21 PM) | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |