Package com.cedarsoftware.util.io
Class JsonReader.CollectionFactory
java.lang.Object
com.cedarsoftware.util.io.JsonReader.CollectionFactory
- All Implemented Interfaces:
JsonReader.ClassFactory
- Enclosing class:
- JsonReader
Use to create new instances of collection interfaces (needed for empty collections)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnewInstance(Class<?> c, JsonObject jObj) Implement this method to return a new instance of the passed in Class.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.cedarsoftware.util.io.JsonReader.ClassFactory
isObjectFinal
-
Constructor Details
-
CollectionFactory
public CollectionFactory()
-
-
Method Details
-
newInstance
Description copied from interface:JsonReader.ClassFactoryImplement 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:
newInstancein interfaceJsonReader.ClassFactory- Parameters:
c- Class of the object that needs to be createdjObj- 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.
-