Class XmlSchemaGenerator
java.lang.Object
gov.nist.secauto.metaschema.schemagen.AbstractSchemaGenerator<AutoCloser<org.codehaus.stax2.XMLStreamWriter2,SchemaGenerationException>,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>,XmlDatatypeManager,gov.nist.secauto.metaschema.schemagen.xml.impl.XmlGenerationState>
-
Nested Class Summary
Nested classes/interfaces inherited from interface gov.nist.secauto.metaschema.schemagen.ISchemaGenerator
ISchemaGenerator.SchemaFormat
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
generateFromModule
(IModule module, Writer out, IConfiguration<SchemaGenerationFeature<?>> configuration) Generate and write a schema for the providedmetaschema
to theWriter
provided bywriter
using the providedconfiguration
.protected void
generateSchema
(gov.nist.secauto.metaschema.schemagen.xml.impl.XmlGenerationState state) Called to generate the actual schema content.protected static void
generateSchemaMetadata
(IModule module, gov.nist.secauto.metaschema.schemagen.xml.impl.XmlGenerationState state) protected org.codehaus.stax2.XMLOutputFactory2
protected gov.nist.secauto.metaschema.schemagen.xml.impl.XmlGenerationState
newGenerationState
(IModule module, AutoCloser<org.codehaus.stax2.XMLStreamWriter2, SchemaGenerationException> schemaWriter, IConfiguration<SchemaGenerationFeature<?>> configuration) Create a new schema generation state object.protected AutoCloser<org.codehaus.stax2.XMLStreamWriter2,
SchemaGenerationException> Create a new writer to use to write the schema.Methods inherited from class gov.nist.secauto.metaschema.schemagen.AbstractSchemaGenerator
analyzeDefinitions
-
Field Details
-
PREFIX_XML_SCHEMA
- See Also:
-
NS_XML_SCHEMA
- See Also:
-
NS_XHTML
- See Also:
-
-
Constructor Details
-
XmlSchemaGenerator
public XmlSchemaGenerator() -
XmlSchemaGenerator
-
-
Method Details
-
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 classAbstractSchemaGenerator<AutoCloser<org.codehaus.stax2.XMLStreamWriter2,
SchemaGenerationException>, XmlDatatypeManager, gov.nist.secauto.metaschema.schemagen.xml.impl.XmlGenerationState> - Parameters:
out
- theWriter
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 classAbstractSchemaGenerator<AutoCloser<org.codehaus.stax2.XMLStreamWriter2,
SchemaGenerationException>, XmlDatatypeManager, gov.nist.secauto.metaschema.schemagen.xml.impl.XmlGenerationState> - Parameters:
module
- the Metaschema module to generate the schema forschemaWriter
- the writer to use to write the schemaconfiguration
- 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 providedmetaschema
to theWriter
provided bywriter
using the providedconfiguration
.- Specified by:
generateFromModule
in interfaceISchemaGenerator
- Overrides:
generateFromModule
in classAbstractSchemaGenerator<AutoCloser<org.codehaus.stax2.XMLStreamWriter2,
SchemaGenerationException>, XmlDatatypeManager, gov.nist.secauto.metaschema.schemagen.xml.impl.XmlGenerationState> - Parameters:
module
- the Module to generate the schema forout
- the writer to use to write the schemaconfiguration
- 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 classAbstractSchemaGenerator<AutoCloser<org.codehaus.stax2.XMLStreamWriter2,
SchemaGenerationException>, 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
-