public class DBObjectValidationModel
extends java.lang.Object
The caching in this class is not thread safe, it is left to the caller to synchronize the addition of exceptions as needed.
| Constructor and Description | 
|---|
DBObjectValidationModel()  | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
add(ValidationException... exceptions)
Adds the given exceptions to this model. 
 | 
java.util.Collection<java.lang.String> | 
getInvalidProperties(DBObject obj)
Gets a list of the properties that are invalid on the given object. 
 | 
java.util.Collection<ValidationException> | 
getValidation(DBObject obj,
             java.lang.String prop)
Gets any ValidationExceptions that have been added against the given
 object for the given property. 
 | 
java.util.Map<java.lang.String,java.util.Collection<ValidationException>> | 
getValidationMap(DBObject obj)
Gets the validation map for the given object. 
 | 
boolean | 
isValid(DBObject obj)
Simple test of whether the given object (or its children) has any
 exceptions against it in the model. 
 | 
boolean | 
isValid(DBObject obj,
       java.lang.String prop)
Tests whether a property on the given object is valid. 
 | 
public void add(ValidationException... exceptions)
exceptions - the exceptions to addpublic java.util.Map<java.lang.String,java.util.Collection<ValidationException>> getValidationMap(DBObject obj)
obj - the object to querypublic boolean isValid(DBObject obj)
obj - the object to testpublic java.util.Collection<java.lang.String> getInvalidProperties(DBObject obj)
public boolean isValid(DBObject obj, java.lang.String prop)
obj - the object to testprop - the property to testpublic java.util.Collection<ValidationException> getValidation(DBObject obj, java.lang.String prop)
obj - the object to testprop - the property (or property path) to test