Class SyntaxType

  • All Implemented Interfaces:
    Comparable<SyntaxType>

    public class SyntaxType
    extends Object
    implements Comparable<SyntaxType>
    A syntax type is made of three parts:
    • a base syntax type (e.g. xwiki, confluence, mediawiki, etc).
    • zero or more variants, which represent Syntax type variations. For example the markdown syntax has the commonmark variant and the github variant.
    • a human-readable name (e.g. XWiki, Confluence, MediaWiki).
    The syntax type string format is: <base type>[+<variant>]*. Examples:
    • xwiki
    • markdown+commonmark
    • sometype+variant1+...+variantN
    Since:
    2.0RC1
    Version:
    $Id: 793b8a3ac794c2e2555448137370578461419e5a $
    • Field Detail

      • XWIKI

        public static final SyntaxType XWIKI
        XWiki wiki syntax.
      • CONFLUENCE

        public static final SyntaxType CONFLUENCE
        Confluence wiki syntax.
      • CONFLUENCEXHTML

        public static final SyntaxType CONFLUENCEXHTML
        Confluence XHTML based syntax.
        Since:
        5.3M1
      • MEDIAWIKI

        public static final SyntaxType MEDIAWIKI
        MediaWiki wiki syntax.
      • DOKUWIKI

        public static final SyntaxType DOKUWIKI
        DokuWiki wiki syntax.
        Since:
        9.8RC1
      • CREOLE

        public static final SyntaxType CREOLE
        Creole wiki syntax.
      • JSPWIKI

        public static final SyntaxType JSPWIKI
        JSPWiki wiki syntax.
      • TWIKI

        public static final SyntaxType TWIKI
        TWiki wiki syntax.
      • XHTML

        public static final SyntaxType XHTML
        XHTML syntax.
      • ANNOTATED_XHTML

        public static final SyntaxType ANNOTATED_XHTML
        Annotated XHTML syntax.
      • ANNOTATED_HTML

        public static final SyntaxType ANNOTATED_HTML
        Annotated HTML syntax.
      • HTML

        public static final SyntaxType HTML
        HTML syntaxes.
      • HTML_FAMILY_TYPES

        @Unstable
        public static final Set<SyntaxType> HTML_FAMILY_TYPES
        Syntaxes that are from the HTML family.
        Since:
        13.9RC1
      • PLAIN

        public static final SyntaxType PLAIN
        Plain text syntax.
      • EVENT

        public static final SyntaxType EVENT
        Events syntax.
      • TEX

        public static final SyntaxType TEX
        TEX syntax.
      • DOCBOOK

        public static final SyntaxType DOCBOOK
        DoxBook syntax.
      • XDOMXML

        public static final SyntaxType XDOMXML
        XML based XWiki DOM syntax.
        Since:
        3.3M1
      • MARKDOWN

        public static final SyntaxType MARKDOWN
        MarkDown wiki syntax.
        Since:
        3.4M1
      • APT

        public static final SyntaxType APT
        APT syntax.
        Since:
        4.3M1
    • Constructor Detail

      • SyntaxType

        public SyntaxType​(String id,
                          String name)
        Parameters:
        id - the technical id of the Syntax type (ex "annotatedxhtml")
        name - the human readable name of the Syntax type (ex "Annotated XHTML")
        Since:
        2.0M3
      • SyntaxType

        public SyntaxType​(String id,
                          List<String> variants,
                          String name)
        Parameters:
        id - the technical id of the Syntax type (ex "annotatedxhtml")
        name - the human readable name of the Syntax type (ex "Annotated XHTML")
        variants - the variants (can be empty or null)
        Since:
        13.0, 12.10.1
    • Method Detail

      • getId

        public String getId()
        Returns:
        the technical id of the Syntax type (ex "annotatedxhtml")
        Since:
        2.0M3
      • getVariants

        public List<String> getVariants()
        Returns:
        the variants (can never be null but can be empty)
        Since:
        13.0, 12.10.1
      • getName

        public String getName()
        Returns:
        the human readable name of the Syntax type (ex "Annotated XHTML")
        Since:
        2.0M3
      • toIdString

        public String toIdString()
        Returns:
        a unique String identifier, does not contain the display name. Usable when searching for parsers and renderers components for example.
        Since:
        13.0, 12.10.1
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • valueOf

        public static SyntaxType valueOf​(String syntaxTypesString)
                                  throws ParseException
        Parameters:
        syntaxTypesString - the syntax type as a string (eg xwiki, confluence+xhtml)
        Returns:
        the parsed syntax type as a SyntaxType object
        Throws:
        ParseException - in case the string doesn't represent a valid syntax type
        Since:
        13.0, 12.10.1