Class AbstractXML2GrammarGenerator<T extends FileContentGeneratorSettings>

    • Constructor Detail

      • AbstractXML2GrammarGenerator

        public AbstractXML2GrammarGenerator()
    • Method Detail

      • generate

        public String generate​(Document prototypeDocument,
                               SharedSettings sharedSettings,
                               T generatorSettings,
                               IXMLFullFormatter formatter,
                               org.eclipse.lsp4j.jsonrpc.CancelChecker cancelChecker)
        Description copied from interface: IFileContentGenerator
        Generates a file content (ex : XSD, DTD) from the given document source document (ex: XML) by using the given settings generatorSettings.
        Specified by:
        generate in interface IFileContentGenerator<Document,​T extends FileContentGeneratorSettings>
        Parameters:
        prototypeDocument - the XML document source.
        sharedSettings - the shared settings.
        generatorSettings - the generator settings.
        formatter - the formatter.
        Returns:
        the result of the generation of the file content (ex : XSD, DTD) from the given document source document (ex: XML) by using the given settings generatorSettings.
      • getFileExtension

        protected abstract String getFileExtension()
        Returns the grammar file extension (ex : xsd, dtd) to generate.
        Returns:
        the grammar file extension (ex : xsd, dtd) to generate.
      • isFlat

        protected boolean isFlat()
        Returns 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.
        Returns:
        true if element declaration must be stored as flat mode and false otherwise.
      • generate

        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.
        Parameters:
        grammar - the grammar information.
        grammarSettings - the grammar settings
        out - the XML builder to update.
        cancelChecker -