org.sitemesh.tagprocessor
Class TagTokenizer

java.lang.Object
  extended by org.sitemesh.tagprocessor.TagTokenizer

public class TagTokenizer
extends 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 TagTokenizer.TokenHandler that will receive callbacks as text and tags are processed.

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

Author:
Joe Walnes

Nested Class Summary
 class TagTokenizer.ReusableToken
           
static class TagTokenizer.Token
           
static interface TagTokenizer.TokenHandler
          Handler that will receive callbacks as 'tags' and 'text' are encountered.
 
Constructor Summary
TagTokenizer(CharBuffer input, TagTokenizer.TokenHandler handler)
           
 
Method Summary
 void start()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TagTokenizer

public TagTokenizer(CharBuffer input,
                    TagTokenizer.TokenHandler handler)
Method Detail

start

public void start()


Copyright © 2011. All Rights Reserved.