public abstract class CanonicalizerBase extends CanonicalizerSpi
Modifier and Type | Field and Description |
---|---|
protected static AttrCompare |
COMPARE |
protected static int |
NODE_AFTER_DOCUMENT_ELEMENT |
protected static int |
NODE_BEFORE_DOCUMENT_ELEMENT |
protected static int |
NODE_NOT_BEFORE_OR_AFTER_DOCUMENT_ELEMENT |
static String |
XML |
static String |
XMLNS |
reset, secureValidation
Constructor and Description |
---|
CanonicalizerBase(boolean includeComments)
Constructor CanonicalizerBase
|
Modifier and Type | Method and Description |
---|---|
protected void |
canonicalizeSubTree(Node currentNode,
NameSpaceSymbTable ns,
Node endnode,
int documentLevel)
Method canonicalizeSubTree, this function is a recursive one.
|
protected void |
canonicalizeXPathNodeSet(Node currentNode,
Node endnode)
Canonicalizes all the nodes included in the currentNode and contained in the
xpathNodeSet field.
|
byte[] |
engineCanonicalize(XMLSignatureInput input)
Canonicalizes a Subtree node.
|
byte[] |
engineCanonicalizeSubTree(Node rootNode)
Method engineCanonicalizeSubTree
|
protected byte[] |
engineCanonicalizeSubTree(Node rootNode,
Node excludeNode)
Canonicalizes a Subtree node.
|
byte[] |
engineCanonicalizeXPathNodeSet(Set<Node> xpathNodeSet)
Method engineCanonicalizeXPathNodeSet
|
protected Attr |
getNullNode(Document ownerDocument) |
protected void |
getParentNameSpaces(Element el,
NameSpaceSymbTable ns)
Adds to ns the definitions from the parent elements of el
|
protected void |
handleParent(Element e,
NameSpaceSymbTable ns) |
protected boolean |
isVisible(Node currentNode) |
protected int |
isVisibleDO(Node currentNode,
int level) |
protected int |
isVisibleInt(Node currentNode) |
protected static void |
outputAttrToWriter(String name,
String value,
OutputStream writer,
Map<String,byte[]> cache)
Outputs an Attribute to the internal Writer.
|
protected void |
outputCommentToWriter(Comment currentComment,
OutputStream writer,
int position)
Method outputCommentToWriter
|
protected void |
outputPItoWriter(ProcessingInstruction currentPI,
OutputStream writer,
int position)
Outputs a PI to the internal Writer.
|
protected static void |
outputTextToWriter(String text,
OutputStream writer)
Outputs a Text of CDATA section to the internal Writer.
|
void |
setWriter(OutputStream writer)
Sets the writer where the canonicalization ends.
|
engineCanonicalize, engineCanonicalizeSubTree, engineCanonicalizeSubTree, engineCanonicalizeXPathNodeSet, engineCanonicalizeXPathNodeSet, engineCanonicalizeXPathNodeSet, engineGetIncludeComments, engineGetURI, isSecureValidation, setSecureValidation
public static final String XML
public static final String XMLNS
protected static final AttrCompare COMPARE
protected static final int NODE_BEFORE_DOCUMENT_ELEMENT
protected static final int NODE_NOT_BEFORE_OR_AFTER_DOCUMENT_ELEMENT
protected static final int NODE_AFTER_DOCUMENT_ELEMENT
public CanonicalizerBase(boolean includeComments)
includeComments
- public byte[] engineCanonicalizeSubTree(Node rootNode) throws CanonicalizationException
engineCanonicalizeSubTree
in class CanonicalizerSpi
rootNode
- CanonicalizationException
public byte[] engineCanonicalizeXPathNodeSet(Set<Node> xpathNodeSet) throws CanonicalizationException
engineCanonicalizeXPathNodeSet
in class CanonicalizerSpi
xpathNodeSet
- CanonicalizationException
public byte[] engineCanonicalize(XMLSignatureInput input) throws CanonicalizationException
input
- the root of the subtree to canicalizeCanonicalizationException
public void setWriter(OutputStream writer)
CanonicalizerSpi
setWriter
in class CanonicalizerSpi
writer
- The writer to set.protected byte[] engineCanonicalizeSubTree(Node rootNode, Node excludeNode) throws CanonicalizationException
rootNode
- the root of the subtree to canonicalizeexcludeNode
- a node to be excluded from the canonicalize operationCanonicalizationException
protected final void canonicalizeSubTree(Node currentNode, NameSpaceSymbTable ns, Node endnode, int documentLevel) throws CanonicalizationException, IOException
currentNode
- ns
- endnode
- CanonicalizationException
IOException
protected final void canonicalizeXPathNodeSet(Node currentNode, Node endnode) throws CanonicalizationException, IOException
currentNode
- endnode
- CanonicalizationException
IOException
protected int isVisibleDO(Node currentNode, int level)
protected int isVisibleInt(Node currentNode)
protected boolean isVisible(Node currentNode)
protected void handleParent(Element e, NameSpaceSymbTable ns)
protected final void getParentNameSpaces(Element el, NameSpaceSymbTable ns)
el
- ns
- protected static final void outputAttrToWriter(String name, String value, OutputStream writer, Map<String,byte[]> cache) throws IOException
&
<
"
#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 
)name
- value
- writer
- IOException
protected void outputPItoWriter(ProcessingInstruction currentPI, OutputStream writer, int position) throws IOException
currentPI
- writer
- where to write the thingsIOException
protected void outputCommentToWriter(Comment currentComment, OutputStream writer, int position) throws IOException
currentComment
- writer
- writer where to write the thingsIOException
protected static final void outputTextToWriter(String text, OutputStream writer) throws IOException
text
- writer
- writer where to write the thingsIOException
Copyright © 2007-2019. All Rights Reserved.