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>
File Generator implementation to generate DTD from a given XML source.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected 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 StringReturns 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
-
Constructor Details
-
XML2DTDGenerator
public XML2DTDGenerator()
-
-
Method Details
-
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
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 <!ELEMENT without hierarchy.
- 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.
-