|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.legstar.jaxb.gen.CobolJAXBCustomizer
public class CobolJAXBCustomizer
This class implements the methods needed to inject custom JAXB bindings into an XML Schema.
The bindings are necessary so that XJC generates the correct JAXB Classes. This will not replace any customization that the user might have added manually in the XML Schema.
| Constructor Summary | |
|---|---|
CobolJAXBCustomizer(JaxbGenModel xjbModel)
Construct the customizer. |
|
| Method Summary | |
|---|---|
void |
customize(File sourceXsdFile,
File targetXsdFile)
Adds JAXB custom bindings to an XML Schema. |
void |
customize(File sourceXsdFile,
String sourceXsdCharset,
File targetXsdFile,
String targetXsdCharset)
Adds JAXB custom bindings to an XML Schema. |
protected Element |
getElement(DocumentFragment markupParent,
String namespace,
String namespacePrefix,
String elementLocalName)
Lookup a DOM element in the parent markup. |
JaxbGenModel |
getJaxbGenModel()
|
protected DocumentFragment |
getMarkupParent(org.apache.ws.commons.schema.XmlSchemaAppInfo appInfo)
The content of appinfo is a raw W3C nodelist. |
protected org.apache.ws.commons.schema.XmlSchemaAppInfo |
getXmlSchemaAppInfo(org.apache.ws.commons.schema.XmlSchemaAnnotated element)
Try to recover application info from an XML schema element and create new ones if none is found. |
void |
injectJaxbElementNameXmlTransformAnnotation(Element xmltransformEl,
String jaxbNamespace,
String jaxbNamespacePrefix)
Inject a ElementNameXmlTransform element in the JAXB XmlTransform annotation. |
void |
injectJaxbEnumerationsAnnotation(org.apache.ws.commons.schema.XmlSchema schema,
String jaxbNamespace,
String jaxbNamespacePrefix)
Enumerations in anonymous simple types are not mapped to type safe Enum classes by JAXB unless they are annotated. |
void |
injectJaxbExtensionAttributes(org.apache.ws.commons.schema.XmlSchema xsd,
String jaxbPrefix)
JAXB needs to know the LegStar extension prefix used. |
void |
injectJaxbGlobalBindingsAnnotations(DocumentFragment markupParent,
String jaxbNamespace,
String jaxbNamespacePrefix)
Inject a global bindings element in the parent annotation node. |
String |
injectJaxbNamespace(org.apache.ws.commons.schema.XmlSchema xsd)
Searches the schema element for the JAXB namespace. |
void |
injectJaxbSchemaAnnotations(org.apache.ws.commons.schema.XmlSchema schema,
String jaxbNamespace,
String jaxbNamespacePrefix)
Given an XML Schema, this will inject or replace custom JAXB bindings annotations at the schema level. |
void |
injectJaxbSchemaBindingsAnnotations(DocumentFragment markupParent,
String jaxbNamespace,
String jaxbNamespacePrefix)
Inject a schema bindings element in the parent annotation node. |
void |
injectJaxbSerializableAnnotation(Element globalbindingsEl,
String jaxbNamespace,
String jaxbNamespacePrefix)
Inject a serializable element in the JAXB global bindings annotation. |
void |
injectJaxbTypeNameXmlTransformAnnotation(Element xmltransformEl,
String jaxbNamespace,
String jaxbNamespacePrefix)
Inject a TypeNameXmlTransform element in the JAXB XmlTransform annotation. |
protected void |
injectJaxbTypeSafeEnumClassAnnotation(String jaxbNamespace,
String jaxbNamespacePrefix,
org.apache.ws.commons.schema.XmlSchemaSimpleType xsdSimpleType,
String elementName)
Create a typesafeEnumClass markup. |
protected void |
injectJaxbTypeSafeEnumMemberAnnotation(String jaxbNamespace,
String jaxbNamespacePrefix,
org.apache.ws.commons.schema.XmlSchemaEnumerationFacet enumerationFacet,
String value)
Create a typesafeEnumMember markup. |
void |
injectJaxbXmlTransformAnnotation(Element schemabindingsEl,
String jaxbNamespace,
String jaxbNamespacePrefix)
Inject a XmlTransform element in the JAXB schema bindings annotation. |
protected void |
processCollectionElements(org.apache.ws.commons.schema.XmlSchema schema,
String jaxbNamespace,
String jaxbNamespacePrefix,
org.apache.ws.commons.schema.XmlSchemaObjectCollection items)
Take all elements from a collection and process them. |
protected void |
processComplexType(org.apache.ws.commons.schema.XmlSchema schema,
String jaxbNamespace,
String jaxbNamespacePrefix,
org.apache.ws.commons.schema.XmlSchemaComplexType xsdComplexType)
Process an XML schema complex type. |
protected void |
processElement(org.apache.ws.commons.schema.XmlSchema schema,
String jaxbNamespace,
String jaxbNamespacePrefix,
org.apache.ws.commons.schema.XmlSchemaElement xsdElement)
Process an XML schema element. |
protected void |
processParticle(org.apache.ws.commons.schema.XmlSchema schema,
String jaxbNamespace,
String jaxbNamespacePrefix,
QName parentName,
org.apache.ws.commons.schema.XmlSchemaParticle particle)
A particle is usually all or sequence. |
protected void |
processSimpleType(org.apache.ws.commons.schema.XmlSchema schema,
String jaxbNamespace,
String jaxbNamespacePrefix,
org.apache.ws.commons.schema.XmlSchemaElement xsdElement,
org.apache.ws.commons.schema.XmlSchemaSimpleType xsdSimpleType)
Process an XML schema simple type. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CobolJAXBCustomizer(JaxbGenModel xjbModel)
throws ParserConfigurationException
xjbModel - the bindings parameters
ParserConfigurationException - if can't configure a DOM parser| Method Detail |
|---|
public void customize(File sourceXsdFile,
File targetXsdFile)
throws IOException
sourceXsdFile - the source XML Schema filetargetXsdFile - the target, customized, XML Schema file
IOException - if output file cannot be written
public void customize(File sourceXsdFile,
String sourceXsdCharset,
File targetXsdFile,
String targetXsdCharset)
throws IOException
sourceXsdFile - the source XML Schema filesourceXsdCharset - the source character settargetXsdFile - the target, customized, XML Schema filetargetXsdCharset - the target character set
IOException - if output file cannot be writtenpublic String injectJaxbNamespace(org.apache.ws.commons.schema.XmlSchema xsd)
xsd - the XML Schema
public void injectJaxbExtensionAttributes(org.apache.ws.commons.schema.XmlSchema xsd,
String jaxbPrefix)
xsd - the XML SchemajaxbPrefix - the JAXB namespace prefix
public void injectJaxbSchemaAnnotations(org.apache.ws.commons.schema.XmlSchema schema,
String jaxbNamespace,
String jaxbNamespacePrefix)
<xsd:appinfo>
<jaxb:globalBindings generateIsSetMethod="true">
<jxb:serializable uid="1"/>
</jaxb:globalBindings>
<jaxb:schemaBindings>
<jaxb:nameXmlTransform>
<jaxb:typeName prefix="Type" suffix="Type" />
<jaxb:elementName prefix="Type" suffix="Type" />
</jaxb:nameXmlTransform>
</jaxb:schemaBindings>
</xsd:appinfo>
schema - the XML SchemajaxbNamespace - the JAXB namespacejaxbNamespacePrefix - the JAXB namespace prefixprotected org.apache.ws.commons.schema.XmlSchemaAppInfo getXmlSchemaAppInfo(org.apache.ws.commons.schema.XmlSchemaAnnotated element)
element - an XML schema element that might hold annotations
protected DocumentFragment getMarkupParent(org.apache.ws.commons.schema.XmlSchemaAppInfo appInfo)
appInfo - the application info element
public void injectJaxbGlobalBindingsAnnotations(DocumentFragment markupParent,
String jaxbNamespace,
String jaxbNamespacePrefix)
markupParent - the parent annotation node (its a document fragment)jaxbNamespace - the JAXB namespacejaxbNamespacePrefix - the JAXB namespace prefix
protected Element getElement(DocumentFragment markupParent,
String namespace,
String namespacePrefix,
String elementLocalName)
markupParent - the parent markupnamespace - the DOM namespacenamespacePrefix - the DOM namespace prefixelementLocalName - the element local name
public void injectJaxbSerializableAnnotation(Element globalbindingsEl,
String jaxbNamespace,
String jaxbNamespacePrefix)
globalbindingsEl - the global bindings nodejaxbNamespace - the JAXB namespacejaxbNamespacePrefix - the JAXB namespace prefix
public void injectJaxbSchemaBindingsAnnotations(DocumentFragment markupParent,
String jaxbNamespace,
String jaxbNamespacePrefix)
markupParent - the parent annotation node (its a document fragment)jaxbNamespace - the JAXB namespacejaxbNamespacePrefix - the JAXB namespace prefix
public void injectJaxbXmlTransformAnnotation(Element schemabindingsEl,
String jaxbNamespace,
String jaxbNamespacePrefix)
schemabindingsEl - the schema bindings nodejaxbNamespace - the JAXB namespacejaxbNamespacePrefix - the JAXB namespace prefix
public void injectJaxbTypeNameXmlTransformAnnotation(Element xmltransformEl,
String jaxbNamespace,
String jaxbNamespacePrefix)
xmltransformEl - the XmlTransform nodejaxbNamespace - the JAXB namespacejaxbNamespacePrefix - the JAXB namespace prefix
public void injectJaxbElementNameXmlTransformAnnotation(Element xmltransformEl,
String jaxbNamespace,
String jaxbNamespacePrefix)
xmltransformEl - the XmlTransform nodejaxbNamespace - the JAXB namespacejaxbNamespacePrefix - the JAXB namespace prefix
public void injectJaxbEnumerationsAnnotation(org.apache.ws.commons.schema.XmlSchema schema,
String jaxbNamespace,
String jaxbNamespacePrefix)
schema - the XML SchemajaxbNamespace - the JAXB namespacejaxbNamespacePrefix - the JAXB namespace prefix
protected void processCollectionElements(org.apache.ws.commons.schema.XmlSchema schema,
String jaxbNamespace,
String jaxbNamespacePrefix,
org.apache.ws.commons.schema.XmlSchemaObjectCollection items)
schema - the XML SchemajaxbNamespace - the JAXB namespacejaxbNamespacePrefix - the JAXB namespace prefixitems - the parent collection
protected void processElement(org.apache.ws.commons.schema.XmlSchema schema,
String jaxbNamespace,
String jaxbNamespacePrefix,
org.apache.ws.commons.schema.XmlSchemaElement xsdElement)
schema - the XML SchemajaxbNamespace - the JAXB namespacejaxbNamespacePrefix - the JAXB namespace prefixxsdElement - the XML Schema element to process
protected void processSimpleType(org.apache.ws.commons.schema.XmlSchema schema,
String jaxbNamespace,
String jaxbNamespacePrefix,
org.apache.ws.commons.schema.XmlSchemaElement xsdElement,
org.apache.ws.commons.schema.XmlSchemaSimpleType xsdSimpleType)
schema - the XML SchemajaxbNamespace - the JAXB namespacejaxbNamespacePrefix - the JAXB namespace prefixxsdElement - the XML Schema element which type we are processingxsdSimpleType - the XML Schema type to process
protected void processComplexType(org.apache.ws.commons.schema.XmlSchema schema,
String jaxbNamespace,
String jaxbNamespacePrefix,
org.apache.ws.commons.schema.XmlSchemaComplexType xsdComplexType)
schema - the XML SchemajaxbNamespace - the JAXB namespacejaxbNamespacePrefix - the JAXB namespace prefixxsdComplexType - the XML Schema type to process
protected void processParticle(org.apache.ws.commons.schema.XmlSchema schema,
String jaxbNamespace,
String jaxbNamespacePrefix,
QName parentName,
org.apache.ws.commons.schema.XmlSchemaParticle particle)
schema - the XML SchemajaxbNamespace - the JAXB namespacejaxbNamespacePrefix - the JAXB namespace prefixparentName - the name of the parent schema object for loggingparticle - the particle schema object
protected void injectJaxbTypeSafeEnumClassAnnotation(String jaxbNamespace,
String jaxbNamespacePrefix,
org.apache.ws.commons.schema.XmlSchemaSimpleType xsdSimpleType,
String elementName)
jaxbNamespace - the JAXB namespacejaxbNamespacePrefix - the JAXB namespace prefixxsdSimpleType - the simple type to annotateelementName - the name of the element whose simple type we are
dealing with.
protected void injectJaxbTypeSafeEnumMemberAnnotation(String jaxbNamespace,
String jaxbNamespacePrefix,
org.apache.ws.commons.schema.XmlSchemaEnumerationFacet enumerationFacet,
String value)
jaxbNamespace - the JAXB namespacejaxbNamespacePrefix - the JAXB namespace prefixenumerationFacet - the enumeration facet to annotatevalue - the enumeration value.public JaxbGenModel getJaxbGenModel()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||