Package org.fugerit.java.core.xml.dom
Class DOMIO
- java.lang.Object
-
- org.fugerit.java.core.xml.dom.DOMIO
-
public class DOMIO extends Object
Simple IO operations on xml DOM (Document Object Model).- Author:
- Fugerit
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_INDENT
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Document
loadDOMDoc(File source)
Load a DOM structure from a Filestatic Document
loadDOMDoc(File source, boolean nsa)
static Document
loadDOMDoc(InputStream source)
Load a DOM structure from a streamstatic Document
loadDOMDoc(InputStream source, boolean nsa)
static Document
loadDOMDoc(Reader source)
Load a DOM structure from a Readerstatic Document
loadDOMDoc(Reader source, boolean nsa)
static Document
loadDOMDoc(String source)
Load a DOM structure from a stringstatic Document
loadDOMDoc(InputSource source)
Load a DOM structure from a sourcestatic Document
loadDOMDoc(InputSource source, boolean nsa)
static Document
loadDOMDoc(InputSource source, EntityResolver er)
Load a DOM structure from a sourcestatic Document
loadDOMDoc(InputSource source, EntityResolver er, boolean nsa)
static DocumentBuilderFactory
newDocumentBuilderFactory(boolean allowExternaEntities)
static DocumentBuilderFactory
newSafeDocumentBuilderFactory()
static DocumentBuilderFactory
newSafeDocumentBuilderFactory(Properties features)
static void
writeDOM(Node tag, OutputStream stream)
Write a DOM structure to a streamstatic void
writeDOMIndent(Node tag, OutputStream result)
Write a DOM structure to a stream, with indentationstatic void
writeDOMIndent(Node tag, Writer result)
Write a DOM structure to a stream, with indentationstatic void
writeDOMIndent(Node tag, Writer result, int indent)
Write a DOM structure to a stream, with indentationstatic void
writeDOMIndent(Node tag, Result result)
Write a DOM structure to a stream, with indentationstatic void
writeDOMIndent(Node tag, Result result, int indent)
Write a DOM structure to a stream, with indentation
-
-
-
Field Detail
-
DEFAULT_INDENT
public static final int DEFAULT_INDENT
- See Also:
- Constant Field Values
-
-
Method Detail
-
newSafeDocumentBuilderFactory
public static DocumentBuilderFactory newSafeDocumentBuilderFactory(Properties features)
-
newDocumentBuilderFactory
public static DocumentBuilderFactory newDocumentBuilderFactory(boolean allowExternaEntities)
-
newSafeDocumentBuilderFactory
public static DocumentBuilderFactory newSafeDocumentBuilderFactory()
-
loadDOMDoc
public static Document loadDOMDoc(String source) throws XMLException
Load a DOM structure from a string- Parameters:
source
- the source- Returns:
- the DOM structure
- Throws:
XMLException
- in case of issues
-
loadDOMDoc
public static Document loadDOMDoc(InputSource source, EntityResolver er) throws XMLException
Load a DOM structure from a source- Parameters:
source
- the sourceer
- an entity resolver- Returns:
- the DOM structure
- Throws:
XMLException
- in case of issues
-
loadDOMDoc
public static Document loadDOMDoc(InputSource source, EntityResolver er, boolean nsa) throws XMLException
- Throws:
XMLException
-
loadDOMDoc
public static Document loadDOMDoc(InputSource source) throws XMLException
Load a DOM structure from a source- Parameters:
source
- the source- Returns:
- the DOM structure
- Throws:
XMLException
- in case of issues
-
loadDOMDoc
public static Document loadDOMDoc(InputSource source, boolean nsa) throws XMLException
- Throws:
XMLException
-
loadDOMDoc
public static Document loadDOMDoc(Reader source) throws XMLException
Load a DOM structure from a Reader- Parameters:
source
- the source- Returns:
- the DOM structure
- Throws:
XMLException
- in case of issues
-
loadDOMDoc
public static Document loadDOMDoc(Reader source, boolean nsa) throws XMLException
- Throws:
XMLException
-
loadDOMDoc
public static Document loadDOMDoc(InputStream source) throws XMLException
Load a DOM structure from a stream- Parameters:
source
- the source- Returns:
- the DOM structure
- Throws:
XMLException
- in case of issues
-
loadDOMDoc
public static Document loadDOMDoc(InputStream source, boolean nsa) throws XMLException
- Throws:
XMLException
-
loadDOMDoc
public static Document loadDOMDoc(File source) throws XMLException
Load a DOM structure from a File- Parameters:
source
- the source- Returns:
- the DOM structure
- Throws:
XMLException
- in case of issues
-
loadDOMDoc
public static Document loadDOMDoc(File source, boolean nsa) throws XMLException
- Throws:
XMLException
-
writeDOM
public static void writeDOM(Node tag, OutputStream stream) throws XMLException
Write a DOM structure to a stream- Parameters:
tag
- the DOM structurestream
- the destination stream- Throws:
XMLException
- in case of issues
-
writeDOMIndent
public static void writeDOMIndent(Node tag, OutputStream result) throws XMLException
Write a DOM structure to a stream, with indentation- Parameters:
tag
- the DOM structureresult
- the destination stream- Throws:
XMLException
- in case of issues
-
writeDOMIndent
public static void writeDOMIndent(Node tag, Writer result) throws XMLException
Write a DOM structure to a stream, with indentation- Parameters:
tag
- the DOM structureresult
- the destination stream- Throws:
XMLException
- in case of issues
-
writeDOMIndent
public static void writeDOMIndent(Node tag, Result result) throws XMLException
Write a DOM structure to a stream, with indentation- Parameters:
tag
- the DOM structureresult
- the destination stream- Throws:
XMLException
- in case of issues
-
writeDOMIndent
public static void writeDOMIndent(Node tag, Result result, int indent) throws XMLException
Write a DOM structure to a stream, with indentation- Parameters:
tag
- the DOM structureresult
- the destination resultindent
- indent amount- Throws:
XMLException
- in case of issues
-
writeDOMIndent
public static void writeDOMIndent(Node tag, Writer result, int indent) throws XMLException
Write a DOM structure to a stream, with indentation- Parameters:
tag
- the DOM structureresult
- the destination resultindent
- indent amount- Throws:
XMLException
- in case of issues
-
-