com.opensymphony.module.sitemesh.html.tokenizer
Class TagTokenizer

java.lang.Object
  extended by com.opensymphony.module.sitemesh.html.tokenizer.TagTokenizer

public class TagTokenizer
extends java.lang.Object

Splits a chunk of HTML into 'text' and 'tag' tokens, for easy processing. Is VERY tolerant to badly formed HTML.

Usage

You need to supply a custom TokenHandler that will receive callbacks as text and tags are processed.

char[] input = ...;
 HTMLTagTokenizer tokenizer = new HTMLTagTokenizer(input);
 TokenHandler handler = new MyTokenHandler();
 tokenizer.start(handler);

Author:
Joe Walnes
See Also:
TokenHandler, HTMLPageParser

Field Summary
private  char[] input
           
 
Constructor Summary
TagTokenizer(char[] input)
           
TagTokenizer(java.lang.String input)
           
 
Method Summary
 void start(TokenHandler handler)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

input

private final char[] input
Constructor Detail

TagTokenizer

public TagTokenizer(char[] input)

TagTokenizer

public TagTokenizer(java.lang.String input)
Method Detail

start

public void start(TokenHandler handler)

www.opensymphony.com/sitemesh/