Package org.apache.wicket.markup
Class MarkupParser
- java.lang.Object
-
- org.apache.wicket.markup.AbstractMarkupParser
-
- org.apache.wicket.markup.MarkupParser
-
public class MarkupParser extends AbstractMarkupParser
This is Wicket's default markup parser. It gets pre-configured with Wicket's default wicket filters.- Author:
- Juergen Donnerstag
- See Also:
MarkupFactory
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
MarkupParser.MarkupFilterList
A simple extension to ArrayList to manage Wicket MarkupFilter's more easily
-
Field Summary
Fields Modifier and Type Field Description static String
WICKET
"wicket"-
Fields inherited from class org.apache.wicket.markup.AbstractMarkupParser
CONDITIONAL_COMMENT_OPENING
-
-
Constructor Summary
Constructors Constructor Description MarkupParser(String markup)
Constructor.MarkupParser(MarkupResourceStream resource)
Constructor.MarkupParser(IXmlPullParser xmlParser, MarkupResourceStream resource)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(IMarkupFilter filter)
Add a markup filterboolean
add(IMarkupFilter filter, Class<? extends IMarkupFilter> beforeFilter)
Add a markup filter before the 'beforeFilter'MarkupParser.MarkupFilterList
getMarkupFilters()
protected MarkupParser.MarkupFilterList
initializeMarkupFilters(Markup markup)
Initialize Wicket's MarkupParser with all necessary markup filters.protected IMarkupFilter
onAppendMarkupFilter(IMarkupFilter filter)
a) Allow subclasses to configure individual Wicket filters-
Methods inherited from class org.apache.wicket.markup.AbstractMarkupParser
compressWhitespace, getMarkupResourceStream, handleRawText, parse, postProcess, setWicketNamespace, toString
-
-
-
-
Field Detail
-
WICKET
public static final String WICKET
"wicket"- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MarkupParser
public MarkupParser(MarkupResourceStream resource)
Constructor.- Parameters:
resource
- The markup resource (file)
-
MarkupParser
public MarkupParser(String markup)
Constructor. Usually for testing purposes only- Parameters:
markup
- The markup resource.
-
MarkupParser
public MarkupParser(IXmlPullParser xmlParser, MarkupResourceStream resource)
Constructor.- Parameters:
xmlParser
- The streaming xml parser to read and parse the markupresource
- The markup resource (file)
-
-
Method Detail
-
getMarkupFilters
public MarkupParser.MarkupFilterList getMarkupFilters()
- Overrides:
getMarkupFilters
in classAbstractMarkupParser
- Returns:
- Gets the list of markup filters
-
add
public final boolean add(IMarkupFilter filter)
Add a markup filter- Parameters:
filter
-- Returns:
- true, if successful
-
add
public final boolean add(IMarkupFilter filter, Class<? extends IMarkupFilter> beforeFilter)
Add a markup filter before the 'beforeFilter'- Parameters:
filter
-beforeFilter
-- Returns:
- true, if successful
-
onAppendMarkupFilter
protected IMarkupFilter onAppendMarkupFilter(IMarkupFilter filter)
a) Allow subclasses to configure individual Wicket filtersb) Allows to disable Wicket filters via returning false
- Parameters:
filter
-- Returns:
- The filter to be added. Null to ignore.
-
initializeMarkupFilters
protected MarkupParser.MarkupFilterList initializeMarkupFilters(Markup markup)
Initialize Wicket's MarkupParser with all necessary markup filters. You may subclass this method, to add your own filters to the list.- Specified by:
initializeMarkupFilters
in classAbstractMarkupParser
- Parameters:
markup
-- Returns:
- The list of markup filter
-
-