java.lang.Object
gov.nist.secauto.metaschema.schemagen.AbstractSchemaGenerator<AutoCloser<org.codehaus.stax2.XMLStreamWriter2,SchemaGenerationException>,gov.nist.secauto.metaschema.schemagen.xml.datatype.XmlDatatypeManager,gov.nist.secauto.metaschema.schemagen.xml.impl.XmlGenerationState>
gov.nist.secauto.metaschema.schemagen.xml.XmlSchemaGenerator
All Implemented Interfaces:
ISchemaGenerator

public class XmlSchemaGenerator extends AbstractSchemaGenerator<AutoCloser<org.codehaus.stax2.XMLStreamWriter2,SchemaGenerationException>,gov.nist.secauto.metaschema.schemagen.xml.datatype.XmlDatatypeManager,gov.nist.secauto.metaschema.schemagen.xml.impl.XmlGenerationState>
  • Field Details

  • Constructor Details

    • XmlSchemaGenerator

      public XmlSchemaGenerator()
    • XmlSchemaGenerator

      public XmlSchemaGenerator(@NonNull org.codehaus.stax2.XMLOutputFactory2 xmlOutputFactory)
  • Method Details

    • getXmlOutputFactory

      protected org.codehaus.stax2.XMLOutputFactory2 getXmlOutputFactory()
    • newWriter

      protected AutoCloser<org.codehaus.stax2.XMLStreamWriter2,SchemaGenerationException> newWriter(Writer out)
      Description copied from class: AbstractSchemaGenerator
      Create a new writer to use to write the schema.
      Specified by:
      newWriter in class AbstractSchemaGenerator<AutoCloser<org.codehaus.stax2.XMLStreamWriter2,SchemaGenerationException>,gov.nist.secauto.metaschema.schemagen.xml.datatype.XmlDatatypeManager,gov.nist.secauto.metaschema.schemagen.xml.impl.XmlGenerationState>
      Parameters:
      out - the Writer to write the schema content to
      Returns:
      the schema writer
    • newGenerationState

      protected gov.nist.secauto.metaschema.schemagen.xml.impl.XmlGenerationState newGenerationState(IModule module, AutoCloser<org.codehaus.stax2.XMLStreamWriter2,SchemaGenerationException> schemaWriter, IConfiguration<SchemaGenerationFeature<?>> configuration)
      Description copied from class: AbstractSchemaGenerator
      Create a new schema generation state object.
      Specified by:
      newGenerationState in class AbstractSchemaGenerator<AutoCloser<org.codehaus.stax2.XMLStreamWriter2,SchemaGenerationException>,gov.nist.secauto.metaschema.schemagen.xml.datatype.XmlDatatypeManager,gov.nist.secauto.metaschema.schemagen.xml.impl.XmlGenerationState>
      Parameters:
      module - the Metaschema module to generate the schema for
      schemaWriter - the writer to use to write the schema
      configuration - the generation configuration
      Returns:
      the schema generation state used for context and writing
    • generateFromModule

      public void generateFromModule(@NonNull IModule module, @NonNull Writer out, @NonNull IConfiguration<SchemaGenerationFeature<?>> configuration)
      Description copied from interface: ISchemaGenerator
      Generate and write a schema for the provided metaschema to the Writer provided by writer using the provided configuration.
      Specified by:
      generateFromModule in interface ISchemaGenerator
      Overrides:
      generateFromModule in class AbstractSchemaGenerator<AutoCloser<org.codehaus.stax2.XMLStreamWriter2,SchemaGenerationException>,gov.nist.secauto.metaschema.schemagen.xml.datatype.XmlDatatypeManager,gov.nist.secauto.metaschema.schemagen.xml.impl.XmlGenerationState>
      Parameters:
      module - the Module to generate the schema for
      out - the writer to use to write the schema
      configuration - the schema generation configuration
    • generateSchema

      protected void generateSchema(gov.nist.secauto.metaschema.schemagen.xml.impl.XmlGenerationState state)
      Description copied from class: AbstractSchemaGenerator
      Called to generate the actual schema content.
      Specified by:
      generateSchema in class AbstractSchemaGenerator<AutoCloser<org.codehaus.stax2.XMLStreamWriter2,SchemaGenerationException>,gov.nist.secauto.metaschema.schemagen.xml.datatype.XmlDatatypeManager,gov.nist.secauto.metaschema.schemagen.xml.impl.XmlGenerationState>
      Parameters:
      state - the generation state object
    • generateSchemaMetadata

      protected static void generateSchemaMetadata(@NonNull IModule module, @NonNull gov.nist.secauto.metaschema.schemagen.xml.impl.XmlGenerationState state) throws XMLStreamException
      Throws:
      XMLStreamException