|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tuscany.samples.sdo.specExampleSection.UsingTypeAndPropertyWithDataObjects
public class UsingTypeAndPropertyWithDataObjects
Demonstrates the use of Type and Property to display and the META-DATA for and access Properties of a DataObject.
The following sample is from the Apache Tuscany project. It was written to help users
understand and experiement with SDO. It is based upon example code contained
within, and is meant for use with, and reference to the SDO Specification. In general this sample attempts to use the
code and comments contained within the specification, exceptions to this are noted
in comments.
The following sample is based upon the 'Using Type and Property with DataObjects' example from the Examples section of the SDO specification.
The Type interface provides access to the metadata for DataObjects. The methods on Type and Property provide information that describes the
properties of a DataObject. To obtain the Type for a DataObject use the getType() method. This example prints out the contents of a DataObject,
each property has it's meta-data displayed, accessed dynamically using Type and Property.
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:
PrintPropertiesOfDataObject
Constructor Summary | |
---|---|
UsingTypeAndPropertyWithDataObjects()
|
Method Summary | |
---|---|
static void |
main(java.lang.String[] args)
Execute this method in order to run the sample. |
static void |
printDataObject(commonj.sdo.DataObject dataObject,
int indent)
Prints out the contents of a DataObject, each property has it's meta-data displayed, accessed dynamically using Type and Property. |
static void |
printValue(java.lang.Object value,
commonj.sdo.Property property,
int indent)
Prints the value of a property |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UsingTypeAndPropertyWithDataObjects()
Method Detail |
---|
public static void main(java.lang.String[] args)
args
- public static void printDataObject(commonj.sdo.DataObject dataObject, int indent)
dataObject.
- DataObject to be printed.indent.
- For formattingpublic static void printValue(java.lang.Object value, commonj.sdo.Property property, int indent)
value.
- Value of Property to be printedproperty.
- Property to be printedindent.
- For formatting
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |