com.miginfocom.property
Class NullValidator<T>

java.lang.Object
  extended by com.miginfocom.property.NullValidator<T>
All Implemented Interfaces:
Validator<T>

public class NullValidator<T>
extends java.lang.Object
implements Validator<T>


Field Summary
static NullValidator ELEMENT_VALIDATOR
           
static NullValidator MAP_KEY_VALIDATOR
           
static NullValidator MAP_VALUE_VALIDATOR
           
static NullValidator VALUE_VALIDATOR
           
 
Method Summary
<T> Result<T>
validate(Result<T> previousResult, PropertyI<T> p, T value, PropertyEvent.Type type, java.lang.Integer index)
          Validates the potential setting of a new value for a property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VALUE_VALIDATOR

public static final NullValidator VALUE_VALIDATOR

ELEMENT_VALIDATOR

public static final NullValidator ELEMENT_VALIDATOR

MAP_KEY_VALIDATOR

public static final NullValidator MAP_KEY_VALIDATOR

MAP_VALUE_VALIDATOR

public static final NullValidator MAP_VALUE_VALIDATOR
Method Detail

validate

public <T> Result<T> validate(Result<T> previousResult,
                              PropertyI<T> p,
                              T value,
                              PropertyEvent.Type type,
                              java.lang.Integer index)
Description copied from interface: Validator
Validates the potential setting of a new value for a property.

Specified by:
validate in interface Validator<T>
Parameters:
previousResult - The previus result from the validator before this one. If no validator exist before this one Result.ok() will be provided. If the validation is ok this value should be returned. Never null.
p - The property that is going to recieve value.
value - The value to be set. Can be null. Should never be changed.
type - The type of value to set.
index - If the property is a CollectionProperty type that maintain element indexes this index should reflect the index of the value that was, for instance, removed.
Returns:
The result of the validation. Never null!


Copyright © 2007 MiG InfoCom AB. All Rights Reserved.