org.springframework.data.mapping
Class BasicMappingContext
java.lang.Object
org.springframework.data.mapping.BasicMappingContext
- All Implemented Interfaces:
- InitializingBean, ApplicationEventPublisherAware, MappingContext
public class BasicMappingContext
- extends Object
- implements MappingContext, InitializingBean, ApplicationEventPublisherAware
- Author:
- Jon Brisbin , Oliver Gierke
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
protected org.apache.commons.logging.Log log
applicationEventPublisher
protected ApplicationEventPublisher applicationEventPublisher
persistentEntities
protected ConcurrentMap<TypeInformation,PersistentEntity<?>> persistentEntities
validators
protected ConcurrentMap<PersistentEntity<?>,List<Validator>> validators
conversionService
protected final GenericConversionService conversionService
BasicMappingContext
public BasicMappingContext()
BasicMappingContext
public BasicMappingContext(GenericConversionService conversionService)
setCustomSimpleTypes
public void setCustomSimpleTypes(List<Class<?>> customSimpleTypes)
- Parameters:
customSimpleTypes
- the customSimpleTypes to set
setApplicationEventPublisher
public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher)
- Specified by:
setApplicationEventPublisher
in interface ApplicationEventPublisherAware
setInitialEntitySet
public void setInitialEntitySet(Set<Class<?>> initialEntitySet)
getPersistentEntities
public Collection<? extends PersistentEntity<?>> getPersistentEntities()
- Description copied from interface:
MappingContext
- Obtains a list of PersistentEntity instances
- Specified by:
getPersistentEntities
in interface MappingContext
- Returns:
- A list of PersistentEntity instances
getPersistentEntity
public <T> PersistentEntity<T> getPersistentEntity(Class<T> type)
- Specified by:
getPersistentEntity
in interface MappingContext
getPersistentEntity
public <T> PersistentEntity<T> getPersistentEntity(TypeInformation type)
- Specified by:
getPersistentEntity
in interface MappingContext
addPersistentEntity
public <T> PersistentEntity<T> addPersistentEntity(Class<T> type)
- Description copied from interface:
MappingContext
- Adds a PersistentEntity instance
- Specified by:
addPersistentEntity
in interface MappingContext
- Parameters:
type
- The Java class representing the entity
- Returns:
- The PersistentEntity instance
addPersistentEntity
public <T> PersistentEntity<T> addPersistentEntity(TypeInformation typeInformation)
getEntityValidators
public List<Validator> getEntityValidators(PersistentEntity<?> entity)
- Description copied from interface:
MappingContext
- Obtains a validator for the given entity
- Specified by:
getEntityValidators
in interface MappingContext
- Parameters:
entity
- The entity
- Returns:
- A validator or null if none exists for the given entity
isPersistentEntity
public boolean isPersistentEntity(Object value)
- Description copied from interface:
MappingContext
- Returns whether the specified value is a persistent entity
- Specified by:
isPersistentEntity
in interface MappingContext
- Parameters:
value
- The value to check
- Returns:
- True if it is
isPersistentEntity
public boolean isPersistentEntity(Class<?> type)
createPersistentEntity
protected <T> BasicPersistentEntity<T> createPersistentEntity(TypeInformation typeInformation,
MappingContext mappingContext)
throws MappingConfigurationException
- Throws:
MappingConfigurationException
createPersistentProperty
protected BasicPersistentProperty createPersistentProperty(Field field,
PropertyDescriptor descriptor,
TypeInformation information)
throws MappingConfigurationException
- Throws:
MappingConfigurationException
isPersistentProperty
public boolean isPersistentProperty(Field field,
PropertyDescriptor descriptor)
throws MappingConfigurationException
- Throws:
MappingConfigurationException
getPreferredConstructor
public <T> PreferredConstructor<T> getPreferredConstructor(Class<T> type)
throws MappingConfigurationException
- Throws:
MappingConfigurationException
isAssociation
public boolean isAssociation(Field field,
PropertyDescriptor descriptor)
throws MappingConfigurationException
- Throws:
MappingConfigurationException
createAssociation
public Association createAssociation(BasicPersistentProperty property)
isTransient
protected boolean isTransient(Field field)
getTargetType
protected Class<?> getTargetType(TypeVariable<?> tv)
getTargetType
protected Class<?> getTargetType(ParameterizedType ptype)
afterPropertiesSet
public void afterPropertiesSet()
throws Exception
- Specified by:
afterPropertiesSet
in interface InitializingBean
- Throws:
Exception
Copyright © 2011. All Rights Reserved.