Package com.dslplatform.json.runtime
Class ObjectFormatDescription<B,T>
- java.lang.Object
-
- com.dslplatform.json.runtime.WriteDescription<T>
-
- com.dslplatform.json.runtime.ObjectFormatDescription<B,T>
-
- All Implemented Interfaces:
JsonReader.BindObject<B>,JsonReader.ReadObject<T>,JsonWriter.WriteObject<T>,FormatConverter<T>
public final class ObjectFormatDescription<B,T> extends WriteDescription<T> implements FormatConverter<T>, JsonReader.BindObject<B>
-
-
Field Summary
Fields Modifier and Type Field Description private DecodePropertyInfo<JsonReader.BindObject>[]decodersprivate java.lang.StringendErrorprivate Settings.Function<B,T>finalizeprivate booleanhasMandatoryprivate static Settings.Functionidentityprivate longmandatoryFlagprivate java.lang.reflect.Typemanifestprivate InstanceFactory<B>newInstanceprivate booleanskipOnUnknownprivate java.lang.StringstartError
-
Constructor Summary
Constructors Constructor Description ObjectFormatDescription(java.lang.reflect.Type manifest, InstanceFactory<B> newInstance, Settings.Function<B,T> finalize, JsonWriter.WriteObject[] encoders, DecodePropertyInfo<JsonReader.BindObject>[] decoders, DslJson json, boolean skipOnUnknown)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Bbind(JsonReader reader, B instance)private voidbindContent(JsonReader reader, B instance)private voidbindObjectSlow(JsonReader reader, B instance, long currentMandatory)static <D> ObjectFormatDescription<D,D>create(java.lang.Class<D> manifest, InstanceFactory<D> newInstance, JsonWriter.WriteObject[] encoders, DecodePropertyInfo<JsonReader.BindObject>[] decoders, DslJson json, boolean skipOnUnknown)private voidfinalChecks(JsonReader reader, B instance, long currentMandatory)Tread(JsonReader reader)TreadContent(JsonReader reader)private voidskip(JsonReader reader)-
Methods inherited from class com.dslplatform.json.runtime.WriteDescription
write, writeContentFull, writeContentMinimal
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.dslplatform.json.runtime.FormatConverter
writeContentFull, writeContentMinimal
-
Methods inherited from interface com.dslplatform.json.JsonWriter.WriteObject
write
-
-
-
-
Field Detail
-
manifest
private final java.lang.reflect.Type manifest
-
newInstance
private final InstanceFactory<B> newInstance
-
finalize
private final Settings.Function<B,T> finalize
-
decoders
private final DecodePropertyInfo<JsonReader.BindObject>[] decoders
-
skipOnUnknown
private final boolean skipOnUnknown
-
hasMandatory
private final boolean hasMandatory
-
mandatoryFlag
private final long mandatoryFlag
-
startError
private final java.lang.String startError
-
endError
private final java.lang.String endError
-
identity
private static final Settings.Function identity
-
-
Constructor Detail
-
ObjectFormatDescription
public ObjectFormatDescription(java.lang.reflect.Type manifest, InstanceFactory<B> newInstance, Settings.Function<B,T> finalize, JsonWriter.WriteObject[] encoders, DecodePropertyInfo<JsonReader.BindObject>[] decoders, DslJson json, boolean skipOnUnknown)
-
-
Method Detail
-
create
public static <D> ObjectFormatDescription<D,D> create(java.lang.Class<D> manifest, InstanceFactory<D> newInstance, JsonWriter.WriteObject[] encoders, DecodePropertyInfo<JsonReader.BindObject>[] decoders, DslJson json, boolean skipOnUnknown)
-
read
@Nullable public T read(JsonReader reader) throws java.io.IOException
- Specified by:
readin interfaceJsonReader.ReadObject<B>- Throws:
java.io.IOException
-
bind
public B bind(JsonReader reader, B instance) throws java.io.IOException
- Specified by:
bindin interfaceJsonReader.BindObject<B>- Throws:
java.io.IOException
-
readContent
public T readContent(JsonReader reader) throws java.io.IOException
- Specified by:
readContentin interfaceFormatConverter<B>- Throws:
java.io.IOException
-
bindContent
private void bindContent(JsonReader reader, B instance) throws java.io.IOException
- Throws:
java.io.IOException
-
bindObjectSlow
private void bindObjectSlow(JsonReader reader, B instance, long currentMandatory) throws java.io.IOException
- Throws:
java.io.IOException
-
finalChecks
private void finalChecks(JsonReader reader, B instance, long currentMandatory) throws java.io.IOException
- Throws:
java.io.IOException
-
skip
private void skip(JsonReader reader) throws java.io.IOException
- Throws:
java.io.IOException
-
-