com.ibm.are.xml.check
Class Check

java.lang.Object
  extended by com.ibm.are.xml.check.Check

public abstract class Check
extends java.lang.Object

The Check class is the base class for all check operations. It also defines, for use by external classes, all of the check operations that are supported.

Author:
IBM

Field Summary
static java.lang.String BLANK_STRING
          String that represents a zero length Java string
static java.lang.String CHECK_TYPE_AFTER
          The actual date must be after (in time) the expected date.
static java.lang.String CHECK_TYPE_ALWAYS_FALSE
          A check that unconditionally evaluates to false.
static java.lang.String CHECK_TYPE_ALWAYS_TRUE
          A check that unconditionally evaluates to true.
static java.lang.String CHECK_TYPE_BEFORE
          The actual date must be before (in time) the expected date.
static java.lang.String CHECK_TYPE_BETWEEN
          The actual date must be between the expected date range.
static java.lang.String CHECK_TYPE_CONTAINS
          The actual value must be a superset of the expected value.
static java.lang.String CHECK_TYPE_CONTAINS_SUBSTRING
          At least one actual value must contain a substring that matches at least one expected value
static java.lang.String CHECK_TYPE_DOES_NOT_CONTAIN
          At least one element in the expected value set is NOT contained in the actual value set.
static java.lang.String CHECK_TYPE_DOES_NOT_CONTAIN_SUBSTRING
          Each actual value must not contain a substring that matches any expected value
static java.lang.String CHECK_TYPE_DOES_NOT_END_WITH
          Each actual value must not end with any expected value
static java.lang.String CHECK_TYPE_DOES_NOT_EQUAL
          The actual value must not equal the expected value.
static java.lang.String CHECK_TYPE_DOES_NOT_EXCLUDE
          The value set must contain at least one value in the expected value set.
static java.lang.String CHECK_TYPE_DOES_NOT_EXIST
          The actual value must NOT exist; it must be empty
static java.lang.String CHECK_TYPE_DOES_NOT_START_WITH
          Each actual value must not start with any expected value
static java.lang.String CHECK_TYPE_ENDS_WITH
          Each actual value must end with at least one expected value
static java.lang.String CHECK_TYPE_EQUALS
          The actual value must equal the expected value.
static java.lang.String CHECK_TYPE_EXCLUDES
          The actual value must NOT contain any expected value.
static java.lang.String CHECK_TYPE_EXISTS
          The actual value must exist and not be empty
static java.lang.String CHECK_TYPE_GREATER_THAN
          The actual value must be greater than the expected value range.
static java.lang.String CHECK_TYPE_IN
          The actual value must be a sub set of the expected value.
static java.lang.String CHECK_TYPE_IN_RANGE
          The actual value must be within the expected value range, including boundary.
static java.lang.String CHECK_TYPE_LESS_THAN
          The actual value must be less than the expected value range.
static java.lang.String CHECK_TYPE_NOT_BETWEEN
          The actual date must NOT be between the expected date range.
static java.lang.String CHECK_TYPE_NOT_IN
          The actual value must have no intersection with the expected value.
static java.lang.String CHECK_TYPE_NOT_IN_RANGE
          The actual value must NOT be within the expected value range, including boundary.
static java.lang.String CHECK_TYPE_REPORT_ONLY
          Report the actual value in the report.
static java.lang.String CHECK_TYPE_STARTS_WITH
          Each actual value must start with at least one expected value
static java.lang.String COPYRIGHT
          Copyright for class bytecode
static java.lang.String NULL_STRING
          String that represents a null Java string
 
Method Summary
abstract  boolean apply(java.lang.Object actualValue)
          Compares the expected and actual values based on the check type.
 java.lang.String formattedExpectedValue()
          Retrieves a formatted description of the expected value.
static java.lang.String formatValue(java.lang.Object valueToFormat)
          Takes any value and formats into a nicely displayable way.
abstract  java.lang.String getCheckName()
          Retrieves a descriptive name of the check operation
 java.lang.Object getExpectedValue()
          Retrieves the expected value associated with this check
 java.lang.String getFormattedDescription(java.lang.Object actualValue)
          Retrieves a formatted description of the entire check operation.
abstract  java.lang.String getOkDescription()
          Gets a description of the check result when the expected and actual values matched.
