|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.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)
Adds a feature to the PropertyChangeListener attribute of the XMLFile object |
protected void |
close()
|
protected void |
close(java.io.File f)
|
boolean |
elementIsValid(org.w3c.dom.Element el,
boolean checkChildren)
Description of the Method |
void |
firePropertyChange(java.lang.String s,
boolean ov,
boolean nv)
Description of the Method |
org.w3c.dom.DocumentType |
getDoctype()
Gets the doctype attribute of the XMLFile object |
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)
Gets the dTDAttributes attribute of the XMLFile object |
DTDCacheEntry |
getDTDCacheEntry()
returns the DTDCacheEntry for this document. |
protected java.io.InputStream |
getFileInputStream()
|
java.util.Enumeration |
getInsertableElements(org.w3c.dom.Element el)
Gets the insertableElements attribute of the XMLFile object |
java.util.Enumeration |
getInsertableElements(org.w3c.dom.Element el,
int index)
Gets the insertableElements attribute of the XMLFile object |
static MerlotDOMNode |
getInstanciatedNode(org.w3c.dom.Node node)
Gets the instanciatedNode attribute of the XMLFile class |
java.lang.String |
getName()
Gets the name attribute of the XMLFile object |
java.lang.String |
getPath()
Gets the path attribute of the XMLFile object |
ValidDocument |
getValidDocument()
Returns the DOMLiaison ValidDocument wrapper for this file |
XMLEditorDoc |
getXMLEditorDoc()
|
boolean |
isDirty()
Gets the dirty attribute of the XMLFile object |
boolean |
isNew()
returns the new property |
protected void |
parseDocument()
Description of the Method |
void |
printRawXML(java.io.OutputStream s,
boolean pretty)
Description of the Method |
static void |
putInstanciatedNode(org.w3c.dom.Node node,
MerlotDOMNode mNode)
Description of the Method |
void |
save()
Saves in the same file we opened |
void |
saveAs(java.io.File f)
Saves to a new file |
void |
setDirty(boolean tf)
Sets the dirty attribute of the XMLFile object |
void |
setNew(boolean tf)
Sets the new property |
void |
setXMLEditorDoc(XMLEditorDoc doc)
|
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
f
- Description of the Parameter
MerlotException
- Description of the Exceptionpublic XMLFile() throws MerlotException
MerlotException
- Description of the ExceptionMethod Detail |
public void setXMLEditorDoc(XMLEditorDoc doc)
public XMLEditorDoc getXMLEditorDoc()
public org.w3c.dom.Document getDocument()
public ValidDocument getValidDocument()
public DTDDocument getDTD(java.lang.String name)
name
- Description of the Parameter
public DTDCacheEntry getDTDCacheEntry()
public void setNew(boolean tf)
tf
- The new new valuepublic boolean isNew()
public org.w3c.dom.DocumentType getDoctype()
protected void parseDocument() throws MerlotException
MerlotException
- Description of the Exceptionprotected java.io.InputStream getFileInputStream() throws java.io.FileNotFoundException
java.io.FileNotFoundException
public void printRawXML(java.io.OutputStream s, boolean pretty) throws MerlotException
s
- Description of the Parameterpretty
- Description of the Parameter
MerlotException
- Description of the Exceptionpublic java.lang.String getName()
public java.lang.String getPath()
public java.util.Enumeration getDTDAttributes(java.lang.String elementName)
elementName
- Description of the Parameter
public java.util.Enumeration getInsertableElements(org.w3c.dom.Element el, int index)
el
- Description of the Parameterindex
- Description of the Parameter
public java.util.Enumeration getInsertableElements(org.w3c.dom.Element el)
el
- Description of the Parameter
public boolean elementIsValid(org.w3c.dom.Element el, boolean checkChildren)
el
- Description of the ParametercheckChildren
- Description of the Parameter
public void setDirty(boolean tf)
tf
- The new dirty valuepublic boolean isDirty()
public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
l
- The feature to be added to the PropertyChangeListener attributepublic void firePropertyChange(java.lang.String s, boolean ov, boolean nv)
s
- Description of the Parameterov
- Description of the Parameternv
- Description of the Parameterpublic void save() throws MerlotException
MerlotException
- Description of the Exceptionpublic void saveAs(java.io.File f) throws MerlotException
f
- Description of the Parameter
MerlotException
- Description of the Exceptionprotected void close()
protected void close(java.io.File f)
public static void putInstanciatedNode(org.w3c.dom.Node node, MerlotDOMNode mNode)
node
- Description of the ParametermNode
- Description of the Parameterpublic static MerlotDOMNode getInstanciatedNode(org.w3c.dom.Node node)
node
- Description of the Parameter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |