public final class FSTConfiguration extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
FSTConfiguration.StreamCoderFactory |
| Modifier and Type | Field and Description |
|---|---|
static Integer[] |
intObjects |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
asByteArray(Object object)
convenience.
|
Object |
asObject(byte[] b)
convenience
|
int |
calcObjectSizeBytesNotAUtility(Object obj)
for optimization purposes, do not use to benchmark processing time or in a regular program as
this methods creates a temporary binaryoutputstream and serializes the object in order to measure the
size.
|
void |
clearCaches()
clear cached softref's and ThreadLocal.
|
static FSTConfiguration |
createCrossPlatformConfiguration() |
static FSTConfiguration |
createDefaultConfiguration() |
FSTDecoder |
createStreamDecoder() |
FSTEncoder |
createStreamEncoder() |
static FSTConfiguration |
createStructConfiguration() |
<T> T |
deepCopy(T metadata) |
Object |
getCachedObject(Class cl) |
String |
getClassForCPName(String name) |
FSTClazzInfo |
getClassInfo(Class type) |
ClassLoader |
getClassLoader()
mark the given class as being replaced by a copy of an equal instance.
|
FSTClazzNameRegistry |
getClassRegistry() |
FSTClazzInfo |
getClazzInfo(Class rowClass) |
FSTClazzInfoRegistry |
getCLInfoRegistry() |
String |
getCPNameForClass(Class cl)
get cross platform symbolic class identifier
|
Integer |
getCrossPlatformAttributeId(String id) |
String |
getCrossPlatformAttributeName(Integer id) |
byte[] |
getCrossPlatformBinaryCache(String symbolicName) |
static FSTConfiguration |
getDefaultConfiguration() |
static Integer |
getInt(int i) |
FSTObjectInput |
getObjectInput(byte[] arr) |
FSTObjectInput |
getObjectInput(byte[] arr,
int len)
take the given array as input. the array is NOT copied
|
FSTObjectInput |
getObjectInput(InputStream in)
utility for thread safety and reuse.
|
FSTObjectOutput |
getObjectOutput() |
FSTObjectOutput |
getObjectOutput(byte[] outByte) |
FSTObjectOutput |
getObjectOutput(OutputStream out)
utility for thread safety and reuse.
|
FSTConfiguration.StreamCoderFactory |
getStreamCoderFactory() |
boolean |
isCrossPlatform() |
boolean |
isForceSerializable() |
boolean |
isPreferSpeed() |
boolean |
isShareReferences() |
boolean |
isStructMode() |
void |
registerClass(Class... c)
attention: id should be > CUSTOM_ID_BASE
|
void |
registerCrossPlatformAttributeNames(String... names)
Note: UNUSED, not yet implemented
init right after creation of configuration, not during operation as it is not threadsafe regarding mutation
|
void |
registerCrossPlatformClassBinaryCache(String fulLQName,
byte[] binary) |
void |
registerCrossPlatformClassMapping(String[][] keysAndVals)
init right after creation of configuration, not during operation as it is not threadsafe regarding mutation
|
void |
registerCrossPlatformClassMappingUseSimpleName(Class[] classes)
init right after creation of configuration, not during operation as it is not threadsafe regarding mutation
|
void |
registerCrossPlatformClassMappingUseSimpleName(List<Class> classes) |
void |
registerSerializer(Class clazz,
FSTObjectSerializer ser,
boolean alsoForAllSubclasses) |
void |
returnObject(Object cached)
reuse heavy weight objects.
|
void |
setClassLoader(ClassLoader classLoader) |
void |
setCrossPlatform(boolean crossPlatform) |
FSTConfiguration |
setForceSerializable(boolean forceSerializable)
treat unserializable classes same as if they would be serializable.
|
void |
setPreferSpeed(boolean preferSpeed)
this options lets FST favour speed of encoding over size of the encoded object.
|
void |
setSerializerRegistryDelegate(FSTSerializerRegistryDelegate del)
patch default serializer lookup. set to null to delete.
|
void |
setShareReferences(boolean shareReferences)
if false, identical objects will get serialized twice.
|
void |
setStreamCoderFactory(FSTConfiguration.StreamCoderFactory streamCoderFactory)
allows to use subclassed stream codecs.
|
void |
setStructMode(boolean ignoreSerialInterfaces)
ignores all serialization related interfaces (Serializable, Externalizable) and serializes all classes using the
default scheme.
|
public static Integer[] intObjects
public static Integer getInt(int i)
public static FSTConfiguration getDefaultConfiguration()
public void setClassLoader(ClassLoader classLoader)
public static FSTConfiguration createCrossPlatformConfiguration()
public static FSTConfiguration createDefaultConfiguration()
public void registerSerializer(Class clazz, FSTObjectSerializer ser, boolean alsoForAllSubclasses)
public static FSTConfiguration createStructConfiguration()
public FSTConfiguration.StreamCoderFactory getStreamCoderFactory()
public void setStreamCoderFactory(FSTConfiguration.StreamCoderFactory streamCoderFactory)
streamCoderFactory - public void returnObject(Object cached)
cached - public boolean isPreferSpeed()
public void setPreferSpeed(boolean preferSpeed)
preferSpeed - public int calcObjectSizeBytesNotAUtility(Object obj) throws IOException
IOExceptionpublic void setSerializerRegistryDelegate(FSTSerializerRegistryDelegate del)
del - public boolean isForceSerializable()
public FSTConfiguration setForceSerializable(boolean forceSerializable)
forceSerializable - public void clearCaches()
public boolean isShareReferences()
public void setShareReferences(boolean shareReferences)
shareReferences - public void registerClass(Class... c)
c - public FSTClazzNameRegistry getClassRegistry()
public FSTClazzInfoRegistry getCLInfoRegistry()
public ClassLoader getClassLoader()
public FSTClazzInfo getClassInfo(Class type)
public FSTObjectInput getObjectInput(InputStream in)
in - public FSTObjectInput getObjectInput(byte[] arr)
public FSTObjectInput getObjectInput(byte[] arr, int len)
arr - len - public FSTObjectOutput getObjectOutput(OutputStream out)
out - - can be null (temp bytearrays stream is created then)public FSTObjectOutput getObjectOutput()
public FSTObjectOutput getObjectOutput(byte[] outByte)
public void setStructMode(boolean ignoreSerialInterfaces)
ignoreSerialInterfaces - public boolean isStructMode()
setStructMode()public FSTClazzInfo getClazzInfo(Class rowClass)
public void setCrossPlatform(boolean crossPlatform)
public boolean isCrossPlatform()
public <T> T deepCopy(T metadata)
public FSTEncoder createStreamEncoder()
public FSTDecoder createStreamDecoder()
public void registerCrossPlatformClassBinaryCache(String fulLQName, byte[] binary)
public byte[] getCrossPlatformBinaryCache(String symbolicName)
public void registerCrossPlatformClassMapping(String[][] keysAndVals)
keysAndVals - { { "symbolicName", "fullQualifiedClazzName" }, .. }public void registerCrossPlatformClassMappingUseSimpleName(Class[] classes)
public void registerCrossPlatformClassMappingUseSimpleName(List<Class> classes)
public void registerCrossPlatformAttributeNames(String... names)
names - { "varName", .. } for each of these an id will be written instead of full name.public String getCPNameForClass(Class cl)
cl - public Object asObject(byte[] b)
public byte[] asByteArray(Object object)
Copyright © 2014. All rights reserved.