|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.xml.security.encryption.AbstractSerializer
public abstract class AbstractSerializer
Converts String
s into Node
s and visa versa.
An abstract class for common Serializer functionality
Field Summary | |
---|---|
protected Canonicalizer |
canon
|
Constructor Summary | |
---|---|
AbstractSerializer()
|
Method Summary | |
---|---|
String |
canonSerialize(Node node)
Use the Canonicalizer to serialize the node |
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)
|
String |
serialize(Element element)
Returns a String representation of the specified
Element . |
String |
serialize(NodeList content)
Returns a String representation of the specified
NodeList . |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Canonicalizer canon
Constructor Detail |
---|
public AbstractSerializer()
Method Detail |
---|
public void setCanonicalizer(Canonicalizer canon)
Serializer
setCanonicalizer
in interface Serializer
public String serialize(Element element) throws Exception
String
representation of the specified
Element
.
Refer also to comments about setup of format.
element
- the Element
to serialize.
String
representation of the serilaized
Element
.
Exception
public byte[] serializeToByteArray(Element element) throws Exception
byte[]
representation of the specified
Element
.
serializeToByteArray
in interface Serializer
element
- the Element
to serialize.
byte[]
representation of the serilaized
Element
.
Exception
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.
content
- the NodeList
to serialize.
String
representation of the serialized
NodeList
.
Exception
public byte[] serializeToByteArray(NodeList content) throws Exception
byte[]
representation of the specified
NodeList
.
serializeToByteArray
in interface Serializer
content
- the NodeList
to serialize.
byte[]
representation of the serialized
NodeList
.
Exception
public String canonSerialize(Node node) throws Exception
node
-
Exception
public byte[] canonSerializeToByteArray(Node node) throws Exception
canonSerializeToByteArray
in interface Serializer
node
-
Exception
public abstract Node deserialize(String source, Node ctx) throws XMLEncryptionException
source
- ctx
-
XMLEncryptionException
public abstract Node deserialize(byte[] source, Node ctx) throws XMLEncryptionException
deserialize
in interface Serializer
source
- ctx
-
XMLEncryptionException
protected static byte[] createContext(byte[] source, Node ctx) throws XMLEncryptionException
XMLEncryptionException
protected static String createContext(String source, Node ctx)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |