com.esotericsoftware.kryo
Interface ClassResolver

All Known Implementing Classes:
DefaultClassResolver

public interface ClassResolver

Handles class registration, writing class identifiers to bytes, and reading class identifiers from bytes.


Method Summary
 Registration getRegistration(java.lang.Class type)
          Returns the registration for the specified class, or null if the class is not registered.
 Registration getRegistration(int classID)
          Returns the registration for the specified ID, or null if no class is registered with that ID.
 Registration readClass(Input input)
          Reads a class and returns its registration.
 Registration register(Registration registration)
          Stores the specified registration.
 Registration registerImplicit(java.lang.Class type)
          Called when an unregistered type is encountered and Kryo.setRegistrationRequired(boolean) is false.
 void reset()
          Called by Kryo.reset().
 void setKryo(Kryo kryo)
          Sets the Kryo instance that this ClassResolver will be used for.
 Registration writeClass(Output output, java.lang.Class type)
          Writes a class and returns its registration.
 

Method Detail

setKryo

void setKryo(Kryo kryo)
Sets the Kryo instance that this ClassResolver will be used for. This is called automatically by Kryo.


register

Registration register(Registration registration)
Stores the specified registration.

See Also:
Kryo.register(Registration)

registerImplicit

Registration registerImplicit(java.lang.Class type)
Called when an unregistered type is encountered and Kryo.setRegistrationRequired(boolean) is false.


getRegistration

Registration getRegistration(java.lang.Class type)
Returns the registration for the specified class, or null if the class is not registered.


getRegistration

Registration getRegistration(int classID)
Returns the registration for the specified ID, or null if no class is registered with that ID.


writeClass

Registration writeClass(Output output,
                        java.lang.Class type)
Writes a class and returns its registration.

Parameters:
type - May be null.
Returns:
Will be null if type is null.

readClass

Registration readClass(Input input)
Reads a class and returns its registration.

Returns:
May be null.

reset

void reset()
Called by Kryo.reset().