Class AbstractMarkupParser

java.lang.Object
org.apache.wicket.markup.AbstractMarkupParser
Direct Known Subclasses:
MarkupParser

public abstract class AbstractMarkupParser extends Object
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.

Author:
Jonathan Locke, Juergen Donnerstag
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • getMarkupFilters

      Returns:
      Gets the list of markup filters
    • setWicketNamespace

      public final void setWicketNamespace(String namespace)
      In case you want to analyze markup which BY DEFAULT does not use "wicket" to find relevant tags.
      Parameters:
      namespace -
    • getMarkupResourceStream

      Applications which subclass initFilterChain() might also wish to access the markup resource stream.
      Returns:
      The markup resource stream
    • initializeMarkupFilters

      protected abstract List<IMarkupFilter> initializeMarkupFilters(Markup markup)
      Create a new markup filter chain and initialize with all default filters required.
      Parameters:
      markup -
      Returns:
      The list of markup filters to be considered by the markup parser
    • parse

      public final Markup parse() throws IOException, org.apache.wicket.util.resource.ResourceStreamNotFoundException
      Reads and parses markup from a file.
      Returns:
      The markup
      Throws:
      IOException
      org.apache.wicket.util.resource.ResourceStreamNotFoundException
    • postProcess

      protected void postProcess(Markup markup)
      Parameters:
      markup -
    • handleRawText

      protected CharSequence handleRawText(String rawMarkup)
      Parameters:
      rawMarkup -
      Returns:
      The modified raw markup
    • compressWhitespace

      protected String compressWhitespace(String rawMarkup)
      Remove whitespace from the raw markup
      Parameters:
      rawMarkup -
      Returns:
      rawMarkup
    • toString

      public String toString()
      Overrides:
      toString in class Object
      See Also: