org.springmodules.validation.util.condition.common
Class InstanceOfCondition

java.lang.Object
  extended by org.springmodules.validation.util.condition.AbstractCondition
      extended by org.springmodules.validation.util.condition.common.InstanceOfCondition
All Implemented Interfaces:
Condition

public class InstanceOfCondition
extends AbstractCondition

A condition that checks whether the checked object is of a specific type.

Author:
Uri Boness

Constructor Summary
InstanceOfCondition(Class clazz)
          Constructs a new InstanceOfCondition with a given class the checked object will be checked against.
 
Method Summary
 boolean doCheck(Object object)
          Checks whether the given object is an instance of the class associated with this condition.
 Class getClazz()
          Returns the class associated with this condition.
 
Methods inherited from class org.springmodules.validation.util.condition.AbstractCondition
afterObjectChecked, and, beforeObjectChecked, check, or
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InstanceOfCondition

public InstanceOfCondition(Class clazz)
Constructs a new InstanceOfCondition with a given class the checked object will be checked against.

Parameters:
clazz - The class the checked object will be checked against.
Method Detail

doCheck

public boolean doCheck(Object object)
Checks whether the given object is an instance of the class associated with this condition.

Specified by:
doCheck in class AbstractCondition
Parameters:
object - The object to be checked.
Returns:
true if the given object is an instance of the class associated with this condition, false otherwise. Note: if the given object is null, false will be returned.

getClazz

public Class getClazz()
Returns the class associated with this condition.

Returns:
The class associated with this condition.


Copyright © 2009. All Rights Reserved.