de.smartics.properties.spi.core.validate
Class PropertyValidator

Package class diagram package PropertyValidator
java.lang.Object
  extended by de.smartics.properties.spi.core.validate.PropertyValidator
All Implemented Interfaces:
Serializable

public class PropertyValidator
     
     
extends Object
implements Serializable

Helper to validate constraints.

See Also:
Serialized Form

Constructor Summary
PropertyValidator(boolean adminMode)
          Default constructor.
 
Method Summary
 void validate(PropertyDescriptor descriptor, Object value, Class<?>... groups)
          Validates if the given value meets the constraints defined by the given descriptor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyValidator

public PropertyValidator(boolean adminMode)
Default constructor.

Parameters:
adminMode - the switch to turn validation into administration mode.
Method Detail

validate

public final void validate(PropertyDescriptor descriptor,
                           Object value,
                           Class<?>... groups)
                    throws PropertyValidationException
Validates if the given value meets the constraints defined by the given descriptor.

Parameters:
descriptor - the descriptor whose constraints are required to be met.
value - the value to check.
groups - the validation only takes place for the given groups.
Throws:
PropertyValidationException - if at least on constraint is not met.


Copyright © 2012-2013 Kronseder & Reiner GmbH - smartics. All Rights Reserved.