Class AbstractSerializerBuilder<T extends AbstractSerializerBuilder>
- java.lang.Object
-
- org.eclipse.yasson.internal.serializer.AbstractSerializerBuilder<T>
-
- Direct Known Subclasses:
DeserializerBuilder
,SerializerBuilder
public class AbstractSerializerBuilder<T extends AbstractSerializerBuilder> extends Object
Base class for serializer builders.- Author:
- Roman Grigoriadi
-
-
Field Summary
Fields Modifier and Type Field Description protected ClassModel
classModel
In case of unknown object genericType.protected Customization
customization
Class customizationprotected Type
genericType
Type is used when field model is not present.protected JsonbContext
jsonbContext
protected Type
runtimeType
Runtime type resolved after expanding type variables and wildcards.protected CurrentItem<?>
wrapper
Not null with an exception of a root item.
-
Constructor Summary
Constructors Constructor Description AbstractSerializerBuilder(JsonbContext jsonbContext)
Crates a builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ClassModel
getClassModel()
Model of a class representing current item and instance (if any).protected ClassModel
getClassModel(Class<?> rawType)
Gets or load class model for a class an its superclasses.Customization
getCustomization()
JsonbContext
getJsonbContext()
Jsonb runtime context.Type
getRuntimeType()
Resolved runtime type for instance in case ofTypeVariable
orWildcardType
Otherwise provided type in type field, or type of field model.CurrentItem<?>
getWrapper()
Wrapper item for this item.T
withCustomization(Customization customization)
Customization of the classT
withType(Type type)
Type for underlying instance to be created from.T
withWrapper(CurrentItem<?> wrapper)
Wrapper item for this item.
-
-
-
Field Detail
-
wrapper
protected CurrentItem<?> wrapper
Not null with an exception of a root item.
-
classModel
protected ClassModel classModel
In case of unknown object genericType. Null for embedded objects such as collections, or known conversion types.
-
runtimeType
protected Type runtimeType
Runtime type resolved after expanding type variables and wildcards.
-
genericType
protected Type genericType
Type is used when field model is not present. In case of root, or embedded objects such as collections.
-
customization
protected Customization customization
Class customization
-
jsonbContext
protected final JsonbContext jsonbContext
-
-
Constructor Detail
-
AbstractSerializerBuilder
public AbstractSerializerBuilder(JsonbContext jsonbContext)
Crates a builder.- Parameters:
jsonbContext
- Not null.
-
-
Method Detail
-
withWrapper
public T withWrapper(CurrentItem<?> wrapper)
Wrapper item for this item.- Parameters:
wrapper
- not null.- Returns:
- Builder instance for call chaining.
-
withCustomization
public T withCustomization(Customization customization)
Customization of the class- Parameters:
customization
- Class customization- Returns:
- Builder instance for call chaining.
-
getClassModel
protected ClassModel getClassModel(Class<?> rawType)
Gets or load class model for a class an its superclasses.- Parameters:
rawType
- Class to get model for.- Returns:
- Class model.
-
getWrapper
public CurrentItem<?> getWrapper()
Wrapper item for this item.- Returns:
- Wrapper item.
-
getClassModel
public ClassModel getClassModel()
Model of a class representing current item and instance (if any). Known collection classes doesn't need such a model.- Returns:
- model of a class
-
getRuntimeType
public Type getRuntimeType()
Resolved runtime type for instance in case ofTypeVariable
orWildcardType
Otherwise provided type in type field, or type of field model.- Returns:
- runtime type
-
withType
public T withType(Type type)
Type for underlying instance to be created from. In case of type variable or wildcard, will be resolved recursively from parent items.- Parameters:
type
- type of instance not null- Returns:
- builder instance for call chaining
-
getJsonbContext
public JsonbContext getJsonbContext()
Jsonb runtime context.- Returns:
- jsonb context
-
getCustomization
public Customization getCustomization()
-
-