org.freecompany.util.xml.editor
Class XmlEditor

java.lang.Object
  extended by org.freecompany.util.xml.editor.XmlEditor
All Implemented Interfaces:
java.io.Serializable

public class XmlEditor
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Constructor Summary
XmlEditor()
           
XmlEditor(org.w3c.dom.Document document)
           
 
Method Summary
 void appendCollection(java.lang.String nodePath, java.util.Collection values)
           
 org.w3c.dom.Node appendNode(java.lang.String path)
           
 void clearContext()
           
 org.xml.sax.ContentHandler contentHandler()
           
 org.w3c.dom.Node createNode(java.lang.String path)
           
 void deleteNodes(java.lang.String path)
           
 org.w3c.dom.Node findNode(java.lang.String path)
           
 java.lang.Iterable<org.w3c.dom.Node> findNodes(java.lang.String path)
           
 java.net.URI getBaseURI()
           
 boolean getBoolean(java.lang.String path)
           
 boolean getBoolean(java.lang.String path, boolean def)
           
 org.w3c.dom.Document getDocument()
           
 int getInteger(java.lang.String path)
           
 int getInteger(java.lang.String path, int def)
           
 java.lang.String getValue(java.lang.String path)
           
 java.lang.String getValue(java.lang.String path, java.lang.String def)
           
 java.net.URI getValueAsFullURI(java.lang.String path)
           
 java.lang.Number getValueAsNumber(java.lang.String path)
           
 java.net.URI getValueAsURI(java.lang.String path)
           
 boolean isModified()
           
 org.w3c.dom.Node newNode(java.lang.String name)
           
 java.util.Collection nodesToText(java.lang.String path, java.util.Collection result)
           
static java.lang.String normalizeString(java.lang.String string)
           
 org.w3c.dom.Node popContext()
           
 void pushContext(org.w3c.dom.Node node)
           
 void read(java.io.File file)
           
 void read(java.io.InputStream in)
           
static org.w3c.dom.Document readDocument(java.io.File file)
           
static org.w3c.dom.Document readDocument(java.io.InputStream in)
           
 void replaceCollection(java.lang.String nodePath, java.util.Collection values)
           
 void setDocument(org.w3c.dom.Document document)
           
 void setModified(boolean modified)
           
 void setValue(java.lang.String path, java.lang.String value)
           
 void startPrefixMapping(java.lang.String uri, java.lang.String prefix)
           
 void write(org.xml.sax.ContentHandler handler)
           
static void write(org.w3c.dom.Document doc, java.io.File file)
           
static void write(org.w3c.dom.Document doc, java.io.OutputStream out)
           
 void write(java.io.File file)
           
 void write(java.io.OutputStream out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlEditor

public XmlEditor()

XmlEditor

public XmlEditor(org.w3c.dom.Document document)
Method Detail

setDocument

public void setDocument(org.w3c.dom.Document document)

getDocument

public org.w3c.dom.Document getDocument()

pushContext

public void pushContext(org.w3c.dom.Node node)

popContext

public org.w3c.dom.Node popContext()

clearContext

public void clearContext()

startPrefixMapping

public void startPrefixMapping(java.lang.String uri,
                               java.lang.String prefix)

isModified

public boolean isModified()

setModified

public void setModified(boolean modified)

read

public void read(java.io.File file)
          throws org.xml.sax.SAXException,
                 java.io.IOException
Throws:
org.xml.sax.SAXException
java.io.IOException

read

public void read(java.io.InputStream in)
          throws org.xml.sax.SAXException,
                 java.io.IOException
Throws:
org.xml.sax.SAXException
java.io.IOException

write

public void write(java.io.File file)
           throws java.io.IOException
Throws:
java.io.IOException

write

public void write(java.io.OutputStream out)
           throws java.io.IOException
Throws:
java.io.IOException

write

public void write(org.xml.sax.ContentHandler handler)
           throws java.io.IOException
Throws:
java.io.IOException

createNode

public org.w3c.dom.Node createNode(java.lang.String path)

findNode

public org.w3c.dom.Node findNode(java.lang.String path)

findNodes

public java.lang.Iterable<org.w3c.dom.Node> findNodes(java.lang.String path)

setValue

public void setValue(java.lang.String path,
                     java.lang.String value)

getValue

public java.lang.String getValue(java.lang.String path)

getValueAsNumber

public java.lang.Number getValueAsNumber(java.lang.String path)

getValue

public java.lang.String getValue(java.lang.String path,
                                 java.lang.String def)

getBoolean

public boolean getBoolean(java.lang.String path)

getBoolean

public boolean getBoolean(java.lang.String path,
                          boolean def)

getInteger

public int getInteger(java.lang.String path)

getInteger

public int getInteger(java.lang.String path,
                      int def)

getBaseURI

public java.net.URI getBaseURI()

getValueAsURI

public java.net.URI getValueAsURI(java.lang.String path)

getValueAsFullURI

public java.net.URI getValueAsFullURI(java.lang.String path)

deleteNodes

public void deleteNodes(java.lang.String path)

appendNode

public org.w3c.dom.Node appendNode(java.lang.String path)

appendCollection

public void appendCollection(java.lang.String nodePath,
                             java.util.Collection values)

replaceCollection

public void replaceCollection(java.lang.String nodePath,
                              java.util.Collection values)

nodesToText

public java.util.Collection nodesToText(java.lang.String path,
                                        java.util.Collection result)

contentHandler

public org.xml.sax.ContentHandler contentHandler()

newNode

public org.w3c.dom.Node newNode(java.lang.String name)

readDocument

public static org.w3c.dom.Document readDocument(java.io.File file)
                                         throws org.xml.sax.SAXException,
                                                java.io.IOException
Throws:
org.xml.sax.SAXException
java.io.IOException

readDocument

public static org.w3c.dom.Document readDocument(java.io.InputStream in)
                                         throws org.xml.sax.SAXException,
                                                java.io.IOException
Throws:
org.xml.sax.SAXException
java.io.IOException

write

public static void write(org.w3c.dom.Document doc,
                         java.io.File file)
                  throws java.io.IOException
Throws:
java.io.IOException

write

public static void write(org.w3c.dom.Document doc,
                         java.io.OutputStream out)
                  throws java.io.IOException
Throws:
java.io.IOException

normalizeString

public static java.lang.String normalizeString(java.lang.String string)