org.exolab.castor.xml.validators

Class BooleanValidator

public class BooleanValidator extends Object implements TypeValidator

The Boolean Validation class. This class handles validation for the boolean type. This will only check that a boolean has the proper fixed value.

Version: $Revision: 5951 $ $Date: 2003-03-03 02:57:21 -0700 (Mon, 03 Mar 2003) $

Author: Arnaud Blandin

Constructor Summary
BooleanValidator()
Creates a new BooleanValidator with no restrictions
Method Summary
voidclearFixed()
Clears the fixed value for this BooleanValidator
BooleangetFixed()
Returns the fixed value that boolean validated with this validator must be equal to.
booleanhasFixed()
Returns true if a fixed value, to validate against, has been set.
voidsetFixed(boolean fixedValue)
Sets the fixed value that boolean validated with this validator must be equal to.
voidsetFixed(Boolean fixedValue)
Sets the fixed value that boolean validated with this validator must be equal to.
voidvalidate(boolean b)
voidvalidate(Object object)
Validates the given Object.
voidvalidate(Object object, ValidationContext context)
Validates the given Object

Constructor Detail

BooleanValidator

public BooleanValidator()
Creates a new BooleanValidator with no restrictions

Method Detail

clearFixed

public void clearFixed()
Clears the fixed value for this BooleanValidator

getFixed

public Boolean getFixed()
Returns the fixed value that boolean validated with this validator must be equal to. A null value is returned if no fixed value has been specified.

Returns: the fixed value to validate against.

hasFixed

public boolean hasFixed()
Returns true if a fixed value, to validate against, has been set.

Returns: true if a fixed value has been set.

setFixed

public void setFixed(boolean fixedValue)
Sets the fixed value that boolean validated with this validator must be equal to.

Parameters: fixedValue the fixed value a boolean validated with this validator must be equal to.

setFixed

public void setFixed(Boolean fixedValue)
Sets the fixed value that boolean validated with this validator must be equal to.

Parameters: fixedValue the fixed value a boolean validated with this validator must be equal to.

validate

public void validate(boolean b)

validate

public void validate(Object object)
Validates the given Object.

Parameters: object the Object to validate

validate

public void validate(Object object, ValidationContext context)
Validates the given Object

Parameters: object the Object to validate context the ValidationContext

Intalio Inc. (C) 1999-2006. All rights reserved http://www.intalio.com