Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.alicebot.server.core.parser
Class TemplateParser  view TemplateParser download TemplateParser.java

java.lang.Object
  extended byorg.alicebot.server.core.parser.GenericParser
      extended byorg.alicebot.server.core.parser.TemplateParser

public class TemplateParser
extends GenericParser

TemplateParser is still a primitive class, implementing not a "real" XML parser, but just enough (hopefully) to get the job done.


Field Summary
private  java.lang.String botid
          The botid on whose behalf this parser is working.
private  java.util.ArrayList inputs
          The input that matched the pattern associated with this template (helps to avoid endless loops).
private  java.util.ArrayList inputStars
          The values captured from the input by wildcards in the pattern.
private  java.util.Stack stackStar
          The stack of inputStars Vector that will allow correct use of
private  java.util.ArrayList thatStars
          The values captured from the input path by wildcards in the that.
private  java.util.ArrayList topicStars
          The values captured from the input path by wildcards in the topic.
private  java.lang.String userid
          The userid for which this parser is used.
 
Fields inherited from class org.alicebot.server.core.parser.GenericParser
ATOMIC_MARKER_END, CLOSE_MARKER_START, COLON, COMMA, EMPTY_STRING, INDEX, NONATOMIC_MARKER_END, OPEN_MARKER_START, processorRegistry
 
Constructor Summary
TemplateParser(java.lang.String input, java.lang.String userid, java.lang.String botid)
          Initializes an TemplateParser.
 
Method Summary
 void addInput(java.lang.String input)
          Adds an input to the inputs list (for avoiding infinite loops).
 java.lang.String getBotID()
          Returns the botid.
 java.util.ArrayList getInputs()
          Returns the input that matched the pattern associated with this template.
 java.util.ArrayList getInputStars()
          Returns the values captured from the input path by wildcards in the pattern.
 java.util.ArrayList getThatStars()
          Returns the the values captured from the input path by wildcards in the that.
 java.util.ArrayList getTopicStars()
          Returns the values captured from the input path by wildcards in the topic name.
 java.lang.String getUserID()
          Returns the userid.
 void pop()
          Pop inputStars Vector
 java.lang.String processTag(int level, XMLNode tag)
          Processes the AIML within and including a given AIML element.
 void push()
          Push inputStars Vector
 void setInputStars(java.util.ArrayList stars)
          Sets the inputStars list.
 void setThatStars(java.util.ArrayList stars)
          Sets the thatStars list.
 void setTopicStars(java.util.ArrayList stars)
          Sets the topicStars Vector.
 
Methods inherited from class org.alicebot.server.core.parser.GenericParser
evaluate, formatTag, getNode, getValid1dIndex, getValid2dIndex, nodeCount, processResponse, shortcutTag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stackStar

private java.util.Stack stackStar
The stack of inputStars Vector that will allow correct use of


inputStars

private java.util.ArrayList inputStars
The values captured from the input by wildcards in the pattern.


thatStars

private java.util.ArrayList thatStars
The values captured from the input path by wildcards in the that.


topicStars

private java.util.ArrayList topicStars
The values captured from the input path by wildcards in the topic.


inputs

private java.util.ArrayList inputs
The input that matched the pattern associated with this template (helps to avoid endless loops).


userid

private java.lang.String userid
The userid for which this parser is used.


botid

private java.lang.String botid
The botid on whose behalf this parser is working.

Constructor Detail

TemplateParser

public TemplateParser(java.lang.String input,
                      java.lang.String userid,
                      java.lang.String botid)
               throws TemplateParserException
Initializes an TemplateParser. The input is a required parameter!

Method Detail

processTag

public java.lang.String processTag(int level,
                                   XMLNode tag)
                            throws org.alicebot.server.core.processor.ProcessorException
Processes the AIML within and including a given AIML element.

Overrides:
processTag in class GenericParser

addInput

public void addInput(java.lang.String input)
Adds an input to the inputs list (for avoiding infinite loops).


getInputs

public java.util.ArrayList getInputs()
Returns the input that matched the pattern associated with this template.


getInputStars

public java.util.ArrayList getInputStars()
Returns the values captured from the input path by wildcards in the pattern.


getThatStars

public java.util.ArrayList getThatStars()
Returns the the values captured from the input path by wildcards in the that.


getTopicStars

public java.util.ArrayList getTopicStars()
Returns the values captured from the input path by wildcards in the topic name.


setInputStars

public void setInputStars(java.util.ArrayList stars)
Sets the inputStars list.


push

public void push()
Push inputStars Vector


pop

public void pop()
Pop inputStars Vector


setThatStars

public void setThatStars(java.util.ArrayList stars)
Sets the thatStars list.


setTopicStars

public void setTopicStars(java.util.ArrayList stars)
Sets the topicStars Vector.


getUserID

public java.lang.String getUserID()
Returns the userid.


getBotID

public java.lang.String getBotID()
Returns the botid.