org.alicebot.server.core.processor
Class ConditionProcessor

java.lang.Object
  extended by org.alicebot.server.core.processor.Processor
      extended by org.alicebot.server.core.processor.AIMLProcessor
          extended by org.alicebot.server.core.processor.ConditionProcessor

public class ConditionProcessor
extends AIMLProcessor

Handles a condition element.

Version:
4.1.4
Author:
Jon Baer, Thomas Ringate, Pedro Colla, Noel Bush

Field Summary
static int DEFAULT_LI
          A defaultListItem in a <condition/>.
static java.lang.String label
           
static int NAME_VALUE_LI
          A nameValueListItem in a <condition/>.
static int VALUE_ONLY_LI
          A valueOnlyListItem in a <condition/>.
 
Fields inherited from class org.alicebot.server.core.processor.Processor
EMPTY_STRING, ENABLED, ID, NAME, NAME_EQUALS, VALUE, VALUE_EQUALS
 
Constructor Summary
ConditionProcessor()
           
 
Method Summary
 java.lang.String process(int level, XMLNode tag, TemplateParser parser)
           
 java.lang.String processListItem(int level, TemplateParser parser, java.util.LinkedList list, int listItemType, java.lang.String name, java.lang.String value)
          Evaluates an <li/> element inside a <condition/>.
 
Methods inherited from class org.alicebot.server.core.processor.AIMLProcessor
process
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME_VALUE_LI

public static final int NAME_VALUE_LI
A nameValueListItem in a <condition/>.

See Also:
Constant Field Values

DEFAULT_LI

public static final int DEFAULT_LI
A defaultListItem in a <condition/>.

See Also:
Constant Field Values

VALUE_ONLY_LI

public static final int VALUE_ONLY_LI
A valueOnlyListItem in a <condition/>.

See Also:
Constant Field Values

label

public static final java.lang.String label
See Also:
Constant Field Values
Constructor Detail

ConditionProcessor

public ConditionProcessor()
Method Detail

process

public java.lang.String process(int level,
                                XMLNode tag,
                                TemplateParser parser)
                         throws AIMLProcessorException
Specified by:
process in class AIMLProcessor
Throws:
AIMLProcessorException

processListItem

public java.lang.String processListItem(int level,
                                        TemplateParser parser,
                                        java.util.LinkedList list,
                                        int listItemType,
                                        java.lang.String name,
                                        java.lang.String value)
Evaluates an <li/> element inside a <condition/>.

Parameters:
level - the level we're at in the XML trie
parser - the TemplateParser object responsible for this
list - the XML trie
listItemType - one of NAME_VALUE_LI, DEFAULT_LI or VALUE_ONLY_LI
name - the name attribute of the <li/> (if applicable)
value - the value attribute of the <li/> (if applicable)
Returns:
the result of processing this <li/>