uk.ac.ic.doc.automed.modelmanagement.modelgen
Class HDMToXMLSchema

java.lang.Object
  extended by uk.ac.ic.doc.automed.modelmanagement.modelgen.HDMToHighLevel
      extended by uk.ac.ic.doc.automed.modelmanagement.modelgen.HDMToXMLSchema

public class HDMToXMLSchema
extends HDMToHighLevel

A class to do HDM to XML Schema translation

Author:
Andrew Charles Smith - acs203

Field Summary
private  java.util.HashMap amMatchObjects
           
private  Construct attribute
           
private  Construct choice
           
private  Construct complexElement
           
private  java.util.Iterator it
           
private  Construct key
           
private  Construct keyref
           
private  int OID
           
private  Construct parentElement
           
(package private) static java.lang.String prefix
           
private  Construct rootElement
           
private  Construct simpleElement
           
private  Model xmlschema
           
 
Fields inherited from class uk.ac.ic.doc.automed.modelmanagement.modelgen.HDMToHighLevel
allConstraintObjects, allEdgeObjects, allNodeObjects, cons, edge, extents, features, hdm, hlth, node, sourceSchema
 
Constructor Summary
HDMToXMLSchema(Schema s1, int features)
          Creates a new instance of XMLSchemaTransform
 
Method Summary
private  Schema addComplexElement(Schema transformedSchema, SchemaObject parent, SchemaObject hdmEdge)
          Recursive method to add all the complex elements to the XML Schema
private  Schema addKeyAttribute(Schema transformedSchema, SchemaObject parentComplexElement, SchemaObject hdmNode, SchemaObject hdmEdge)
          Add a key attribute
private  Schema addSimpleElement(Schema transformedSchema, SchemaObject parentComplexElement, SchemaObject hdmNode, SchemaObject hdmEdge)
          Add a child element and a link to it's parent complex type
private  Schema createRootNode(Schema transformedSchema)
          Create a root node for this XML Schema
 Schema execute(TransformModel am)
          Transform the HDM elements in this schema into XMLSchema elements
private  void setupXMLModel()
          Set up the XML Schema model
 
Methods inherited from class uk.ac.ic.doc.automed.modelmanagement.modelgen.HDMToHighLevel
addHDMObjectsToHashTables, removeHDMConstructs, setSchema
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

prefix

static final java.lang.String prefix
See Also:
Constant Field Values

xmlschema

private Model xmlschema

rootElement

private Construct rootElement

choice

private Construct choice

parentElement

private Construct parentElement

complexElement

private Construct complexElement

simpleElement

private Construct simpleElement

attribute

private Construct attribute

keyref

private Construct keyref

key

private Construct key

OID

private int OID

amMatchObjects

private java.util.HashMap amMatchObjects

it

private java.util.Iterator it
Constructor Detail

HDMToXMLSchema

public HDMToXMLSchema(Schema s1,
                      int features)
               throws NotFoundException
Creates a new instance of XMLSchemaTransform

Parameters:
s1 - The schema to transform
Throws:
NotFoundException - Throws an exception if constrcuts are not found
Method Detail

addComplexElement

private Schema addComplexElement(Schema transformedSchema,
                                 SchemaObject parent,
                                 SchemaObject hdmEdge)
                          throws AutoMedException
Recursive method to add all the complex elements to the XML Schema

Throws:
AutoMedException

addSimpleElement

private Schema addSimpleElement(Schema transformedSchema,
                                SchemaObject parentComplexElement,
                                SchemaObject hdmNode,
                                SchemaObject hdmEdge)
                         throws TypeMismatchException,
                                NotFoundException,
                                IntegrityException
Add a child element and a link to it's parent complex type

Throws:
TypeMismatchException
NotFoundException
IntegrityException

addKeyAttribute

private Schema addKeyAttribute(Schema transformedSchema,
                               SchemaObject parentComplexElement,
                               SchemaObject hdmNode,
                               SchemaObject hdmEdge)
                        throws TypeMismatchException,
                               NotFoundException,
                               IntegrityException
Add a key attribute

Throws:
TypeMismatchException
NotFoundException
IntegrityException

createRootNode

private Schema createRootNode(Schema transformedSchema)
                       throws AutoMedException
Create a root node for this XML Schema

Throws:
AutoMedException

setupXMLModel

private void setupXMLModel()
                    throws AutoMedException
Set up the XML Schema model

Throws:
AutoMedException

execute

public Schema execute(TransformModel am)
               throws AutoMedException
Transform the HDM elements in this schema into XMLSchema elements

Specified by:
execute in class HDMToHighLevel
Parameters:
am - - The result of transforming the HDM schema into an XML Schema-like HDM schema
Returns:
The XML Schema
Throws:
AutoMedException - General AutoMed exception