Class CollectionFactory

java.lang.Object
com.cedarsoftware.util.io.factory.CollectionFactory
All Implemented Interfaces:
JsonReader.ClassFactory

@Deprecated public class CollectionFactory extends Object implements JsonReader.ClassFactory
Deprecated.
Use to create new instances of collection interfaces (needed for empty collections)
  • Constructor Details

    • CollectionFactory

      public CollectionFactory()
      Deprecated.
  • Method Details

    • newInstance

      public Object newInstance(Class<?> c, JsonObject jObj, ReaderContext context)
      Deprecated.
      Description copied from interface: JsonReader.ClassFactory
      Implement this method to return a new instance of the passed in Class. Use the passed in JsonObject to supply values to the construction of the object.
      Specified by:
      newInstance in interface JsonReader.ClassFactory
      Parameters:
      c - Class of the object that needs to be created
      jObj - JsonObject (if primitive type do jObj.getPrimitiveValue();
      context - ReaderContext for creating objects an getting read options
      Returns:
      a new instance of C. If you completely fill the new instance using the value(s) from object, and no further work is needed for construction, then override the isObjectFinal() method below and return true.