Package jodd.json
Class JsonParserBase
- java.lang.Object
-
- jodd.json.JsonParserBase
-
- Direct Known Subclasses:
JsonParser
public abstract class JsonParserBase extends java.lang.Object
Just a base class ofJsonParser
that contains various utilities, to reduce the size of a parser.
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.util.function.Supplier<java.util.List>
ARRAYLIST_SUPPLIER
protected java.util.List<java.lang.String>
classnameWhitelist
protected static java.util.function.Supplier<java.util.Map>
HASHMAP_SUPPLIER
protected static java.util.function.Supplier<java.util.List>
LAZYLIST_SUPPLIER
protected static java.util.function.Supplier<java.util.Map>
LAZYMAP_SUPPLIER
protected java.util.function.Supplier<java.util.List>
listSupplier
protected java.util.function.Supplier<java.util.Map>
mapSupplier
protected boolean
strictTypes
-
Constructor Summary
Constructors Constructor Description JsonParserBase(boolean strictTypes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.Object
convertType(java.lang.Object value, java.lang.Class targetType)
Converts type of the given value.protected MapToBean
createMapToBean(java.lang.String classMetadataName)
Creates new instance ofMapToBean
.protected void
injectValueIntoObject(java.lang.Object target, jodd.introspector.PropertyDescriptor pd, java.lang.Object value)
Injects value into the targets property.protected java.util.Collection<java.lang.Object>
newArrayInstance(java.lang.Class targetType)
Creates new type for JSON array objects.protected java.lang.Object
newObjectInstance(java.lang.Class targetType)
Creates new object or aHashMap
if type is not specified.
-
-
-
Field Detail
-
HASHMAP_SUPPLIER
protected static final java.util.function.Supplier<java.util.Map> HASHMAP_SUPPLIER
-
LAZYMAP_SUPPLIER
protected static final java.util.function.Supplier<java.util.Map> LAZYMAP_SUPPLIER
-
ARRAYLIST_SUPPLIER
protected static final java.util.function.Supplier<java.util.List> ARRAYLIST_SUPPLIER
-
LAZYLIST_SUPPLIER
protected static final java.util.function.Supplier<java.util.List> LAZYLIST_SUPPLIER
-
mapSupplier
protected java.util.function.Supplier<java.util.Map> mapSupplier
-
listSupplier
protected java.util.function.Supplier<java.util.List> listSupplier
-
classnameWhitelist
protected java.util.List<java.lang.String> classnameWhitelist
-
strictTypes
protected boolean strictTypes
-
-
Method Detail
-
createMapToBean
protected MapToBean createMapToBean(java.lang.String classMetadataName)
Creates new instance ofMapToBean
.
-
newArrayInstance
protected java.util.Collection<java.lang.Object> newArrayInstance(java.lang.Class targetType)
Creates new type for JSON array objects. It returns a collection. Later, the collection will be converted into the target type.
-
newObjectInstance
protected java.lang.Object newObjectInstance(java.lang.Class targetType)
Creates new object or aHashMap
if type is not specified.
-
injectValueIntoObject
protected void injectValueIntoObject(java.lang.Object target, jodd.introspector.PropertyDescriptor pd, java.lang.Object value)
Injects value into the targets property.
-
convertType
protected java.lang.Object convertType(java.lang.Object value, java.lang.Class targetType)
Converts type of the given value.
-
-