Package org.nustaq.serialization
Class FSTClazzNameRegistry
java.lang.Object
org.nustaq.serialization.FSTClazzNameRegistry
public class FSTClazzNameRegistry
extends java.lang.Object
Created with IntelliJ IDEA.
User: ruedi
Date: 10.11.12
Time: 00:34
maps classnames => id and vice versa.
FSTConfiguration holds a parent containing default mappings (e.g. created by
registerClass ). A stream instance then creates a temporary instance to record/id encode
classes dynamically during serialization. This way a class name is only written once per
object graph.
This class is thread safe,
-
Field Summary
Fields Modifier and Type Field Description static intFIRST_USER_CLZ_IDstatic intLOWEST_CLZ_ID -
Constructor Summary
Constructors Constructor Description FSTClazzNameRegistry(FSTClazzNameRegistry par) -
Method Summary
Modifier and Type Method Description protected voidaddClassMapping(java.lang.Class c, int id, FSTClazzInfo clInfo, FSTConfiguration conf)java.lang.ClassclassForName(java.lang.String clName, FSTConfiguration conf)voidclear()FSTClazzInfodecodeClass(FSTDecoder in, FSTConfiguration conf)voidencodeClass(FSTEncoder out, java.lang.Class c)voidencodeClass(FSTEncoder out, FSTClazzInfo ci)FSTClazzInfogetClazzFromId(int c)intgetIdFromClazz(java.lang.Class c)voidregisterClass(java.lang.Class c, int code, FSTConfiguration conf)voidregisterClass(java.lang.Class c, FSTConfiguration conf)voidregisterClazzFromOtherLoader(java.lang.Class cl)
-
Field Details
-
LOWEST_CLZ_ID
public static final int LOWEST_CLZ_ID- See Also:
- Constant Field Values
-
FIRST_USER_CLZ_ID
public static final int FIRST_USER_CLZ_ID- See Also:
- Constant Field Values
-
-
Constructor Details
-
Method Details
-
clear
public void clear() -
registerClass
-
registerClass
-
addClassMapping
protected void addClassMapping(java.lang.Class c, int id, FSTClazzInfo clInfo, FSTConfiguration conf) -
getIdFromClazz
public int getIdFromClazz(java.lang.Class c) -
encodeClass
- Throws:
java.io.IOException
-
encodeClass
- Throws:
java.io.IOException
-
decodeClass
public FSTClazzInfo decodeClass(FSTDecoder in, FSTConfiguration conf) throws java.io.IOException, java.lang.ClassNotFoundException- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
classForName
public java.lang.Class classForName(java.lang.String clName, FSTConfiguration conf) throws java.lang.ClassNotFoundException- Throws:
java.lang.ClassNotFoundException
-
registerClazzFromOtherLoader
public void registerClazzFromOtherLoader(java.lang.Class cl) -
getClazzFromId
-