org.aitools.programd.processor
Class Processor

java.lang.Object
  extended by org.aitools.programd.processor.Processor
Direct Known Subclasses:
AIMLProcessor, BotConfigurationElementProcessor

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 process(org.w3c.dom.Element, org.aitools.programd.parser.GenericParser

) method and set label to the appropriate string.

Since:
4.1.3
Author:
Noel Bush

Field Summary
protected  Core core
          The Core to use.
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.
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(Core coreToUse)
          Creates a new Processor using the given Core.
 
Method Summary
abstract
<P extends Processor>
java.lang.String
process(org.w3c.dom.Element element, GenericParser<P> parser)
          Processes an element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

core

protected Core core
The Core to use.


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(Core coreToUse)
Creates a new Processor using the given Core.

Parameters:
coreToUse - the Core object to use
Method Detail

process

public abstract <P extends Processor> java.lang.String process(org.w3c.dom.Element element,
                                                               GenericParser<P> parser)
                                  throws ProcessorException
Processes an element.

Parameters:
element - 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