Class Markup

    • Field Detail

      • NO_MARKUP

        public static final Markup NO_MARKUP
        Placeholder that indicates no markup
    • Constructor Detail

      • Markup

        public Markup​(MarkupResourceStream markupResourceStream)
        Constructor
        Parameters:
        markupResourceStream - The associated Markup
    • Method Detail

      • of

        public static Markup of​(String markup)
        Take the markup string, parse it and return the Markup (list of MarkupElements).

        Limitation: Please note that MarkupFactory is NOT used and thus no caching is used (which doesn't matter for Strings anyway), but what might matter is that your own MarkupFilters are not applied, which you might have registered with MarkupFactory.

        Parameters:
        markup - the string to use as markup
        Returns:
        Markup The parsed markup
      • of

        public static Markup of​(String markup,
                                String wicketNamespace)
        Take the markup string, parse it and return the Markup (list of MarkupElements).

        Limitation: Please note that MarkupFactory is NOT used and thus no caching is used (which doesn't matter for Strings anyway), but what might matter is that your own MarkupFilters are not applied, which you might have registered with MarkupFactory.

        Parameters:
        markup - the string to use as markup
        wicketNamespace - the namespace for Wicket elements and attributes
        Returns:
        Markup The parsed markup
      • get

        public final MarkupElement get​(int index)
        Description copied from interface: IMarkupFragment
        Get the MarkupElement at the index provided.
        Parameters:
        index - Index into markup list
        Returns:
        Markup element
      • getMarkupResourceStream

        public final MarkupResourceStream getMarkupResourceStream()
        Description copied from interface: IMarkupFragment
        Get the underlying markup resource stream, which might contain more than just the markup portion represented by the IMarkupFragment.
        Returns:
        The underlying markup resource stream
      • replace

        public final void replace​(int index,
                                  MarkupElement elem)
        Parameters:
        index -
        elem -
      • locationAsString

        public String locationAsString()
        Returns:
        The fixed location as a string, e.g. the file name or the URL. Return null to avoid caching the markup.
      • size

        public final int size()
        Description copied from interface: IMarkupFragment
        The number of markup elements.
        Returns:
        Number of markup elements
      • addMarkupElement

        public final void addMarkupElement​(int pos,
                                           MarkupElement markupElement)
        Add a MarkupElement
        Parameters:
        pos -
        markupElement -
      • makeImmutable

        public final void makeImmutable()
        Make all tags immutable and the list of elements unmodifiable.
      • find

        public final IMarkupFragment find​(String id)
        Description copied from interface: IMarkupFragment
        Finds a markup fragment that spans a tag
        Parameters:
        id - the wicket:id attribute in the tag
        Returns:
        the markup fragment that spans the complete found tag
      • toString

        public final String toString​(boolean markupOnly)
        Parameters:
        markupOnly - True, if only the markup shall be returned
        Returns:
        String