APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.org.apache.xml.internal.security.c14n.implementations

public abstract Class Canonicalizer20010315

extends CanonicalizerBase
Class Inheritance
Known Direct Subclasses
com.sun.org.apache.xml.internal.security.c14n.implementations.Canonicalizer20010315OmitComments, com.sun.org.apache.xml.internal.security.c14n.implementations.Canonicalizer20010315WithComments, com.sun.org.apache.xml.internal.security.c14n.implementations.Canonicalizer11_OmitComments, com.sun.org.apache.xml.internal.security.c14n.implementations.Canonicalizer11_WithComments
Imports
java.io.IOException, .OutputStream, java.util.Map, .Set, .SortedSet, .TreeSet, com.sun.org.apache.xml.internal.security.c14n.CanonicalizationException, com.sun.org.apache.xml.internal.security.c14n.helper.C14nHelper, com.sun.org.apache.xml.internal.security.parser.XMLParserException, com.sun.org.apache.xml.internal.security.signature.XMLSignatureInput, com.sun.org.apache.xml.internal.security.utils.XMLUtils, org.w3c.dom.Attr, .DOMException, .Document, .Element, .NamedNodeMap, .Node

Implements Canonical XML Version 1.0, a W3C Recommendation from 15 March 2001.

Field Summary

Modifier and TypeField and Description
private final boolean
private boolean
private final XmlAttrStack
Inherited from com.sun.org.apache.xml.internal.security.c14n.implementations.CanonicalizerBase:
COMPARENODE_AFTER_DOCUMENT_ELEMENTNODE_BEFORE_DOCUMENT_ELEMENTNODE_NOT_BEFORE_OR_AFTER_DOCUMENT_ELEMENTXMLXML_LANG_URIXMLNSXMLNS_URI

Constructor Summary

AccessConstructor and Description
public
Canonicalizer20010315(boolean includeComments)

Constructor Canonicalizer20010315

public
Canonicalizer20010315(boolean includeComments, boolean
Whether this is a Canonical XML 1.1 implementation or not
c14n11
)

Constructor Canonicalizer20010315

Method Summary

Modifier and TypeMethod and Description
protected void
public void
engineCanonicalizeSubTree(Node rootNode, String inclusiveNamespaces, OutputStream
OutputStream to write the canonicalization result
writer
)

Implements abstract com.sun.org.apache.xml.internal.security.c14n.CanonicalizerSpi.engineCanonicalizeSubTree.

Always throws a CanonicalizationException because this is inclusive c14n.

public void
engineCanonicalizeSubTree(Node rootNode, String inclusiveNamespaces, boolean propagateDefaultNamespace, OutputStream
OutputStream to write the canonicalization result
writer
)

Implements abstract com.sun.org.apache.xml.internal.security.c14n.CanonicalizerSpi.engineCanonicalizeSubTree.

Always throws a CanonicalizationException because this is inclusive c14n.

public void
engineCanonicalizeXPathNodeSet(Set<Node> xpathNodeSet, String inclusiveNamespaces, OutputStream
OutputStream to write the canonicalization result
writer
)

Implements abstract com.sun.org.apache.xml.internal.security.c14n.CanonicalizerSpi.engineCanonicalizeXPathNodeSet.

Always throws a CanonicalizationException because this is inclusive c14n.

protected void
protected void
outputAttributes(Element element, NameSpaceSymbTable ns, Map<String, byte[]> cache, OutputStream
OutputStream to write the canonicalization result
writer
)

Implements abstract com.sun.org.apache.xml.internal.security.c14n.implementations.CanonicalizerBase.outputAttributes.

Output the Attr[]s for the given element.

protected void
outputAttributesSubtree(Element element, NameSpaceSymbTable ns, Map<String, byte[]> cache, OutputStream
OutputStream to write the canonicalization result
writer
)

Implements abstract com.sun.org.apache.xml.internal.security.c14n.implementations.CanonicalizerBase.outputAttributesSubtree.

Output the Attr[]s for the given element.

Inherited from com.sun.org.apache.xml.internal.security.c14n.implementations.CanonicalizerBase:
engineCanonicalizeengineCanonicalizeSubTreeengineCanonicalizeSubTreeengineCanonicalizeXPathNodeSetgetNullNodeisVisibleisVisibleDOisVisibleIntoutputAttrToWriteroutputCommentToWriteroutputPItoWriter

