com.threerings.nexus.io
Interface Serializer

All Known Implementing Classes:
AbstractSerializer

public interface Serializer

An automatically generated class that knows about all Streamable and NexusService classes that will be used by a client. This is used on platforms that lack reflection capabilities.


Method Summary
 Class<?> getClass(short code)
          Returns the class assigned the supplied code.
 short getCode(Class<?> clazz)
          Returns the code assigned to the supplied class.
 short getServiceCode(Class<? extends NexusService> clazz)
          Returns the code assigned to the supplied service class.
 DService.Factory<?> getServiceFactory(short code)
          Returns the service factory for the class assigned the supplied code.
 Streamer<?> getStreamer(short code)
          Returns the streamer for the class assigned the supplied code.
<T> Streamer<T>
writeStreamer(Streamable.Output out, T value)
          Writes the class code for the supplied value, and returns the streamer for same.
 

Method Detail

getClass

Class<?> getClass(short code)
Returns the class assigned the supplied code.

Throws:
NexusException - if no class is registered for the supplied code.

getStreamer

Streamer<?> getStreamer(short code)
Returns the streamer for the class assigned the supplied code.

Throws:
NexusException - if no streamer is registered for the supplied code.

getServiceFactory

DService.Factory<?> getServiceFactory(short code)
Returns the service factory for the class assigned the supplied code.

Throws:
NexusException - if no service is registered for the supplied code.

getCode

short getCode(Class<?> clazz)
Returns the code assigned to the supplied class.

Throws:
NexusException - if the class in question is not registered.

getServiceCode

short getServiceCode(Class<? extends NexusService> clazz)
Returns the code assigned to the supplied service class.

Throws:
NexusException - if the class in question is not registered.

writeStreamer

<T> Streamer<T> writeStreamer(Streamable.Output out,
                              T value)
Writes the class code for the supplied value, and returns the streamer for same.

Throws:
NexusException - if the class for the value in question is not registered.


Copyright © 2013. All Rights Reserved.