org.universAAL.ri.gateway.communicator.service.impl
Enum Serializer

Package class diagram package Serializer
java.lang.Object
  extended by java.lang.Enum<Serializer>
      extended by org.universAAL.ri.gateway.communicator.service.impl.Serializer
All Implemented Interfaces:
Serializable, Comparable<Serializer>

public enum Serializer
extends Enum<Serializer>


Enum Constant Summary
Instance
           
 
Method Summary
 Message marshall(Object obj)
           
 Message marshallObject(Object objectToMarshall)
           
static void sendMessageToStream(MessageWrapper wrp, OutputStream out)
          Deserializes the wrapper and sends to a ready stream.
<T> T
unmarshall(Class<T> clazz, Message message)
           
<T> T
unmarshallObject(Class<T> clazz, Message message)
           
<T> T
unmarshallObject(Class<T> clazz, Object obj, ClassLoader cl)
           
static MessageWrapper unmarshalMessage(InputStream is)
          Reads a message wrapper from a stream.
static Serializer valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Serializer[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

Instance

public static final Serializer Instance
Method Detail

values

public static Serializer[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (Serializer c : Serializer.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Serializer valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

marshallObject

public Message marshallObject(Object objectToMarshall)
                       throws IOException
Throws:
IOException

unmarshallObject

public <T> T unmarshallObject(Class<T> clazz,
                              Message message)
                   throws IOException,
                          ClassNotFoundException
Throws:
IOException
ClassNotFoundException

unmarshallObject

public <T> T unmarshallObject(Class<T> clazz,
                              Object obj,
                              ClassLoader cl)
                   throws IOException,
                          ClassNotFoundException
Throws:
IOException
ClassNotFoundException

marshall

public Message marshall(Object obj)

unmarshall

public <T> T unmarshall(Class<T> clazz,
                        Message message)

sendMessageToStream

public static void sendMessageToStream(MessageWrapper wrp,
                                       OutputStream out)
                                throws IOException,
                                       org.bouncycastle.crypto.CryptoException
Deserializes the wrapper and sends to a ready stream.

Parameters:
wrp - the wrapper
out - the stream
Throws:
IOException - io exception
org.bouncycastle.crypto.CryptoException

unmarshalMessage

public static MessageWrapper unmarshalMessage(InputStream is)
                                       throws IOException,
                                              ClassNotFoundException,
                                              org.bouncycastle.crypto.CryptoException
Reads a message wrapper from a stream.

Parameters:
is - input stream to read from a
Returns:
a message wrapper
Throws:
IOException - io exception
ClassNotFoundException - deserulization exception
org.bouncycastle.crypto.CryptoException


Copyright © 2014 universAAL Consortium. All Rights Reserved.