org.aitools.programd.test.aiml
Class Checker

java.lang.Object
  extended by org.aitools.programd.test.aiml.Checker
Direct Known Subclasses:
AnswerChecker, ExpectedKeywordChecker, LengthChecker, MatchChecker

public abstract class Checker
extends java.lang.Object

Performs a specific test on a given input.

Since:
4.5
Author:
Albertas Mickensas

Field Summary
static java.lang.String TAG_ALERT_KEYWORDS
          The string "".
static java.lang.String TAG_EXPECTED_ANSWER
          The string "".
static java.lang.String TAG_EXPECTED_KEYWORDS
          The string "".
static java.lang.String TAG_EXPECTED_LENGTH
          The string "".
static java.lang.String TAG_EXPECTED_MATCH
          The string "".
 
Constructor Summary
protected Checker()
          A protected constructor, for use in persistence.
 
Method Summary
static Checker create(org.w3c.dom.Element element, java.lang.String encoding)
          Creates a new Checker of the correct type based on the contents of the given XML element.
abstract  java.lang.String getContent()
           
abstract  java.lang.String getTagName()
           
abstract  boolean test(java.lang.String input)
          Determines whether the given input passes the Checker's test.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TAG_EXPECTED_ANSWER

public static java.lang.String TAG_EXPECTED_ANSWER
The string "".


TAG_EXPECTED_KEYWORDS

public static java.lang.String TAG_EXPECTED_KEYWORDS
The string "".


TAG_EXPECTED_LENGTH

public static java.lang.String TAG_EXPECTED_LENGTH
The string "".


TAG_EXPECTED_MATCH

public static java.lang.String TAG_EXPECTED_MATCH
The string "".


TAG_ALERT_KEYWORDS

public static java.lang.String TAG_ALERT_KEYWORDS
The string "".

Constructor Detail

Checker

protected Checker()
A protected constructor, for use in persistence.

Method Detail

test

public abstract boolean test(java.lang.String input)
Determines whether the given input passes the Checker's test.

Parameters:
input - the input to test
Returns:
whether the given input passes the Checker's test

create

public static Checker create(org.w3c.dom.Element element,
                             java.lang.String encoding)
Creates a new Checker of the correct type based on the contents of the given XML element.

Parameters:
element - the element from which to create the Input
encoding - the encoding of the document from which this element comes
Returns:
the created Input

getContent

public abstract java.lang.String getContent()
Returns:
the textual content of the checker

getTagName

public abstract java.lang.String getTagName()
Returns:
the tag name that the checker uses