com.bowstreet.xml.schema
Class SchemaCreator

java.lang.Object
  extended by com.bowstreet.xml.schema.SchemaCreatorComponent
      extended by com.bowstreet.xml.schema.SchemaCreator

public class SchemaCreator
extends SchemaCreatorComponent

Utility class for generating XSD schemas.

Example:
Create a schema and add it to WebApp (sample builder code):
 SchemaCreator schemaCreator = new SchemaCreator("testns", "http://test.bowstreet.com/test");
 SchemaCreatorComponent table = schemaCreator.addComplexType("PersonTable");
 SchemaCreatorComponent row = table.addComplexType("Person", "0", "unbounded");
 row.addAttribute("IsValid", "string");
 row.addSimpleElement("firstName", "string");
 row.addSimpleElement("lastName", "string");
 row.addSimpleElement("hireDate", "dateTime");
 webApp.addSchema("personSchema", schemaCreator.getXML(), null);

Constructor Summary
SchemaCreator(java.lang.String namespacePrefix, java.lang.String namespaceURI)
          Constructor - specify namespace prefix and URI.
 
Method Summary
 void addImport(java.lang.String namespace, java.lang.String schemaLocation)
           
 void addNamespace(java.lang.String namespacePrefix, java.lang.String namespaceURI)
           
 java.lang.String getXML()
          Get the XML for the generated schema.
 void setAttributeFormDefault(boolean qualified)
          Sets the attributeFormDefault to qualified or unqualified.
 void setElementFormDefault(boolean qualified)
          Sets the elementFormDefault to qualified or unqualified.
 
Methods inherited from class com.bowstreet.xml.schema.SchemaCreatorComponent
addAnnotation, addAttribute, addComplexType, addComplexType, addElement, addElementUsingType, addElementUsingType, addElementWithRestrictions, addEnumerations, addLocalComplexType, addLocalComplexType, addRealComplexType, addReferenceToElement, addReferenceToElement, addSimpleContentExtension, addSimpleElement, addSimpleElement, addStringElement, addTopLevelElement, addTopLevelElementWithRestrictions, setMaxLength, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SchemaCreator

public SchemaCreator(java.lang.String namespacePrefix,
                     java.lang.String namespaceURI)
Constructor - specify namespace prefix and URI.

Parameters:
namespacePrefix - The namespace prefix to use.
namespaceURI - The namespace URI to use.
Method Detail

addImport

public void addImport(java.lang.String namespace,
                      java.lang.String schemaLocation)

addNamespace

public void addNamespace(java.lang.String namespacePrefix,
                         java.lang.String namespaceURI)

getXML

public java.lang.String getXML()
Get the XML for the generated schema.

Returns:
The XML for the schema.

setAttributeFormDefault

public void setAttributeFormDefault(boolean qualified)
Sets the attributeFormDefault to qualified or unqualified.


setElementFormDefault

public void setElementFormDefault(boolean qualified)
Sets the elementFormDefault to qualified or unqualified.



Copyright © 2009 IBM. All Rights Reserved.