public abstract class AbstractMarkupFilter extends Object implements IMarkupFilter
| Modifier and Type | Field and Description |
|---|---|
protected static MetaDataKey<Map<String,AtomicInteger>> |
REQUEST_COUNTER_KEY
A key for a request-relative map of counters.
|
| Constructor and Description |
|---|
AbstractMarkupFilter()
Construct.
|
AbstractMarkupFilter(MarkupResourceStream markupResourceStream) |
| Modifier and Type | Method and Description |
|---|---|
protected MarkupResourceStream |
getMarkupResourceStream() |
IMarkupFilter |
getNextFilter()
IMarkupFilters are usually chained with the last filter retrieving the elements from the XML
parser.
|
protected int |
getRequestUniqueId()
Returns an id using the request-relative counter associated with the
underlying
MarkupResourceStream's owner container
(see MarkupResourceStream.getContainerInfo()). |
protected String |
getWicketNamespace()
Extracts the markup namespace from the MarkupResourceStream
passed at creation time.
|
protected String |
getWicketNamespace(MarkupStream markupStream)
Extracts the markup namespace from the passed MarkupStream if available,
or from the MarkupResourceStream passed at creation time.
|
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.
|
protected static final MetaDataKey<Map<String,AtomicInteger>> REQUEST_COUNTER_KEY
MarkupResourceStream's owner
container (see MarkupResourceStream.getContainerInfo()),
meaning that each container has its own counter.
The counters are used by getRequestUniqueId() to get unique ids for markup tags.public AbstractMarkupFilter()
public AbstractMarkupFilter(MarkupResourceStream markupResourceStream)
public IMarkupFilter getNextFilter()
IMarkupFiltergetNextFilter in interface IMarkupFilterpublic void setNextFilter(IMarkupFilter parent)
setNextFilter in interface IMarkupFilterparent - The parent of this component The next element in the chainpublic MarkupElement nextElement() throws ParseException
nextElement in interface IMarkupFilterParseExceptionprotected abstract MarkupElement onComponentTag(ComponentTag tag) throws ParseException
By default this method is also called for WicketTags.
tag - ParseExceptionprotected MarkupElement onSpecialTag(HtmlSpecialTag tag) throws ParseException
tag - ParseExceptionpublic void postProcess(Markup markup)
IMarkupFilterpostProcess in interface IMarkupFilterprotected MarkupResourceStream getMarkupResourceStream()
protected String getWicketNamespace()
There are two versions of this method because most IMarkupFilter's
have dual personality - IMarkupFilter (one instance per MarkupParser)
and IComponentResolver (one
instance per application).
protected String getWicketNamespace(MarkupStream markupStream)
There are two versions of this method because most IMarkupFilter's
have dual personality - IMarkupFilter (one instance per MarkupParser)
and IComponentResolver (one
instance per application).
markupStream - the markup streamprotected int getRequestUniqueId()
MarkupResourceStream's owner container
(see MarkupResourceStream.getContainerInfo()).
This can be useful for autocomponent tags that need to get a tag id.Copyright © 2006–2021 Apache Software Foundation. All rights reserved.