Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.xml.security.encryption
Class AbstractSerializer

    java.lang.Object
      org.apache.xml.security.encryption.AbstractSerializer

All Implemented Interfaces:
  Serializer

Direct Known Subclasses:
  DocumentSerializer, TransformSerializer

    public abstract class AbstractSerializer

extends java.lang.Object
implements Serializer

Converts `String`s into `Node`s and visa versa. An abstract class for common Serializer functionality

Field Summary
`protected Canonicalizer` | `canon`
`protected boolean` | `secureValidation`

Constructor Summary
`AbstractSerializer()`

Method Summary
`java.lang.String` | `canonSerialize(org.w3c.dom.Node node)` Deprecated.
`byte[]` | `canonSerializeToByteArray(org.w3c.dom.Node node)` Use the Canonicalizer to serialize the node
`protected static byte[]` | `createContext(byte[] source, org.w3c.dom.Node ctx)`
`protected static java.lang.String` | `createContext(java.lang.String source, org.w3c.dom.Node ctx)`
`abstract org.w3c.dom.Node` | `deserialize(byte[] source, org.w3c.dom.Node ctx)`
`abstract org.w3c.dom.Node` | `deserialize(java.lang.String source, org.w3c.dom.Node ctx)` Deprecated.
`boolean` | `isSecureValidation()`
`java.lang.String` | `serialize(org.w3c.dom.Element element)` Deprecated.
`java.lang.String` | `serialize(org.w3c.dom.NodeList content)` Deprecated.
`byte[]` | `serializeToByteArray(org.w3c.dom.Element element)` Returns a `byte[]` representation of the specified `Element`.
`byte[]` | `serializeToByteArray(org.w3c.dom.NodeList content)` Returns a `byte[]` representation of the specified `NodeList`.
`void` | `setCanonicalizer(Canonicalizer canon)` Set the Canonicalizer object to use.
`void` | `setSecureValidation(boolean secureValidation)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### canon

    protected Canonicalizer canon

### secureValidation

    protected boolean secureValidation

Constructor Detail

### AbstractSerializer

    public AbstractSerializer()

Method Detail

### setCanonicalizer

    public void setCanonicalizer(Canonicalizer canon)

  Description copied from interface: `Serializer`
  Set the Canonicalizer object to use.

  Specified by:
    `setCanonicalizer` in interface `Serializer`

### serialize

    @Deprecated
    public java.lang.String serialize(org.w3c.dom.Element element)
                               throws java.lang.Exception

  Deprecated.

  Returns a `String` representation of the specified `Element`.

  Refer also to comments about setup of format.

  Specified by:
    `serialize` in interface `Serializer`
  Parameters:
    `element` - the `Element` to serialize.
  Returns:
    the `String` representation of the serilaized `Element`.
  Throws:
    `java.lang.Exception`

### serializeToByteArray

    public byte[] serializeToByteArray(org.w3c.dom.Element element)
                                throws java.lang.Exception

  Returns a `byte[]` representation of the specified `Element`.

  Specified by:
    `serializeToByteArray` in interface `Serializer`
  Parameters:
    `element` - the `Element` to serialize.
  Returns:
    the `byte[]` representation of the serilaized `Element`.
  Throws:
    `java.lang.Exception`

### serialize

    @Deprecated
    public java.lang.String serialize(org.w3c.dom.NodeList content)
                               throws java.lang.Exception

  Deprecated.

  Returns a `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.

  Specified by:
    `serialize` in interface `Serializer`
  Parameters:
    `content` - the `NodeList` to serialize.
  Returns:
    the `String` representation of the serialized `NodeList`.
  Throws:
    `java.lang.Exception`

### serializeToByteArray

    public byte[] serializeToByteArray(org.w3c.dom.NodeList content)
                                throws java.lang.Exception

  Returns a `byte[]` representation of the specified `NodeList`.

  Specified by:
    `serializeToByteArray` in interface `Serializer`
  Parameters:
    `content` - the `NodeList` to serialize.
  Returns:
    the `byte[]` representation of the serialized `NodeList`.
  Throws:
    `java.lang.Exception`

### canonSerialize

    @Deprecated
    public java.lang.String canonSerialize(org.w3c.dom.Node node)
                                    throws java.lang.Exception

  Deprecated.

  Use the Canonicalizer to serialize the node

  Specified by:
    `canonSerialize` in interface `Serializer`
  Parameters:
    `node` -
  Returns:
    the canonicalization of the node
  Throws:
    `java.lang.Exception`

### canonSerializeToByteArray

    public byte[] canonSerializeToByteArray(org.w3c.dom.Node node)
                                     throws java.lang.Exception

  Use the Canonicalizer to serialize the node

  Specified by:
    `canonSerializeToByteArray` in interface `Serializer`
  Parameters:
    `node` -
  Returns:
    the (byte[]) canonicalization of the node
  Throws:
    `java.lang.Exception`

### deserialize

    @Deprecated
    public abstract org.w3c.dom.Node deserialize(java.lang.String source,
                                                            org.w3c.dom.Node ctx)
                                          throws XMLEncryptionException

  Deprecated.

  Specified by:
    `deserialize` in interface `Serializer`
  Parameters:
    `source` -
    `ctx` -
  Returns:
    the Node resulting from the parse of the source
  Throws:
    `XMLEncryptionException`

### deserialize

    public abstract org.w3c.dom.Node deserialize(byte[] source,
                                                 org.w3c.dom.Node ctx)
                                          throws XMLEncryptionException

  Specified by:
    `deserialize` in interface `Serializer`
  Parameters:
    `source` -
    `ctx` -
  Returns:
    the Node resulting from the parse of the source
  Throws:
    `XMLEncryptionException`

### createContext

    protected static byte[] createContext(byte[] source,
                                          org.w3c.dom.Node ctx)
                                   throws XMLEncryptionException

  Throws:
    `XMLEncryptionException`

### createContext

    protected static java.lang.String createContext(java.lang.String source,
                                                    org.w3c.dom.Node ctx)

### isSecureValidation

    public boolean isSecureValidation()

### setSecureValidation

    public void setSecureValidation(boolean secureValidation)

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD