public class

JaxbSerializer

extends AbstractSerializer<T>
java.lang.Object
   ↳ com.netflix.astyanax.serializers.AbstractSerializer<T>
     ↳ com.netflix.astyanax.serializers.JaxbSerializer

Class Overview

Serializes Objects using Jaxb. An instance of this class may only serialize JAXB compatible objects of classes known to its configured context.

Summary

Public Constructors
JaxbSerializer(Class... serializableClasses)
Constructor.
Public Methods
Object fromByteBuffer(ByteBuffer bytes)
Extract an object of type T from the bytes.
ByteBuffer toByteBuffer(Object obj)
Extract bytes from the obj of type T
Protected Methods
XMLStreamReader createStreamReader(InputStream input)
Get a new XML stream reader.
XMLStreamWriter createStreamWriter(OutputStream output)
Get a new XML stream writer.
[Expand]
Inherited Methods
From class com.netflix.astyanax.serializers.AbstractSerializer
From class java.lang.Object
From interface com.netflix.astyanax.Serializer

Public Constructors

public JaxbSerializer (Class... serializableClasses)

Constructor.

Parameters
serializableClasses List of classes which can be serialized by this instance. Note that concrete classes directly referenced by any class in the list will also be serializable through this instance.

Public Methods

public Object fromByteBuffer (ByteBuffer bytes)

Extract an object of type T from the bytes.

public ByteBuffer toByteBuffer (Object obj)

Extract bytes from the obj of type T

Protected Methods

protected XMLStreamReader createStreamReader (InputStream input)

Get a new XML stream reader.

Parameters
input the underlying InputStream to read from.
Returns
Throws
XMLStreamException

protected XMLStreamWriter createStreamWriter (OutputStream output)

Get a new XML stream writer.

Parameters
output An underlying OutputStream to write to.
Returns
  • a new XMLStreamWriter which writes to the specified OutputStream. The output written by this XMLStreamWriter is understandable by XMLStreamReaders produced by createStreamReader(InputStream).
Throws
XMLStreamException