public static class ReadOptionsBuilder.DefaultReadOptions extends Object implements ReadOptions
ReadOptions.ReturnType
Modifier and Type | Method and Description |
---|---|
Map<String,Field> |
buildDeepFieldMap(Class<?> c)
Gets the declared fields for the full class hierarchy of a given class
|
void |
clearCaches() |
JsonReader.ClassFactory |
getClassFactory(Class<?> c)
Get the ClassFactory associated to the passed in class.
|
ClassLoader |
getClassLoader() |
Class<?> |
getCoercedClass(Class<?> c)
Fetch the coerced class for the passed in fully qualified class name.
|
com.cedarsoftware.util.convert.ConverterOptions |
getConverterOptions() |
Object |
getCustomOption(String key)
Get a custom option
|
JsonReader.JsonClassReader |
getCustomReader(Class<?> c)
Fetch the custom reader for the passed in Class.
|
Map<String,Field> |
getDeepDeclaredFields(Class<?> c)
Gets the declared fields for the full class hierarchy of a given class
|
Map<String,Injector> |
getDeepInjectorMap(Class<?> classToTraverse) |
int |
getMaxDepth() |
JsonReader.MissingFieldHandler |
getMissingFieldHandler() |
String |
getTypeNameAlias(String typeName)
Alias Type Names, e.g.
|
Class<?> |
getUnknownTypeClass() |
boolean |
isClassCoerced(String className) |
boolean |
isCloseStream() |
boolean |
isCustomReaderClass(Class<?> clazz) |
boolean |
isFailOnUnknownType() |
boolean |
isNonReferenceableClass(Class<?> clazz) |
boolean |
isNotCustomReaderClass(Class<?> clazz) |
boolean |
isReturningJavaObjects() |
boolean |
isReturningJsonObjects() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isAllowNanAndInfinity
public ClassLoader getClassLoader()
getClassLoader
in interface ReadOptions
public boolean isFailOnUnknownType()
isFailOnUnknownType
in interface ReadOptions
public Class<?> getUnknownTypeClass()
getUnknownTypeClass
in interface ReadOptions
public boolean isCloseStream()
isCloseStream
in interface ReadOptions
public int getMaxDepth()
getMaxDepth
in interface ReadOptions
public String getTypeNameAlias(String typeName)
getTypeNameAlias
in interface ReadOptions
typeName
- String name of type to fetch alias for. There are no default aliases.public boolean isClassCoerced(String className)
isClassCoerced
in interface ReadOptions
public Class<?> getCoercedClass(Class<?> c)
getCoercedClass
in interface ReadOptions
c
- Class to coercepublic JsonReader.MissingFieldHandler getMissingFieldHandler()
getMissingFieldHandler
in interface ReadOptions
public boolean isNonReferenceableClass(Class<?> clazz)
isNonReferenceableClass
in interface ReadOptions
clazz
- Class to check to see if it is non-referenceable. Non-referenceable classes will always create
a new instance when read in and never use @id/@ref. This uses more memory when the JSON is read in,
as there will be a separate instance in memory for each occurrence. There are certain classes that
json-io automatically treats as non-referenceable, like Strings, Enums, Class, and any Number
instance (BigDecimal, AtomicLong, etc.) You can add to this list. Often, non-referenceable classes
are useful for classes that can be defined in one line as a JSON, like a LocalDateTime, for example.public boolean isNotCustomReaderClass(Class<?> clazz)
isNotCustomReaderClass
in interface ReadOptions
clazz
- Class to see if it is on the not-customized list. Classes are added to this list when
a class is being picked up through inheritance, and you don't want it to have a custom
reader associated to it.public boolean isCustomReaderClass(Class<?> clazz)
isCustomReaderClass
in interface ReadOptions
clazz
- Class to check to see if there is a custom reader associated to it.public JsonReader.ClassFactory getClassFactory(Class<?> c)
getClassFactory
in interface ReadOptions
c
- Class for which to fetch the ClassFactory.public JsonReader.JsonClassReader getCustomReader(Class<?> c)
getCustomReader
in interface ReadOptions
c
- Class of object for which fetch a custom readerpublic boolean isReturningJsonObjects()
isReturningJsonObjects
in interface ReadOptions
public boolean isReturningJavaObjects()
isReturningJavaObjects
in interface ReadOptions
public Map<String,Injector> getDeepInjectorMap(Class<?> classToTraverse)
getDeepInjectorMap
in interface ReadOptions
public void clearCaches()
clearCaches
in interface ReadOptions
public Map<String,Field> getDeepDeclaredFields(Class<?> c)
getDeepDeclaredFields
in interface ReadOptions
c
- - given class.public com.cedarsoftware.util.convert.ConverterOptions getConverterOptions()
getConverterOptions
in interface ReadOptions
public Object getCustomOption(String key)
ReadOptions
getCustomOption
in interface ReadOptions
key
- String name of the custom optionCopyright © 2024. All rights reserved.