public class DefaultCreator extends Object implements ObjectFactory
| Constructor and Description |
|---|
DefaultCreator() |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
createInst(Class<T> clazz) |
<T> T |
createInstance(Class<T> clazz)
Creates an instance of the given class.
|
<T> T |
createInstance(Class<T> clazz,
DBObject dbObj)
Creates an instance of the class defined in the
Mapper.CLASS_NAME_FIELDNAME field in the dbObject passed in. |
Object |
createInstance(Mapper mapper,
MappedField mf,
DBObject dbObj)
Creates an instance of the class defined in the
Mapper.CLASS_NAME_FIELDNAME field in the dbObject passed in. |
List |
createList(MappedField mf)
Defines how morphia creates a List object.
|
Map |
createMap(MappedField mf)
Defines how morphia creates a Map object.
|
Set |
createSet(MappedField mf)
Defines how morphia creates a Set object.
|
protected ClassLoader |
getClassLoaderForClass() |
public <T> T createInstance(Class<T> clazz)
ObjectFactorycreateInstance in interface ObjectFactorypublic <T> T createInstance(Class<T> clazz, DBObject dbObj)
ObjectFactoryMapper.CLASS_NAME_FIELDNAME field in the dbObject passed in. If that field
is missing, the given Class is used instead.createInstance in interface ObjectFactorypublic Object createInstance(Mapper mapper, MappedField mf, DBObject dbObj)
ObjectFactoryMapper.CLASS_NAME_FIELDNAME field in the dbObject passed in. If that field
is missing, morphia attempts to the MappedField to determine which concrete class to instantiate.createInstance in interface ObjectFactorypublic Map createMap(MappedField mf)
ObjectFactorycreateMap in interface ObjectFactorypublic List createList(MappedField mf)
ObjectFactorycreateList in interface ObjectFactorypublic Set createSet(MappedField mf)
ObjectFactorycreateSet in interface ObjectFactoryprotected ClassLoader getClassLoaderForClass()
public <T> T createInst(Class<T> clazz)