org.alicebot.server.core.processor
Class Processor

java.lang.Object
  extended by org.alicebot.server.core.processor.Processor
Direct Known Subclasses:
AIMLProcessor, StartupElementProcessor

public abstract class Processor
extends java.lang.Object

A Processor is responsible for processing an element. Subclasses of this base class need only implement the #processElement method and set label to the appropriate string.

Since:
4.1.3
Author:
Noel Bush

Field Summary
protected static java.lang.String EMPTY_STRING
          An empty string, for convenience.
protected static java.lang.String ENABLED
          The string "enabled".
protected static java.lang.String ID
          The string "id", for convenience.
static java.lang.String label
          The label of a tag that this processor should process.
protected static java.lang.String NAME
          The string "name", for convenience.
protected static java.lang.String NAME_EQUALS
          The string "name=", for convenience.
protected static java.lang.String VALUE
          The string "value", for convenience.
protected static java.lang.String VALUE_EQUALS
          The string "value=", for convenience.
 
Constructor Summary
Processor()
           
 
Method Summary
abstract  java.lang.String process(int level, XMLNode tag, GenericParser parser)
          Processes an element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

label

public static final java.lang.String label
The label of a tag that this processor should process.


EMPTY_STRING

protected static final java.lang.String EMPTY_STRING
An empty string, for convenience.

See Also:
Constant Field Values

NAME

protected static final java.lang.String NAME
The string "name", for convenience.

See Also:
Constant Field Values

VALUE

protected static final java.lang.String VALUE
The string "value", for convenience.

See Also:
Constant Field Values

NAME_EQUALS

protected static final java.lang.String NAME_EQUALS
The string "name=", for convenience.

See Also:
Constant Field Values

VALUE_EQUALS

protected static final java.lang.String VALUE_EQUALS
The string "value=", for convenience.

See Also:
Constant Field Values

ID

protected static final java.lang.String ID
The string "id", for convenience.

See Also:
Constant Field Values

ENABLED

protected static final java.lang.String ENABLED
The string "enabled".

See Also:
Constant Field Values
Constructor Detail

Processor

public Processor()
Method Detail

process

public abstract java.lang.String process(int level,
                                         XMLNode tag,
                                         GenericParser parser)
                                  throws ProcessorException
Processes an element.

Parameters:
level - the starting level in the XML trie
tag - the element to process
parser - the parser calling the processor
Returns:
the result of processing the given element
Throws:
ProcessorException - if the tag or its contents are invalid