org.thewonderlemming.c4plantuml.graphml.export

## Class CDataDocumentDecorator

- java.lang.Object
- - org.thewonderlemming.c4plantuml.graphml.export.CDataDocumentDecorator

- All Implemented Interfaces:
    Document, Node

      public class CDataDocumentDecorator
      extends Object
      implements Document

  A `Document` decorator to handle CDATA tags around values in JAXB marshalling operations.
  Author:
    thewonderlemming

- - ### Field Summary

    - ### Fields inherited from interface org.w3c.dom.Node

      `ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Node` | `adoptNode(Node source)`
    `Node` | `appendChild(Node newChild)`
    `Node` | `cloneNode(boolean deep)`
    `short` | `compareDocumentPosition(Node other)`
    `Attr` | `createAttribute(String name)`
    `Attr` | `createAttributeNS(String namespaceURI, String qualifiedName)`
    `CDATASection` | `createCDATASection(String data)`
    `Comment` | `createComment(String data)`
    `DocumentFragment` | `createDocumentFragment()`
    `Element` | `createElement(String tagName)`
    `Element` | `createElementNS(String namespaceURI, String qualifiedName)`
    `EntityReference` | `createEntityReference(String name)`
    `ProcessingInstruction` | `createProcessingInstruction(String target, String data)`
    `Text` | `createTextNode(String data)`
    `Optional<String>` | `exportAsString(Charset charset, boolean indent, boolean validate, boolean strictValidation)` Exports the content of the document as a string that contains CDATA tags around values.
    `NamedNodeMap` | `getAttributes()`
    `String` | `getBaseURI()`
    `NodeList` | `getChildNodes()`
    `DocumentType` | `getDoctype()`
    `Element` | `getDocumentElement()`
    `String` | `getDocumentURI()`
    `DOMConfiguration` | `getDomConfig()`
    `Element` | `getElementById(String elementId)`
    `NodeList` | `getElementsByTagName(String tagname)`
    `NodeList` | `getElementsByTagNameNS(String namespaceURI, String localName)`
    `Object` | `getFeature(String feature, String version)`
    `Node` | `getFirstChild()`
    `DOMImplementation` | `getImplementation()`
    `String` | `getInputEncoding()`
    `Node` | `getLastChild()`
    `String` | `getLocalName()`
    `String` | `getNamespaceURI()`
    `Node` | `getNextSibling()`
    `String` | `getNodeName()`
    `short` | `getNodeType()`
    `String` | `getNodeValue()`
    `Document` | `getOwnerDocument()`
    `Node` | `getParentNode()`
    `String` | `getPrefix()`
    `Node` | `getPreviousSibling()`
    `boolean` | `getStrictErrorChecking()`
    `String` | `getTextContent()`
    `Object` | `getUserData(String key)`
    `String` | `getXmlEncoding()`
    `boolean` | `getXmlStandalone()`
    `String` | `getXmlVersion()`
    `boolean` | `hasAttributes()`
    `boolean` | `hasChildNodes()`
    `Node` | `importNode(Node importedNode, boolean deep)`
    `Node` | `insertBefore(Node newChild, Node refChild)`
    `boolean` | `isDefaultNamespace(String namespaceURI)`
    `boolean` | `isEqualNode(Node arg)`
    `boolean` | `isSameNode(Node other)`
    `boolean` | `isSupported(String feature, String version)`
    `String` | `lookupNamespaceURI(String prefix)`
    `String` | `lookupPrefix(String namespaceURI)`
    `static CDataDocumentDecorator` | `newInstance()` A factory method that builds a new `Document` and decorates it with the returned `CDataDocumentDecorator` instance.
    `static CDataDocumentDecorator` | `newInstance(Document decorated)` A factory method that builds a new `CDataDocumentDecorator` instance given a `Document` to decorate.
    `void` | `normalize()`
    `void` | `normalizeDocument()`
    `Node` | `removeChild(Node oldChild)`
    `Node` | `renameNode(Node n, String namespaceURI, String qualifiedName)`
    `Node` | `replaceChild(Node newChild, Node oldChild)`
    `void` | `setDocumentURI(String documentURI)`
    `void` | `setNodeValue(String nodeValue)`
    `void` | `setPrefix(String prefix)`
    `void` | `setStrictErrorChecking(boolean strictErrorChecking)`
    `void` | `setTextContent(String textContent)`
    `Object` | `setUserData(String key, Object data, UserDataHandler handler)`
    `void` | `setXmlStandalone(boolean xmlStandalone)`
    `void` | `setXmlVersion(String xmlVersion)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### newInstance

          public static CDataDocumentDecorator newInstance()
                                                    throws ParserConfigurationException

      A factory method that builds a new `Document` and decorates it with the returned `CDataDocumentDecorator` instance.
      Returns:
        a new `CDataDocumentDecorator` instance.
      Throws:
        `ParserConfigurationException` - if anything goes wrong while creating the `Document` instance.

    - #### newInstance

          public static CDataDocumentDecorator newInstance(Document decorated)

      A factory method that builds a new `CDataDocumentDecorator` instance given a `Document` to decorate.
      Parameters:
        `decorated` - the `Document` to decorate.
      Returns:
        a new `CDataDocumentDecorator` instance.

    - #### adoptNode

          public Node adoptNode(Node source)

      Specified by:
        `adoptNode` in interface `Document`

    - #### appendChild

          public Node appendChild(Node newChild)

      Specified by:
        `appendChild` in interface `Node`

    - #### cloneNode

          public Node cloneNode(boolean deep)

      Specified by:
        `cloneNode` in interface `Node`

    - #### compareDocumentPosition

          public short compareDocumentPosition(Node other)

      Specified by:
        `compareDocumentPosition` in interface `Node`

    - #### createAttribute

          public Attr createAttribute(String name)

      Specified by:
        `createAttribute` in interface `Document`

    - #### createAttributeNS

          public Attr createAttributeNS(String namespaceURI,
                                        String qualifiedName)

      Specified by:
        `createAttributeNS` in interface `Document`

    - #### createCDATASection

          public CDATASection createCDATASection(String data)

      Specified by:
        `createCDATASection` in interface `Document`

    - #### createComment

          public Comment createComment(String data)

      Specified by:
        `createComment` in interface `Document`

    - #### createDocumentFragment

          public DocumentFragment createDocumentFragment()

      Specified by:
        `createDocumentFragment` in interface `Document`

    - #### createElement

          public Element createElement(String tagName)

      Specified by:
        `createElement` in interface `Document`

    - #### createElementNS

          public Element createElementNS(String namespaceURI,
                                         String qualifiedName)

      Specified by:
        `createElementNS` in interface `Document`

    - #### createEntityReference

          public EntityReference createEntityReference(String name)

      Specified by:
        `createEntityReference` in interface `Document`

    - #### createProcessingInstruction

          public ProcessingInstruction createProcessingInstruction(String target,
                                                                   String data)

      Specified by:
        `createProcessingInstruction` in interface `Document`

    - #### createTextNode

          public Text createTextNode(String data)

      Specified by:
        `createTextNode` in interface `Document`

    - #### exportAsString

          public Optional<String> exportAsString(Charset charset,
                                                 boolean indent,
                                                 boolean validate,
                                                 boolean strictValidation)

      Exports the content of the document as a string that contains CDATA tags around values.
      Parameters:
        `charset` - the `Charset` to use for the XML output.
        `indent` - a flag that tells whether or not the XML output should fit on a single line.
        `validate` - a flag that telles whether or not the XML output should be validated against an XSD.
        `strictValidation` - a flag that tells whether or not validation exception should void the marshalling result.
      Returns:
        an `Optional` of the result of the XML marshalling operation. Can be empty.

    - #### getAttributes

          public NamedNodeMap getAttributes()

      Specified by:
        `getAttributes` in interface `Node`

    - #### getBaseURI

          public String getBaseURI()

      Specified by:
        `getBaseURI` in interface `Node`

    - #### getChildNodes

          public NodeList getChildNodes()

      Specified by:
        `getChildNodes` in interface `Node`

    - #### getDoctype

          public DocumentType getDoctype()

      Specified by:
        `getDoctype` in interface `Document`

    - #### getDocumentElement

          public Element getDocumentElement()

      Specified by:
        `getDocumentElement` in interface `Document`

    - #### getDocumentURI

          public String getDocumentURI()

      Specified by:
        `getDocumentURI` in interface `Document`

    - #### getDomConfig

          public DOMConfiguration getDomConfig()

      Specified by:
        `getDomConfig` in interface `Document`

    - #### getElementById

          public Element getElementById(String elementId)

      Specified by:
        `getElementById` in interface `Document`

    - #### getElementsByTagName

          public NodeList getElementsByTagName(String tagname)

      Specified by:
        `getElementsByTagName` in interface `Document`

    - #### getElementsByTagNameNS

          public NodeList getElementsByTagNameNS(String namespaceURI,
                                                 String localName)

      Specified by:
        `getElementsByTagNameNS` in interface `Document`

    - #### getFeature

          public Object getFeature(String feature,
                                   String version)

      Specified by:
        `getFeature` in interface `Node`

    - #### getFirstChild

          public Node getFirstChild()

      Specified by:
        `getFirstChild` in interface `Node`

    - #### getImplementation

          public DOMImplementation getImplementation()

      Specified by:
        `getImplementation` in interface `Document`

    - #### getInputEncoding

          public String getInputEncoding()

      Specified by:
        `getInputEncoding` in interface `Document`

    - #### getLastChild

          public Node getLastChild()

      Specified by:
        `getLastChild` in interface `Node`

    - #### getLocalName

          public String getLocalName()

      Specified by:
        `getLocalName` in interface `Node`

    - #### getNamespaceURI

          public String getNamespaceURI()

      Specified by:
        `getNamespaceURI` in interface `Node`

    - #### getNextSibling

          public Node getNextSibling()

      Specified by:
        `getNextSibling` in interface `Node`

    - #### getNodeName

          public String getNodeName()

      Specified by:
        `getNodeName` in interface `Node`

    - #### getNodeType

          public short getNodeType()

      Specified by:
        `getNodeType` in interface `Node`

    - #### getNodeValue

          public String getNodeValue()

      Specified by:
        `getNodeValue` in interface `Node`

    - #### getOwnerDocument

          public Document getOwnerDocument()

      Specified by:
        `getOwnerDocument` in interface `Node`

    - #### getParentNode

          public Node getParentNode()

      Specified by:
        `getParentNode` in interface `Node`

    - #### getPrefix

          public String getPrefix()

      Specified by:
        `getPrefix` in interface `Node`

    - #### getPreviousSibling

          public Node getPreviousSibling()

      Specified by:
        `getPreviousSibling` in interface `Node`

    - #### getStrictErrorChecking

          public boolean getStrictErrorChecking()

      Specified by:
        `getStrictErrorChecking` in interface `Document`

    - #### getTextContent

          public String getTextContent()

      Specified by:
        `getTextContent` in interface `Node`

    - #### getUserData

          public Object getUserData(String key)

      Specified by:
        `getUserData` in interface `Node`

    - #### getXmlEncoding

          public String getXmlEncoding()

      Specified by:
        `getXmlEncoding` in interface `Document`

    - #### getXmlStandalone

          public boolean getXmlStandalone()

      Specified by:
        `getXmlStandalone` in interface `Document`

    - #### getXmlVersion

          public String getXmlVersion()

      Specified by:
        `getXmlVersion` in interface `Document`

    - #### hasAttributes

          public boolean hasAttributes()

      Specified by:
        `hasAttributes` in interface `Node`

    - #### hasChildNodes

          public boolean hasChildNodes()

      Specified by:
        `hasChildNodes` in interface `Node`

    - #### importNode

          public Node importNode(Node importedNode,
                                 boolean deep)

      Specified by:
        `importNode` in interface `Document`

    - #### insertBefore

          public Node insertBefore(Node newChild,
                                   Node refChild)

      Specified by:
        `insertBefore` in interface `Node`

    - #### isDefaultNamespace

          public boolean isDefaultNamespace(String namespaceURI)

      Specified by:
        `isDefaultNamespace` in interface `Node`

    - #### isEqualNode

          public boolean isEqualNode(Node arg)

      Specified by:
        `isEqualNode` in interface `Node`

    - #### isSameNode

          public boolean isSameNode(Node other)

      Specified by:
        `isSameNode` in interface `Node`

    - #### isSupported

          public boolean isSupported(String feature,
                                     String version)

      Specified by:
        `isSupported` in interface `Node`

    - #### lookupNamespaceURI

          public String lookupNamespaceURI(String prefix)

      Specified by:
        `lookupNamespaceURI` in interface `Node`

    - #### lookupPrefix

          public String lookupPrefix(String namespaceURI)

      Specified by:
        `lookupPrefix` in interface `Node`

    - #### normalize

          public void normalize()

      Specified by:
        `normalize` in interface `Node`

    - #### normalizeDocument

          public void normalizeDocument()

      Specified by:
        `normalizeDocument` in interface `Document`

    - #### removeChild

          public Node removeChild(Node oldChild)

      Specified by:
        `removeChild` in interface `Node`

    - #### renameNode

          public Node renameNode(Node n,
                                 String namespaceURI,
                                 String qualifiedName)

      Specified by:
        `renameNode` in interface `Document`

    - #### replaceChild

          public Node replaceChild(Node newChild,
                                   Node oldChild)

      Specified by:
        `replaceChild` in interface `Node`

    - #### setDocumentURI

          public void setDocumentURI(String documentURI)

      Specified by:
        `setDocumentURI` in interface `Document`

    - #### setNodeValue

          public void setNodeValue(String nodeValue)

      Specified by:
        `setNodeValue` in interface `Node`

    - #### setPrefix

          public void setPrefix(String prefix)

      Specified by:
        `setPrefix` in interface `Node`

    - #### setStrictErrorChecking

          public void setStrictErrorChecking(boolean strictErrorChecking)

      Specified by:
        `setStrictErrorChecking` in interface `Document`

    - #### setTextContent

          public void setTextContent(String textContent)

      Specified by:
        `setTextContent` in interface `Node`

    - #### setUserData

          public Object setUserData(String key,
                                    Object data,
                                    UserDataHandler handler)

      Specified by:
        `setUserData` in interface `Node`

    - #### setXmlStandalone

          public void setXmlStandalone(boolean xmlStandalone)

      Specified by:
        `setXmlStandalone` in interface `Document`

    - #### setXmlVersion

          public void setXmlVersion(String xmlVersion)

      Specified by:
        `setXmlVersion` in interface `Document`

Copyright © 2020. All rights reserved.