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 StringNS_XHTMLstatic StringNS_XML_SCHEMAstatic StringPREFIX_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 voidgenerateFromModule(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.XMLOutputFactory2getXmlOutputFactory()protected 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>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:AbstractSchemaGeneratorCreate a new writer to use to write the schema.- Specified by:
newWriterin 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- 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>,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: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>,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:AbstractSchemaGeneratorCalled to generate the actual schema content.- Specified by:
generateSchemain 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
-
-