Class CustomizeJsonParser


  • @Beta
    public class CustomizeJsonParser
    extends java.lang.Object
    Beta
    Customizes the behavior of a JSON parser.

    All methods have a default trivial implementation, so subclasses need only implement the methods whose behavior needs customization.

    Implementation has no fields and therefore thread-safe, but sub-classes are not necessarily thread-safe.

    Since:
    1.0
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void handleUnrecognizedKey​(java.lang.Object context, java.lang.String key)
      Called when the given unrecognized key is encountered in the given context object.
      java.util.Collection<java.lang.Object> newInstanceForArray​(java.lang.Object context, java.lang.reflect.Field field)
      Returns a new instance value for the given field in the given context object for a JSON array or null for the default behavior.
      java.lang.Object newInstanceForObject​(java.lang.Object context, java.lang.Class<?> fieldClass)
      Returns a new instance value for the given field class in the given context object for JSON Object or null for the default behavior.
      boolean stopAt​(java.lang.Object context, java.lang.String key)
      Returns whether to stop parsing at the given key of the given context object.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CustomizeJsonParser

        public CustomizeJsonParser()
    • Method Detail

      • stopAt

        public boolean stopAt​(java.lang.Object context,
                              java.lang.String key)
        Returns whether to stop parsing at the given key of the given context object.
      • handleUnrecognizedKey

        public void handleUnrecognizedKey​(java.lang.Object context,
                                          java.lang.String key)
        Called when the given unrecognized key is encountered in the given context object.
      • newInstanceForArray

        public java.util.Collection<java.lang.Object> newInstanceForArray​(java.lang.Object context,
                                                                          java.lang.reflect.Field field)
        Returns a new instance value for the given field in the given context object for a JSON array or null for the default behavior.
      • newInstanceForObject

        public java.lang.Object newInstanceForObject​(java.lang.Object context,
                                                     java.lang.Class<?> fieldClass)
        Returns a new instance value for the given field class in the given context object for JSON Object or null for the default behavior.