Package org.xwiki.rendering.syntax
Class Syntax
- java.lang.Object
-
- org.xwiki.rendering.syntax.Syntax
-
- All Implemented Interfaces:
Comparable<Syntax>
public class Syntax extends Object implements Comparable<Syntax>
Represents a wiki syntax that the user can use to enter wiki content. A syntax is made of three parts:- a syntax type (e.g.
xwiki,confluence,confluence+xhtml, etc). - a version (
1.0,2.0, etc. - an optional qualifier which is a free form string adding some additional information about the Syntax when serialized as a String). Can be used for example to mark a Syntax as experimental.
<type>/<version>. Examples:xwiki/2.1markdown+commonmark/1.2sometype+variant1+...+variantN/1.0
- Since:
- 2.0RC1
- Version:
- $Id: 266e59690e526f5a1638a09aadf4d0d43f7d7c4d $
-
-
Field Summary
Fields Modifier and Type Field Description static SyntaxANNOTATED_HTML_5_0This is HTML5 with annotations (comments) in order to allow round tripping between for example the WYSIWYG editor and wiki syntax.static SyntaxANNOTATED_XHTML_1_0This is HTML with annotations (comments) in order to allow round tripping between for example the WYSIWYG editor and wiki syntax.static SyntaxAPT_1_0static SyntaxCONFLUENCE_1_0Confluence wiki syntax.static SyntaxCONFLUENCEXHTML_1_0Confluence XHTML based syntax.static SyntaxCREOLE_1_0Creole syntax.static SyntaxDOCBOOK_4_4Docbook 4.4 syntax.static SyntaxDOKUWIKI_1_0DokuWiki syntax.static SyntaxEVENT_1_0Events syntax.static SyntaxHTML_4_01HTML 4.01 syntax.static SyntaxHTML_5_0HTML5 syntax.static SyntaxJSPWIKI_1_0JSPWiki syntax.static SyntaxMARKDOWN_1_0static SyntaxMARKDOWN_1_1static SyntaxMEDIAWIKI_1_0Deprecated.since 8.2RC1, useMEDIAWIKI_1_6insteadstatic SyntaxMEDIAWIKI_1_6New MediaWiki syntax.static SyntaxPLAIN_1_0Plain text syntax.static SyntaxTEX_1_0TEX syntax.static SyntaxTWIKI_1_0TWiki syntax.static SyntaxXDOMXML_1_0static SyntaxXDOMXML_CURRENTstatic SyntaxXHTML_1_0XHTML 1.0 syntax.static SyntaxXHTML_5XHTML5 syntax.static SyntaxXWIKI_1_0Deprecated.since 5.0, useXWIKI_2_1insteadstatic SyntaxXWIKI_2_0XWiki 2.0 syntax.static SyntaxXWIKI_2_1XWiki 2.1 syntax.
-
Constructor Summary
Constructors Constructor Description Syntax(SyntaxType type, String version)Syntax(SyntaxType type, String version, String qualifier)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description intcompareTo(Syntax syntax)booleanequals(Object object)StringgetQualifier()SyntaxTypegetType()StringgetVersion()inthashCode()StringtoIdString()StringtoString()static SyntaxvalueOf(String syntaxIdAsString)Deprecated.since 13.3RC1, useSyntaxRegistry.getSyntax(String)
-
-
-
Field Detail
-
XHTML_5
@Unstable public static final Syntax XHTML_5
XHTML5 syntax.- Since:
- 14.1RC1
-
HTML_5_0
public static final Syntax HTML_5_0
HTML5 syntax.- Since:
- 6.4M3
-
XHTML_1_0
public static final Syntax XHTML_1_0
XHTML 1.0 syntax.
-
HTML_4_01
public static final Syntax HTML_4_01
HTML 4.01 syntax.
-
XWIKI_1_0
@Deprecated public static final Syntax XWIKI_1_0
Deprecated.since 5.0, useXWIKI_2_1insteadXWiki 1.0 syntax.
-
XWIKI_2_0
public static final Syntax XWIKI_2_0
XWiki 2.0 syntax.
-
XWIKI_2_1
public static final Syntax XWIKI_2_1
XWiki 2.1 syntax.
-
PLAIN_1_0
public static final Syntax PLAIN_1_0
Plain text syntax.
-
EVENT_1_0
public static final Syntax EVENT_1_0
Events syntax.
-
TEX_1_0
public static final Syntax TEX_1_0
TEX syntax.
-
CREOLE_1_0
public static final Syntax CREOLE_1_0
Creole syntax.
-
JSPWIKI_1_0
public static final Syntax JSPWIKI_1_0
JSPWiki syntax.
-
MEDIAWIKI_1_0
public static final Syntax MEDIAWIKI_1_0
Deprecated.since 8.2RC1, useMEDIAWIKI_1_6insteadOld MediaWiki syntax.
-
MEDIAWIKI_1_6
public static final Syntax MEDIAWIKI_1_6
New MediaWiki syntax.
-
DOKUWIKI_1_0
public static final Syntax DOKUWIKI_1_0
DokuWiki syntax.- Since:
- 9.8RC1
-
TWIKI_1_0
public static final Syntax TWIKI_1_0
TWiki syntax.
-
DOCBOOK_4_4
public static final Syntax DOCBOOK_4_4
Docbook 4.4 syntax.
-
CONFLUENCE_1_0
public static final Syntax CONFLUENCE_1_0
Confluence wiki syntax.
-
CONFLUENCEXHTML_1_0
public static final Syntax CONFLUENCEXHTML_1_0
Confluence XHTML based syntax.- Since:
- 5.3M1
-
XDOMXML_CURRENT
public static final Syntax XDOMXML_CURRENT
- Since:
- 3.3M1
-
XDOMXML_1_0
public static final Syntax XDOMXML_1_0
- Since:
- 3.3M1
-
MARKDOWN_1_0
public static final Syntax MARKDOWN_1_0
- Since:
- 3.4M1
-
MARKDOWN_1_1
public static final Syntax MARKDOWN_1_1
- Since:
- 5.2M1
-
APT_1_0
public static final Syntax APT_1_0
- Since:
- 4.3M1
-
ANNOTATED_XHTML_1_0
public static final Syntax ANNOTATED_XHTML_1_0
This is HTML with annotations (comments) in order to allow round tripping between for example the WYSIWYG editor and wiki syntax.
-
ANNOTATED_HTML_5_0
public static final Syntax ANNOTATED_HTML_5_0
This is HTML5 with annotations (comments) in order to allow round tripping between for example the WYSIWYG editor and wiki syntax.
-
-
Constructor Detail
-
Syntax
public Syntax(SyntaxType type, String version)
- Parameters:
type- the type of the syntaxversion- the specific version of the syntax
-
Syntax
public Syntax(SyntaxType type, String version, String qualifier)
- Parameters:
type- the type of the syntaxversion- the specific version of the syntaxqualifier- a qualifier
-
-
Method Detail
-
valueOf
@Deprecated public static Syntax valueOf(String syntaxIdAsString) throws ParseException
Deprecated.since 13.3RC1, useSyntaxRegistry.getSyntax(String)- Parameters:
syntaxIdAsString- the syntax as a string (eg "xwiki/2.0", "plain/1.0")- Returns:
- the parsed syntax as a Syntax object
- Throws:
ParseException- in case the string doesn't represent a valid syntax- Since:
- 9.8RC1
-
getType
public SyntaxType getType()
- Returns:
- the type of the syntax
-
getVersion
public String getVersion()
- Returns:
- the specific version of the syntax
-
getQualifier
public String getQualifier()
- Returns:
- a qualifier
-
toIdString
public String toIdString()
- Returns:
- a unique String identifier, does not contain display name and qualifier. Usable when searching for parsers and renderers components for example.
-
compareTo
public int compareTo(Syntax syntax)
- Specified by:
compareToin interfaceComparable<Syntax>
-
-