abstract  java.lang.String getProblemDescription()
          Gets a description of the check result when the expected and actual values did not match.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
Copyright for class bytecode

See Also:
Constant Field Values

BLANK_STRING

public static final java.lang.String BLANK_STRING
String that represents a zero length Java string

See Also:
Constant Field Values

NULL_STRING

public static final java.lang.String NULL_STRING
String that represents a null Java string

See Also:
Constant Field Values

CHECK_TYPE_EXISTS

public static final java.lang.String CHECK_TYPE_EXISTS
The actual value must exist and not be empty

Applies to: String, Number, Date

See Also:
Constant Field Values

CHECK_TYPE_DOES_NOT_EXIST

public static final java.lang.String CHECK_TYPE_DOES_NOT_EXIST
The actual value must NOT exist; it must be empty

Applies to: String, Number, Date

See Also:
Constant Field Values

CHECK_TYPE_EQUALS

public static final java.lang.String CHECK_TYPE_EQUALS
The actual value must equal the expected value.

Applies to: String, Number, Date

Examples:

See Also:
Constant Field Values

CHECK_TYPE_DOES_NOT_EQUAL

public static final java.lang.String CHECK_TYPE_DOES_NOT_EQUAL
The actual value must not equal the expected value.

Applies to: String, Number, Date

Examples:

See Also:
Constant Field Values

CHECK_TYPE_IN

public static final java.lang.String CHECK_TYPE_IN
The actual value must be a sub set of the expected value.

The intersection of the actual value set and the expected value set must equal the actual value set.

Applies to: String, Number

Examples:

See Also:
Constant Field Values

CHECK_TYPE_NOT_IN

public static final java.lang.String CHECK_TYPE_NOT_IN
The actual value must have no intersection with the expected value.

The intersection of the actual value set and expected value set must be an empty set.

Applies to: String, Number

Examples:

See Also:
Constant Field Values

CHECK_TYPE_CONTAINS

public static final java.lang.String CHECK_TYPE_CONTAINS
The actual value must be a superset of the expected value.

The intersection of the actual value set and the expected value set must equal the expected value set.

Applies to: String, Number

Examples:

See Also:
Constant Field Values

CHECK_TYPE_DOES_NOT_CONTAIN

public static final java.lang.String CHECK_TYPE_DOES_NOT_CONTAIN
At least one element in the expected value set is NOT contained in the actual value set.

Applies to: String, Number

Examples:

See Also:
Constant Field Values

CHECK_TYPE_EXCLUDES

public static final java.lang.String CHECK_TYPE_EXCLUDES
The actual value must NOT contain any expected value.

The intersection of the actual value set and the expected value set must be an empty set.

Applies to: String, Number

Examples:

See Also:
Constant Field Values

CHECK_TYPE_DOES_NOT_EXCLUDE

public static final java.lang.String CHECK_TYPE_DOES_NOT_EXCLUDE
The value set must contain at least one value in the expected value set.

The intersection of the two set must NOT be empty.

Applies to: String, Number

Examples:

See Also:
Constant Field Values

CHECK_TYPE_STARTS_WITH

public static final java.lang.String CHECK_TYPE_STARTS_WITH
Each actual value must start with at least one expected value

Applies to: String

Examples:

See Also:
Constant Field Values

CHECK_TYPE_DOES_NOT_START_WITH

public static final java.lang.String CHECK_TYPE_DOES_NOT_START_WITH
Each actual value must not start with any expected value

Applies to: String

Examples:

See Also:
Constant Field Values

CHECK_TYPE_ENDS_WITH

public static final java.lang.String CHECK_TYPE_ENDS_WITH
Each actual value must end with at least one expected value

Applies to: String

Examples:

See Also:
Constant Field Values

CHECK_TYPE_DOES_NOT_END_WITH

public static final java.lang.String CHECK_TYPE_DOES_NOT_END_WITH
Each actual value must not end with any expected value

Applies to: String

Examples:

See Also:
Constant Field Values

CHECK_TYPE_CONTAINS_SUBSTRING

public static final java.lang.String CHECK_TYPE_CONTAINS_SUBSTRING
At least one actual value must contain a substring that matches at least one expected value

Applies to: String

Examples:

See Also:
Constant Field Values

