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
markdownsyntax has thecommonmarkvariant and thegithubvariant. - a human-readable name (e.g.
XWiki,Confluence,MediaWiki).
<base type>[+<variant>]*. Examples:xwikimarkdown+commonmarksometype+variant1+...+variantN
- Since:
- 2.0RC1
- Version:
- $Id: 793b8a3ac794c2e2555448137370578461419e5a $
-
-
Field Summary
Fields Modifier and Type Field Description static SyntaxTypeANNOTATED_HTMLAnnotated HTML syntax.static SyntaxTypeANNOTATED_XHTMLAnnotated XHTML syntax.static SyntaxTypeAPTAPT syntax.static SyntaxTypeCONFLUENCEConfluence wiki syntax.static SyntaxTypeCONFLUENCEXHTMLConfluence XHTML based syntax.static SyntaxTypeCREOLECreole wiki syntax.static SyntaxTypeDOCBOOKDoxBook syntax.static SyntaxTypeDOKUWIKIDokuWiki wiki syntax.static SyntaxTypeEVENTEvents syntax.static SyntaxTypeHTMLHTML syntaxes.static Set<SyntaxType>HTML_FAMILY_TYPESSyntaxes that are from the HTML family.static SyntaxTypeJSPWIKIJSPWiki wiki syntax.static SyntaxTypeMARKDOWNMarkDown wiki syntax.static SyntaxTypeMEDIAWIKIMediaWiki wiki syntax.static SyntaxTypePLAINPlain text syntax.static SyntaxTypeTEXTEX syntax.static SyntaxTypeTWIKITWiki wiki syntax.static SyntaxTypeXDOMXMLXML based XWiki DOM syntax.static SyntaxTypeXHTMLXHTML syntax.static SyntaxTypeXWIKIXWiki 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 intcompareTo(SyntaxType syntaxType)booleanequals(Object object)StringgetId()StringgetName()static Map<String,SyntaxType>getSyntaxTypes()Deprecated.since 13.3RC1, useSyntaxRegistry.getSyntaxes()List<String>getVariants()inthashCode()StringtoIdString()StringtoString()static SyntaxTypevalueOf(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:
toStringin classObject- See Also:
Object.toString()
-
compareTo
public int compareTo(SyntaxType syntaxType)
- Specified by:
compareToin 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
-
-