T
- the grammar generator settings.public abstract class AbstractXML2GrammarGenerator<T extends FileContentGeneratorSettings> extends Object implements IFileContentGenerator<Document,T>
The process is to build a generic Grammar
instance from the XML
source and each implementation uses this grammar information to generate the
proper grammar.
Constructor and Description |
---|
AbstractXML2GrammarGenerator() |
Modifier and Type | Method and Description |
---|---|
String |
generate(Document prototypeDocument,
SharedSettings sharedSettings,
T generatorSettings,
IXMLFullFormatter formatter,
org.eclipse.lsp4j.jsonrpc.CancelChecker cancelChecker)
Generates a file content (ex : XSD, DTD) from the given document source
document (ex: XML) by using the given settings
generatorSettings . |
protected abstract void |
generate(Grammar grammar,
T grammarSettings,
XMLBuilder out,
org.eclipse.lsp4j.jsonrpc.CancelChecker cancelChecker)
Generate the grammar content from the given grammar information into the
given builder.
|
protected abstract String |
getFileExtension()
Returns the grammar file extension (ex : xsd, dtd) to generate.
|
protected boolean |
isFlat()
Returns true if element declaration must be stored as flat mode and false
otherwise.
|
public String generate(Document prototypeDocument, SharedSettings sharedSettings, T generatorSettings, IXMLFullFormatter formatter, org.eclipse.lsp4j.jsonrpc.CancelChecker cancelChecker)
IFileContentGenerator
document
(ex: XML) by using the given settings
generatorSettings
.generate
in interface IFileContentGenerator<Document,T extends FileContentGeneratorSettings>
prototypeDocument
- the XML document source.sharedSettings
- the shared settings.generatorSettings
- the generator settings.formatter
- the formatter.document
(ex: XML) by using
the given settings generatorSettings
.protected abstract String getFileExtension()
protected boolean isFlat()
protected abstract void generate(Grammar grammar, T grammarSettings, XMLBuilder out, org.eclipse.lsp4j.jsonrpc.CancelChecker cancelChecker)
grammar
- the grammar information.grammarSettings
- the grammar settingsout
- the XML builder to update.cancelChecker
- Copyright © 2022. All rights reserved.