Class CanonicalizerBase

    • Constructor Detail

      • CanonicalizerBase

        public CanonicalizerBase​(boolean includeComments)
        Constructor CanonicalizerBase
        Parameters:
        includeComments -
    • Method Detail

      • setWriter

        public void setWriter​(OutputStream writer)
        Description copied from class: CanonicalizerSpi
        Sets the writer where the canonicalization ends. ByteArrayOutputStream if none is set.
        Specified by:
        setWriter in class CanonicalizerSpi
        Parameters:
        writer - The writer to set.
      • engineCanonicalizeSubTree

        protected byte[] engineCanonicalizeSubTree​(Node rootNode,
                                                   Node excludeNode)
                                            throws CanonicalizationException
        Canonicalizes a Subtree node.
        Parameters:
        rootNode - the root of the subtree to canonicalize
        excludeNode - a node to be excluded from the canonicalize operation
        Returns:
        The canonicalize stream.
        Throws:
        CanonicalizationException
      • isVisibleDO

        protected int isVisibleDO​(Node currentNode,
                                  int level)
      • isVisibleInt

        protected int isVisibleInt​(Node currentNode)
      • isVisible

        protected boolean isVisible​(Node currentNode)
      • getParentNameSpaces

        protected final void getParentNameSpaces​(Element el,
                                                 NameSpaceSymbTable ns)
        Adds to ns the definitions from the parent elements of el
        Parameters:
        el -
        ns -
      • outputAttrToWriter

        protected static final void outputAttrToWriter​(String name,
                                                       String value,
                                                       OutputStream writer,
                                                       Map<String,​byte[]> cache)
                                                throws IOException
        Outputs an Attribute to the internal Writer. The string value of the node is modified by replacing
        • all ampersands with &amp;
        • all open angle brackets with &lt;
        • all quotation mark characters with &quot;
        • and the whitespace characters #x9, #xA, and #xD, with character references. The character references are written in uppercase hexadecimal with no leading zeroes (for example, #xD is represented by the character reference &#xD;)
        Parameters:
        name -
        value -
        writer -
        Throws:
        IOException
      • outputCommentToWriter

        protected void outputCommentToWriter​(Comment currentComment,
                                             OutputStream writer,
                                             int position)
                                      throws IOException
        Method outputCommentToWriter
        Parameters:
        currentComment -
        writer - writer where to write the things
        Throws:
        IOException
      • outputTextToWriter

        protected static final void outputTextToWriter​(String text,
                                                       OutputStream writer)
                                                throws IOException
        Outputs a Text of CDATA section to the internal Writer.
        Parameters:
        text -
        writer - writer where to write the things
        Throws:
        IOException
      • getNullNode

        protected Attr getNullNode​(Document ownerDocument)