Class EnumClassFactory

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

public class EnumClassFactory extends Object implements JsonReader.ClassFactory
  • Constructor Details

    • EnumClassFactory

      public EnumClassFactory()
  • Method Details

    • newInstance

      public Object newInstance(Class<?> c, JsonObject jObj)
      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();
      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.
    • fromString

      protected Enum fromString(Class<?> c, String s)