Class AbstractMarkupFilter

    • Constructor Detail

      • AbstractMarkupFilter

        public AbstractMarkupFilter()
        Construct.
    • Method Detail

      • getNextFilter

        public IMarkupFilter getNextFilter()
        Description copied from interface: IMarkupFilter
        IMarkupFilters are usually chained with the last filter retrieving the elements from the XML parser.
        Specified by:
        getNextFilter in interface IMarkupFilter
        Returns:
        The next MarkupFilter in the chain
      • setNextFilter

        public void setNextFilter​(IMarkupFilter parent)
        Set new parent.
        Specified by:
        setNextFilter in interface IMarkupFilter
        Parameters:
        parent - The parent of this component The next element in the chain
      • nextElement

        public MarkupElement nextElement()
                                  throws ParseException
        Get the next xml element from the markup. If eof, than retun null. Ignore raw markup. Invoke nextTag(tag) if a tag was found.
        Specified by:
        nextElement in interface IMarkupFilter
        Returns:
        Return the next eligible MarkupElement. Null, if no more found.
        Throws:
        ParseException
      • onComponentTag

        protected abstract MarkupElement onComponentTag​(ComponentTag tag)
                                                 throws ParseException
        Invoked when a ComponentTag was found.

        By default this method is also called for WicketTags.

        Parameters:
        tag -
        Returns:
        Usually the same as the tag attribute
        Throws:
        ParseException
      • onSpecialTag

        protected MarkupElement onSpecialTag​(HtmlSpecialTag tag)
                                      throws ParseException
        Invoked when a tags (e.g. DOCTYPE, PROCESSING_INSTRUCTIION, etc. which have been identified as special tags by the xml parser.
        Parameters:
        tag -
        Returns:
        Usually the same as the tag attribute
        Throws:
        ParseException
      • getWicketNamespace

        protected String getWicketNamespace()
        Extracts the markup namespace from the MarkupResourceStream passed at creation time.

        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).

        Returns:
        the namespace of the loaded markup
      • getWicketNamespace

        protected String getWicketNamespace​(MarkupStream markupStream)
        Extracts the markup namespace from the passed MarkupStream if available, or from the MarkupResourceStream passed at creation time.

        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).

        Parameters:
        markupStream - the markup stream
        Returns:
        namespace extracted from the markup
      • getRequestUniqueId

        protected int getRequestUniqueId()
        Returns an id using the request-relative counter associated with the underlying MarkupResourceStream's owner container (see MarkupResourceStream.getContainerInfo()). This can be useful for autocomponent tags that need to get a tag id.
        Returns:
        the request-relative id