org.apache.tuscany.samples.sdo.specCodeSnippets
Class CreateDataObjectFromXsdAndXmlFiles

java.lang.Object
  extended by org.apache.tuscany.samples.sdo.specCodeSnippets.CreateDataObjectFromXsdAndXmlFiles

public class CreateDataObjectFromXsdAndXmlFiles
extends java.lang.Object

Demonstrates defining Types by using a predefined xsd resource, and populating a DataObject by using a previously created xml file. The following sample is from the Apache Tuscany project. It was written to help users understand and experiment with SDO. It is based upon code snippets contained within, and is meant for use with, and reference to the SDO Specification.


Uses SdoSampleConstants.PO_XSD_RESOURCE and SdoSampleConstants.PO_XML_RESOURCE in order to define purcahseOrder DataObjects

Usage:
This sample can easily be run from within Eclipse as a Java Application if tuscany or the sample-sdo project is imported into Eclipse as an existing project.

If executing as a standalone application please do the following:


Field Summary
static boolean typesDefined
           
 
Constructor Summary
CreateDataObjectFromXsdAndXmlFiles()
           
 
Method Summary
static commonj.sdo.DataObject createPurchaseOrderDataObjectUsingXmlResource()
          Uses resource SdoSampleConstants.PO_XML_RESOURCE to populate DataObject
static void definePurchaseOrderTypeUsingXsdResource()
          Loads the SdoSampleConstants.PO_XSD_RESOURCE resource in order to define PurchaseOrder Types
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

typesDefined

public static boolean typesDefined
Constructor Detail

CreateDataObjectFromXsdAndXmlFiles

public CreateDataObjectFromXsdAndXmlFiles()
Method Detail

definePurchaseOrderTypeUsingXsdResource

public static void definePurchaseOrderTypeUsingXsdResource()
                                                    throws java.lang.Exception
Loads the SdoSampleConstants.PO_XSD_RESOURCE resource in order to define PurchaseOrder Types

Throws:
java.lang.Exception

createPurchaseOrderDataObjectUsingXmlResource

public static commonj.sdo.DataObject createPurchaseOrderDataObjectUsingXmlResource()
                                                                            throws java.lang.Exception
Uses resource SdoSampleConstants.PO_XML_RESOURCE to populate DataObject

Returns:
populated purchase order DataObject
Throws:
java.lang.Exception

main

public static void main(java.lang.String[] args)
Parameters:
args. - No arguments required


Copyright © 2007 Apache Software Foundation. All Rights Reserved.