org.erowid.sperowider
Class SperowiderCommandInterpreter

java.lang.Object
  extended byorg.erowid.sperowider.SperowiderCommandInterpreter

public class SperowiderCommandInterpreter
extends Object

This class is used to perform certain transforms to comments in HTML, if they match the Sperowider command syntax. There are currently three supported commands : include, exclude, and loadurl. Include indicates the the contents of the HTML comment should be included as HTML text. Exclude indicates that all of the HTML content between the end of the comment and the start of the next (terminating) exclude command should be removed. loadurl indicates that the contents of another URL should be inserted at this point.

It should be understood that this class does not implement this functionality, but simply interprets the command and sets values (isCommand(), isExcludeStart(), isExcludeEnd(), isInclude(), getIncludeText(), getURLs()) that can be read by the class that does the actual work. Examples will be included in this document soon.

Version:
$Header: /cvsroot/sperowider/SPEROWIDER_MODULE/javasource/org/erowid/sperowider/SperowiderCommandInterpreter.java,v 1.12 2005/06/02 06:40:53 gurustu Exp $
Author:
Stu Statman


Constructor Summary
SperowiderCommandInterpreter()
           
 
Method Summary
 String getIncludeText()
          Returns the include text corresponding to the recent include command.
 List getURLs()
          Returns the URLs contained in the recent loadurls command, if the most recent command was one.
 boolean isCommand()
          Returns true if the most recently parsed command text was an actual command, or just a regular comment.
 boolean isExcludeEnd()
          Returns true if the most recently parsed command text was an exclude-end command.
 boolean isExcludeStart()
          Returns true if the most recently parsed command text was an exclude-start command.
 boolean isInclude()
          Returns true if the most recently parsed command text was an include command.
 boolean isNoIndex()
          Returns true if a noindex tag was found.
 void setCommentText(String commentText)
          Sets the comment text, to prepare for parsing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SperowiderCommandInterpreter

public SperowiderCommandInterpreter()
Method Detail

isNoIndex

public boolean isNoIndex()
Returns true if a noindex tag was found.


isCommand

public boolean isCommand()
Returns true if the most recently parsed command text was an actual command, or just a regular comment.


isExcludeStart

public boolean isExcludeStart()
Returns true if the most recently parsed command text was an exclude-start command.


isExcludeEnd

public boolean isExcludeEnd()
Returns true if the most recently parsed command text was an exclude-end command.


isInclude

public boolean isInclude()
Returns true if the most recently parsed command text was an include command.


getIncludeText

public String getIncludeText()
Returns the include text corresponding to the recent include command.


getURLs

public List getURLs()
Returns the URLs contained in the recent loadurls command, if the most recent command was one.


setCommentText

public void setCommentText(String commentText)
Sets the comment text, to prepare for parsing.


spero logo small Sperowider is
© 2005 Erowid.org