|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.wicket.markup.AbstractMarkupParser
public abstract class AbstractMarkupParser
This is a base MarkupParser specifically for (X)HTML. It makes use of a streaming XML parser to read the markup and IMarkupFilters to remove comments, identify Wicket relevant tags, apply html specific treatments etc.. Please see WicketMarkupParser for a parser preconfigured for Wicket.
The result will be an Markup object, which is basically a list, containing Wicket relevant tags and RawMarkup.
IMarkupFilter
,
MarkupFactory
,
IMarkupSettings
Field Summary | |
---|---|
static Pattern |
CONDITIONAL_COMMENT_OPENING
Opening a conditional comment section, which is NOT treated as a comment section |
Constructor Summary | |
---|---|
AbstractMarkupParser(IXmlPullParser xmlParser,
MarkupResourceStream resource)
Constructor. |
|
AbstractMarkupParser(MarkupResourceStream resource)
Constructor. |
|
AbstractMarkupParser(String markup)
Constructor. |
Method Summary | |
---|---|
protected String |
compressWhitespace(String rawMarkup)
Remove whitespace from the raw markup |
List<IMarkupFilter> |
getMarkupFilters()
|
protected MarkupResourceStream |
getMarkupResourceStream()
Applications which subclass initFilterChain() might also wish to access the markup resource stream. |
protected CharSequence |
handleRawText(String rawMarkup)
|
protected abstract List<IMarkupFilter> |
initializeMarkupFilters(Markup markup)
Create a new markup filter chain and initialize with all default filters required. |
Markup |
parse()
Reads and parses markup from a file. |
protected void |
postProcess(Markup markup)
|
void |
setWicketNamespace(String namespace)
In case you want to analyze markup which BY DEFAULT does not use "wicket" to find relevant tags. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Pattern CONDITIONAL_COMMENT_OPENING
Constructor Detail |
---|
public AbstractMarkupParser(MarkupResourceStream resource)
resource
- The markup resource (file)public AbstractMarkupParser(String markup)
markup
- The markup resource.public AbstractMarkupParser(IXmlPullParser xmlParser, MarkupResourceStream resource)
xmlParser
- The streaming xml parser to read and parse the markupresource
- The markup resource (file)Method Detail |
---|
public List<IMarkupFilter> getMarkupFilters()
public final void setWicketNamespace(String namespace)
namespace
- protected MarkupResourceStream getMarkupResourceStream()
protected abstract List<IMarkupFilter> initializeMarkupFilters(Markup markup)
markup
-
public final Markup parse() throws IOException, ResourceStreamNotFoundException
IOException
ResourceStreamNotFoundException
protected void postProcess(Markup markup)
markup
- protected CharSequence handleRawText(String rawMarkup)
rawMarkup
-
protected String compressWhitespace(String rawMarkup)
rawMarkup
-
public String toString()
toString
in class Object
Object.toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |