org.sitemesh.tagprocessor
Class TagProcessor

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

public class TagProcessor
extends Object

Copies a document from a source to a destination, applying rules on the way to extract content and/or transform the content.

TagRules can be added to perform the extractions/transformations.

The processor can have different rules applied to different States. A rule may switch the current state using TagProcessorContext.changeState(State).

Author:
Joe Walnes

Constructor Summary
TagProcessor(CharBuffer source)
           
 
Method Summary
 void addRule(String name, TagRule rule)
          Equivalent of TagProcessor.defaultState().addRule()
 State defaultState()
          The default state of the processor (that is, when it begins processing).
 CharSequence getDefaultBufferContents()
          Return the contents of the default buffer used during TagProcessing.
 void process()
          Process the document, applying TagRules.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TagProcessor

public TagProcessor(CharBuffer source)
Method Detail

getDefaultBufferContents

public CharSequence getDefaultBufferContents()
Return the contents of the default buffer used during TagProcessing. By default, everything will be written to this, except when new buffers are pushed on to the stack.


defaultState

public State defaultState()
The default state of the processor (that is, when it begins processing).


addRule

public void addRule(String name,
                    TagRule rule)
Equivalent of TagProcessor.defaultState().addRule()

See Also:
State.addRule(String,TagRule)

process

public void process()
             throws IOException
Process the document, applying TagRules.

Throws:
IOException


Copyright © 2011. All Rights Reserved.