com.iparelan.util.validation
Class NonNullValidationStrategy<T>

java.lang.Object
  extended by com.iparelan.util.UtilObject
      extended by com.iparelan.util.validation.AbstractValidationStrategy<T>
          extended by com.iparelan.util.validation.NonNullValidationStrategy<T>
All Implemented Interfaces:
ValidationStrategy<T>
Direct Known Subclasses:
BeanTools.NonNullPropertyChangeEventValidator, NonNullObjectValidationStrategy

@Immutable
@Copyright(value="Copyright © 2008, Iparelan Solutions, LLC. All rights reserved.")
public class NonNullValidationStrategy<T>
extends AbstractValidationStrategy<T>

A validator that ensures an object of some arbitrary type is not null.

Version:
July 2008
Author:
Greg Mattes

Nested Class Summary
 
Nested classes/interfaces inherited from class com.iparelan.util.validation.AbstractValidationStrategy
AbstractValidationStrategy.ContextIndex
 
Field Summary
 
Fields inherited from class com.iparelan.util.validation.AbstractValidationStrategy
valueDescription
 
Fields inherited from class com.iparelan.util.UtilObject
LOGGER, MSGS, UTILITIES_LOGGER_NAME
 
Fields inherited from interface com.iparelan.util.validation.ValidationStrategy
BIG_DECIMAL_RANGE, BIG_INTEGER_RANGE, BYTE_RANGE, CALENDAR_RANGE, CHARACTER_RANGE, DATE_RANGE, DOUBLE_RANGE, FILE, FLOAT_RANGE, GREGORIAN_CALENDAR_RANGE, INTEGER, INTEGER_RANGE, LONG_RANGE, NON_EMPTY_STRING, NON_NULL_CLASS, NON_NULL_NON_EMPTY_STRING, NON_NULL_OBJECT, NON_NULL_STRING, SHORT_RANGE, SQL_DATE_RANGE, SQL_TIME_RANGE, SQL_TIMESTAMP_RANGE
 
Constructor Summary
NonNullValidationStrategy()
          Creates a new NonNullValidationStrategy.
NonNullValidationStrategy(String valueDescription)
          Creates a new NonNullValidationStrategy.
 
Method Summary
 String getValidatorDescription()
          Produces the description of this ValidationStrategy.
 void validate(T object, Object... context)
          Validates the specified value.
 
Methods inherited from class com.iparelan.util.validation.AbstractValidationStrategy
getValueDescription, getValueDescription, toString, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NonNullValidationStrategy

NonNullValidationStrategy()
Creates a new NonNullValidationStrategy.


NonNullValidationStrategy

public NonNullValidationStrategy(String valueDescription)
Creates a new NonNullValidationStrategy.

Parameters:
valueDescription - Describes the new NonNullValidationStrategy. May not be null.
Method Detail

validate

public void validate(@Nullable
                     T object,
                     Object... context)
Description copied from interface: ValidationStrategy
Validates the specified value.

Parameters:
object - The value to be validated. May not be null.
context - Any information required for, or related to, the validation of unvalidated. The semantics (including whether null-ness is permitted) of this parameter are defined by the implementations of this method. The first contextual argument is, by convention, a String containing a description of the value being validated.

getValidatorDescription

public String getValidatorDescription()
Description copied from class: AbstractValidationStrategy
Produces the description of this ValidationStrategy.

Specified by:
getValidatorDescription in class AbstractValidationStrategy<T>
Returns:
The description of this ValidationStrategy. Never null.


Copyright © 2008 Iparelan Solutions, LLC. All rights reserved.