public class XsdEmitter extends Object
Uses the XsdDataItem facade to CobolDataItem. This will have all XSD
attributes ready.
This class uses Apache XmlSchema to produce the XML schema.
All execution parameters are bundled in Cob2XsdConfig.
| Constructor and Description |
|---|
XsdEmitter(org.apache.ws.commons.schema.XmlSchema xsd,
Cob2XsdConfig model)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addEnumerationFacets(XsdDataItem xsdDataItem,
org.apache.ws.commons.schema.XmlSchemaSimpleTypeRestriction restriction)
If simple type has conditions attached to it, emit enumeration facets.
|
protected org.apache.ws.commons.schema.XmlSchemaSimpleType |
createAlphaXmlSchemaSimpleType(XsdDataItem xsdDataItem,
String xsdTypeName)
Create a simple type for an alphanumeric type.
|
protected org.apache.ws.commons.schema.XmlSchemaEnumerationFacet |
createEnumerationFacet(String conditionValue)
Create an XML schema enumeration facet.
|
protected org.apache.ws.commons.schema.XmlSchemaFractionDigitsFacet |
createFractionDigitsFacet(int fractionDigits)
Create an XML schema fractionDigits facet.
|
protected org.apache.ws.commons.schema.XmlSchemaMaxInclusiveFacet |
createMaxInclusiveFacet(String maxInclusive)
Create an XML schema maxInclusive facet.
|
protected org.apache.ws.commons.schema.XmlSchemaMaxLengthFacet |
createMaxLengthFacet(int length)
Create an XML schema maxLength facet.
|
protected org.apache.ws.commons.schema.XmlSchemaMinInclusiveFacet |
createMinInclusiveFacet(String minInclusive)
Create an XML schema minInclusive facet.
|
protected org.apache.ws.commons.schema.XmlSchemaSimpleType |
createNumericXmlSchemaSimpleType(XsdDataItem xsdDataItem,
String xsdTypeName)
Create a simple type for an numeric type.
|
protected org.apache.ws.commons.schema.XmlSchemaPatternFacet |
createPatternFacet(String pattern)
Create an XML schema pattern facet.
|
protected org.apache.ws.commons.schema.XmlSchemaSimpleTypeRestriction |
createRestriction(String xsdTypeName)
Create an XML schema restriction.
|
protected org.apache.ws.commons.schema.XmlSchemaTotalDigitsFacet |
createTotalDigitsFacet(int totalDigits)
Create an XML schema totalDigits facet.
|
org.apache.ws.commons.schema.XmlSchemaComplexType |
createXmlSchemaComplexType(XsdDataItem xsdDataItem)
Create an XML schema complex type.
|
org.apache.ws.commons.schema.XmlSchemaElement |
createXmlSchemaElement(XsdDataItem xsdDataItem)
Create an XML Schema element from a COBOL data item.
|
protected org.apache.ws.commons.schema.XmlSchemaSimpleType |
createXmlSchemaSimpleType(org.apache.ws.commons.schema.XmlSchemaSimpleTypeRestriction restriction)
Create an XML schema simple type from a restriction.
|
org.apache.ws.commons.schema.XmlSchemaType |
createXmlSchemaType(XsdDataItem xsdDataItem)
Maps a COBOL data item to an XML schema type.
|
Cob2XsdConfig |
getConfig() |
org.apache.ws.commons.schema.XmlSchema |
getXsd() |
public XsdEmitter(org.apache.ws.commons.schema.XmlSchema xsd,
Cob2XsdConfig model)
xsd - the XML Schema to be populated.model - the translator optionspublic org.apache.ws.commons.schema.XmlSchemaType createXmlSchemaType(XsdDataItem xsdDataItem)
xsdDataItem - COBOL data item decorated with XSD attributespublic org.apache.ws.commons.schema.XmlSchemaComplexType createXmlSchemaComplexType(XsdDataItem xsdDataItem)
xsdDataItem - COBOL data item decorated with XSD attributespublic org.apache.ws.commons.schema.XmlSchemaElement createXmlSchemaElement(XsdDataItem xsdDataItem)
xsdDataItem - COBOL data item decorated with XSD attributesprotected org.apache.ws.commons.schema.XmlSchemaSimpleType createAlphaXmlSchemaSimpleType(XsdDataItem xsdDataItem, String xsdTypeName)
COBOL alphanumeric fields are fixed length so we create a facet to enforce that constraint. A pattern derived from the picture clause can also be used as a facet. If the item has children conditions, we add enumeration facets
xsdDataItem - COBOL data item decorated with XSD attributesxsdTypeName - the XML schema built-in type name to use as a
restrictionprotected org.apache.ws.commons.schema.XmlSchemaSimpleType createNumericXmlSchemaSimpleType(XsdDataItem xsdDataItem, String xsdTypeName)
Numeric elements might have totaDigits, fractionDigits, minInclusive or maxInclusive facets.
xsdDataItem - COBOL data item decorated with XSD attributesxsdTypeName - the XML schema built-in type name to use as a
restrictionprotected void addEnumerationFacets(XsdDataItem xsdDataItem, org.apache.ws.commons.schema.XmlSchemaSimpleTypeRestriction restriction)
xsdDataItem - COBOL data item decorated with XSD attributesrestriction - the current set of constraintsprotected org.apache.ws.commons.schema.XmlSchemaSimpleType createXmlSchemaSimpleType(org.apache.ws.commons.schema.XmlSchemaSimpleTypeRestriction restriction)
restriction - the XML schema restrictionprotected org.apache.ws.commons.schema.XmlSchemaSimpleTypeRestriction createRestriction(String xsdTypeName)
xsdTypeName - the XML schema built-in type name to use as a
restrictionprotected org.apache.ws.commons.schema.XmlSchemaMaxLengthFacet createMaxLengthFacet(int length)
length - the value to setprotected org.apache.ws.commons.schema.XmlSchemaPatternFacet createPatternFacet(String pattern)
pattern - the value to setprotected org.apache.ws.commons.schema.XmlSchemaEnumerationFacet createEnumerationFacet(String conditionValue)
conditionValue - the value to setprotected org.apache.ws.commons.schema.XmlSchemaTotalDigitsFacet createTotalDigitsFacet(int totalDigits)
totalDigits - the value to setprotected org.apache.ws.commons.schema.XmlSchemaFractionDigitsFacet createFractionDigitsFacet(int fractionDigits)
fractionDigits - the value to setprotected org.apache.ws.commons.schema.XmlSchemaMinInclusiveFacet createMinInclusiveFacet(String minInclusive)
minInclusive - the value to setprotected org.apache.ws.commons.schema.XmlSchemaMaxInclusiveFacet createMaxInclusiveFacet(String maxInclusive)
maxInclusive - the value to setpublic org.apache.ws.commons.schema.XmlSchema getXsd()
public Cob2XsdConfig getConfig()
Copyright © 2021 LegSem. All rights reserved.