CHECK_TYPE_DOES_NOT_CONTAIN_SUBSTRING

public static final java.lang.String CHECK_TYPE_DOES_NOT_CONTAIN_SUBSTRING
Each actual value must not contain a substring that matches any expected value

Applies to: String

Examples:

See Also:
Constant Field Values

CHECK_TYPE_IN_RANGE

public static final java.lang.String CHECK_TYPE_IN_RANGE
The actual value must be within the expected value range, including boundary.

Applies to: Number

Examples:

See Also:
Constant Field Values

CHECK_TYPE_NOT_IN_RANGE

public static final java.lang.String CHECK_TYPE_NOT_IN_RANGE
The actual value must NOT be within the expected value range, including boundary.

Applies to: Number

Examples:

See Also:
Constant Field Values

CHECK_TYPE_LESS_THAN

public static final java.lang.String CHECK_TYPE_LESS_THAN
The actual value must be less than the expected value range.

Applies to: Number

Examples:

See Also:
Constant Field Values

CHECK_TYPE_GREATER_THAN

public static final java.lang.String CHECK_TYPE_GREATER_THAN
The actual value must be greater than the expected value range.

Applies to: Number

Examples:

See Also:
Constant Field Values

CHECK_TYPE_BETWEEN

public static final java.lang.String CHECK_TYPE_BETWEEN
The actual date must be between the expected date range.

Applies to: Date

See Also:
Constant Field Values

CHECK_TYPE_NOT_BETWEEN

public static final java.lang.String CHECK_TYPE_NOT_BETWEEN
The actual date must NOT be between the expected date range.

Applies to: Date

See Also:
Constant Field Values

CHECK_TYPE_BEFORE

public static final java.lang.String CHECK_TYPE_BEFORE
The actual date must be before (in time) the expected date.

Applies to: Date

See Also:
Constant Field Values

CHECK_TYPE_AFTER

public static final java.lang.String CHECK_TYPE_AFTER
The actual date must be after (in time) the expected date.

Applies to: Date

See Also:
Constant Field Values

CHECK_TYPE_REPORT_ONLY

public static final java.lang.String CHECK_TYPE_REPORT_ONLY
Report the actual value in the report. Do not do any check.

See Also:
Constant Field Values

CHECK_TYPE_ALWAYS_TRUE

public static final java.lang.String CHECK_TYPE_ALWAYS_TRUE
A check that unconditionally evaluates to true.

See Also:
Constant Field Values

CHECK_TYPE_ALWAYS_FALSE

public static final java.lang.String CHECK_TYPE_ALWAYS_FALSE
A check that unconditionally evaluates to false.

See Also:
Constant Field Values
Method Detail

getExpectedValue

public java.lang.Object getExpectedValue()
Retrieves the expected value associated with this check

Returns:
The expected value associated with this check

apply

public abstract boolean apply(java.lang.Object actualValue)
Compares the expected and actual values based on the check type.

Parameters:
actualValue - The actual value, which is compared to the expected value
Returns:
true if the expected and actual values match when compared using the rules associated with the check type.

getOkDescription

public abstract java.lang.String getOkDescription()
Gets a description of the check result when the expected and actual values matched.

Returns:
A description of the check result when the expected and actual values matched.

getProblemDescription

public abstract java.lang.String getProblemDescription()
Gets a description of the check result when the expected and actual values did not match.

Returns:
A description of the check result when the expected and actual values did not match.

getCheckName

public abstract java.lang.String getCheckName()
Retrieves a descriptive name of the check operation

Returns:
A descriptive name of the check operation

getFormattedDescription

public java.lang.String getFormattedDescription(java.lang.Object actualValue)
Retrieves a formatted description of the entire check operation. This includes formatted the expected and actual values, along with a description of the check operation that was performed between those two values.

Parameters:
actualValue - The actual value
Returns:
A formatted descriptoin of the entire check operation

formattedExpectedValue

public java.lang.String formattedExpectedValue()
Retrieves a formatted description of the expected value.

Returns:
A formatted description of the expected value.

formatValue

public static java.lang.String formatValue(java.lang.Object valueToFormat)
Takes any value and formats into a nicely displayable way. Includes dealing with lists of values.

Parameters:
valueToFormat - The value to format
Returns:
A nicely formatted, ready to display value