|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.merlotxml.merlot.XMLFile
An XML file. This provides an internface into a particular XML file, including its dtd and its file location. It provides methods for loading and parsing a file, saving a file, and accessing the content model in the dtd.
Field Summary | |
protected boolean |
_dirty
Status holder for marking the file as needing a save |
protected ValidDocument |
_doc
The parsed DOM document with validation |
protected org.w3c.dom.DocumentType |
_docType
The document type (dtd) |
protected java.io.File |
_file
The file on the filesystem |
protected boolean |
_new
Status marker for brand new files so we can call saveas instead of save |
protected java.beans.PropertyChangeSupport |
_propchange
property change delegate |
Fields inherited from interface org.merlotxml.merlot.MerlotConstants |
ACTION_MENU_ACCELERATOR,
ACTION_MENU_ICON,
ACTION_NAME,
ACTION_SHORT_DESCRIPTION,
ACTION_SMALL_ICON,
AFTER,
BEFORE,
ERR,
INTO,
UI,
XML |
Constructor Summary | |
XMLFile()
creates a new file with a blank Document tree |
|
XMLFile(java.io.File f)
Reads in the given filename to create the Document tree |
Method Summary | |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener l)
|
void |
firePropertyChange(java.lang.String s,
boolean ov,
boolean nv)
|
org.w3c.dom.DocumentType |
getDoctype()
|
org.w3c.dom.Document |
getDocument()
Returns the DOM document for this file |
DTDDocument |
getDTD(java.lang.String name)
Returns the main DTDDocument for this file |
java.util.Enumeration |
getDTDAttributes(java.lang.String elementName)
|
DTDCacheEntry |
getDTDCacheEntry()
returns the DTDCacheEntry for this document. |
java.util.Enumeration |
getInsertableElements(org.w3c.dom.Element el,
int index)
|
java.lang.String |
getName()
|
java.lang.String |
getPath()
|
ValidDocument |
getValidDocument()
Returns the DOMLiaison ValidDocument wrapper for this file |
boolean |
isDirty()
|
boolean |
isNew()
returns the new property |
protected void |
parseDocument()
|
void |
printRawXML(java.io.OutputStream s,
boolean pretty)
|
void |
save()
Saves in the same file we opened |
void |
saveAs(java.io.File f)
Saves to a new file |
void |
setDirty(boolean tf)
|
void |
setNew(boolean tf)
Sets the new property |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected ValidDocument _doc
protected org.w3c.dom.DocumentType _docType
protected java.io.File _file
protected boolean _dirty
protected boolean _new
protected java.beans.PropertyChangeSupport _propchange
Constructor Detail |
public XMLFile(java.io.File f) throws MerlotException
public XMLFile() throws MerlotException
Method Detail |
public org.w3c.dom.Document getDocument()
public ValidDocument getValidDocument()
public DTDDocument getDTD(java.lang.String name)
public DTDCacheEntry getDTDCacheEntry()
public void setNew(boolean tf)
public boolean isNew()
public org.w3c.dom.DocumentType getDoctype()
protected void parseDocument() throws MerlotException
public void printRawXML(java.io.OutputStream s, boolean pretty) throws MerlotException
public java.lang.String getName()
public java.lang.String getPath()
public java.util.Enumeration getDTDAttributes(java.lang.String elementName)
public java.util.Enumeration getInsertableElements(org.w3c.dom.Element el, int index)
public void setDirty(boolean tf)
public boolean isDirty()
public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
public void firePropertyChange(java.lang.String s, boolean ov, boolean nv)
public void save() throws MerlotException
public void saveAs(java.io.File f) throws MerlotException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |