org.apache.wicket.markup.parser
Class AbstractMarkupFilter

java.lang.Object
  extended by org.apache.wicket.markup.parser.AbstractMarkupFilter
All Implemented Interfaces:
IMarkupFilter
Direct Known Subclasses:
AutoLabelTagHandler, ConditionalCommentFilter, EnclosureHandler, HeadForceTagIdHandler, HtmlHandler, HtmlHeaderSectionHandler, HtmlProblemFinder, InlineEnclosureHandler, OpenCloseTagExpander, RelativePathPrefixHandler, RootMarkupFilter, StyleAndScriptIdentifier, WicketLinkTagHandler, WicketMessageTagHandler, WicketNamespaceHandler, WicketRemoveTagHandler, WicketTagIdentifier

public abstract class AbstractMarkupFilter
extends java.lang.Object
implements IMarkupFilter

Base class for markup filters

Author:
Jonathan Locke, Juergen Donnerstag

Constructor Summary
AbstractMarkupFilter()
          Construct.
 
Method Summary
 IMarkupFilter getNextFilter()
          IMarkupFilters are usually chained with the last filter retrieving the elements from the XML parser.
 MarkupElement nextElement()
          Get the next xml element from the markup.
protected abstract  MarkupElement onComponentTag(ComponentTag tag)
          Invoked when a ComponentTag was found.
protected  MarkupElement onSpecialTag(HtmlSpecialTag tag)
          Invoked when a tags (e.g.
 void postProcess(Markup markup)
          Called after all filters have been processed.
 void setNextFilter(IMarkupFilter parent)
          Set new parent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractMarkupFilter

public AbstractMarkupFilter()
Construct.

Method Detail

getNextFilter

public IMarkupFilter getNextFilter()
Description copied from interface: IMarkupFilter
IMarkupFilters are usually chained with the last filter retrieving the elements from the XML parser.

Specified by:
getNextFilter in interface IMarkupFilter
Returns:
The next MarkupFilter in the chain

setNextFilter

public void setNextFilter(IMarkupFilter parent)
Set new parent.

Specified by:
setNextFilter in interface IMarkupFilter
Parameters:
parent - The parent of this component The next element in the chain

nextElement

public MarkupElement nextElement()
                          throws java.text.ParseException
Get the next xml element from the markup. If eof, than retun null. Ignore raw markup. Invoke nextTag(tag) if a tag was found.

Specified by:
nextElement in interface IMarkupFilter
Returns:
Return the next eligible MarkupElement. Null, if no more found.
Throws:
java.text.ParseException

onComponentTag

protected abstract MarkupElement onComponentTag(ComponentTag tag)
                                         throws java.text.ParseException
Invoked when a ComponentTag was found.

By default this method is also called for WicketTags.

Parameters:
tag -
Returns:
Usually the same as the tag attribute
Throws:
java.text.ParseException

onSpecialTag

protected MarkupElement onSpecialTag(HtmlSpecialTag tag)
                              throws java.text.ParseException
Invoked when a tags (e.g. DOCTYPE, PROCESSING_INSTRUCTIION, etc. which have been identified as special tags by the xml parser.

Parameters:
tag -
Returns:
Usually the same as the tag attribute
Throws:
java.text.ParseException

postProcess

public void postProcess(Markup markup)
Description copied from interface: IMarkupFilter
Called after all filters have been processed.

Specified by:
postProcess in interface IMarkupFilter


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.