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.1
markdown+commonmark/1.2
sometype+variant1+...+variantN/1.0
- Since:
- 2.0RC1
- Version:
- $Id: 266e59690e526f5a1638a09aadf4d0d43f7d7c4d $
-
-
Field Summary
Fields Modifier and Type Field Description static 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.static 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.static Syntax
APT_1_0
static Syntax
CONFLUENCE_1_0
Confluence wiki syntax.static Syntax
CONFLUENCEXHTML_1_0
Confluence XHTML based syntax.static Syntax
CREOLE_1_0
Creole syntax.static Syntax
DOCBOOK_4_4
Docbook 4.4 syntax.static Syntax
DOKUWIKI_1_0
DokuWiki syntax.static Syntax
EVENT_1_0
Events syntax.static Syntax
HTML_4_01
HTML 4.01 syntax.static Syntax
HTML_5_0
HTML5 syntax.static Syntax
JSPWIKI_1_0
JSPWiki syntax.static Syntax
MARKDOWN_1_0
static Syntax
MARKDOWN_1_1
static Syntax
MEDIAWIKI_1_0
Deprecated.since 8.2RC1, useMEDIAWIKI_1_6
insteadstatic Syntax
MEDIAWIKI_1_6
New MediaWiki syntax.static Syntax
PLAIN_1_0
Plain text syntax.static Syntax
TEX_1_0
TEX syntax.static Syntax
TWIKI_1_0
TWiki syntax.static Syntax
XDOMXML_1_0
static Syntax
XDOMXML_CURRENT
static Syntax
XHTML_1_0
XHTML 1.0 syntax.static Syntax
XHTML_5
XHTML5 syntax.static Syntax
XWIKI_1_0
Deprecated.since 5.0, useXWIKI_2_1
insteadstatic Syntax
XWIKI_2_0
XWiki 2.0 syntax.static Syntax
XWIKI_2_1
XWiki 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 int
compareTo(Syntax syntax)
boolean
equals(Object object)
String
getQualifier()
SyntaxType
getType()
String
getVersion()
int
hashCode()
String
toIdString()
String
toString()
static Syntax
valueOf(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_1
insteadXWiki 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_6
insteadOld 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:
compareTo
in interfaceComparable<Syntax>
-
-