Class Canonicalize
java.lang.Object
com.adobe.xfa.service.canonicalize.Canonicalize
A service class to canonicalize XML DOM nodes into their
standard representations as defined by the
invalid input: '<'a * href="http://www.w3.org/TR/xml-c14n">Canonical XML
and the
Exclusive XML Canonicalization
specifications.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intCanonicalization type: generic canonicalization.static final intCanonicalization type: generic canonicalization with all comments removed.static final intCanonicalization type: exclusive canonicalization.static final intCanonicalization type: exclusive canonicalization with all comments removed.static final intCanonicalization type: generic canonicalization without the use of context namespaces.static final intCanonicalization type: generic canonicalization without the use of context namespaces and with all comments removed. -
Constructor Summary
ConstructorsConstructorDescriptionInstantiates a canonicalization service.Canonicalize(boolean bLegacy_V32_Canonicalization) Instantiates a canonicalization service.Canonicalize(Node node, boolean bInPlace, boolean bLegacy_V32_Canonicalization) Instantiates a canonicalization service.Canonicalize(List<? extends Node> store, boolean bWithDescendants, boolean bLegacy_V32_Canonicalization) Instantiates a canonicalization service. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]canonicalize(int eCanonicalType, List<String> inclusiveNSPrefixList) Performs text normalization of a set of nodes.voidcanonicalize(OutputStream out, int eCanonicalType, List<String> inclusiveNSPrefixList) Performs text normalization of a set of nodes.canonicalize(List<? super Node> retList, int eCanonicalType, List<String> inclusiveNSPrefixList) Performs text normalization of a set of nodes.Gets the save options for canonicalized data.voidSet the data for this canonicalize to work on.
-
Field Details
-
CANONICALWITH
public static final int CANONICALWITHCanonicalization type: generic canonicalization.- See Also:
-
CANONICALWITHOUT
public static final int CANONICALWITHOUTCanonicalization type: generic canonicalization with all comments removed.- See Also:
-
EXCLUSIVEWITH
public static final int EXCLUSIVEWITHCanonicalization type: exclusive canonicalization.- See Also:
-
EXCLUSIVEWITHOUT
public static final int EXCLUSIVEWITHOUTCanonicalization type: exclusive canonicalization with all comments removed.- See Also:
-
SAVEWITH
public static final int SAVEWITHCanonicalization type: generic canonicalization without the use of context namespaces.- See Also:
-
SAVEWITHOUT
public static final int SAVEWITHOUTCanonicalization type: generic canonicalization without the use of context namespaces and with all comments removed.- See Also:
-
-
Constructor Details
-
Canonicalize
public Canonicalize()Instantiates a canonicalization service. -
Canonicalize
public Canonicalize(boolean bLegacy_V32_Canonicalization) Instantiates a canonicalization service.- Parameters:
bLegacy_V32_Canonicalization- legacy protected canonicalization flag
-
Canonicalize
Instantiates a canonicalization service.- Parameters:
node- a node to be canonicalized along with its children.bInPlace- whether to perform canonicalization on the node specifiedbLegacy_V32_Canonicalization- legacy protected canonicalization flag * or on a copy.
-
Canonicalize
public Canonicalize(List<? extends Node> store, boolean bWithDescendants, boolean bLegacy_V32_Canonicalization) Instantiates a canonicalization service.- Parameters:
store- a list of nodes to be canonicalized.bWithDescendants- whentrue, canonicalize the descendants andbLegacy_V32_Canonicalization- legacy protected canonicalization flag * attributes of each node in the list; otherwise, do not.
-
-
Method Details
-
canonicalize
public Document canonicalize(List<? super Node> retList, int eCanonicalType, List<String> inclusiveNSPrefixList) Performs text normalization of a set of nodes. This implies that:- CDATA sections are replaced with their character content.
- XML declaration and document type declaration (DTD) are removed.
- empty elements are converted to start-end tag pairs.
- whitespace outside of the document element and within start and end tags is normalized.
- all whitespace in character content is retained (excluding characters removed during line feed normalization).
- special characters in attribute values and character content are replaced by character references.
- encoding of special characters as character references in attribute values (&, <, ", CR, NL, TAB).
- encoding of special characters as character references in text (&, <, >, CR).
- superfluous namespace declarations are removed from each element.
- default attributes are added to each element.
- lexicographic order is imposed on the namespace declarations and attributes of each element.
- Parameters:
retList- a list given by the caller to be populated with canonicalizednodes, by this method.eCanonicalType- the canonicalization type to use.inclusiveNSPrefixList- a list of namespace prefixes that are handled as though performing non-exclusive canonicalization, when exclusive canonicalization type is specified.- Returns:
- the document.
-
canonicalize
Performs text normalization of a set of nodes. This implies that:- CDATA sections are replaced with their character content.
- XML declaration and document type declaration (DTD) are removed.
- empty elements are converted to start-end tag pairs.
- whitespace outside of the document element and within start and end tags is normalized.
- all whitespace in character content is retained (excluding characters removed during line feed normalization).
- special characters in attribute values and character content are replaced by character references.
- encoding of special characters as character references in attribute values (&, <, ", CR, NL, TAB).
- encoding of special characters as character references in text (&, <, >, CR).
- superfluous namespace declarations are removed from each element.
- default attributes are added to each element.
- lexicographic order is imposed on the namespace declarations and attributes of each element.
- Parameters:
eCanonicalType- the canonicalization type to use: one ofCANONICALWITH,CANONICALWITHOUT,EXCLUSIVEWITHorEXCLUSIVEWITHOUT.inclusiveNSPrefixList- a list of namespace prefixes that are handled as though performing non-exclusive canonicalization, when exclusive canonicalization type is specified.- Returns:
- byte array containing the canonicalized, UTF-8 encoded, data.
-
canonicalize
Performs text normalization of a set of nodes. This implies that:- CDATA sections are replaced with their character content.
- XML declaration and document type declaration (DTD) are removed.
- empty elements are converted to start-end tag pairs.
- whitespace outside of the document element and within start and end tags is normalized.
- all whitespace in character content is retained (excluding characters removed during line feed normalization).
- special characters in attribute values and character content are replaced by character references.
- encoding of special characters as character references in attribute values (&, <, ", CR, NL, TAB).
- encoding of special characters as character references in text (&, <, >, CR).
- superfluous namespace declarations are removed from each element.
- default attributes are added to each element.
- lexicographic order is imposed on the namespace declarations and attributes of each element.
- Parameters:
out- the stream to be populated with the the canonicalized data. The stream will be UTF-8 encoded.eCanonicalType- the canonicalization type to use: one ofCANONICALWITH,CANONICALWITHOUT,EXCLUSIVEWITHorEXCLUSIVEWITHOUT.inclusiveNSPrefixList- a list of namespace prefixes that are handled as though performing non-exclusive canonicalization, when exclusive canonicalization type is specified.
-
getSaveOptions
Gets the save options for canonicalized data.- Returns:
- the save options for canonicalized data.
-
setData
Set the data for this canonicalize to work on.- Parameters:
node- a node to be canonicalized along with its children.
-