Class XmlFormatter

    • Constructor Detail

      • XmlFormatter

        public XmlFormatter()
        Creates a new XML formatter.
      • XmlFormatter

        public XmlFormatter​(Map<StructuredFormatter.Key,​String> keyOverrides)
        Creates a new XML formatter.

        If the keyOverrides is empty the default namespace will be used.

        Parameters:
        keyOverrides - a map of overrides for the default keys
    • Method Detail

      • isPrettyPrint

        public boolean isPrettyPrint()
        Indicates whether or not pretty printing is enabled.
        Returns:
        true if pretty printing is enabled, otherwise false
      • setPrettyPrint

        public void setPrettyPrint​(boolean prettyPrint)
        Turns on or off pretty printing.
        Parameters:
        prettyPrint - true to turn on pretty printing or false to turn it off
      • isPrintNamespace

        public boolean isPrintNamespace()
        Indicates whether or not the name space should be written on the <record/>.
        Returns:
        true if the name space should be written for each record
      • setPrintNamespace

        public void setPrintNamespace​(boolean printNamespace)
        Turns on or off the printing of the namespace for each <record/>. This is set to false by default.
        Parameters:
        printNamespace - true if the name space should be written for each record
      • getNamespaceUri

        public String getNamespaceUri()
        Returns the namespace URI used for each record if isPrintNamespace() is true.
        Returns:
        the namespace URI, may be null if explicitly set to null
      • setNamespaceUri

        public void setNamespaceUri​(String namespaceUri)
        Sets the namespace URI used for each record if isPrintNamespace() is true.
        Parameters:
        namespaceUri - the namespace to use or null if no namespace URI should be used regardless of the isPrintNamespace() value