Class EmptyExtension

java.lang.Object
com.jsoniter.spi.EmptyExtension
All Implemented Interfaces:
Extension
Direct Known Subclasses:
Config

public class EmptyExtension extends Object implements Extension
  • Constructor Details

    • EmptyExtension

      public EmptyExtension()
  • Method Details

    • chooseImplementation

      public Type chooseImplementation(Type type)
      Description copied from interface: Extension
      Choose the implementation class for interface types
      Specified by:
      chooseImplementation in interface Extension
      Parameters:
      type - the type to decode to, could be class or parameterized type
      Returns:
      the implementation type to use
    • canCreate

      public boolean canCreate(Class clazz)
      Description copied from interface: Extension
      Can this extension create object instance for given interface type
      Specified by:
      canCreate in interface Extension
      Parameters:
      clazz - the interface
      Returns:
      true if can create, false if can not
    • create

      public Object create(Class clazz)
      Description copied from interface: Extension
      Create object instance for given interface type
      Specified by:
      create in interface Extension
      Parameters:
      clazz - the interface
      Returns:
      the object instance, throw exception if can not create
    • createDecoder

      public Decoder createDecoder(String cacheKey, Type type)
      Description copied from interface: Extension
      Customize type decoding
      Specified by:
      createDecoder in interface Extension
      Parameters:
      cacheKey - name of the decoder
      type - change how to decode the type
      Returns:
      null, if no special customization needed
    • createEncoder

      public Encoder createEncoder(String cacheKey, Type type)
      Description copied from interface: Extension
      Customize type encoding
      Specified by:
      createEncoder in interface Extension
      Parameters:
      cacheKey - name of the encoder
      type - change how to encode the type
      Returns:
      null, if not special customization needed
    • updateClassDescriptor

      public void updateClassDescriptor(ClassDescriptor desc)
      Description copied from interface: Extension
      Update how binding is done for the class
      Specified by:
      updateClassDescriptor in interface Extension
      Parameters:
      desc - binding information