Field Detail

c14n11back to summary
private final boolean c14n11
firstCallback to summary
private boolean firstCall
xmlattrStackback to summary
private final XmlAttrStack xmlattrStack

Constructor Detail

Canonicalizer20010315back to summary
public Canonicalizer20010315(boolean includeComments)

Constructor Canonicalizer20010315

Canonicalizer20010315back to summary
public Canonicalizer20010315(boolean includeComments, boolean c14n11)

Constructor Canonicalizer20010315

Parameters
c14n11:boolean

Whether this is a Canonical XML 1.1 implementation or not

Method Detail

circumventBugIfNeededback to summary
protected void circumventBugIfNeeded(XMLSignatureInput input) throws XMLParserException, IOException

Implements abstract com.sun.org.apache.xml.internal.security.c14n.implementations.CanonicalizerBase.circumventBugIfNeeded.

Annotations
@Override
engineCanonicalizeSubTreeback to summary
public void engineCanonicalizeSubTree(Node rootNode, String inclusiveNamespaces, OutputStream writer) throws CanonicalizationException

Implements abstract com.sun.org.apache.xml.internal.security.c14n.CanonicalizerSpi.engineCanonicalizeSubTree.

Always throws a CanonicalizationException because this is inclusive c14n.

Parameters
writer:OutputStream

OutputStream to write the canonicalization result

Annotations
@Override
engineCanonicalizeSubTreeback to summary
public void engineCanonicalizeSubTree(Node rootNode, String inclusiveNamespaces, boolean propagateDefaultNamespace, OutputStream writer) throws CanonicalizationException

Implements abstract com.sun.org.apache.xml.internal.security.c14n.CanonicalizerSpi.engineCanonicalizeSubTree.

Always throws a CanonicalizationException because this is inclusive c14n.

Parameters
writer:OutputStream

OutputStream to write the canonicalization result

Annotations
@Override
engineCanonicalizeXPathNodeSetback to summary
public void engineCanonicalizeXPathNodeSet(Set<Node> xpathNodeSet, String inclusiveNamespaces, OutputStream writer) throws CanonicalizationException

Implements abstract com.sun.org.apache.xml.internal.security.c14n.CanonicalizerSpi.engineCanonicalizeXPathNodeSet.

Always throws a CanonicalizationException because this is inclusive c14n.

Parameters
writer:OutputStream

OutputStream to write the canonicalization result

Annotations
@Override
Exceptions
CanonicalizationException:
always
handleParentback to summary
protected void handleParent(Element e, NameSpaceSymbTable ns)

Overrides com.sun.org.apache.xml.internal.security.c14n.implementations.CanonicalizerBase.handleParent.

Annotations
@Override
outputAttributesback to summary
protected void outputAttributes(Element element, NameSpaceSymbTable ns, Map<String, byte[]> cache, OutputStream writer) throws CanonicalizationException, DOMException, IOException

Implements abstract com.sun.org.apache.xml.internal.security.c14n.implementations.CanonicalizerBase.outputAttributes.

Output the Attr[]s for the given element.

Important Note

This method expects to work on a modified DOM tree, i.e. a DOM which has been prepared using com.sun.org.apache.xml.internal.security.utils.XMLUtils#circumventBug2650( org.w3c.dom.Document).

Parameters
writer:OutputStream

OutputStream to write the canonicalization result

Annotations
@Override
outputAttributesSubtreeback to summary
protected void outputAttributesSubtree(Element element, NameSpaceSymbTable ns, Map<String, byte[]> cache, OutputStream writer) throws CanonicalizationException, DOMException, IOException

Implements abstract com.sun.org.apache.xml.internal.security.c14n.implementations.CanonicalizerBase.outputAttributesSubtree.

Output the Attr[]s for the given element.
The code of this method is a copy of outputAttributes(Element, NameSpaceSymbTable, Map, OutputStream), whereas it takes into account that subtree-c14n is -- well -- subtree-based. So if the element in question isRoot of c14n, it's parent is not in the node set, as well as all other ancestors.

Parameters
writer:OutputStream

OutputStream to write the canonicalization result

Annotations
@Override