Package jodd.json

Class JsonParserBase

  • Direct Known Subclasses:
    JsonParser

    public abstract class JsonParserBase
    extends java.lang.Object
    Just a base class of JsonParser 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 of MapToBean.
      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 a HashMap if type is not specified.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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
    • Constructor Detail

      • JsonParserBase

        public JsonParserBase​(boolean strictTypes)
    • Method Detail

      • createMapToBean

        protected MapToBean createMapToBean​(java.lang.String classMetadataName)
        Creates new instance of MapToBean.
      • 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 a HashMap 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.