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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidgenerateFromModule(IModule module, Writer out, IConfiguration<SchemaGenerationFeature<?>> configuration) Generate and write a schema for the providedmetaschemato theWriterprovided bywriterusing the providedconfiguration.protected voidgenerateSchema(gov.nist.secauto.metaschema.schemagen.xml.impl.XmlGenerationState state) Called to generate the actual schema content.protected static voidgenerateSchemaMetadata(IModule module, gov.nist.secauto.metaschema.schemagen.xml.impl.XmlGenerationState state) protected org.codehaus.stax2.XMLOutputFactory2protected gov.nist.secauto.metaschema.schemagen.xml.impl.XmlGenerationStatenewGenerationState(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:AbstractSchemaGeneratorCreate a new writer to use to write the schema.- Specified by:
newWriterin classAbstractSchemaGenerator<AutoCloser<org.codehaus.stax2.XMLStreamWriter2,SchemaGenerationException>, XmlDatatypeManager, gov.nist.secauto.metaschema.schemagen.xml.impl.XmlGenerationState> - Parameters:
out- theWriterto 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:AbstractSchemaGeneratorCreate a new schema generation state object.- Specified by:
newGenerationStatein 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:ISchemaGeneratorGenerate and write a schema for the providedmetaschemato theWriterprovided bywriterusing the providedconfiguration.- Specified by:
generateFromModulein interfaceISchemaGenerator- Overrides:
generateFromModulein 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:AbstractSchemaGeneratorCalled to generate the actual schema content.- Specified by:
generateSchemain 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
-