public class ReadOptionsBuilder extends Object
Constructor and Description |
---|
ReadOptionsBuilder() |
public static void addPermanentCoercedType(String fqName, Class<?> c)
fqName
- Class to assign a custom JSON reader toc
- The JsonClassReader which will read the custom JSON format of 'c'public static void addReaderPermanent(Class c, JsonReader.JsonClassReader reader)
c
- Class to assign a custom JSON reader toreader
- The JsonClassReader which will read the custom JSON format of 'c'public static void assignInstantiator(String className, JsonReader.ClassFactory factory)
This API is an 'escape hatch' to allow ANY object to be instantiated by JsonReader and is useful when you encounter a class that JsonReader cannot instantiate using its internal exhausting attempts (trying all constructors, varying arguments to them, etc.)
className
- Class name to assign an ClassFactory tofactory
- ClassFactory that will create 'c' instancespublic static void assignInstantiator(Class c, JsonReader.ClassFactory factory)
public ReadOptionsBuilder setUnknownTypeClass(Class<?> c)
public ReadOptionsBuilder setMissingFieldHandler(JsonReader.MissingFieldHandler missingFieldHandler)
public ReadOptionsBuilder failOnUnknownType()
public ReadOptionsBuilder withClassLoader(ClassLoader classLoader)
public ReadOptionsBuilder returnAsMaps()
public ReadOptionsBuilder withCoercedType(Class<?> oldType, Class<?> newType)
public ReadOptionsBuilder withCoercedType(String fullyQualifedNameOldType, Class<?> newType)
public ReadOptionsBuilder withCustomTypeName(Class<?> type, String newTypeName)
public ReadOptionsBuilder withCustomTypeName(String type, String newTypeName)
public ReadOptionsBuilder withCustomTypeNames(Map<String,String> map)
public ReadOptionsBuilder withCustomReader(Class<?> c, JsonReader.JsonClassReader reader)
c
- Class to assign a custom JSON reader toreader
- The JsonClassReader which will read the custom JSON format of 'c'public ReadOptionsBuilder withCustomReaders(Map<? extends Class<?>,? extends JsonReader.JsonClassReader> map)
map
- This map contains classes mapped to their respctive readerspublic ReadOptionsBuilder withNonCustomizableClass(Class<?> c)
public ReadOptionsBuilder withMaxDepth(int maxDepth)
public ReadOptionsBuilder withNonCustomizableClasses(Collection<Class<?>> collection)
public ReadOptionsBuilder withClassFactory(Class<?> type, JsonReader.ClassFactory factory)
public ReadOptionsBuilder withClassFactories(Map<Class<?>,? extends JsonReader.ClassFactory> factories)
public ReadOptionsBuilder withLogicalPrimitive(Class<?> c)
public ReadOptionsBuilder withLogicalPrimitives(Collection<Class<?>> collection)
public static ReadOptionsBuilder fromMap(Map<String,Object> args)
public ReadOptions build()
Copyright © 2023. All rights reserved.