|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jdom.Document
org.activemath.omdocjdom.OJDocument
public class OJDocument
A generic subclass of Document to provide support
for origin tracking (getCollectionID() and getFile().
| Field Summary | |
|---|---|
protected OJCollection |
collection
|
protected Object |
info
|
| Fields inherited from class org.jdom.Document |
|---|
baseURI |
| Constructor Summary | |
|---|---|
OJDocument()
Constructs an OJDocument with an empty omdoc element
and a doctype constructed OJConstants.DTD_SYSTEMID. |
|
OJDocument(org.jdom.Element rootElement)
Constructs an OJDocument with arbitrary root and without docType. |
|
OJDocument(org.jdom.Element rootElement,
org.jdom.DocType docType)
Constructs an OJDocument with arbitrary root and docType. |
|
OJDocument(org.jdom.Element rootElement,
org.jdom.DocType docType,
String baseURI)
|
|
| Method Summary | |
|---|---|
OJElement |
findElementWithID(ID id)
A method to find back id-ed elements. |
String |
getCollectionID()
|
File |
getFile()
Get the file mentionned by the setFile(java.io.File) method, or null
if none was set. |
Object |
getInfo()
|
Date |
getLastModificationDate()
Returns the the modification date of the file when it was loaded by the setFile(java.io.File) method. |
Iterator |
listItems()
|
void |
setCollection(OJCollection s)
Sets a "collection", whichever that can mean. |
void |
setFile(File file)
Set the file this element was loaded from, if any. |
void |
setInfo(Object i)
|
String |
toString()
|
void |
writeDocument()
Outputs the document to the given file using the UTF-8 encoding. |
void |
writeDocument(String encoding)
Outputs the document to the given file using the given encoding, which supposed to be UTF-8 if none other was given. |
| Methods inherited from class org.jdom.Document |
|---|
addContent, addContent, addContent, addContent, clone, cloneContent, detachRootElement, equals, getBaseURI, getContent, getContent, getContent, getContentSize, getDescendants, getDescendants, getDocType, getDocument, getParent, getProperty, getRootElement, hashCode, hasRootElement, indexOf, removeContent, removeContent, removeContent, removeContent, setBaseURI, setContent, setContent, setContent, setContent, setDocType, setProperty, setRootElement |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected OJCollection collection
protected Object info
| Constructor Detail |
|---|
public OJDocument()
omdoc element
and a doctype constructed OJConstants.DTD_SYSTEMID.
public OJDocument(org.jdom.Element rootElement,
org.jdom.DocType docType)
public OJDocument(org.jdom.Element rootElement,
org.jdom.DocType docType,
String baseURI)
public OJDocument(org.jdom.Element rootElement)
| Method Detail |
|---|
public OJElement findElementWithID(ID id)
The current method goes through the whole tree stopping
at OMOBJ elements' depth until it finds the given ID.
At each node, it requests the ID (using OJElement.getID())
and compares it to this one.
public void setCollection(OJCollection s)
ID.getCollection().
public String getCollectionID()
public Iterator listItems()
public void setInfo(Object i)
public Object getInfo()
public void setFile(File file)
URL one day.
public File getFile()
setFile(java.io.File) method, or null
if none was set.
public Date getLastModificationDate()
setFile(java.io.File) method.
public void writeDocument()
throws IOException
writeDocument(String).
IOException
public void writeDocument(String encoding)
throws IOException
The output is printed as much as possible by keeping all the formatting of the original source.
IOExceptionpublic String toString()
toString in class org.jdom.Document
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||