org.freecompany.redline
Class XmlEditor

java.lang.Object
  extended by org.freecompany.redline.XmlEditor
All Implemented Interfaces:
Serializable

public class XmlEditor
extends Object
implements Serializable

See Also:
Serialized Form

Constructor Summary
XmlEditor()
           
XmlEditor(Document document)
           
 
Method Summary
 void appendCollection(String nodePath, Collection values)
           
 Node appendNode(String path)
           
 void clearContext()
           
 ContentHandler contentHandler()
           
 Node createNode(String path)
           
 void deleteNodes(String path)
           
 Node findNode(String path)
           
 Iterable<Node> findNodes(String path)
           
 URI getBaseURI()
           
 boolean getBoolean(String path)
           
 boolean getBoolean(String path, boolean def)
           
 Document getDocument()
           
 int getInteger(String path)
           
 int getInteger(String path, int def)
           
 String getValue(String path)
           
 String getValue(String path, String def)
           
 URI getValueAsFullURI(String path)
           
 Number getValueAsNumber(String path)
           
 URI getValueAsURI(String path)
           
 boolean isModified()
           
 Node newNode(String name)
           
 Collection nodesToText(String path, Collection result)
           
static String normalizeString(String string)
           
 Node popContext()
           
 void pushContext(Node node)
           
 void read(File file)
           
 void read(InputStream in)
           
static Document readDocument(File file)
           
static Document readDocument(InputStream in)
           
 void replaceCollection(String nodePath, Collection values)
           
 void setDocument(Document document)
           
 void setModified(boolean modified)
           
 void setValue(String path, String value)
           
 void startPrefixMapping(String uri, String prefix)
           
 void write(ContentHandler handler)
           
static void write(Document doc, File file)
           
static void write(Document doc, OutputStream out)
           
 void write(File file)
           
 void write(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(Document document)
Method Detail

setDocument

public void setDocument(Document document)

getDocument

public Document getDocument()

pushContext

public void pushContext(Node node)

popContext

public Node popContext()

clearContext

public void clearContext()

startPrefixMapping

public void startPrefixMapping(String uri,
                               String prefix)

isModified

public boolean isModified()

setModified

public void setModified(boolean modified)

read

public void read(File file)
          throws SAXException,
                 IOException
Throws:
SAXException
IOException

read

public void read(InputStream in)
          throws SAXException,
                 IOException
Throws:
SAXException
IOException

write

public void write(File file)
           throws IOException
Throws:
IOException

write

public void write(OutputStream out)
           throws IOException
Throws:
IOException

write

public void write(ContentHandler handler)
           throws IOException
Throws:
IOException

createNode

public Node createNode(String path)

findNode

public Node findNode(String path)

findNodes

public Iterable<Node> findNodes(String path)

setValue

public void setValue(String path,
                     String value)

getValue

public String getValue(String path)

getValueAsNumber

public Number getValueAsNumber(String path)

getValue

public String getValue(String path,
                       String def)

getBoolean

public boolean getBoolean(String path)

getBoolean

public boolean getBoolean(String path,
                          boolean def)

getInteger

public int getInteger(String path)

getInteger

public int getInteger(String path,
                      int def)

getBaseURI

public URI getBaseURI()

getValueAsURI

public URI getValueAsURI(String path)

getValueAsFullURI

public URI getValueAsFullURI(String path)

deleteNodes

public void deleteNodes(String path)

appendNode

public Node appendNode(String path)

appendCollection

public void appendCollection(String nodePath,
                             Collection values)

replaceCollection

public void replaceCollection(String nodePath,
                              Collection values)

nodesToText

public Collection nodesToText(String path,
                              Collection result)

contentHandler

public ContentHandler contentHandler()

newNode

public Node newNode(String name)

readDocument

public static Document readDocument(File file)
                             throws SAXException,
                                    IOException
Throws:
SAXException
IOException

readDocument

public static Document readDocument(InputStream in)
                             throws SAXException,
                                    IOException
Throws:
SAXException
IOException

write

public static void write(Document doc,
                         File file)
                  throws IOException
Throws:
IOException

write

public static void write(Document doc,
                         OutputStream out)
                  throws IOException
Throws:
IOException

normalizeString

public static String normalizeString(String string)


Copyright © 2014. All Rights Reserved.