Class XmlSchemaGenerator
- 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>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface gov.nist.secauto.metaschema.schemagen.ISchemaGenerator
ISchemaGenerator.SchemaFormat
-
-
Field Summary
Fields Modifier and Type Field Description static String
NS_XHTML
static String
NS_XML_SCHEMA
static String
PREFIX_XML_SCHEMA
-
Constructor Summary
Constructors Constructor Description XmlSchemaGenerator()
XmlSchemaGenerator(org.codehaus.stax2.XMLOutputFactory2 xmlOutputFactory)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
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
getXmlOutputFactory()
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>
newWriter(Writer out)
Create a new writer to use to write the schema.-
Methods inherited from class gov.nist.secauto.metaschema.schemagen.AbstractSchemaGenerator
analyzeDefinitions
-
-
-
-
Field Detail
-
PREFIX_XML_SCHEMA
@NonNull public static final String PREFIX_XML_SCHEMA
- See Also:
- Constant Field Values
-
NS_XML_SCHEMA
@NonNull public static final String NS_XML_SCHEMA
- See Also:
- Constant Field Values
-
NS_XHTML
@NonNull public static final String NS_XHTML
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
XmlSchemaGenerator
public XmlSchemaGenerator()
-
XmlSchemaGenerator
public XmlSchemaGenerator(@NonNull org.codehaus.stax2.XMLOutputFactory2 xmlOutputFactory)
-
-
Method Detail
-
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 classAbstractSchemaGenerator<AutoCloser<org.codehaus.stax2.XMLStreamWriter2,SchemaGenerationException>,gov.nist.secauto.metaschema.schemagen.xml.datatype.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>,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 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>,gov.nist.secauto.metaschema.schemagen.xml.datatype.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>,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
-
-