Class DOMIO


  • public class DOMIO
    extends Object
    Simple IO operations on xml DOM (Document Object Model).
    Author:
    Fugerit
    • Method Detail

      • newDocumentBuilderFactory

        public static DocumentBuilderFactory newDocumentBuilderFactory​(boolean allowExternaEntities)
      • 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)
                                   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​(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​(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​(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
      • writeDOM

        public static void writeDOM​(Node tag,
                                    OutputStream stream)
                             throws XMLException
        Write a DOM structure to a stream
        Parameters:
        tag - the DOM structure
        stream - 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 structure
        result - 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 structure
        result - 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 structure
        result - 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 structure
        result - the destination result
        indent - 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 structure
        result - the destination result
        indent - indent amount
        Throws:
        XMLException - in case of issues