org.apache.tuscany.samples.sdo.specCodeSnippets
Class UsingXPath
java.lang.Object
org.apache.tuscany.samples.sdo.specCodeSnippets.UsingXPath
public class UsingXPath
- extends java.lang.Object
Demonstrates accessing a created DataObject's properties using SDO's XPath like syntax.
This 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
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:
- Include the following jar files on your classpath :
- SDO API and Tuscany Implementation
- sdo-api-{version}.jar - SDO API
- tuscany-sdo-impl-{version}.jar - Tuscany SDO implementation
- EMF dependencies.
- emf-common-{version}.jar - some common framework utility and base classes
- emf-ecore-{version}.jar - the EMF core runtime implementation classes (the Ecore metamodel)
- emf-ecore-change-{version}.jar - the EMF change recorder and framework
- emf-ecore-xmi-{version}.jar - EMF's default XML (and XMI) serializer and loader
- xsd-{version}.jar - the XML Schema model
These jar files can be obtained by downloading and unpacking a Tuscany binary distribution
- Execute:
java org.apache.tuscany.samples.sdo.specCodeSnippets.UsingXPath
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UsingXPath
public UsingXPath()
accessDataObjectUsingXPath
public static void accessDataObjectUsingXPath(commonj.sdo.DataObject purchaseOrder)
throws java.lang.Exception
- Prints a subset of item properties to System.out where the individual item was accessed using an xPath expression
- Parameters:
purchaseOrder.
- DataObject defined by Types in SdoSampleConstants.PO_XSD_RESOURCE
- Throws:
java.lang.Exception
main
public static void main(java.lang.String[] args)
- Accesses and modifies properties of a purchase order DataObject using xPath( properties are defined in the xsd
SdoSampleConstants.PO_XSD_RESOURCE
and populated by xml
SdoSampleConstants.PO_XML_RESOURCE
)
- Parameters:
args.
- No parameters required.
Copyright © 2007 Apache Software Foundation. All Rights Reserved.