Class AbstractLayoutFileMarkupFilter

  • All Implemented Interfaces:
    org.apache.wicket.markup.parser.IMarkupFilter
    Direct Known Subclasses:
    ELMarkupFilter, PageMarkupFilter

    public abstract class AbstractLayoutFileMarkupFilter
    extends org.apache.wicket.markup.parser.AbstractMarkupFilter
    Abstract markup filter used as base implementation used to help other implementations of markup filters for layout file.
    Since:
    6.0.0
    Version:
    $Revision: 13093 $ $Date: 2011-05-28 18:40:18 -0300 (Sat, 28 May 2011) $
    • Constructor Detail

      • AbstractLayoutFileMarkupFilter

        public AbstractLayoutFileMarkupFilter​(boolean stripLayoutFileTagsAndAttributes)
        Creates a new markup filter for processing layout file tags.
        Parameters:
        stripLayoutFileTagsAndAttributes - indicates whether layout file built-in tags and attributes are to be removed from the output.
        Since:
        6.0.0
    • Method Detail

      • isStripLayoutFileTagsAndAttributes

        protected boolean isStripLayoutFileTagsAndAttributes()
        Returns whether layout file built-in tags and attributes are to be removed from the output.
        Returns:
        true if they are to be stripped, false otherwise.
        Since:
        6.0.0
      • getNamespaceURI

        protected abstract String getNamespaceURI()
        Returns the namespace URI whose prefix will be determined to be returned by getNamespacePrefix().
        Returns:
        the namespace URI.
        Since:
        6.0.0
      • getDefaultNamespacePrefix

        protected abstract String getDefaultNamespacePrefix()
        Returns the default namespace prefix for the tags processed by this filter. This is the prefix that will be used if the namespace is not defined in the markup.
        Returns:
        the default namespace prefix.
        Since:
        6.0.0
        See Also:
        getNamespacePrefix()
      • getNamespacePrefix

        protected String getNamespacePrefix()
        Returns the namespace prefix used for getNamespaceURI() in the current markup.
        Since:
        6.0.0
      • getGenerateIdPrefix

        protected abstract String getGenerateIdPrefix()
        Returns the prefix to be used by generateId(String).
        Returns:
        the prefix.
        Since:
        6.0.0
      • generateId

        protected String generateId​(String title)
        Utility method for generating a unique identifier for a component.
        Parameters:
        title - the title for the component. Will be used as part of the identifier.
        Returns:
        the identifier.
        Since:
        6.0.0
      • pushTag

        protected void pushTag​(org.apache.wicket.markup.ComponentTag componentTag)
        Pushes a tag to a stack to be returned in the next call to nextTag().
        Parameters:
        componentTag - the tag.
        Since:
        6.0.0
      • createComponentTag

        protected org.apache.wicket.markup.ComponentTag createComponentTag​(org.apache.wicket.markup.ComponentTag base,
                                                                           String namespace,
                                                                           String name,
                                                                           org.apache.wicket.markup.parser.XmlTag.Type type)
        Creates a new component tag that can be included in the markup.
        Parameters:
        base - the base component tag, used to obtain the position to be used for the new tag.
        namespace - the namespace for the tag.
        name - the name for the tag.
        type - the type for the tag.
        Returns:
        the tag.
        Since:
        6.0.0
      • beforeProcessTag

        protected org.apache.wicket.markup.ComponentTag beforeProcessTag​(org.apache.wicket.markup.ComponentTag componentTag)
        Allow to manipulate a tag before the processTag(ComponentTag) method.
        Parameters:
        componentTag - the tag to be processed.
        Returns:
        the tag that will actually be processed.
        Since:
        6.0.0
        See Also:
        processTag(ComponentTag), afterProcessTag(ComponentTag)
      • extractAttribute

        protected String extractAttribute​(org.apache.wicket.markup.ComponentTag componentTag,
                                          String attributeName)
        Extracts an attribute from the tag. It is removed if stripLayoutFileTagsAndAttributes is true.
        Parameters:
        componentTag - the tag.
        attributeName - the attribute name, without the namespace (it will be applied automatically).
        Returns:
        the attribute value, or null if it is not present.
        Since:
        6.0.0