Class XML2DTDGenerator
- java.lang.Object
-
- org.eclipse.lemminx.extensions.generators.AbstractXML2GrammarGenerator<DTDGeneratorSettings>
-
- org.eclipse.lemminx.extensions.generators.xml2dtd.XML2DTDGenerator
-
- All Implemented Interfaces:
IFileContentGenerator<Document,DTDGeneratorSettings>
public class XML2DTDGenerator extends AbstractXML2GrammarGenerator<DTDGeneratorSettings>
File Generator implementation to generate DTD from a given XML source.
-
-
Constructor Summary
Constructors Constructor Description XML2DTDGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidgenerate(Grammar grammar, DTDGeneratorSettings settings, XMLBuilder dtd, org.eclipse.lsp4j.jsonrpc.CancelChecker cancelChecker)Generate the grammar content from the given grammar information into the given builder.protected StringgetFileExtension()Returns the grammar file extension (ex : xsd, dtd) to generate.protected booleanisFlat()Returns true if element declaration must be stored as flat mode and false otherwise.-
Methods inherited from class org.eclipse.lemminx.extensions.generators.AbstractXML2GrammarGenerator
generate
-
-
-
-
Method Detail
-
generate
protected void generate(Grammar grammar, DTDGeneratorSettings settings, XMLBuilder dtd, org.eclipse.lsp4j.jsonrpc.CancelChecker cancelChecker)
Description copied from class:AbstractXML2GrammarGeneratorGenerate the grammar content from the given grammar information into the given builder.- Specified by:
generatein classAbstractXML2GrammarGenerator<DTDGeneratorSettings>- Parameters:
grammar- the grammar information.settings- the grammar settingsdtd- the XML builder to update.
-
getFileExtension
protected String getFileExtension()
Description copied from class:AbstractXML2GrammarGeneratorReturns the grammar file extension (ex : xsd, dtd) to generate.- Specified by:
getFileExtensionin classAbstractXML2GrammarGenerator<DTDGeneratorSettings>- Returns:
- the grammar file extension (ex : xsd, dtd) to generate.
-
isFlat
protected boolean isFlat()
Description copied from class:AbstractXML2GrammarGeneratorReturns true if element declaration must be stored as flat mode and false otherwise.- flat=true: helpful for DTD which declares
- flat=false: helpful for XSD which declares xs:element with hierarchy.
- Overrides:
isFlatin classAbstractXML2GrammarGenerator<DTDGeneratorSettings>- Returns:
- true if element declaration must be stored as flat mode and false otherwise.
-
-