| Package | Description |
|---|---|
| net.lecousin.framework.io.serialization |
Serialization and deserialization framework.
|
| net.lecousin.framework.io.serialization.rules |
Serialization rules to customize serialization and deserialization.
|
| net.lecousin.framework.xml.serialization |
XML serialization and deserialization.
|
| Modifier and Type | Field and Description |
|---|---|
protected TypeDefinition |
SerializationClass.Attribute.originalType |
protected TypeDefinition |
SerializationClass.Attribute.type |
| Modifier and Type | Method and Description |
|---|---|
static TypeDefinition |
TypeDefinition.from(Class<?> instanceType,
TypeDefinition definition)
Create a type, with the given definition of a field or method, and knowing the instance type.
|
TypeDefinition |
SerializationContext.CollectionContext.getCollectionType() |
TypeDefinition |
SerializationContext.CollectionContext.getElementType() |
TypeDefinition |
SerializationContext.ObjectContext.getOriginalType() |
TypeDefinition |
SerializationClass.Attribute.getOriginalType() |
TypeDefinition |
SerializationClass.getType() |
TypeDefinition |
SerializationClass.Attribute.getType() |
static TypeDefinition |
SerializationClass.searchAttributeType(TypeDefinition containerType,
String attributeName)
Search an attribute in the given type.
|
TypeDefinition |
CustomSerializer.sourceType()
Source type.
|
TypeDefinition |
CustomSerializer.targetType()
Target type.
|
| Modifier and Type | Method and Description |
|---|---|
List<TypeDefinition> |
TypeDefinition.getParameters()
Return the generic parameters.
|
| Modifier and Type | Method and Description |
|---|---|
<T> AsyncWork<T,Exception> |
Deserializer.deserialize(TypeDefinition type,
IO.Readable input,
List<SerializationRule> rules)
Deserialize an object/value of the given type from the given input.
|
<T> AsyncWork<T,Exception> |
AbstractDeserializer.deserialize(TypeDefinition type,
IO.Readable input,
List<SerializationRule> rules) |
protected AsyncWork<Object,Exception> |
AbstractDeserializer.deserializeCollectionValue(SerializationContext context,
TypeDefinition type,
String path,
List<SerializationRule> rules) |
protected AsyncWork<Map<?,?>,Exception> |
AbstractDeserializer.deserializeMapValue(SerializationContext context,
TypeDefinition typeDef,
String path,
List<SerializationRule> rules) |
protected void |
AbstractDeserializer.deserializeObjectAttributes(SerializationContext parentContext,
Object instance,
TypeDefinition typeDef,
String path,
List<SerializationRule> rules,
AsyncWork<Object,Exception> result) |
protected <T> AsyncWork<T,Exception> |
AbstractDeserializer.deserializeObjectValue(SerializationContext context,
TypeDefinition type,
String path,
List<SerializationRule> rules) |
<T> AsyncWork<T,Exception> |
AbstractDeserializer.deserializeValue(SerializationContext context,
TypeDefinition type,
String path,
List<SerializationRule> rules)
Deserialize a value.
|
static TypeDefinition |
TypeDefinition.from(Class<?> instanceType,
TypeDefinition definition)
Create a type, with the given definition of a field or method, and knowing the instance type.
|
protected static Map<?,?> |
AbstractDeserializer.getMap(ArrayList<SerializationUtil.MapEntry> entries,
TypeDefinition type,
SerializationContext context,
List<SerializationRule> rules) |
static boolean |
TypeDefinition.getTypeParameters(Type superType,
TypeDefinition finalType,
TypeVariable[] vars,
TypeDefinition[] params)
Fill the generic parameters.
|
static boolean |
TypeDefinition.getTypeParameters(Type superType,
TypeDefinition finalType,
TypeVariable[] vars,
TypeDefinition[] params)
Fill the generic parameters.
|
static Object |
SerializationClass.instantiate(TypeDefinition type,
SerializationContext context,
List<SerializationRule> rules,
boolean forceType)
Instantiate the given type.
|
static TypeDefinition |
SerializationClass.searchAttributeType(TypeDefinition containerType,
String attributeName)
Search an attribute in the given type.
|
ISynchronizationPoint<Exception> |
Serializer.serialize(Object object,
TypeDefinition typeDef,
IO.Writable output,
List<SerializationRule> rules)
Serialize the given object.
|
ISynchronizationPoint<Exception> |
AbstractSerializer.serialize(Object object,
TypeDefinition typeDef,
IO.Writable output,
List<SerializationRule> rules) |
protected ISynchronizationPoint<? extends Exception> |
AbstractSerializer.serializeMapAttribute(SerializationContext.AttributeContext context,
Map<?,?> map,
TypeDefinition typeDef,
String path,
List<SerializationRule> rules) |
protected ISynchronizationPoint<? extends Exception> |
AbstractSerializer.serializeMapValue(SerializationContext context,
Map<?,?> map,
TypeDefinition typeDef,
String path,
List<SerializationRule> rules) |
protected ISynchronizationPoint<? extends Exception> |
AbstractSerializer.serializeObjectValue(SerializationContext context,
Object value,
TypeDefinition typeDef,
String path,
List<SerializationRule> rules) |
ISynchronizationPoint<? extends Exception> |
AbstractSerializer.serializeValue(SerializationContext context,
Object value,
TypeDefinition typeDef,
String path,
List<SerializationRule> rules)
Serialize a value.
|
void |
SerializationContext.ObjectContext.setOriginalType(TypeDefinition originalType) |
void |
SerializationClass.Attribute.setType(TypeDefinition type) |
protected abstract ISynchronizationPoint<? extends Exception> |
AbstractSerializationSpecWriter.specifyEnumValue(SerializationContext context,
TypeDefinition type) |
protected ISynchronizationPoint<? extends Exception> |
AbstractSerializationSpecWriter.specifyMapValue(SerializationContext context,
TypeDefinition type,
List<SerializationRule> rules) |
protected ISynchronizationPoint<? extends Exception> |
AbstractSerializationSpecWriter.specifyObjectValue(SerializationContext context,
TypeDefinition typeDef,
List<SerializationRule> rules) |
protected abstract ISynchronizationPoint<? extends Exception> |
AbstractSerializationSpecWriter.specifyStringValue(SerializationContext context,
TypeDefinition type) |
ISynchronizationPoint<? extends Exception> |
AbstractSerializationSpecWriter.specifyValue(SerializationContext context,
TypeDefinition typeDef,
List<SerializationRule> rules)
Can be used when already initialized.
|
protected abstract AsyncWork<Object,Exception> |
AbstractDeserializer.startObjectValue(SerializationContext context,
TypeDefinition type,
List<SerializationRule> rules)
Instantiate the type if the start of an object has been found, null if null has been found, or an error.
|
| Constructor and Description |
|---|
Attribute(SerializationClass parent,
String name,
TypeDefinition type)
Constructor.
|
CollectionContext(SerializationContext parent,
Object col,
TypeDefinition colType,
TypeDefinition elementType)
Constructor.
|
ObjectContext(SerializationContext parent,
Object instance,
SerializationClass clazz,
TypeDefinition originalType)
Constructor.
|
SerializationClass(TypeDefinition type)
Constructor.
|
TypeDefinition(Class<?> base,
TypeDefinition... parameters)
Create a type of the given class and generic parameters.
|
TypeDefinition(TypeDefinition containerType,
Type type)
Create from the given type which is the type of an attribute or a method, knowing its container type.
|
| Constructor and Description |
|---|
TypeDefinition(Class<?> base,
List<TypeDefinition> parameters)
Create a type of the given class and generic parameters.
|
| Modifier and Type | Method and Description |
|---|---|
default TypeDefinition |
SerializationRule.getDeserializationType(TypeDefinition type,
SerializationContext context)
Can be used to change a type during deserialization, in a similar way as the method
convertSerializationValue during serialization.
|
TypeDefinition |
CustomTypeSerializer.getDeserializationType(TypeDefinition type,
SerializationContext context) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
TypeFactory.canInstantiate(TypeDefinition type,
SerializationContext context) |
default boolean |
SerializationRule.canInstantiate(TypeDefinition type,
SerializationContext context)
During deserialization, when a type needs to be instantiated, this method is called to know
if this rule is providing a custom way to instantiate the given type.
|
default Object |
SerializationRule.convertSerializationValue(Object value,
TypeDefinition type,
SerializationContext context)
Before to serialize a value, this method is called in order to give the opportunity to convert to another value.
|
Object |
CustomTypeSerializer.convertSerializationValue(Object value,
TypeDefinition type,
SerializationContext context) |
default TypeDefinition |
SerializationRule.getDeserializationType(TypeDefinition type,
SerializationContext context)
Can be used to change a type during deserialization, in a similar way as the method
convertSerializationValue during serialization.
|
TypeDefinition |
CustomTypeSerializer.getDeserializationType(TypeDefinition type,
SerializationContext context) |
default Object |
SerializationRule.getDeserializationValue(Object value,
TypeDefinition type,
SerializationContext context)
Can be used to change the deserialization, in a similar way as the method
convertSerializationValue during serialization.
|
Object |
CustomTypeSerializer.getDeserializationValue(Object value,
TypeDefinition type,
SerializationContext context) |
Object |
TypeFactory.instantiate(TypeDefinition type,
SerializationContext context) |
default Object |
SerializationRule.instantiate(TypeDefinition type,
SerializationContext context)
Called if the method canInstantiate previously returned true during deserialization.
|
default void |
SerializationRule.onInstantiation(TypeDefinition type,
Object instance,
SerializationContext context)
Called each time a type is instantiated during deserialization.
|
| Modifier and Type | Method and Description |
|---|---|
TypeDefinition |
XMLCustomSerializer.type()
Type that this serializer is handling.
|
| Modifier and Type | Method and Description |
|---|---|
protected ISynchronizationPoint<? extends Exception> |
XMLSpecWriter.specifyEnumValue(SerializationContext context,
TypeDefinition type) |
protected ISynchronizationPoint<? extends Exception> |
XMLSpecWriter.specifyStringValue(SerializationContext context,
TypeDefinition type) |
protected AsyncWork<Object,Exception> |
XMLDeserializer.startObjectValue(SerializationContext context,
TypeDefinition type,
List<SerializationRule> rules) |
Copyright © 2018. All rights reserved.