@Unstable
@Role
public interface SyntaxRegistry
javax.inject.Provider<List<Syntax>>
component role (and they are automatically unregistered
when the component is unregistered from the Component Manager). If a syntax is registered manually by calling a
register method from this class, then it also needs to be unregistered manually when the extension bringing it is
uninstalled.Modifier and Type | Method and Description |
---|---|
Optional<Syntax> |
getSyntax(String syntaxId) |
Map<String,Syntax> |
getSyntaxes() |
void |
registerSyntaxes(Syntax... syntaxes)
Adds one or several Syntaxes to the Syntax Registry.
|
Syntax |
resolveSyntax(String syntaxId)
Parse the provided string representation of a Syntax and return a typed
Syntax object. |
void |
unregisterSyntaxes(Syntax... syntaxes)
Removes one or several Syntaxes from the Syntax Registry.
|
void registerSyntaxes(Syntax... syntaxes)
syntaxes
- the syntaxes to addvoid unregisterSyntaxes(Syntax... syntaxes)
syntaxes
- the syntaxes to removeOptional<Syntax> getSyntax(String syntaxId)
syntaxId
- the syntax represented as a string (e.g. xwiki/2.1
)Syntax
object taken from the list of already registered Syntaxes and
Optional.empty()
if not foundSyntax resolveSyntax(String syntaxId) throws ParseException
Syntax
object.syntaxId
- the syntax represented as a string (e.g. xwiki/2.1
)ParseException
- when the passed syntax is invalidCopyright © 2004–2021 XWiki. All rights reserved.