de.dbsystems.simplescrape
Class TextToken

java.lang.Object
  extended by de.dbsystems.simplescrape.AbstractHTMLToken
      extended by de.dbsystems.simplescrape.TextToken
Direct Known Subclasses:
RegExTextToken

public class TextToken
extends AbstractHTMLToken

Represents tokens containing text data in an HTML-file. This is all data outside of tags and comments. Tokens can span multiple words, sentences and lines.

Since:
04.04.2007
Author:
Ronald Bieber, DB Systems GmbH

Constructor Summary
TextToken(java.lang.String text)
          Creates a new TextToken, initializing it with the provided text.
 
Method Summary
 java.lang.String getText()
          Returns the text-content of this token.
 boolean match(AbstractHTMLToken other, ScrapeOptions options)
          Determines whether two tokens match.
 java.lang.String toString()
          Returns the text-content of this token.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TextToken

public TextToken(java.lang.String text)
Creates a new TextToken, initializing it with the provided text.

Parameters:
text - The text this token is supposed to hold.
Method Detail

getText

public java.lang.String getText()
Returns the text-content of this token.

Returns:
The text token, or null, if none has been set.

toString

public java.lang.String toString()
Returns the text-content of this token. Unlike than with other children of HtmlToken, this is the same as calling

Overrides:
toString in class java.lang.Object
Returns:
The text token, or null, if none has been set.
See Also:
getText()

match

public boolean match(AbstractHTMLToken other,
                     ScrapeOptions options)
Description copied from class: AbstractHTMLToken
Determines whether two tokens match.

Specified by:
match in class AbstractHTMLToken
Parameters:
other - The search-HtmlToken to be tested against.
options - A set of options. Relevant options are attributesStrict, trimText and ignoreCase.
Returns:
true: The two elements match, false: they don't (duh!)