Class WikiFormat


  • public class WikiFormat
    extends Object
    An immutable set of styles.
    Since:
    4.0M1
    Version:
    $Id: 19761654def5f0c27655741f383b88aaaf34e9f7 $
    • Method Detail

      • addStyle

        public WikiFormat addStyle​(WikiStyle style)
        Creates a new style set and adds the given style to it.
        Parameters:
        style - the style to add
        Returns:
        a new copy of the style set containing the given style
      • getClone

        protected WikiFormat getClone()
        Returns:
        a new clone of this format object
      • getTags

        public String getTags​(boolean open)
        Returns opening or closing tags corresponding to the given format(it depends on the given flag).
        Parameters:
        open - if this flag is true then this method returns opening tags for this format
        Returns:
        opening or closing tags corresponding to the given format(it depends on the given flag)
      • hasStyle

        public boolean hasStyle​(WikiStyle style)
        Parameters:
        style - the style to check
        Returns:
        true if this format has the specified style
      • removeStyle

        public WikiFormat removeStyle​(WikiStyle style)
        Creates a new style set which does not contain the specified style.
        Parameters:
        style - the style to add
        Returns:
        a new copy of the style set containing the given style
      • switchStyle

        public WikiFormat switchStyle​(WikiStyle wikiStyle)
        Creates a new format object where the specified style is switched: if this format contains the given style then the resulting format does not and vice versa.
        Parameters:
        wikiStyle - the style to switch
        Returns:
        a format object where the given style is inverted relatively to this format
      • getStyles

        public List<WikiStyle> getStyles()
        Returns:
        the list of styles in the order in which they were created