Package blue.endless.jankson.impl
Class MarshallerImpl
java.lang.Object
blue.endless.jankson.impl.MarshallerImpl
- All Implemented Interfaces:
Marshaller
Deprecated.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MarshallerDeprecated.<T> Tmarshall(Class<T> clazz, JsonElement elem) Deprecated.Unpacks the provided JsonElement into a new object of typeclazz, making a best effort to unpack all the fields it can.<T> Tmarshall(Class<T> clazz, JsonElement elem, boolean failFast) Deprecated.<T> Tmarshall(Type type, JsonElement elem) Deprecated.EXPERIMENTAL.<T> TmarshallCarefully(Class<T> clazz, JsonElement elem) Deprecated.Unpacks the provided JsonElement in fail-fast mode.<T> voidDeprecated.<A,B> void registerDeserializer(Class<A> sourceClass, Class<B> targetClass, DeserializerFunction<A, B> function) Deprecated.<T> voidregisterSerializer(Class<T> clazz, BiFunction<T, Marshaller, JsonElement> serializer) Deprecated.<T> voidregisterSerializer(Class<T> clazz, Function<T, JsonElement> serializer) Deprecated.<T> voidregisterTypeAdapter(Class<T> clazz, Function<JsonObject, T> adapter) Deprecated.<T> voidregisterTypeFactory(Class<T> clazz, Supplier<T> supplier) Deprecated.Deprecated.Turns a java object into its json intermediate representation.
-
Constructor Details
-
MarshallerImpl
public MarshallerImpl()Deprecated.
-
-
Method Details
-
getFallback
Deprecated. -
register
Deprecated. -
registerTypeAdapter
Deprecated. -
registerSerializer
Deprecated. -
registerSerializer
Deprecated. -
registerTypeFactory
Deprecated. -
registerDeserializer
public <A,B> void registerDeserializer(Class<A> sourceClass, Class<B> targetClass, DeserializerFunction<A, B> function) Deprecated. -
marshall
Deprecated.EXPERIMENTAL. Marshalls elem into a very specific parameterized type, honoring generic type arguments.- Specified by:
marshallin interfaceMarshaller- Type Parameters:
T- The type to force-cast to at the end- Parameters:
type- The type to deserialize toelem- json intermediate representation of the data to be unpacked.- Returns:
- A new object of the provided Type that represents the data in the json provided.
-
marshall
Deprecated.Description copied from interface:MarshallerUnpacks the provided JsonElement into a new object of typeclazz, making a best effort to unpack all the fields it can. Any fields that cannot be unpacked will be left in the state the initializer and no-arg constructor leaves them in.Note: Consider using
Marshaller.marshallCarefully(Class, JsonElement)to detect errors first, and then calling this method as a fallback if an error is encountered.- Specified by:
marshallin interfaceMarshaller- Type Parameters:
T- The type of the object to create and deserialize- Parameters:
clazz- The class of the object to create and deserializeelem- json intermediate representation of the data to be unpacked.- Returns:
- A new object of the provided class that represents the data in the json provided.
-
marshallCarefully
Deprecated.Description copied from interface:MarshallerUnpacks the provided JsonElement in fail-fast mode. A detailed exception is thrown for any problem encountered during the unpacking process.- Specified by:
marshallCarefullyin interfaceMarshaller- Type Parameters:
T- The type of the object to create and deserialize- Parameters:
clazz- The class of the object to create and deserializeelem- json intermediate representation of the data to be unpacked.- Returns:
- A new object of the provided class that represents the data in the json provided.
- Throws:
DeserializationException- if any problems are encountered unpacking the data.
-
marshall
@Nullable public <T> T marshall(Class<T> clazz, JsonElement elem, boolean failFast) throws DeserializationException Deprecated.- Throws:
DeserializationException
-
serialize
Deprecated.Description copied from interface:MarshallerTurns a java object into its json intermediate representation.- Specified by:
serializein interfaceMarshaller
-
Marshaller