Package org.xwiki.rendering.syntax
Class SyntaxType
- java.lang.Object
-
- org.xwiki.rendering.syntax.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 thecommonmark
variant and thegithub
variant. - a human-readable name (e.g.
XWiki
,Confluence
,MediaWiki
).
<base type>[+<variant>]*
. Examples:xwiki
markdown+commonmark
sometype+variant1+...+variantN
- Since:
- 2.0RC1
- Version:
- $Id: 793b8a3ac794c2e2555448137370578461419e5a $
-
-
Field Summary
Fields Modifier and Type Field Description static SyntaxType
ANNOTATED_HTML
Annotated HTML syntax.static SyntaxType
ANNOTATED_XHTML
Annotated XHTML syntax.static SyntaxType
APT
APT syntax.static SyntaxType
CONFLUENCE
Confluence wiki syntax.static SyntaxType
CONFLUENCEXHTML
Confluence XHTML based syntax.static SyntaxType
CREOLE
Creole wiki syntax.static SyntaxType
DOCBOOK
DoxBook syntax.static SyntaxType
DOKUWIKI
DokuWiki wiki syntax.static SyntaxType
EVENT
Events syntax.static SyntaxType
HTML
HTML syntaxes.static Set<SyntaxType>
HTML_FAMILY_TYPES
Syntaxes that are from the HTML family.static SyntaxType
JSPWIKI
JSPWiki wiki syntax.static SyntaxType
MARKDOWN
MarkDown wiki syntax.static SyntaxType
MEDIAWIKI
MediaWiki wiki syntax.static SyntaxType
PLAIN
Plain text syntax.static SyntaxType
TEX
TEX syntax.static SyntaxType
TWIKI
TWiki wiki syntax.static SyntaxType
XDOMXML
XML based XWiki DOM syntax.static SyntaxType
XHTML
XHTML syntax.static SyntaxType
XWIKI
XWiki wiki syntax.
-
Constructor Summary
Constructors Constructor Description SyntaxType(String id, String name)
SyntaxType(String id, List<String> variants, String name)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description int
compareTo(SyntaxType syntaxType)
boolean
equals(Object object)
String
getId()
String
getName()
static Map<String,SyntaxType>
getSyntaxTypes()
Deprecated.since 13.3RC1, useSyntaxRegistry.getSyntaxes()
List<String>
getVariants()
int
hashCode()
String
toIdString()
String
toString()
static SyntaxType
valueOf(String syntaxTypesString)
-
-
-
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
-
-
Method Detail
-
getSyntaxTypes
@Deprecated public static Map<String,SyntaxType> getSyntaxTypes()
Deprecated.since 13.3RC1, useSyntaxRegistry.getSyntaxes()
- Returns:
- the well-known Syntax types
-
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
-
toString
public String toString()
Display a human readable name of the Syntax type.
- Overrides:
toString
in classObject
- See Also:
Object.toString()
-
compareTo
public int compareTo(SyntaxType syntaxType)
- Specified by:
compareTo
in interfaceComparable<SyntaxType>
-
valueOf
public static SyntaxType valueOf(String syntaxTypesString) throws ParseException
- Parameters:
syntaxTypesString
- the syntax type as a string (egxwiki
,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
-
-