|
VdexReload 1.1.3 API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.reload.moonunit.dom.ReloadDocument
This encapsulates the JDOM XML Document file with it plus helper methods.
Field Summary | |
protected boolean |
_dirty
A flag to set if this Document is dirty (edited) |
protected org.jdom.Document |
_doc
The JDOM Document |
protected java.io.File |
_file
The File for this Document - this may be null if not saved to disk |
Constructor Summary | |
ReloadDocument()
Default Constructor |
|
ReloadDocument(java.io.File file,
org.jdom.Document doc)
Constructor that takes in a an XML filename, JDOM document and a ReloadSchemaController |
Method Summary | |
org.jdom.Document |
getDocument()
Get the JDOM Metadata or Vocabulary Document. |
java.io.File |
getFile()
Get the File of this Document. |
org.jdom.Element |
getRootElement()
Get the Root Element of the JDOM Document |
org.jdom.Namespace |
getSchemaNamespace()
Get the Schema Namespace of the Document if there is one |
boolean |
isDirty()
Whether this Document has been changed in some way |
boolean |
isDocumentNamespace(org.jdom.Element element)
Checks if element belongs to the namespace of this document |
static boolean |
isMemberOfSameDocument(org.jdom.Element element1,
org.jdom.Element element2)
Checks of element1 and element2 belongs to the same document |
void |
loadDocument(java.io.File file)
Load the JDOM Document File |
void |
saveAsDocument(java.io.File file)
This will save the XML IMS file with a new File ref |
void |
saveDocument()
This will save the XML IMS file with the existing File ref. |
void |
setDirty(boolean isDirty)
Set whether this Document is dirty or not |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected org.jdom.Document _doc
protected boolean _dirty
protected java.io.File _file
Constructor Detail |
public ReloadDocument()
public ReloadDocument(java.io.File file, org.jdom.Document doc)
file
- the XML file, for example an IMS metadata or an IMS VDEX vocabulary file
doc the JDOM document of the XML fileMethod Detail |
public org.jdom.Document getDocument()
public java.io.File getFile()
public void loadDocument(java.io.File file) throws DweezilXMLException
file
- The XML File to read in
DweezilXMLException
public void saveDocument() throws ReloadDomException
ReloadDomException
- if an error occurspublic void saveAsDocument(java.io.File file) throws ReloadDomException
file
- The File to save as
ReloadDomException
- if an error occurspublic boolean isDirty()
public void setDirty(boolean isDirty)
isDirty
- true if the document is changed, false otherwisepublic org.jdom.Element getRootElement()
public org.jdom.Namespace getSchemaNamespace()
public boolean isDocumentNamespace(org.jdom.Element element)
public static boolean isMemberOfSameDocument(org.jdom.Element element1, org.jdom.Element element2)
|
VdexReload 1.1.3 API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |