Class Overview
A standard provider for native Java types. Currently, this provider supports:
- Pseudo-support for Object since all objects inherit it
- Primitive types: boolean, byte, char, short, int, long, float, double
- Objects wrapping the primitive types: Boolean, Byte, Character,
Short, Integer, Long, Float, Double
- Char-sequence types: String
- Big-num types: BigInteger and BigDecimal
- List types: ArrayList, LinkedList, ArrayDeque
- Set types: HashSet, TreeSet, LinkedHashSet
- Map types: HashMap, TreeMap, LinkedHashMap,
IdentityHashMap
Currently, serializing any other non-native type (or non @
Ser
type) will result in
undefined behavior.
Caveats regarding collections and maps: when serializing those objects, optional parameters such
as the initial capacity, the load factor, or even a custom comparator (for tree-sets/maps) are
not persisted. Therefore, they cannot be automatically restored. It is up to the implementation
to wrap such objects in higher-level classes using a custom constructor
that can call the original object (collection or map) constructor's with proper parameters. This
is especially critical for TreeMap or TreeSet using custom comparators.
Summary
Protected Methods |
void
|
loadTypes(Map<Class<?>, Integer> map, Map<Integer, Integer> movedmap)
|
[Expand]
Inherited Methods |
From class
com.pnfsoftware.jeb.util.serialization.AbstractTypeIdProvider
void
|
addAll(ITypeIdProvider provider)
Add of types from a provider to this provider.
|
int
|
getId(Class<?> c)
Get the ype-id of a given type.
|
Map<Class<?>, Integer>
|
getMap()
Get the map of type to type-id.
|
Map<Integer, Class<?>>
|
getReverseMap()
Get the reverse type-id map, mapping a type-id to a type.
|
Class<?>
|
getType(int typeId)
Get a type by type-id.
|
abstract
void
|
loadTypes(Map<Class<?>, Integer> map, Map<Integer, Integer> movedmap)
|
|
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
From interface
com.pnfsoftware.jeb.util.serialization.ITypeIdProvider
abstract
void
|
addAll(ITypeIdProvider provider)
Add of types from a provider to this provider.
|
abstract
int
|
getId(Class<?> c)
Get the ype-id of a given type.
|
abstract
Map<Class<?>, Integer>
|
getMap()
Get the map of type to type-id.
|
abstract
Map<Integer, Class<?>>
|
getReverseMap()
Get the reverse type-id map, mapping a type-id to a type.
|
abstract
Class<?>
|
getType(int id)
Get a type by type-id.
|
|
Public Methods
Protected Methods
protected
void
loadTypes
(Map<Class<?>, Integer> map, Map<Integer, Integer> movedmap)