org.opennms.web.parsers
Class XMLWriter
java.lang.Object
org.opennms.web.parsers.XMLWriter
- Direct Known Subclasses:
- GroupsWriter, NotificationsWriter, UsersWriter, ViewsWriter
public abstract class XMLWriter
- extends Object
This class is used to parse data from and save data to the users.xml file.
- Version:
- 1.1.1.1
- Author:
- Jason Johns , OpenNMS
|
Constructor Summary |
XMLWriter(String fileName)
Default constructor, intializes the member variables |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
m_headerInfo
protected static XMLHeader m_headerInfo
- The header information parsed from the file
m_document
protected Document m_document
m_docBuilder
protected DocumentBuilder m_docBuilder
m_fileName
protected String m_fileName
m_baseName
protected String m_baseName
m_xmlPath
protected String m_xmlPath
m_dtdPath
protected String m_dtdPath
m_dtd
protected String m_dtd
XML_EXTENSION
protected static final String XML_EXTENSION
- See Also:
- Constant Field Values
DTD_EXTENSION
protected static final String DTD_EXTENSION
- See Also:
- Constant Field Values
XMLWriter
public XMLWriter(String fileName)
throws XMLWriteException
- Default constructor, intializes the member variables
- Throws:
XMLWriteException
loadDTD
protected void loadDTD(String dtdFileName)
throws FileNotFoundException,
IOException
- Throws:
FileNotFoundException
IOException
getDTD
public String getDTD(String dtdFileName)
throws FileNotFoundException,
IOException
- Throws:
FileNotFoundException
IOException
getVersion
public String getVersion()
backup
public void backup()
throws XMLWriteException
- This method attempts to make a backup of the xml file. It is recommended
that this method is called prior to making the call to save(), so that
the original config file will be recoverable if the writting of the new
config file fails.
- Throws:
XMLWriteException
serializeToFile
protected void serializeToFile()
throws XMLWriteException
- Throws:
XMLWriteException
addEmptyElement
public Element addEmptyElement(Element parent,
String elementName)
addDataElement
public Element addDataElement(Element parent,
String elementName,
String data)
addCDataElement
public Element addCDataElement(Element parent,
String elementName,
String data)
throws XMLWriteException
- Throws:
XMLWriteException
save
public void save(Collection list)
throws XMLWriteException
- Throws:
XMLWriteException
saveDocument
protected abstract void saveDocument(Collection list)
throws XMLWriteException
- Throws:
XMLWriteException
Copyright ? 2007. All Rights Reserved.