com.legstar.xsd
Class AbstractXsdAnnotator

java.lang.Object
  extended by com.legstar.xsd.AbstractXsdAnnotator
All Implemented Interfaces:
XsdObjectProcessor
Direct Known Subclasses:
Xsd2CobAnnotator

public abstract class AbstractXsdAnnotator
extends Object
implements XsdObjectProcessor

Common methods and properties for all XML schema annotators.

An annotator must be setup before it is used (using the setUp method) this will give it a chance to load configuration data.


Constructor Summary
AbstractXsdAnnotator()
          No arg constructor.
AbstractXsdAnnotator(Map<String,String> complexTypeToJavaClassMap)
          Construct using a complex type to java class map.
 
Method Summary
 void annotate(org.apache.ws.commons.schema.XmlSchema schema, org.apache.ws.commons.schema.XmlSchemaAnnotated schemaObject, Element elc)
          Add annotations to an XML schema object (Element or Type).
 String getCobolName(String xsdName)
          Method to infer a Cobol name from an XML schema type name.
 com.legstar.cobol.gen.CobolNameResolver getCobolNameResolver()
           
 Map<String,String> getComplexTypeToJavaClassMap()
           
 XsdCobolTypeMap getXsdCobolTypeMap()
           
 void setComplexTypeAttributes(org.apache.ws.commons.schema.XmlSchema schema, org.apache.ws.commons.schema.XmlSchemaComplexType xsdComplexType, Element elc, int level)
          Annotated complex types as group items.
 void setUp()
          Initialize whatever needs to be initialized.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.legstar.xsd.XsdObjectProcessor
processComplexType, processElement
 

Constructor Detail

AbstractXsdAnnotator

public AbstractXsdAnnotator()
No arg constructor.


AbstractXsdAnnotator

public AbstractXsdAnnotator(Map<String,String> complexTypeToJavaClassMap)
Construct using a complex type to java class map.

Parameters:
complexTypeToJavaClassMap - complex type to java class map
Method Detail

setUp

public void setUp()
           throws IOException
Description copied from interface: XsdObjectProcessor
Initialize whatever needs to be initialized.

Specified by:
setUp in interface XsdObjectProcessor
Throws:
IOException - if initialization fails

annotate

public void annotate(org.apache.ws.commons.schema.XmlSchema schema,
                     org.apache.ws.commons.schema.XmlSchemaAnnotated schemaObject,
                     Element elc)
Add annotations to an XML schema object (Element or Type).

Parameters:
schema - the XML schema
schemaObject - the XML schema object to annotate
elc - a DOM element holding the annotations

setComplexTypeAttributes

public void setComplexTypeAttributes(org.apache.ws.commons.schema.XmlSchema schema,
                                     org.apache.ws.commons.schema.XmlSchemaComplexType xsdComplexType,
                                     Element elc,
                                     int level)
                              throws XsdMappingException
Annotated complex types as group items.

Parameters:
schema - the XML Schema being annotated
xsdComplexType - the XML schema type
elc - the DOM Element representing the Cobol annotation
level - the current level in the type hierarchy
Throws:
XsdMappingException - if annotation fails

getCobolName

public String getCobolName(String xsdName)
Method to infer a Cobol name from an XML schema type name.

Parameters:
xsdName - the XSD type name
Returns:
the proposed cobol name

getXsdCobolTypeMap

public XsdCobolTypeMap getXsdCobolTypeMap()
Returns:
the map that associates a cobol type to an XSD primitive type

getCobolNameResolver

public com.legstar.cobol.gen.CobolNameResolver getCobolNameResolver()
Returns:
the COBOL name resolver

getComplexTypeToJavaClassMap

public Map<String,String> getComplexTypeToJavaClassMap()
Returns:
the complexType to Java qualified class name map


Copyright © 2012 LegSem. All Rights Reserved.