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,
com.mongodb.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,
com.mongodb.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.
|
public <T> T createInstance(Class<T> clazz)
ObjectFactory
createInstance
in interface ObjectFactory
public <T> T createInstance(Class<T> clazz, com.mongodb.DBObject dbObj)
ObjectFactory
Mapper.CLASS_NAME_FIELDNAME
field in the dbObject passed in. If that field
is missing, the given Class is used instead.createInstance
in interface ObjectFactory
public Object createInstance(Mapper mapper, MappedField mf, com.mongodb.DBObject dbObj)
ObjectFactory
Mapper.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 ObjectFactory
public Map createMap(MappedField mf)
ObjectFactory
createMap
in interface ObjectFactory
public List createList(MappedField mf)
ObjectFactory
createList
in interface ObjectFactory
public Set createSet(MappedField mf)
ObjectFactory
createSet
in interface ObjectFactory
public <T> T createInst(Class<T> clazz)
Copyright © 2016. All rights reserved.