public abstract class AbstractSerializer extends Object implements Serializer
Strings into Nodes and visa versa.
An abstract class for common Serializer functionality| Modifier and Type | Field and Description |
|---|---|
protected Canonicalizer |
canon |
protected boolean |
secureValidation |
| Constructor and Description |
|---|
AbstractSerializer() |
| Modifier and Type | Method and Description |
|---|---|
String |
canonSerialize(Node node)
Deprecated.
|
byte[] |
canonSerializeToByteArray(Node node)
Use the Canonicalizer to serialize the node
|
protected static byte[] |
createContext(byte[] source,
Node ctx) |
protected static String |
createContext(String source,
Node ctx) |
abstract Node |
deserialize(byte[] source,
Node ctx) |
abstract Node |
deserialize(String source,
Node ctx)
Deprecated.
|
boolean |
isSecureValidation() |
String |
serialize(Element element)
Deprecated.
|
String |
serialize(NodeList content)
Deprecated.
|
byte[] |
serializeToByteArray(Element element)
Returns a
byte[] representation of the specified
Element. |
byte[] |
serializeToByteArray(NodeList content)
Returns a
byte[] representation of the specified
NodeList. |
void |
setCanonicalizer(Canonicalizer canon)
Set the Canonicalizer object to use.
|
void |
setSecureValidation(boolean secureValidation) |
protected Canonicalizer canon
protected boolean secureValidation
public void setCanonicalizer(Canonicalizer canon)
SerializersetCanonicalizer in interface Serializer@Deprecated public String serialize(Element element) throws Exception
String representation of the specified
Element.
Refer also to comments about setup of format.serialize in interface Serializerelement - the Element to serialize.String representation of the serilaized
Element.Exceptionpublic byte[] serializeToByteArray(Element element) throws Exception
byte[] representation of the specified
Element.serializeToByteArray in interface Serializerelement - the Element to serialize.byte[] representation of the serilaized
Element.Exception@Deprecated public String serialize(NodeList content) throws Exception
String representation of the specified
NodeList.
This is a special case because the NodeList may represent a
DocumentFragment. A document fragment may be a
non-valid XML document (refer to appropriate description of
W3C) because it my start with a non-element node, e.g. a text
node.
The methods first converts the node list into a document fragment.
Special care is taken to not destroy the current document, thus
the method clones the nodes (deep cloning) before it appends
them to the document fragment.
Refer also to comments about setup of format.serialize in interface Serializercontent - the NodeList to serialize.String representation of the serialized
NodeList.Exceptionpublic byte[] serializeToByteArray(NodeList content) throws Exception
byte[] representation of the specified
NodeList.serializeToByteArray in interface Serializercontent - the NodeList to serialize.byte[] representation of the serialized
NodeList.Exception@Deprecated public String canonSerialize(Node node) throws Exception
canonSerialize in interface Serializernode - Exceptionpublic byte[] canonSerializeToByteArray(Node node) throws Exception
canonSerializeToByteArray in interface Serializernode - Exception@Deprecated public abstract Node deserialize(String source, Node ctx) throws XMLEncryptionException
deserialize in interface Serializersource - ctx - XMLEncryptionExceptionpublic abstract Node deserialize(byte[] source, Node ctx) throws XMLEncryptionException
deserialize in interface Serializersource - ctx - XMLEncryptionExceptionprotected static byte[] createContext(byte[] source,
Node ctx)
throws XMLEncryptionException
XMLEncryptionExceptionpublic boolean isSecureValidation()
public void setSecureValidation(boolean secureValidation)
Copyright © 2000–2023 The Apache Software Foundation. All rights reserved.