Package 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
Modifier and TypeMethodDescriptiongetRegistration
(int classID) Returns the registration for the specified ID, or null if no class is registered with that ID.getRegistration
(Class type) Returns the registration for the specified class, or null if the class is not registered.Reads a class and returns its registration.register
(Registration registration) Stores the specified registration.registerImplicit
(Class type) Called when an unregistered type is encountered andKryo.setRegistrationRequired(boolean)
is false.void
reset()
Called byKryo.reset()
.void
Sets the Kryo instance that this ClassResolver will be used for.writeClass
(Output output, Class type) Writes a class and returns its registration.
-
Method Details
-
setKryo
Sets the Kryo instance that this ClassResolver will be used for. This is called automatically by Kryo. -
register
Stores the specified registration.- See Also:
-
registerImplicit
Called when an unregistered type is encountered andKryo.setRegistrationRequired(boolean)
is false. -
getRegistration
Returns the registration for the specified class, or null if the class is not registered. -
getRegistration
Returns the registration for the specified ID, or null if no class is registered with that ID. -
writeClass
Writes a class and returns its registration.- Parameters:
type
- May be null.- Returns:
- Will be null if type is null.
-
readClass
Reads a class and returns its registration.- Returns:
- May be null.
-
reset
void reset()Called byKryo.reset()
.
-