DATACMNS-215 - Removed validators from MappingContext API.

This commit is contained in:
Oliver Gierke
2012-08-16 10:39:57 +02:00
parent f4a5edcf44
commit beea916da0
2 changed files with 0 additions and 20 deletions

View File

@@ -52,7 +52,6 @@ import org.springframework.data.util.ClassTypeInformation;
import org.springframework.data.util.TypeInformation;
import org.springframework.util.ReflectionUtils;
import org.springframework.util.ReflectionUtils.FieldCallback;
import org.springframework.validation.Validator;
/**
* Base class to build mapping metadata and thus create instances of {@link PersistentEntity} and
@@ -73,7 +72,6 @@ public abstract class AbstractMappingContext<E extends MutablePersistentEntity<?
private static final Set<String> UNMAPPED_FIELDS = new HashSet<String>(Arrays.asList("class", "this$0"));
private final ConcurrentMap<TypeInformation<?>, E> persistentEntities = new ConcurrentHashMap<TypeInformation<?>, E>();
private final ConcurrentMap<E, List<Validator>> validators = new ConcurrentHashMap<E, List<Validator>>();
private ApplicationEventPublisher applicationEventPublisher;
private ApplicationContext applicationContext;
@@ -228,14 +226,6 @@ public abstract class AbstractMappingContext<E extends MutablePersistentEntity<?
return new DefaultPersistentPropertyPath<P>(result);
}
/*
* (non-Javadoc)
* @see org.springframework.data.mapping.context.MappingContext#getEntityValidators(org.springframework.data.mapping.PersistentEntity)
*/
public List<Validator> getEntityValidators(E entity) {
return validators.get(entity);
}
/**
* Adds the given type to the {@link MappingContext}.
*

View File

@@ -16,13 +16,11 @@
package org.springframework.data.mapping.context;
import java.util.Collection;
import java.util.List;
import org.springframework.data.mapping.PersistentEntity;
import org.springframework.data.mapping.PersistentProperty;
import org.springframework.data.mapping.PropertyPath;
import org.springframework.data.util.TypeInformation;
import org.springframework.validation.Validator;
/**
* This interface defines the overall context including all known PersistentEntity instances and methods to obtain
@@ -76,12 +74,4 @@ public interface MappingContext<E extends PersistentEntity<?, P>, P extends Pers
* @return
*/
PersistentPropertyPath<P> getPersistentPropertyPath(PropertyPath propertyPath);
/**
* Obtains a validator for the given entity TODO: Why do we need validators at the {@link MappingContext}?
*
* @param entity The entity
* @return A validator or null if none exists for the given entity
*/
List<Validator> getEntityValidators(E entity);
}