|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.datastore.mapping.AbstractMappingContext
public abstract class AbstractMappingContext
Abstract implementation of the MappingContext interface
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.springframework.datastore.mapping.MappingContext |
---|
MappingContext.Listener |
Field Summary | |
---|---|
protected org.springframework.core.convert.support.GenericConversionService |
conversionService
|
protected Map<PersistentEntity,org.springframework.validation.Validator> |
entityValidators
|
protected Collection<MappingContext.Listener> |
eventListeners
|
protected Collection<PersistentEntity> |
persistentEntities
|
protected Map<PersistentEntity,Map<String,PersistentEntity>> |
persistentEntitiesByDiscriminator
|
protected Map<String,PersistentEntity> |
persistentEntitiesByName
|
protected ProxyFactory |
proxyFactory
|
Constructor Summary | |
---|---|
AbstractMappingContext()
|
Method Summary | |
---|---|
void |
addEntityValidator(PersistentEntity entity,
org.springframework.validation.Validator validator)
Adds a validator to be used by the entity for validation |
void |
addMappingContextListener(MappingContext.Listener listener)
Adds a new mapping context listener instance |
PersistentEntity |
addPersistentEntity(Class javaClass)
Adds a PersistentEntity instance |
void |
addTypeConverter(org.springframework.core.convert.converter.Converter converter)
Add a converter used to convert property values to and from the datastore |
protected abstract PersistentEntity |
createPersistentEntity(Class javaClass)
|
PersistentEntity |
getChildEntityByDiscriminator(PersistentEntity root,
String discriminator)
Obtains a child of the given root entity using the given discriminator |
org.springframework.core.convert.support.GenericConversionService |
getConversionService()
Obtains the ConversionService instance to use for type conversion |
org.springframework.validation.Validator |
getEntityValidator(PersistentEntity entity)
Obtains a validator for the given entity |
Collection<PersistentEntity> |
getPersistentEntities()
Obtains a list of PersistentEntity instances |
PersistentEntity |
getPersistentEntity(String name)
Obtains a PersistentEntity by name |
ProxyFactory |
getProxyFactory()
Factory used for creating proxies |
boolean |
isPersistentEntity(Class type)
Returns whether the specified class is a persistent entity |
boolean |
isPersistentEntity(Object value)
Returns whether the specified value is a persistent entity |
void |
setProxyFactory(ProxyFactory factory)
Factory to use for creating proxies |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.springframework.datastore.mapping.MappingContext |
---|
getMappingFactory, getMappingSyntaxStrategy |
Field Detail |
---|
protected Collection<PersistentEntity> persistentEntities
protected Map<String,PersistentEntity> persistentEntitiesByName
protected Map<PersistentEntity,Map<String,PersistentEntity>> persistentEntitiesByDiscriminator
protected Map<PersistentEntity,org.springframework.validation.Validator> entityValidators
protected Collection<MappingContext.Listener> eventListeners
protected org.springframework.core.convert.support.GenericConversionService conversionService
protected ProxyFactory proxyFactory
Constructor Detail |
---|
public AbstractMappingContext()
Method Detail |
---|
public org.springframework.core.convert.support.GenericConversionService getConversionService()
MappingContext
getConversionService
in interface MappingContext
public ProxyFactory getProxyFactory()
MappingContext
getProxyFactory
in interface MappingContext
public void addMappingContextListener(MappingContext.Listener listener)
MappingContext
addMappingContextListener
in interface MappingContext
listener
- The listenerpublic void setProxyFactory(ProxyFactory factory)
MappingContext
setProxyFactory
in interface MappingContext
factory
- The proxy factorypublic void addTypeConverter(org.springframework.core.convert.converter.Converter converter)
MappingContext
addTypeConverter
in interface MappingContext
converter
- The converter to addpublic org.springframework.validation.Validator getEntityValidator(PersistentEntity entity)
MappingContext
getEntityValidator
in interface MappingContext
entity
- The entity
public void addEntityValidator(PersistentEntity entity, org.springframework.validation.Validator validator)
MappingContext
addEntityValidator
in interface MappingContext
entity
- The PersistentEntityvalidator
- The validatorpublic final PersistentEntity addPersistentEntity(Class javaClass)
MappingContext
addPersistentEntity
in interface MappingContext
javaClass
- The Java class representing the entity
public PersistentEntity getChildEntityByDiscriminator(PersistentEntity root, String discriminator)
MappingContext
getChildEntityByDiscriminator
in interface MappingContext
root
- The root entitydiscriminator
- The discriminator
protected abstract PersistentEntity createPersistentEntity(Class javaClass)
public Collection<PersistentEntity> getPersistentEntities()
MappingContext
getPersistentEntities
in interface MappingContext
public boolean isPersistentEntity(Class type)
MappingContext
isPersistentEntity
in interface MappingContext
type
- The type to check
public boolean isPersistentEntity(Object value)
MappingContext
isPersistentEntity
in interface MappingContext
value
- The value to check
public PersistentEntity getPersistentEntity(String name)
MappingContext
getPersistentEntity
in interface MappingContext
name
- The name of the entity
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |