summaryrefslogtreecommitdiffstats
path: root/sdo-java/tags/1.0-incubator-M3
diff options
context:
space:
mode:
authorlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-11-10 19:20:12 +0000
committerlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-11-10 19:20:12 +0000
commit195774c489a1a671aca514b0afa88332bf9c6ee3 (patch)
treea22cb1f3f70f0c13a9a7049075205072901459aa /sdo-java/tags/1.0-incubator-M3
parentc54bda13cb403d10675a6244bd00b8b536111ad6 (diff)
Moving SDO tags
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@834617 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sdo-java/tags/1.0-incubator-M3')
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo-api/BUILDING.txt26
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo-api/LICENSE.txt241
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo-api/NOTICE.txt32
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo-api/STATUS.txt86
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo-api/pom.xml135
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/ChangeSummary.java207
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/DataGraph.java76
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/DataObject.java1121
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/Property.java115
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/Sequence.java140
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/Type.java166
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/helper/CopyHelper.java85
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/helper/DataFactory.java64
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/helper/DataHelper.java215
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/helper/EqualityHelper.java92
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/helper/HelperContext.java67
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/helper/TypeHelper.java96
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/helper/XMLDocument.java155
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/helper/XMLHelper.java201
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/helper/XSDHelper.java196
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/impl/ExternalizableDelegator.java90
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/impl/HelperProvider.java400
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/impl/NoHelperProviderException.java58
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/resources/xml/datagraph.xsd88
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/resources/xml/sdoJava.xml53
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/resources/xml/sdoJava.xsd88
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/resources/xml/sdoModel.xml92
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/resources/xml/sdoModel.xsd221
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/resources/xml/sdoModelExtended.xsd29
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/resources/xml/sdoXML.xml40
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/resources/xml/sdoXML.xsd56
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo-api/src/test/java/commonj/sdo/impl/HelperProviderTestCase.java90
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo-api/src/test/java/test/DefaultHelperProvider.java71
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo-api/src/test/java/test/TCCL1HelperProvider.java71
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo-api/src/test/resources/default/META-INF/services/commonj.sdo.impl.HelperProvider3
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo-api/src/test/resources/tccl1/META-INF/services/commonj.sdo.impl.HelperProvider1
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/BUILDING.txt52
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/LICENSE.txt342
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/NOTICE.txt32
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/STATUS86
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/distribution/RELEASE_NOTES.txt100
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/distribution/readme.html45
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/model/SDO.ecore980
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/model/SDO.genmodel582
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/model/SDO.mdl7670
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/pom.xml139
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/AnyTypeDataObject.java37
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/SDOExtendedMetaData.java39
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/SDOFactory.java176
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/SDOPackage.java1627
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/SDOTypeVisitor.java49
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/SimpleAnyTypeDataObject.java35
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/codegen/BytecodeInterfaceGenerator.java98
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/codegen/GenerationException.java42
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/codegen/JavaInterfaceGenerator.java179
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/codegen/NoJavaImplementationException.java61
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/BaseSDOExtendedMetaDataImpl.java167
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/BaseSDOXSDEcoreBuilder.java1609
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/CopyHelperImpl.java84
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/CrossScopeCopyHelperImpl.java255
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/DataFactoryImpl.java65
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/DataHelperImpl.java565
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/EqualityHelperImpl.java81
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/HelperContextImpl.java98
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/HelperProviderImpl.java236
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/SDOAnnotations.java51
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/SDOExtendedMetaDataImpl.java285
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/SDOXSDEcoreBuilder.java670
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/SchemaBuilder.java786
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/TypeHelperImpl.java305
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/TypeTable.java254
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/XMLDocumentImpl.java539
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/XMLHelperImpl.java132
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/XMLStreamHelper.java112
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/XMLStreamHelperImpl.java135
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/XSDHelperImpl.java301
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/AnyTypeDataObjectImpl.java299
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/AttributeImpl.java824
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/ChangeSummaryImpl.java800
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/ChangeSummarySettingImpl.java113
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/ClassImpl.java1109
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DataGraphImpl.java852
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DataObjectBase.java425
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DataObjectImpl.java1518
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DataTypeImpl.java781
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DynamicDataObjectImpl.java208
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DynamicStoreDataObjectImpl.java91
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/EnumImpl.java183
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/FactoryBase.java352
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/ReferenceImpl.java781
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/SDOFactoryImpl.java325
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/SDOPackageImpl.java2185
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/SimpleAnyTypeDataObjectImpl.java333
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/StoreDataObjectImpl.java314
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/BaseDataGraphType.java213
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/DataGraphType.java53
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/DataObject.java35
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/ModelFactory.java106
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/ModelsType.java62
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/Property.java503
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/TextType.java57
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/Type.java431
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/Types.java59
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/XSDType.java62
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/BaseDataGraphTypeImpl.java625
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/DataGraphTypeImpl.java258
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/DataObjectImpl.java84
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/ModelFactoryImpl.java2452
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/ModelsTypeImpl.java220
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/PropertyImpl.java1170
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/TextTypeImpl.java206
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/TypeImpl.java1067
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/TypesImpl.java210
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/XSDTypeImpl.java220
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/java/JavaFactory.java61
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/java/JavaInfo.java92
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/java/impl/JavaFactoryImpl.java658
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/java/impl/JavaInfoImpl.java256
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/xml/XMLFactory.java61
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/xml/XMLInfo.java92
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/xml/impl/XMLFactoryImpl.java334
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/xml/impl/XMLInfoImpl.java256
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/BasicSequence.java158
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/DataGraphResourceFactoryImpl.java705
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/DataObjectUtil.java2805
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/SDOUtil.java922
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/StAX2SAXAdapter.java250
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/StreamDeserializer.java92
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/JavaMetaData.java90
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/MetadataFactory.java77
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/SDOMetaDataGroup.java87
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/TypeMetaData.java65
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/XSDMetaData.java66
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/JavaMetaDataImpl.java267
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/MetadataFactoryImpl.java367
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/SDOMetaDataGroupImpl.java285
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/TypeMetaDataImpl.java203
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/XSDMetaDataImpl.java203
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/ChangeSummaryStreamDeserializer.java663
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/ChangeSummaryStreamSerializer.java688
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/DataObjectXMLStreamReader.java1531
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/RecordedEventXMLStreamReader.java868
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/SDODeserializer.java339
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/SDOObjectInputStream.java51
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/SDOObjectOutputStream.java51
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/SDOURIConverterImpl.java55
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/SDOXMLResourceFactoryImpl.java47
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/SDOXMLResourceImpl.java885
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/XMLDocumentStreamReader.java438
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/XMLFragmentStreamReader.java44
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/XMLStreamSerializer.java272
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/resources/META-INF/LICENSE.txt454
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/resources/META-INF/MANIFEST.MF25
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/resources/META-INF/NOTICE28
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/resources/META-INF/README.txt35
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/resources/META-INF/services/commonj.sdo.impl.HelperProvider1
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/resources/sdo-metadata.xsd45
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/resources/xml/sdoModelChangeSummary.xsd28
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/resources/xml/sdoModelExtended.xsd29
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/com/example/simple/Quote.java475
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/com/example/simple/SimpleFactory.java61
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/com/example/simple/impl/QuoteImpl.java1045
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/com/example/simple/impl/SimpleFactoryImpl.java327
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/AllTests.java41
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/AllTests.java47
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/Bar1.java26
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/Bar2.java26
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/BytecodeInterfaceGeneratorTestCase.java167
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/Foo.java26
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/JavaInterfaceGeneratorTestCase.java129
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/MockProperty.java94
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/MockType.java104
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/AllTests.java75
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/AnyTypeTest.java112
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/ChangeSummaryOnDataObjectTestCase.java216
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/ChangeSummaryPropertyTestCase.java219
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/ChangeSummaryTestCase.java92
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/CrossScopeCopyTestCase.java474
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/DataGraphTestCase.java270
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/DataTypeBaseTypeTestCase.java68
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/DateConversionTestCase.java374
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/DefineOpenContentPropertyTestCase.java124
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/DefineTypeTestCase.java684
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/DeserializationNoSchemaTestCase.java108
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/DotNameTest.java78
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/DynamicTypesComparisonTestCase.java256
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/FormTestCase.java112
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/HelperContextTestCase.java75
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/IsManyTestCase.java65
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/JavaSerializeDeserializeTestCase.java297
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/JiraTestCases.java184
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/MetadataInstancePropertiesTestCase.java219
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/MixedTypeTestCase.java89
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/NeverStaleChangeSummaryTestCase.java76
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/OpenTypeTestCase.java110
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/SchemaLocationTestCase.java48
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/SerializeTypesTestCase.java129
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/SimpleCopyTestCase.java71
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/SimpleDynamicTestCase.java123
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/SimpleEqualityTestCase.java63
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/SubstitutionValuesTestCase.java47
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/TestUtil.java285
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/TypeConversionTestCase.java889
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/TypeRoundTripTestCase.java148
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/XMLDocumentTestCase.java110
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/XMLHelperTestCase.java161
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/XMLStreamHelperPerformanceTestCase.java91
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/XMLStreamHelperTestCase.java169
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/XPathTestCase.java125
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/XSDHelperTestCase.java224
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/SchemaLocationTestCase.xml33
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/SequenceChangeSummary.xsd48
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/SubstitutionValues.xsd30
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/TypePropertyMetadataInfo.xsd96
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/XMLDocumentNoNamespaceSchemaLocation.xsd31
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/XMLDocumentSchemaLocation.xsd35
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/XMLDocumentTestCase.xml14
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/XMLStreamHelper.xsd41
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/anytype.xsd36
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/api_test.xsd46
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/bank.xsd78
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/company.xsd44
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/customer1.xml8
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/customer2.xml8
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/datatype.xsd34
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/dotNames.xsd30
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/foo-ext.xml9
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/foo-ext.xsd44
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/foo.xsd232
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/mixed.xml9
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/mixed.xsd41
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/mixed2.xml12
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/mixedChangeSummary.xml11
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/mixedChangeSummaryUndone.xml2
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/mixedopen.xml13
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/names.xsd33
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/open.xml8
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/open.xsd51
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/open1any.xsd44
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/open2.xml9
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/openChangeSummary.xml24
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/openChangeSummaryUndone.xml17
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/openContentProperty.xml12
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/po.xsd62
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/prefix.xsd24
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/quote.xml14
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/quoteInSOAP.xml19
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/sdoModel.xsd28
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/sdoannotations.xsd60
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/sdotypes.xsd71
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/shallowquote.xml11
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/simple.xsd41
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/simple2.xsd41
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/simple3.xsd34
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/simpleWithChangeSummary.xml28
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/simpleWithChangeSummary.xsd49
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/simpleWithChangeSummaryUndone.xml19
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/simplechangesummary.xml33
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/xpath.xml51
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/xpath.xsd75
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/xsdCorners.xsd34
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/plugin/pom.xml57
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/plugin/src/main/java/org/apache/tuscany/sdo/plugin/GeneratorMojo.java309
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/plugin/src/main/java/org/apache/tuscany/sdo/plugin/SchemaFileOption.java194
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/plugin/src/main/resources/META-INF/LICENSE.txt442
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/plugin/src/main/resources/META-INF/NOTICE29
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/plugin/src/main/resources/META-INF/README.txt35
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/pom.xml173
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/sample/LICENSE.txt237
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/sample/NOTICE.txt33
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/sample/README.txt20
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/sample/STATUS.txt86
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/sample/pom.xml109
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/ExecuteSamples.java193
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/SdoSampleConstants.java70
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/otherSources/CreateCompany.java244
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/otherSources/CreatePurchaseOrder.java169
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/otherSources/PurchaseOrderCmdLine.java395
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/otherSources/PurchaseOrderControl.java494
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/otherSources/ReadPurchaseOrder.java139
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/otherSources/package.html40
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/overview.html76
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/package.html33
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specCodeSnippets/AccessDataObjectPropertiesByName.java150
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specCodeSnippets/AccessDataObjectUsingValidXPath.java135
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specCodeSnippets/CreateDataObjectFromXmlString.java160
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specCodeSnippets/CreateDataObjectFromXsdAndXmlFiles.java192
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specCodeSnippets/DynamicCustomerTypeSample.java188
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specCodeSnippets/ObtainingDataGraphFromXml.java184
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specCodeSnippets/PrintPropertiesOfDataObject.java173
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specCodeSnippets/UsingXPath.java140
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specCodeSnippets/package.html40
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specExampleSection/AccessDataObjectsUsingXPath.java249
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specExampleSection/AccessingDataObjectsViaPropertyIndex.java230
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specExampleSection/AccessingTheContentsOfASequence.java192
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specExampleSection/CreatingDataObjectTreesFromXMLDocuments.java134
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specExampleSection/CreatingXmlFromDataObjects.java158
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specExampleSection/SerializingDesearializingADataObject.java181
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specExampleSection/UsingTypeAndPropertyWithDataObjects.java188
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specExampleSection/package.html40
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/resources/company.xsd45
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/resources/companyCompleteDataGraph.xml69
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/resources/companyDataGraph.xml31
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/resources/companyDataGraphGenerated.xml30
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/resources/companyGenerated.xml27
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/resources/doc-files/cmdPrompt.GIFbin0 -> 9431 bytes
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/resources/letter.xml21
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/resources/letter.xsd32
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/resources/po.xml57
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/resources/po.xsd81
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/sdo.xml63
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/pom.xml100
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/readme.htm44
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/Interface2JavaGenerator.java244
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/JavaGenerator.java621
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/XSD2JavaGenerator.java193
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/adapter/SDOGenClassGeneratorAdapter.java46
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/adapter/SDOGenModelGeneratorAdapterFactory.java54
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/adapter/SDOGenPackageGeneratorAdapter.java52
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/templates/model/SDOClass.java4281
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/templates/model/SDOFactoryClass.java1153
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/util/SDOGenUtil.java245
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/java/org/eclipse/jdt/core/formatter/CodeFormatter.java27
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/resources/META-INF/LICENSE.txt483
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/resources/META-INF/MANIFEST.MF21
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/resources/META-INF/NOTICE28
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/resources/META-INF/README.txt35
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/noInterfaces/simple/Quote.java1237
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/noInterfaces/simple/SimpleFactory.java333
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/repchoice/RCType.java103
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/repchoice/RepchoiceFactory.java61
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/repchoice/impl/RCTypeImpl.java325
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/repchoice/impl/RepchoiceFactoryImpl.java270
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/MixedQuote.java491
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/MixedRepeatingChoice.java102
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/RepeatingChoice.java88
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/SequencesFactory.java97
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/TwoRCs.java184
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/TwoRCsMixed.java198
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/impl/MixedQuoteImpl.java757
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/impl/MixedRepeatingChoiceImpl.java327
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/impl/RepeatingChoiceImpl.java291
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/impl/SequencesFactoryImpl.java771
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/impl/TwoRCsImpl.java515
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/impl/TwoRCsMixedImpl.java493
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/simple/Quote.java475
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/simple/SimpleFactory.java61
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/simple/cs/CSFactory.java70
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/simple/cs/Quote.java475
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/simple/cs/QuoteBase.java91
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/simple/cs/impl/CSFactoryImpl.java369
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/simple/cs/impl/QuoteBaseImpl.java346
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/simple/cs/impl/QuoteImpl.java1045
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/simple/impl/QuoteImpl.java1045
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/simple/impl/SimpleFactoryImpl.java327
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/subgroup/A.java108
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/subgroup/B.java92
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/subgroup/Bprime.java90
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/subgroup/SubgroupFactory.java80
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/subgroup/impl/AImpl.java310
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/subgroup/impl/BImpl.java256
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/subgroup/impl/BprimeImpl.java264
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/subgroup/impl/SubgroupFactoryImpl.java352
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/AllTests.java49
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/ChangeSummaryGenTestCase.java71
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/CreateTestClasses.java46
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/GenPatternsTestCase.java115
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/InheritanceTestCase.java102
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/SimpleStaticTestCase.java86
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/TestUtil.java288
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/TUSCANY1050.xsd44
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/enum.xsd50
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/mixedRepeatingChoiceTestResult.xml20
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/mixedStaticTestResult.xml27
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/repeatingChoice.xsd33
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/repeatingChoiceTestResult.xml25
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/sdoModel.xsd28
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/sequences.xsd100
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/simple.xsd41
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/simpleWithChangeSummary.xsd49
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/subgroup.xsd48
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/subgroup1.xml23
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/twoRepeatingChoicesMixedTestResult.xml20
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/twoRepeatingChoicesTestResult.xml28
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/templates/Header.javajetinc6
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/templates/models/SDOClass.javajet1948
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/templates/models/SDOFactoryClass.javajet640
-rw-r--r--sdo-java/tags/1.0-incubator-M3/sdo/tools/templates/models/generator.skeleton25
388 files changed, 100993 insertions, 0 deletions
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo-api/BUILDING.txt b/sdo-java/tags/1.0-incubator-M3/sdo-api/BUILDING.txt
new file mode 100644
index 0000000000..86d5594223
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo-api/BUILDING.txt
@@ -0,0 +1,26 @@
+Building the SDO Java Specification Project from the source distribution
+=========================================================================
+(note, these instructions are for building the SDO binary release from
+source, not for establishing a development environment. If you wish to
+participate in sdo development, follow the instructions at
+http://cwiki.apache.org/confluence/display/TUSCANY/Developing+SDO+Java)
+
+Initial Setup
+-------------
+
+1) Install J2SE JDK 1.4.2 or above
+2) Install Maven:
+Download Maven 2.0.4 (download from http://maven.apache.org/download.html).
+
+
+
+Building
+--------
+
+1) Change to the top level directory of the Tuscany SDO Java Spec project (<archive-root>/sdo-api) of this source distribution.
+2) Execute: mvn
+This will build an artefact in your local maven repository that the SDO implementation can use.
+
+Note: Depending on the load being experienced by remote Maven 2.0 repositories you may have to execute mvn several times
+ until required dependencies are all located in your local maven repository. After you have completed a full successful
+ build you can use "mvn -o" which is much faster.
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo-api/LICENSE.txt b/sdo-java/tags/1.0-incubator-M3/sdo-api/LICENSE.txt
new file mode 100644
index 0000000000..5d88d9bbae
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo-api/LICENSE.txt
@@ -0,0 +1,241 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+
+
+
+
+===============================================================================================================
+
+
+License for the Service Data Objects JavaDoc and Interface Definition files. (sdo-api-r2.1-1.0-incubator-M3.jar)
+
+Permission to copy, make derivative works of, and distribute the Service Data Objects
+JavaDoc and Interface Definition Files files in any medium without fee or royalty as part
+of a compliant implementation of the Service Data Objects Specification is hereby granted.
+The Service Data Objects Specification may be found at any of the following locations:
+
+http://osoa.org/display/Main/Service+Data+Objects+Specifications
+http://dev2dev.bea.com/technologies/commonj/index.jsp
+http://www.ibm.com/developerworks/library/specification/ws-sdo/
+http://oracle.com/technology/webservices/sca
+https://www.sdn.sap.com/
+http://www.xcalia/xdn/specs/sdo
+
+THE SERVICE DATA OBJECTS SPECIFICATION AND THE JAVADOC AND INTERFACE DEFINITION FILES
+ARE PROVIDED "AS IS," AND THE AUTHORS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS
+SPECIFICATION OR THE JAVADOC AND INTERFACE DEFINITION FILES AND THE IMPLEMENTATION OF THEIR CONTENTS,
+INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
+NON-INFRINGEMENT OR TITLE. THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL,
+INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO ANY USE OR DISTRIBUTION OF THE
+SERVICE DATA OBJECTS SPECIFICATION OR THE JAVADOC OR INTERFACE DEFINTION FILES.
+
+The name and trademarks of the Authors may NOT be used in any manner, including advertising or
+publicity pertaining to the Service Component Architecture Specification or its contents without specific,
+written prior permission. Title to copyright in the Service Data Objects Specification and the
+JavaDoc and Interface Definition Files will at all times remain with the Authors.
+
+No other rights are granted by implication, estoppel or otherwise.
+
+
+
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo-api/NOTICE.txt b/sdo-java/tags/1.0-incubator-M3/sdo-api/NOTICE.txt
new file mode 100644
index 0000000000..e9d98fc7f5
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo-api/NOTICE.txt
@@ -0,0 +1,32 @@
+Apache Tuscany SDO for Java
+Copyright 2006, 2007 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+Apache Tuscany is an effort undergoing incubation at The Apache Software Foundation (ASF),
+sponsored by the Apache Web Services PMC. Incubation is required of all newly accepted
+projects until a further review indicates that the infrastructure, communications,
+and decision making process have stabilized in a manner consistent with other successful
+ASF projects. While incubation status is not necessarily a reflection of the completeness
+or stability of the code, it does indicate that the project has yet to be fully endorsed
+by the ASF.
+
+Unless otherwise indicated, all distribution made available by the Apache Software Foundation
+is provided to you under the terms and conditions of the Apache License Version 2.0 ("AL").
+A copy of the AL is provided with this distribution as the LICENSE.txt file present in the
+root directory, and is also available at http://www.apache.org/licenses/.
+
+The terms and conditions governing the distribution may refer to the AL or other license
+agreements, notices or terms and conditions. Some of these other license agreements may
+include (but are not limited to):
+
+ . Eclipse Public License Version 1.0 (available at http://www.eclipse.org/legal/epl-v10.html)
+
+It is your obligation to read and accept all such terms and conditions prior to use of the
+distribution. If term or condition is provided, please contact the Apache Software Foundation
+to determine what terms and conditions govern that particular distribution.
+
+This product also includes software developed by the Open Service Oriented Architecture organisation
+(http://osoa.org). The license for this software may be found in the LICENSE.txt file contained in this
+distribution.
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo-api/STATUS.txt b/sdo-java/tags/1.0-incubator-M3/sdo-api/STATUS.txt
new file mode 100644
index 0000000000..99ab4398d1
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo-api/STATUS.txt
@@ -0,0 +1,86 @@
+Apache Tuscany Status
+
+Tuscany provides multiple language implementations of the Service Component Architecture (SCA) specifications and related technologies such as SDO.
+
+PROJECT STATUS
+==============
+
+ Tuscany is being incubated at the request of the Apache Web Services PMC.
+ For information on incubation please visit the project page at
+ http://incubator.apache.org/projects/tuscany.html
+
+
+Pending Issues
+==============
+none
+
+RESOLVED ISSUES SINCE LAST STATUS
+=================================
+2005-12-28 CCLA received for IBM's contribution of a C++ implementation
+2005-12-28 CCLA received for BEA and IBM joint contribution of a Java implementation
+
+OTHER NEWS
+==========
+
+2007-01-22 Vote to add Simon Laws as a new committer
+2006-12-24 Java SCA Milestone 2 release
+2006-11-20 Java DAS Milestone 2 release
+2006-11-14 Java SDO Milestone 2 release
+2006-11-10 Vote to add Luciano Resende as a new commiter
+2006-11-07 Vote to add Rajith Attapattu
+2006-11-03 C++ Milestone 2 release
+2006-10-19 Voted to release pom and buildtools for Java M2 release
+2006-09-29 Vote to add Ignacio Silva-Lepe as a new committer
+2006-09-18 Vote to add Venkata Krishnan as a new committer
+2006-08-10 Vote to add Andrew Borley as a new committer
+2006-08-07 Vote to add Meeraj Kunnumpurath as a new committer
+2006-08-07 Vote to add Kelvin Goodson as a new committer
+2006-08-06 Vote to add Brent Daniel as a new committer
+2006-08-04 Vote to add Raymond Feng as a new committer
+2006-08-01 C++ Milestone 1 release
+2006-06-07 Java Milestone 1 release
+2006-05-02 Vote to add Dan Kulp as a new committer
+2006-03-01 Vote to add Ant Elder as a new committer
+
+2006-01-05 Contribution of Java implementation by BEA and IBM committed
+2006-01-05 Contribution of C+ implementation by IBM committed
+
+RELEASE STATUS
+==============
+None
+
+REFERENCES
+==========
+Status file http://svn.apache.org/repos/asf/incubator/tuscany/STATUS
+User List tuscany-user@ws.apache.org
+Developer List tuscany-dev@ws.apache.org
+Commits List tuscany-commits@ws.apache.org
+Source Code http://svn.apache.org/repos/asf/incubator/tuscany/
+Issue Tracking http://issues.apache.org/jira/browse/TUSCANY
+
+Committers
+ ajborley Andrew Borley
+ antelder Ant Elder
+ bdaniel Brent Daniel
+ dkulp Dan Kulp
+ dims Davanum Srinivas
+ edslattery Ed Slattery
+ ekoneil Eddie O'Neil
+ frankb Frank Budinsky
+ geirm Geir Magnusson Jr
+ isilval Ignacio Silva-Lepe
+ jsdelfino Jean-Sebastien Delfino
+ jboynes Jeremy Boynes
+ jmarino Jim Marino
+ kelvingoodson Kelvin Goodson
+ kentam Ken Tam
+ kwilliams Kevin Williams
+ lresende Luciano Resende
+ edwardsmj Mike Edwards
+ meerajk Meeraj Kunnumpurath
+ rajith Rajith Attapattu
+ rfeng Raymond Feng
+ robbinspg Pete Robbins
+ rineholt Rick Rineholt
+ slaws Simon Laws
+ svkrish Venkata Krishnan \ No newline at end of file
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo-api/pom.xml b/sdo-java/tags/1.0-incubator-M3/sdo-api/pom.xml
new file mode 100644
index 0000000000..82c2ded1ac
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo-api/pom.xml
@@ -0,0 +1,135 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany</groupId>
+ <artifactId>parent</artifactId>
+ <version>2-incubating</version>
+ </parent>
+ <groupId>commonj</groupId>
+ <artifactId>sdo-api-r${specVersion}</artifactId>
+ <packaging>osgi-bundle</packaging>
+ <version>1.0-incubator-M3</version>
+ <name>SDO API</name>
+ <description>API classes for Service Data Objects</description>
+
+ <properties>
+ <specVersion>2.1</specVersion>
+ </properties>
+
+ <!-- definition of repositories where the parent pom can be found -->
+ <repositories>
+ <repository>
+ <id>apache.snapshots</id>
+ <name>Apache Snapshot Repository</name>
+ <url>http://people.apache.org/repo/m2-snapshot-repository</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ <repository>
+ <id>apache.incubator</id>
+ <name>Apache Incubator Repository</name>
+ <url>http://people.apache.org/repo/m2-incubating-repository/</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.3</version>
+ <configuration>
+ <includes>
+ <include>**/*TestCase.java</include>
+ </includes>
+ <reportFormat>brief</reportFormat>
+ <useFile>false</useFile>
+ <forkMode>once</forkMode>
+ <argLine>-ea</argLine>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.4</source>
+ <target>1.4</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix.plugins</groupId>
+ <artifactId>maven-osgi-plugin</artifactId>
+ <version>0.8.0-SNAPSHOT</version>
+ <extensions>true</extensions>
+ <configuration>
+ <osgiManifest>
+ <bundleName>${pom.name}</bundleName>
+ <bundleDescription>${pom.description}</bundleDescription>
+ <bundleVendor>${pom.organization.name}</bundleVendor>
+ <bundleLocalization>plugin</bundleLocalization>
+ <bundleSymbolicName>commonj.sdo</bundleSymbolicName>
+ <exportPackage>
+ commonj.sdo;version="${specVersion}",commonj.sdo.helper;version="${specVersion}",commonj.sdo.impl;version="${specVersion}"
+ </exportPackage>
+ </osgiManifest>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <version>2.0</version>
+ </configuration>
+ <executions>
+ <execution>
+ <id>package</id>
+ <phase>package</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ <defaultGoal>install</defaultGoal>
+ </build>
+</project>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/ChangeSummary.java b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/ChangeSummary.java
new file mode 100644
index 0000000000..72d694da45
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/ChangeSummary.java
@@ -0,0 +1,207 @@
+/**
+ * <copyright>
+ *
+ * Service Data Objects
+ * Version 2.1.0
+ * Licensed Materials
+ *
+ * (c) Copyright BEA Systems, Inc., International Business Machines Corporation,
+ * Oracle Corporation, Primeton Technologies Ltd., Rogue Wave Software, SAP AG.,
+ * Software AG., Sun Microsystems, Sybase Inc., Xcalia, Zend Technologies,
+ * 2005, 2006. All rights reserved.
+ *
+ * </copyright>
+ *
+ */
+
+package commonj.sdo;
+
+import java.util.List;
+
+/**
+ * A change summary is used to record changes to DataObjects,
+ * allowing applications to efficiently and incrementally update back-end storage when required.
+ */
+public interface ChangeSummary
+{
+ /**
+ * Indicates whether change logging is on (<code>true</code>) or off (<code>false</code>).
+ * @return <code>true</code> if change logging is on.
+ * @see #beginLogging
+ * @see #endLogging
+ */
+ boolean isLogging();
+
+ /**
+ * Returns the {@link DataGraph data graph} associated with this change summary or null.
+ * @return the data graph.
+ * @see DataGraph#getChangeSummary
+ */
+ DataGraph getDataGraph();
+
+ /**
+ * Returns a list consisting of all the {@link DataObject data objects} that have been changed while {@link #isLogging logging}.
+ * <p>
+ * The {@link #isCreated new} and {@link #isModified modified} objects in the List are references to objects
+ * associated with this ChangeSummary.
+ * The {@link #isDeleted deleted} objects in the List are references to objects
+ * at the time that event logging was enabled;
+ * <p> Each changed object must have exactly one of the following methods return true:
+ * {@link #isCreated isCreated},
+ * {@link #isDeleted isDeleted}, or
+ * {@link #isModified isModified}.
+ * @return a list of changed data objects.
+ * @see #isCreated(DataObject)
+ * @see #isDeleted(DataObject)
+ * @see #isModified(DataObject)
+ */
+ List /*DataObject*/ getChangedDataObjects();
+
+ /**
+ * Returns whether or not the specified data object was created while {@link #isLogging logging}.
+ * Any object that was added to the scope
+ * but was not in the scope when logging began,
+ * will be considered created.
+ * @param dataObject the data object in question.
+ * @return <code>true</code> if the specified data object was created.
+ * @see #getChangedDataObjects
+ */
+ boolean isCreated(DataObject dataObject);
+
+ /**
+ * Returns whether or not the specified data object was deleted while {@link #isLogging logging}.
+ * Any object that is not in scope but was in scope when logging began
+ * will be considered deleted.
+ * @param dataObject the data object in question.
+ * @return <code>true</code> if the specified data object was deleted.
+ * @see #getChangedDataObjects
+ */
+ boolean isDeleted(DataObject dataObject);
+
+ /**
+ * A setting encapsulates a {@link Property property} and a corresponding single value of the property's {@link Property#getType type}.
+ */
+ public interface Setting
+ {
+ /**
+ * Returns the property of the setting.
+ * @return the setting property.
+ */
+ Property getProperty();
+
+ /**
+ * Returns the value of the setting.
+ * @return the setting value.
+ */
+ Object getValue();
+
+ /**
+ * Returns whether or not the property is set.
+ * @return <code>true</code> if the property is set.
+ */
+ boolean isSet();
+ }
+
+ /**
+ * Returns a list of {@link ChangeSummary.Setting settings}
+ * that represent the property values of the given <code>dataObject</code>
+ * at the point when logging {@link #beginLogging() began}.
+ * <p>In the case of a {@link #isDeleted(DataObject) deleted} object,
+ * the List will include settings for all the Properties.
+ * <p> An old value setting indicates the value at the
+ * point logging begins. A setting is only produced for
+ * {@link #isModified modified} objects if
+ * either the old value differs from the current value or
+ * if the isSet differs from the current value.
+ * <p> No settings are produced for {@link #isCreated created} objects.
+ * @param dataObject the object in question.
+ * @return a list of settings.
+ * @see #getChangedDataObjects
+ */
+ List /*ChangeSummary.Setting*/ getOldValues(DataObject dataObject);
+
+ /**
+ * Clears the List of {@link #getChangedDataObjects changes} and turns change logging on.
+ * No operation occurs if logging is already on.
+ * @see #endLogging
+ * @see #isLogging
+ */
+ void beginLogging();
+
+ /**
+ * An implementation that requires logging may throw an UnsupportedOperationException.
+ * Turns change logging off. No operation occurs if logging is already off.
+ * @see #beginLogging
+ * @see #isLogging
+ */
+ void endLogging();
+
+
+ /**
+ * Returns whether or not the specified data object was updated while {@link #isLogging logging}.
+ * An object that was contained in the scope when logging began
+ * and remains in the scope when logging ends will be considered potentially modified.
+ * <p> An object considered modified must have at least one old value setting.
+ * @param dataObject the data object in question.
+ * @return <code>true</code> if the specified data object was modified.
+ * @see #getChangedDataObjects
+ */
+ boolean isModified(DataObject dataObject);
+
+ /**
+ * Returns the ChangeSummary root DataObject - the object from which
+ * changes are tracked.
+ * When a DataGraph is used, this is the same as getDataGraph().getRootObject().
+ * @return the ChangeSummary root DataObject
+ */
+ DataObject getRootObject();
+
+ /**
+ * Returns a {@link ChangeSummary.Setting setting} for the specified property
+ * representing the property value of the given <code>dataObject</code>
+ * at the point when logging {@link #beginLogging() began}.
+ * <p>Returns null if the property was not modified and
+ * has not been {@link #isDeleted(DataObject) deleted}.
+ * @param dataObject the object in question.
+ * @param property the property of the object.
+ * @return the Setting for the specified property.
+ * @see #getChangedDataObjects
+ */
+ Setting getOldValue(DataObject dataObject, Property property);
+
+ /**
+ * Returns the value of the {@link DataObject#getContainer container} data object
+ * at the point when logging {@link #beginLogging() began}.
+ * @param dataObject the object in question.
+ * @return the old container data object.
+ */
+ DataObject getOldContainer(DataObject dataObject);
+
+ /**
+ * Returns the value of the {@link DataObject#getContainmentProperty containment property} data object property
+ * at the point when logging {@link #beginLogging() began}.
+ * @param dataObject the object in question.
+ * @return the old containment property.
+ */
+ Property getOldContainmentProperty(DataObject dataObject);
+
+ /**
+ * Returns the value of the {@link DataObject#getSequence sequence} for the data object
+ * at the point when logging {@link #beginLogging() began}.
+ * @param dataObject the object in question.
+ * @return the old containment property.
+ */
+ Sequence getOldSequence(DataObject dataObject);
+
+ /**
+ * This method is intended for use by service implementations only.
+ * Undoes all changes in the log to restore the tree of
+ * DataObjects to its original state when logging began.
+ * isLogging() is unchanged. The log is cleared.
+ * @see #beginLogging
+ * @see #endLogging
+ * @see #isLogging
+ */
+ void undoChanges();
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/DataGraph.java b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/DataGraph.java
new file mode 100644
index 0000000000..f583cbf0a3
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/DataGraph.java
@@ -0,0 +1,76 @@
+/**
+ * <copyright>
+ *
+ * Service Data Objects
+ * Version 2.1.0
+ * Licensed Materials
+ *
+ * (c) Copyright BEA Systems, Inc., International Business Machines Corporation,
+ * Oracle Corporation, Primeton Technologies Ltd., Rogue Wave Software, SAP AG.,
+ * Software AG., Sun Microsystems, Sybase Inc., Xcalia, Zend Technologies,
+ * 2005, 2006. All rights reserved.
+ *
+ * </copyright>
+ *
+ */
+
+package commonj.sdo;
+
+import java.io.Serializable;
+
+/**
+ * A data graph is used to package a graph of {@link DataObject data objects} along with their
+ * metadata, that is, data describing the data.
+ * A data graph also contains a {@link #getChangeSummary change summary}
+ * which is used to record changes made to the objects in the graph.
+ */
+
+public interface DataGraph extends Serializable
+{
+ /**
+ * Returns the root {@link DataObject data object} of this data graph.
+ * @return the root data object.
+ * @see DataObject#getDataGraph
+ */
+ DataObject getRootObject();
+
+ /**
+ * Returns the {@link ChangeSummary change summary} associated with this data graph.
+ * @return the change summary.
+ * @see ChangeSummary#getDataGraph
+ */
+ ChangeSummary getChangeSummary();
+
+ /**
+ * Returns the {@link Type type} with the given the {@link Type#getURI() URI},
+ * or contained by the resource at the given URI,
+ * and with the given {@link Type#getName name}.
+ * @param uri the namespace URI of a type or the location URI of a resource containing a type.
+ * @param typeName name of a type.
+ * @return the type with the corresponding namespace and name.
+ */
+ Type getType(String uri, String typeName);
+
+ /**
+ * Creates a new root data object of the {@link #getType specified type}.
+ * An exception is thrown if a root object exists.
+ * @param namespaceURI namespace of the type.
+ * @param typeName name of the type.
+ * @return the new root.
+ * @throws IllegalStateException if the root object already exists.
+ * @see #createRootObject(Type)
+ * @see #getType(String, String)
+ */
+ DataObject createRootObject(String namespaceURI, String typeName);
+
+ /**
+ * Creates a new root data object of the specified type.
+ * An exception is thrown if a root object exists.
+ * @param type the type of the new root.
+ * @return the new root.
+ * @throws IllegalStateException if the root object already exists.
+ * @see #createRootObject(String, String)
+ */
+ DataObject createRootObject(Type type);
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/DataObject.java b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/DataObject.java
new file mode 100644
index 0000000000..fb592fcf58
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/DataObject.java
@@ -0,0 +1,1121 @@
+/**
+ * <copyright>
+ *
+ * Service Data Objects
+ * Version 2.1.0
+ * Licensed Materials
+ *
+ * (c) Copyright BEA Systems, Inc., International Business Machines Corporation,
+ * Oracle Corporation, Primeton Technologies Ltd., Rogue Wave Software, SAP AG.,
+ * Software AG., Sun Microsystems, Sybase Inc., Xcalia, Zend Technologies,
+ * 2005, 2006. All rights reserved.
+ *
+ * </copyright>
+ *
+ */
+
+package commonj.sdo;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * A data object is a representation of some structured data.
+ * It is the fundamental component in the SDO (Service Data Objects) package.
+ * Data objects support reflection, path-based accesss, convenience creation and deletion methods,
+ * and the ability to be part of a {@link DataGraph data graph}.
+ * <p>
+ * Each data object holds its data as a series of {@link Property Properties}.
+ * Properties can be accessed by name, property index, or using the property meta object itself.
+ * A data object can also contain references to other data objects, through reference-type Properties.
+ * <p>
+ * A data object has a series of convenience accessors for its Properties.
+ * These methods either use a path (String),
+ * a property index,
+ * or the {@link Property property's meta object} itself, to identify the property.
+ * Some examples of the path-based accessors are as follows:
+ *<pre>
+ * DataObject company = ...;
+ * company.get("name"); is the same as company.get(company.getType().getProperty("name"))
+ * company.set("name", "acme");
+ * company.get("department.0/name") is the same as ((DataObject)((List)company.get("department")).get(0)).get("name")
+ * .n indexes from 0 ... implies the name property of the first department
+ * company.get("department[1]/name") [] indexes from 1 ... implies the name property of the first department
+ * company.get("department[number=123]") returns the first department where number=123
+ * company.get("..") returns the containing data object
+ * company.get("/") returns the root containing data object
+ *</pre>
+ * <p> There are general accessors for Properties, i.e., {@link #get(Property) get} and {@link #set(Property, Object) set},
+ * as well as specific accessors for the primitive types and commonly used data types like
+ * String, Date, List, BigInteger, and BigDecimal.
+ */
+public interface DataObject extends Serializable
+{
+ /**
+ * Returns the value of a property of either this object or an object reachable from it, as identified by the
+ * specified path.
+ * @param path the path to a valid object and property.
+ * @return the value of the specified property.
+ * @see #get(Property)
+ */
+ Object get(String path);
+
+ /**
+ * Sets a property of either this object or an object reachable from it, as identified by the specified path,
+ * to the specified value.
+ * @param path the path to a valid object and property.
+ * @param value the new value for the property.
+ * @see #set(Property, Object)
+ */
+ void set(String path, Object value);
+
+ /**
+ * Returns whether a property of either this object or an object reachable from it, as identified by the specified path,
+ * is considered to be set.
+ * @param path the path to a valid object and property.
+ * @see #isSet(Property)
+ */
+ boolean isSet(String path);
+
+ /**
+ * Unsets a property of either this object or an object reachable from it, as identified by the specified path.
+ * @param path the path to a valid object and property.
+ * @see #unset(Property)
+ */
+ void unset(String path);
+
+ /**
+ * Returns the value of a <code>boolean</code> property identified by the specified path.
+ * @param path the path to a valid object and property.
+ * @return the <code>boolean</code> value of the specified property.
+ * @see #get(String)
+ */
+ boolean getBoolean(String path);
+
+ /**
+ * Returns the value of a <code>byte</code> property identified by the specified path.
+ * @param path the path to a valid object and property.
+ * @return the <code>byte</code> value of the specified property.
+ * @see #get(String)
+ */
+ byte getByte(String path);
+
+ /**
+ * Returns the value of a <code>char</code> property identified by the specified path.
+ * @param path the path to a valid object and property.
+ * @return the <code>char</code> value of the specified property.
+ * @see #get(String)
+ */
+ char getChar(String path);
+
+ /**
+ * Returns the value of a <code>double</code> property identified by the specified path.
+ * @param path the path to a valid object and property.
+ * @return the <code>double</code> value of the specified property.
+ * @see #get(String)
+ */
+ double getDouble(String path);
+
+ /**
+ * Returns the value of a <code>float</code> property identified by the specified path.
+ * @param path the path to a valid object and property.
+ * @return the <code>float</code> value of the specified property.
+ * @see #get(String)
+ */
+ float getFloat(String path);
+
+ /**
+ * Returns the value of a <code>int</code> property identified by the specified path.
+ * @param path the path to a valid object and property.
+ * @return the <code>int</code> value of the specified property.
+ * @see #get(String)
+ */
+ int getInt(String path);
+
+ /**
+ * Returns the value of a <code>long</code> property identified by the specified path.
+ * @param path the path to a valid object and property.
+ * @return the <code>long</code> value of the specified property.
+ * @see #get(String)
+ */
+ long getLong(String path);
+
+ /**
+ * Returns the value of a <code>short</code> property identified by the specified path.
+ * @param path the path to a valid object and property.
+ * @return the <code>short</code> value of the specified property.
+ * @see #get(String)
+ */
+ short getShort(String path);
+
+ /**
+ * Returns the value of a <code>byte[]</code> property identified by the specified path.
+ * @param path the path to a valid object and property.
+ * @return the <code>byte[]</code> value of the specified property.
+ * @see #get(String)
+ */
+ byte[] getBytes(String path);
+
+ /**
+ * Returns the value of a <code>BigDecimal</code> property identified by the specified path.
+ * @param path the path to a valid object and property.
+ * @return the <code>BigDecimal</code> value of the specified property.
+ * @see #get(String)
+ */
+ BigDecimal getBigDecimal(String path);
+
+ /**
+ * Returns the value of a <code>BigInteger</code> property identified by the specified path.
+ * @param path the path to a valid object and property.
+ * @return the <code>BigInteger</code> value of the specified property.
+ * @see #get(String)
+ */
+ BigInteger getBigInteger(String path);
+
+ /**
+ * Returns the value of a <code>DataObject</code> property identified by the specified path.
+ * @param path the path to a valid object and property.
+ * @return the <code>DataObject</code> value of the specified property.
+ * @see #get(String)
+ */
+ DataObject getDataObject(String path);
+
+ /**
+ * Returns the value of a <code>Date</code> property identified by the specified path.
+ * @param path the path to a valid object and property.
+ * @return the <code>Date</code> value of the specified property.
+ * @see #get(String)
+ */
+ Date getDate(String path);
+
+ /**
+ * Returns the value of a <code>String</code> property identified by the specified path.
+ * @param path the path to a valid object and property.
+ * @return the <code>String</code> value of the specified property.
+ * @see #get(String)
+ */
+ String getString(String path);
+
+ /**
+ * Returns the value of a <code>List</code> property identified by the specified path.
+ * @param path the path to a valid object and property.
+ * @return the <code>List</code> value of the specified property.
+ * @see #get(String)
+ */
+ List getList(String path);
+
+ /**
+ * @see #getSequence()
+ * Returns the value of a <code>Sequence</code> property identified by the specified path.
+ * An implementation may throw an UnsupportedOperationException.
+ * @param path the path to a valid object and property.
+ * @return the <code>Sequence</code> value of the specified property.
+ * @see #get(String)
+ * @deprecated in 2.1.0.
+ */
+ Sequence getSequence(String path);
+
+ /**
+ * Sets the value of a <code>boolean</code> property identified by the specified path, to the specified value.
+ * @param path the path to a valid object and property.
+ * @param value the new value for the property.
+ * @see #set(String, Object)
+ */
+ void setBoolean(String path, boolean value);
+
+ /**
+ * Sets the value of a <code>byte</code> property identified by the specified path, to the specified value.
+ * @param path the path to a valid object and property.
+ * @param value the new value for the property.
+ * @see #set(String, Object)
+ */
+ void setByte(String path, byte value);
+
+ /**
+ * Sets the value of a <code>char</code> property identified by the specified path, to the specified value.
+ * @param path the path to a valid object and property.
+ * @param value the new value for the property.
+ * @see #set(String, Object)
+ */
+ void setChar(String path, char value);
+
+ /**
+ * Sets the value of a <code>double</code> property identified by the specified path, to the specified value.
+ * @param path the path to a valid object and property.
+ * @param value the new value for the property.
+ * @see #set(String, Object)
+ */
+ void setDouble(String path, double value);
+
+ /**
+ * Sets the value of a <code>float</code> property identified by the specified path, to the specified value.
+ * @param path the path to a valid object and property.
+ * @param value the new value for the property.
+ * @see #set(String, Object)
+ */
+ void setFloat(String path, float value);
+
+ /**
+ * Sets the value of a <code>int</code> property identified by the specified path, to the specified value.
+ * @param path the path to a valid object and property.
+ * @param value the new value for the property.
+ * @see #set(String, Object)
+ */
+ void setInt(String path, int value);
+
+ /**
+ * Sets the value of a <code>long</code> property identified by the specified path, to the specified value.
+ * @param path the path to a valid object and property.
+ * @param value the new value for the property.
+ * @see #set(String, Object)
+ */
+ void setLong(String path, long value);
+
+ /**
+ * Sets the value of a <code>short</code> property identified by the specified path, to the specified value.
+ * @param path the path to a valid object and property.
+ * @param value the new value for the property.
+ * @see #set(String, Object)
+ */
+ void setShort(String path, short value);
+
+ /**
+ * Sets the value of a <code>byte[]</code> property identified by the specified path, to the specified value.
+ * @param path the path to a valid object and property.
+ * @param value the new value for the property.
+ * @see #set(String, Object)
+ */
+ void setBytes(String path, byte[] value);
+
+ /**
+ * Sets the value of a <code>BigDecimal</code> property identified by the specified path, to the specified value.
+ * @param path the path to a valid object and property.
+ * @param value the new value for the property.
+ * @see #set(String, Object)
+ */
+ void setBigDecimal(String path, BigDecimal value);
+
+ /**
+ * Sets the value of a <code>BigInteger</code> property identified by the specified path, to the specified value.
+ * @param path the path to a valid object and property.
+ * @param value the new value for the property.
+ * @see #set(String, Object)
+ */
+ void setBigInteger(String path, BigInteger value);
+
+ /**
+ * Sets the value of a <code>DataObject</code> property identified by the specified path, to the specified value.
+ * @param path the path to a valid object and property.
+ * @param value the new value for the property.
+ * @see #set(String, Object)
+ */
+ void setDataObject(String path, DataObject value);
+
+ /**
+ * Sets the value of a <code>Date</code> property identified by the specified path, to the specified value.
+ * @param path the path to a valid object and property.
+ * @param value the new value for the property.
+ * @see #set(String, Object)
+ */
+ void setDate(String path, Date value);
+
+ /**
+ * Sets the value of a <code>String</code> property identified by the specified path, to the specified value.
+ * @param path the path to a valid object and property.
+ * @param value the new value for the property.
+ * @see #set(String, Object)
+ */
+ void setString(String path, String value);
+
+ /**
+ * Sets the value of a <code>List</code> property identified by the specified path, to the specified value.
+ * @param path the path to a valid object and property.
+ * @param value the new value for the property.
+ * @see #set(String, Object)
+ * @see #setList(Property, List)
+ */
+ void setList(String path, List value);
+
+ /**
+ * Returns the value of the property at the specified index in {@link Type#getProperties property list}
+ * of this object's {@link Type type}.
+ * @param propertyIndex the index of the property.
+ * @return the value of the specified property.
+ * @see #get(Property)
+ */
+ Object get(int propertyIndex);
+
+ /**
+ * Sets the property at the specified index in {@link Type#getProperties property list} of this object's
+ * {@link Type type}, to the specified value.
+ * @param propertyIndex the index of the property.
+ * @param value the new value for the property.
+ * @see #set(Property, Object)
+ */
+ void set(int propertyIndex, Object value);
+
+ /**
+ * Returns whether the the property at the specified index in {@link Type#getProperties property list} of this object's
+ * {@link Type type}, is considered to be set.
+ * @param propertyIndex the index of the property.
+ * @return whether the specified property is set.
+ * @see #isSet(Property)
+ */
+ boolean isSet(int propertyIndex);
+
+ /**
+ * Unsets the property at the specified index in {@link Type#getProperties property list} of this object's {@link Type type}.
+ * @param propertyIndex the index of the property.
+ * @see #unset(Property)
+ */
+ void unset(int propertyIndex);
+
+ /**
+ * Returns the value of a <code>boolean</code> property identified by the specified property index.
+ * @param propertyIndex the index of the property.
+ * @return the <code>boolean</code> value of the specified property.
+ * @see #get(int)
+ */
+ boolean getBoolean(int propertyIndex);
+
+ /**
+ * Returns the value of a <code>byte</code> property identified by the specified property index.
+ * @param propertyIndex the index of the property.
+ * @return the <code>byte</code> value of the specified property.
+ * @see #get(int)
+ */
+ byte getByte(int propertyIndex);
+
+ /**
+ * Returns the value of a <code>char</code> property identified by the specified property index.
+ * @param propertyIndex the index of the property.
+ * @return the <code>char</code> value of the specified property.
+ * @see #get(int)
+ */
+ char getChar(int propertyIndex);
+
+ /**
+ * Returns the value of a <code>double</code> property identified by the specified property index.
+ * @param propertyIndex the index of the property.
+ * @return the <code>double</code> value of the specified property.
+ * @see #get(int)
+ */
+ double getDouble(int propertyIndex);
+
+ /**
+ * Returns the value of a <code>float</code> property identified by the specified property index.
+ * @param propertyIndex the index of the property.
+ * @return the <code>float</code> value of the specified property.
+ * @see #get(int)
+ */
+ float getFloat(int propertyIndex);
+
+ /**
+ * Returns the value of a <code>int</code> property identified by the specified property index.
+ * @param propertyIndex the index of the property.
+ * @return the <code>int</code> value of the specified property.
+ * @see #get(int)
+ */
+ int getInt(int propertyIndex);
+
+ /**
+ * Returns the value of a <code>long</code> property identified by the specified property index.
+ * @param propertyIndex the index of the property.
+ * @return the <code>long</code> value of the specified property.
+ * @see #get(int)
+ */
+ long getLong(int propertyIndex);
+
+ /**
+ * Returns the value of a <code>short</code> property identified by the specified property index.
+ * @param propertyIndex the index of the property.
+ * @return the <code>short</code> value of the specified property.
+ * @see #get(int)
+ */
+ short getShort(int propertyIndex);
+
+ /**
+ * Returns the value of a <code>byte[]</code> property identified by the specified property index.
+ * @param propertyIndex the index of the property.
+ * @return the <code>byte[]</code> value of the specified property.
+ * @see #get(int)
+ */
+ byte[] getBytes(int propertyIndex);
+
+ /**
+ * Returns the value of a <code>BigDecimal</code> property identified by the specified property index.
+ * @param propertyIndex the index of the property.
+ * @return the <code>BigDecimal</code> value of the specified property.
+ * @see #get(int)
+ */
+ BigDecimal getBigDecimal(int propertyIndex);
+
+ /**
+ * Returns the value of a <code>BigInteger</code> property identified by the specified property index.
+ * @param propertyIndex the index of the property.
+ * @return the <code>BigInteger</code> value of the specified property.
+ * @see #get(int)
+ */
+ BigInteger getBigInteger(int propertyIndex);
+
+ /**
+ * Returns the value of a <code>DataObject</code> property identified by the specified property index.
+ * @param propertyIndex the index of the property.
+ * @return the <code>DataObject</code> value of the specified property.
+ * @see #get(int)
+ */
+ DataObject getDataObject(int propertyIndex);
+
+ /**
+ * Returns the value of a <code>Date</code> property identified by the specified property index.
+ * @param propertyIndex the index of the property.
+ * @return the <code>Date</code> value of the specified property.
+ * @see #get(int)
+ */
+ Date getDate(int propertyIndex);
+
+ /**
+ * Returns the value of a <code>String</code> property identified by the specified property index.
+ * @param propertyIndex the index of the property.
+ * @return the <code>String</code> value of the specified property.
+ * @see #get(int)
+ */
+ String getString(int propertyIndex);
+
+ /**
+ * Returns the value of a <code>List</code> property identified by the specified property index.
+ * @param propertyIndex the index of the property.
+ * @return the <code>List</code> value of the specified property.
+ * @see #get(int)
+ */
+ List getList(int propertyIndex);
+
+ /**
+ * @see #getSequence()
+ * Returns the value of a <code>Sequence</code> property identified by the specified property index.
+ * An implementation may throw an UnsupportedOperationException.
+ * @param propertyIndex the index of the property.
+ * @return the <code>Sequence</code> value of the specified property.
+ * @see #get(int)
+ * @deprecated in 2.1.0.
+ */
+ Sequence getSequence(int propertyIndex);
+
+ /**
+ * Sets the value of a <code>boolean</code> property identified by the specified property index, to the specified value.
+ * @param propertyIndex the index of the property.
+ * @param value the new value for the property.
+ * @see #set(int, Object)
+ */
+ void setBoolean(int propertyIndex, boolean value);
+
+ /**
+ * Sets the value of a <code>byte</code> property identified by the specified property index, to the specified value.
+ * @param propertyIndex the index of the property.
+ * @param value the new value for the property.
+ * @see #set(int, Object)
+ */
+ void setByte(int propertyIndex, byte value);
+
+ /**
+ * Sets the value of a <code>char</code> property identified by the specified property index, to the specified value.
+ * @param propertyIndex the index of the property.
+ * @param value the new value for the property.
+ * @see #set(int, Object)
+ */
+ void setChar(int propertyIndex, char value);
+
+ /**
+ * Sets the value of a <code>double</code> property identified by the specified property index, to the specified value.
+ * @param propertyIndex the index of the property.
+ * @param value the new value for the property.
+ * @see #set(int, Object)
+ */
+ void setDouble(int propertyIndex, double value);
+
+ /**
+ * Sets the value of a <code>float</code> property identified by the specified property index, to the specified value.
+ * @param propertyIndex the index of the property.
+ * @param value the new value for the property.
+ * @see #set(int, Object)
+ */
+ void setFloat(int propertyIndex, float value);
+
+ /**
+ * Sets the value of a <code>int</code> property identified by the specified property index, to the specified value.
+ * @param propertyIndex the index of the property.
+ * @param value the new value for the property.
+ * @see #set(int, Object)
+ */
+ void setInt(int propertyIndex, int value);
+
+ /**
+ * Sets the value of a <code>long</code> property identified by the specified property index, to the specified value.
+ * @param propertyIndex the index of the property.
+ * @param value the new value for the property.
+ * @see #set(int, Object)
+ */
+ void setLong(int propertyIndex, long value);
+
+ /**
+ * Sets the value of a <code>short</code> property identified by the specified property index, to the specified value.
+ * @param propertyIndex the index of the property.
+ * @param value the new value for the property.
+ * @see #set(int, Object)
+ */
+ void setShort(int propertyIndex, short value);
+
+ /**
+ * Sets the value of a <code>byte[]</code> property identified by the specified property index, to the specified value.
+ * @param propertyIndex the index of the property.
+ * @param value the new value for the property.
+ * @see #set(int, Object)
+ */
+ void setBytes(int propertyIndex, byte[] value);
+
+ /**
+ * Sets the value of a <code>BigDecimal</code> property identified by the specified property index, to the specified value.
+ * @param propertyIndex the index of the property.
+ * @param value the new value for the property.
+ * @see #set(int, Object)
+ */
+ void setBigDecimal(int propertyIndex, BigDecimal value);
+
+ /**
+ * Sets the value of a <code>BigInteger</code> property identified by the specified property index, to the specified value.
+ * @param propertyIndex the index of the property.
+ * @param value the new value for the property.
+ * @see #set(int, Object)
+ */
+ void setBigInteger(int propertyIndex, BigInteger value);
+
+ /**
+ * Sets the value of a <code>DataObject</code> property identified by the specified property index, to the specified value.
+ * @param propertyIndex the index of the property.
+ * @param value the new value for the property.
+ * @see #set(int, Object)
+ */
+ void setDataObject(int propertyIndex, DataObject value);
+
+ /**
+ * Sets the value of a <code>Date</code> property identified by the specified property index, to the specified value.
+ * @param propertyIndex the index of the property.
+ * @param value the new value for the property.
+ * @see #set(int, Object)
+ */
+ void setDate(int propertyIndex, Date value);
+
+ /**
+ * Sets the value of a <code>String</code> property identified by the specified property index, to the specified value.
+ * @param propertyIndex the index of the property.
+ * @param value the new value for the property.
+ * @see #set(int, Object)
+ */
+ void setString(int propertyIndex, String value);
+
+ /**
+ * Sets the value of a <code>List</code> property identified by the specified property index, to the specified value.
+ * @param propertyIndex the index of the property.
+ * @param value the new value for the property.
+ * @see #set(int, Object)
+ * @see #setList(Property, List)
+ */
+ void setList(int propertyIndex, List value);
+
+ /**
+ * Returns the value of the given property of this object.
+ * <p>
+ * If the property is {@link Property#isMany many-valued},
+ * the result will be a {@link java.util.List}
+ * and each object in the List will be {@link Type#isInstance an instance of}
+ * the property's {@link Property#getType type}.
+ * Otherwise the result will directly be an instance of the property's type.
+ * @param property the property of the value to fetch.
+ * @return the value of the given property of the object.
+ * @see #set(Property, Object)
+ * @see #unset(Property)
+ * @see #isSet(Property)
+ */
+ Object get(Property property);
+
+ /**
+ * Sets the value of the given property of the object to the new value.
+ * <p>
+ * If the property is {@link Property#isMany many-valued},
+ * the new value must be a {@link java.util.List}
+ * and each object in that list must be {@link Type#isInstance an instance of}
+ * the property's {@link Property#getType type};
+ * the existing contents are cleared and the contents of the new value are added.
+ * Otherwise the new value directly must be an instance of the property's type
+ * and it becomes the new value of the property of the object.
+ * @param property the property of the value to set.
+ * @param value the new value for the property.
+ * @see #unset(Property)
+ * @see #isSet(Property)
+ * @see #get(Property)
+ */
+ void set(Property property, Object value);
+
+ /**
+ * Returns whether the property of the object is considered to be set.
+ * <p>
+ * isSet() for many-valued Properties returns true if the List is not empty and
+ * false if the List is empty. For single-valued Properties it returns true if the Property
+ * has been set() and not unset(), and false otherwise.
+ * Any call to set() without a call to unset() will cause isSet() to return true, regardless of
+ * the value being set. For example, after calling set(property, property.getDefault()) on a
+ * previously unset property, isSet(property) will return true, even though the value of
+ * get(property) will be unchanged.
+ * @param property the property in question.
+ * @return whether the property of the object is set.
+ * @see #set(Property, Object)
+ * @see #unset(Property)
+ * @see #get(Property)
+ */
+ boolean isSet(Property property);
+
+ /**
+ * Unsets the property of the object.
+ * <p>
+ * If the property is {@link Property#isMany many-valued},
+ * the value must be an {@link java.util.List}
+ * and that list is cleared.
+ * Otherwise,
+ * the value of the property of the object
+ * is set to the property's {@link Property#getDefault default value}.
+ * The property will no longer be considered {@link #isSet set}.
+ * @param property the property in question.
+ * @see #isSet(Property)
+ * @see #set(Property, Object)
+ * @see #get(Property)
+ */
+ void unset(Property property);
+
+ /**
+ * Returns the value of the specified <code>boolean</code> property.
+ * @param property the property to get.
+ * @return the <code>boolean</code> value of the specified property.
+ * @see #get(Property)
+ */
+ boolean getBoolean(Property property);
+
+ /**
+ * Returns the value of the specified <code>byte</code> property.
+ * @param property the property to get.
+ * @return the <code>byte</code> value of the specified property.
+ * @see #get(Property)
+ */
+ byte getByte(Property property);
+
+ /**
+ * Returns the value of the specified <code>char</code> property.
+ * @param property the property to get.
+ * @return the <code>char</code> value of the specified property.
+ * @see #get(Property)
+ */
+ char getChar(Property property);
+
+ /**
+ * Returns the value of the specified <code>double</code> property.
+ * @param property the property to get.
+ * @return the <code>double</code> value of the specified property.
+ * @see #get(Property)
+ */
+ double getDouble(Property property);
+
+ /**
+ * Returns the value of the specified <code>float</code> property.
+ * @param property the property to get.
+ * @return the <code>float</code> value of the specified property.
+ * @see #get(Property)
+ */
+ float getFloat(Property property);
+
+ /**
+ * Returns the value of the specified <code>int</code> property.
+ * @param property the property to get.
+ * @return the <code>int</code> value of the specified property.
+ * @see #get(Property)
+ */
+ int getInt(Property property);
+
+ /**
+ * Returns the value of the specified <code>long</code> property.
+ * @param property the property to get.
+ * @return the <code>long</code> value of the specified property.
+ * @see #get(Property)
+ */
+ long getLong(Property property);
+
+ /**
+ * Returns the value of the specified <code>short</code> property.
+ * @param property the property to get.
+ * @return the <code>short</code> value of the specified property.
+ * @see #get(Property)
+ */
+ short getShort(Property property);
+
+ /**
+ * Returns the value of the specified <code>byte[]</code> property.
+ * @param property the property to get.
+ * @return the <code>byte[]</code> value of the specified property.
+ * @see #get(Property)
+ */
+ byte[] getBytes(Property property);
+
+ /**
+ * Returns the value of the specified <code>BigDecimal</code> property.
+ * @param property the property to get.
+ * @return the <code>BigDecimal</code> value of the specified property.
+ * @see #get(Property)
+ */
+ BigDecimal getBigDecimal(Property property);
+
+ /**
+ * Returns the value of the specified <code>BigInteger</code> property.
+ * @param property the property to get.
+ * @return the <code>BigInteger</code> value of the specified property.
+ * @see #get(Property)
+ */
+ BigInteger getBigInteger(Property property);
+
+ /**
+ * Returns the value of the specified <code>DataObject</code> property.
+ * @param property the property to get.
+ * @return the <code>DataObject</code> value of the specified property.
+ * @see #get(Property)
+ */
+ DataObject getDataObject(Property property);
+
+ /**
+ * Returns the value of the specified <code>Date</code> property.
+ * @param property the property to get.
+ * @return the <code>Date</code> value of the specified property.
+ * @see #get(Property)
+ */
+ Date getDate(Property property);
+
+ /**
+ * Returns the value of the specified <code>String</code> property.
+ * @param property the property to get.
+ * @return the <code>String</code> value of the specified property.
+ * @see #get(Property)
+ */
+ String getString(Property property);
+
+ /**
+ * Returns the value of the specified <code>List</code> property.
+ * The List returned contains the current values.
+ * Updates through the List interface operate on the current values of the DataObject.
+ * Each access returns the same List object.
+ * @param property the property to get.
+ * @return the <code>List</code> value of the specified property.
+ * @see #get(Property)
+ */
+ List getList(Property property);
+
+ /**
+ * @see #getSequence()
+ * Returns the value of the specified <code>Sequence</code> property.
+ * An implementation may throw an UnsupportedOperationException.
+ * @param property the property to get.
+ * @return the <code>Sequence</code> value of the specified property.
+ * @see #get(Property)
+ * @deprecated in 2.1.0.
+ */
+ Sequence getSequence(Property property);
+
+ /**
+ * Sets the value of the specified <code>boolean</code> property, to the specified value.
+ * @param property the property to set.
+ * @param value the new value for the property.
+ * @see #set(Property, Object)
+ */
+ void setBoolean(Property property, boolean value);
+
+ /**
+ * Sets the value of the specified <code>byte</code> property, to the specified value.
+ * @param property the property to set.
+ * @param value the new value for the property.
+ * @see #set(Property, Object)
+ */
+ void setByte(Property property, byte value);
+
+ /**
+ * Sets the value of the specified <code>char</code> property, to the specified value.
+ * @param property the property to set.
+ * @param value the new value for the property.
+ * @see #set(Property, Object)
+ */
+ void setChar(Property property, char value);
+
+ /**
+ * Sets the value of the specified <code>double</code> property, to the specified value.
+ * @param property the property to set.
+ * @param value the new value for the property.
+ * @see #set(Property, Object)
+ */
+ void setDouble(Property property, double value);
+
+ /**
+ * Sets the value of the specified <code>float</code> property, to the specified value.
+ * @param property the property to set.
+ * @param value the new value for the property.
+ * @see #set(Property, Object)
+ */
+ void setFloat(Property property, float value);
+
+ /**
+ * Sets the value of the specified <code>int</code> property, to the specified value.
+ * @param property the property to set.
+ * @param value the new value for the property.
+ * @see #set(Property, Object)
+ */
+ void setInt(Property property, int value);
+
+ /**
+ * Sets the value of the specified <code>long</code> property, to the specified value.
+ * @param property the property to set.
+ * @param value the new value for the property.
+ * @see #set(Property, Object)
+ */
+ void setLong(Property property, long value);
+
+ /**
+ * Sets the value of the specified <code>short</code> property, to the specified value.
+ * @param property the property to set.
+ * @param value the new value for the property.
+ * @see #set(Property, Object)
+ */
+ void setShort(Property property, short value);
+
+ /**
+ * Sets the value of the specified <code>byte[]</code> property, to the specified value.
+ * @param property the property to set.
+ * @param value the new value for the property.
+ * @see #set(Property, Object)
+ */
+ void setBytes(Property property, byte[] value);
+
+ /**
+ * Sets the value of the specified <code>BigDecimal</code> property, to the specified value.
+ * @param property the property to set.
+ * @param value the new value for the property.
+ * @see #set(Property, Object)
+ */
+ void setBigDecimal(Property property, BigDecimal value);
+
+ /**
+ * Sets the value of the specified <code>BigInteger</code> property, to the specified value.
+ * @param property the property to set.
+ * @param value the new value for the property.
+ * @see #set(Property, Object)
+ */
+ void setBigInteger(Property property, BigInteger value);
+
+ /**
+ * Sets the value of the specified <code>DataObject</code> property, to the specified value.
+ * @param property the property to set.
+ * @param value the new value for the property.
+ * @see #set(Property, Object)
+ */
+ void setDataObject(Property property, DataObject value);
+
+ /**
+ * Sets the value of the specified <code>Date</code> property, to the specified value.
+ * @param property the property to set.
+ * @param value the new value for the property.
+ * @see #set(Property, Object)
+ */
+ void setDate(Property property, Date value);
+
+ /**
+ * Sets the value of the specified <code>String</code> property, to the specified value.
+ * @param property the property to set.
+ * @param value the new value for the property.
+ * @see #set(Property, Object)
+ */
+ void setString(Property property, String value);
+
+ /**
+ * Sets the value of the specified <code>List</code> property, to the specified value.
+ * <p> The new value must be a {@link java.util.List}
+ * and each object in that list must be {@link Type#isInstance an instance of}
+ * the property's {@link Property#getType type};
+ * the existing contents are cleared and the contents of the new value are added.
+ * @param property the property to set.
+ * @param value the new value for the property.
+ * @see #set(Property, Object)
+ */
+ void setList(Property property, List value);
+
+ /**
+ * Returns a new {@link DataObject data object} contained by this object using the specified property,
+ * which must be a {@link Property#isContainment containment property}.
+ * The type of the created object is the {@link Property#getType declared type} of the specified property.
+ * @param propertyName the name of the specified containment property.
+ * @return the created data object.
+ * @see #createDataObject(String, String, String)
+ */
+ DataObject createDataObject(String propertyName);
+
+ /**
+ * Returns a new {@link DataObject data object} contained by this object using the specified property,
+ * which must be a {@link Property#isContainment containment property}.
+ * The type of the created object is the {@link Property#getType declared type} of the specified property.
+ * @param propertyIndex the index of the specified containment property.
+ * @return the created data object.
+ * @see #createDataObject(int, String, String)
+ */
+ DataObject createDataObject(int propertyIndex);
+
+ /**
+ * Returns a new {@link DataObject data object} contained by this object using the specified property,
+ * which must be a {@link Property#isContainment containment property}.
+ * The type of the created object is the {@link Property#getType declared type} of the specified property.
+ * @param property the specified containment property.
+ * @return the created data object.
+ * @see #createDataObject(Property, Type)
+ */
+ DataObject createDataObject(Property property);
+
+ /**
+ * Returns a new {@link DataObject data object} contained by this object using the specified property,
+ * which must be a {@link Property#isContainment containment property}.
+ * The type of the created object is specified by the packageURI and typeName arguments.
+ * The specified type must be a compatible target for the property identified by propertyName.
+ * @param propertyName the name of the specified containment property.
+ * @param namespaceURI the namespace URI of the package containing the type of object to be created.
+ * @param typeName the name of a type in the specified package.
+ * @return the created data object.
+ * @see #createDataObject(String)
+ * @see DataGraph#getType
+ */
+ DataObject createDataObject(String propertyName, String namespaceURI, String typeName);
+
+ /**
+ * Returns a new {@link DataObject data object} contained by this object using the specified property,
+ * which must be a {@link Property#isContainment containment property}.
+ * The type of the created object is specified by the packageURI and typeName arguments.
+ * The specified type must be a compatible target for the property identified by propertyIndex.
+ * @param propertyIndex the index of the specified containment property.
+ * @param namespaceURI the namespace URI of the package containing the type of object to be created.
+ * @param typeName the name of a type in the specified package.
+ * @return the created data object.
+ * @see #createDataObject(int)
+ * @see DataGraph#getType
+ */
+ DataObject createDataObject(int propertyIndex, String namespaceURI, String typeName);
+
+ /**
+ * Returns a new {@link DataObject data object} contained by this object using the specified property,
+ * which must be of {@link Property#isContainment containment type}.
+ * The type of the created object is specified by the type argument,
+ * which must be a compatible target for the speicifed property.
+ * @param property a containment property of this object.
+ * @param type the type of object to be created.
+ * @return the created data object.
+ * @see #createDataObject(int)
+ */
+ DataObject createDataObject(Property property, Type type);
+
+ /**
+ * Remove this object from its container and then unset all its non-{@link Property#isReadOnly readOnly} Properties.
+ * If this object is contained by a {@link Property#isReadOnly readOnly} {@link Property#isContainment containment property}, its non-{@link Property#isReadOnly readOnly} Properties will be unset but the object will not be removed from its container.
+ * All DataObjects recursively contained by {@link Property#isContainment containment Properties} will also be deleted.
+ */
+ void delete();
+
+ /**
+ * Returns the containing {@link DataObject data object}
+ * or <code>null</code> if there is no container.
+ * @return the containing data object or <code>null</code>.
+ */
+ DataObject getContainer();
+
+ /**
+ * Return the Property of the {@link DataObject data object} containing this data object
+ * or <code>null</code> if there is no container.
+ * @return the property containing this data object.
+ */
+ Property getContainmentProperty();
+
+ /**
+ * Returns the {@link DataGraph data graph} for this object or <code>null</code> if there isn't one.
+ * @return the containing data graph or <code>null</code>.
+ */
+ DataGraph getDataGraph();
+
+ /**
+ * Returns the data object's type.
+ * <p>
+ * The type defines the Properties available for reflective access.
+ * @return the type.
+ */
+ Type getType();
+
+ /**
+ * Returns the <code>Sequence</code> for this DataObject.
+ * When getType().isSequencedType() == true,
+ * the Sequence of a DataObject corresponds to the
+ * XML elements representing the values of its Properties.
+ * Updates through DataObject and the Lists or Sequences returned
+ * from DataObject operate on the same data.
+ * When getType().isSequencedType() == false, null is returned.
+ * @return the <code>Sequence</code> or null.
+ */
+ Sequence getSequence();
+
+ /**
+ * Returns a read-only List of the Properties currently used in this DataObject.
+ * This list will contain all of the Properties in getType().getProperties()
+ * and any Properties where isSet(property) is true.
+ * For example, Properties resulting from the use of
+ * open or mixed XML content are present if allowed by the Type.
+ * the List does not contain duplicates.
+ * The order of the Properties in the List begins with getType().getProperties()
+ * and the order of the remaining Properties is determined by the implementation.
+ * The same list will be returned unless the DataObject is updated so that
+ * the contents of the List change.
+ * @return the List of Properties currently used in this DataObject.
+ */
+ List /* Property */ getInstanceProperties();
+
+ /**
+ * Returns the named Property from the current instance properties,
+ * or null if not found. The instance properties are getInstanceProperties().
+ * @param propertyName the name of the Property
+ * @return the named Property from the DataObject's current instance properties, or null.
+ */
+ Property getInstanceProperty(String propertyName);
+
+ /**
+ * @deprecated replaced by {@link #getInstanceProperty(String)} in 2.1.0
+ */
+ Property getProperty(String propertyName);
+
+ /**
+ * Returns the root {@link DataObject data object}.
+ * @return the root data object.
+ */
+ DataObject getRootObject();
+
+ /**
+ * Returns the ChangeSummary with scope covering this dataObject, or null
+ * if there is no ChangeSummary.
+ * @return the ChangeSummary with scope covering this dataObject, or null.
+ */
+ ChangeSummary getChangeSummary();
+
+ /**
+ * Removes this DataObject from its container, if any.
+ * Same as
+ * getContainer().getList(getContainmentProperty()).remove(this) or
+ * getContainer().unset(getContainmentProperty())
+ * depending on getContainmentProperty().isMany() respectively.
+ */
+ void detach();
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/Property.java b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/Property.java
new file mode 100644
index 0000000000..89a3857a75
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/Property.java
@@ -0,0 +1,115 @@
+/**
+ * <copyright>
+ *
+ * Service Data Objects
+ * Version 2.1.0
+ * Licensed Materials
+ *
+ * (c) Copyright BEA Systems, Inc., International Business Machines Corporation,
+ * Oracle Corporation, Primeton Technologies Ltd., Rogue Wave Software, SAP AG.,
+ * Software AG., Sun Microsystems, Sybase Inc., Xcalia, Zend Technologies,
+ * 2005, 2006. All rights reserved.
+ *
+ * </copyright>
+ *
+ */
+
+package commonj.sdo;
+
+import java.util.List;
+
+/**
+ * A representation of a Property in the {@link Type type} of a {@link DataObject data object}.
+ */
+public interface Property
+{
+ /**
+ * Returns the name of the Property.
+ * @return the Property name.
+ */
+ String getName();
+
+ /**
+ * Returns the type of the Property.
+ * @return the Property type.
+ */
+ Type getType();
+
+ /**
+ * Returns whether the Property is many-valued.
+ * @return <code>true</code> if the Property is many-valued.
+ */
+ boolean isMany();
+
+ /**
+ * Returns whether the Property is containment, i.e., whether it represents by-value composition.
+ * @return <code>true</code> if the Property is containment.
+ */
+ boolean isContainment();
+
+ /**
+ * Returns the containing type of this Property.
+ * @return the Property's containing type.
+ * @see Type#getProperties()
+ */
+ Type getContainingType();
+
+ /**
+ * Returns the default value this Property will have in a {@link DataObject data object} where the Property hasn't been set.
+ * @return the default value.
+ */
+ Object getDefault();
+
+ /**
+ * Returns true if values for this Property cannot be modified using the SDO APIs.
+ * When true, DataObject.set(Property property, Object value) throws an exception.
+ * Values may change due to other factors, such as services operating on DataObjects.
+ * @return true if values for this Property cannot be modified.
+ */
+ boolean isReadOnly();
+
+ /**
+ * Returns the opposite Property if the Property is bi-directional or null otherwise.
+ * @return the opposite Property if the Property is bi-directional or null
+ */
+ Property getOpposite();
+
+ /**
+ * Returns a list of alias names for this Property.
+ * @return a list of alias names for this Property.
+ */
+ List /*String*/ getAliasNames();
+
+ /**
+ * Returns whether or not instances of this property can be set to null. The effect of calling set(null) on a non-nullable
+ * property is not specified by SDO.
+ * @return true if this property is nullable.
+ */
+ boolean isNullable();
+
+ /**
+ * Returns whether or not this is an open content Property.
+ * @return true if this property is an open content Property.
+ */
+ boolean isOpenContent();
+
+ /**
+ * Returns a read-only List of instance Properties available on this Property.
+ * <p>
+ * This list includes, at a minimum, any open content properties (extensions) added to
+ * the object before {@link commonj.sdo.helper.TypeHelper#define(DataObject) defining
+ * the Property's Type}. Implementations may, but are not required to in the 2.1 version
+ * of SDO, provide additional instance properties.
+ * @return the List of instance Properties on this Property.
+ */
+ List /*Property*/ getInstanceProperties();
+
+ /**
+ * Returns the value of the specified instance property of this Property.
+ * @param property one of the properties returned by {@link #getInstanceProperties()}.
+ * @return the value of the specified property.
+ * @see DataObject#get(Property)
+ */
+ Object get(Property property);
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/Sequence.java b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/Sequence.java
new file mode 100644
index 0000000000..d015633fa5
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/Sequence.java
@@ -0,0 +1,140 @@
+/**
+ * <copyright>
+ *
+ * Service Data Objects
+ * Version 2.1.0
+ * Licensed Materials
+ *
+ * (c) Copyright BEA Systems, Inc., International Business Machines Corporation,
+ * Oracle Corporation, Primeton Technologies Ltd., Rogue Wave Software, SAP AG.,
+ * Software AG., Sun Microsystems, Sybase Inc., Xcalia, Zend Technologies,
+ * 2005, 2006. All rights reserved.
+ *
+ * </copyright>
+ *
+ */
+
+package commonj.sdo;
+
+/**
+ * A sequence is a heterogeneous list of {@link Property properties} and corresponding values.
+ * It represents an ordered arbitrary mixture of data values from more than one property of a {@link DataObject data object}.
+ */
+public interface Sequence
+{
+ /**
+ * Returns the number of entries in the sequence.
+ * @return the number of entries.
+ */
+ int size();
+
+ /**
+ * Returns the property for the given entry index.
+ * Returns <code>null</code> for mixed text entries.
+ * @param index the index of the entry.
+ * @return the property or <code>null</code> for the given entry index.
+ */
+ Property getProperty(int index);
+
+ /**
+ * Returns the property value for the given entry index.
+ * @param index the index of the entry.
+ * @return the value for the given entry index.
+ */
+ Object getValue(int index);
+
+ /**
+ * Sets the entry at a specified index to the new value.
+ * @param index the index of the entry.
+ * @param value the new value for the entry.
+ */
+ Object setValue(int index, Object value);
+
+ /**
+ * Adds a new entry with the specified property name and value
+ * to the end of the entries.
+ * @param propertyName the name of the entry's property.
+ * @param value the value for the entry.
+ */
+ boolean add(String propertyName, Object value);
+
+ /**
+ * Adds a new entry with the specified property index and value
+ * to the end of the entries.
+ * @param propertyIndex the index of the entry's property.
+ * @param value the value for the entry.
+ */
+ boolean add(int propertyIndex, Object value);
+
+ /**
+ * Adds a new entry with the specified property and value
+ * to the end of the entries.
+ * @param property the property of the entry.
+ * @param value the value for the entry.
+ */
+ boolean add(Property property, Object value);
+
+ /**
+ * Adds a new entry with the specified property name and value
+ * at the specified entry index.
+ * @param index the index at which to add the entry.
+ * @param propertyName the name of the entry's property.
+ * @param value the value for the entry.
+ */
+ void add(int index, String propertyName, Object value);
+
+ /**
+ * Adds a new entry with the specified property index and value
+ * at the specified entry index.
+ * @param index the index at which to add the entry.
+ * @param propertyIndex the index of the entry's property.
+ * @param value the value for the entry.
+ */
+ void add(int index, int propertyIndex, Object value);
+
+ /**
+ * Adds a new entry with the specified property and value
+ * at the specified entry index.
+ * @param index the index at which to add the entry.
+ * @param property the property of the entry.
+ * @param value the value for the entry.
+ */
+ void add(int index, Property property, Object value);
+
+ /**
+ * Removes the entry at the given entry index.
+ * @param index the index of the entry.
+ */
+ void remove(int index);
+
+ /**
+ * Moves the entry at <code>fromIndex</code> to <code>toIndex</code>.
+ * @param toIndex the index of the entry destination.
+ * @param fromIndex the index of the entry to move.
+ */
+ void move(int toIndex, int fromIndex);
+
+ /**
+ * @deprecated replaced by {@link #addText(String)} in 2.1.0
+ */
+ void add(String text);
+
+ /**
+ * @deprecated replaced by {@link #addText(int, String)} in 2.1.0
+ */
+ void add(int index, String text);
+
+ /**
+ * Adds a new text entry to the end of the Sequence.
+ * @param text value of the entry.
+ */
+ void addText(String text);
+
+ /**
+ * Adds a new text entry at the given index.
+ * @param index the index at which to add the entry.
+ * @param text value of the entry.
+ */
+ void addText(int index, String text);
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/Type.java b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/Type.java
new file mode 100644
index 0000000000..c8d54a6ca0
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/Type.java
@@ -0,0 +1,166 @@
+/**
+ * <copyright>
+ *
+ * Service Data Objects
+ * Version 2.1.0
+ * Licensed Materials
+ *
+ * (c) Copyright BEA Systems, Inc., International Business Machines Corporation,
+ * Oracle Corporation, Primeton Technologies Ltd., Rogue Wave Software, SAP AG.,
+ * Software AG., Sun Microsystems, Sybase Inc., Xcalia, Zend Technologies,
+ * 2005, 2006. All rights reserved.
+ *
+ * </copyright>
+ *
+ */
+
+package commonj.sdo;
+
+import java.util.List;
+
+/**
+ * A representation of the type of a {@link Property property} of a {@link DataObject data object}.
+ */
+public interface Type
+{
+ /**
+ * Returns the name of the type.
+ * @return the type name.
+ */
+ String getName();
+
+ /**
+ * Returns the namespace URI of the type.
+ * @return the namespace URI.
+ */
+ String getURI();
+
+ /**
+ * Returns the Java class that this type represents.
+ * @return the Java class.
+ */
+ Class getInstanceClass();
+
+ /**
+ * Returns whether the specified object is an instance of this type.
+ * @param object the object in question.
+ * @return <code>true</code> if the object is an instance.
+ * @see Class#isInstance
+ */
+ boolean isInstance(Object object);
+
+ /**
+ * Returns the List of the {@link Property Properties} of this type.
+ * <p>
+ * The expression
+ *<pre>
+ * type.getProperties().indexOf(property)
+ *</pre>
+ * yields the property's index relative to this type.
+ * As such, these expressions are equivalent:
+ *<pre>
+ * dataObject.{@link DataObject#get(int) get}(i)
+ * dataObject.{@link DataObject#get(Property) get}((Property)dataObject.getType().getProperties().get(i));
+ *</pre>
+ * </p>
+ * @return the Properties of the type.
+ * @see Property#getContainingType
+ */
+ List /*Property*/ getProperties();
+
+ /**
+ * Returns from {@link #getProperties all the Properties} of this type, the one with the specified name.
+ * As such, these expressions are equivalent:
+ *<pre>
+ * dataObject.{@link DataObject#get(String) get}("name")
+ * dataObject.{@link DataObject#get(Property) get}(dataObject.getType().getProperty("name"))
+ *</pre>
+ * </p>
+ * @return the Property with the specified name.
+ * @see #getProperties
+ */
+ Property getProperty(String propertyName);
+
+ /**
+ * Indicates if this Type specifies DataTypes (true) or DataObjects (false).
+ * When false, any object that is an instance of this type
+ * also implements the DataObject interface.
+ * True for simple types such as Strings and numbers.
+ * For any object:
+ * <pre>
+ * isInstance(object) && !isDataType() implies
+ * DataObject.class.isInstance(object) returns true.
+ * </pre>
+ * @return true if Type specifies DataTypes, false for DataObjects.
+ */
+ boolean isDataType();
+
+ /**
+ * Indicates if this Type allows any form of open content. If false,
+ * dataObject.getInstanceProperties() must be the same as
+ * dataObject.getType().getProperties() for any DataObject dataObject of this Type.
+ * @return true if this Type allows open content.
+ */
+ boolean isOpen();
+
+ /**
+ * Indicates if this Type specifies Sequenced DataObjects.
+ * Sequenced DataObjects are used when the order of values
+ * between Properties must be preserved.
+ * When true, a DataObject will return a Sequence. For example,
+ * <pre>
+ * Sequence elements = dataObject.{@link DataObject#getSequence() getSequence}();
+ * </pre>
+ * @return true if this Type specifies Sequenced DataObjects.
+ */
+ boolean isSequenced();
+
+ /**
+ * Indicates if this Type is abstract. If true, this Type cannot be
+ * instantiated. Abstract types cannot be used in DataObject or
+ * DataFactory create methods.
+ * @return true if this Type is abstract.
+ */
+ boolean isAbstract();
+
+ /**
+ * Returns the List of base Types for this Type. The List is empty
+ * if there are no base Types. XSD <extension>, <restriction>, and
+ * Java extends keyword are mapped to this list.
+ * @return the List of base Types for this Type.
+ */
+ List /*Type*/ getBaseTypes();
+
+ /**
+ * Returns the Properties declared in this Type as opposed to
+ * those declared in base Types.
+ * @return the Properties declared in this Type.
+ */
+ List /*Property*/ getDeclaredProperties();
+
+ /**
+ * Return a list of alias names for this Type.
+ * @return a list of alias names for this Type.
+ */
+ List /*String*/ getAliasNames();
+
+ /**
+ * Returns a read-only List of instance Properties available on this Type.
+ * <p>
+ * This list includes, at a minimum, any open content properties (extensions) added to
+ * the object before {@link commonj.sdo.helper.TypeHelper#define(DataObject) defining
+ * the Type's Type}. Implementations may, but are not required to in the 2.1 version
+ * of SDO, provide additional instance properties.
+ * @return the List of instance Properties on this Type.
+ */
+ List /*Property*/ getInstanceProperties();
+
+ /**
+ * Returns the value of the specified instance property of this Type.
+ * @param property one of the properties returned by {@link #getInstanceProperties()}.
+ * @return the value of the specified property.
+ * @see DataObject#get(Property)
+ */
+ Object get(Property property);
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/helper/CopyHelper.java b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/helper/CopyHelper.java
new file mode 100644
index 0000000000..d185d4d420
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/helper/CopyHelper.java
@@ -0,0 +1,85 @@
+/**
+ * <copyright>
+ *
+ * Service Data Objects
+ * Version 2.1.0
+ * Licensed Materials
+ *
+ * (c) Copyright BEA Systems, Inc., International Business Machines Corporation,
+ * Oracle Corporation, Primeton Technologies Ltd., Rogue Wave Software, SAP AG.,
+ * Software AG., Sun Microsystems, Sybase Inc., Xcalia, Zend Technologies,
+ * 2005, 2006. All rights reserved.
+ *
+ * </copyright>
+ *
+ */
+
+package commonj.sdo.helper;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.impl.HelperProvider;
+
+/**
+ * A helper for copying DataObjects.
+ */
+public interface CopyHelper
+{
+ /**
+ * Create a shallow copy of the DataObject dataObject:
+ * Creates a new DataObject copiedDataObject with the same values
+ * as the source dataObject for each property where
+ * property.getType().isDataType() is true.
+ * The value of such a Property property in copiedDataObject is:
+ * dataObject.get(property) for single-valued Properties
+ * (copiedDataObject.get(property) equals() dataObject.get(property)), or
+ * a List where each member is equal to the member at the
+ * same index in dataObject for multi-valued Properties
+ * copiedDataObject.getList(property).get(i) equals() dataObject.getList(property).get(i)
+ * The copied Object is unset for each Property where
+ * property.getType().isDataType() is false
+ * since they are not copied.
+ * Read-only properties are copied.
+ * A copied object shares metadata with the source object
+ * sourceDO.getType() == copiedDO.getType()
+ * If a ChangeSummary is part of the source DataObject
+ * the copy has a new, empty ChangeSummary.
+ * Logging state is the same as the source ChangeSummary.
+ *
+ * @param dataObject to be copied
+ * @return copy of dataObject
+ */
+ DataObject copyShallow(DataObject dataObject);
+
+ /**
+ * Create a deep copy of the DataObject tree:
+ * Copies the dataObject and all its {@link commonj.sdo.Property#isContainment() contained}
+ * DataObjects recursively.
+ * Values of Properties are copied as in shallow copy,
+ * and values of Properties where
+ * property.getType().isDataType() is false
+ * are copied where each value copied must be a
+ * DataObject contained by the source dataObject.
+ * If a DataObject is outside the DataObject tree and the
+ * property is bidirectional, then the DataObject is skipped.
+ * If a DataObject is outside the DataObject tree and the
+ * property is unidirectional, then the same DataObject is referenced.
+ * Read-only properties are copied.
+ * If any DataObject referenced is not in the containment
+ * tree an IllegalArgumentException is thrown.
+ * If a ChangeSummary is part of the copy tree the new
+ * ChangeSummary refers to objects in the new DataObject tree.
+ * Logging state is the same as the source ChangeSummary.
+ *
+ * @param dataObject to be copied.
+ * @return copy of dataObject
+ * @throws IllegalArgumentException if any referenced DataObject
+ * is not part of the containment tree.
+ */
+ DataObject copy(DataObject dataObject);
+
+ /**
+ * The default CopyHelper.
+ */
+ CopyHelper INSTANCE = HelperProvider.getCopyHelper();
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/helper/DataFactory.java b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/helper/DataFactory.java
new file mode 100644
index 0000000000..8507b83440
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/helper/DataFactory.java
@@ -0,0 +1,64 @@
+/**
+ * <copyright>
+ *
+ * Service Data Objects
+ * Version 2.1.0
+ * Licensed Materials
+ *
+ * (c) Copyright BEA Systems, Inc., International Business Machines Corporation,
+ * Oracle Corporation, Primeton Technologies Ltd., Rogue Wave Software, SAP AG.,
+ * Software AG., Sun Microsystems, Sybase Inc., Xcalia, Zend Technologies,
+ * 2005, 2006. All rights reserved.
+ *
+ * </copyright>
+ *
+ */
+
+package commonj.sdo.helper;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Type;
+import commonj.sdo.impl.HelperProvider;
+
+/**
+ * A Factory for creating DataObjects.
+ * The created DataObjects are not connected to any other DataObjects.
+ */
+public interface DataFactory
+{
+ /**
+ * Create a DataObject of the Type specified by typeName with the given package uri.
+ * @param uri The uri of the Type.
+ * @param typeName The name of the Type.
+ * @return the created DataObject.
+ * @throws IllegalArgumentException if the uri and typeName does
+ * not correspond to a Type this factory can instantiate.
+ */
+ DataObject create(String uri, String typeName);
+
+ /**
+ * Create a DataObject supporting the given interface.
+ * InterfaceClass is the interface for the DataObject's Type.
+ * The DataObject created is an instance of the interfaceClass.
+ * @param interfaceClass is the interface for the DataObject's Type.
+ * @return the created DataObject.
+ * @throws IllegalArgumentException if the instanceClass does
+ * not correspond to a Type this factory can instantiate.
+ */
+ DataObject create(Class interfaceClass);
+
+ /**
+ * Create a DataObject of the Type specified.
+ * @param type The Type.
+ * @return the created DataObject.
+ * @throws IllegalArgumentException if the Type
+ * cannot be instantiaed by this factory.
+ */
+ DataObject create(Type type);
+
+ /**
+ * The default DataFactory.
+ */
+ DataFactory INSTANCE = HelperProvider.getDataFactory();
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/helper/DataHelper.java b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/helper/DataHelper.java
new file mode 100644
index 0000000000..2b705c718e
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/helper/DataHelper.java
@@ -0,0 +1,215 @@
+/**
+ * <copyright>
+ *
+ * Service Data Objects
+ * Version 2.1.0
+ * Licensed Materials
+ *
+ * (c) Copyright BEA Systems, Inc., International Business Machines Corporation,
+ * Oracle Corporation, Primeton Technologies Ltd., Rogue Wave Software, SAP AG.,
+ * Software AG., Sun Microsystems, Sybase Inc., Xcalia, Zend Technologies,
+ * 2005, 2006. All rights reserved.
+ *
+ * </copyright>
+ *
+ */
+
+package commonj.sdo.helper;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.Locale;
+
+import commonj.sdo.Type;
+import commonj.sdo.Property;
+
+import commonj.sdo.impl.HelperProvider;
+
+/**
+ * Data helper methods.
+ */
+public interface DataHelper
+{
+ /**
+ * Convert from a String representation of an SDO date type to a Date.
+ * @param dateString the String representation of an SDO date type
+ * @return a Date representation of an SDO date type.
+ * @throws IllegalArgumentException for invalid formats.
+ */
+ Date toDate(String dateString);
+
+ /**
+ * Convert from a String representation of an SDO date type to a Calendar using the
+ * default locale. Same as toCalendar(dateString, null).
+ * @param dateString the String representation of an SDO date type
+ * @return a Calendar representation of an SDO date type.
+ * @throws IllegalArgumentException for invalid formats.
+ */
+ Calendar toCalendar(String dateString);
+
+ /**
+ * Convert from a String representation of an SDO date type to a Calendar using the
+ * specified locale, or the default locale if the locale is null.
+ * @param dateString the String representation of an SDO date type
+ * @param locale the locale or null for default locale.
+ * @return a Calendar representation of an SDO date type.
+ * @throws IllegalArgumentException for invalid formats.
+ */
+ Calendar toCalendar(String dateString, Locale locale);
+
+ /**
+ * Convert from a Date to a String representation of the DateTime type.
+ * @param date the date
+ * @return a Date to a String representation of the DateTime type.
+ */
+ String toDateTime(Date date);
+
+ /**
+ * Convert from a Date to a String representation of the Duration type.
+ * @param date the date
+ * @return a Date to a String representation of the Duration type.
+ */
+ String toDuration(Date date);
+
+ /**
+ * Convert from a Date to a String representation of the Time type.
+ * @param date the date
+ * @return a Date to a String representation of the Time type.
+ */
+ String toTime(Date date);
+
+ /**
+ * Convert from a Date to a String representation of the Day type.
+ * @param date the date
+ * @return a Date to a String representation of the Day type.
+ */
+ String toDay(Date date);
+
+ /**
+ * Convert from a Date to a String representation of the Month type.
+ * @param date the date
+ * @return a Date to a String representation of the Month type.
+ */
+ String toMonth(Date date);
+
+ /**
+ * Convert from a Date to a String representation of the MonthDay type.
+ * @param date the date
+ * @return a Date to a String representation of the MonthDay type.
+ */
+ String toMonthDay(Date date);
+
+ /**
+ * Convert from a Date to a String representation of the Year type.
+ * @param date the date
+ * @return a Date to a String representation of the Year type.
+ */
+ String toYear(Date date);
+
+ /**
+ * Convert from a Date to a String representation of the YearMonth type.
+ * @param date the date
+ * @return a Date to a String representation of the YearMonth type.
+ */
+ String toYearMonth(Date date);
+
+ /**
+ * Convert from a Date to a String representation of the YearMonthDay type.
+ * @param date the date
+ * @return a Date to a String representation of the YearMonthDay type.
+ */
+ String toYearMonthDay(Date date);
+
+ /**
+ * Convert from a Calendar to a String representation of the DateTime type.
+ * @param calendar the calendar to convert
+ * @return a Calendar to a String representation of the DateTime type.
+ */
+ String toDateTime(Calendar calendar);
+
+ /**
+ * Convert from a Calendar to a String representation of the Duration type.
+ * @param calendar the calendar to convert
+ * @return a Calendar to a String representation of the Duration type.
+ */
+ String toDuration(Calendar calendar);
+
+ /**
+ * Convert from a Calendar to a String representation of the Time type.
+ * @param calendar the calendar to convert
+ * @return a Calendar to a String representation of the Time type.
+ */
+ String toTime(Calendar calendar);
+
+ /**
+ * Convert from a Calendar to a String representation of the Day type.
+ * @param calendar the calendar to convert
+ * @return a Calendar to a String representation of the Day type.
+ */
+ String toDay(Calendar calendar);
+
+ /**
+ * Convert from a Calendar to a String representation of the Month type.
+ * @param calendar the calendar to convert
+ * @return a Calendar to a String representation of the Month type.
+ */
+ String toMonth(Calendar calendar);
+
+ /**
+ * Convert from a Calendar to a String representation of the MonthDay type.
+ * @param calendar the calendar to convert
+ * @return a Calendar to a String representation of the MonthDay type.
+ */
+ String toMonthDay(Calendar calendar);
+
+ /**
+ * Convert from a Calendar to a String representation of the Year type.
+ * @param calendar the calendar to convert
+ * @return a Calendar to a String representation of the Year type.
+ */
+ String toYear(Calendar calendar);
+
+ /**
+ * Convert from a Calendar to a String representation of the YearMonth type.
+ * @param calendar the calendar to convert
+ * @return a Calendar to a String representation of the YearMonth type.
+ */
+ String toYearMonth(Calendar calendar);
+
+ /**
+ * Convert from a Calendar to a String representation of the YearMonthDay type.
+ * @param calendar the calendar to convert
+ * @return a Calendar to a String representation of the YearMonthDay type.
+ */
+ String toYearMonthDay(Calendar calendar);
+
+ /**
+ * Convert the specified value to an {@link Type#getInstanceClass() instance}
+ * of the specified type.
+ * Supported conversions are listed in Section 16 of the SDO specification.
+ * @param type the target {@link Type#isDataType() data type}.
+ * @param value the value to convert
+ * @return a value of the specified type's instance class
+ * @throws IllegalArgumentException if the value could not be converted
+ * @see #convert(Property, Object)
+ */
+ Object convert(Type type, Object value);
+
+ /**
+ * Convert the specified value to an {@link Type#getInstanceClass() instance}
+ * of the specified property's {@link Property#getType() type}.
+ * The specified value must be a List if the property is {@link Property#isMany()
+ * many valued}. In this case, all the values in the List are converted.
+ * @param property the target {@link Type#isDataType() data type} property.
+ * @param value the value or List of values to convert
+ * @return a converted value or list of converted values
+ * @throws IllegalArgumentException if the value could not be converted
+ * @see #convert(Type, Object)
+ */
+ Object convert(Property property, Object value);
+
+ /**
+ * The default DataHelper.
+ */
+ DataHelper INSTANCE = HelperProvider.getDataHelper();
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/helper/EqualityHelper.java b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/helper/EqualityHelper.java
new file mode 100644
index 0000000000..31cd9b686f
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/helper/EqualityHelper.java
@@ -0,0 +1,92 @@
+/**
+ * <copyright>
+ *
+ * Service Data Objects
+ * Version 2.1.0
+ * Licensed Materials
+ *
+ * (c) Copyright BEA Systems, Inc., International Business Machines Corporation,
+ * Oracle Corporation, Primeton Technologies Ltd., Rogue Wave Software, SAP AG.,
+ * Software AG., Sun Microsystems, Sybase Inc., Xcalia, Zend Technologies,
+ * 2005, 2006. All rights reserved.
+ *
+ * </copyright>
+ *
+ */
+
+package commonj.sdo.helper;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.impl.HelperProvider;
+
+/**
+ * A helper for comparing DataObjects.
+ */
+public interface EqualityHelper
+{
+ /**
+ * <p>Two DataObjects are equalShallow if
+ * they have the same {@link DataObject#getType Type}
+ * and all their compared Properties are equal.
+ * The set of Properties compared are the
+ * {@link DataObject#getInstanceProperties() instance properties}
+ * where property.getType().isDataType() is true
+ * and property.getType() is not ChangeSummaryType.
+ * <br/>Two of these Property values are equal if they are both not
+ * {@link DataObject#isSet(Property) set}, or set to an equal value
+ * dataObject1.get(property).equals(dataObject2.get(property))
+ * <br/>If the type is a sequenced type, the sequence entries must be the same.
+ * For each entry x in the sequence where the property is used in the comparison,
+ * dataObject1.getSequence().getValue(x).equals(
+ * dataObject2.getSequence().getValue(x)) and
+ * dataObject1.getSequence().getProperty(x) ==
+ * dataObject2.getSequence().getProperty(x)
+ * must be true.
+ * </p>
+ * Returns true the objects have the same Type and all values of all compared Properties are equal.
+ * @param dataObject1 DataObject to be compared
+ * @param dataObject2 DataObject to be compared
+ * @return true the objects have the same Type and all values of all compared Properties are equal.
+ */
+ boolean equalShallow(DataObject dataObject1, DataObject dataObject2);
+
+ /**
+ * <p>Two DataObjects are equal(Deep) if they are equalShallow,
+ * all their compared Properties are equal, and all reachable DataObjects in their
+ * graphs excluding containers are equal.
+ * The set of Properties compared are the
+ * {@link DataObject#getInstanceProperties() instance properties}
+ * where property.getType().isDataType() is false,
+ * and is not a container property, ie !property.getOpposite().isContainment()
+ * <br/>Two of these Property values are equal if they are both not
+ * {@link DataObject#isSet(Property) set}, or all the DataObjects
+ * they refer to are {@link #equal(DataObject, DataObject) equal} in the
+ * context of dataObject1 and dataObject2.
+ * <br/>Note that properties to a containing DataObject are not compared
+ * which means two DataObject trees can be equal even if their containers are not equal.
+ * <br/>If the type is a sequenced type, the sequence entries must be the same.
+ * For each entry x in the sequence where the property is used in the comparison,
+ * equal(dataObject1.getSequence().getValue(x),
+ * dataObject2.getSequence().getValue(x)) and
+ * dataObject1.getSequence().getProperty(x) ==
+ * dataObject2.getSequence().getProperty(x)
+ * must be true.
+ * </p><p>
+ * A DataObject directly or indirectly referenced by dataObject1 or dataObject2
+ * can only be equal to exactly one DataObject directly or indirectly referenced
+ * by dataObject1 or dataObject2, respectively.
+ * This ensures that dataObject1 and dataObject2 are equal if the graph formed by
+ * all their referenced DataObjects have the same shape.
+ * </p>
+ * Returns true if the trees of DataObjects are equal(Deep).
+ * @param dataObject1 DataObject to be compared
+ * @param dataObject2 DataObject to be compared
+ * @return true if the trees of DataObjects are equal(Deep).
+ */
+ boolean equal(DataObject dataObject1, DataObject dataObject2);
+
+ /**
+ * The default EqualityHelper.
+ */
+ EqualityHelper INSTANCE = HelperProvider.getEqualityHelper();
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/helper/HelperContext.java b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/helper/HelperContext.java
new file mode 100644
index 0000000000..058393f727
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/helper/HelperContext.java
@@ -0,0 +1,67 @@
+/**
+ * <copyright>
+ *
+ * Service Data Objects
+ * Version 2.1.0
+ * Licensed Materials
+ *
+ * (c) Copyright BEA Systems, Inc., International Business Machines Corporation,
+ * Oracle Corporation, Primeton Technologies Ltd., Rogue Wave Software, SAP AG.,
+ * Software AG., Sun Microsystems, Sybase Inc., Xcalia, Zend Technologies,
+ * 2005, 2006. All rights reserved.
+ *
+ * </copyright>
+ *
+ */
+
+package commonj.sdo.helper;
+
+/**
+ * This interface represents a helper execution context.
+ * The set of helpers returned by the methods in this interface have visibility
+ * to the same SDO metadata, that is, they execute in the same "scope".
+ */
+public interface HelperContext
+{
+ /**
+ * Gets the CopyHelper to use in this context.
+ * @return a CopyHelper object
+ */
+ CopyHelper getCopyHelper();
+
+ /**
+ * Gets the DataFactory to use in this context.
+ * @return a DataFactory object
+ */
+ DataFactory getDataFactory();
+
+ /**
+ * Gets the DataHelper to use in this context.
+ * @return a DataHelper object
+ */
+ DataHelper getDataHelper();
+
+ /**
+ * Gets the EqualityHelper to use in this context.
+ * @return an EqualityHelper object
+ */
+ EqualityHelper getEqualityHelper();
+
+ /**
+ * Gets the TypeHelper to use in this context.
+ * @return a TypeHelper object
+ */
+ TypeHelper getTypeHelper();
+
+ /**
+ * Gets the XMLHelper to use in this context.
+ * @return an XMLHelper object
+ */
+ XMLHelper getXMLHelper();
+
+ /**
+ * Gets the XSDHelper to use in this context.
+ * @return an XSDHelper object
+ */
+ XSDHelper getXSDHelper();
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/helper/TypeHelper.java b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/helper/TypeHelper.java
new file mode 100644
index 0000000000..6281a257b1
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/helper/TypeHelper.java
@@ -0,0 +1,96 @@
+/**
+ * <copyright>
+ *
+ * Service Data Objects
+ * Version 2.1.0
+ * Licensed Materials
+ *
+ * (c) Copyright BEA Systems, Inc., International Business Machines Corporation,
+ * Oracle Corporation, Primeton Technologies Ltd., Rogue Wave Software, SAP AG.,
+ * Software AG., Sun Microsystems, Sybase Inc., Xcalia, Zend Technologies,
+ * 2005, 2006. All rights reserved.
+ *
+ * </copyright>
+ *
+ */
+
+package commonj.sdo.helper;
+
+import java.util.List;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+import commonj.sdo.impl.HelperProvider;
+
+/**
+ * Look up a Type given the uri and typeName or interfaceClass.
+ * SDO Types are available through the
+ * getType("commonj.sdo", typeName) method.
+ * Defines Types from DataObjects.
+ */
+public interface TypeHelper
+{
+ /**
+ * Return the Type specified by typeName with the given uri,
+ * or null if not found.
+ * @param uri The uri of the Type - type.getURI();
+ * @param typeName The name of the Type - type.getName();
+ * @return the Type specified by typeName with the given uri,
+ * or null if not found.
+ */
+ Type getType(String uri, String typeName);
+
+ /**
+ * Return the Type for this interfaceClass or null if not found.
+ * @param interfaceClass is the interface for the DataObject's Type -
+ * type.getInstanceClass();
+ * @return the Type for this interfaceClass or null if not found.
+ */
+ Type getType(Class interfaceClass);
+
+ /**
+ * Get the open content (global) Property with the specified uri and name, or null
+ * if not found.
+ * @param uri the namespace URI of the open content Property.
+ * @param propertyName the name of the open content Property.
+ * @return the global Property.
+ */
+ Property getOpenContentProperty(String uri, String propertyName);
+
+ /**
+ * Define the DataObject as a Type.
+ * The Type is available through TypeHelper and DataGraph getType() methods.
+ * @param type the DataObject representing the Type.
+ * @return the defined Type.
+ * @throws IllegalArgumentException if the Type could not be defined.
+ */
+ Type define(DataObject type);
+
+ /**
+ * Define the list of DataObjects as Types.
+ * The Types are available through TypeHelper and DataGraph getType() methods.
+ * @param types a List of DataObjects representing the Types.
+ * @return the defined Types.
+ * @throws IllegalArgumentException if the Types could not be defined.
+ */
+ List /*Type*/ define(List /*DataObject*/ types);
+
+ /**
+ * Define the DataObject as a Property for setting open content.
+ * The containing Type of the open content property is not specified by SDO.
+ * If the specified uri is not null the defined property is accessible through
+ * TypeHelper.getOpenContentProperty(uri, propertyName).
+ * If a null uri is specified, the location and management of the open content property
+ * is not specified by SDO.
+ * @param uri the namespace URI of the open content Property or null.
+ * @return the defined open content Property.
+ * @throws IllegalArgumentException if the Property could not be defined.
+ */
+ Property defineOpenContentProperty(String uri, DataObject property);
+
+ /**
+ * The default TypeHelper.
+ */
+ TypeHelper INSTANCE = HelperProvider.getTypeHelper();
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/helper/XMLDocument.java b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/helper/XMLDocument.java
new file mode 100644
index 0000000000..a89ff7bd9d
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/helper/XMLDocument.java
@@ -0,0 +1,155 @@
+/**
+ * <copyright>
+ *
+ * Service Data Objects
+ * Version 2.1.0
+ * Licensed Materials
+ *
+ * (c) Copyright BEA Systems, Inc., International Business Machines Corporation,
+ * Oracle Corporation, Primeton Technologies Ltd., Rogue Wave Software, SAP AG.,
+ * Software AG., Sun Microsystems, Sybase Inc., Xcalia, Zend Technologies,
+ * 2005, 2006. All rights reserved.
+ *
+ * </copyright>
+ *
+ */
+
+package commonj.sdo.helper;
+
+import commonj.sdo.DataObject;
+
+/**
+ * Represents an XML Document containing a tree of DataObjects.
+ *
+ * An example XMLDocument fragment is:
+ * <?xml version="1.0"?>
+ * <purchaseOrder orderDate="1999-10-20">
+ *
+ * created from this XML Schema fragment:
+ * <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ * <xsd:element name="purchaseOrder" type="PurchaseOrderType"/>
+ * <xsd:complexType name="PurchaseOrderType">
+ *
+ * Upon loading this XMLDocument:
+ * DataObject is an instance of Type PurchaseOrderType.
+ * RootElementURI is null because the XSD has no targetNamespace URI.
+ * RootElementName is purchaseOrder.
+ * Encoding is null because the document did not specify an encoding.
+ * XMLDeclaration is true because the document contained an XML declaration.
+ * XMLVersion is 1.0
+ * SchemaLocation and noNamespaceSchemaLocation are null because they are
+ * not specified in the document.
+ *
+ * When saving the root element, if the type of the root dataObject is not the
+ * type of global element specified by rootElementURI and rootElementName,
+ * or if a global element does not exist for rootElementURI and rootElementName,
+ * then an xsi:type declaration is written to record the root DataObject's Type.
+ *
+ * When loading the root element and an xsi:type declaration is found
+ * it is used as the type of the root DataObject. In this case,
+ * if validation is not being performed, it is not an error if the
+ * rootElementName is not a global element.
+ */
+public interface XMLDocument
+{
+ /**
+ * Return the root DataObject for the XMLDocument.
+ * @return root DataObject for the XMLDocument.
+ */
+ DataObject getRootObject();
+
+ /**
+ * Return the targetNamespace URI for the root element.
+ * If there is no targetNamespace URI, the value is null.
+ * The root element is a global element of the XML Schema
+ * with a type compatible to the DataObject.
+ * @return the targetNamespace URI for the root element.
+ */
+ String getRootElementURI();
+
+ /**
+ * Return the name of the root element.
+ * The root element is a global element of the XML Schema
+ * with a type compatible to the DataObject.
+ * @return the name of the root element.
+ */
+ String getRootElementName();
+
+ /**
+ * Return the XML encoding of the document, or null if not specified.
+ * The default value is "UTF-8".
+ * Specification of other values is implementation-dependent.
+ * @return the XML encoding of the document, or null if not specified.
+ */
+ String getEncoding();
+
+ /**
+ * Set the XML encoding of the document, or null if not specified.
+ * @param encoding
+ */
+ void setEncoding(String encoding);
+
+ /**
+ * Return the XML declaration of the document. If true,
+ * XMLHelper save() will produce a declaration of the form:
+ * <?xml version="1.0" encoding="UTF-8"?>
+ * Encoding will be suppressed if getEncoding() is null.
+ * The default value is true.
+ * @return the XML declaration of the document.
+ */
+ boolean isXMLDeclaration();
+
+ /**
+ * Set the XML declaration version of the document.
+ * @param xmlDeclaration the XML declaration version of the document.
+ */
+ void setXMLDeclaration(boolean xmlDeclaration);
+
+ /**
+ * Return the XML version of the document, or null if not specified.
+ * The default value is "1.0".
+ * Specification of other values is implementation-dependent.
+ * @return the XML version of the document, or null if not specified.
+ */
+ String getXMLVersion();
+
+ /**
+ * Set the XML version of the document, or null if not specified.
+ * @param xmlVersion the XML version of the document, or null if not specified.
+ */
+ void setXMLVersion(String xmlVersion);
+
+ /**
+ * Return the value of the schemaLocation declaration
+ * for the http://www.w3.org/2001/XMLSchema-instance namespace in the
+ * root element, or null if not present.
+ * @return the value of the schemaLocation declaration,
+ * or null if not present.
+ */
+ String getSchemaLocation();
+
+ /**
+ * Sets the value of the schemaLocation declaration
+ * for the http://www.w3.org/2001/XMLSchema-instance namespace in the
+ * root element, or null if it should not be present.
+ * @param schemaLocation the value of the schemaLocation declaration, or null.
+ */
+ void setSchemaLocation(String schemaLocation);
+
+ /**
+ * Return the value of the noNamespaceSchemaLocation declaration
+ * for the http://www.w3.org/2001/XMLSchema-instance namespace in the
+ * root element, or null if not present.
+ * @return the value of the noNamespaceSchemaLocation declaration,
+ * or null if not present.
+ */
+ String getNoNamespaceSchemaLocation();
+
+ /**
+ * Sets the value of the noNamespaceSchemaLocation declaration
+ * for the http://www.w3.org/2001/XMLSchema-instance namespace in the
+ * root element, or null if it should not be present.
+ * @param schemaLocation the value of the noNamespaceSchemaLocation declaration, or null.
+ */
+ void setNoNamespaceSchemaLocation(String schemaLocation);
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/helper/XMLHelper.java b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/helper/XMLHelper.java
new file mode 100644
index 0000000000..d28b017b41
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/helper/XMLHelper.java
@@ -0,0 +1,201 @@
+/**
+ * <copyright>
+ *
+ * Service Data Objects
+ * Version 2.1.0
+ * Licensed Materials
+ *
+ * (c) Copyright BEA Systems, Inc., International Business Machines Corporation,
+ * Oracle Corporation, Primeton Technologies Ltd., Rogue Wave Software, SAP AG.,
+ * Software AG., Sun Microsystems, Sybase Inc., Xcalia, Zend Technologies,
+ * 2005, 2006. All rights reserved.
+ *
+ * </copyright>
+ *
+ */
+
+package commonj.sdo.helper;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.Reader;
+import java.io.Writer;
+import javax.xml.transform.Source;
+import javax.xml.transform.Result;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.impl.HelperProvider;
+
+/**
+ * A helper to convert XML documents into DataObects and
+ * DataObjects into XML documnets.
+ */
+public interface XMLHelper
+{
+ /**
+ * Creates and returns an XMLDocument from the input String.
+ * By default does not perform XSD validation.
+ * Same as
+ * load(new StringReader(inputString), null, null);
+ *
+ * @param inputString specifies the String to read from
+ * @return the new XMLDocument loaded
+ * @throws RuntimeException for errors in XML parsing or
+ * implementation-specific validation.
+ */
+ XMLDocument load(String inputString);
+
+ /**
+ * Creates and returns an XMLDocument from the inputStream.
+ * The InputStream will be closed after reading.
+ * By default does not perform XSD validation.
+ * Same as
+ * load(inputStream, null, null);
+ *
+ * @param inputStream specifies the InputStream to read from
+ * @return the new XMLDocument loaded
+ * @throws IOException for stream exceptions.
+ * @throws RuntimeException for errors in XML parsing or
+ * implementation-specific validation.
+ */
+ XMLDocument load(InputStream inputStream) throws IOException;
+
+ /**
+ * Creates and returns an XMLDocument from the inputStream.
+ * The InputStream will be closed after reading.
+ * By default does not perform XSD validation.
+ * @param inputStream specifies the InputStream to read from
+ * @param locationURI specifies the URI of the document for relative schema locations
+ * @param options implementation-specific options.
+ * @return the new XMLDocument loaded
+ * @throws IOException for stream exceptions.
+ * @throws RuntimeException for errors in XML parsing or
+ * implementation-specific validation.
+ */
+ XMLDocument load(InputStream inputStream, String locationURI, Object options) throws IOException;
+
+ /**
+ * Creates and returns an XMLDocument from the inputReader.
+ * The InputStream will be closed after reading.
+ * By default does not perform XSD validation.
+ * @param inputReader specifies the Reader to read from
+ * @param locationURI specifies the URI of the document for relative schema locations
+ * @param options implementation-specific options.
+ * @return the new XMLDocument loaded
+ * @throws IOException for stream exceptions.
+ * @throws RuntimeException for errors in XML parsing or
+ * implementation-specific validation.
+ */
+ XMLDocument load(Reader inputReader, String locationURI, Object options) throws IOException;
+
+ /**
+ * Creates and returns an XMLDocument from the inputSource.
+ * The InputSource will be closed after reading.
+ * By default does not perform XSD validation.
+ * @param inputSource specifies the Source to read from
+ * @param locationURI specifies the URI of the document for relative schema locations
+ * @param options implementation-specific options.
+ * @return the new XMLDocument loaded
+ * @throws IOException for stream exceptions.
+ * @throws RuntimeException for errors in XML parsing or
+ * implementation-specific validation.
+ */
+ XMLDocument load(Source inputSource, String locationURI, Object options) throws IOException;
+
+ /**
+ * Returns the DataObject saved as an XML document with the specified root element.
+ * Same as
+ * StringWriter stringWriter = new StringWriter();
+ * save(createDocument(dataObject, rootElementURI, rootElementName),
+ * stringWriter, null);
+ * stringWriter.toString();
+ *
+ * @param dataObject specifies DataObject to be saved
+ * @param rootElementURI the Target Namespace URI of the root XML element
+ * @param rootElementName the Name of the root XML element
+ * @return the saved XML document as a string
+ * @throws IllegalArgumentException if the dataObject tree
+ * is not closed or has no container.
+ */
+ String save(DataObject dataObject, String rootElementURI, String rootElementName);
+
+ /**
+ * Saves the DataObject as an XML document with the specified root element.
+ * Same as
+ * save(createDocument(dataObject, rootElementURI, rootElementName),
+ * outputStream, null);
+ *
+ * @param dataObject specifies DataObject to be saved
+ * @param rootElementURI the Target Namespace URI of the root XML element
+ * @param rootElementName the Name of the root XML element
+ * @param outputStream specifies the OutputStream to write to.
+ * @throws IOException for stream exceptions.
+ * @throws IllegalArgumentException if the dataObject tree
+ * is not closed or has no container.
+ */
+ void save(DataObject dataObject, String rootElementURI, String rootElementName, OutputStream outputStream) throws IOException;
+
+ /**
+ * Serializes an XMLDocument as an XML document into the outputStream.
+ * If the DataObject's Type was defined by an XSD, the serialization
+ * will follow the XSD.
+ * Otherwise the serialization will follow the format as if an XSD
+ * were generated as defined by the SDO specification.
+ * The OutputStream will be flushed after writing.
+ * Does not perform validation to ensure compliance with an XSD.
+ * @param xmlDocument specifies XMLDocument to be saved
+ * @param outputStream specifies the OutputStream to write to.
+ * @param options implementation-specific options.
+ * @throws IOException for stream exceptions.
+ * @throws IllegalArgumentException if the dataObject tree
+ * is not closed or has no container.
+ */
+ void save(XMLDocument xmlDocument, OutputStream outputStream, Object options) throws IOException;
+
+ /**
+ * Serializes an XMLDocument as an XML document into the outputWriter.
+ * If the DataObject's Type was defined by an XSD, the serialization
+ * will follow the XSD.
+ * Otherwise the serialization will follow the format as if an XSD
+ * were generated as defined by the SDO specification.
+ * The OutputStream will be flushed after writing.
+ * Does not perform validation to ensure compliance with an XSD.
+ * @param xmlDocument specifies XMLDocument to be saved
+ * @param outputWriter specifies the Writer to write to.
+ * @param options implementation-specific options.
+ * @throws IOException for stream exceptions.
+ * @throws IllegalArgumentException if the dataObject tree
+ * is not closed or has no container.
+ */
+ void save(XMLDocument xmlDocument, Writer outputWriter, Object options) throws IOException;
+
+ /**
+ * Serializes an XMLDocument as an XML document into the outputResult in a
+ * serialization technology independent format (as specified in
+ * javax.xml.transform).
+ * The OutputResult will be flushed after writing.
+ * Does not perform validation to ensure compliance with an XSD.
+ * @param xmlDocument specifies XMLDocument to be saved
+ * @param outputResult specifies Result to be saved
+ * @param options implementation-specific options.
+ * @throws IOException for stream exceptions.
+ * @throws IllegalArgumentException if the dataObject tree
+ * is not closed or has no container.
+ */
+ void save(XMLDocument xmlDocument, Result outputResult, Object options) throws IOException;
+
+ /**
+ * Creates an XMLDocument with the specified XML rootElement for the DataObject.
+ * @param dataObject specifies DataObject to be saved
+ * @param rootElementURI the Target Namespace URI of the root XML element
+ * @param rootElementName the Name of the root XML element
+ * @return XMLDocument a new XMLDocument set with the specified parameters.
+ */
+ XMLDocument createDocument(DataObject dataObject, String rootElementURI, String rootElementName);
+
+ /**
+ * The default XMLHelper.
+ */
+ XMLHelper INSTANCE = HelperProvider.getXMLHelper();
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/helper/XSDHelper.java b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/helper/XSDHelper.java
new file mode 100644
index 0000000000..af4f002690
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/helper/XSDHelper.java
@@ -0,0 +1,196 @@
+/**
+ * <copyright>
+ *
+ * Service Data Objects
+ * Version 2.1.0
+ * Licensed Materials
+ *
+ * (c) Copyright BEA Systems, Inc., International Business Machines Corporation,
+ * Oracle Corporation, Primeton Technologies Ltd., Rogue Wave Software, SAP AG.,
+ * Software AG., Sun Microsystems, Sybase Inc., Xcalia, Zend Technologies,
+ * 2005, 2006. All rights reserved.
+ *
+ * </copyright>
+ *
+ */
+
+package commonj.sdo.helper;
+
+import java.io.InputStream;
+import java.io.Reader;
+import java.util.List;
+import java.util.Map;
+
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+import commonj.sdo.impl.HelperProvider;
+
+/**
+ * Provides access to additional information when the
+ * Type or Property is defined by an XML Schema (XSD).
+ * Methods return null/false otherwise or if the information is unavailable.
+ * Defines Types from an XSD.
+*/
+public interface XSDHelper
+{
+ /**
+ * Returns the local name as declared in the XSD.
+ * @param type to return local name for.
+ * @return the local name as declared in the XSD.
+ */
+ String getLocalName(Type type);
+
+ /**
+ * Returns the local name as declared in the XSD.
+ * @param property to return local name for.
+ * @return the local name as declared in the XSD.
+ */
+ String getLocalName(Property property);
+
+ /**
+ * Returns the namespace URI as declared in the XSD.
+ * @param property to return namespace URI for.
+ * @return the namespace URI as declared in the XSD.
+ */
+ String getNamespaceURI(Property property);
+
+ /**
+ * Returns true if the property is declared as an attribute in the XSD.
+ * Returns false if not known or for advanced cases.
+ * It is possible for both isAttribute and isElement to return false
+ * but they will not both return true.
+ * @param property to identify if an attribute.
+ * @return true if the property is declared as an attribute in the XSD.
+ */
+ boolean isAttribute(Property property);
+
+ /**
+ * Returns true if the property is declared as an element in the XSD.
+ * Returns false if not known or for advanced cases.
+ * It is possible for both isAttribute and isElement to return false
+ * but they will not both return true.
+ * @param property to identify if an element.
+ * @return true if the property is declared as an element in the XSD.
+ */
+ boolean isElement(Property property);
+
+ /**
+ * Returns true if the Type is declared to contain mixed content.
+ * A DataObject's mixed content values are typically accessed via a Sequence.
+ * @param type to identify if mixed content.
+ * @return true if the Type is declared to contain mixed content.
+ */
+ boolean isMixed(Type type);
+
+ /**
+ * Indicates if this helper contains XSD information for the specified type.
+ * @param type the type.
+ * @return true if this helper contains XSD information for the specified type.
+ */
+ boolean isXSD(Type type);
+
+ /**
+ * Returns the Property defined by the named global element or attribute
+ * in the targetNamespace uri, or null if not found.
+ * @param uri The uri of the targetNamespace.
+ * @param propertyName The name of the global property.
+ * @param isElement is true for global elements, false for global attributes.
+ * @return the Property defined by the named global element or attribute
+ * in the targetNamespace uri, or null if not found.
+ */
+ Property getGlobalProperty(String uri, String propertyName, boolean isElement);
+
+ /**
+ * Return the appinfo declared for this Type and source.
+ * The appinfo start and end tags and content are returned.
+ * The xml namespace context is preserved in the appinfo element.
+ * If more than one appinfo with the same source is declared on the same
+ * Type their contents are concatenated.
+ * @param type the type with the appinfo declaration
+ * @param source the source of the appinfo declaration.
+ * @return the appinfo declared for this Type and source.
+ */
+ String getAppinfo(Type type, String source);
+
+ /**
+ * Return the content of the appinfo declared for this Property and source.
+ * If the property is defined by ref= the appinfo of the referenced
+ * element or attribute is included.
+ * The appinfo start and end tags and content are returned.
+ * The xml namespace context is preserved in the appinfo element.
+ * If more than one appinfo with the same source is declared on the same
+ * Type their contents are concatenated.
+ * @param property the Property with the appinfo declaration
+ * @param source the source of the appinfo declaration.
+ * @return the appinfo declared for this Property and source.
+ */
+ String getAppinfo(Property property, String source);
+
+ /**
+ * Define the XML Schema as Types.
+ * The Types are available through TypeHelper and DataGraph getType() methods.
+ * Same as define(new StringReader(xsd), null)
+ * @param xsd the XML Schema.
+ * @return the defined Types.
+ * @throws IllegalArgumentException if the Types could not be defined.
+ */
+ List /*Type*/ define(String xsd);
+
+ /**
+ * Define XML Schema as Types.
+ * The Types are available through TypeHelper and DataGraph getType() methods.
+ * @param xsdReader reader to an XML Schema.
+ * @param schemaLocation the URI of the location of the schema, used
+ * for processing relative imports and includes. May be null if not used.
+ * @return the defined Types.
+ * @throws IllegalArgumentException if the Types could not be defined.
+ */
+ List /*Type*/ define(Reader xsdReader, String schemaLocation);
+
+ /**
+ * Define XML Schema as Types.
+ * The Types are available through TypeHelper and DataGraph getType() methods.
+ * @param xsdInputStream input stream to an XML Schema.
+ * @param schemaLocation the URI of the location of the schema, used
+ * for processing relative imports and includes. May be null if not used.
+ * @return the defined Types.
+ * @throws IllegalArgumentException if the Types could not be defined.
+ */
+ List /*Type*/ define(InputStream xsdInputStream, String schemaLocation);
+
+ /**
+ * Generate an XML Schema Declaration (XSD) from Types.
+ * Same as generate(types, null);
+ * @param types a List containing the Types
+ * @return a String containing the generated XSD.
+ * @throws IllegalArgumentException if the XSD could not be generated.
+ */
+ String generate(List /*Type*/ types);
+
+ /**
+ * Generate an XML Schema Declaration (XSD) from Types.
+ * Round trip from SDO to XSD to SDO is supported.
+ * Round trip from XSD to SDO to XSD is not supported.
+ * Use the original schema if one exists instead of generating a new one, as
+ * the generated XSD validates a different set of documents than the original XSD.
+ * Generating an XSD does not affect the XSDHelper or the Types.
+ * The Types must all have the same URI.
+ * The result is a String containing the generated XSD.
+ * All Types referenced with the same URI will be generated in the XSD
+ * and the list will be expanded to include all types generated.
+ * Any Types referenced with other URIs will cause
+ * imports to be produced as appropriate.
+ * Imports will include a schemaLocation if a Map is provided with an entry
+ * of the form key=import target namespace, value=schemaLocation
+ * @param types a List containing the Types
+ * @param namespaceToSchemaLocation map of target namespace to schema locations or null
+ * @return a String containing the generated XSD.
+ * @throws IllegalArgumentException if the XSD could not be generated.
+ */
+ String generate(List /*Type*/ types, Map /*String, String*/ namespaceToSchemaLocation);
+
+ /**
+ * The default XSDHelper.
+ */
+ XSDHelper INSTANCE = HelperProvider.getXSDHelper();
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/impl/ExternalizableDelegator.java b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/impl/ExternalizableDelegator.java
new file mode 100644
index 0000000000..03220a8a32
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/impl/ExternalizableDelegator.java
@@ -0,0 +1,90 @@
+/**
+ * <copyright>
+ *
+ * Service Data Objects
+ * Version 2.1.0
+ * Licensed Materials
+ *
+ * (c) Copyright BEA Systems, Inc., International Business Machines Corporation,
+ * Oracle Corporation, Primeton Technologies Ltd., Rogue Wave Software, SAP AG.,
+ * Software AG., Sun Microsystems, Sybase Inc., Xcalia, Zend Technologies,
+ * 2005, 2006. All rights reserved.
+ *
+ * </copyright>
+ *
+ */
+
+package commonj.sdo.impl;
+
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.io.ObjectStreamException;
+
+/**
+ * Delegates DataObject serialization while ensuring implementation independent
+ * java.io.Serialization. An implementation of DataObject
+ * returns an ExternalizableDelegator from its writeReplace() method.
+ *
+ * The root DataObject is the object returned from do.getRootObject() where
+ * do is the DataObject being serialized in a java.io.ObjectOutputStream.
+ * When do.getContainer() == null then do is a root object.
+ *
+ * The byte format for each DataObject in the stream is:
+ * [0] [path] [root] // when do is not a root object
+ * [1] [rootXML] // when do is a root object
+ *
+ * where:
+ * [0] is the byte 0, serialized using writeByte(0).
+ * [1] is the byte 1, serialized using writeByte(1).
+ *
+ * [path] is an SDO path expression from the root DataObject to the serialized
+ * DataObject such that root.getDataObject(path) == do.
+ * Serialized using writeUTF(path).
+ *
+ * [root] is the root object serialized using writeObject(root).
+ *
+ * [rootXML] is the GZip of the XML serialization of the root DataObject.
+ * The XML serialization is the same as
+ * XMLHelper.INSTANCE.save(root, "commonj.sdo", "dataObject", stream);
+ * where stream is a GZIPOutputStream, length is the number of bytes
+ * in the stream, and bytes are the contents of the stream.
+ * Serialized using writeInt(length), write(bytes).
+ *
+ */
+public class ExternalizableDelegator implements Externalizable
+{
+ public interface Resolvable extends Externalizable
+ {
+ Object readResolve() throws ObjectStreamException;
+ }
+
+ static final long serialVersionUID = 1;
+ transient Resolvable delegate;
+
+ public ExternalizableDelegator()
+ {
+ delegate = HelperProvider.createResolvable();
+ }
+
+ public ExternalizableDelegator(Object target)
+ {
+ delegate = HelperProvider.createResolvable(target);
+ }
+
+ public void writeExternal(ObjectOutput out) throws IOException
+ {
+ delegate.writeExternal(out);
+ }
+
+ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
+ {
+ delegate.readExternal(in);
+ }
+
+ public Object readResolve() throws ObjectStreamException
+ {
+ return delegate.readResolve();
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/impl/HelperProvider.java b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/impl/HelperProvider.java
new file mode 100644
index 0000000000..2bb5d9b3fd
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/impl/HelperProvider.java
@@ -0,0 +1,400 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package commonj.sdo.impl;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.UnsupportedEncodingException;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+import commonj.sdo.helper.CopyHelper;
+import commonj.sdo.helper.DataFactory;
+import commonj.sdo.helper.DataHelper;
+import commonj.sdo.helper.EqualityHelper;
+import commonj.sdo.helper.HelperContext;
+import commonj.sdo.helper.TypeHelper;
+import commonj.sdo.helper.XMLHelper;
+import commonj.sdo.helper.XSDHelper;
+
+/**
+ * A HelperProvider obtains specific default helpers and other
+ * implementation-specific objects used by a Java implementation of SDO.
+ *
+ * @version $Rev$ $Date$
+ */
+public abstract class HelperProvider {
+ /**
+ * The default HelperProvider INSTANCE. This is located using the ClassLoader used
+ * to load the HelperProvider class itself and if no default implementation is available
+ * this field will be set to null.
+ */
+ public static final HelperProvider INSTANCE;
+
+ /**
+ * The name of the resource that is used for service location.
+ */
+ public static final String SERVICE_RESOURCE_NAME = "META-INF/services/commonj.sdo.impl.HelperProvider";
+
+ /**
+ * The name of the system property that will be checked for an implementation name.
+ */
+ public static final String PROPERTY_NAME = "commonj.sdo.impl.HelperProvider";
+
+ static {
+ // initialize the default instance using this class's classloader
+ // set to null if none could be located (implies no default implementation)
+ HelperProvider provider;
+ try {
+ provider = getInstance(HelperProvider.class.getClassLoader());
+ } catch (NoHelperProviderException e) {
+ provider = null;
+ }
+ INSTANCE = provider;
+ }
+
+ /**
+ * Locate and instantiate a HelperProvider.
+ * <p/>
+ * Attempt to locate a HelperProvider using first the Thread's current context classloader and then,
+ * if that is not set, not readable, or does not provide an implementation, using the classloader
+ * used to load the HelperProvider class itself.
+ * <p/>
+ * A new instance is returned for each sucessful invocation.
+ *
+ * @return an implementation of HelperProvider
+ * @throws NoHelperProviderException if no provider implementation was defined or it could not be instantiated
+ */
+ public static HelperProvider getInstance() throws NoHelperProviderException {
+ String implName = getImplementationName();
+
+ ClassLoader cl = getContextClassLoader();
+ if (cl != null) {
+ HelperProvider provider = loadImplementation(cl, implName);
+ if (provider != null) {
+ return provider;
+ }
+ }
+
+ cl = HelperProvider.class.getClassLoader();
+ HelperProvider provider = loadImplementation(cl, implName);
+ if (provider != null) {
+ return provider;
+ }
+
+ throw new NoHelperProviderException(implName);
+ }
+
+
+ /**
+ * Locate and instantiate a HelperProvider using the supplied ClassLoader.
+ * <p/>
+ * The name of the implementation to use is determined by the value of the "commonj.sdo.impl.HelperProvider"
+ * system property. If this is not set or this code does not have permission to read it then the name
+ * will be retrieved from the META-INF/services/commonj.sdo.impl.HelperProvider resource as returned
+ * by the supplied classloader as described in the
+ * <a href="http://java.sun.com/j2se/1.5.0/docs/guide/jar/jar.html#Service%20Provider">JAR file specification</a>.
+ * <p/>
+ * A new instance is returned for each sucessful invocation.
+ *
+ * @param cl the classloader to use to locate and instantiate the implementation
+ * @return the specified implementation of HelperProvider
+ * @throws NoHelperProviderException if no provider implementation was defined or it could not be instantiated
+ */
+ public static HelperProvider getInstance(ClassLoader cl) throws NoHelperProviderException {
+ String implName = getImplementationName();
+ HelperProvider provider = loadImplementation(cl, implName);
+ if (provider == null) {
+ throw new NoHelperProviderException(implName);
+ }
+ return provider;
+ }
+
+ private static ClassLoader getContextClassLoader() {
+ try {
+ return (ClassLoader)AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ });
+ } catch (SecurityException e) {
+ return null;
+ }
+ }
+
+ private static HelperProvider loadImplementation(ClassLoader cl, String implName) throws NoHelperProviderException {
+ // if no name is requested, locate using the supplied classloader
+ if (implName == null) {
+ implName = getImplementationName(cl);
+ }
+ // no implementation to try, return null
+ if (implName == null) {
+ return null;
+ }
+
+ // try an instantiate the implementation
+ try {
+ return (HelperProvider) cl.loadClass(implName).newInstance();
+ } catch (InstantiationException e) {
+ throw new NoHelperProviderException(implName, e);
+ } catch (IllegalAccessException e) {
+ throw new NoHelperProviderException(implName, e);
+ } catch (ClassNotFoundException e) {
+ throw new NoHelperProviderException(implName, e);
+ }
+ }
+
+ private static String getImplementationName() {
+ try {
+ return (String)AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ return System.getProperty(PROPERTY_NAME);
+ }
+ });
+ } catch (SecurityException e) {
+ return null;
+ }
+ }
+
+ private static String getImplementationName(ClassLoader cl) {
+ InputStream is = cl.getResourceAsStream(SERVICE_RESOURCE_NAME);
+ if (is == null) {
+ return null;
+ }
+
+ InputStreamReader in;
+ try {
+ in = new InputStreamReader(is, "UTF-8");
+ } catch (UnsupportedEncodingException e) {
+ throw new AssertionError("UTF-8 encoding not available");
+ }
+
+ try {
+ BufferedReader reader = new BufferedReader(in, 128);
+ try {
+ String line;
+ while ((line = reader.readLine()) != null) {
+ int i = line.indexOf('#');
+ if (i != -1) {
+ line = line.substring(0, i);
+ }
+ line = line.trim();
+ if (line.length() > 0) {
+ return line;
+ }
+ }
+ return null;
+ } finally {
+ reader.close();
+ }
+ } catch (IOException e) {
+ throw new NoHelperProviderException(e);
+ }
+ }
+
+
+ ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ // implementation specific methods for users that don't want to use the default implementation
+
+ /**
+ * Returns a CopyHelper obtained from this implementation.
+ *
+ * @return a CopyHelper obtained from this implementation
+ */
+ public abstract CopyHelper copyHelper();
+
+ /**
+ * Returns a DataFactory obtained from this implementation.
+ *
+ * @return a DataFactory obtained from this implementation
+ */
+ public abstract DataFactory dataFactory();
+
+ /**
+ * Returns a DataHelper obtained from this implementation.
+ *
+ * @return a DataHelper obtained from this implementation
+ */
+ public abstract DataHelper dataHelper();
+
+ /**
+ * Returns a EqualityHelper obtained from this implementation.
+ *
+ * @return a EqualityHelper obtained from this implementation
+ */
+ public abstract EqualityHelper equalityHelper();
+
+ /**
+ * Returns a TypeHelper obtained from this implementation.
+ *
+ * @return a TypeHelper obtained from this implementation
+ */
+ public abstract TypeHelper typeHelper();
+
+ /**
+ * Returns a XMLHelper obtained from this implementation.
+ *
+ * @return a XMLHelper obtained from this implementation
+ */
+ public abstract XMLHelper xmlHelper();
+
+ /**
+ * Returns a XSDHelper obtained from this implementation.
+ *
+ * @return a XSDHelper obtained from this implementation
+ */
+ public abstract XSDHelper xsdHelper();
+
+ /**
+ * Create a Resolvable using this implementation
+ *
+ * @return a Resolvable created using this implementation
+ */
+ public abstract ExternalizableDelegator.Resolvable resolvable();
+
+ /**
+ * Create a Resolvable using this implementation
+ *
+ * @param target the object to be resolved
+ * @return a Resolvable created using this implementation
+ */
+ public abstract ExternalizableDelegator.Resolvable resolvable(Object target);
+
+
+ ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ // static helper methods required by the specification
+
+ /**
+ * Returns a CopyHelper obtained from the default HelperProvider.
+ *
+ * @return a CopyHelper obtained from the default HelperProvider
+ */
+ public static CopyHelper getCopyHelper() {
+ return INSTANCE.copyHelper();
+ }
+
+ /**
+ * Returns a DataFactory obtained from the default HelperProvider.
+ *
+ * @return a DataFactory obtained from the default HelperProvider
+ */
+ public static DataFactory getDataFactory() {
+ return INSTANCE.dataFactory();
+ }
+
+ /**
+ * Returns a DataHelper obtained from the default HelperProvider.
+ *
+ * @return a DataHelper obtained from the default HelperProvider
+ */
+ public static DataHelper getDataHelper() {
+ return INSTANCE.dataHelper();
+ }
+
+ /**
+ * Returns a EqualityHelper obtained from the default HelperProvider.
+ *
+ * @return a EqualityHelper obtained from the default HelperProvider
+ */
+ public static EqualityHelper getEqualityHelper() {
+ return INSTANCE.equalityHelper();
+ }
+
+ /**
+ * Returns a TypeHelper obtained from the default HelperProvider.
+ *
+ * @return a TypeHelper obtained from the default HelperProvider
+ */
+ public static TypeHelper getTypeHelper() {
+ return INSTANCE.typeHelper();
+ }
+
+ /**
+ * Returns a XMLHelper obtained from the default HelperProvider.
+ *
+ * @return a XMLHelper obtained from the default HelperProvider
+ */
+ public static XMLHelper getXMLHelper() {
+ return INSTANCE.xmlHelper();
+ }
+
+ /**
+ * Returns a XSDHelper obtained from the default HelperProvider.
+ *
+ * @return a XSDHelper obtained from the default HelperProvider
+ */
+ public static XSDHelper getXSDHelper() {
+ return INSTANCE.xsdHelper();
+ }
+
+ /**
+ * Create a Resolvable using the default HelperProvider
+ *
+ * @return a Resolvable created using the default HelperProvider
+ */
+ public static ExternalizableDelegator.Resolvable createResolvable() {
+ return INSTANCE.resolvable();
+ }
+
+ /**
+ * Create a Resolvable using the default HelperProvider
+ *
+ * @param target the object to be resolved
+ * @return a Resolvable created using the default HelperProvider
+ */
+ public static ExternalizableDelegator.Resolvable createResolvable(Object target) {
+ return INSTANCE.resolvable(target);
+ }
+
+ ////////////////////////////////////////////////////////////////////////////////////////////////////
+ // New in SDO 2.1
+ ////////////////////////////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * Gets the default HelperContext
+ * @return a HelperContext object
+ */
+ public static HelperContext getDefaultContext()
+ {
+ return INSTANCE.helperContext();
+ }
+
+ HelperContext helperContext()
+ {
+ return defaultContext;
+ }
+
+ static HelperContext defaultContext = new DefaultHelperContext();
+
+ static class DefaultHelperContext implements HelperContext
+ {
+ public CopyHelper getCopyHelper() { return INSTANCE.copyHelper(); }
+ public DataFactory getDataFactory() { return INSTANCE.dataFactory(); }
+ public DataHelper getDataHelper() { return INSTANCE.dataHelper(); }
+ public EqualityHelper getEqualityHelper() { return INSTANCE.equalityHelper(); }
+ public TypeHelper getTypeHelper() { return INSTANCE.typeHelper(); }
+ public XMLHelper getXMLHelper() { return INSTANCE.xmlHelper(); }
+ public XSDHelper getXSDHelper() { return INSTANCE.xsdHelper(); }
+ }
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/impl/NoHelperProviderException.java b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/impl/NoHelperProviderException.java
new file mode 100644
index 0000000000..83f0b21e2e
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/java/commonj/sdo/impl/NoHelperProviderException.java
@@ -0,0 +1,58 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package commonj.sdo.impl;
+
+/**
+ * Exception indicating that a HelperProvider could not be located or instantiated.
+ * The message will be set to the name of the implementation class; a null value
+ * indicates that the name of the implementation could not be determined.
+ * The cause will be set to the Throwable that prevented the provider from being
+ * located or created.
+ *
+ * @version $Revision$ $Date$
+ */
+public class NoHelperProviderException extends RuntimeException {
+ private static final long serialVersionUID = 727646133930924084L;
+
+ public NoHelperProviderException() {
+ }
+
+ public NoHelperProviderException(String message) {
+ super(message);
+ }
+
+ public NoHelperProviderException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public NoHelperProviderException(Throwable cause) {
+ super(cause);
+ }
+
+ /**
+ * Return the name of the implementation class that could not be provided.
+ *
+ * @return the name of the implementation class; may be null if not known
+ */
+ public String getImplementationName() {
+ return getMessage();
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/resources/xml/datagraph.xsd b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/resources/xml/datagraph.xsd
new file mode 100644
index 0000000000..e6b9697a8d
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/resources/xml/datagraph.xsd
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+/**
+ * <copyright>
+ *
+ * Service Data Objects
+ * Version 2.1.0
+ * Licensed Materials
+ *
+ * (c) Copyright BEA Systems, Inc., International Business Machines Corporation,
+ * Oracle Corporation, Primeton Technologies Ltd., Rogue Wave Software, SAP AG.,
+ * Software AG., Sun Microsystems, Sybase Inc., Xcalia, Zend Technologies,
+ * 2005, 2006. All rights reserved.
+ *
+ * </copyright>
+ *
+ */
+-->
+
+<xsd:schema
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:sdo="commonj.sdo"
+ xmlns:sdoJava="commonj.sdo/java"
+ targetNamespace="commonj.sdo">
+
+ <xsd:element name="datagraph" type="sdo:DataGraphType"/>
+
+ <xsd:complexType name="DataGraphType">
+ <xsd:complexContent>
+ <xsd:extension base="sdo:BaseDataGraphType">
+ <xsd:sequence>
+ <xsd:any minOccurs="0" maxOccurs="1" namespace="##other" processContents="lax"/>
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+
+ <xsd:complexType name="BaseDataGraphType" abstract="true">
+ <xsd:sequence>
+ <xsd:element name="models" type="sdo:ModelsType" minOccurs="0"/>
+ <xsd:element name="xsd" type="sdo:XSDType" minOccurs="0"/>
+ <xsd:element name="changeSummary" type="sdo:ChangeSummaryType" minOccurs="0"/>
+ </xsd:sequence>
+ <xsd:anyAttribute namespace="##other" processContents="lax"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="ModelsType">
+ <xsd:annotation>
+ <xsd:documentation>
+ Expected type is emof:Package.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:any minOccurs="0" maxOccurs="unbounded" namespace="##other" processContents="lax"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="XSDType">
+ <xsd:annotation>
+ <xsd:documentation>
+ Expected type is xsd:schema.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:any minOccurs="0" maxOccurs="unbounded" namespace="http://www.w3.org/2001/XMLSchema" processContents="lax"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+<!-- FB TEMP -->
+ <xsd:simpleType name="ChangeSummaryType" sdoJava:instanceClass="commonj.sdo.ChangeSummary">
+ <xsd:restriction base="xsd:string"/>
+ </xsd:simpleType>
+<!--
+ <xsd:complexType name="ChangeSummaryType">
+ <xsd:sequence>
+ <xsd:any minOccurs="0" maxOccurs="unbounded" namespace="##any" processContents="lax"/>
+ </xsd:sequence>
+ <xsd:attribute name="create" type="xsd:string"/>
+ <xsd:attribute name="delete" type="xsd:string"/>
+ <xsd:attribute name="logging" type="xsd:boolean"/>
+ </xsd:complexType>
+-->
+
+ <xsd:attribute name="ref" type="xsd:string"/>
+ <xsd:attribute name="unset" type="xsd:string"/>
+
+</xsd:schema>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/resources/xml/sdoJava.xml b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/resources/xml/sdoJava.xml
new file mode 100644
index 0000000000..01d3d9e1ac
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/resources/xml/sdoJava.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+/**
+ * <copyright>
+ *
+ * Service Data Objects
+ * Version 2.1.0
+ * Licensed Materials
+ *
+ * (c) Copyright BEA Systems, Inc., International Business Machines Corporation,
+ * Oracle Corporation, Primeton Technologies Ltd., Rogue Wave Software, SAP AG.,
+ * Software AG., Sun Microsystems, Sybase Inc., Xcalia, Zend Technologies,
+ * 2005, 2006. All rights reserved.
+ *
+ * </copyright>
+ *
+ */
+-->
+
+<types xmlns="commonj.sdo"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:sdoJava="commonj.sdo/java"
+ xsi:schemaLocation="commonj.sdo sdoModel.xsd commonj.sdo/java sdoJava.xsd commonj.sdo/xml sdoXML.xsd">
+
+<!--
+ Global properties used in open content for
+ the Java binding of SDO Types and Properties.
+-->
+
+ <type uri="commonj.sdo/java">
+ <property name="javaClass" type="commonj.sdo#String"/>
+ </type>
+
+ <!-- JavaInfo deprecated in 2.1.0 -->
+ <type name="JavaInfo" uri="commonj.sdo/java">
+ <property name="javaClass" type="commonj.sdo#String"/>
+ </type>
+
+<!--
+ The Java object data types.
+-->
+
+ <type name="BooleanObject" dataType="true" sdoJava:instanceClass="java.lang.Boolean" uri="commonj.sdo/java"/>
+ <type name="ByteObject" dataType="true" sdoJava:instanceClass="java.lang.Byte" uri="commonj.sdo/java"/>
+ <type name="CharacterObject" dataType="true" sdoJava:instanceClass="java.lang.Character" uri="commonj.sdo/java"/>
+ <type name="DoubleObject" dataType="true" sdoJava:instanceClass="java.lang.Double" uri="commonj.sdo/java"/>
+ <type name="FloatObject" dataType="true" sdoJava:instanceClass="java.lang.Float" uri="commonj.sdo/java"/>
+ <type name="IntObject" dataType="true" sdoJava:instanceClass="java.lang.Int" uri="commonj.sdo/java"/>
+ <type name="LongObject" dataType="true" sdoJava:instanceClass="java.lang.Long" uri="commonj.sdo/java"/>
+ <type name="ShortObject" dataType="true" sdoJava:instanceClass="java.lang.Short" uri="commonj.sdo/java"/>
+
+</types>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/resources/xml/sdoJava.xsd b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/resources/xml/sdoJava.xsd
new file mode 100644
index 0000000000..7387568942
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/resources/xml/sdoJava.xsd
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+/**
+ * <copyright>
+ *
+ * Service Data Objects
+ * Version 2.1.0
+ * Licensed Materials
+ *
+ * (c) Copyright BEA Systems, Inc., International Business Machines Corporation,
+ * Oracle Corporation, Primeton Technologies Ltd., Rogue Wave Software, SAP AG.,
+ * Software AG., Sun Microsystems, Sybase Inc., Xcalia, Zend Technologies,
+ * 2005, 2006. All rights reserved.
+ *
+ * </copyright>
+ *
+ */
+-->
+
+<xsd:schema
+ targetNamespace="commonj.sdo/java"
+ xmlns:sdoJava="commonj.sdo/java"
+ xmlns:sdo="commonj.sdo"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+<xsd:import namespace="commonj.sdo" schemaLocation="sdoModel.xsd"/>
+
+<!--
+ These attributes are used to customize the Java mapping of
+ XSD to SDO Types and Properties.
+-->
+
+<xsd:attribute name="package" type="xsd:string" />
+<xsd:attribute name="instanceClass" type="xsd:string" />
+<xsd:attribute name="extendedInstanceClass" type="xsd:string" />
+<xsd:attribute name="nestedInterfaces" type="xsd:boolean" />
+
+<!--
+ Global properties used in open content for
+ the Java binding of SDO Types and Properties.
+-->
+
+<xsd:attribute name="javaClass" type="sdo:String"/>
+
+<!-- JavaInfo deprecated in 2.1.0 -->
+<xsd:complexType name="JavaInfo">
+ <xsd:attribute name="javaClass" type="sdo:String"/>
+</xsd:complexType>
+
+<!--
+ The Java object data types.
+-->
+
+<xsd:simpleType name="BooleanObject" sdoJava:instanceClass="java.lang.Boolean">
+ <xsd:restriction base="xsd:boolean"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="ByteObject" sdoJava:instanceClass="java.lang.Byte">
+ <xsd:restriction base="xsd:byte"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="CharacterObject" sdoJava:instanceClass="java.lang.Character">
+ <xsd:restriction base="xsd:string"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="DoubleObject" sdoJava:instanceClass="java.lang.Double">
+ <xsd:restriction base="xsd:double"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="FloatObject" sdoJava:instanceClass="java.lang.Float">
+ <xsd:restriction base="xsd:float"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="IntObject" sdoJava:instanceClass="java.lang.Integer">
+ <xsd:restriction base="xsd:int"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="LongObject" sdoJava:instanceClass="java.lang.Long">
+ <xsd:restriction base="xsd:long"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="ShortObject" sdoJava:instanceClass="java.lang.Short">
+ <xsd:restriction base="xsd:short"/>
+</xsd:simpleType>
+
+</xsd:schema>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/resources/xml/sdoModel.xml b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/resources/xml/sdoModel.xml
new file mode 100644
index 0000000000..7fdf82d1be
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/resources/xml/sdoModel.xml
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+/**
+ * <copyright>
+ *
+ * Service Data Objects
+ * Version 2.1.0
+ * Licensed Materials
+ *
+ * (c) Copyright BEA Systems, Inc., International Business Machines Corporation,
+ * Oracle Corporation, Primeton Technologies Ltd., Rogue Wave Software, SAP AG.,
+ * Software AG., Sun Microsystems, Sybase Inc., Xcalia, Zend Technologies,
+ * 2005, 2006. All rights reserved.
+ *
+ * </copyright>
+ *
+ */
+-->
+
+<types xmlns="commonj.sdo"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:sdoJava="commonj.sdo/java"
+ xsi:schemaLocation="commonj.sdo sdoModel.xsd commonj.sdo/java sdoJava.xsd commonj.sdo/xml sdoXML.xsd">
+
+<!-- Model Types
+ SDO Type and Property are defined in terms of themselves.
+-->
+
+ <type name="Type" open="true" uri="commonj.sdo">
+ <property name="baseType" type="#Type" many="true"/>
+ <property name="property" type="#Property" containment="true" many="true"/>
+ <property name="aliasName" type="#String" many="true"/>
+ <property name="name" type="#String"/>
+ <property name="uri" type="#String"/>
+ <property name="dataType" type="#Boolean"/>
+ <property name="open" type="#Boolean"/>
+ <property name="sequenced" type="#Boolean"/>
+ <property name="abstract" type="#Boolean"/>
+ </type>
+
+ <type name="Property" open="true" uri="commonj.sdo">
+ <property name="aliasName" type="#String" many="true"/>
+ <property name="name" type="#String"/>
+ <property name="many" type="#Boolean"/>
+ <property name="containment" type="#Boolean"/>
+ <property name="type" type="#Type" />
+ <property name="default" type="#String"/>
+ <property name="readOnly" type="#Boolean"/>
+ <property name="opposite" type="#Property"/>
+ <property name="nullable" type="#Boolean"/>
+ </type>
+
+<!-- SDO special types -->
+
+ <type name="DataObject" abstract="true" sdoJava:instanceClass="commonj.sdo.DataObject" uri="commonj.sdo"/>
+ <type name="Object" abstract="true" datatype="true" sdoJava:instanceClass="java.lang.Object" uri="commonj.sdo"/>
+ <type name="ChangeSummaryType" abstract="true" datatype="true" sdoJava:instanceClass="commonj.sdo.ChangeSummary" uri="commonj.sdo"/>
+
+ <!-- TextType deprecated in 2.1.0 -->
+ <type name="TextType" abstract="true">
+ <property name="text" type="#String" many="true"/>
+ </type>
+
+<!-- SDO data types -->
+
+ <type name="Boolean" datatype="true" sdoJava:instanceClass="boolean" uri="commonj.sdo"/>
+ <type name="Byte" datatype="true" sdoJava:instanceClass="byte" uri="commonj.sdo"/>
+ <type name="Bytes" datatype="true" sdoJava:instanceClass="byte[]" uri="commonj.sdo"/>
+ <type name="Character" datatype="true" sdoJava:instanceClass="char" uri="commonj.sdo"/>
+ <type name="Date" datatype="true" sdoJava:instanceClass="java.util.Date" uri="commonj.sdo"/>
+ <type name="DateTime" datatype="true" sdoJava:instanceClass="java.lang.String" uri="commonj.sdo"/>
+ <type name="Day" datatype="true" sdoJava:instanceClass="java.lang.String" uri="commonj.sdo"/>
+ <type name="Decimal" datatype="true" sdoJava:instanceClass="java.math.BigDecimal" uri="commonj.sdo"/>
+ <type name="Duration" datatype="true" sdoJava:instanceClass="java.lang.String" uri="commonj.sdo"/>
+ <type name="Double" datatype="true" sdoJava:instanceClass="double" uri="commonj.sdo"/>
+ <type name="Float" datatype="true" sdoJava:instanceClass="float" uri="commonj.sdo"/>
+ <type name="Int" datatype="true" sdoJava:instanceClass="int" uri="commonj.sdo"/>
+ <type name="Integer" datatype="true" sdoJava:instanceClass="java.math.BigInteger" uri="commonj.sdo"/>
+ <type name="Long" datatype="true" sdoJava:instanceClass="long" uri="commonj.sdo"/>
+ <type name="MonthDay" datatype="true" sdoJava:instanceClass="java.lang.String" uri="commonj.sdo"/>
+ <type name="Month" datatype="true" sdoJava:instanceClass="java.lang.String" uri="commonj.sdo"/>
+ <type name="Short" datatype="true" sdoJava:instanceClass="short" uri="commonj.sdo"/>
+ <type name="String" datatype="true" sdoJava:instanceClass="java.lang.String" uri="commonj.sdo"/>
+ <type name="Strings" datatype="true" sdoJava:instanceClass="java.util.List" uri="commonj.sdo"/>
+ <type name="Time" datatype="true" sdoJava:instanceClass="java.lang.String" uri="commonj.sdo"/>
+ <type name="Year" datatype="true" sdoJava:instanceClass="java.lang.String" uri="commonj.sdo"/>
+ <type name="YearMonth" datatype="true" sdoJava:instanceClass="java.lang.String" uri="commonj.sdo"/>
+ <type name="YearMonthDay" datatype="true" sdoJava:instanceClass="java.lang.String" uri="commonj.sdo"/>
+ <type name="URI" datatype="true" sdoJava:instanceClass="java.lang.String" uri="commonj.sdo"/>
+
+</types>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/resources/xml/sdoModel.xsd b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/resources/xml/sdoModel.xsd
new file mode 100644
index 0000000000..c5aabc9cc8
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/resources/xml/sdoModel.xsd
@@ -0,0 +1,221 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+/**
+ * <copyright>
+ *
+ * Service Data Objects
+ * Version 2.1.0
+ * Licensed Materials
+ *
+ * (c) Copyright BEA Systems, Inc., International Business Machines Corporation,
+ * Oracle Corporation, Primeton Technologies Ltd., Rogue Wave Software, SAP AG.,
+ * Software AG., Sun Microsystems, Sybase Inc., Xcalia, Zend Technologies,
+ * 2005, 2006. All rights reserved.
+ *
+ * </copyright>
+ *
+ */
+
+-->
+
+<xsd:schema
+ targetNamespace="commonj.sdo"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:sdo="commonj.sdo"
+ xmlns:sdoXML="commonj.sdo/xml"
+ xmlns:sdoJava="commonj.sdo/java"
+ elementFormDefault="qualified"
+ xsi:schemaLocation="commonj.sdo/xml sdoXML.xsd
+ commonj.sdo/java sdoJava.xsd">
+
+<xsd:include schemaLocation="datagraph.xsd"/>
+
+<!-- Root element for defining several Types in one document.
+ Is not part of the model.
+-->
+<xsd:element name="types" type="sdo:Types"/>
+<xsd:complexType name="Types">
+ <xsd:sequence>
+ <xsd:element name="type" type="sdo:Type" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
+</xsd:complexType>
+
+<!-- Any data object may be serialized with this element,
+ with xsi:type to declare the
+ actual type of the DataObject serialized.
+-->
+<xsd:element name="dataObject" type="xsd:anyType"/>
+
+<!-- Model Types
+ SDO Type and Property are defined in terms of themselves.
+-->
+<xsd:element name="type" type="sdo:Type"/>
+<xsd:complexType name="Type">
+ <xsd:sequence>
+ <xsd:element name="baseType" type="sdo:URI"
+ minOccurs="0" maxOccurs="unbounded"
+ sdoXML:propertyType="sdo:Type" />
+ <xsd:element name="property" type="sdo:Property"
+ minOccurs="0" maxOccurs="unbounded" />
+ <xsd:element name="aliasName" type="sdo:String"
+ minOccurs="0" maxOccurs="unbounded" />
+ <xsd:any namespace="##other" processContents="lax"
+ minOccurs="0" maxOccurs="unbounded" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:ID" sdoXML:dataType="sdo:String"/>
+ <xsd:attribute name="uri" type="sdo:URI"/>
+ <xsd:attribute name="dataType" type="sdo:Boolean"/>
+ <xsd:attribute name="open" type="sdo:Boolean"/>
+ <xsd:attribute name="sequenced" type="sdo:Boolean"/>
+ <xsd:attribute name="abstract" type="sdo:Boolean"/>
+ <xsd:anyAttribute namespace="##any" processContents="lax"/>
+</xsd:complexType>
+
+<xsd:complexType name="Property">
+ <xsd:sequence>
+ <xsd:element name="aliasName" type="sdo:String"
+ minOccurs="0" maxOccurs="unbounded" />
+ <xsd:any namespace="##other" processContents="lax"
+ minOccurs="0" maxOccurs="unbounded" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="sdo:String"/>
+ <xsd:attribute name="many" type="sdo:Boolean"/>
+ <xsd:attribute name="containment" type="sdo:Boolean"/>
+ <xsd:attribute name="default" type="sdo:String"/>
+ <xsd:attribute name="readOnly" type="sdo:Boolean"/>
+ <xsd:attribute name="type" type="sdo:URI" sdoXML:propertyType="sdo:Type"/>
+ <xsd:attribute name="opposite" type="sdo:URI" sdoXML:propertyType="sdo:Property"/>
+ <xsd:attribute name="nullable" type="sdo:Boolean"/>
+ <xsd:anyAttribute namespace="##any" processContents="lax"/>
+</xsd:complexType>
+
+<!-- Special Types -->
+<xsd:complexType name="DataObject" abstract="true"/>
+
+<!-- TextType deprecated in 2.1.0 -->
+ <xsd:complexType name="TextType" abstract="true">
+ <xsd:sequence>
+ <xsd:element name="text" minOccurs="0" maxOccurs="unbounded" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+<!-- ChangeSummaryType is defined in datagraph.xsd.
+ Although declared there as a ComplexType,
+ at the model level it is treated as a SimpleType
+ with a special XML serialization.
+-->
+
+<!-- Data Types -->
+<xsd:simpleType name="Boolean" sdoJava:instanceClass="boolean">
+ <xsd:restriction base="xsd:boolean"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="Byte" sdoJava:instanceClass="byte">
+ <xsd:restriction base="xsd:byte"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="Bytes" sdoJava:instanceClass="byte[]">
+ <xsd:restriction base="xsd:hexBinary"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="Character" sdoJava:instanceClass="char">
+ <xsd:restriction base="xsd:string"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="Date" sdoJava:instanceClass="java.util.Date">
+ <xsd:restriction base="xsd:dateTime"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="DateTime" sdoJava:instanceClass="java.lang.String">
+ <xsd:restriction base="xsd:dateTime"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="Day" sdoJava:instanceClass="java.lang.String">
+ <xsd:restriction base="xsd:gDay"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="Decimal" sdoJava:instanceClass="java.math.BigDecimal">
+ <xsd:restriction base="xsd:decimal"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="Double" sdoJava:instanceClass="double">
+ <xsd:restriction base="xsd:double"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="Duration" sdoJava:instanceClass="java.lang.String">
+ <xsd:restriction base="xsd:duration"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="Float" sdoJava:instanceClass="float">
+ <xsd:restriction base="xsd:float"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="Int" sdoJava:instanceClass="int">
+ <xsd:restriction base="xsd:int"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="Integer" sdoJava:instanceClass="java.math.BigInteger">
+ <xsd:restriction base="xsd:integer"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="Long" sdoJava:instanceClass="long">
+ <xsd:restriction base="xsd:long"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="Month" sdoJava:instanceClass="java.lang.String">
+ <xsd:restriction base="xsd:gMonth"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="MonthDay" sdoJava:instanceClass="java.lang.String">
+ <xsd:restriction base="xsd:gMonthDay"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="Object" sdoJava:instanceClass="java.lang.Object">
+ <!-- Only the schema for schemas is allowed to restrict anySimpleType.
+ <xsd:restriction base="xsd:anySimpleType"/>
+ The equivalent declaration is a union of the predefined XSD data types.
+ -->
+ <xsd:union memberTypes="xsd:anyURI xsd:base64Binary xsd:boolean xsd:byte
+ xsd:date xsd:dateTime xsd:decimal xsd:double xsd:duration xsd:ENTITIES xsd:ENTITY xsd:float
+ xsd:gDay xsd:gMonth xsd:gMonthDay xsd:gYear xsd:gYearMonth xsd:hexBinary xsd:ID xsd:IDREF xsd:IDREFS
+ xsd:int xsd:integer xsd:language xsd:long xsd:Name xsd:NCName xsd:negativeInteger
+ xsd:NMTOKEN xsd:NMTOKENS xsd:nonNegativeInteger xsd:nonPositiveInteger
+ xsd:normalizedString xsd:NOTATION xsd:positiveInteger xsd:QName xsd:short xsd:string
+ xsd:time xsd:token xsd:unsignedByte xsd:unsignedInt xsd:unsignedLong xsd:unsignedShort"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="Short" sdoJava:instanceClass="short">
+ <xsd:restriction base="xsd:short"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="String" sdoJava:instanceClass="java.lang.String">
+ <xsd:restriction base="xsd:string"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="Strings" sdoJava:instanceClass="java.util.List">
+ <xsd:restriction base="xsd:string"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="Time" sdoJava:instanceClass="java.lang.String">
+ <xsd:restriction base="xsd:time"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="Year" sdoJava:instanceClass="java.lang.String">
+ <xsd:restriction base="xsd:gYear"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="YearMonth" sdoJava:instanceClass="java.lang.String">
+ <xsd:restriction base="xsd:gYearMonth"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="YearMonthDay" sdoJava:instanceClass="java.lang.String">
+ <xsd:restriction base="xsd:date"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="URI" sdoJava:instanceClass="java.lang.String">
+ <xsd:restriction base="xsd:anyURI"/>
+</xsd:simpleType>
+
+</xsd:schema>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/resources/xml/sdoModelExtended.xsd b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/resources/xml/sdoModelExtended.xsd
new file mode 100644
index 0000000000..f67f5451b3
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/resources/xml/sdoModelExtended.xsd
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ -->
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sdo="commonj.sdo" xmlns:sdoJava="commonj.sdo/java" xmlns:sdoXML="commonj.sdo/xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" elementFormDefault="qualified" targetNamespace="commonj.sdo" xsi:schemaLocation="commonj.sdo/xml sdoXML.xsd commonj.sdo/java sdoJava.xsd">
+
+<xsd:include schemaLocation="sdoModel.xsd"/>
+
+<!-- Data Types -->
+<xsd:simpleType name="Base64Bytes" sdoJava:instanceClass="byte[]">
+ <xsd:restriction base="xsd:base64Binary"/>
+</xsd:simpleType>
+
+</xsd:schema>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/resources/xml/sdoXML.xml b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/resources/xml/sdoXML.xml
new file mode 100644
index 0000000000..f0fbeac49b
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/resources/xml/sdoXML.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+/**
+ * <copyright>
+ *
+ * Service Data Objects
+ * Version 2.1.0
+ * Licensed Materials
+ *
+ * (c) Copyright BEA Systems, Inc., International Business Machines Corporation,
+ * Oracle Corporation, Primeton Technologies Ltd., Rogue Wave Software, SAP AG.,
+ * Software AG., Sun Microsystems, Sybase Inc., Xcalia, Zend Technologies,
+ * 2005, 2006. All rights reserved.
+ *
+ * </copyright>
+ *
+ */
+-->
+
+<types xmlns="commonj.sdo"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:sdoXML="commonj.sdo/xml"
+ xsi:schemaLocation="commonj.sdo sdoModel.xsd commonj.sdo/java sdoJava.xsd commonj.sdo/xml sdoXML.xsd">
+
+<!--
+ Global properties used in open content for
+ the XML binding of SDO Types and Properties.
+-->
+
+ <type uri="commonj.sdo/xml">
+ <property name="xmlElement" type="commonj.sdo#Boolean"/>
+ </type>
+
+ <!-- XMLInfo deprecated in 2.1.0 -->
+ <type name="XMLInfo" uri="commonj.sdo/xml">
+ <property name="xmlElement" type="commonj.sdo#Boolean"/>
+ </type>
+
+</types>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/resources/xml/sdoXML.xsd b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/resources/xml/sdoXML.xsd
new file mode 100644
index 0000000000..39dd3840ec
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/main/resources/xml/sdoXML.xsd
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+/**
+ * <copyright>
+ *
+ * Service Data Objects
+ * Version 2.1.0
+ * Licensed Materials
+ *
+ * (c) Copyright BEA Systems, Inc., International Business Machines Corporation,
+ * Oracle Corporation, Primeton Technologies Ltd., Rogue Wave Software, SAP AG.,
+ * Software AG., Sun Microsystems, Sybase Inc., Xcalia, Zend Technologies,
+ * 2005, 2006. All rights reserved.
+ *
+ * </copyright>
+ *
+ */
+-->
+
+<xsd:schema
+ targetNamespace="commonj.sdo/xml"
+ xmlns:sdo="commonj.sdo"
+ xmlns:sdoXML="commonj.sdo/xml"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+<xsd:import namespace="commonj.sdo" schemaLocation="sdoModel.xsd"/>
+
+
+<!--
+ These attributes are used to customize the XSD mapping of SDO Types and Properties.
+-->
+
+<xsd:attribute name="name" type="xsd:string" />
+<xsd:attribute name="propertyType" type="xsd:QName" />
+<xsd:attribute name="oppositeProperty" type="xsd:string" />
+<xsd:attribute name="sequence" type="xsd:boolean" />
+<xsd:attribute name="string" type="xsd:boolean" />
+<xsd:attribute name="dataType" type="xsd:QName" />
+<xsd:attribute name="aliasName" type="xsd:string" />
+<xsd:attribute name="readOnly" type="xsd:boolean" />
+<xsd:attribute name="many" type="xsd:boolean" />
+
+<!--
+ Global properties used in open content for
+ the XML binding of SDO Types and Properties.
+-->
+
+<xsd:attribute name="xmlElement" type="sdo:Boolean"/>
+
+<!-- XMLInfo deprecated in 2.1.0 -->
+<xsd:complexType name="XMLInfo">
+ <xsd:attribute name="xmlElement" type="sdo:Boolean"/>
+</xsd:complexType>
+
+</xsd:schema>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo-api/src/test/java/commonj/sdo/impl/HelperProviderTestCase.java b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/test/java/commonj/sdo/impl/HelperProviderTestCase.java
new file mode 100644
index 0000000000..8854e936b7
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/test/java/commonj/sdo/impl/HelperProviderTestCase.java
@@ -0,0 +1,90 @@
+/**
+ *
+ * Copyright 2005 International Business Machines Corporation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package commonj.sdo.impl;
+
+import java.net.URL;
+import java.net.URLClassLoader;
+
+import junit.framework.TestCase;
+import test.DefaultHelperProvider;
+import test.TCCL1HelperProvider;
+
+/**
+ * @version $Revision$ $Date$
+ */
+public class HelperProviderTestCase extends TestCase {
+ private URL classes;
+ private URL testClasses;
+ private URL def;
+ private URL tccl1;
+
+ public void testInstanceIsNullWithNoImplementation() throws Exception {
+ assertNull(HelperProvider.INSTANCE);
+ }
+
+ public void testDefaultInstance() throws Exception {
+ ClassLoader cl = new URLClassLoader(new URL[]{classes, def, testClasses}, null);
+ Class providerClass = cl.loadClass(HelperProvider.class.getName());
+ Class implClass = cl.loadClass(DefaultHelperProvider.class.getName());
+ Object instance = providerClass.getField("INSTANCE").get(null);
+ assertNotNull(instance);
+ assertEquals(implClass, instance.getClass());
+ }
+
+ public void testLocateFromClassLoader() throws Exception {
+ ClassLoader cl = new URLClassLoader(new URL[]{classes, tccl1, testClasses}, null);
+ Class providerClass = cl.loadClass(HelperProvider.class.getName());
+ Object provider = providerClass.getMethod("getInstance", new Class[] {ClassLoader.class})
+ .invoke(null, new Object[] {cl});
+ assertNotNull(provider);
+ assertEquals(TCCL1HelperProvider.class.getName(), provider.getClass().getName());
+ }
+
+ public void testThreadContextInstance() throws Exception {
+ ClassLoader cl = new URLClassLoader(new URL[]{classes, tccl1, testClasses}, null);
+ ClassLoader tccl = Thread.currentThread().getContextClassLoader();
+ try {
+ Thread.currentThread().setContextClassLoader(cl);
+ Class providerClass = cl.loadClass(HelperProvider.class.getName());
+ Object provider = providerClass.getMethod("getInstance", new Class[0]).invoke(null, new Object[0]);
+ assertNotNull(provider);
+ assertEquals(TCCL1HelperProvider.class.getName(), provider.getClass().getName());
+ } finally {
+ Thread.currentThread().setContextClassLoader(tccl);
+ }
+
+ }
+
+ public void testSystemProperty() {
+ System.setProperty("commonj.sdo.impl.HelperProvider", "test.TCCL1HelperProvider");
+ try {
+ HelperProvider provider = HelperProvider.getInstance();
+ assertNotNull(provider);
+ assertEquals(TCCL1HelperProvider.class, provider.getClass());
+ } finally {
+ System.getProperties().remove("commonj.sdo.impl.HelperProvider");
+ }
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ classes = new URL(HelperProvider.class.getResource("HelperProvider.class"), "../../..");
+ testClasses = new URL(HelperProviderTestCase.class.getResource("HelperProviderTestCase.class"), "../../..");
+ tccl1 = new URL(testClasses, "tccl1/");
+ def = new URL(testClasses, "default/");
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo-api/src/test/java/test/DefaultHelperProvider.java b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/test/java/test/DefaultHelperProvider.java
new file mode 100644
index 0000000000..77d6206972
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/test/java/test/DefaultHelperProvider.java
@@ -0,0 +1,71 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package test;
+
+import commonj.sdo.impl.HelperProvider;
+import commonj.sdo.impl.ExternalizableDelegator;
+import commonj.sdo.helper.CopyHelper;
+import commonj.sdo.helper.DataFactory;
+import commonj.sdo.helper.DataHelper;
+import commonj.sdo.helper.EqualityHelper;
+import commonj.sdo.helper.TypeHelper;
+import commonj.sdo.helper.XMLHelper;
+import commonj.sdo.helper.XSDHelper;
+
+/**
+ * @version $Revision$ $Date$
+ */
+public class DefaultHelperProvider extends HelperProvider {
+ public CopyHelper copyHelper() {
+ throw new UnsupportedOperationException();
+ }
+
+ public DataFactory dataFactory() {
+ throw new UnsupportedOperationException();
+ }
+
+ public DataHelper dataHelper() {
+ throw new UnsupportedOperationException();
+ }
+
+ public EqualityHelper equalityHelper() {
+ throw new UnsupportedOperationException();
+ }
+
+ public TypeHelper typeHelper() {
+ throw new UnsupportedOperationException();
+ }
+
+ public XMLHelper xmlHelper() {
+ throw new UnsupportedOperationException();
+ }
+
+ public XSDHelper xsdHelper() {
+ throw new UnsupportedOperationException();
+ }
+
+ public ExternalizableDelegator.Resolvable resolvable() {
+ throw new UnsupportedOperationException();
+ }
+
+ public ExternalizableDelegator.Resolvable resolvable(Object target) {
+ throw new UnsupportedOperationException();
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo-api/src/test/java/test/TCCL1HelperProvider.java b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/test/java/test/TCCL1HelperProvider.java
new file mode 100644
index 0000000000..05b1b04925
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/test/java/test/TCCL1HelperProvider.java
@@ -0,0 +1,71 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package test;
+
+import commonj.sdo.impl.HelperProvider;
+import commonj.sdo.impl.ExternalizableDelegator;
+import commonj.sdo.helper.CopyHelper;
+import commonj.sdo.helper.DataFactory;
+import commonj.sdo.helper.DataHelper;
+import commonj.sdo.helper.EqualityHelper;
+import commonj.sdo.helper.TypeHelper;
+import commonj.sdo.helper.XMLHelper;
+import commonj.sdo.helper.XSDHelper;
+
+/**
+ * @version $Revision$ $Date$
+ */
+public class TCCL1HelperProvider extends HelperProvider {
+ public CopyHelper copyHelper() {
+ throw new UnsupportedOperationException();
+ }
+
+ public DataFactory dataFactory() {
+ throw new UnsupportedOperationException();
+ }
+
+ public DataHelper dataHelper() {
+ throw new UnsupportedOperationException();
+ }
+
+ public EqualityHelper equalityHelper() {
+ throw new UnsupportedOperationException();
+ }
+
+ public TypeHelper typeHelper() {
+ throw new UnsupportedOperationException();
+ }
+
+ public XMLHelper xmlHelper() {
+ throw new UnsupportedOperationException();
+ }
+
+ public XSDHelper xsdHelper() {
+ throw new UnsupportedOperationException();
+ }
+
+ public ExternalizableDelegator.Resolvable resolvable() {
+ throw new UnsupportedOperationException();
+ }
+
+ public ExternalizableDelegator.Resolvable resolvable(Object target) {
+ throw new UnsupportedOperationException();
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo-api/src/test/resources/default/META-INF/services/commonj.sdo.impl.HelperProvider b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/test/resources/default/META-INF/services/commonj.sdo.impl.HelperProvider
new file mode 100644
index 0000000000..5175e5abea
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/test/resources/default/META-INF/services/commonj.sdo.impl.HelperProvider
@@ -0,0 +1,3 @@
+# test comment and blank line
+
+ test.DefaultHelperProvider # comment
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo-api/src/test/resources/tccl1/META-INF/services/commonj.sdo.impl.HelperProvider b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/test/resources/tccl1/META-INF/services/commonj.sdo.impl.HelperProvider
new file mode 100644
index 0000000000..fa88e4c705
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo-api/src/test/resources/tccl1/META-INF/services/commonj.sdo.impl.HelperProvider
@@ -0,0 +1 @@
+test.TCCL1HelperProvider
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/BUILDING.txt b/sdo-java/tags/1.0-incubator-M3/sdo/BUILDING.txt
new file mode 100644
index 0000000000..992710f730
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/BUILDING.txt
@@ -0,0 +1,52 @@
+Building SDO Releases
+=====================
+The SDO specification source distribution and the SDO implementation source distribution
+together with a computer with a live internet connection, maven 2.0.4 installed and java 1.4.2
+or above installed are all you need to build
+1) the SDO binary distribution
+2) the SDO samples source distribution
+
+Building the SDO Java Implementation Project Binary Release from the source distribution
+========================================================================================
+(note, these instructions are for building the SDO binary release from
+source, not for establishing a development environment. If you wish to
+participate in sdo development, follow the instructions at
+http://cwiki.apache.org/confluence/display/TUSCANY/Developing+SDO+Java
+
+Building
+--------
+In these instructions <archive-root> refers to the common root folder contained in all distribution archives for a particular release, for example "tuscany-sdo-1.0-incubating-M3"
+
+1) Download the corresponding SDO specification source distribution from http://cwiki.apache.org/TUSCANY/sdo-java-download.html
+2) Execute the instructions in that archive for building the SDO specification component
+Note: following this step you will have maven installed, and a Java JDK at level 1.4.2 or above installed.
+3) If you have chosen to install a JDK at level 5 then all will be fine, but there is one value add component in the
+ Tuscany SDO implementation which relies on new JDK 5.0 features. If you do not wish to use JDK 5 for the following
+ build step, then you will need to delete the file
+ <archive-root>/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/Interface2JavaGenerator.java before proceding
+4) Change to the top level directory of the Tuscany SDO Java Implementation project (<archive-root>/sdo) of this source distribution.
+6) Execute: mvn
+ This will install the sdo implementation and tools jars in your local maven repository
+5) Execute: mvn package javadoc:javadoc assembly:assembly
+ This will build the Tuscany SDO for Java binary distribution artefacts in the sdo/distribution/target
+ directory.
+
+Note: Depending on the load being experienced by remote Maven 2.0 repositories you may have to execute mvn several
+ times until required dependencies are all located in your local maven repository. After you have completed a
+ full successful build you can use "mvn -o" which builds without trying to access updated build dependencies (offline mode) and is much faster.
+
+6) Currently, due to maven configuration issues, the distribution artefacts at this point contain 2 spurious items, junit-3.8.1.jar and asm-2.2.jar. In order for the distribution archives to be consistent with the contained license information, these jar files must be manually removed from the archives. This step will become unnecessary once the issues with maven have been overcome/fixed.
+
+7) To run the sample programs, change directory to the <archive-root>/sdo/sample directory, and run the command "mvn". Then look in the <archive-root>/sdo/sample/target/site/apidocs/index.html file for javadoc that describes how to run the samples.
+
+
+Building the SDO Samples Source distribution
+============================================
+
+To build the SDO Samples source distribution
+1) Build the SDO binary distribution as instructed above
+2) From the top level directory of your SDO implementation build tree change directory to the <archive-root>/sdo/sample directory and execute the command mvn javadoc:javadoc to create javadoc for the samples in the <archive-root>/sdo/sample/target/site/apidocs directory
+3) copy the <archive-root>/sdo/sample directory from the SDO implementation source distribution to a temporary location with the path <archive-root>/sample below the temporary directory location
+4) copy the site/apidocs folder created in step 2 to the temporary directory created for step 3, so that it exists at path <archive-root>/sample/javadoc
+5) create .zip and .tar.gz archives containing the sample source and javadoc using the naming convention
+apache-<archive-root>-sample.<archive-extension>, such that the archives each contain a single root folder <archive-root> \ No newline at end of file
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/LICENSE.txt b/sdo-java/tags/1.0-incubator-M3/sdo/LICENSE.txt
new file mode 100644
index 0000000000..ef33d7eeab
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/LICENSE.txt
@@ -0,0 +1,342 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+===============================================================================================================
+
+Apache Tuscany SDO for Java Subcomponents
+=========================================:
+
+The Tuscany SDO for Java release includes a number of subcomponents with
+separate copyright notices and license terms. Your use of the source
+code for the these subcomponents is subject to the terms and
+conditions of the following licenses.
+
+
+
+License for the Service Data Objects JavaDoc and Interface Definition files. (sdo-api-r2.0.1-1.0-incubator-M2.jar)
+
+Permission to copy, make derivative works of, and distribute the Service Data Objects
+JavaDoc and Interface Definition Files files in any medium without fee or royalty as part
+of a compliant implementation of the Service Data Objects Specification is hereby granted.
+The Service Data Objects Specification may be found at any of the following locations:
+
+http://dev2dev.bea.com/technologies/commonj/index.jsp
+http://www.ibm.com/developerworks/library/specification/ws-sdo/
+http://oracle.com/technology/webservices/sca
+https://www.sdn.sap.com/
+http://www.xcalia/xdn/specs/sdo
+
+THE SERVICE DATA OBJECTS SPECIFICATION AND THE JAVADOC AND INTERFACE DEFINITION FILES
+ARE PROVIDED "AS IS," AND THE AUTHORS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS
+SPECIFICATION OR THE JAVADOC AND INTERFACE DEFINITION FILES AND THE IMPLEMENTATION OF THEIR CONTENTS,
+INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
+NON-INFRINGEMENT OR TITLE. THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL,
+INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO ANY USE OR DISTRIBUTION OF THE
+SERVICE DATA OBJECTS SPECIFICATION OR THE JAVADOC OR INTERFACE DEFINTION FILES.
+
+The name and trademarks of the Authors may NOT be used in any manner, including advertising or
+publicity pertaining to the Service Component Architecture Specification or its contents without specific,
+written prior permission. Title to copyright in the Service Data Objects Specification and the
+JavaDoc and Interface Definition Files will at all times remain with the Authors.
+
+No other rights are granted by implication, estoppel or otherwise.
+
+=================================================================================================================
+
+For the Eclipse EMF components
+(codegen-2.2.2.jar
+codegen-ecore-2.2.2.jar
+common-2.2.2.jar
+ecore-2.2.2.jar
+ecore-change-2.2.2.jar
+ecore-xmi-2.2.2.jar
+xsd-2.2.2.jar)
+
+
+Eclipse Public License - v 1.0
+
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+
+1. DEFINITIONS
+
+"Contribution" means:
+
+a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
+b) in the case of each subsequent Contributor:
+
+i) changes to the Program, and
+
+ii) additions to the Program;
+
+where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
+
+"Contributor" means any person or entity that distributes the Program.
+
+"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
+
+"Program" means the Contributions distributed in accordance with this Agreement.
+
+"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
+
+2. GRANT OF RIGHTS
+
+a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
+
+b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
+
+c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
+
+d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
+
+3. REQUIREMENTS
+
+A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
+
+a) it complies with the terms and conditions of this Agreement; and
+
+b) its license agreement:
+
+i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
+
+ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
+
+iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
+
+iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
+
+When the Program is made available in source code form:
+
+a) it must be made available under this Agreement; and
+
+b) a copy of this Agreement must be included with each copy of the Program.
+
+Contributors may not remove or alter any copyright notices contained within the Program.
+
+Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
+
+4. COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
+
+For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
+
+5. NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
+
+6. DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+
+If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
+
+All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
+
+Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
+
+This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
+
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/NOTICE.txt b/sdo-java/tags/1.0-incubator-M3/sdo/NOTICE.txt
new file mode 100644
index 0000000000..c2cf1f95b4
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/NOTICE.txt
@@ -0,0 +1,32 @@
+Apache Tuscany SDO for Java
+Copyright 2006, 2007 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+Apache Tuscany is an effort undergoing incubation at The Apache Software Foundation (ASF),
+sponsored by the Apache Web Services PMC. Incubation is required of all newly accepted
+projects until a further review indicates that the infrastructure, communications,
+and decision making process have stabilized in a manner consistent with other successful
+ASF projects. While incubation status is not necessarily a reflection of the completeness
+or stability of the code, it does indicate that the project has yet to be fully endorsed
+by the ASF.
+
+Unless otherwise indicated, all distribution made available by the Apache Software Foundation
+is provided to you under the terms and conditions of the Apache License Version 2.0 ("AL").
+A copy of the AL is provided with this distribution as the LICENSE.txt file present in the
+root directory, and is also available at http://www.apache.org/licenses/.
+
+The terms and conditions governing the distribution may refer to the AL or other license
+agreements, notices or terms and conditions. Some of these other license agreements may
+include (but are not limited to):
+
+ . Eclipse Public License Version 1.0 (available at http://www.eclipse.org/legal/epl-v10.html)
+
+It is your obligation to read and accept all such terms and conditions prior to use of the
+distribution. If term or condition is provided, please contact the Apache Software Foundation
+to determine what terms and conditions govern that particular distribution.
+
+This product also includes software developed by the Open Service Oriented Architecture organisation
+(http://osoa.org). The license for this software may be found in the LICENSE.txt file contained in this
+distribution.
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/STATUS b/sdo-java/tags/1.0-incubator-M3/sdo/STATUS
new file mode 100644
index 0000000000..6388ec3286
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/STATUS
@@ -0,0 +1,86 @@
+Apache Tuscany Status
+
+Tuscany provides multiple language implementations of the Service Component Architecture (SCA) specifications and related technologies such as SDO.
+
+PROJECT STATUS
+==============
+
+ Tuscany is being incubated at the request of the Apache Web Services PMC.
+ For information on incubation please visit the project page at
+ http://incubator.apache.org/projects/tuscany.html
+
+
+Pending Issues
+==============
+none
+
+RESOLVED ISSUES SINCE LAST STATUS
+=================================
+2005-12-28 CCLA received for IBM's contribution of a C++ implementation
+2005-12-28 CCLA received for BEA and IBM joint contribution of a Java implementation
+
+OTHER NEWS
+==========
+
+2007-01-22 Vote to add Simon Laws as a new committer
+2006-12-24 Java SCA Milestone 2 release
+2006-11-20 Java DAS Milestone 2 release
+2006-11-14 Java SDO Milestone 2 release
+2006-11-10 Vote to add Luciano Resende as a new commiter
+2006-11-07 Vote to add Rajith Attapattu
+2006-11-03 C++ Milestone 2 release
+2006-10-19 Voted to release pom and buildtools for Java M2 release
+2006-09-29 Vote to add Ignacio Silva-Lepe as a new committer
+2006-09-18 Vote to add Venkata Krishnan as a new committer
+2006-08-10 Vote to add Andrew Borley as a new committer
+2006-08-07 Vote to add Meeraj Kunnumpurath as a new committer
+2006-08-07 Vote to add Kelvin Goodson as a new committer
+2006-08-06 Vote to add Brent Daniel as a new committer
+2006-08-04 Vote to add Raymond Feng as a new committer
+2006-08-01 C++ Milestone 1 release
+2006-06-07 Java Milestone 1 release
+2006-05-02 Vote to add Dan Kulp as a new committer
+2006-03-01 Vote to add Ant Elder as a new committer
+
+2006-01-05 Contribution of Java implementation by BEA and IBM committed
+2006-01-05 Contribution of C+ implementation by IBM committed
+
+RELEASE STATUS
+==============
+None
+
+REFERENCES
+==========
+Status file http://svn.apache.org/repos/asf/incubator/tuscany/STATUS
+User List tuscany-user@ws.apache.org
+Developer List tuscany-dev@ws.apache.org
+Commits List tuscany-commits@ws.apache.org
+Source Code http://svn.apache.org/repos/asf/incubator/tuscany/
+Issue Tracking http://issues.apache.org/jira/browse/TUSCANY
+
+Committers
+ ajborley Andrew Borley
+ antelder Ant Elder
+ bdaniel Brent Daniel
+ dkulp Dan Kulp
+ dims Davanum Srinivas
+ edslattery Ed Slattery
+ ekoneil Eddie O'Neil
+ frankb Frank Budinsky
+ geirm Geir Magnusson Jr
+ isilval Ignacio Silva-Lepe
+ jsdelfino Jean-Sebastien Delfino
+ jboynes Jeremy Boynes
+ jmarino Jim Marino
+ kelvingoodson Kelvin Goodson
+ kentam Ken Tam
+ kwilliams Kevin Williams
+ lresende Luciano Resende
+ edwardsmj Mike Edwards
+ meerajk Meeraj Kunnumpurath
+ rajith Rajith Attapattu
+ rfeng Raymond Feng
+ robbinspg Pete Robbins
+ rineholt Rick Rineholt
+ slaws Simon Laws
+ svkrish Venkata Krishnan
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/distribution/RELEASE_NOTES.txt b/sdo-java/tags/1.0-incubator-M3/sdo/distribution/RELEASE_NOTES.txt
new file mode 100644
index 0000000000..c3de1bdf6d
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/distribution/RELEASE_NOTES.txt
@@ -0,0 +1,100 @@
+What's New in SDO Java M3
+
+For previous revision history, take a look at the http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/distribution/RELEASE_NOTES.txt?view=markup&pathrev=465232
+
+Details are described below.
+
+SDO Java M3 is a superset of previous SDO Java M2 release.
+Anything in M2 is also in M3, but M3 contains features and bugfixes not present in M2 release.
+
+Downloading
+ http://cwiki.apache.org/confluence/display/TUSCANY/SDO+Java+Download
+
+Compatibility Concerns
+ M3 now uses the SDO 2.1 interfaces whereas M2 used the 2.0.1 interfaces.
+ A program written to the M2 dynamic SDO API/SPI can compile against M3 libraries,
+ although some API and SPI interfaces have been deprecated between releases.
+ In most instances these programs will execute as before, but if the programs relied
+ on the exposure of EMF Property instances through the SDO API then they will fail.
+ Static SDO classes generated with the M2 release must be regenerated before they will work in an M3 environment.
+ A program written for M3 cannot necessarily compile or run against M2 libraries.
+
+
+New Features and Fixes
+
+For more detail on these fixes and features please see ...
+http://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=true&&pid=12310210&fixfor=12312317&resolution=1&sorter/field=issuekey&sorter/order=DESC
+
+
+TUSCANY-153 ChangeSummary on root data object not supported
+TUSCANY-396 Cardinality of wildcard element not respected
+TUSCANY-521 Hide special Sequence-type properties from SDO Types
+TUSCANY-684 Generated SDO classes should be able to register the static types to a given TypeHelper
+TUSCANY-701 Conversion to date types which do not include month can give incorrect results
+TUSCANY-708 Should TypeHelper.define return List of Types that includes DocumentRootType
+TUSCANY-709 Loads DataGraph in designated scope(TypeHelper)
+TUSCANY-713 Discover and regiester new SDO types during the time of loading the XML instance document
+TUSCANY-718 make -noEMF code generation the default
+TUSCANY-836 doubleValue() may be inaccurate for Long
+TUSCANY-859 ChangeSummary#isCreated cache is not updated while changes are still going on
+TUSCANY-885 Property DataObject.getProperty(String propertyName) should return null if the property cannot be fou
+TUSCANY-887 TypeHelper.define() should create an accompanying global property per type
+TUSCANY-894 SDO (and indirectly DAS) may not now depend on CPL if EMF has completed migration to EPL
+TUSCANY-901 jar Manifests require Implementation-Vendor-Id
+TUSCANY-902 release distributions should have common root folder naming the release
+TUSCANY-928 Define Tuscany SDO options for XMLHelper load and save operations
+TUSCANY-929 Move to SDO 2.1 spec APIs
+TUSCANY-930 Add new SDOUtil.createHelperContext() method
+TUSCANY-931 Sequence.add(int index, String propertyName, Object value) is not functioning correctly
+TUSCANY-932 Invoking DataObject.isSet(String path) with invalid path would result in NPE
+TUSCANY-933 XSD2Java Generator still generates EMF codes with -noEMF option on
+TUSCANY-934 XSD2JavaGenerator -noEMF option does not work with abstract classes.
+TUSCANY-935 SDO path accessors need to support names that contain "."
+TUSCANY-956 SDOFactory instance lookup is using the wrong namespace URI
+TUSCANY-958 NPE generated during a property set of a static SDO
+TUSCANY-972 commonj.sdo/xml namespace should be supported by SDO runtime by default
+TUSCANY-1100 Dynamic Type tests are needed to ensure that all XSD datatypes are supported
+TUSCANY-1006 ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe
+TUSCANY-1044 DataHelperImpl.toDateTime() is not compliant with spec.
+TUSCANY-1050 For some schemas, the code generated will not compile (notication and settable problems)
+TUSCANY-1055 DataFactory.create(abstract_type) should throw an IllegalArgumentException
+TUSCANY-1062 DataGraph.createRootObject implementation does not match 2.1 spec and also is not helpful when given
+TUSCANY-1065 Coexistence problem between EMF and Tuscany SDO
+TUSCANY-1082 Change Summary XML deserialization
+TUSCANY-1083 Shorter NameSpace prefix to speed up XML processing and reduce communication bandwidth
+TUSCANY-1085 schemaLocation attribute in the <xsd:import> should be only a hint
+TUSCANY-1086 Scope defined java serialiazation/deserialization of SDO
+TUSCANY-1088 SDO should tolerate malformed XML
+TUSCANY-1091 DataObjectXMLStreamReader doesn't have to repeat NameSpace declaration which impacts performance
+TUSCANY-1093 isSet returning false when boolean set to false, or int set to 0
+TUSCANY-1096 Exception thrown when reference with many multiplicity to the element of anyType
+TUSCANY-1097 DataObjectXMLStreamReader shouldn't have ignored (transient Properties in) Sequence
+TUSCANY-1098 Add get() and getInstanceProperties() methods in Type and Property
+TUSCANY-1099 fix for TUSCANY-1083 used lookupPrefix method of Node not available to Java 1.4.2 users
+TUSCANY-1101 Support mixed Sequence and any Sequence in Change Summary
+TUSCANY-1102 Support EMF 2.2.2
+TUSCANY-1107 Multiple calls to getNamespaceContext
+TUSCANY-1113 Extensible namespaces and types that change
+TUSCANY-1120 Static code generator template bugs
+TUSCANY-1123 test case generated code and metadata access is anachronistic
+TUSCANY-1130 Concurrent access to SDOUtil.createHelperContext() results in exception
+TUSCANY-1132 SDO Java serialization/deserialization throws an exception when the serialized data object is not the
+TUSCANY-1141 The dependency/imported package was not initialized if the codegen tool was provided with -javaPackag
+TUSCANY-1155 Java SDO static code generation tool java doc and usage hints need updating.
+TUSCANY-1156 CodeGen generates lowercase feature name when the schema specifies uppercase
+TUSCANY-1164 Container of root object is non-null after endLogging()
+TUSCANY-1167 SDO Codegen generates bad code when the noNotification option is used
+TUSCANY-1168 Type.isSequenced() returns wrong value for my XSD
+TUSCANY-1169 Property.getType() throws ClassCastException if the property is from AnyDataObjectType.getInstancePro
+TUSCANY-1172 plugin LICENSE.txt file has spurious
+TUSCANY-1179 Race condition due to lazy metada initialization when SDO is shared across threads for read intent
+TUSCANY-1185 Contribution of EMF classes, BasicExtendedMetaData and XSDEcoreBuilder
+TUSCANY-1190 IAE in static case when using DataObject.setList() to assign multiple Objects to a many-valued Proper
+TUSCANY-1205 An exception was thrown when reading a large Java object back to DataObject
+TUSCANY-1200 Default HelperContext should provide automatic ClassLoader-specific scoping
+TUSCANY-1196 java.lang.ClassCastException org.eclipse.emf.ecore.impl.DynamicEObjectImpl incompatible with commonj.sdo.DataObject
+TUSCANY-1193 unable to create data objects from dynamic metadata that match data objects created from XSD metadata
+
+
+
+
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/distribution/readme.html b/sdo-java/tags/1.0-incubator-M3/sdo/distribution/readme.html
new file mode 100644
index 0000000000..5872035e37
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/distribution/readme.html
@@ -0,0 +1,45 @@
+<HTML>
+<head>
+<title>
+Tuscany SDO for Java M3 Binary Distribution
+</title>
+</head>
+<body>
+<H1>Tuscany SDO for Java M3 Binary Distribution Readme File</h1>
+<h2>Legal Notices</h2>
+<p>
+See the <a href="LICENSE.txt">LICENSE.txt</a> and <a href="NOTICE.txt">NOTICE.txt</a> files for legal information concerning this distribution.
+</p>
+<h2>Release Information</h2>
+<p>
+See the <a href="RELEASE_NOTES.txt">RELEASE_NOTES.txt</a> file for a summary of what's new with this release since the M2 release.
+</p>
+<h2>Documentation</h2>
+<p>
+For general documentation about the Tuscany project and the SDO for Java, see the <a href="http://incubator.apache.org/tuscany">Tuscany</a> website.
+</p>
+<p>
+This distribution contains javadoc for the <a href="javadoc/api/index.html">SDO 2.1 API</a>.
+It also contains Javadoc for the <a href="javadoc/impl/index.html">implementation code</a>.
+Although this is not of general use to the SDO user, there are some classes in the implementation code which are of interest
+to the user of SDO, these include
+<ul>
+
+ <li>org.apache.tuscany.sdo.util.SDOUtil</li>
+ <li>org.apache.tuscany.sdo.generate.XSD2JavaGenerator</li>
+ <li>org.apache.tuscany.sdo.generate.Interface2JavaGenerator</li>
+</ul>
+</p>
+<h2>Samples</h2>
+<p>
+Sample source code is available to <a href="http://cwiki.apache.org/TUSCANY/sdo-java-download.html">download</a> as a separate distribution to accompany this binary distribution.
+Download and unpack a suitable archive and follow the instructions in the archive to build and run the samples.
+</p>
+<p>
+</p>
+<p>
+</p>
+</body>
+</HTML>
+
+
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/model/SDO.ecore b/sdo-java/tags/1.0-incubator-M3/sdo/impl/model/SDO.ecore
new file mode 100644
index 0000000000..f9cf39ee5d
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/model/SDO.ecore
@@ -0,0 +1,980 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ -->
+<ecore:EPackage xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="sdo"
+ nsURI="http://www.apache.org/tuscany/2005/SDO" nsPrefix="sdo">
+ <eClassifiers xsi:type="ecore:EClass" name="ChangeSummary" instanceClassName="commonj.sdo.ChangeSummary"
+ eSuperTypes="../../org.eclipse.emf.ecore.change/model/Change.ecore#//ChangeDescription">
+ <eOperations name="beginLogging"/>
+ <eOperations name="endLogging"/>
+ <eOperations name="isCreated" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
+ <eParameters name="dataObject" eType="#//DataObject"/>
+ </eOperations>
+ <eOperations name="isDeleted" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
+ <eParameters name="dataObject" eType="#//DataObject"/>
+ </eOperations>
+ <eOperations name="getOldValues" eType="#//EJavaList">
+ <eParameters name="dataObject" eType="#//DataObject"/>
+ </eOperations>
+ <eOperations name="isModified" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
+ <eParameters name="dataObject" eType="#//DataObject"/>
+ </eOperations>
+ <eOperations name="getOldValue" eType="#//ChangeSummarySetting">
+ <eParameters name="dataObject" eType="#//DataObject"/>
+ <eParameters name="property" eType="#//Property"/>
+ </eOperations>
+ <eOperations name="getOldContainer" eType="#//DataObject">
+ <eParameters name="dataObject" eType="#//DataObject"/>
+ </eOperations>
+ <eOperations name="getOldContainmentProperty" eType="#//Property">
+ <eParameters name="dataObject" eType="#//DataObject"/>
+ </eOperations>
+ <eOperations name="getOldSequence" eType="#//Sequence">
+ <eParameters name="dataObject" eType="#//DataObject"/>
+ </eOperations>
+ <eOperations name="undoChanges"/>
+ <eOperations name="isLogging" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
+ <eOperations name="getDataGraph" eType="#//DataGraph"/>
+ <eOperations name="getChangedObjects" eType="#//EJavaList"/>
+ <eOperations name="getRootObject" eType="#//DataObject"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="eDataGraph" lowerBound="1"
+ eType="#//DataGraph" transient="true" resolveProxies="false" eOpposite="#//DataGraph/eChangeSummary"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="ChangeSummarySetting" instanceClassName="commonj.sdo.ChangeSummary$Setting"
+ eSuperTypes="../../org.eclipse.emf.ecore.change/model/Change.ecore#//FeatureChange">
+ <eOperations name="isSet" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
+ <eOperations name="getValue" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EJavaObject"/>
+ <eOperations name="getProperty" eType="#//Property"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="DataGraph" instanceClassName="commonj.sdo.DataGraph"
+ eSuperTypes="../../org.eclipse.emf.ecore/model/Ecore.ecore#//EObject">
+ <eOperations name="createRootObject" eType="#//DataObject">
+ <eParameters name="namespaceURI" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eParameters name="typeName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eOperations>
+ <eOperations name="createRootObject" eType="#//DataObject">
+ <eParameters name="type" eType="#//Type"/>
+ </eOperations>
+ <eOperations name="getType" eType="#//Type">
+ <eParameters name="namespaceURI" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eParameters name="typeName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eOperations>
+ <eOperations name="getRootObject" eType="#//DataObject"/>
+ <eOperations name="getChangeSummary" eType="#//ChangeSummary"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="resourceSet" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EResourceSet"
+ transient="true"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="rootResource" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EResource"
+ changeable="false" volatile="true" transient="true" derived="true"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="eChangeSummary" lowerBound="1"
+ eType="#//ChangeSummary" resolveProxies="false" eOpposite="#//ChangeSummary/eDataGraph"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="eRootObject" lowerBound="1"
+ eType="ecore:EClass ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EObject"
+ resolveProxies="false"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="DataObject" instanceClassName="commonj.sdo.DataObject"
+ abstract="true">
+ <eOperations name="get" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EJavaObject">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.get(this, path);"/>
+ </eAnnotations>
+ <eParameters name="path" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eOperations>
+ <eOperations name="set">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.set(this, path, value);"/>
+ </eAnnotations>
+ <eParameters name="path" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eParameters name="value" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EJavaObject"/>
+ </eOperations>
+ <eOperations name="isSet" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.isSet(this, path);"/>
+ </eAnnotations>
+ <eParameters name="path" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eOperations>
+ <eOperations name="unset">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.unset(this, path);"/>
+ </eAnnotations>
+ <eParameters name="path" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eOperations>
+ <eOperations name="get" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EJavaObject">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.get(this, propertyIndex);"/>
+ </eAnnotations>
+ <eParameters name="propertyIndex" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ </eOperations>
+ <eOperations name="set">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.set(this, propertyIndex, value);"/>
+ </eAnnotations>
+ <eParameters name="propertyIndex" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ <eParameters name="value" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EJavaObject"/>
+ </eOperations>
+ <eOperations name="isSet" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.isSet(this, propertyIndex);"/>
+ </eAnnotations>
+ <eParameters name="propertyIndex" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ </eOperations>
+ <eOperations name="unset">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.unset(this, propertyIndex);"/>
+ </eAnnotations>
+ <eParameters name="propertyIndex" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ </eOperations>
+ <eOperations name="get" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EJavaObject">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.get(this, property);"/>
+ </eAnnotations>
+ <eParameters name="property" eType="#//Property"/>
+ </eOperations>
+ <eOperations name="set">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.set(this, property, value);"/>
+ </eAnnotations>
+ <eParameters name="property" eType="#//Property"/>
+ <eParameters name="value" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EJavaObject"/>
+ </eOperations>
+ <eOperations name="isSet" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.isSet(this, property);"/>
+ </eAnnotations>
+ <eParameters name="property" eType="#//Property"/>
+ </eOperations>
+ <eOperations name="unset">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.unset(this, property);"/>
+ </eAnnotations>
+ <eParameters name="property" eType="#//Property"/>
+ </eOperations>
+ <eOperations name="getContainer" eType="#//DataObject">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getContainer(this);"/>
+ </eAnnotations>
+ </eOperations>
+ <eOperations name="getContainmentProperty" eType="#//Property">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getContainmentProperty(this);"/>
+ </eAnnotations>
+ </eOperations>
+ <eOperations name="getDataGraph" eType="#//DataGraph">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getDataGraph(this);"/>
+ </eAnnotations>
+ </eOperations>
+ <eOperations name="getType" eType="#//Type">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getType(this);"/>
+ </eAnnotations>
+ </eOperations>
+ <eOperations name="getBigDecimal" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EBigDecimal">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getBigDecimal(this, path);"/>
+ </eAnnotations>
+ <eParameters name="path" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eOperations>
+ <eOperations name="getBigInteger" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EBigInteger">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getBigInteger(this, path);"/>
+ </eAnnotations>
+ <eParameters name="path" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eOperations>
+ <eOperations name="getBoolean" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getBoolean(this, path);"/>
+ </eAnnotations>
+ <eParameters name="path" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eOperations>
+ <eOperations name="getByte" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EByte">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getByte(this, path);"/>
+ </eAnnotations>
+ <eParameters name="path" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eOperations>
+ <eOperations name="getBytes" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EByteArray">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getBytes(this, path);"/>
+ </eAnnotations>
+ <eParameters name="path" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eOperations>
+ <eOperations name="getChar" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EChar">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getChar(this, path);"/>
+ </eAnnotations>
+ <eParameters name="path" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eOperations>
+ <eOperations name="getDataObject" eType="#//DataObject">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getDataObject(this, path);"/>
+ </eAnnotations>
+ <eParameters name="path" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eOperations>
+ <eOperations name="getDate" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EDate">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getDate(this, path);"/>
+ </eAnnotations>
+ <eParameters name="path" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eOperations>
+ <eOperations name="getDouble" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDouble">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getDouble(this, path);"/>
+ </eAnnotations>
+ <eParameters name="path" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eOperations>
+ <eOperations name="getFloat" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EFloat">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getFloat(this, path);"/>
+ </eAnnotations>
+ <eParameters name="path" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eOperations>
+ <eOperations name="getInt" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getInt(this, path);"/>
+ </eAnnotations>
+ <eParameters name="path" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eOperations>
+ <eOperations name="getList" eType="#//EJavaList">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getList(this, path);"/>
+ </eAnnotations>
+ <eParameters name="path" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eOperations>
+ <eOperations name="getLong" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//ELong">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getLong(this, path);"/>
+ </eAnnotations>
+ <eParameters name="path" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eOperations>
+ <eOperations name="getSequence" eType="#//Sequence">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getSequence(this, path);"/>
+ </eAnnotations>
+ <eParameters name="path" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eOperations>
+ <eOperations name="getShort" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EShort">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getShort(this, path);"/>
+ </eAnnotations>
+ <eParameters name="path" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eOperations>
+ <eOperations name="getString" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getString(this, path);"/>
+ </eAnnotations>
+ <eParameters name="path" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eOperations>
+ <eOperations name="setBigDecimal">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.setBigDecimal(this, path, value);"/>
+ </eAnnotations>
+ <eParameters name="path" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eParameters name="value" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EBigDecimal"/>
+ </eOperations>
+ <eOperations name="setBigInteger">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.setBigInteger(this, path, value);"/>
+ </eAnnotations>
+ <eParameters name="path" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eParameters name="value" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EBigInteger"/>
+ </eOperations>
+ <eOperations name="setBoolean">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.setBoolean(this, path, value);"/>
+ </eAnnotations>
+ <eParameters name="path" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eParameters name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
+ </eOperations>
+ <eOperations name="setByte">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.setByte(this, path, value);"/>
+ </eAnnotations>
+ <eParameters name="path" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eParameters name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EByte"/>
+ </eOperations>
+ <eOperations name="setBytes">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.setBytes(this, path, value);"/>
+ </eAnnotations>
+ <eParameters name="path" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eParameters name="value" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EByteArray"/>
+ </eOperations>
+ <eOperations name="setChar">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.setChar(this, path, value);"/>
+ </eAnnotations>
+ <eParameters name="path" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eParameters name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EChar"/>
+ </eOperations>
+ <eOperations name="setDataObject">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.setDataObject(this, path, value);"/>
+ </eAnnotations>
+ <eParameters name="path" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eParameters name="value" eType="#//DataObject"/>
+ </eOperations>
+ <eOperations name="setDate">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.setDate(this, path, value);"/>
+ </eAnnotations>
+ <eParameters name="path" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eParameters name="value" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EDate"/>
+ </eOperations>
+ <eOperations name="setDouble">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.setDouble(this, path, value);"/>
+ </eAnnotations>
+ <eParameters name="path" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eParameters name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDouble"/>
+ </eOperations>
+ <eOperations name="setFloat">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.setFloat(this, path, value);"/>
+ </eAnnotations>
+ <eParameters name="path" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eParameters name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EFloat"/>
+ </eOperations>
+ <eOperations name="setInt">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.setInt(this, path, value);"/>
+ </eAnnotations>
+ <eParameters name="path" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eParameters name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ </eOperations>
+ <eOperations name="setList">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.setList(this, path, value);"/>
+ </eAnnotations>
+ <eParameters name="path" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eParameters name="value" eType="#//EJavaList"/>
+ </eOperations>
+ <eOperations name="setLong">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.setLong(this, path, value);"/>
+ </eAnnotations>
+ <eParameters name="path" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eParameters name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//ELong"/>
+ </eOperations>
+ <eOperations name="setShort">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.setShort(this, path, value);"/>
+ </eAnnotations>
+ <eParameters name="path" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eParameters name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EShort"/>
+ </eOperations>
+ <eOperations name="setString">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.setString(this, path, value);"/>
+ </eAnnotations>
+ <eParameters name="path" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eParameters name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eOperations>
+ <eOperations name="getBigDecimal" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EBigDecimal">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getBigDecimal(this, propertyIndex);"/>
+ </eAnnotations>
+ <eParameters name="propertyIndex" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ </eOperations>
+ <eOperations name="getBigInteger" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EBigInteger">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getBigInteger(this, propertyIndex);"/>
+ </eAnnotations>
+ <eParameters name="propertyIndex" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ </eOperations>
+ <eOperations name="getBoolean" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getBoolean(this, propertyIndex);"/>
+ </eAnnotations>
+ <eParameters name="propertyIndex" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ </eOperations>
+ <eOperations name="getByte" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EByte">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getByte(this, propertyIndex);"/>
+ </eAnnotations>
+ <eParameters name="propertyIndex" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ </eOperations>
+ <eOperations name="getBytes" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EByteArray">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getBytes(this, propertyIndex);"/>
+ </eAnnotations>
+ <eParameters name="propertyIndex" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ </eOperations>
+ <eOperations name="getChar" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EChar">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getChar(this, propertyIndex);"/>
+ </eAnnotations>
+ <eParameters name="propertyIndex" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ </eOperations>
+ <eOperations name="getDataObject" eType="#//DataObject">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getDataObject(this, propertyIndex);"/>
+ </eAnnotations>
+ <eParameters name="propertyIndex" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ </eOperations>
+ <eOperations name="getDate" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EDate">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getDate(this, propertyIndex);"/>
+ </eAnnotations>
+ <eParameters name="propertyIndex" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ </eOperations>
+ <eOperations name="getDouble" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDouble">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getDouble(this, propertyIndex);"/>
+ </eAnnotations>
+ <eParameters name="propertyIndex" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ </eOperations>
+ <eOperations name="getFloat" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EFloat">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getFloat(this, propertyIndex);"/>
+ </eAnnotations>
+ <eParameters name="propertyIndex" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ </eOperations>
+ <eOperations name="getInt" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getInt(this, propertyIndex);"/>
+ </eAnnotations>
+ <eParameters name="propertyIndex" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ </eOperations>
+ <eOperations name="getList" eType="#//EJavaList">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getList(this, propertyIndex);"/>
+ </eAnnotations>
+ <eParameters name="propertyIndex" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ </eOperations>
+ <eOperations name="getLong" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//ELong">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getLong(this, propertyIndex);"/>
+ </eAnnotations>
+ <eParameters name="propertyIndex" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ </eOperations>
+ <eOperations name="getSequence" eType="#//Sequence">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getSequence(this, propertyIndex);"/>
+ </eAnnotations>
+ <eParameters name="propertyIndex" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ </eOperations>
+ <eOperations name="getShort" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EShort">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getShort(this, propertyIndex);"/>
+ </eAnnotations>
+ <eParameters name="propertyIndex" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ </eOperations>
+ <eOperations name="getString" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getString(this, propertyIndex);"/>
+ </eAnnotations>
+ <eParameters name="propertyIndex" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ </eOperations>
+ <eOperations name="setBigDecimal">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.setBigDecimal(this, propertyIndex, value);"/>
+ </eAnnotations>
+ <eParameters name="propertyIndex" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ <eParameters name="value" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EBigDecimal"/>
+ </eOperations>
+ <eOperations name="setBigInteger">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.setBigInteger(this, propertyIndex, value);"/>
+ </eAnnotations>
+ <eParameters name="propertyIndex" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ <eParameters name="value" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EBigInteger"/>
+ </eOperations>
+ <eOperations name="setBoolean">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.setBoolean(this, propertyIndex, value);"/>
+ </eAnnotations>
+ <eParameters name="propertyIndex" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ <eParameters name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
+ </eOperations>
+ <eOperations name="setByte">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.setByte(this, propertyIndex, value);"/>
+ </eAnnotations>
+ <eParameters name="propertyIndex" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ <eParameters name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EByte"/>
+ </eOperations>
+ <eOperations name="setBytes">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.setBytes(this, propertyIndex, value);"/>
+ </eAnnotations>
+ <eParameters name="propertyIndex" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ <eParameters name="value" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EByteArray"/>
+ </eOperations>
+ <eOperations name="setChar">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.setChar(this, propertyIndex, value);"/>
+ </eAnnotations>
+ <eParameters name="propertyIndex" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ <eParameters name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EChar"/>
+ </eOperations>
+ <eOperations name="setDataObject">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.setDataObject(this, propertyIndex, value);"/>
+ </eAnnotations>
+ <eParameters name="propertyIndex" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ <eParameters name="value" eType="#//DataObject"/>
+ </eOperations>
+ <eOperations name="setDate">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.setDate(this, propertyIndex, value);"/>
+ </eAnnotations>
+ <eParameters name="propertyIndex" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ <eParameters name="value" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EDate"/>
+ </eOperations>
+ <eOperations name="setDouble">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.setDouble(this, propertyIndex, value);"/>
+ </eAnnotations>
+ <eParameters name="propertyIndex" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ <eParameters name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDouble"/>
+ </eOperations>
+ <eOperations name="setFloat">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.setFloat(this, propertyIndex, value);"/>
+ </eAnnotations>
+ <eParameters name="propertyIndex" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ <eParameters name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EFloat"/>
+ </eOperations>
+ <eOperations name="setInt">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.setInt(this, propertyIndex, value);"/>
+ </eAnnotations>
+ <eParameters name="propertyIndex" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ <eParameters name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ </eOperations>
+ <eOperations name="setList">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.setList(this, propertyIndex, value);"/>
+ </eAnnotations>
+ <eParameters name="propertyIndex" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ <eParameters name="value" eType="#//EJavaList"/>
+ </eOperations>
+ <eOperations name="setLong">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.setLong(this, propertyIndex, value);"/>
+ </eAnnotations>
+ <eParameters name="propertyIndex" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ <eParameters name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//ELong"/>
+ </eOperations>
+ <eOperations name="setShort">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.setShort(this, propertyIndex, value);"/>
+ </eAnnotations>
+ <eParameters name="propertyIndex" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ <eParameters name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EShort"/>
+ </eOperations>
+ <eOperations name="setString">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.setString(this, propertyIndex, value);"/>
+ </eAnnotations>
+ <eParameters name="propertyIndex" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ <eParameters name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eOperations>
+ <eOperations name="getBigDecimal" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EBigDecimal">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getBigDecimal(this, property);"/>
+ </eAnnotations>
+ <eParameters name="property" eType="#//Property"/>
+ </eOperations>
+ <eOperations name="getBigInteger" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EBigInteger">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getBigInteger(this, property);"/>
+ </eAnnotations>
+ <eParameters name="property" eType="#//Property"/>
+ </eOperations>
+ <eOperations name="getBoolean" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getBoolean(this, property);"/>
+ </eAnnotations>
+ <eParameters name="property" eType="#//Property"/>
+ </eOperations>
+ <eOperations name="getByte" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EByte">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getByte(this, property);"/>
+ </eAnnotations>
+ <eParameters name="property" eType="#//Property"/>
+ </eOperations>
+ <eOperations name="getBytes" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EByteArray">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getBytes(this, property);"/>
+ </eAnnotations>
+ <eParameters name="property" eType="#//Property"/>
+ </eOperations>
+ <eOperations name="getChar" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EChar">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getChar(this, property);"/>
+ </eAnnotations>
+ <eParameters name="property" eType="#//Property"/>
+ </eOperations>
+ <eOperations name="getDataObject" eType="#//DataObject">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getDataObject(this, property);"/>
+ </eAnnotations>
+ <eParameters name="property" eType="#//Property"/>
+ </eOperations>
+ <eOperations name="getDate" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EDate">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getDate(this, property);"/>
+ </eAnnotations>
+ <eParameters name="property" eType="#//Property"/>
+ </eOperations>
+ <eOperations name="getDouble" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDouble">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getDouble(this, property);"/>
+ </eAnnotations>
+ <eParameters name="property" eType="#//Property"/>
+ </eOperations>
+ <eOperations name="getFloat" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EFloat">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getFloat(this, property);"/>
+ </eAnnotations>
+ <eParameters name="property" eType="#//Property"/>
+ </eOperations>
+ <eOperations name="getInt" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getInt(this, property);"/>
+ </eAnnotations>
+ <eParameters name="property" eType="#//Property"/>
+ </eOperations>
+ <eOperations name="getList" eType="#//EJavaList">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getList(this, property);"/>
+ </eAnnotations>
+ <eParameters name="property" eType="#//Property"/>
+ </eOperations>
+ <eOperations name="getLong" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//ELong">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getLong(this, property);"/>
+ </eAnnotations>
+ <eParameters name="property" eType="#//Property"/>
+ </eOperations>
+ <eOperations name="getSequence" eType="#//Sequence">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getSequence(this, property);"/>
+ </eAnnotations>
+ <eParameters name="property" eType="#//Property"/>
+ </eOperations>
+ <eOperations name="getShort" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EShort">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getShort(this, property);"/>
+ </eAnnotations>
+ <eParameters name="property" eType="#//Property"/>
+ </eOperations>
+ <eOperations name="getString" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getString(this, property);"/>
+ </eAnnotations>
+ <eParameters name="property" eType="#//Property"/>
+ </eOperations>
+ <eOperations name="setBigDecimal">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.setBigDecimal(this, property, value);"/>
+ </eAnnotations>
+ <eParameters name="property" eType="#//Property"/>
+ <eParameters name="value" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EBigDecimal"/>
+ </eOperations>
+ <eOperations name="setBigInteger">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.setBigInteger(this, property, value);"/>
+ </eAnnotations>
+ <eParameters name="property" eType="#//Property"/>
+ <eParameters name="value" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EBigInteger"/>
+ </eOperations>
+ <eOperations name="setBoolean">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.setBoolean(this, property, value);"/>
+ </eAnnotations>
+ <eParameters name="property" eType="#//Property"/>
+ <eParameters name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
+ </eOperations>
+ <eOperations name="setByte">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.setByte(this, property, value);"/>
+ </eAnnotations>
+ <eParameters name="property" eType="#//Property"/>
+ <eParameters name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EByte"/>
+ </eOperations>
+ <eOperations name="setBytes">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.setBytes(this, property, value);"/>
+ </eAnnotations>
+ <eParameters name="property" eType="#//Property"/>
+ <eParameters name="value" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EByteArray"/>
+ </eOperations>
+ <eOperations name="setChar">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.setChar(this, property, value);"/>
+ </eAnnotations>
+ <eParameters name="property" eType="#//Property"/>
+ <eParameters name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EChar"/>
+ </eOperations>
+ <eOperations name="setDataObject">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.setDataObject(this, property, value);"/>
+ </eAnnotations>
+ <eParameters name="property" eType="#//Property"/>
+ <eParameters name="value" eType="#//DataObject"/>
+ </eOperations>
+ <eOperations name="setDate">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.setDate(this, property, value);"/>
+ </eAnnotations>
+ <eParameters name="property" eType="#//Property"/>
+ <eParameters name="value" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EDate"/>
+ </eOperations>
+ <eOperations name="setDouble">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.setDouble(this, property, value);"/>
+ </eAnnotations>
+ <eParameters name="property" eType="#//Property"/>
+ <eParameters name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDouble"/>
+ </eOperations>
+ <eOperations name="setFloat">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.setFloat(this, property, value);"/>
+ </eAnnotations>
+ <eParameters name="property" eType="#//Property"/>
+ <eParameters name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EFloat"/>
+ </eOperations>
+ <eOperations name="setInt">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.setInt(this, property, value);"/>
+ </eAnnotations>
+ <eParameters name="property" eType="#//Property"/>
+ <eParameters name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ </eOperations>
+ <eOperations name="setList">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.setList(this, property, value);"/>
+ </eAnnotations>
+ <eParameters name="property" eType="#//Property"/>
+ <eParameters name="value" eType="#//EJavaList"/>
+ </eOperations>
+ <eOperations name="setLong">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.setLong(this, property, value);"/>
+ </eAnnotations>
+ <eParameters name="property" eType="#//Property"/>
+ <eParameters name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//ELong"/>
+ </eOperations>
+ <eOperations name="setShort">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.setShort(this, property, value);"/>
+ </eAnnotations>
+ <eParameters name="property" eType="#//Property"/>
+ <eParameters name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EShort"/>
+ </eOperations>
+ <eOperations name="setString">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.setString(this, property, value);"/>
+ </eAnnotations>
+ <eParameters name="property" eType="#//Property"/>
+ <eParameters name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eOperations>
+ <eOperations name="createDataObject" eType="#//DataObject">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.createDataObject(this, propertyName);"/>
+ </eAnnotations>
+ <eParameters name="propertyName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eOperations>
+ <eOperations name="createDataObject" eType="#//DataObject">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.createDataObject(this, propertyIndex);"/>
+ </eAnnotations>
+ <eParameters name="propertyIndex" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ </eOperations>
+ <eOperations name="createDataObject" eType="#//DataObject">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.createDataObject(this, property);"/>
+ </eAnnotations>
+ <eParameters name="property" eType="#//Property"/>
+ </eOperations>
+ <eOperations name="createDataObject" eType="#//DataObject">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.createDataObject(this, propertyName, namespaceURI, typeName);"/>
+ </eAnnotations>
+ <eParameters name="propertyName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eParameters name="namespaceURI" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eParameters name="typeName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eOperations>
+ <eOperations name="createDataObject" eType="#//DataObject">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.createDataObject(this, propertyIndex, namespaceURI, typeName);"/>
+ </eAnnotations>
+ <eParameters name="propertyIndex" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ <eParameters name="namespaceURI" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eParameters name="typeName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eOperations>
+ <eOperations name="createDataObject" eType="#//DataObject">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.createDataObject(this, property, type);"/>
+ </eAnnotations>
+ <eParameters name="property" eType="#//Property"/>
+ <eParameters name="type" eType="#//Type"/>
+ </eOperations>
+ <eOperations name="delete">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.delete(this);"/>
+ </eAnnotations>
+ </eOperations>
+ <eOperations name="getSequence" eType="#//Sequence">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getSequence(this);"/>
+ </eAnnotations>
+ </eOperations>
+ <eOperations name="getInstanceProperties" eType="#//EJavaList">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getInstanceProperties(this);"/>
+ </eAnnotations>
+ </eOperations>
+ <eOperations name="getProperty" eType="#//Property">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getProperty(this, propertyName);"/>
+ </eAnnotations>
+ <eParameters name="propertyName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eOperations>
+ <eOperations name="getRootObject" eType="#//DataObject">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getRootObject(this);"/>
+ </eAnnotations>
+ </eOperations>
+ <eOperations name="getChangeSummary" eType="#//ChangeSummary">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="return &lt;%org.apache.sdo.util.SDOUtil%>.getChangeSummary(this);"/>
+ </eAnnotations>
+ </eOperations>
+ <eOperations name="detach">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="body" value="&lt;%org.apache.sdo.util.SDOUtil%>.detach(this);"/>
+ </eAnnotations>
+ </eOperations>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Property" instanceClassName="commonj.sdo.Property"
+ abstract="true" interface="true">
+ <eOperations name="getName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eOperations name="getType" eType="#//Type"/>
+ <eOperations name="isMany" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
+ <eOperations name="isContainment" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
+ <eOperations name="isReadOnly" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
+ <eOperations name="getContainingType" eType="#//Type"/>
+ <eOperations name="getAliasNames" eType="#//EJavaList"/>
+ <eOperations name="getOpposite" eType="#//Property"/>
+ <eOperations name="getDefault" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EJavaObject"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Sequence" instanceClassName="commonj.sdo.Sequence"
+ abstract="true" interface="true">
+ <eOperations name="size" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ <eOperations name="getProperty" eType="#//Property">
+ <eParameters name="index" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ </eOperations>
+ <eOperations name="getValue" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EJavaObject">
+ <eParameters name="index" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ </eOperations>
+ <eOperations name="setValue" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EJavaObject">
+ <eParameters name="index" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ <eParameters name="value" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EJavaObject"/>
+ </eOperations>
+ <eOperations name="add" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
+ <eParameters name="propertyName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eParameters name="value" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EJavaObject"/>
+ </eOperations>
+ <eOperations name="add" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
+ <eParameters name="propertIndex" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ <eParameters name="value" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EJavaObject"/>
+ </eOperations>
+ <eOperations name="add" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
+ <eParameters name="property" eType="#//Property"/>
+ <eParameters name="value" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EJavaObject"/>
+ </eOperations>
+ <eOperations name="add">
+ <eParameters name="index" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ <eParameters name="propertyName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eParameters name="value" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EJavaObject"/>
+ </eOperations>
+ <eOperations name="add">
+ <eParameters name="index" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ <eParameters name="propertyIndex" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ <eParameters name="value" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EJavaObject"/>
+ </eOperations>
+ <eOperations name="add">
+ <eParameters name="index" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ <eParameters name="property" eType="#//Property"/>
+ <eParameters name="value" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EJavaObject"/>
+ </eOperations>
+ <eOperations name="add">
+ <eParameters name="text" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eOperations>
+ <eOperations name="add">
+ <eParameters name="index" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+ <eParameters name="text" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eOperations>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Type" instanceClassName="commonj.sdo.Type"
+ abstract="true" interface="true">
+ <eOperations name="getName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eOperations name="getURI" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eOperations name="getInstanceClass" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EJavaClass"/>
+ <eOperations name="isInstance" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
+ <eParameters name="object" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EJavaObject"/>
+ </eOperations>
+ <eOperations name="isDataType" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
+ <eOperations name="isSequenced" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
+ <eOperations name="isOpen" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
+ <eOperations name="isAbstract" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
+ <eOperations name="getBaseTypes" eType="#//EJavaList"/>
+ <eOperations name="getAliasNames" eType="#//EJavaList"/>
+ <eOperations name="getProperties" eType="#//EJavaList"/>
+ <eOperations name="getDeclaredProperties" eType="#//EJavaList"/>
+ <eOperations name="getProperty" eType="#//Property">
+ <eParameters name="propertyName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eOperations>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EDataType" name="EJavaList" instanceClassName="java.util.List"
+ serializable="false"/>
+ <eClassifiers xsi:type="ecore:EDataType" name="EObjectStreamException" instanceClassName="java.io.ObjectStreamException"
+ serializable="false"/>
+ <eClassifiers xsi:type="ecore:EClass" name="AnyTypeDataObject" eSuperTypes="#//DataObject ../../org.eclipse.emf.ecore/model/XMLType.ecore#//AnyType">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="mixed"/>
+ </eAnnotations>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="SimpleAnyTypeDataObject" eSuperTypes="#//AnyTypeDataObject ../../org.eclipse.emf.ecore/model/XMLType.ecore#//SimpleAnyType">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="simple"/>
+ </eAnnotations>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Class" instanceClassName="commonj.sdo.Type"
+ eSuperTypes="../../org.eclipse.emf.ecore/model/Ecore.ecore#//EClass #//Type"/>
+ <eClassifiers xsi:type="ecore:EClass" name="DataType" instanceClassName="commonj.sdo.Type"
+ eSuperTypes="../../org.eclipse.emf.ecore/model/Ecore.ecore#//EDataType #//Type"/>
+ <eClassifiers xsi:type="ecore:EClass" name="Attribute" instanceClassName="commonj.sdo.Property"
+ eSuperTypes="../../org.eclipse.emf.ecore/model/Ecore.ecore#//EAttribute #//Property"/>
+ <eClassifiers xsi:type="ecore:EClass" name="Reference" instanceClassName="commonj.sdo.Property"
+ eSuperTypes="../../org.eclipse.emf.ecore/model/Ecore.ecore#//EReference #//Property"/>
+ <eClassifiers xsi:type="ecore:EClass" name="Enum" instanceClassName="commonj.sdo.Type"
+ eSuperTypes="../../org.eclipse.emf.ecore/model/Ecore.ecore#//EEnum #//Type"/>
+ <eClassifiers xsi:type="ecore:EClass" name="DynamicDataObject" instanceClassName="commonj.sdo.DataObject"
+ eSuperTypes="#//DataObject"/>
+ <eClassifiers xsi:type="ecore:EClass" name="StoreDataObject" instanceClassName="commonj.sdo.DataObject"
+ eSuperTypes="#//DataObject"/>
+ <eClassifiers xsi:type="ecore:EClass" name="DynamicStoreDataObject" instanceClassName="commonj.sdo.DataObject"
+ eSuperTypes="#//StoreDataObject"/>
+</ecore:EPackage>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/model/SDO.genmodel b/sdo-java/tags/1.0-incubator-M3/sdo/impl/model/SDO.genmodel
new file mode 100644
index 0000000000..43900d652e
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/model/SDO.genmodel
@@ -0,0 +1,582 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ -->
+<genmodel:GenModel xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
+ xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/org.apache.tuscany.sdo.impl/src/main/java"
+ creationCommands="false" modelPluginID="org.apache.tuscany.sdo.impl" runtimeJar="true"
+ modelName="SDO" modelPluginClass="" updateClasspath="false" rootExtendsClass="org.eclipse.emf.ecore.impl.BasicEObjectImpl"
+ rootImplementsInterface="" testsDirectory="" importerID="org.eclipse.emf.importer.rose"
+ usedGenPackages="../../org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore ../../org.eclipse.emf.ecore/model/XMLType.genmodel#//type ../../org.eclipse.emf.ecore.change/model/Change.genmodel#//change">
+ <foreignModel>SDO.mdl</foreignModel>
+ <foreignModel>VABASE_PLUGINS_PATH</foreignModel>
+ <foreignModel>../..</foreignModel>
+ <genPackages prefix="SDO" basePackage="org.apache.tuscany" disposableProviderFactory="true"
+ adapterFactory="false" generateExampleClass="false" ecorePackage="SDO.ecore#/">
+ <genDataTypes ecoreDataType="SDO.ecore#//EJavaList"/>
+ <genDataTypes ecoreDataType="SDO.ecore#//EObjectStreamException"/>
+ <genClasses ecoreClass="SDO.ecore#//ChangeSummary">
+ <genFeatures notify="false" createChild="false" ecoreFeature="ecore:EReference SDO.ecore#//ChangeSummary/eDataGraph"/>
+ <genOperations ecoreOperation="SDO.ecore#//ChangeSummary/beginLogging"/>
+ <genOperations ecoreOperation="SDO.ecore#//ChangeSummary/endLogging"/>
+ <genOperations ecoreOperation="SDO.ecore#//ChangeSummary/isCreated">
+ <genParameters ecoreParameter="SDO.ecore#//ChangeSummary/isCreated/dataObject"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//ChangeSummary/isDeleted">
+ <genParameters ecoreParameter="SDO.ecore#//ChangeSummary/isDeleted/dataObject"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//ChangeSummary/getOldValues">
+ <genParameters ecoreParameter="SDO.ecore#//ChangeSummary/getOldValues/dataObject"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//ChangeSummary/isModified">
+ <genParameters ecoreParameter="SDO.ecore#//ChangeSummary/isModified/dataObject"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//ChangeSummary/getOldValue">
+ <genParameters ecoreParameter="SDO.ecore#//ChangeSummary/getOldValue/dataObject"/>
+ <genParameters ecoreParameter="SDO.ecore#//ChangeSummary/getOldValue/property"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//ChangeSummary/getOldContainer">
+ <genParameters ecoreParameter="SDO.ecore#//ChangeSummary/getOldContainer/dataObject"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//ChangeSummary/getOldContainmentProperty">
+ <genParameters ecoreParameter="SDO.ecore#//ChangeSummary/getOldContainmentProperty/dataObject"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//ChangeSummary/getOldSequence">
+ <genParameters ecoreParameter="SDO.ecore#//ChangeSummary/getOldSequence/dataObject"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//ChangeSummary/undoChanges"/>
+ <genOperations ecoreOperation="SDO.ecore#//ChangeSummary/isLogging"/>
+ <genOperations ecoreOperation="SDO.ecore#//ChangeSummary/getDataGraph"/>
+ <genOperations ecoreOperation="SDO.ecore#//ChangeSummary/getChangedObjects"/>
+ <genOperations ecoreOperation="SDO.ecore#//ChangeSummary/getRootObject"/>
+ </genClasses>
+ <genClasses ecoreClass="SDO.ecore#//ChangeSummarySetting">
+ <genOperations ecoreOperation="SDO.ecore#//ChangeSummarySetting/isSet"/>
+ <genOperations ecoreOperation="SDO.ecore#//ChangeSummarySetting/getValue"/>
+ <genOperations ecoreOperation="SDO.ecore#//ChangeSummarySetting/getProperty"/>
+ </genClasses>
+ <genClasses ecoreClass="SDO.ecore#//DataGraph">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute SDO.ecore#//DataGraph/resourceSet"/>
+ <genFeatures property="Readonly" createChild="false" ecoreFeature="ecore:EAttribute SDO.ecore#//DataGraph/rootResource"/>
+ <genFeatures notify="false" createChild="false" ecoreFeature="ecore:EReference SDO.ecore#//DataGraph/eChangeSummary"/>
+ <genFeatures notify="false" createChild="false" ecoreFeature="ecore:EReference SDO.ecore#//DataGraph/eRootObject"/>
+ <genOperations ecoreOperation="SDO.ecore#//DataGraph/createRootObject">
+ <genParameters ecoreParameter="SDO.ecore#//DataGraph/createRootObject/namespaceURI"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataGraph/createRootObject/typeName"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataGraph/createRootObject.1">
+ <genParameters ecoreParameter="SDO.ecore#//DataGraph/createRootObject.1/type"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataGraph/getType">
+ <genParameters ecoreParameter="SDO.ecore#//DataGraph/getType/namespaceURI"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataGraph/getType/typeName"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataGraph/getRootObject"/>
+ <genOperations ecoreOperation="SDO.ecore#//DataGraph/getChangeSummary"/>
+ </genClasses>
+ <genClasses ecoreClass="SDO.ecore#//DataObject">
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/get">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/get/path"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/set">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/set/path"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/set/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/isSet">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/isSet/path"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/unset">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/unset/path"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/get.1">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/get.1/propertyIndex"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/set.1">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/set.1/propertyIndex"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/set.1/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/isSet.1">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/isSet.1/propertyIndex"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/unset.1">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/unset.1/propertyIndex"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/get.2">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/get.2/property"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/set.2">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/set.2/property"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/set.2/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/isSet.2">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/isSet.2/property"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/unset.2">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/unset.2/property"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getContainer"/>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getContainmentProperty"/>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getDataGraph"/>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getType"/>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getBigDecimal">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getBigDecimal/path"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getBigInteger">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getBigInteger/path"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getBoolean">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getBoolean/path"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getByte">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getByte/path"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getBytes">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getBytes/path"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getChar">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getChar/path"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getDataObject">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getDataObject/path"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getDate">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getDate/path"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getDouble">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getDouble/path"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getFloat">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getFloat/path"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getInt">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getInt/path"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getList">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getList/path"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getLong">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getLong/path"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getSequence">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getSequence/path"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getShort">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getShort/path"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getString">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getString/path"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/setBigDecimal">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setBigDecimal/path"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setBigDecimal/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/setBigInteger">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setBigInteger/path"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setBigInteger/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/setBoolean">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setBoolean/path"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setBoolean/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/setByte">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setByte/path"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setByte/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/setBytes">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setBytes/path"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setBytes/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/setChar">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setChar/path"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setChar/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/setDataObject">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setDataObject/path"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setDataObject/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/setDate">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setDate/path"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setDate/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/setDouble">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setDouble/path"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setDouble/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/setFloat">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setFloat/path"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setFloat/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/setInt">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setInt/path"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setInt/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/setList">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setList/path"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setList/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/setLong">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setLong/path"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setLong/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/setShort">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setShort/path"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setShort/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/setString">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setString/path"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setString/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getBigDecimal.1">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getBigDecimal.1/propertyIndex"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getBigInteger.1">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getBigInteger.1/propertyIndex"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getBoolean.1">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getBoolean.1/propertyIndex"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getByte.1">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getByte.1/propertyIndex"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getBytes.1">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getBytes.1/propertyIndex"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getChar.1">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getChar.1/propertyIndex"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getDataObject.1">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getDataObject.1/propertyIndex"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getDate.1">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getDate.1/propertyIndex"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getDouble.1">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getDouble.1/propertyIndex"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getFloat.1">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getFloat.1/propertyIndex"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getInt.1">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getInt.1/propertyIndex"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getList.1">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getList.1/propertyIndex"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getLong.1">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getLong.1/propertyIndex"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getSequence.1">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getSequence.1/propertyIndex"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getShort.1">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getShort.1/propertyIndex"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getString.1">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getString.1/propertyIndex"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/setBigDecimal.1">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setBigDecimal.1/propertyIndex"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setBigDecimal.1/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/setBigInteger.1">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setBigInteger.1/propertyIndex"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setBigInteger.1/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/setBoolean.1">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setBoolean.1/propertyIndex"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setBoolean.1/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/setByte.1">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setByte.1/propertyIndex"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setByte.1/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/setBytes.1">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setBytes.1/propertyIndex"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setBytes.1/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/setChar.1">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setChar.1/propertyIndex"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setChar.1/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/setDataObject.1">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setDataObject.1/propertyIndex"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setDataObject.1/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/setDate.1">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setDate.1/propertyIndex"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setDate.1/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/setDouble.1">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setDouble.1/propertyIndex"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setDouble.1/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/setFloat.1">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setFloat.1/propertyIndex"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setFloat.1/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/setInt.1">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setInt.1/propertyIndex"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setInt.1/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/setList.1">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setList.1/propertyIndex"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setList.1/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/setLong.1">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setLong.1/propertyIndex"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setLong.1/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/setShort.1">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setShort.1/propertyIndex"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setShort.1/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/setString.1">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setString.1/propertyIndex"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setString.1/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getBigDecimal.2">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getBigDecimal.2/property"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getBigInteger.2">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getBigInteger.2/property"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getBoolean.2">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getBoolean.2/property"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getByte.2">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getByte.2/property"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getBytes.2">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getBytes.2/property"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getChar.2">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getChar.2/property"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getDataObject.2">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getDataObject.2/property"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getDate.2">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getDate.2/property"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getDouble.2">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getDouble.2/property"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getFloat.2">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getFloat.2/property"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getInt.2">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getInt.2/property"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getList.2">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getList.2/property"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getLong.2">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getLong.2/property"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getSequence.2">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getSequence.2/property"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getShort.2">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getShort.2/property"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getString.2">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getString.2/property"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/setBigDecimal.2">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setBigDecimal.2/property"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setBigDecimal.2/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/setBigInteger.2">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setBigInteger.2/property"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setBigInteger.2/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/setBoolean.2">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setBoolean.2/property"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setBoolean.2/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/setByte.2">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setByte.2/property"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setByte.2/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/setBytes.2">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setBytes.2/property"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setBytes.2/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/setChar.2">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setChar.2/property"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setChar.2/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/setDataObject.2">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setDataObject.2/property"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setDataObject.2/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/setDate.2">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setDate.2/property"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setDate.2/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/setDouble.2">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setDouble.2/property"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setDouble.2/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/setFloat.2">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setFloat.2/property"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setFloat.2/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/setInt.2">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setInt.2/property"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setInt.2/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/setList.2">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setList.2/property"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setList.2/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/setLong.2">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setLong.2/property"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setLong.2/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/setShort.2">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setShort.2/property"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setShort.2/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/setString.2">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setString.2/property"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/setString.2/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/createDataObject">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/createDataObject/propertyName"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/createDataObject.1">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/createDataObject.1/propertyIndex"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/createDataObject.2">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/createDataObject.2/property"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/createDataObject.3">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/createDataObject.3/propertyName"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/createDataObject.3/namespaceURI"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/createDataObject.3/typeName"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/createDataObject.4">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/createDataObject.4/propertyIndex"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/createDataObject.4/namespaceURI"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/createDataObject.4/typeName"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/createDataObject.5">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/createDataObject.5/property"/>
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/createDataObject.5/type"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/delete"/>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getSequence.3"/>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getInstanceProperties"/>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getProperty">
+ <genParameters ecoreParameter="SDO.ecore#//DataObject/getProperty/propertyName"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getRootObject"/>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/getChangeSummary"/>
+ <genOperations ecoreOperation="SDO.ecore#//DataObject/detach"/>
+ </genClasses>
+ <genClasses ecoreClass="SDO.ecore#//Property">
+ <genOperations ecoreOperation="SDO.ecore#//Property/getName"/>
+ <genOperations ecoreOperation="SDO.ecore#//Property/getType"/>
+ <genOperations ecoreOperation="SDO.ecore#//Property/isMany"/>
+ <genOperations ecoreOperation="SDO.ecore#//Property/isContainment"/>
+ <genOperations ecoreOperation="SDO.ecore#//Property/isReadOnly"/>
+ <genOperations ecoreOperation="SDO.ecore#//Property/getContainingType"/>
+ <genOperations ecoreOperation="SDO.ecore#//Property/getAliasNames"/>
+ <genOperations ecoreOperation="SDO.ecore#//Property/getOpposite"/>
+ <genOperations ecoreOperation="SDO.ecore#//Property/getDefault"/>
+ </genClasses>
+ <genClasses ecoreClass="SDO.ecore#//Sequence">
+ <genOperations ecoreOperation="SDO.ecore#//Sequence/size"/>
+ <genOperations ecoreOperation="SDO.ecore#//Sequence/getProperty">
+ <genParameters ecoreParameter="SDO.ecore#//Sequence/getProperty/index"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//Sequence/getValue">
+ <genParameters ecoreParameter="SDO.ecore#//Sequence/getValue/index"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//Sequence/setValue">
+ <genParameters ecoreParameter="SDO.ecore#//Sequence/setValue/index"/>
+ <genParameters ecoreParameter="SDO.ecore#//Sequence/setValue/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//Sequence/add">
+ <genParameters ecoreParameter="SDO.ecore#//Sequence/add/propertyName"/>
+ <genParameters ecoreParameter="SDO.ecore#//Sequence/add/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//Sequence/add.1">
+ <genParameters ecoreParameter="SDO.ecore#//Sequence/add.1/propertIndex"/>
+ <genParameters ecoreParameter="SDO.ecore#//Sequence/add.1/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//Sequence/add.2">
+ <genParameters ecoreParameter="SDO.ecore#//Sequence/add.2/property"/>
+ <genParameters ecoreParameter="SDO.ecore#//Sequence/add.2/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//Sequence/add.3">
+ <genParameters ecoreParameter="SDO.ecore#//Sequence/add.3/index"/>
+ <genParameters ecoreParameter="SDO.ecore#//Sequence/add.3/propertyName"/>
+ <genParameters ecoreParameter="SDO.ecore#//Sequence/add.3/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//Sequence/add.4">
+ <genParameters ecoreParameter="SDO.ecore#//Sequence/add.4/index"/>
+ <genParameters ecoreParameter="SDO.ecore#//Sequence/add.4/propertyIndex"/>
+ <genParameters ecoreParameter="SDO.ecore#//Sequence/add.4/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//Sequence/add.5">
+ <genParameters ecoreParameter="SDO.ecore#//Sequence/add.5/index"/>
+ <genParameters ecoreParameter="SDO.ecore#//Sequence/add.5/property"/>
+ <genParameters ecoreParameter="SDO.ecore#//Sequence/add.5/value"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//Sequence/add.6">
+ <genParameters ecoreParameter="SDO.ecore#//Sequence/add.6/text"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//Sequence/add.7">
+ <genParameters ecoreParameter="SDO.ecore#//Sequence/add.7/index"/>
+ <genParameters ecoreParameter="SDO.ecore#//Sequence/add.7/text"/>
+ </genOperations>
+ </genClasses>
+ <genClasses ecoreClass="SDO.ecore#//Type">
+ <genOperations ecoreOperation="SDO.ecore#//Type/getName"/>
+ <genOperations ecoreOperation="SDO.ecore#//Type/getURI"/>
+ <genOperations ecoreOperation="SDO.ecore#//Type/getInstanceClass"/>
+ <genOperations ecoreOperation="SDO.ecore#//Type/isInstance">
+ <genParameters ecoreParameter="SDO.ecore#//Type/isInstance/object"/>
+ </genOperations>
+ <genOperations ecoreOperation="SDO.ecore#//Type/isDataType"/>
+ <genOperations ecoreOperation="SDO.ecore#//Type/isSequenced"/>
+ <genOperations ecoreOperation="SDO.ecore#//Type/isOpen"/>
+ <genOperations ecoreOperation="SDO.ecore#//Type/isAbstract"/>
+ <genOperations ecoreOperation="SDO.ecore#//Type/getBaseTypes"/>
+ <genOperations ecoreOperation="SDO.ecore#//Type/getAliasNames"/>
+ <genOperations ecoreOperation="SDO.ecore#//Type/getProperties"/>
+ <genOperations ecoreOperation="SDO.ecore#//Type/getDeclaredProperties"/>
+ <genOperations ecoreOperation="SDO.ecore#//Type/getProperty">
+ <genParameters ecoreParameter="SDO.ecore#//Type/getProperty/propertyName"/>
+ </genOperations>
+ </genClasses>
+ <genClasses ecoreClass="SDO.ecore#//AnyTypeDataObject"/>
+ <genClasses ecoreClass="SDO.ecore#//SimpleAnyTypeDataObject"/>
+ <genClasses ecoreClass="SDO.ecore#//Class"/>
+ <genClasses ecoreClass="SDO.ecore#//DataType"/>
+ <genClasses ecoreClass="SDO.ecore#//Attribute"/>
+ <genClasses ecoreClass="SDO.ecore#//Reference"/>
+ <genClasses ecoreClass="SDO.ecore#//Enum"/>
+ <genClasses ecoreClass="SDO.ecore#//DynamicDataObject"/>
+ <genClasses ecoreClass="SDO.ecore#//StoreDataObject"/>
+ <genClasses ecoreClass="SDO.ecore#//DynamicStoreDataObject"/>
+ </genPackages>
+</genmodel:GenModel>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/model/SDO.mdl b/sdo-java/tags/1.0-incubator-M3/sdo/impl/model/SDO.mdl
new file mode 100644
index 0000000000..2288766bab
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/model/SDO.mdl
@@ -0,0 +1,7670 @@
+
+(object Petal
+ version 42
+ _written "Rose 4.5.8163.3"
+ charSet 0)
+
+(object Design "Logical View"
+ is_unit TRUE
+ is_loaded TRUE
+ defaults (object defaults
+ rightMargin 0.250000
+ leftMargin 0.250000
+ topMargin 0.250000
+ bottomMargin 0.500000
+ pageOverlap 0.250000
+ clipIconLabels TRUE
+ autoResize FALSE
+ snapToGrid TRUE
+ gridX 16
+ gridY 16
+ defaultFont (object Font
+ size 10
+ face "Arial"
+ bold FALSE
+ italics FALSE
+ underline FALSE
+ strike FALSE
+ color 0
+ default_color TRUE)
+ showMessageNum 1
+ showClassOfObject TRUE
+ notation "Unified")
+ root_usecase_package (object Class_Category "Use Case View"
+ quid "3FAA8E8700BE"
+ exportControl "Public"
+ global TRUE
+ logical_models (list unit_reference_list)
+ logical_presentations (list unit_reference_list
+ (object UseCaseDiagram "Main"
+ quid "3FAA8E8700EF"
+ title "Main"
+ zoom 100
+ max_height 28350
+ max_width 21600
+ origin_x 0
+ origin_y 0
+ items (list diagram_item_list))))
+ root_category (object Class_Category "Logical View"
+ quid "3FAA8E8700BD"
+ exportControl "Public"
+ global TRUE
+ subsystem "Component View"
+ quidu "3FAA8E8700BF"
+ logical_models (list unit_reference_list
+ (object Class_Category "sdo"
+ attributes (list Attribute_Set
+ (object Attribute
+ tool "Ecore"
+ name "nsPrefix"
+ value "sdo")
+ (object Attribute
+ tool "Ecore"
+ name "nsURI"
+ value "http://www.apache.org/tuscany/2005/SDO")
+ (object Attribute
+ tool "Ecore"
+ name "basePackage"
+ value "org.apache.tuscany")
+ (object Attribute
+ tool "Ecore"
+ name "prefix"
+ value "SDO"))
+ quid "3FAA8E8B0306"
+ exportControl "Public"
+ logical_models (list unit_reference_list
+ (object Class "ChangeSummary"
+ quid "3FAB7C360208"
+ superclasses (list inheritance_relationship_list
+ (object Inheritance_Relationship
+ quid "4361480602D8"
+ supplier "Logical View::change::ChangeDescription"
+ quidu "4FAB6F110198"))
+ operations (list Operations
+ (object Operation "beginLogging"
+ quid "3FAB8899003B"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "endLogging"
+ quid "3FAB88AB0145"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "isCreated"
+ quid "3FAB89650125"
+ parameters (list Parameters
+ (object Parameter "dataObject"
+ type "DataObject"))
+ result "boolean"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "isDeleted"
+ quid "3FAB896F0314"
+ parameters (list Parameters
+ (object Parameter "dataObject"
+ type "DataObject"))
+ result "boolean"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getOldValues"
+ quid "3FAB89A4039C"
+ parameters (list Parameters
+ (object Parameter "dataObject"
+ type "DataObject"))
+ result "EJavaList"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "isModified"
+ quid "435500FB024C"
+ parameters (list Parameters
+ (object Parameter "dataObject"
+ type "DataObject"))
+ result "boolean"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getOldValue"
+ quid "435501180185"
+ parameters (list Parameters
+ (object Parameter "dataObject"
+ type "DataObject")
+ (object Parameter "property"
+ type "Property"))
+ result "ChangeSummarySetting"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getOldContainer"
+ quid "43550265035B"
+ parameters (list Parameters
+ (object Parameter "dataObject"
+ type "DataObject"))
+ result "DataObject"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getOldContainmentProperty"
+ quid "4355027F01D2"
+ parameters (list Parameters
+ (object Parameter "dataObject"
+ type "DataObject"))
+ result "Property"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getOldSequence"
+ quid "4355029E03A3"
+ parameters (list Parameters
+ (object Parameter "dataObject"
+ type "DataObject"))
+ result "Sequence"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "undoChanges"
+ quid "435502B303D5"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "isLogging"
+ quid "435D2CB50354"
+ result "boolean"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getDataGraph"
+ quid "435D2CC200A0"
+ result "DataGraph"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getChangedDataObjects"
+ quid "435D2D2B001F"
+ result "EJavaList"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getRootObject"
+ quid "435D2D360151"
+ result "DataObject"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0))
+ class_attributes (list class_attribute_list
+ (object ClassAttribute "commonj.sdo.ChangeSummary"
+ quid "3FAB7C4D0373"
+ stereotype "javaclass"
+ exportControl "Public")))
+ (object Class "ChangeSummarySetting"
+ quid "3FAB8BF8005A"
+ superclasses (list inheritance_relationship_list
+ (object Inheritance_Relationship
+ quid "436134F001A6"
+ supplier "Logical View::change::FeatureChange"
+ quidu "4FC39D6D0177"))
+ operations (list Operations
+ (object Operation "isSet"
+ quid "3FD14B5800BD"
+ result "boolean"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getValue"
+ quid "3FDEF80600EA"
+ result "EJavaObject"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getProperty"
+ quid "435D2C440045"
+ result "Property"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0))
+ class_attributes (list class_attribute_list
+ (object ClassAttribute "commonj.sdo.ChangeSummary$Setting"
+ quid "3FAB8C05003A"
+ stereotype "javaclass"
+ exportControl "Public")))
+ (object Class "DataGraph"
+ quid "3FAB7BFE03C0"
+ superclasses (list inheritance_relationship_list
+ (object Inheritance_Relationship
+ quid "43612C7B0243"
+ supplier "Logical View::ecore::EObject"
+ quidu "3C4F1C860123"))
+ operations (list Operations
+ (object Operation "createRootObject"
+ quid "3FAB86D40102"
+ parameters (list Parameters
+ (object Parameter "namespaceURI"
+ type "String")
+ (object Parameter "typeName"
+ type "String"))
+ result "DataObject"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "createRootObject"
+ quid "3FAB87520135"
+ parameters (list Parameters
+ (object Parameter "type"
+ type "Type"))
+ result "DataObject"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getType"
+ quid "3FAB87E20024"
+ parameters (list Parameters
+ (object Parameter "namespaceURI"
+ type "String")
+ (object Parameter "typeName"
+ type "String"))
+ result "Type"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getRootObject"
+ quid "435D2C900120"
+ result "DataObject"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getChangeSummary"
+ quid "435D2C9B039D"
+ result "ChangeSummary"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0))
+ class_attributes (list class_attribute_list
+ (object ClassAttribute "commonj.sdo.DataGraph"
+ quid "3FAB7C1A0171"
+ stereotype "javaclass"
+ exportControl "Public")
+ (object ClassAttribute "resourceSet"
+ attributes (list Attribute_Set
+ (object Attribute
+ tool "Ecore"
+ name "isTransient"
+ value TRUE))
+ quid "436129AF0208"
+ type "EResourceSet"
+ exportControl "Public")
+ (object ClassAttribute "rootResource"
+ attributes (list Attribute_Set
+ (object Attribute
+ tool "Ecore"
+ name "isTransient"
+ value TRUE)
+ (object Attribute
+ tool "Ecore"
+ name "isVolatile"
+ value TRUE)
+ (object Attribute
+ tool "Ecore"
+ name "isChangeable"
+ value FALSE))
+ quid "436129BF0016"
+ type "EResource"
+ exportControl "Public"
+ derived TRUE)))
+ (object Class "DataObject"
+ quid "3FAB6F7501C4"
+ operations (list Operations
+ (object Operation "get"
+ quid "3FAB8EF201A0"
+ parameters (list Parameters
+ (object Parameter "path"
+ type "String"))
+ result "EJavaObject"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.get(this, path);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "set"
+ quid "3FAB8FE502FE"
+ parameters (list Parameters
+ (object Parameter "path"
+ type "String")
+ (object Parameter "value"
+ type "EJavaObject"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.set(this, path, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "isSet"
+ quid "3FAB901001BF"
+ parameters (list Parameters
+ (object Parameter "path"
+ type "String"))
+ result "boolean"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.isSet(this, path);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "unset"
+ quid "3FAB901803B6"
+ parameters (list Parameters
+ (object Parameter "path"
+ type "String"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.unset(this, path);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "get"
+ quid "01EDEDEDEDED"
+ parameters (list Parameters
+ (object Parameter "propertyIndex"
+ type "int"))
+ result "EJavaObject"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.get(this, propertyIndex);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "set"
+ quid "02EDEDEDEDED"
+ parameters (list Parameters
+ (object Parameter "propertyIndex"
+ type "int")
+ (object Parameter "value"
+ type "EJavaObject"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.set(this, propertyIndex, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "isSet"
+ quid "03EDEDEDEDED"
+ parameters (list Parameters
+ (object Parameter "propertyIndex"
+ type "int"))
+ result "boolean"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.isSet(this, propertyIndex);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "unset"
+ quid "04EDEDEDEDED"
+ parameters (list Parameters
+ (object Parameter "propertyIndex"
+ type "int"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.unset(this, propertyIndex);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "get"
+ quid "01ADEDEDEDED"
+ parameters (list Parameters
+ (object Parameter "property"
+ type "Property"))
+ result "EJavaObject"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.get(this, property);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "set"
+ quid "02ADEDEDEDED"
+ parameters (list Parameters
+ (object Parameter "property"
+ type "Property")
+ (object Parameter "value"
+ type "EJavaObject"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.set(this, property, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "isSet"
+ quid "03ADEDEDEDED"
+ parameters (list Parameters
+ (object Parameter "property"
+ type "Property"))
+ result "boolean"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.isSet(this, property);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "unset"
+ quid "04ADEDEDEDED"
+ parameters (list Parameters
+ (object Parameter "property"
+ type "Property"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.unset(this, property);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getContainer"
+ quid "AAEDEDEDEDE0"
+ result "DataObject"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getContainer(this);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getContainmentProperty"
+ quid "AAEDEDEDEDE2"
+ result "Property"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getContainmentProperty(this);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getDataGraph"
+ quid "AAEDEDEDEDE3"
+ result "DataGraph"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getDataGraph(this);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getType"
+ quid "AAEDEDEDEDE1"
+ result "Type"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getType(this);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getBigDecimal"
+ quid "EDEDEDED0000"
+ parameters (list Parameters
+ (object Parameter "path"
+ type "String"))
+ result "EBigDecimal"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getBigDecimal(this, path);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getBigInteger"
+ quid "EDEDEDED0001"
+ parameters (list Parameters
+ (object Parameter "path"
+ type "String"))
+ result "EBigInteger"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getBigInteger(this, path);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getBoolean"
+ quid "EDEDEDED0002"
+ parameters (list Parameters
+ (object Parameter "path"
+ type "String"))
+ result "boolean"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getBoolean(this, path);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getByte"
+ quid "EDEDEDED0003"
+ parameters (list Parameters
+ (object Parameter "path"
+ type "String"))
+ result "byte"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getByte(this, path);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getBytes"
+ quid "EDEDEDED0004"
+ parameters (list Parameters
+ (object Parameter "path"
+ type "String"))
+ result "EByteArray"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getBytes(this, path);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getChar"
+ quid "EDEDEDED0005"
+ parameters (list Parameters
+ (object Parameter "path"
+ type "String"))
+ result "char"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getChar(this, path);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getDataObject"
+ quid "EDEDEDED0006"
+ parameters (list Parameters
+ (object Parameter "path"
+ type "String"))
+ result "DataObject"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getDataObject(this, path);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getDate"
+ quid "EDEDEDED0007"
+ parameters (list Parameters
+ (object Parameter "path"
+ type "String"))
+ result "EDate"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getDate(this, path);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getDouble"
+ quid "EDEDEDED0008"
+ parameters (list Parameters
+ (object Parameter "path"
+ type "String"))
+ result "double"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getDouble(this, path);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getFloat"
+ quid "EDEDEDED0009"
+ parameters (list Parameters
+ (object Parameter "path"
+ type "String"))
+ result "float"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getFloat(this, path);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getInt"
+ quid "EDEDEDED000A"
+ parameters (list Parameters
+ (object Parameter "path"
+ type "String"))
+ result "int"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getInt(this, path);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getList"
+ quid "EDEDEDED000B"
+ parameters (list Parameters
+ (object Parameter "path"
+ type "String"))
+ result "EJavaList"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getList(this, path);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getLong"
+ quid "EDEDEDED000C"
+ parameters (list Parameters
+ (object Parameter "path"
+ type "String"))
+ result "long"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getLong(this, path);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getSequence"
+ quid "EDEDEDED000D"
+ parameters (list Parameters
+ (object Parameter "path"
+ type "String"))
+ result "Sequence"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getSequence(this, path);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getShort"
+ quid "EDEDEDED000E"
+ parameters (list Parameters
+ (object Parameter "path"
+ type "String"))
+ result "short"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getShort(this, path);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getString"
+ quid "EDEDEDED000F"
+ parameters (list Parameters
+ (object Parameter "path"
+ type "String"))
+ result "String"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getString(this, path);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "setBigDecimal"
+ quid "EDEDEDED1000"
+ parameters (list Parameters
+ (object Parameter "path"
+ type "String")
+ (object Parameter "value"
+ type "EBigDecimal"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.setBigDecimal(this, path, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "setBigInteger"
+ quid "EDEDEDED1001"
+ parameters (list Parameters
+ (object Parameter "path"
+ type "String")
+ (object Parameter "value"
+ type "EBigInteger"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.setBigInteger(this, path, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "setBoolean"
+ quid "EDEDEDED1002"
+ parameters (list Parameters
+ (object Parameter "path"
+ type "String")
+ (object Parameter "value"
+ type "boolean"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.setBoolean(this, path, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "setByte"
+ quid "EDEDEDED1003"
+ parameters (list Parameters
+ (object Parameter "path"
+ type "String")
+ (object Parameter "value"
+ type "byte"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.setByte(this, path, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "setBytes"
+ quid "EDEDEDED1004"
+ parameters (list Parameters
+ (object Parameter "path"
+ type "String")
+ (object Parameter "value"
+ type "EByteArray"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.setBytes(this, path, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "setChar"
+ quid "EDEDEDED1005"
+ parameters (list Parameters
+ (object Parameter "path"
+ type "String")
+ (object Parameter "value"
+ type "char"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.setChar(this, path, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "setDataObject"
+ quid "EDEDEDED1006"
+ parameters (list Parameters
+ (object Parameter "path"
+ type "String")
+ (object Parameter "value"
+ type "DataObject"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.setDataObject(this, path, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "setDate"
+ quid "EDEDEDED1007"
+ parameters (list Parameters
+ (object Parameter "path"
+ type "String")
+ (object Parameter "value"
+ type "EDate"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.setDate(this, path, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "setDouble"
+ quid "EDEDEDED1008"
+ parameters (list Parameters
+ (object Parameter "path"
+ type "String")
+ (object Parameter "value"
+ type "double"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.setDouble(this, path, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "setFloat"
+ quid "EDEDEDED1009"
+ parameters (list Parameters
+ (object Parameter "path"
+ type "String")
+ (object Parameter "value"
+ type "float"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.setFloat(this, path, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "setInt"
+ quid "EDEDEDED100A"
+ parameters (list Parameters
+ (object Parameter "path"
+ type "String")
+ (object Parameter "value"
+ type "int"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.setInt(this, path, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "setList"
+ quid "EDEDEDED100B"
+ parameters (list Parameters
+ (object Parameter "path"
+ type "String")
+ (object Parameter "value"
+ type "EJavaList"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.setList(this, path, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "setLong"
+ quid "EDEDEDED100C"
+ parameters (list Parameters
+ (object Parameter "path"
+ type "String")
+ (object Parameter "value"
+ type "long"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.setLong(this, path, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "setShort"
+ quid "EDEDEDED100E"
+ parameters (list Parameters
+ (object Parameter "path"
+ type "String")
+ (object Parameter "value"
+ type "short"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.setShort(this, path, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "setString"
+ quid "EDEDEDED100F"
+ parameters (list Parameters
+ (object Parameter "path"
+ type "String")
+ (object Parameter "value"
+ type "String"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.setString(this, path, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getBigDecimal"
+ quid "EDEDEDED2000"
+ parameters (list Parameters
+ (object Parameter "propertyIndex"
+ type "int"))
+ result "EBigDecimal"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getBigDecimal(this, propertyIndex);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getBigInteger"
+ quid "EDEDEDED2001"
+ parameters (list Parameters
+ (object Parameter "propertyIndex"
+ type "int"))
+ result "EBigInteger"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getBigInteger(this, propertyIndex);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getBoolean"
+ quid "EDEDEDED2002"
+ parameters (list Parameters
+ (object Parameter "propertyIndex"
+ type "int"))
+ result "boolean"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getBoolean(this, propertyIndex);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getByte"
+ quid "EDEDEDED2003"
+ parameters (list Parameters
+ (object Parameter "propertyIndex"
+ type "int"))
+ result "byte"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getByte(this, propertyIndex);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getBytes"
+ quid "EDEDEDED2004"
+ parameters (list Parameters
+ (object Parameter "propertyIndex"
+ type "int"))
+ result "EByteArray"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getBytes(this, propertyIndex);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getChar"
+ quid "EDEDEDED2005"
+ parameters (list Parameters
+ (object Parameter "propertyIndex"
+ type "int"))
+ result "char"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getChar(this, propertyIndex);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getDataObject"
+ quid "EDEDEDED2006"
+ parameters (list Parameters
+ (object Parameter "propertyIndex"
+ type "int"))
+ result "DataObject"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getDataObject(this, propertyIndex);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getDate"
+ quid "EDEDEDED2007"
+ parameters (list Parameters
+ (object Parameter "propertyIndex"
+ type "int"))
+ result "EDate"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getDate(this, propertyIndex);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getDouble"
+ quid "EDEDEDED2008"
+ parameters (list Parameters
+ (object Parameter "propertyIndex"
+ type "int"))
+ result "double"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getDouble(this, propertyIndex);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getFloat"
+ quid "EDEDEDED2009"
+ parameters (list Parameters
+ (object Parameter "propertyIndex"
+ type "int"))
+ result "float"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getFloat(this, propertyIndex);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getInt"
+ quid "EDEDEDED200A"
+ parameters (list Parameters
+ (object Parameter "propertyIndex"
+ type "int"))
+ result "int"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getInt(this, propertyIndex);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getList"
+ quid "EDEDEDED200B"
+ parameters (list Parameters
+ (object Parameter "propertyIndex"
+ type "int"))
+ result "EJavaList"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getList(this, propertyIndex);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getLong"
+ quid "EDEDEDED200C"
+ parameters (list Parameters
+ (object Parameter "propertyIndex"
+ type "int"))
+ result "long"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getLong(this, propertyIndex);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getSequence"
+ quid "EDEDEDED200D"
+ parameters (list Parameters
+ (object Parameter "propertyIndex"
+ type "int"))
+ result "Sequence"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getSequence(this, propertyIndex);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getShort"
+ quid "EDEDEDED200E"
+ parameters (list Parameters
+ (object Parameter "propertyIndex"
+ type "int"))
+ result "short"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getShort(this, propertyIndex);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getString"
+ quid "EDEDEDED200F"
+ parameters (list Parameters
+ (object Parameter "propertyIndex"
+ type "int"))
+ result "String"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getString(this, propertyIndex);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "setBigDecimal"
+ quid "EDEDEDED3000"
+ parameters (list Parameters
+ (object Parameter "propertyIndex"
+ type "int")
+ (object Parameter "value"
+ type "EBigDecimal"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.setBigDecimal(this, propertyIndex, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "setBigInteger"
+ quid "EDEDEDED3001"
+ parameters (list Parameters
+ (object Parameter "propertyIndex"
+ type "int")
+ (object Parameter "value"
+ type "EBigInteger"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.setBigInteger(this, propertyIndex, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "setBoolean"
+ quid "EDEDEDED3002"
+ parameters (list Parameters
+ (object Parameter "propertyIndex"
+ type "int")
+ (object Parameter "value"
+ type "boolean"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.setBoolean(this, propertyIndex, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "setByte"
+ quid "EDEDEDED3003"
+ parameters (list Parameters
+ (object Parameter "propertyIndex"
+ type "int")
+ (object Parameter "value"
+ type "byte"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.setByte(this, propertyIndex, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "setBytes"
+ quid "EDEDEDED3004"
+ parameters (list Parameters
+ (object Parameter "propertyIndex"
+ type "int")
+ (object Parameter "value"
+ type "EByteArray"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.setBytes(this, propertyIndex, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "setChar"
+ quid "EDEDEDED3005"
+ parameters (list Parameters
+ (object Parameter "propertyIndex"
+ type "int")
+ (object Parameter "value"
+ type "char"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.setChar(this, propertyIndex, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "setDataObject"
+ quid "EDEDEDED3006"
+ parameters (list Parameters
+ (object Parameter "propertyIndex"
+ type "int")
+ (object Parameter "value"
+ type "DataObject"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.setDataObject(this, propertyIndex, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "setDate"
+ quid "EDEDEDED3007"
+ parameters (list Parameters
+ (object Parameter "propertyIndex"
+ type "int")
+ (object Parameter "value"
+ type "EDate"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.setDate(this, propertyIndex, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "setDouble"
+ quid "EDEDEDED3008"
+ parameters (list Parameters
+ (object Parameter "propertyIndex"
+ type "int")
+ (object Parameter "value"
+ type "double"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.setDouble(this, propertyIndex, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "setFloat"
+ quid "EDEDEDED3009"
+ parameters (list Parameters
+ (object Parameter "propertyIndex"
+ type "int")
+ (object Parameter "value"
+ type "float"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.setFloat(this, propertyIndex, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "setInt"
+ quid "EDEDEDED300A"
+ parameters (list Parameters
+ (object Parameter "propertyIndex"
+ type "int")
+ (object Parameter "value"
+ type "int"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.setInt(this, propertyIndex, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "setList"
+ quid "EDEDEDED300B"
+ parameters (list Parameters
+ (object Parameter "propertyIndex"
+ type "int")
+ (object Parameter "value"
+ type "EJavaList"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.setList(this, propertyIndex, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "setLong"
+ quid "EDEDEDED300C"
+ parameters (list Parameters
+ (object Parameter "propertyIndex"
+ type "int")
+ (object Parameter "value"
+ type "long"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.setLong(this, propertyIndex, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "setShort"
+ quid "EDEDEDED300E"
+ parameters (list Parameters
+ (object Parameter "propertyIndex"
+ type "int")
+ (object Parameter "value"
+ type "short"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.setShort(this, propertyIndex, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "setString"
+ quid "EDEDEDED300F"
+ parameters (list Parameters
+ (object Parameter "propertyIndex"
+ type "int")
+ (object Parameter "value"
+ type "String"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.setString(this, propertyIndex, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getBigDecimal"
+ quid "EDEDEEEE2000"
+ parameters (list Parameters
+ (object Parameter "property"
+ type "Property"))
+ result "EBigDecimal"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getBigDecimal(this, property);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getBigInteger"
+ quid "EDEDEEEE2001"
+ parameters (list Parameters
+ (object Parameter "property"
+ type "Property"))
+ result "EBigInteger"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getBigInteger(this, property);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getBoolean"
+ quid "EDEDEEEE2002"
+ parameters (list Parameters
+ (object Parameter "property"
+ type "Property"))
+ result "boolean"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getBoolean(this, property);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getByte"
+ quid "EDEDEEEE2003"
+ parameters (list Parameters
+ (object Parameter "property"
+ type "Property"))
+ result "byte"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getByte(this, property);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getBytes"
+ quid "EDEDEEEE2004"
+ parameters (list Parameters
+ (object Parameter "property"
+ type "Property"))
+ result "EByteArray"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getBytes(this, property);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getChar"
+ quid "EDEDEEEE2005"
+ parameters (list Parameters
+ (object Parameter "property"
+ type "Property"))
+ result "char"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getChar(this, property);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getDataObject"
+ quid "EDEDEEEE2006"
+ parameters (list Parameters
+ (object Parameter "property"
+ type "Property"))
+ result "DataObject"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getDataObject(this, property);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getDate"
+ quid "EDEDEEEE2007"
+ parameters (list Parameters
+ (object Parameter "property"
+ type "Property"))
+ result "EDate"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getDate(this, property);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getDouble"
+ quid "EDEDEEEE2008"
+ parameters (list Parameters
+ (object Parameter "property"
+ type "Property"))
+ result "double"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getDouble(this, property);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getFloat"
+ quid "EDEDEEEE2009"
+ parameters (list Parameters
+ (object Parameter "property"
+ type "Property"))
+ result "float"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getFloat(this, property);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getInt"
+ quid "EDEDEEEE200A"
+ parameters (list Parameters
+ (object Parameter "property"
+ type "Property"))
+ result "int"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getInt(this, property);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getList"
+ quid "EDEDEEEE200B"
+ parameters (list Parameters
+ (object Parameter "property"
+ type "Property"))
+ result "EJavaList"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getList(this, property);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getLong"
+ quid "EDEDEEEE200C"
+ parameters (list Parameters
+ (object Parameter "property"
+ type "Property"))
+ result "long"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getLong(this, property);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getSequence"
+ quid "EDEDEEEE200D"
+ parameters (list Parameters
+ (object Parameter "property"
+ type "Property"))
+ result "Sequence"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getSequence(this, property);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getShort"
+ quid "EDEDEEEE200E"
+ parameters (list Parameters
+ (object Parameter "property"
+ type "Property"))
+ result "short"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getShort(this, property);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getString"
+ quid "EDEDEEEE200F"
+ parameters (list Parameters
+ (object Parameter "property"
+ type "Property"))
+ result "String"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getString(this, property);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "setBigDecimal"
+ quid "EDEDEEEE3000"
+ parameters (list Parameters
+ (object Parameter "property"
+ type "Property")
+ (object Parameter "value"
+ type "EBigDecimal"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.setBigDecimal(this, property, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "setBigInteger"
+ quid "EDEDEEEE3001"
+ parameters (list Parameters
+ (object Parameter "property"
+ type "Property")
+ (object Parameter "value"
+ type "EBigInteger"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.setBigInteger(this, property, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "setBoolean"
+ quid "EDEDEEEE3002"
+ parameters (list Parameters
+ (object Parameter "property"
+ type "Property")
+ (object Parameter "value"
+ type "boolean"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.setBoolean(this, property, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "setByte"
+ quid "EDEDEEEE3003"
+ parameters (list Parameters
+ (object Parameter "property"
+ type "Property")
+ (object Parameter "value"
+ type "byte"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.setByte(this, property, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "setBytes"
+ quid "EDEDEEEE3004"
+ parameters (list Parameters
+ (object Parameter "property"
+ type "Property")
+ (object Parameter "value"
+ type "EByteArray"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.setBytes(this, property, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "setChar"
+ quid "EDEDEEEE3005"
+ parameters (list Parameters
+ (object Parameter "property"
+ type "Property")
+ (object Parameter "value"
+ type "char"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.setChar(this, property, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "setDataObject"
+ quid "EDEDEEEE3006"
+ parameters (list Parameters
+ (object Parameter "property"
+ type "Property")
+ (object Parameter "value"
+ type "DataObject"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.setDataObject(this, property, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "setDate"
+ quid "EDEDEEEE3007"
+ parameters (list Parameters
+ (object Parameter "property"
+ type "Property")
+ (object Parameter "value"
+ type "EDate"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.setDate(this, property, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "setDouble"
+ quid "EDEDEEEE3008"
+ parameters (list Parameters
+ (object Parameter "property"
+ type "Property")
+ (object Parameter "value"
+ type "double"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.setDouble(this, property, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "setFloat"
+ quid "EDEDEEEE3009"
+ parameters (list Parameters
+ (object Parameter "property"
+ type "Property")
+ (object Parameter "value"
+ type "float"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.setFloat(this, property, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "setInt"
+ quid "EDEDEEEE300A"
+ parameters (list Parameters
+ (object Parameter "property"
+ type "Property")
+ (object Parameter "value"
+ type "int"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.setInt(this, property, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "setList"
+ quid "EDEDEEEE300B"
+ parameters (list Parameters
+ (object Parameter "property"
+ type "Property")
+ (object Parameter "value"
+ type "EJavaList"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.setList(this, property, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "setLong"
+ quid "EDEDEEEE300C"
+ parameters (list Parameters
+ (object Parameter "property"
+ type "Property")
+ (object Parameter "value"
+ type "long"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.setLong(this, property, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "setShort"
+ quid "EDEDEEEE300E"
+ parameters (list Parameters
+ (object Parameter "property"
+ type "Property")
+ (object Parameter "value"
+ type "short"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.setShort(this, property, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "setString"
+ quid "EDEDEEEE300F"
+ parameters (list Parameters
+ (object Parameter "property"
+ type "Property")
+ (object Parameter "value"
+ type "String"))
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.setString(this, property, value);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "createDataObject"
+ quid "EDEDEEEEEEE0"
+ parameters (list Parameters
+ (object Parameter "propertyName"
+ type "String"))
+ result "DataObject"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.createDataObject(this, propertyName);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "createDataObject"
+ quid "EDEDEEEEEEE1"
+ parameters (list Parameters
+ (object Parameter "propertyIndex"
+ type "int"))
+ result "DataObject"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.createDataObject(this, propertyIndex);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "createDataObject"
+ quid "EDEDEEEEEEE2"
+ parameters (list Parameters
+ (object Parameter "property"
+ type "Property"))
+ result "DataObject"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.createDataObject(this, property);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "createDataObject"
+ quid "EDEDEEEEEEE3"
+ parameters (list Parameters
+ (object Parameter "propertyName"
+ type "String")
+ (object Parameter "namespaceURI"
+ type "String")
+ (object Parameter "typeName"
+ type "String"))
+ result "DataObject"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.createDataObject(this, propertyName, namespaceURI, typeName);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "createDataObject"
+ quid "EDEDEEEEEEE4"
+ parameters (list Parameters
+ (object Parameter "propertyIndex"
+ type "int")
+ (object Parameter "namespaceURI"
+ type "String")
+ (object Parameter "typeName"
+ type "String"))
+ result "DataObject"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.createDataObject(this, propertyIndex, namespaceURI, typeName);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "createDataObject"
+ quid "EDEDEEEEEEE5"
+ parameters (list Parameters
+ (object Parameter "property"
+ type "Property")
+ (object Parameter "type"
+ type "Type"))
+ result "DataObject"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.createDataObject(this, property, type);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "delete"
+ quid "EDEDEEEEEEE6"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.delete(this);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getSequence"
+ quid "4354FB2702D3"
+ result "Sequence"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getSequence(this);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getInstanceProperties"
+ quid "4354FB9F00CC"
+ result "EJavaList"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getInstanceProperties(this);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getProperty"
+ quid "4354FBB20369"
+ parameters (list Parameters
+ (object Parameter "propertyName"
+ type "String"))
+ result "Property"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getProperty(this, propertyName);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getRootObject"
+ quid "4354FBDD01B2"
+ result "DataObject"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getRootObject(this);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getChangeSummary"
+ quid "4354FC0400F0"
+ result "ChangeSummary"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "return <%org.apache.sdo.util.SDOUtil%>.getChangeSummary(this);")
+ opExportControl "Public"
+ uid 0)
+ (object Operation "detach"
+ quid "4354FC150068"
+ concurrency "Sequential"
+ semantics (object Semantic_Info
+ PDL "<%org.apache.sdo.util.SDOUtil%>.detach(this);")
+ opExportControl "Public"
+ uid 0))
+ class_attributes (list class_attribute_list
+ (object ClassAttribute "commonj.sdo.DataObject"
+ quid "3FAB6F8B0284"
+ stereotype "javaclass"
+ exportControl "Public"))
+ abstract TRUE)
+ (object Class "Property"
+ quid "3FAB7CA1031A"
+ stereotype "Interface"
+ operations (list Operations
+ (object Operation "getName"
+ quid "4357B5A1009C"
+ result "String"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getType"
+ quid "4358FF1A0291"
+ result "Type"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "isMany"
+ quid "4357B64B019A"
+ result "boolean"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "isContainment"
+ quid "4357B76501FA"
+ result "boolean"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "isReadOnly"
+ quid "4358FF3501DC"
+ result "boolean"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getContainingType"
+ quid "4358FF3C03D1"
+ result "Type"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getAliasNames"
+ quid "4358FF4D02EF"
+ result "EJavaList"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getOpposite"
+ quid "4358FF59013D"
+ result "Property"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getDefault"
+ quid "4358FF66029B"
+ result "EJavaObject"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0))
+ class_attributes (list class_attribute_list
+ (object ClassAttribute "commonj.sdo.Property"
+ quid "3FAB7CAB00E4"
+ stereotype "javaclass"
+ exportControl "Public")))
+ (object Class "Sequence"
+ quid "3FAB7CC302B5"
+ stereotype "Interface"
+ operations (list Operations
+ (object Operation "size"
+ quid "3FD1F958017D"
+ result "int"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getProperty"
+ quid "3FAC32F4028D"
+ parameters (list Parameters
+ (object Parameter "index"
+ type "int"))
+ result "Property"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getValue"
+ quid "3FAC3318010E"
+ parameters (list Parameters
+ (object Parameter "index"
+ type "int"))
+ result "EJavaObject"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "setValue"
+ quid "3FAC33270259"
+ parameters (list Parameters
+ (object Parameter "index"
+ type "int")
+ (object Parameter "value"
+ type "EJavaObject"))
+ result "EJavaObject"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "add"
+ quid "3FAC333D017C"
+ parameters (list Parameters
+ (object Parameter "propertyName"
+ type "String")
+ (object Parameter "value"
+ type "EJavaObject"))
+ result "boolean"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "add"
+ quid "3FAC3371009F"
+ parameters (list Parameters
+ (object Parameter "propertIndex"
+ type "int")
+ (object Parameter "value"
+ type "EJavaObject"))
+ result "boolean"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "add"
+ quid "3FAC338C00CE"
+ parameters (list Parameters
+ (object Parameter "property"
+ type "Property")
+ (object Parameter "value"
+ type "EJavaObject"))
+ result "boolean"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "add"
+ quid "3FAC33AD02C6"
+ parameters (list Parameters
+ (object Parameter "index"
+ type "int")
+ (object Parameter "propertyName"
+ type "String")
+ (object Parameter "value"
+ type "EJavaObject"))
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "add"
+ quid "3FAC33C40263"
+ parameters (list Parameters
+ (object Parameter "index"
+ type "int")
+ (object Parameter "propertyIndex"
+ type "int")
+ (object Parameter "value"
+ type "EJavaObject"))
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "add"
+ quid "3FAC33C70375"
+ parameters (list Parameters
+ (object Parameter "index"
+ type "int")
+ (object Parameter "property"
+ type "Property")
+ (object Parameter "value"
+ type "EJavaObject"))
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "add"
+ quid "43550F7D01DE"
+ parameters (list Parameters
+ (object Parameter "text"
+ type "String"))
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "add"
+ quid "43550F930352"
+ parameters (list Parameters
+ (object Parameter "index"
+ type "int")
+ (object Parameter "text"
+ type "String"))
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0))
+ class_attributes (list class_attribute_list
+ (object ClassAttribute "commonj.sdo.Sequence"
+ quid "3FAB7CEB00D2"
+ stereotype "javaclass"
+ exportControl "Public")))
+ (object Class "Type"
+ quid "3FAB7C7C0349"
+ stereotype "Interface"
+ operations (list Operations
+ (object Operation "getName"
+ quid "4357B56E012E"
+ result "String"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getURI"
+ quid "4358FE18013C"
+ result "String"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getInstanceClass"
+ quid "4357B6380265"
+ result "EJavaClass"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "isInstance"
+ quid "3FAB82AD0027"
+ parameters (list Parameters
+ (object Parameter "object"
+ type "EJavaObject"))
+ result "boolean"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "isDataType"
+ quid "4358FE26031D"
+ result "boolean"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "isSequenced"
+ quid "4358FE33020D"
+ result "boolean"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "isOpen"
+ quid "4358FE4000F3"
+ result "boolean"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "isAbstract"
+ quid "4357B7440365"
+ result "boolean"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getBaseTypes"
+ quid "4358FE4B0316"
+ result "EJavaList"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getAliasNames"
+ quid "4358FE740351"
+ result "EJavaList"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getProperties"
+ quid "4358FE8D0248"
+ result "EJavaList"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getDeclaredProperties"
+ quid "4358FE9C02A4"
+ result "EJavaList"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0)
+ (object Operation "getProperty"
+ quid "3FAB831701D8"
+ parameters (list Parameters
+ (object Parameter "propertyName"
+ type "String"))
+ result "Property"
+ concurrency "Sequential"
+ opExportControl "Public"
+ uid 0))
+ class_attributes (list class_attribute_list
+ (object ClassAttribute "commonj.sdo.Type"
+ quid "3FAB7C8B0015"
+ stereotype "javaclass"
+ exportControl "Public")))
+ (object Class "EJavaList"
+ quid "3FAB8A010237"
+ stereotype "datatype"
+ class_attributes (list class_attribute_list
+ (object ClassAttribute "java.util.List"
+ quid "3FAB8A0F01F1"
+ stereotype "javaclass"
+ exportControl "Public"))
+ abstract TRUE)
+ (object Class "EObjectStreamException"
+ quid "3FC352DE038F"
+ stereotype "datatype"
+ class_attributes (list class_attribute_list
+ (object ClassAttribute "java.io.ObjectStreamException"
+ quid "3FC352F90171"
+ stereotype "javaclass"
+ exportControl "Public"))
+ abstract TRUE)
+ (object Class "AnyTypeDataObject"
+ attributes (list Attribute_Set
+ (object Attribute
+ tool "Ecore"
+ name "xmlContentKind"
+ value ("ContentKind" 3)))
+ quid "4069645E0146"
+ superclasses (list inheritance_relationship_list
+ (object Inheritance_Relationship
+ quid "406964870375"
+ supplier "Logical View::type::AnyType"
+ quidu "40695FE40332")
+ (object Inheritance_Relationship
+ quid "436141F003E7"
+ stereotype "extend"
+ supplier "Logical View::sdo::DataObject"
+ quidu "3FAB6F7501C4")))
+ (object Class "SimpleAnyTypeDataObject"
+ attributes (list Attribute_Set
+ (object Attribute
+ tool "Ecore"
+ name "xmlContentKind"
+ value ("ContentKind" 2)))
+ quid "406964710189"
+ superclasses (list inheritance_relationship_list
+ (object Inheritance_Relationship
+ quid "4069648302E3"
+ stereotype "extend"
+ supplier "Logical View::sdo::AnyTypeDataObject"
+ quidu "4069645E0146")
+ (object Inheritance_Relationship
+ quid "4069648D02E8"
+ supplier "Logical View::type::SimpleAnyType"
+ quidu "406961210099")))
+ (object Class "Class"
+ quid "43559BB702E7"
+ superclasses (list inheritance_relationship_list
+ (object Inheritance_Relationship
+ quid "43559D3A01A3"
+ supplier "Logical View::ecore::EClass"
+ quidu "3903D5BF000A")
+ (object Inheritance_Relationship
+ quid "435901C600DC"
+ supplier "Logical View::sdo::Type"
+ quidu "3FAB7C7C0349"))
+ class_attributes (list class_attribute_list
+ (object ClassAttribute "commonj.sdo.Type"
+ quid "435900CF00F5"
+ stereotype "javaclass"
+ exportControl "Public")))
+ (object Class "DataType"
+ quid "43559BE502F7"
+ superclasses (list inheritance_relationship_list
+ (object Inheritance_Relationship
+ quid "43590C6F016D"
+ supplier "Logical View::sdo::Type"
+ quidu "3FAB7C7C0349")
+ (object Inheritance_Relationship
+ quid "43590C73038F"
+ supplier "Logical View::ecore::EDataType"
+ quidu "3903D525033E"))
+ class_attributes (list class_attribute_list
+ (object ClassAttribute "commonj.sdo.Type"
+ quid "4358FFE30331"
+ stereotype "javaclass"
+ exportControl "Public")))
+ (object Class "Attribute"
+ quid "43559E690004"
+ superclasses (list inheritance_relationship_list
+ (object Inheritance_Relationship
+ quid "43559ED801E4"
+ supplier "Logical View::ecore::EAttribute"
+ quidu "39238472039D")
+ (object Inheritance_Relationship
+ quid "43567DFD03B6"
+ supplier "Logical View::sdo::Property"
+ quidu "3FAB7CA1031A"))
+ class_attributes (list class_attribute_list
+ (object ClassAttribute "commonj.sdo.Property"
+ quid "4359014A0246"
+ stereotype "javaclass"
+ exportControl "Public")))
+ (object Class "Reference"
+ quid "43559E86025E"
+ superclasses (list inheritance_relationship_list
+ (object Inheritance_Relationship
+ quid "43559EE0011D"
+ supplier "Logical View::ecore::EReference"
+ quidu "39238479039D")
+ (object Inheritance_Relationship
+ quid "43567DF9022A"
+ supplier "Logical View::sdo::Property"
+ quidu "3FAB7CA1031A"))
+ class_attributes (list class_attribute_list
+ (object ClassAttribute "commonj.sdo.Property"
+ quid "4359018E0226"
+ stereotype "javaclass"
+ exportControl "Public")))
+ (object Class "Enum"
+ quid "4357B1010017"
+ superclasses (list inheritance_relationship_list
+ (object Inheritance_Relationship
+ quid "4357B1410218"
+ supplier "Logical View::sdo::Type"
+ quidu "3FAB7C7C0349")
+ (object Inheritance_Relationship
+ quid "4357B14701DA"
+ supplier "Logical View::ecore::EEnum"
+ quidu "39A473E901D4"))
+ class_attributes (list class_attribute_list
+ (object ClassAttribute "commonj.sdo.Type"
+ quid "4359006102CE"
+ stereotype "javaclass"
+ exportControl "Public")))
+ (object Class "DynamicDataObject"
+ quid "435E94210124"
+ superclasses (list inheritance_relationship_list
+ (object Inheritance_Relationship
+ quid "435E9435008D"
+ supplier "Logical View::sdo::DataObject"
+ quidu "3FAB6F7501C4"))
+ class_attributes (list class_attribute_list
+ (object ClassAttribute "commonj.sdo.DataObject"
+ quid "435E9459021F"
+ stereotype "javaclass"
+ exportControl "Public")))
+ (object Class "StoreDataObject"
+ quid "43621EBA03B4"
+ superclasses (list inheritance_relationship_list
+ (object Inheritance_Relationship
+ quid "43621F0B03A6"
+ supplier "Logical View::sdo::DataObject"
+ quidu "3FAB6F7501C4"))
+ class_attributes (list class_attribute_list
+ (object ClassAttribute "commonj.sdo.DataObject"
+ quid "43621EDF015E"
+ stereotype "javaclass"
+ exportControl "Public")))
+ (object Class "DynamicStoreDataObject"
+ quid "43621F4203CD"
+ superclasses (list inheritance_relationship_list
+ (object Inheritance_Relationship
+ quid "43621F920242"
+ supplier "Logical View::sdo::StoreDataObject"
+ quidu "43621EBA03B4"))
+ class_attributes (list class_attribute_list
+ (object ClassAttribute "commonj.sdo.DataObject"
+ quid "43621F5701ED"
+ stereotype "javaclass"
+ exportControl "Public")))
+ (object Association "$UNNAMED$0"
+ quid "3FAD10CA01D5"
+ roles (list role_list
+ (object Role "eDataGraph"
+ attributes (list Attribute_Set
+ (object Attribute
+ tool "Ecore"
+ name "isResolveProxies"
+ value FALSE)
+ (object Attribute
+ tool "Ecore"
+ name "isTransient"
+ value TRUE))
+ quid "3FAD10CC001F"
+ label "eDataGraph"
+ supplier "Logical View::sdo::DataGraph"
+ quidu "3FAB7BFE03C0"
+ client_cardinality (value cardinality "1")
+ is_navigable TRUE)
+ (object Role "eChangeSummary"
+ attributes (list Attribute_Set
+ (object Attribute
+ tool "Ecore"
+ name "isResolveProxies"
+ value FALSE))
+ quid "3FAD10CC0020"
+ label "eChangeSummary"
+ supplier "Logical View::sdo::ChangeSummary"
+ quidu "3FAB7C360208"
+ client_cardinality (value cardinality "1")
+ Containment "By Value"
+ is_navigable TRUE)))
+ (object Association "$UNNAMED$1"
+ quid "3FAD26E802F5"
+ roles (list role_list
+ (object Role "$UNNAMED$2"
+ quid "3FAD26ED00E9"
+ supplier "Logical View::sdo::DataGraph"
+ quidu "3FAB7BFE03C0")
+ (object Role "eRootObject"
+ attributes (list Attribute_Set
+ (object Attribute
+ tool "Ecore"
+ name "isResolveProxies"
+ value FALSE))
+ quid "3FAD26ED00F3"
+ label "eRootObject"
+ supplier "Logical View::ecore::EObject"
+ quidu "3C4F1C860123"
+ client_cardinality (value cardinality "1")
+ is_navigable TRUE)))
+ (object Association "$UNNAMED$3"
+ quid "406962A200CF"
+ roles (list role_list
+ (object Role "$UNNAMED$4"
+ quid "406962A30076"
+ supplier "Logical View::type::SimpleAnyType"
+ quidu "406961210099")
+ (object Role "instanceType"
+ attributes (list Attribute_Set
+ (object Attribute
+ tool "Ecore"
+ name "isResolveProxies"
+ value FALSE))
+ quid "406962A30077"
+ label "instanceType"
+ supplier "Logical View::ecore::EDataType"
+ quidu "3903D525033E"
+ client_cardinality (value cardinality "1")
+ is_navigable TRUE))))
+ logical_presentations (list unit_reference_list
+ (object ClassDiagram "SDO Interfaces"
+ quid "3FAB8BAA0329"
+ title "SDO Interfaces"
+ zoom 100
+ max_height 28350
+ max_width 21600
+ origin_x 764
+ origin_y 0
+ items (list diagram_item_list
+ (object ClassView "Class" "Logical View::sdo::Sequence" @1
+ ShowCompartmentStereotypes TRUE
+ IncludeAttribute TRUE
+ IncludeOperation TRUE
+ ShowOperationSignature TRUE
+ location (2560, 2032)
+ label (object ItemLabel
+ Parent_View @1
+ location (1999, 1673)
+ fill_color 13434879
+ nlines 1
+ max_width 1122
+ justify 0
+ label "Sequence")
+ stereotype (object ItemLabel
+ Parent_View @1
+ location (1999, 1623)
+ fill_color 13434879
+ anchor 10
+ nlines 1
+ max_width 1122
+ justify 0
+ label "<<Interface>>")
+ icon "Interface"
+ icon_style "Label"
+ line_color 3342489
+ fill_color 13434879
+ quidu "3FAB7CC302B5"
+ compartment (object Compartment
+ Parent_View @1
+ location (1999, 1733)
+ icon_style "Icon"
+ fill_color 16777215
+ anchor 2
+ nlines 14
+ max_width 1128)
+ width 1140
+ height 842
+ annotation 8
+ autoResize TRUE)
+ (object ClassView "Class" "Logical View::sdo::DataGraph" @2
+ ShowCompartmentStereotypes TRUE
+ IncludeAttribute TRUE
+ IncludeOperation TRUE
+ ShowOperationSignature TRUE
+ location (768, 304)
+ label (object ItemLabel
+ Parent_View @2
+ location (65, 48)
+ fill_color 13434879
+ nlines 1
+ max_width 1406
+ justify 0
+ label "DataGraph")
+ icon_style "Icon"
+ line_color 3342489
+ fill_color 13434879
+ quidu "3FAB7BFE03C0"
+ compartment (object Compartment
+ Parent_View @2
+ location (65, 108)
+ icon_style "Icon"
+ fill_color 16777215
+ anchor 2
+ nlines 9
+ max_width 1412)
+ width 1424
+ height 536
+ annotation 8
+ autoResize TRUE)
+ (object ClassView "Class" "Logical View::sdo::DataObject" @3
+ ShowCompartmentStereotypes TRUE
+ IncludeAttribute TRUE
+ ShowOperationSignature TRUE
+ location (976, 1280)
+ font (object Font
+ italics TRUE)
+ label (object ItemLabel
+ Parent_View @3
+ location (62, 674)
+ fill_color 13434879
+ nlines 1
+ max_width 1828
+ justify 0
+ label "DataObject")
+ icon_style "Icon"
+ line_color 3342489
+ fill_color 13434879
+ quidu "3FAB6F7501C4"
+ compartment (object Compartment
+ Parent_View @3
+ location (62, 734)
+ icon_style "Icon"
+ fill_color 13434879
+ anchor 2
+ nlines 23
+ max_width 1834
+ compartmentItems (list Compartment
+ "+ get(property : Property) : EJavaObject"
+ "+ set(property : Property, value : EJavaObject)"
+ "+ isSet(property : Property) : boolean"
+ "+ unset(property : Property)"
+ "+ getContainer() : DataObject"
+ "+ getContainmentProperty() : Property"
+ "+ getDataGraph() : DataGraph"
+ "+ getType() : Type"
+ "+ createDataObject(propertyName : String) : DataObject"
+ "+ createDataObject(propertyIndex : int) : DataObject"
+ "+ createDataObject(property : Property) : DataObject"
+ "+ createDataObject(propertyName : String, namespaceURI : String, typeName : String) : DataObject"
+ "+ createDataObject(propertyIndex : int, namespaceURI : String, typeName : String) : DataObject"
+ "+ createDataObject(property : Property, type : Type) : DataObject"
+ "+ delete()"
+ "+ getSequence() : Sequence"
+ "+ getInstanceProperties() : EJavaList"
+ "+ getProperty(propertyName : String) : Property"
+ "+ getRootObject() : DataObject"
+ "+ getChangeSummary() : ChangeSummary"
+ "+ detach()"))
+ width 1846
+ height 1236
+ annotation 8
+ autoResize TRUE)
+ (object ClassView "Class" "Logical View::sdo::ChangeSummary" @4
+ ShowCompartmentStereotypes TRUE
+ IncludeAttribute TRUE
+ IncludeOperation TRUE
+ ShowOperationSignature TRUE
+ location (2768, 528)
+ label (object ItemLabel
+ Parent_View @4
+ location (1979, 72)
+ fill_color 13434879
+ nlines 1
+ max_width 1578
+ justify 0
+ label "ChangeSummary")
+ icon_style "Icon"
+ line_color 3342489
+ fill_color 13434879
+ quidu "3FAB7C360208"
+ compartment (object Compartment
+ Parent_View @4
+ location (1979, 132)
+ icon_style "Icon"
+ fill_color 16777215
+ anchor 2
+ nlines 17
+ max_width 1575)
+ width 1596
+ height 936
+ annotation 8
+ autoResize TRUE)
+ (object ClassView "Class" "Logical View::sdo::Type" @5
+ ShowCompartmentStereotypes TRUE
+ IncludeAttribute TRUE
+ IncludeOperation TRUE
+ ShowOperationSignature TRUE
+ location (512, 2448)
+ label (object ItemLabel
+ Parent_View @5
+ location (75, 2064)
+ fill_color 13434879
+ nlines 1
+ max_width 874
+ justify 0
+ label "Type")
+ stereotype (object ItemLabel
+ Parent_View @5
+ location (75, 2014)
+ fill_color 13434879
+ anchor 10
+ nlines 1
+ max_width 874
+ justify 0
+ label "<<Interface>>")
+ icon "Interface"
+ icon_style "Label"
+ line_color 3342489
+ fill_color 13434879
+ quidu "3FAB7C7C0349"
+ compartment (object Compartment
+ Parent_View @5
+ location (75, 2124)
+ icon_style "Icon"
+ fill_color 16777215
+ anchor 2
+ nlines 15
+ max_width 881)
+ width 892
+ height 892
+ annotation 8
+ autoResize TRUE)
+ (object ClassView "Class" "Logical View::sdo::Property" @6
+ ShowCompartmentStereotypes TRUE
+ IncludeAttribute TRUE
+ IncludeOperation TRUE
+ ShowOperationSignature TRUE
+ location (1424, 2352)
+ label (object ItemLabel
+ Parent_View @6
+ location (1054, 2068)
+ fill_color 13434879
+ nlines 1
+ max_width 740
+ justify 0
+ label "Property")
+ stereotype (object ItemLabel
+ Parent_View @6
+ location (1054, 2018)
+ fill_color 13434879
+ anchor 10
+ nlines 1
+ max_width 740
+ justify 0
+ label "<<Interface>>")
+ icon "Interface"
+ icon_style "Label"
+ line_color 3342489
+ fill_color 13434879
+ quidu "3FAB7CA1031A"
+ compartment (object Compartment
+ Parent_View @6
+ location (1054, 2128)
+ icon_style "Icon"
+ fill_color 16777215
+ anchor 2
+ nlines 11
+ max_width 746)
+ width 758
+ height 692
+ annotation 8
+ autoResize TRUE)
+ (object ClassView "Class" "Logical View::sdo::ChangeSummarySetting" @7
+ ShowCompartmentStereotypes TRUE
+ IncludeAttribute TRUE
+ IncludeOperation TRUE
+ ShowOperationSignature TRUE
+ location (2528, 1328)
+ label (object ItemLabel
+ Parent_View @7
+ location (2003, 1144)
+ fill_color 13434879
+ nlines 1
+ max_width 1050
+ justify 0
+ label "ChangeSummarySetting")
+ icon_style "Icon"
+ line_color 3342489
+ fill_color 13434879
+ quidu "3FAB8BF8005A"
+ compartment (object Compartment
+ Parent_View @7
+ location (2003, 1204)
+ icon_style "Icon"
+ fill_color 16777215
+ anchor 2
+ nlines 5
+ max_width 1056)
+ width 1068
+ height 392
+ annotation 8
+ autoResize TRUE)))
+ (object ClassDiagram "SDO DataObject Access"
+ quid "3FAC2D8D008D"
+ title "SDO DataObject Access"
+ zoom 100
+ max_height 28350
+ max_width 21600
+ origin_x 0
+ origin_y 0
+ items (list diagram_item_list
+ (object ClassView "Class" "Logical View::sdo::DataObject" @8
+ ShowCompartmentStereotypes TRUE
+ IncludeAttribute TRUE
+ ShowOperationSignature TRUE
+ location (528, 1360)
+ font (object Font
+ italics TRUE)
+ label (object ItemLabel
+ Parent_View @8
+ location (53, 79)
+ fill_color 13434879
+ nlines 1
+ max_width 950
+ justify 0
+ label "DataObject")
+ icon_style "Icon"
+ line_color 3342489
+ fill_color 16316638
+ quidu "3FAB6F7501C4"
+ compartment (object Compartment
+ Parent_View @8
+ location (53, 139)
+ icon_style "Icon"
+ fill_color 13434879
+ anchor 2
+ nlines 50
+ max_width 0
+ compartmentItems (list Compartment
+ "+ getBigDecimal(path : String) : EBigDecimal"
+ "+ getBigInteger(path : String) : EBigInteger"
+ "+ getBoolean(path : String) : boolean"
+ "+ getByte(path : String) : byte"
+ "+ getBytes(path : String) : EByteArray"
+ "+ getChar(path : String) : char"
+ "+ getDataObject(path : String) : DataObject"
+ "+ getDate(path : String) : EDate"
+ "+ getDouble(path : String) : double"
+ "+ getFloat(path : String) : float"
+ "+ getInt(path : String) : int"
+ "+ getList(path : String) : EJavaList"
+ "+ getLong(path : String) : long"
+ "+ getSequence(path : String) : Sequence"
+ "+ getShort(path : String) : short"
+ "+ getString(path : String) : String"
+ "+ getBigDecimal(propertyIndex : int) : EBigDecimal"
+ "+ getBigInteger(propertyIndex : int) : EBigInteger"
+ "+ getBoolean(propertyIndex : int) : boolean"
+ "+ getByte(propertyIndex : int) : byte"
+ "+ getBytes(propertyIndex : int) : EByteArray"
+ "+ getChar(propertyIndex : int) : char"
+ "+ getDataObject(propertyIndex : int) : DataObject"
+ "+ getDate(propertyIndex : int) : EDate"
+ "+ getDouble(propertyIndex : int) : double"
+ "+ getFloat(propertyIndex : int) : float"
+ "+ getInt(propertyIndex : int) : int"
+ "+ getList(propertyIndex : int) : EJavaList"
+ "+ getLong(propertyIndex : int) : long"
+ "+ getSequence(propertyIndex : int) : Sequence"
+ "+ getShort(propertyIndex : int) : short"
+ "+ getString(propertyIndex : int) : String"
+ "+ getBigDecimal(property : Property) : EBigDecimal"
+ "+ getBigInteger(property : Property) : EBigInteger"
+ "+ getBoolean(property : Property) : boolean"
+ "+ getByte(property : Property) : byte"
+ "+ getBytes(property : Property) : EByteArray"
+ "+ getChar(property : Property) : char"
+ "+ getDataObject(property : Property) : DataObject"
+ "+ getDate(property : Property) : EDate"
+ "+ getDouble(property : Property) : double"
+ "+ getFloat(property : Property) : float"
+ "+ getInt(property : Property) : int"
+ "+ getList(property : Property) : EJavaList"
+ "+ getLong(property : Property) : long"
+ "+ getSequence(property : Property) : Sequence"
+ "+ getShort(property : Property) : short"
+ "+ getString(property : Property) : String"
+ "<<javaclass>> + commonj.sdo.DataObject"))
+ width 968
+ height 2586
+ annotation 8
+ autoResize TRUE)
+ (object ClassView "Class" "Logical View::sdo::DataObject" @9
+ ShowCompartmentStereotypes TRUE
+ IncludeAttribute TRUE
+ ShowOperationSignature TRUE
+ location (1664, 1280)
+ font (object Font
+ italics TRUE)
+ label (object ItemLabel
+ Parent_View @9
+ location (1131, 74)
+ fill_color 13434879
+ nlines 1
+ max_width 1066
+ justify 0
+ label "DataObject")
+ icon_style "Icon"
+ line_color 3342489
+ fill_color 16316638
+ quidu "3FAB6F7501C4"
+ compartment (object Compartment
+ Parent_View @9
+ location (1131, 134)
+ icon_style "Icon"
+ fill_color 13434879
+ anchor 2
+ nlines 47
+ max_width 0
+ compartmentItems (list Compartment
+ "+ setBigDecimal(path : String, value : EBigDecimal)"
+ "+ setBigInteger(path : String, value : EBigInteger)"
+ "+ setBoolean(path : String, value : boolean)"
+ "+ setByte(path : String, value : byte)"
+ "+ setBytes(path : String, value : EByteArray)"
+ "+ setChar(path : String, value : char)"
+ "+ setDataObject(path : String, value : DataObject)"
+ "+ setDate(path : String, value : EDate)"
+ "+ setDouble(path : String, value : double)"
+ "+ setFloat(path : String, value : float)"
+ "+ setInt(path : String, value : int)"
+ "+ setList(path : String, value : EJavaList)"
+ "+ setLong(path : String, value : long)"
+ "+ setShort(path : String, value : short)"
+ "+ setString(path : String, value : String)"
+ "+ setBigDecimal(propertyIndex : int, value : EBigDecimal)"
+ "+ setBigInteger(propertyIndex : int, value : EBigInteger)"
+ "+ setBoolean(propertyIndex : int, value : boolean)"
+ "+ setByte(propertyIndex : int, value : byte)"
+ "+ setBytes(propertyIndex : int, value : EByteArray)"
+ "+ setChar(propertyIndex : int, value : char)"
+ "+ setDataObject(propertyIndex : int, value : DataObject)"
+ "+ setDate(propertyIndex : int, value : EDate)"
+ "+ setDouble(propertyIndex : int, value : double)"
+ "+ setFloat(propertyIndex : int, value : float)"
+ "+ setInt(propertyIndex : int, value : int)"
+ "+ setList(propertyIndex : int, value : EJavaList)"
+ "+ setLong(propertyIndex : int, value : long)"
+ "+ setShort(propertyIndex : int, value : short)"
+ "+ setString(propertyIndex : int, value : String)"
+ "+ setBigDecimal(property : Property, value : EBigDecimal)"
+ "+ setBigInteger(property : Property, value : EBigInteger)"
+ "+ setBoolean(property : Property, value : boolean)"
+ "+ setByte(property : Property, value : byte)"
+ "+ setBytes(property : Property, value : EByteArray)"
+ "+ setChar(property : Property, value : char)"
+ "+ setDataObject(property : Property, value : DataObject)"
+ "+ setDate(property : Property, value : EDate)"
+ "+ setDouble(property : Property, value : double)"
+ "+ setFloat(property : Property, value : float)"
+ "+ setInt(property : Property, value : int)"
+ "+ setList(property : Property, value : EJavaList)"
+ "+ setLong(property : Property, value : long)"
+ "+ setShort(property : Property, value : short)"
+ "+ setString(property : Property, value : String)"
+ "<<javaclass>> + commonj.sdo.DataObject"))
+ width 1084
+ height 2436
+ annotation 8
+ autoResize TRUE)))
+ (object ClassDiagram "Ecore SDO"
+ quid "3FAC379A02D5"
+ title "Ecore SDO"
+ zoom 100
+ max_height 28350
+ max_width 21600
+ origin_x 0
+ origin_y 0
+ items (list diagram_item_list
+ (object ClassView "Class" "Logical View::sdo::DataGraph" @10
+ ShowCompartmentStereotypes TRUE
+ SuppressOperation TRUE
+ location (464, 160)
+ label (object ItemLabel
+ Parent_View @10
+ location (74, 104)
+ fill_color 13434879
+ nlines 1
+ max_width 780
+ justify 0
+ label "DataGraph")
+ icon_style "Icon"
+ line_color 3342489
+ fill_color 13434879
+ quidu "3FAB7BFE03C0"
+ compartment (object Compartment
+ Parent_View @10
+ location (74, 164)
+ icon_style "Icon"
+ fill_color 13434879
+ anchor 2
+ nlines 1
+ max_width 0
+ compartmentItems (list Compartment
+ "<<javaclass>> + commonj.sdo.DataGraph"))
+ width 798
+ height 136
+ annotation 8
+ autoResize TRUE)
+ (object ClassView "Class" "Logical View::sdo::ChangeSummary" @11
+ ShowCompartmentStereotypes TRUE
+ SuppressOperation TRUE
+ location (528, 400)
+ label (object ItemLabel
+ Parent_View @11
+ location (78, 344)
+ fill_color 13434879
+ nlines 1
+ max_width 900
+ justify 0
+ label "ChangeSummary")
+ icon_style "Icon"
+ line_color 3342489
+ fill_color 13434879
+ quidu "3FAB7C360208"
+ compartment (object Compartment
+ Parent_View @11
+ location (78, 404)
+ icon_style "Icon"
+ fill_color 13434879
+ anchor 2
+ nlines 1
+ max_width 0
+ compartmentItems (list Compartment
+ "<<javaclass>> + commonj.sdo.ChangeSummary"))
+ width 918
+ height 136
+ annotation 8
+ autoResize TRUE)
+ (object ClassView "Class" "Logical View::sdo::Type" @12
+ ShowCompartmentStereotypes TRUE
+ SuppressOperation TRUE
+ location (416, 1088)
+ label (object ItemLabel
+ Parent_View @12
+ location (79, 1054)
+ fill_color 13434879
+ nlines 1
+ max_width 674
+ justify 0
+ label "Type")
+ stereotype (object ItemLabel
+ Parent_View @12
+ location (79, 1004)
+ fill_color 13434879
+ anchor 10
+ nlines 1
+ max_width 674
+ justify 0
+ label "<<Interface>>")
+ icon "Interface"
+ icon_style "Label"
+ line_color 3342489
+ fill_color 13434879
+ quidu "3FAB7C7C0349"
+ compartment (object Compartment
+ Parent_View @12
+ location (79, 1114)
+ icon_style "Icon"
+ fill_color 13434879
+ anchor 2
+ nlines 1
+ max_width 0
+ compartmentItems (list Compartment
+ "<<javaclass>> + commonj.sdo.Type"))
+ width 692
+ height 192
+ annotation 8
+ autoResize TRUE)
+ (object ClassView "Class" "Logical View::sdo::Property" @13
+ ShowCompartmentStereotypes TRUE
+ SuppressOperation TRUE
+ location (448, 1648)
+ label (object ItemLabel
+ Parent_View @13
+ location (78, 1614)
+ fill_color 13434879
+ nlines 1
+ max_width 740
+ justify 0
+ label "Property")
+ stereotype (object ItemLabel
+ Parent_View @13
+ location (78, 1564)
+ fill_color 13434879
+ anchor 10
+ nlines 1
+ max_width 740
+ justify 0
+ label "<<Interface>>")
+ icon "Interface"
+ icon_style "Label"
+ line_color 3342489
+ fill_color 13434879
+ quidu "3FAB7CA1031A"
+ compartment (object Compartment
+ Parent_View @13
+ location (78, 1674)
+ icon_style "Icon"
+ fill_color 13434879
+ anchor 2
+ nlines 1
+ max_width 0
+ compartmentItems (list Compartment
+ "<<javaclass>> + commonj.sdo.Property"))
+ width 758
+ height 192
+ annotation 8
+ autoResize TRUE)
+ (object ClassView "Class" "Logical View::sdo::ChangeSummarySetting" @14
+ ShowCompartmentStereotypes TRUE
+ SuppressOperation TRUE
+ IncludeOperation TRUE
+ location (608, 640)
+ label (object ItemLabel
+ Parent_View @14
+ location (83, 584)
+ fill_color 13434879
+ nlines 1
+ max_width 1050
+ justify 0
+ label "ChangeSummarySetting")
+ icon_style "Icon"
+ line_color 3342489
+ fill_color 13434879
+ quidu "3FAB8BF8005A"
+ compartment (object Compartment
+ Parent_View @14
+ location (83, 644)
+ icon_style "Icon"
+ fill_color 13434879
+ anchor 2
+ nlines 1
+ max_width 0
+ compartmentItems (list Compartment
+ "<<javaclass>> + commonj.sdo.ChangeSummary$Setting"))
+ width 1068
+ height 136
+ annotation 8
+ autoResize TRUE)
+ (object ClassView "Class" "Logical View::change::ChangeDescription" @15
+ ShowCompartmentStereotypes TRUE
+ SuppressAttribute TRUE
+ SuppressOperation TRUE
+ IncludeAttribute TRUE
+ IncludeOperation TRUE
+ location (2496, 400)
+ label (object ItemLabel
+ Parent_View @15
+ location (2311, 350)
+ fill_color 13434879
+ nlines 1
+ max_width 370
+ justify 0
+ label "ChangeDescription")
+ icon_style "Icon"
+ line_color 3342489
+ fill_color 13434879
+ quidu "4FAB6F110198"
+ width 388
+ height 124
+ annotation 8
+ autoResize TRUE)
+ (object ClassView "Class" "Logical View::ecore::EObject" @16
+ ShowCompartmentStereotypes TRUE
+ SuppressAttribute TRUE
+ SuppressOperation TRUE
+ location (2592, 160)
+ label (object ItemLabel
+ Parent_View @16
+ location (2503, 110)
+ fill_color 13434879
+ nlines 1
+ max_width 178
+ justify 0
+ label "EObject")
+ icon_style "Icon"
+ line_color 3342489
+ fill_color 13434879
+ quidu "3C4F1C860123"
+ width 196
+ height 124
+ annotation 8
+ autoResize TRUE)
+ (object ClassView "Class" "Logical View::change::FeatureChange" @17
+ ShowCompartmentStereotypes TRUE
+ SuppressAttribute TRUE
+ SuppressOperation TRUE
+ IncludeAttribute TRUE
+ IncludeOperation TRUE
+ location (2528, 640)
+ label (object ItemLabel
+ Parent_View @17
+ location (2374, 590)
+ fill_color 13434879
+ nlines 1
+ max_width 308
+ justify 0
+ label "FeatureChange")
+ icon_style "Icon"
+ line_color 3342489
+ fill_color 13434879
+ quidu "4FC39D6D0177"
+ width 326
+ height 124
+ annotation 8
+ autoResize TRUE)
+ (object ClassView "Class" "Logical View::sdo::Class" @18
+ ShowCompartmentStereotypes TRUE
+ SuppressOperation TRUE
+ IncludeAttribute TRUE
+ IncludeOperation TRUE
+ location (1648, 1296)
+ label (object ItemLabel
+ Parent_View @18
+ location (1311, 1241)
+ fill_color 13434879
+ nlines 1
+ max_width 674
+ justify 0
+ label "Class")
+ icon_style "Icon"
+ line_color 3342489
+ fill_color 13434879
+ quidu "43559BB702E7"
+ width 692
+ height 134
+ annotation 8)
+ (object ClassView "Class" "Logical View::sdo::DataType" @19
+ ShowCompartmentStereotypes TRUE
+ SuppressOperation TRUE
+ IncludeAttribute TRUE
+ IncludeOperation TRUE
+ location (1648, 880)
+ label (object ItemLabel
+ Parent_View @19
+ location (1311, 825)
+ fill_color 13434879
+ nlines 1
+ max_width 674
+ justify 0
+ label "DataType")
+ icon_style "Icon"
+ line_color 3342489
+ fill_color 13434879
+ quidu "43559BE502F7"
+ width 692
+ height 134
+ annotation 8)
+ (object ClassView "Class" "Logical View::ecore::EClass" @20
+ ShowCompartmentStereotypes TRUE
+ SuppressAttribute TRUE
+ SuppressOperation TRUE
+ IncludeAttribute TRUE
+ IncludeOperation TRUE
+ location (2592, 1296)
+ label (object ItemLabel
+ Parent_View @20
+ location (2502, 1246)
+ fill_color 13434879
+ nlines 1
+ max_width 181
+ justify 0
+ label "EClass")
+ icon_style "Icon"
+ line_color 3342489
+ fill_color 13434879
+ quidu "3903D5BF000A"
+ width 199
+ height 124
+ annotation 8)
+ (object ClassView "Class" "Logical View::ecore::EDataType" @21
+ ShowCompartmentStereotypes TRUE
+ SuppressAttribute TRUE
+ SuppressOperation TRUE
+ IncludeAttribute TRUE
+ IncludeOperation TRUE
+ location (2560, 880)
+ label (object ItemLabel
+ Parent_View @21
+ location (2444, 830)
+ fill_color 13434879
+ nlines 1
+ max_width 232
+ justify 0
+ label "EDataType")
+ icon_style "Icon"
+ line_color 3342489
+ fill_color 13434879
+ quidu "3903D525033E"
+ width 250
+ height 124
+ annotation 8)
+ (object ClassView "Class" "Logical View::sdo::Attribute" @22
+ ShowCompartmentStereotypes TRUE
+ SuppressOperation TRUE
+ IncludeAttribute TRUE
+ IncludeOperation TRUE
+ location (1664, 1536)
+ label (object ItemLabel
+ Parent_View @22
+ location (1294, 1481)
+ fill_color 13434879
+ nlines 1
+ max_width 740
+ justify 0
+ label "Attribute")
+ icon_style "Icon"
+ line_color 3342489
+ fill_color 13434879
+ quidu "43559E690004"
+ width 758
+ height 134
+ annotation 8)
+ (object ClassView "Class" "Logical View::sdo::Reference" @23
+ ShowCompartmentStereotypes TRUE
+ SuppressOperation TRUE
+ IncludeAttribute TRUE
+ IncludeOperation TRUE
+ location (1664, 1760)
+ label (object ItemLabel
+ Parent_View @23
+ location (1294, 1705)
+ fill_color 13434879
+ nlines 1
+ max_width 740
+ justify 0
+ label "Reference")
+ icon_style "Icon"
+ line_color 3342489
+ fill_color 13434879
+ quidu "43559E86025E"
+ width 758
+ height 134
+ annotation 8)
+ (object ClassView "Class" "Logical View::ecore::EAttribute" @24
+ ShowCompartmentStereotypes TRUE
+ SuppressAttribute TRUE
+ SuppressOperation TRUE
+ IncludeAttribute TRUE
+ IncludeOperation TRUE
+ location (2576, 1536)
+ label (object ItemLabel
+ Parent_View @24
+ location (2470, 1486)
+ fill_color 13434879
+ nlines 1
+ max_width 212
+ justify 0
+ label "EAttribute")
+ icon_style "Icon"
+ line_color 3342489
+ fill_color 13434879
+ quidu "39238472039D"
+ width 230
+ height 124
+ annotation 8)
+ (object ClassView "Class" "Logical View::ecore::EReference" @25
+ ShowCompartmentStereotypes TRUE
+ SuppressAttribute TRUE
+ SuppressOperation TRUE
+ IncludeAttribute TRUE
+ IncludeOperation TRUE
+ location (2576, 1760)
+ label (object ItemLabel
+ Parent_View @25
+ location (2458, 1710)
+ fill_color 13434879
+ nlines 1
+ max_width 236
+ justify 0
+ label "EReference")
+ icon_style "Icon"
+ line_color 3342489
+ fill_color 13434879
+ quidu "39238479039D"
+ width 254
+ height 124
+ annotation 8)
+ (object InheritView "" @26
+ stereotype TRUE
+ line_color 3342489
+ quidu "43559ED801E4"
+ client @22
+ supplier @24
+ line_style 0)
+ (object InheritView "" @27
+ stereotype TRUE
+ line_color 3342489
+ quidu "43559EE0011D"
+ client @23
+ supplier @25
+ line_style 0)
+ (object InheritView "" @28
+ stereotype TRUE
+ line_color 3342489
+ quidu "43567DF9022A"
+ client @23
+ supplier @13
+ line_style 0)
+ (object InheritView "" @29
+ stereotype TRUE
+ line_color 3342489
+ quidu "43567DFD03B6"
+ client @22
+ supplier @13
+ line_style 0)
+ (object ClassView "Class" "Logical View::sdo::Enum" @30
+ ShowCompartmentStereotypes TRUE
+ SuppressOperation TRUE
+ IncludeAttribute TRUE
+ IncludeOperation TRUE
+ location (1648, 1088)
+ label (object ItemLabel
+ Parent_View @30
+ location (1311, 1033)
+ fill_color 13434879
+ nlines 1
+ max_width 674
+ justify 0
+ label "Enum")
+ icon_style "Icon"
+ line_color 3342489
+ fill_color 13434879
+ quidu "4357B1010017"
+ width 692
+ height 134
+ annotation 8)
+ (object ClassView "Class" "Logical View::ecore::EEnum" @31
+ ShowCompartmentStereotypes TRUE
+ SuppressAttribute TRUE
+ SuppressOperation TRUE
+ IncludeAttribute TRUE
+ IncludeOperation TRUE
+ location (2592, 1088)
+ label (object ItemLabel
+ Parent_View @31
+ location (2502, 1038)
+ fill_color 13434879
+ nlines 1
+ max_width 181
+ justify 0
+ label "EEnum")
+ icon_style "Icon"
+ line_color 3342489
+ fill_color 13434879
+ quidu "39A473E901D4"
+ width 199
+ height 124
+ annotation 8)
+ (object InheritView "" @32
+ stereotype TRUE
+ line_color 3342489
+ quidu "4357B1410218"
+ client @30
+ supplier @12
+ line_style 0)
+ (object InheritView "" @33
+ stereotype TRUE
+ line_color 3342489
+ quidu "4357B14701DA"
+ client @30
+ supplier @31
+ line_style 0)
+ (object InheritView "" @34
+ stereotype TRUE
+ line_color 3342489
+ quidu "43559D3A01A3"
+ client @18
+ supplier @20
+ line_style 0)
+ (object InheritView "" @35
+ stereotype TRUE
+ line_color 3342489
+ quidu "435901C600DC"
+ client @18
+ supplier @12
+ line_style 0)
+ (object InheritView "" @36
+ stereotype TRUE
+ line_color 3342489
+ quidu "43590C6F016D"
+ client @19
+ supplier @12
+ line_style 0)
+ (object InheritView "" @37
+ stereotype TRUE
+ line_color 3342489
+ quidu "43590C73038F"
+ client @19
+ supplier @21
+ line_style 0)
+ (object InheritView "" @38
+ stereotype TRUE
+ line_color 3342489
+ quidu "43612C7B0243"
+ client @10
+ supplier @16
+ line_style 0)
+ (object InheritView "" @39
+ stereotype TRUE
+ line_color 3342489
+ quidu "436134F001A6"
+ client @14
+ supplier @17
+ line_style 0)
+ (object InheritView "" @40
+ stereotype TRUE
+ line_color 3342489
+ quidu "4361480602D8"
+ client @11
+ supplier @15
+ line_style 0)))
+ (object ClassDiagram "Ecore Data Graph"
+ quid "3FAD029E0142"
+ title "Ecore Data Graph"
+ zoom 100
+ max_height 28350
+ max_width 21600
+ origin_x 0
+ origin_y 0
+ items (list diagram_item_list
+ (object ClassView "Class" "Logical View::ecore::EObject" @41
+ ShowCompartmentStereotypes TRUE
+ SuppressAttribute TRUE
+ SuppressOperation TRUE
+ IncludeAttribute TRUE
+ IncludeOperation TRUE
+ location (464, 832)
+ label (object ItemLabel
+ Parent_View @41
+ location (375, 782)
+ fill_color 13434879
+ nlines 1
+ max_width 178
+ justify 0
+ label "EObject")
+ icon_style "Icon"
+ line_color 3342489
+ fill_color 13434879
+ quidu "3C4F1C860123"
+ width 196
+ height 124
+ annotation 8
+ autoResize TRUE)
+ (object ClassView "Class" "Logical View::sdo::DataGraph" @42
+ ShowCompartmentStereotypes TRUE
+ SuppressOperation TRUE
+ IncludeAttribute TRUE
+ IncludeOperation TRUE
+ location (768, 256)
+ label (object ItemLabel
+ Parent_View @42
+ location (378, 150)
+ fill_color 13434879
+ nlines 1
+ max_width 780
+ justify 0
+ label "DataGraph")
+ icon_style "Icon"
+ line_color 3342489
+ fill_color 13434879
+ quidu "3FAB7BFE03C0"
+ width 798
+ height 236
+ annotation 8)
+ (object AssociationViewNew "$UNNAMED$1" @43
+ location (469, 572)
+ stereotype TRUE
+ quidu "3FAD26E802F5"
+ roleview_list (list RoleViews
+ (object RoleView "$UNNAMED$2" @44
+ Parent_View @43
+ location (-1067, -932)
+ stereotype TRUE
+ line_color 3342489
+ quidu "3FAD26ED00E9"
+ client @43
+ supplier @42
+ line_style 3
+ origin_attachment (469, 572)
+ terminal_attachment (469, 374))
+ (object RoleView "eRootObject" @45
+ Parent_View @43
+ location (-1067, -932)
+ label (object SegLabel @46
+ Parent_View @45
+ location (324, 683)
+ anchor 1
+ anchor_loc 1
+ nlines 1
+ max_width 252
+ justify 0
+ label "+eRootObject"
+ pctDist 0.567708
+ height 146
+ orientation 1)
+ stereotype TRUE
+ line_color 3342489
+ quidu "3FAD26ED00F3"
+ client @43
+ supplier @41
+ line_style 3
+ origin_attachment (469, 572)
+ terminal_attachment (469, 770)
+ label (object SegLabel @47
+ Parent_View @45
+ location (512, 690)
+ anchor 2
+ anchor_loc 1
+ nlines 1
+ max_width 15
+ justify 0
+ label "1"
+ pctDist 0.598958
+ height 43
+ orientation 0))))
+ (object ClassView "Class" "Logical View::sdo::ChangeSummary" @48
+ ShowCompartmentStereotypes TRUE
+ SuppressAttribute TRUE
+ SuppressOperation TRUE
+ IncludeAttribute TRUE
+ IncludeOperation TRUE
+ location (1072, 832)
+ label (object ItemLabel
+ Parent_View @48
+ location (881, 782)
+ fill_color 13434879
+ nlines 1
+ max_width 382
+ justify 0
+ label "ChangeSummary")
+ icon_style "Icon"
+ line_color 3342489
+ fill_color 13434879
+ quidu "3FAB7C360208"
+ width 400
+ height 125
+ annotation 8)
+ (object AssociationViewNew "$UNNAMED$0" @49
+ location (1078, 572)
+ stereotype TRUE
+ quidu "3FAD10CA01D5"
+ roleview_list (list RoleViews
+ (object RoleView "eDataGraph" @50
+ Parent_View @49
+ location (662, -692)
+ label (object SegLabel @51
+ Parent_View @50
+ location (929, 437)
+ anchor 1
+ anchor_loc 1
+ nlines 1
+ max_width 240
+ justify 0
+ label "+eDataGraph"
+ pctDist 0.686170
+ height 150
+ orientation 0)
+ stereotype TRUE
+ line_color 3342489
+ quidu "3FAD10CC001F"
+ client @49
+ supplier @42
+ line_style 3
+ origin_attachment (1078, 572)
+ terminal_attachment (1078, 374)
+ label (object SegLabel @52
+ Parent_View @50
+ location (1115, 437)
+ anchor 2
+ anchor_loc 1
+ nlines 1
+ max_width 15
+ justify 0
+ label "1"
+ pctDist 0.686170
+ height 37
+ orientation 1))
+ (object RoleView "eChangeSummary" @53
+ Parent_View @49
+ location (662, -692)
+ label (object SegLabel @54
+ Parent_View @53
+ location (876, 692)
+ anchor 1
+ anchor_loc 1
+ nlines 1
+ max_width 360
+ justify 0
+ label "+eChangeSummary"
+ pctDist 0.611702
+ height 203
+ orientation 1)
+ stereotype TRUE
+ line_color 3342489
+ quidu "3FAD10CC0020"
+ client @49
+ supplier @48
+ line_style 3
+ origin_attachment (1078, 572)
+ terminal_attachment (1078, 770)
+ label (object SegLabel @55
+ Parent_View @53
+ location (1114, 692)
+ anchor 2
+ anchor_loc 1
+ nlines 1
+ max_width 15
+ justify 0
+ label "1"
+ pctDist 0.611702
+ height 36
+ orientation 0))))))
+ (object ClassDiagram "External Types"
+ quid "3FAB907F00F7"
+ title "External Types"
+ zoom 100
+ max_height 28350
+ max_width 21600
+ origin_x 0
+ origin_y 0
+ items (list diagram_item_list
+ (object ClassView "Class" "Logical View::sdo::EObjectStreamException" @56
+ ShowCompartmentStereotypes TRUE
+ SuppressOperation TRUE
+ IncludeAttribute TRUE
+ IncludeOperation TRUE
+ ShowOperationSignature TRUE
+ location (1184, 176)
+ font (object Font
+ italics TRUE)
+ label (object ItemLabel
+ Parent_View @56
+ location (741, 142)
+ fill_color 13434879
+ nlines 1
+ max_width 886
+ justify 0
+ label "EObjectStreamException")
+ stereotype (object ItemLabel
+ Parent_View @56
+ location (741, 92)
+ fill_color 13434879
+ anchor 10
+ nlines 1
+ max_width 886
+ justify 0
+ label "<<datatype>>")
+ icon_style "Icon"
+ line_color 3342489
+ fill_color 12303359
+ quidu "3FC352DE038F"
+ width 904
+ height 192
+ annotation 8
+ autoResize TRUE)
+ (object ClassView "Class" "Logical View::sdo::EJavaList" @57
+ ShowCompartmentStereotypes TRUE
+ SuppressOperation TRUE
+ IncludeAttribute TRUE
+ IncludeOperation TRUE
+ ShowOperationSignature TRUE
+ location (352, 176)
+ font (object Font
+ italics TRUE)
+ label (object ItemLabel
+ Parent_View @57
+ location (80, 142)
+ fill_color 13434879
+ nlines 1
+ max_width 544
+ justify 0
+ label "EJavaList")
+ stereotype (object ItemLabel
+ Parent_View @57
+ location (80, 92)
+ fill_color 13434879
+ anchor 10
+ nlines 1
+ max_width 544
+ justify 0
+ label "<<datatype>>")
+ icon_style "Icon"
+ line_color 3342489
+ fill_color 8963327
+ quidu "3FAB8A010237"
+ width 562
+ height 192
+ annotation 8)))
+ (object ClassDiagram "SDO XML Type"
+ quid "406964270056"
+ title "SDO XML Type"
+ zoom 100
+ max_height 28350
+ max_width 21600
+ origin_x 0
+ origin_y 0
+ items (list diagram_item_list
+ (object ClassView "Class" "Logical View::type::AnyType" @58
+ ShowCompartmentStereotypes TRUE
+ IncludeAttribute TRUE
+ IncludeOperation TRUE
+ ShowOperationSignature TRUE
+ location (1488, 576)
+ label (object ItemLabel
+ Parent_View @58
+ location (1075, 421)
+ fill_color 13434879
+ nlines 1
+ max_width 826
+ justify 0
+ label "AnyType")
+ icon_style "Icon"
+ line_color 3342489
+ fill_color 13434879
+ quidu "40695FE40332"
+ width 844
+ height 334
+ annotation 8)
+ (object ClassView "Class" "Logical View::type::SimpleAnyType" @59
+ ShowCompartmentStereotypes TRUE
+ IncludeAttribute TRUE
+ IncludeOperation TRUE
+ ShowOperationSignature TRUE
+ location (1488, 1040)
+ label (object ItemLabel
+ Parent_View @59
+ location (1272, 910)
+ fill_color 13434879
+ nlines 1
+ max_width 432
+ justify 0
+ label "SimpleAnyType")
+ icon_style "Icon"
+ line_color 3342489
+ fill_color 13434879
+ quidu "406961210099"
+ width 450
+ height 284
+ annotation 8)
+ (object ClassView "Class" "Logical View::sdo::AnyTypeDataObject" @60
+ ShowCompartmentStereotypes TRUE
+ IncludeAttribute TRUE
+ IncludeOperation TRUE
+ ShowOperationSignature TRUE
+ location (448, 560)
+ label (object ItemLabel
+ Parent_View @60
+ location (250, 509)
+ fill_color 13434879
+ nlines 1
+ max_width 396
+ justify 0
+ label "AnyTypeDataObject")
+ icon_style "Icon"
+ line_color 3342489
+ fill_color 13434879
+ quidu "4069645E0146"
+ width 414
+ height 126
+ annotation 8
+ autoResize TRUE)
+ (object ClassView "Class" "Logical View::sdo::SimpleAnyTypeDataObject" @61
+ ShowCompartmentStereotypes TRUE
+ IncludeAttribute TRUE
+ IncludeOperation TRUE
+ ShowOperationSignature TRUE
+ location (464, 1024)
+ label (object ItemLabel
+ Parent_View @61
+ location (201, 973)
+ fill_color 13434879
+ nlines 1
+ max_width 526
+ justify 0
+ label "SimpleAnyTypeDataObject")
+ icon_style "Icon"
+ line_color 3342489
+ fill_color 13434879
+ quidu "406964710189"
+ width 544
+ height 126
+ annotation 8
+ autoResize TRUE)
+ (object ClassView "Class" "Logical View::sdo::DataObject" @62
+ ShowCompartmentStereotypes TRUE
+ SuppressAttribute TRUE
+ SuppressOperation TRUE
+ IncludeAttribute TRUE
+ IncludeOperation TRUE
+ location (448, 208)
+ font (object Font
+ italics TRUE)
+ label (object ItemLabel
+ Parent_View @62
+ location (328, 165)
+ fill_color 13434879
+ nlines 1
+ max_width 240
+ justify 0
+ label "DataObject")
+ icon_style "Icon"
+ line_color 3342489
+ fill_color 13434879
+ quidu "3FAB6F7501C4"
+ width 258
+ height 110
+ annotation 8)
+ (object InheritView "" @63
+ stereotype (object SegLabel @64
+ Parent_View @63
+ location (298, 791)
+ anchor 10
+ anchor_loc 1
+ nlines 1
+ max_width 450
+ justify 0
+ label "<<extend>>"
+ pctDist 0.502959
+ height 150
+ orientation 0)
+ line_color 3342489
+ quidu "4069648302E3"
+ client @61
+ supplier @60
+ line_style 3
+ origin_attachment (448, 961)
+ terminal_attachment (448, 623))
+ (object InheritView "" @65
+ stereotype TRUE
+ line_color 3342489
+ quidu "4069648D02E8"
+ client @61
+ supplier @59
+ line_style 3
+ origin_attachment (736, 1002)
+ terminal_attachment (1263, 1002))
+ (object InheritView "" @66
+ stereotype TRUE
+ line_color 3342489
+ quidu "40696143020B"
+ client @59
+ supplier @58
+ line_style 3
+ origin_attachment (1479, 898)
+ terminal_attachment (1479, 743))
+ (object InheritView "" @67
+ stereotype TRUE
+ line_color 3342489
+ quidu "406964870375"
+ client @60
+ supplier @58
+ line_style 3
+ origin_attachment (655, 561)
+ terminal_attachment (1066, 561))
+ (object InheritView "" @68
+ stereotype (object SegLabel @69
+ Parent_View @68
+ location (294, 403)
+ anchor 10
+ anchor_loc 1
+ nlines 1
+ max_width 450
+ justify 0
+ label "<<extend>>"
+ pctDist 0.405229
+ height 155
+ orientation 0)
+ line_color 3342489
+ quidu "436141F003E7"
+ client @60
+ supplier @62
+ line_style 0)))
+ (object ClassDiagram "SDO DataObject Implementations"
+ quid "43621DF90149"
+ title "SDO DataObject Implementations"
+ zoom 100
+ max_height 28350
+ max_width 21600
+ origin_x 0
+ origin_y 0
+ items (list diagram_item_list
+ (object ClassView "Class" "Logical View::sdo::DataObject" @70
+ ShowCompartmentStereotypes TRUE
+ SuppressOperation TRUE
+ location (1056, 368)
+ font (object Font
+ italics TRUE)
+ label (object ItemLabel
+ Parent_View @70
+ location (661, 312)
+ fill_color 13434879
+ nlines 1
+ max_width 790
+ justify 0
+ label "DataObject")
+ icon_style "Icon"
+ line_color 3342489
+ fill_color 13434879
+ quidu "3FAB6F7501C4"
+ compartment (object Compartment
+ Parent_View @70
+ location (661, 372)
+ icon_style "Icon"
+ fill_color 13434879
+ anchor 2
+ nlines 1
+ max_width 0
+ compartmentItems (list Compartment
+ "<<javaclass>> + commonj.sdo.DataObject"))
+ width 808
+ height 136
+ annotation 8
+ autoResize TRUE)
+ (object ClassView "Class" "Logical View::sdo::DynamicDataObject" @71
+ ShowCompartmentStereotypes TRUE
+ SuppressOperation TRUE
+ IncludeAttribute TRUE
+ IncludeOperation TRUE
+ location (576, 720)
+ label (object ItemLabel
+ Parent_View @71
+ location (181, 664)
+ fill_color 13434879
+ nlines 1
+ max_width 790
+ justify 0
+ label "DynamicDataObject")
+ icon_style "Icon"
+ line_color 3342489
+ fill_color 13434879
+ quidu "435E94210124"
+ width 808
+ height 136
+ annotation 8)
+ (object ClassView "Class" "Logical View::sdo::StoreDataObject" @72
+ ShowCompartmentStereotypes TRUE
+ SuppressOperation TRUE
+ IncludeAttribute TRUE
+ IncludeOperation TRUE
+ location (1680, 720)
+ label (object ItemLabel
+ Parent_View @72
+ location (1285, 664)
+ fill_color 13434879
+ nlines 1
+ max_width 790
+ justify 0
+ label "StoreDataObject")
+ icon_style "Icon"
+ line_color 3342489
+ fill_color 13434879
+ quidu "43621EBA03B4"
+ width 808
+ height 136
+ annotation 8)
+ (object InheritTreeView "" @73
+ location (1053, 559)
+ line_color 3342489
+ fill_color 13434879
+ supplier @70
+ vertices (list Points
+ (1053, 559)
+ (1053, 436)))
+ (object InheritView "" @74
+ stereotype TRUE
+ line_color 3342489
+ quidu "435E9435008D"
+ client @71
+ supplier @70
+ line_style 3
+ origin_attachment (562, 652)
+ terminal_attachment (562, 559)
+ drawSupplier @73)
+ (object ClassView "Class" "Logical View::sdo::DynamicStoreDataObject" @75
+ ShowCompartmentStereotypes TRUE
+ SuppressOperation TRUE
+ IncludeAttribute TRUE
+ IncludeOperation TRUE
+ location (1680, 1056)
+ label (object ItemLabel
+ Parent_View @75
+ location (1285, 1000)
+ fill_color 13434879
+ nlines 1
+ max_width 790
+ justify 0
+ label "DynamicStoreDataObject")
+ icon_style "Icon"
+ line_color 3342489
+ fill_color 13434879
+ quidu "43621F4203CD"
+ width 808
+ height 136
+ annotation 8)
+ (object InheritView "" @76
+ stereotype TRUE
+ line_color 3342489
+ quidu "43621F920242"
+ client @75
+ supplier @72
+ line_style 0)
+ (object InheritView "" @77
+ stereotype TRUE
+ line_color 3342489
+ quidu "43621F0B03A6"
+ client @72
+ supplier @70
+ line_style 3
+ origin_attachment (1681, 652)
+ terminal_attachment (1681, 559)
+ drawSupplier @73)))))
+ (object Class_Category "ecore"
+ is_unit TRUE
+ is_loaded FALSE
+ file_name "$VABASE_PLUGINS_PATH\\org.eclipse.emf.ecore\\model\\org.eclipse.emf.Ecore.cat"
+ quid "39A5ED04004E")
+ (object Class_Category "change"
+ is_unit TRUE
+ is_loaded FALSE
+ file_name "$VABASE_PLUGINS_PATH\\org.eclipse.emf.ecore.change\\model\\org.eclipse.emf.ecore.Change.cat"
+ quid "4FAA8E8B0306")
+ (object Class_Category "type"
+ attributes (list Attribute_Set
+ (object Attribute
+ tool "Ecore"
+ name "packageName"
+ value "type")
+ (object Attribute
+ tool "Ecore"
+ name "nsPrefix"
+ value "xml.type")
+ (object Attribute
+ tool "Ecore"
+ name "nsURI"
+ value "http://www.eclipse.org/emf/2003/XMLType")
+ (object Attribute
+ tool "Ecore"
+ name "basePackage"
+ value "org.eclipse.emf.ecore.xml")
+ (object Attribute
+ tool "Ecore"
+ name "prefix"
+ value "XMLType"))
+ quid "40696924000C"
+ exportControl "Public"
+ logical_models (list unit_reference_list
+ (object Class "AnyType"
+ attributes (list Attribute_Set
+ (object Attribute
+ tool "Ecore"
+ name "xmlContentKind"
+ value ("ContentKind" 3)))
+ quid "40695FE40332"
+ class_attributes (list class_attribute_list
+ (object ClassAttribute "mixed"
+ attributes (list Attribute_Set
+ (object Attribute
+ tool "Ecore"
+ name "isUnique"
+ value FALSE))
+ quid "40696039001D"
+ stereotype "0..*"
+ type "EFeatureMapEntry"
+ exportControl "Public")
+ (object ClassAttribute "any"
+ attributes (list Attribute_Set
+ (object Attribute
+ tool "Ecore"
+ name "isTransient"
+ value TRUE)
+ (object Attribute
+ tool "Ecore"
+ name "isVolatile"
+ value TRUE)
+ (object Attribute
+ tool "Ecore"
+ name "isUnique"
+ value FALSE))
+ quid "40696084002F"
+ stereotype "0..*"
+ type "EFeatureMapEntry"
+ exportControl "Public"
+ derived TRUE)
+ (object ClassAttribute "anyAttribute"
+ attributes (list Attribute_Set
+ (object Attribute
+ tool "Ecore"
+ name "isUnique"
+ value FALSE))
+ quid "4069609A0153"
+ stereotype "0..*"
+ type "EFeatureMapEntry"
+ exportControl "Public")))
+ (object Class "SimpleAnyType"
+ attributes (list Attribute_Set
+ (object Attribute
+ tool "Ecore"
+ name "xmlContentKind"
+ value ("ContentKind" 2)))
+ quid "406961210099"
+ superclasses (list inheritance_relationship_list
+ (object Inheritance_Relationship
+ quid "40696143020B"
+ supplier "Logical View::type::AnyType"
+ quidu "40695FE40332"))
+ class_attributes (list class_attribute_list
+ (object ClassAttribute "rawValue"
+ attributes (list Attribute_Set
+ (object Attribute
+ tool "Ecore"
+ name "isTransient"
+ value TRUE)
+ (object Attribute
+ tool "Ecore"
+ name "isVolatile"
+ value TRUE)
+ (object Attribute
+ tool "Ecore"
+ name "isUnique"
+ value FALSE))
+ quid "4069612E0391"
+ type "String"
+ exportControl "Public"
+ derived TRUE)
+ (object ClassAttribute "value"
+ attributes (list Attribute_Set
+ (object Attribute
+ tool "Ecore"
+ name "isTransient"
+ value TRUE)
+ (object Attribute
+ tool "Ecore"
+ name "isVolatile"
+ value TRUE)
+ (object Attribute
+ tool "Ecore"
+ name "isUnique"
+ value FALSE))
+ quid "406961A40106"
+ type "EJavaObject"
+ exportControl "Public"
+ derived TRUE))))
+ logical_presentations (list unit_reference_list)))
+ logical_presentations (list unit_reference_list
+ (object ClassDiagram "Main"
+ quid "3FAA8E8700D0"
+ title "Main"
+ zoom 100
+ max_height 28350
+ max_width 21600
+ origin_x 0
+ origin_y 0
+ items (list diagram_item_list
+ (object CategoryView "Logical View::ecore" @78
+ location (912, 272)
+ label (object ItemLabel
+ Parent_View @78
+ location (768, 188)
+ fill_color 13434879
+ nlines 2
+ max_width 288
+ justify 0
+ label "ecore")
+ icon_style "Icon"
+ line_color 3342489
+ fill_color 13434879
+ quidu "39A5ED04004E"
+ width 300
+ height 180)
+ (object CategoryView "Logical View::sdo" @79
+ location (368, 272)
+ label (object ItemLabel
+ Parent_View @79
+ location (224, 188)
+ fill_color 13434879
+ nlines 2
+ max_width 288
+ justify 0
+ label "sdo")
+ icon_style "Icon"
+ line_color 3342489
+ fill_color 13434879
+ quidu "3FAA8E8B0306"
+ width 300
+ height 180)
+ (object CategoryView "Logical View::change" @80
+ location (1440, 272)
+ label (object ItemLabel
+ Parent_View @80
+ location (1296, 188)
+ fill_color 13434879
+ nlines 2
+ max_width 288
+ justify 0
+ label "change")
+ icon_style "Icon"
+ line_color 3342489
+ fill_color 13434879
+ quidu "4FAA8E8B0306"
+ width 300
+ height 180)))))
+ root_subsystem (object SubSystem "Component View"
+ quid "3FAA8E8700BF"
+ physical_models (list unit_reference_list)
+ physical_presentations (list unit_reference_list
+ (object Module_Diagram "Main"
+ quid "3FAA8E8700EE"
+ title "Main"
+ zoom 100
+ max_height 28350
+ max_width 21600
+ origin_x 0
+ origin_y 0
+ items (list diagram_item_list))))
+ process_structure (object Processes
+ quid "3FAA8E8700C0"
+ ProcsNDevs (list
+ (object Process_Diagram "Deployment View"
+ quid "3FAA8E8700C2"
+ title "Deployment View"
+ zoom 100
+ max_height 28350
+ max_width 21600
+ origin_x 0
+ origin_y 0
+ items (list diagram_item_list))))
+ properties (object Properties
+ attributes (list Attribute_Set
+ (object Attribute
+ tool "DDL"
+ name "propertyId"
+ value "809135966")
+ (object Attribute
+ tool "DDL"
+ name "default__Project"
+ value (list Attribute_Set
+ (object Attribute
+ tool "DDL"
+ name "Directory"
+ value "AUTO GENERATE")
+ (object Attribute
+ tool "DDL"
+ name "DataBase"
+ value ("DataBaseSet" 800))
+ (object Attribute
+ tool "DDL"
+ name "DataBaseSet"
+ value (list Attribute_Set
+ (object Attribute
+ tool "DDL"
+ name "ANSI"
+ value 800)
+ (object Attribute
+ tool "DDL"
+ name "Oracle"
+ value 801)
+ (object Attribute
+ tool "DDL"
+ name "SQLServer"
+ value 802)
+ (object Attribute
+ tool "DDL"
+ name "Sybase"
+ value 803)
+ (object Attribute
+ tool "DDL"
+ name "Watcom"
+ value 804)))
+ (object Attribute
+ tool "DDL"
+ name "PrimaryKeyColumnName"
+ value "Id")
+ (object Attribute
+ tool "DDL"
+ name "PrimaryKeyColumnType"
+ value "NUMBER(5)")
+ (object Attribute
+ tool "DDL"
+ name "ViewName"
+ value "V_")
+ (object Attribute
+ tool "DDL"
+ name "TableName"
+ value "T_")
+ (object Attribute
+ tool "DDL"
+ name "InheritSuffix"
+ value "_V")
+ (object Attribute
+ tool "DDL"
+ name "DropClause"
+ value FALSE)
+ (object Attribute
+ tool "DDL"
+ name "BaseViews"
+ value FALSE)
+ (object Attribute
+ tool "DDL"
+ name "DDLScriptFilename"
+ value "DDL1.SQL")))
+ (object Attribute
+ tool "DDL"
+ name "default__Attribute"
+ value (list Attribute_Set
+ (object Attribute
+ tool "DDL"
+ name "ColumnType"
+ value "VARCHAR")
+ (object Attribute
+ tool "DDL"
+ name "Length"
+ value "")
+ (object Attribute
+ tool "DDL"
+ name "NullsOK"
+ value TRUE)
+ (object Attribute
+ tool "DDL"
+ name "PrimaryKey"
+ value FALSE)
+ (object Attribute
+ tool "DDL"
+ name "Unique"
+ value FALSE)
+ (object Attribute
+ tool "DDL"
+ name "CompositeUnique"
+ value FALSE)
+ (object Attribute
+ tool "DDL"
+ name "CheckConstraint"
+ value "")))
+ (object Attribute
+ tool "DDL"
+ name "HiddenTool"
+ value FALSE)
+ (object Attribute
+ tool "IDL"
+ name "propertyId"
+ value "809135966")
+ (object Attribute
+ tool "IDL"
+ name "default__Project"
+ value (list Attribute_Set
+ (object Attribute
+ tool "IDL"
+ name "CreateMissingDirectories"
+ value TRUE)
+ (object Attribute
+ tool "IDL"
+ name "StopOnError"
+ value TRUE)
+ (object Attribute
+ tool "IDL"
+ name "Directory"
+ value "AUTO GENERATE")
+ (object Attribute
+ tool "IDL"
+ name "GeneratePreserveRegions"
+ value TRUE)))
+ (object Attribute
+ tool "IDL"
+ name "default__Class"
+ value (list Attribute_Set
+ (object Attribute
+ tool "IDL"
+ name "ImplementationType"
+ value "")
+ (object Attribute
+ tool "IDL"
+ name "ConstValue"
+ value "")
+ (object Attribute
+ tool "IDL"
+ name "GenerateDefaultSpecifier"
+ value FALSE)
+ (object Attribute
+ tool "IDL"
+ name "DefaultSpecifier"
+ value "")
+ (object Attribute
+ tool "IDL"
+ name "IDLElement"
+ value TRUE)
+ (object Attribute
+ tool "IDL"
+ name "IDLSpecificationType"
+ value ("IDLSpecSet" 22))
+ (object Attribute
+ tool "IDL"
+ name "IDLSpecSet"
+ value (list Attribute_Set
+ (object Attribute
+ tool "IDL"
+ name "Interface"
+ value 22)
+ (object Attribute
+ tool "IDL"
+ name "Typedef"
+ value 54)
+ (object Attribute
+ tool "IDL"
+ name "Enumeration"
+ value 8)
+ (object Attribute
+ tool "IDL"
+ name "Const"
+ value 71)
+ (object Attribute
+ tool "IDL"
+ name "Exception"
+ value 61)
+ (object Attribute
+ tool "IDL"
+ name "Struct"
+ value 51)
+ (object Attribute
+ tool "IDL"
+ name "Union"
+ value 81)))))
+ (object Attribute
+ tool "IDL"
+ name "default__Module-Spec"
+ value (list Attribute_Set
+ (object Attribute
+ tool "IDL"
+ name "Generate"
+ value TRUE)
+ (object Attribute
+ tool "IDL"
+ name "CmIdentification"
+ value (value Text " %X% @(#) plugins/org.eclipse.emf.ecore.sdo/model/SDO.mdl, emf.ecore.sdo, org.eclipse.dev"))
+ (object Attribute
+ tool "IDL"
+ name "CopyrightNotice"
+ value (value Text ""))
+ (object Attribute
+ tool "IDL"
+ name "FileName"
+ value "AUTO GENERATE")
+ (object Attribute
+ tool "IDL"
+ name "GenerateIDLModule"
+ value FALSE)
+ (object Attribute
+ tool "IDL"
+ name "InclusionProtectionSymbol"
+ value "AUTO GENERATE")
+ (object Attribute
+ tool "IDL"
+ name "AdditionalIncludes"
+ value (value Text ""))
+ (object Attribute
+ tool "IDL"
+ name "IncludeBySimpleName"
+ value FALSE)))
+ (object Attribute
+ tool "IDL"
+ name "default__Module-Body"
+ value (list Attribute_Set
+ (object Attribute
+ tool "IDL"
+ name "CmIdentification"
+ value (value Text " %X% @(#) plugins/org.eclipse.emf.ecore.sdo/model/SDO.mdl, emf.ecore.sdo, org.eclipse.dev"))
+ (object Attribute
+ tool "IDL"
+ name "CopyrightNotice"
+ value (value Text ""))
+ (object Attribute
+ tool "IDL"
+ name "FileName"
+ value "AUTO GENERATE")
+ (object Attribute
+ tool "IDL"
+ name "AdditionalIncludes"
+ value (value Text ""))
+ (object Attribute
+ tool "IDL"
+ name "IncludeBySimpleName"
+ value FALSE)))
+ (object Attribute
+ tool "IDL"
+ name "default__Operation"
+ value (list Attribute_Set
+ (object Attribute
+ tool "IDL"
+ name "OperationIsOneWay"
+ value FALSE)
+ (object Attribute
+ tool "IDL"
+ name "Context"
+ value "")
+ (object Attribute
+ tool "IDL"
+ name "Raises"
+ value "")))
+ (object Attribute
+ tool "IDL"
+ name "default__Attribute"
+ value (list Attribute_Set
+ (object Attribute
+ tool "IDL"
+ name "CaseSpecifier"
+ value "")
+ (object Attribute
+ tool "IDL"
+ name "GenerateDataMember"
+ value TRUE)
+ (object Attribute
+ tool "IDL"
+ name "DataMemberName"
+ value "$relationship")
+ (object Attribute
+ tool "IDL"
+ name "IsReadOnly"
+ value FALSE)
+ (object Attribute
+ tool "IDL"
+ name "IsConst"
+ value FALSE)
+ (object Attribute
+ tool "IDL"
+ name "ConstValue"
+ value "")))
+ (object Attribute
+ tool "IDL"
+ name "default__Has"
+ value (list Attribute_Set
+ (object Attribute
+ tool "IDL"
+ name "NameIfUnlabeled"
+ value "the_$supplier")
+ (object Attribute
+ tool "IDL"
+ name "GenerateDataMember"
+ value TRUE)
+ (object Attribute
+ tool "IDL"
+ name "DataMemberName"
+ value "$relationship")
+ (object Attribute
+ tool "IDL"
+ name "GenerateForwardReference"
+ value FALSE)
+ (object Attribute
+ tool "IDL"
+ name "IsReadOnly"
+ value FALSE)
+ (object Attribute
+ tool "IDL"
+ name "BoundedHasRelType"
+ value ("HasRelTypeSet" 47))
+ (object Attribute
+ tool "IDL"
+ name "HasRelTypeSet"
+ value (list Attribute_Set
+ (object Attribute
+ tool "IDL"
+ name "Array"
+ value 24)
+ (object Attribute
+ tool "IDL"
+ name "Sequence"
+ value 47)))))
+ (object Attribute
+ tool "IDL"
+ name "default__Role"
+ value (list Attribute_Set
+ (object Attribute
+ tool "IDL"
+ name "NameIfUnlabeled"
+ value "the_$supplier")
+ (object Attribute
+ tool "IDL"
+ name "GenerateDataMember"
+ value TRUE)
+ (object Attribute
+ tool "IDL"
+ name "DataMemberName"
+ value "$relationship")
+ (object Attribute
+ tool "IDL"
+ name "GenerateForwardReference"
+ value FALSE)
+ (object Attribute
+ tool "IDL"
+ name "IsReadOnly"
+ value FALSE)
+ (object Attribute
+ tool "IDL"
+ name "BoundedRoleType"
+ value ("AssocTypeSet" 47))
+ (object Attribute
+ tool "IDL"
+ name "AssocTypeSet"
+ value (list Attribute_Set
+ (object Attribute
+ tool "IDL"
+ name "Array"
+ value 24)
+ (object Attribute
+ tool "IDL"
+ name "Sequence"
+ value 47)))))
+ (object Attribute
+ tool "IDL"
+ name "default__Uses"
+ value (list Attribute_Set
+ (object Attribute
+ tool "IDL"
+ name "GenerateForwardReference"
+ value FALSE)))
+ (object Attribute
+ tool "IDL"
+ name "default__Subsystem"
+ value (list Attribute_Set
+ (object Attribute
+ tool "IDL"
+ name "Directory"
+ value "AUTO GENERATE")))
+ (object Attribute
+ tool "IDL"
+ name "HiddenTool"
+ value FALSE)
+ (object Attribute
+ tool "SCC"
+ name "HiddenTool"
+ value FALSE)
+ (object Attribute
+ tool "Ecore"
+ name "propertyId"
+ value "809135969")
+ (object Attribute
+ tool "Ecore"
+ name "default__Category"
+ value (list Attribute_Set
+ (object Attribute
+ tool "Ecore"
+ name "packageName"
+ value "")
+ (object Attribute
+ tool "Ecore"
+ name "nsPrefix"
+ value "")
+ (object Attribute
+ tool "Ecore"
+ name "nsURI"
+ value "")
+ (object Attribute
+ tool "Ecore"
+ name "basePackage"
+ value "")
+ (object Attribute
+ tool "Ecore"
+ name "prefix"
+ value "")
+ (object Attribute
+ tool "Ecore"
+ name "annotation"
+ value "")))
+ (object Attribute
+ tool "Ecore"
+ name "default__Class"
+ value (list Attribute_Set
+ (object Attribute
+ tool "Ecore"
+ name "classifierName"
+ value "")
+ (object Attribute
+ tool "Ecore"
+ name "xmlName"
+ value "")
+ (object Attribute
+ tool "Ecore"
+ name "xmlContentKind"
+ value ("ContentKind" 0))
+ (object Attribute
+ tool "Ecore"
+ name "ContentKind"
+ value (list Attribute_Set
+ (object Attribute
+ tool "Ecore"
+ name "Unspecified"
+ value 0)
+ (object Attribute
+ tool "Ecore"
+ name "Empty"
+ value 1)
+ (object Attribute
+ tool "Ecore"
+ name "Simple"
+ value 2)
+ (object Attribute
+ tool "Ecore"
+ name "Mixed"
+ value 3)
+ (object Attribute
+ tool "Ecore"
+ name "ElementOnly"
+ value 4)))
+ (object Attribute
+ tool "Ecore"
+ name "annotation"
+ value "")))
+ (object Attribute
+ tool "Ecore"
+ name "default__Operation"
+ value (list Attribute_Set
+ (object Attribute
+ tool "Ecore"
+ name "operationName"
+ value "")
+ (object Attribute
+ tool "Ecore"
+ name "annotation"
+ value "")))
+ (object Attribute
+ tool "Ecore"
+ name "default__Attribute"
+ value (list Attribute_Set
+ (object Attribute
+ tool "Ecore"
+ name "attributeName"
+ value "")
+ (object Attribute
+ tool "Ecore"
+ name "isTransient"
+ value FALSE)
+ (object Attribute
+ tool "Ecore"
+ name "isVolatile"
+ value FALSE)
+ (object Attribute
+ tool "Ecore"
+ name "isChangeable"
+ value TRUE)
+ (object Attribute
+ tool "Ecore"
+ name "isUnsettable"
+ value FALSE)
+ (object Attribute
+ tool "Ecore"
+ name "isUnique"
+ value TRUE)
+ (object Attribute
+ tool "Ecore"
+ name "isID"
+ value FALSE)
+ (object Attribute
+ tool "Ecore"
+ name "xmlName"
+ value "")
+ (object Attribute
+ tool "Ecore"
+ name "xmlNamespace"
+ value "")
+ (object Attribute
+ tool "Ecore"
+ name "xmlFeatureKind"
+ value ("FeatureKind" 0))
+ (object Attribute
+ tool "Ecore"
+ name "FeatureKind"
+ value (list Attribute_Set
+ (object Attribute
+ tool "Ecore"
+ name "Unspecified"
+ value 0)
+ (object Attribute
+ tool "Ecore"
+ name "Simple"
+ value 1)
+ (object Attribute
+ tool "Ecore"
+ name "Attribute"
+ value 2)
+ (object Attribute
+ tool "Ecore"
+ name "Element"
+ value 4)))
+ (object Attribute
+ tool "Ecore"
+ name "annotation"
+ value "")))
+ (object Attribute
+ tool "Ecore"
+ name "default__Role"
+ value (list Attribute_Set
+ (object Attribute
+ tool "Ecore"
+ name "referenceName"
+ value "")
+ (object Attribute
+ tool "Ecore"
+ name "isTransient"
+ value FALSE)
+ (object Attribute
+ tool "Ecore"
+ name "isVolatile"
+ value FALSE)
+ (object Attribute
+ tool "Ecore"
+ name "isChangeable"
+ value TRUE)
+ (object Attribute
+ tool "Ecore"
+ name "isUnsettable"
+ value FALSE)
+ (object Attribute
+ tool "Ecore"
+ name "isResolveProxies"
+ value TRUE)
+ (object Attribute
+ tool "Ecore"
+ name "xmlName"
+ value "")
+ (object Attribute
+ tool "Ecore"
+ name "xmlNamespace"
+ value "")
+ (object Attribute
+ tool "Ecore"
+ name "xmlFeatureKind"
+ value ("FeatureKind" 0))
+ (object Attribute
+ tool "Ecore"
+ name "FeatureKind"
+ value (list Attribute_Set
+ (object Attribute
+ tool "Ecore"
+ name "Unspecified"
+ value 0)
+ (object Attribute
+ tool "Ecore"
+ name "Simple"
+ value 1)
+ (object Attribute
+ tool "Ecore"
+ name "Attribute"
+ value 2)
+ (object Attribute
+ tool "Ecore"
+ name "Element"
+ value 4)))
+ (object Attribute
+ tool "Ecore"
+ name "annotation"
+ value "")))
+ (object Attribute
+ tool "framework"
+ name "HiddenTool"
+ value FALSE)
+ (object Attribute
+ tool "Java"
+ name "propertyId"
+ value "809135966")
+ (object Attribute
+ tool "Java"
+ name "default__Project"
+ value (list Attribute_Set
+ (object Attribute
+ tool "Java"
+ name "CreateMissingDirectories"
+ value TRUE)
+ (object Attribute
+ tool "Java"
+ name "StopOnError"
+ value FALSE)
+ (object Attribute
+ tool "Java"
+ name "Directory"
+ value "AUTO GENERATE")
+ (object Attribute
+ tool "Java"
+ name "UsePrefixes"
+ value FALSE)
+ (object Attribute
+ tool "Java"
+ name "InstanceVariablePrefix"
+ value "m_")
+ (object Attribute
+ tool "Java"
+ name "ClassVariablePrefix"
+ value "s_")
+ (object Attribute
+ tool "Java"
+ name "DefaultAttributeDataType"
+ value "int")
+ (object Attribute
+ tool "Java"
+ name "DefaultOperationReturnType"
+ value "void")))
+ (object Attribute
+ tool "Java"
+ name "default__Class"
+ value (list Attribute_Set
+ (object Attribute
+ tool "Java"
+ name "Final"
+ value FALSE)
+ (object Attribute
+ tool "Java"
+ name "GenerateDefaultConstructor"
+ value TRUE)
+ (object Attribute
+ tool "Java"
+ name "ConstructorIs"
+ value ("Ctor_Set" 62))
+ (object Attribute
+ tool "Java"
+ name "Ctor_Set"
+ value (list Attribute_Set
+ (object Attribute
+ tool "Java"
+ name "Public"
+ value 62)
+ (object Attribute
+ tool "Java"
+ name "Protected"
+ value 63)
+ (object Attribute
+ tool "Java"
+ name "Private"
+ value 64)))
+ (object Attribute
+ tool "Java"
+ name "GenerateFinalizer"
+ value FALSE)
+ (object Attribute
+ tool "Java"
+ name "GenerateStaticInitializer"
+ value FALSE)
+ (object Attribute
+ tool "Java"
+ name "GenerateInstanceInitializer"
+ value FALSE)))
+ (object Attribute
+ tool "Java"
+ name "default__Module-Spec"
+ value (list Attribute_Set
+ (object Attribute
+ tool "Java"
+ name "Generate"
+ value TRUE)
+ (object Attribute
+ tool "Java"
+ name "CmIdentification"
+ value (value Text ""))
+ (object Attribute
+ tool "Java"
+ name "CopyrightNotice"
+ value (value Text ""))
+ (object Attribute
+ tool "Java"
+ name "AdditionalImports"
+ value (value Text ""))))
+ (object Attribute
+ tool "Java"
+ name "default__Module-Body"
+ value (list Attribute_Set
+ (object Attribute
+ tool "Java"
+ name "Generate"
+ value TRUE)
+ (object Attribute
+ tool "Java"
+ name "CmIdentification"
+ value (value Text ""))
+ (object Attribute
+ tool "Java"
+ name "CopyrightNotice"
+ value (value Text ""))
+ (object Attribute
+ tool "Java"
+ name "AdditionalImports"
+ value (value Text ""))))
+ (object Attribute
+ tool "Java"
+ name "default__Operation"
+ value (list Attribute_Set
+ (object Attribute
+ tool "Java"
+ name "Abstract"
+ value FALSE)
+ (object Attribute
+ tool "Java"
+ name "Static"
+ value FALSE)
+ (object Attribute
+ tool "Java"
+ name "Final"
+ value FALSE)
+ (object Attribute
+ tool "Java"
+ name "Native"
+ value FALSE)
+ (object Attribute
+ tool "Java"
+ name "Synchronized"
+ value FALSE)))
+ (object Attribute
+ tool "Java"
+ name "default__Attribute"
+ value (list Attribute_Set
+ (object Attribute
+ tool "Java"
+ name "GenerateDataMember"
+ value TRUE)
+ (object Attribute
+ tool "Java"
+ name "Final"
+ value FALSE)
+ (object Attribute
+ tool "Java"
+ name "Transient"
+ value FALSE)
+ (object Attribute
+ tool "Java"
+ name "Volatile"
+ value FALSE)))
+ (object Attribute
+ tool "Java"
+ name "default__Role"
+ value (list Attribute_Set
+ (object Attribute
+ tool "Java"
+ name "GenerateDataMember"
+ value TRUE)
+ (object Attribute
+ tool "Java"
+ name "ContainerClass"
+ value "")
+ (object Attribute
+ tool "Java"
+ name "InitialValue"
+ value "")
+ (object Attribute
+ tool "Java"
+ name "Final"
+ value FALSE)
+ (object Attribute
+ tool "Java"
+ name "Transient"
+ value FALSE)
+ (object Attribute
+ tool "Java"
+ name "Volatile"
+ value FALSE)))
+ (object Attribute
+ tool "Java"
+ name "HiddenTool"
+ value FALSE)
+ (object Attribute
+ tool "Oracle8"
+ name "propertyId"
+ value "360000002")
+ (object Attribute
+ tool "Oracle8"
+ name "default__Project"
+ value (list Attribute_Set
+ (object Attribute
+ tool "Oracle8"
+ name "DDLScriptFilename"
+ value "DDL1.SQL")
+ (object Attribute
+ tool "Oracle8"
+ name "DropClause"
+ value FALSE)
+ (object Attribute
+ tool "Oracle8"
+ name "PrimaryKeyColumnName"
+ value "_ID")
+ (object Attribute
+ tool "Oracle8"
+ name "PrimaryKeyColumnType"
+ value "NUMBER(5,0)")
+ (object Attribute
+ tool "Oracle8"
+ name "SchemaNamePrefix"
+ value "")
+ (object Attribute
+ tool "Oracle8"
+ name "SchemaNameSuffix"
+ value "")
+ (object Attribute
+ tool "Oracle8"
+ name "TableNamePrefix"
+ value "")
+ (object Attribute
+ tool "Oracle8"
+ name "TableNameSuffix"
+ value "")
+ (object Attribute
+ tool "Oracle8"
+ name "TypeNamePrefix"
+ value "")
+ (object Attribute
+ tool "Oracle8"
+ name "TypeNameSuffix"
+ value "")
+ (object Attribute
+ tool "Oracle8"
+ name "ViewNamePrefix"
+ value "")
+ (object Attribute
+ tool "Oracle8"
+ name "ViewNameSuffix"
+ value "")
+ (object Attribute
+ tool "Oracle8"
+ name "VarrayNamePrefix"
+ value "")
+ (object Attribute
+ tool "Oracle8"
+ name "VarrayNameSuffix"
+ value "")
+ (object Attribute
+ tool "Oracle8"
+ name "NestedTableNamePrefix"
+ value "")
+ (object Attribute
+ tool "Oracle8"
+ name "NestedTableNameSuffix"
+ value "")
+ (object Attribute
+ tool "Oracle8"
+ name "ObjectTableNamePrefix"
+ value "")
+ (object Attribute
+ tool "Oracle8"
+ name "ObjectTableNameSuffix"
+ value "")))
+ (object Attribute
+ tool "Oracle8"
+ name "default__Module-Spec"
+ value (list Attribute_Set
+ (object Attribute
+ tool "Oracle8"
+ name "IsSchema"
+ value FALSE)))
+ (object Attribute
+ tool "Oracle8"
+ name "default__Class"
+ value (list Attribute_Set
+ (object Attribute
+ tool "Oracle8"
+ name "OID"
+ value "")
+ (object Attribute
+ tool "Oracle8"
+ name "WhereClause"
+ value "")
+ (object Attribute
+ tool "Oracle8"
+ name "CheckConstraint"
+ value "")
+ (object Attribute
+ tool "Oracle8"
+ name "CollectionTypeLength"
+ value "")
+ (object Attribute
+ tool "Oracle8"
+ name "CollectionTypePrecision"
+ value "")
+ (object Attribute
+ tool "Oracle8"
+ name "CollectionTypeScale"
+ value "")
+ (object Attribute
+ tool "Oracle8"
+ name "CollectionOfREFS"
+ value FALSE)))
+ (object Attribute
+ tool "Oracle8"
+ name "default__Operation"
+ value (list Attribute_Set
+ (object Attribute
+ tool "Oracle8"
+ name "MethodKind"
+ value ("MethodKindSet" 1903))
+ (object Attribute
+ tool "Oracle8"
+ name "OverloadID"
+ value "")
+ (object Attribute
+ tool "Oracle8"
+ name "OrderNumber"
+ value "")
+ (object Attribute
+ tool "Oracle8"
+ name "IsReadNoDataState"
+ value FALSE)
+ (object Attribute
+ tool "Oracle8"
+ name "IsReadNoProcessState"
+ value FALSE)
+ (object Attribute
+ tool "Oracle8"
+ name "IsWriteNoDataState"
+ value FALSE)
+ (object Attribute
+ tool "Oracle8"
+ name "IsWriteNoProcessState"
+ value FALSE)
+ (object Attribute
+ tool "Oracle8"
+ name "IsSelfish"
+ value FALSE)
+ (object Attribute
+ tool "Oracle8"
+ name "TriggerType"
+ value ("TriggerTypeSet" 1801))
+ (object Attribute
+ tool "Oracle8"
+ name "TriggerEvent"
+ value ("TriggerEventSet" 1601))
+ (object Attribute
+ tool "Oracle8"
+ name "TriggerText"
+ value "")
+ (object Attribute
+ tool "Oracle8"
+ name "TriggerReferencingNames"
+ value "")
+ (object Attribute
+ tool "Oracle8"
+ name "TriggerForEach"
+ value ("TriggerForEachSet" 1701))
+ (object Attribute
+ tool "Oracle8"
+ name "TriggerWhenClause"
+ value "")
+ (object Attribute
+ tool "Oracle8"
+ name "MethodKindSet"
+ value (list Attribute_Set
+ (object Attribute
+ tool "Oracle8"
+ name "MapMethod"
+ value 1901)
+ (object Attribute
+ tool "Oracle8"
+ name "OrderMethod"
+ value 1902)
+ (object Attribute
+ tool "Oracle8"
+ name "Function"
+ value 1903)
+ (object Attribute
+ tool "Oracle8"
+ name "Procedure"
+ value 1904)
+ (object Attribute
+ tool "Oracle8"
+ name "Operator"
+ value 1905)
+ (object Attribute
+ tool "Oracle8"
+ name "Constructor"
+ value 1906)
+ (object Attribute
+ tool "Oracle8"
+ name "Destructor"
+ value 1907)
+ (object Attribute
+ tool "Oracle8"
+ name "Trigger"
+ value 1908)
+ (object Attribute
+ tool "Oracle8"
+ name "Calculated"
+ value 1909)))
+ (object Attribute
+ tool "Oracle8"
+ name "TriggerTypeSet"
+ value (list Attribute_Set
+ (object Attribute
+ tool "Oracle8"
+ name "AFTER"
+ value 1801)
+ (object Attribute
+ tool "Oracle8"
+ name "BEFORE"
+ value 1802)
+ (object Attribute
+ tool "Oracle8"
+ name "INSTEAD OF"
+ value 1803)))
+ (object Attribute
+ tool "Oracle8"
+ name "TriggerForEachSet"
+ value (list Attribute_Set
+ (object Attribute
+ tool "Oracle8"
+ name "ROW"
+ value 1701)
+ (object Attribute
+ tool "Oracle8"
+ name "STATEMENT"
+ value 1702)))
+ (object Attribute
+ tool "Oracle8"
+ name "TriggerEventSet"
+ value (list Attribute_Set
+ (object Attribute
+ tool "Oracle8"
+ name "INSERT"
+ value 1601)
+ (object Attribute
+ tool "Oracle8"
+ name "UPDATE"
+ value 1602)
+ (object Attribute
+ tool "Oracle8"
+ name "DELETE"
+ value 1603)
+ (object Attribute
+ tool "Oracle8"
+ name "INSERT OR UPDATE"
+ value 1604)
+ (object Attribute
+ tool "Oracle8"
+ name "INSERT OR DELETE"
+ value 1605)
+ (object Attribute
+ tool "Oracle8"
+ name "UPDATE OR DELETE"
+ value 1606)
+ (object Attribute
+ tool "Oracle8"
+ name "INSERT OR UPDATE OR DELETE"
+ value 1607)))))
+ (object Attribute
+ tool "Oracle8"
+ name "default__Role"
+ value (list Attribute_Set
+ (object Attribute
+ tool "Oracle8"
+ name "OrderNumber"
+ value "")))
+ (object Attribute
+ tool "Oracle8"
+ name "default__Attribute"
+ value (list Attribute_Set
+ (object Attribute
+ tool "Oracle8"
+ name "OrderNumber"
+ value "")
+ (object Attribute
+ tool "Oracle8"
+ name "IsUnique"
+ value FALSE)
+ (object Attribute
+ tool "Oracle8"
+ name "NullsAllowed"
+ value TRUE)
+ (object Attribute
+ tool "Oracle8"
+ name "Length"
+ value "")
+ (object Attribute
+ tool "Oracle8"
+ name "Precision"
+ value "2")
+ (object Attribute
+ tool "Oracle8"
+ name "Scale"
+ value "6")
+ (object Attribute
+ tool "Oracle8"
+ name "IsIndex"
+ value FALSE)
+ (object Attribute
+ tool "Oracle8"
+ name "IsPrimaryKey"
+ value FALSE)
+ (object Attribute
+ tool "Oracle8"
+ name "CompositeUnique"
+ value FALSE)
+ (object Attribute
+ tool "Oracle8"
+ name "CheckConstraint"
+ value "")))
+ (object Attribute
+ tool "Oracle8"
+ name "HiddenTool"
+ value FALSE)
+ (object Attribute
+ tool "Repository"
+ name "HiddenTool"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "propertyId"
+ value "809135966")
+ (object Attribute
+ tool "cg"
+ name "default__Project"
+ value (list Attribute_Set
+ (object Attribute
+ tool "cg"
+ name "UseMSVC"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "HeaderFileExtension"
+ value "h")
+ (object Attribute
+ tool "cg"
+ name "HeaderFileBackupExtension"
+ value "h~")
+ (object Attribute
+ tool "cg"
+ name "HeaderFileTemporaryExtension"
+ value "h#")
+ (object Attribute
+ tool "cg"
+ name "CodeFileExtension"
+ value "cpp")
+ (object Attribute
+ tool "cg"
+ name "CodeFileBackupExtension"
+ value "cp~")
+ (object Attribute
+ tool "cg"
+ name "CodeFileTemporaryExtension"
+ value "cp#")
+ (object Attribute
+ tool "cg"
+ name "CreateMissingDirectories"
+ value TRUE)
+ (object Attribute
+ tool "cg"
+ name "StopOnError"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "ErrorLimit"
+ value 30)
+ (object Attribute
+ tool "cg"
+ name "Directory"
+ value "$ROSECPP_SOURCE")
+ (object Attribute
+ tool "cg"
+ name "PathSeparator"
+ value "")
+ (object Attribute
+ tool "cg"
+ name "FileNameFormat"
+ value "128vx_b")
+ (object Attribute
+ tool "cg"
+ name "BooleanType"
+ value "int")
+ (object Attribute
+ tool "cg"
+ name "AllowTemplates"
+ value TRUE)
+ (object Attribute
+ tool "cg"
+ name "AllowExplicitInstantiations"
+ value TRUE)
+ (object Attribute
+ tool "cg"
+ name "AllowProtectedInheritance"
+ value TRUE)
+ (object Attribute
+ tool "cg"
+ name "CommentWidth"
+ value 60)
+ (object Attribute
+ tool "cg"
+ name "OneByValueContainer"
+ value "$targetClass")
+ (object Attribute
+ tool "cg"
+ name "OneByReferenceContainer"
+ value "$targetClass *")
+ (object Attribute
+ tool "cg"
+ name "OptionalByValueContainer"
+ value "OptionalByValue<$targetClass>")
+ (object Attribute
+ tool "cg"
+ name "OptionalByReferenceContainer"
+ value "$targetClass *")
+ (object Attribute
+ tool "cg"
+ name "FixedByValueContainer"
+ value "$targetClass[$limit]")
+ (object Attribute
+ tool "cg"
+ name "UnorderedFixedByValueContainer"
+ value "$targetClass[$limit]")
+ (object Attribute
+ tool "cg"
+ name "FixedByReferenceContainer"
+ value "$targetClass *[$limit]")
+ (object Attribute
+ tool "cg"
+ name "UnorderedFixedByReferenceContainer"
+ value "$targetClass *[$limit]")
+ (object Attribute
+ tool "cg"
+ name "BoundedByValueContainer"
+ value "BoundedListByValue<$targetClass,$limit>")
+ (object Attribute
+ tool "cg"
+ name "UnorderedBoundedByValueContainer"
+ value "BoundedSetByValue<$targetClass,$limit>")
+ (object Attribute
+ tool "cg"
+ name "BoundedByReferenceContainer"
+ value "BoundedListByReference<$targetClass,$limit>")
+ (object Attribute
+ tool "cg"
+ name "UnorderedBoundedByReferenceContainer"
+ value "BoundedSetByReference<$targetClass,$limit>")
+ (object Attribute
+ tool "cg"
+ name "UnboundedByValueContainer"
+ value "UnboundedListByValue<$targetClass>")
+ (object Attribute
+ tool "cg"
+ name "UnorderedUnboundedByValueContainer"
+ value "UnboundedSetByValue<$targetClass>")
+ (object Attribute
+ tool "cg"
+ name "UnboundedByReferenceContainer"
+ value "UnboundedListByReference<$targetClass>")
+ (object Attribute
+ tool "cg"
+ name "UnorderedUnboundedByReferenceContainer"
+ value "UnboundedSetByReference<$targetClass>")
+ (object Attribute
+ tool "cg"
+ name "QualifiedByValueContainer"
+ value "AssociationByValue<$qualtype, $qualcont>")
+ (object Attribute
+ tool "cg"
+ name "UnorderedQualifiedByValueContainer"
+ value "DictionaryByValue<$qualtype, $qualcont>")
+ (object Attribute
+ tool "cg"
+ name "QualifiedByReferenceContainer"
+ value "AssociationByReference<$qualtype, $qualcont>")
+ (object Attribute
+ tool "cg"
+ name "UnorderedQualifiedByReferenceContainer"
+ value "DictionaryByReference<$qualtype, $qualcont>")
+ (object Attribute
+ tool "cg"
+ name "GeneratePreserveRegions"
+ value TRUE)))
+ (object Attribute
+ tool "cg"
+ name "default__Class"
+ value (list Attribute_Set
+ (object Attribute
+ tool "cg"
+ name "CodeName"
+ value "")
+ (object Attribute
+ tool "cg"
+ name "ImplementationType"
+ value "")
+ (object Attribute
+ tool "cg"
+ name "ClassKey"
+ value "class")
+ (object Attribute
+ tool "cg"
+ name "GenerateEmptyRegions"
+ value ("GenerateEmptyRegionSet" 3))
+ (object Attribute
+ tool "cg"
+ name "GenerateEmptyRegionSet"
+ value (list Attribute_Set
+ (object Attribute
+ tool "cg"
+ name "None"
+ value 0)
+ (object Attribute
+ tool "cg"
+ name "Preserved"
+ value 1)
+ (object Attribute
+ tool "cg"
+ name "Unpreserved"
+ value 2)
+ (object Attribute
+ tool "cg"
+ name "All"
+ value 3)))
+ (object Attribute
+ tool "cg"
+ name "PutBodiesInSpec"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "GenerateDefaultConstructor"
+ value ("GenerateSet" 199))
+ (object Attribute
+ tool "cg"
+ name "DefaultConstructorVisibility"
+ value ("VisibilitySet" 45))
+ (object Attribute
+ tool "cg"
+ name "InlineDefaultConstructor"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "ExplicitDefaultConstructor"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "GenerateCopyConstructor"
+ value ("GenerateSet" 199))
+ (object Attribute
+ tool "cg"
+ name "CopyConstructorVisibility"
+ value ("VisibilitySet" 45))
+ (object Attribute
+ tool "cg"
+ name "InlineCopyConstructor"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "ExplicitCopyConstructor"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "GenerateDestructor"
+ value TRUE)
+ (object Attribute
+ tool "cg"
+ name "DestructorVisibility"
+ value ("VisibilitySet" 45))
+ (object Attribute
+ tool "cg"
+ name "DestructorKind"
+ value ("ThreeKindSet" 200))
+ (object Attribute
+ tool "cg"
+ name "InlineDestructor"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "GenerateAssignmentOperation"
+ value ("GenerateSet" 199))
+ (object Attribute
+ tool "cg"
+ name "AssignmentVisibility"
+ value ("VisibilitySet" 45))
+ (object Attribute
+ tool "cg"
+ name "AssignmentKind"
+ value ("ThreeKindSet" 200))
+ (object Attribute
+ tool "cg"
+ name "InlineAssignmentOperation"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "GenerateEqualityOperations"
+ value ("GenerateSet" 199))
+ (object Attribute
+ tool "cg"
+ name "EqualityVisibility"
+ value ("VisibilitySet" 45))
+ (object Attribute
+ tool "cg"
+ name "EqualityKind"
+ value ("FriendKindSet" 200))
+ (object Attribute
+ tool "cg"
+ name "InlineEqualityOperations"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "GenerateRelationalOperations"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "RelationalVisibility"
+ value ("VisibilitySet" 45))
+ (object Attribute
+ tool "cg"
+ name "RelationalKind"
+ value ("FriendKindSet" 200))
+ (object Attribute
+ tool "cg"
+ name "InlineRelationalOperations"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "GenerateStorageMgmtOperations"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "StorageMgmtVisibility"
+ value ("VisibilitySet" 45))
+ (object Attribute
+ tool "cg"
+ name "InlineStorageMgmtOperations"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "GenerateSubscriptOperation"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "SubscriptVisibility"
+ value ("VisibilitySet" 45))
+ (object Attribute
+ tool "cg"
+ name "SubscriptKind"
+ value ("ThreeKindSet" 200))
+ (object Attribute
+ tool "cg"
+ name "SubscriptResultType"
+ value "")
+ (object Attribute
+ tool "cg"
+ name "InlineSubscriptOperation"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "GenerateDereferenceOperation"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "DereferenceVisibility"
+ value ("VisibilitySet" 45))
+ (object Attribute
+ tool "cg"
+ name "DereferenceKind"
+ value ("ThreeKindSet" 200))
+ (object Attribute
+ tool "cg"
+ name "DereferenceResultType"
+ value "")
+ (object Attribute
+ tool "cg"
+ name "InlineDereferenceOperation"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "GenerateIndirectionOperation"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "IndirectionVisibility"
+ value ("VisibilitySet" 45))
+ (object Attribute
+ tool "cg"
+ name "IndirectionKind"
+ value ("ThreeKindSet" 200))
+ (object Attribute
+ tool "cg"
+ name "IndirectionResultType"
+ value "")
+ (object Attribute
+ tool "cg"
+ name "InlineIndirectionOperation"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "GenerateStreamOperations"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "StreamVisibility"
+ value ("VisibilitySet" 45))
+ (object Attribute
+ tool "cg"
+ name "InlineStreamOperations"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "ThreeKindSet"
+ value (list Attribute_Set
+ (object Attribute
+ tool "cg"
+ name "Common"
+ value 200)
+ (object Attribute
+ tool "cg"
+ name "Virtual"
+ value 201)
+ (object Attribute
+ tool "cg"
+ name "Abstract"
+ value 202)))
+ (object Attribute
+ tool "cg"
+ name "KindSet"
+ value (list Attribute_Set
+ (object Attribute
+ tool "cg"
+ name "Common"
+ value 200)
+ (object Attribute
+ tool "cg"
+ name "Virtual"
+ value 201)
+ (object Attribute
+ tool "cg"
+ name "Abstract"
+ value 202)
+ (object Attribute
+ tool "cg"
+ name "Static"
+ value 203)))
+ (object Attribute
+ tool "cg"
+ name "FriendKindSet"
+ value (list Attribute_Set
+ (object Attribute
+ tool "cg"
+ name "Common"
+ value 200)
+ (object Attribute
+ tool "cg"
+ name "Virtual"
+ value 201)
+ (object Attribute
+ tool "cg"
+ name "Abstract"
+ value 202)
+ (object Attribute
+ tool "cg"
+ name "Friend"
+ value 204)))
+ (object Attribute
+ tool "cg"
+ name "GenerateSet"
+ value (list Attribute_Set
+ (object Attribute
+ tool "cg"
+ name "DeclareAndDefine"
+ value 199)
+ (object Attribute
+ tool "cg"
+ name "DeclareOnly"
+ value 205)
+ (object Attribute
+ tool "cg"
+ name "DoNotDeclare"
+ value 206)))
+ (object Attribute
+ tool "cg"
+ name "VisibilitySet"
+ value (list Attribute_Set
+ (object Attribute
+ tool "cg"
+ name "Public"
+ value 45)
+ (object Attribute
+ tool "cg"
+ name "Protected"
+ value 44)
+ (object Attribute
+ tool "cg"
+ name "Private"
+ value 43)
+ (object Attribute
+ tool "cg"
+ name "Implementation"
+ value 14)))
+ (object Attribute
+ tool "cg"
+ name "ConstValue"
+ value "")
+ (object Attribute
+ tool "cg"
+ name "GenerateDefaultSpecifier"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "DefaultSpecifier"
+ value "")))
+ (object Attribute
+ tool "cg"
+ name "default__Module-Spec"
+ value (list Attribute_Set
+ (object Attribute
+ tool "cg"
+ name "Generate"
+ value TRUE)
+ (object Attribute
+ tool "cg"
+ name "GenerateEmptyRegions"
+ value ("GenerateEmptyRegionSet" 3))
+ (object Attribute
+ tool "cg"
+ name "GenerateEmptyRegionSet"
+ value (list Attribute_Set
+ (object Attribute
+ tool "cg"
+ name "None"
+ value 0)
+ (object Attribute
+ tool "cg"
+ name "Preserved"
+ value 1)
+ (object Attribute
+ tool "cg"
+ name "Unpreserved"
+ value 2)
+ (object Attribute
+ tool "cg"
+ name "All"
+ value 3)))
+ (object Attribute
+ tool "cg"
+ name "CmIdentification"
+ value (value Text " %X% %Q% %Z% %W%"))
+ (object Attribute
+ tool "cg"
+ name "CopyrightNotice"
+ value (value Text ""))
+ (object Attribute
+ tool "cg"
+ name "FileName"
+ value "AUTO GENERATE")
+ (object Attribute
+ tool "cg"
+ name "AllowExtensionlessFileName"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "InclusionProtectionSymbol"
+ value "AUTO GENERATE")
+ (object Attribute
+ tool "cg"
+ name "IncludeFormat"
+ value (value Text
+|// $package
+|#include "$file"
+|
+ ))
+ (object Attribute
+ tool "cg"
+ name "IncludeBySimpleName"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "IncludePrecompiledHeader"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "IncludeOrder"
+ value "AMIR")
+ (object Attribute
+ tool "cg"
+ name "AdditionalIncludes"
+ value (value Text ""))
+ (object Attribute
+ tool "cg"
+ name "InliningStyle"
+ value ("InliningStyleSet" 207))
+ (object Attribute
+ tool "cg"
+ name "InliningStyleSet"
+ value (list Attribute_Set
+ (object Attribute
+ tool "cg"
+ name "InClassDeclaration"
+ value 208)
+ (object Attribute
+ tool "cg"
+ name "FollowingClassDeclaration"
+ value 207)))
+ (object Attribute
+ tool "cg"
+ name "TypesDefined"
+ value (value Text ""))
+ (object Attribute
+ tool "cg"
+ name "IncludeClosure"
+ value (value Text ""))))
+ (object Attribute
+ tool "cg"
+ name "default__Module-Body"
+ value (list Attribute_Set
+ (object Attribute
+ tool "cg"
+ name "Generate"
+ value TRUE)
+ (object Attribute
+ tool "cg"
+ name "GenerateEmptyRegions"
+ value ("GenerateEmptyRegionSet" 3))
+ (object Attribute
+ tool "cg"
+ name "GenerateEmptyRegionSet"
+ value (list Attribute_Set
+ (object Attribute
+ tool "cg"
+ name "None"
+ value 0)
+ (object Attribute
+ tool "cg"
+ name "Preserved"
+ value 1)
+ (object Attribute
+ tool "cg"
+ name "Unpreserved"
+ value 2)
+ (object Attribute
+ tool "cg"
+ name "All"
+ value 3)))
+ (object Attribute
+ tool "cg"
+ name "CmIdentification"
+ value (value Text " %X% %Q% %Z% %W%"))
+ (object Attribute
+ tool "cg"
+ name "CopyrightNotice"
+ value (value Text ""))
+ (object Attribute
+ tool "cg"
+ name "FileName"
+ value "AUTO GENERATE")
+ (object Attribute
+ tool "cg"
+ name "AllowExtensionlessFileName"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "IncludeFormat"
+ value (value Text
+|// $package
+|#include "$file"
+|
+ ))
+ (object Attribute
+ tool "cg"
+ name "IncludeBySimpleName"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "IncludePrecompiledHeader"
+ value TRUE)
+ (object Attribute
+ tool "cg"
+ name "IncludeOrder"
+ value "AMIR")
+ (object Attribute
+ tool "cg"
+ name "AdditionalIncludes"
+ value (value Text ""))
+ (object Attribute
+ tool "cg"
+ name "InliningStyle"
+ value ("InliningStyleSet" 207))
+ (object Attribute
+ tool "cg"
+ name "InliningStyleSet"
+ value (list Attribute_Set
+ (object Attribute
+ tool "cg"
+ name "InClassDeclaration"
+ value 208)
+ (object Attribute
+ tool "cg"
+ name "FollowingClassDeclaration"
+ value 207)))
+ (object Attribute
+ tool "cg"
+ name "TypesDefined"
+ value (value Text ""))
+ (object Attribute
+ tool "cg"
+ name "IncludeClosure"
+ value (value Text ""))))
+ (object Attribute
+ tool "cg"
+ name "default__Operation"
+ value (list Attribute_Set
+ (object Attribute
+ tool "cg"
+ name "CodeName"
+ value "")
+ (object Attribute
+ tool "cg"
+ name "OperationKind"
+ value ("OperationKindSet" 200))
+ (object Attribute
+ tool "cg"
+ name "OperationKindSet"
+ value (list Attribute_Set
+ (object Attribute
+ tool "cg"
+ name "Common"
+ value 200)
+ (object Attribute
+ tool "cg"
+ name "Virtual"
+ value 201)
+ (object Attribute
+ tool "cg"
+ name "Abstract"
+ value 202)
+ (object Attribute
+ tool "cg"
+ name "Static"
+ value 203)
+ (object Attribute
+ tool "cg"
+ name "Friend"
+ value 204)))
+ (object Attribute
+ tool "cg"
+ name "OperationIsConst"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "OperationIsExplicit"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "Inline"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "EntryCode"
+ value (value Text ""))
+ (object Attribute
+ tool "cg"
+ name "ExitCode"
+ value (value Text ""))
+ (object Attribute
+ tool "cg"
+ name "GenerateEmptyRegions"
+ value ("GenerateEmptyRegionSet" 3))
+ (object Attribute
+ tool "cg"
+ name "GenerateEmptyRegionSet"
+ value (list Attribute_Set
+ (object Attribute
+ tool "cg"
+ name "None"
+ value 0)
+ (object Attribute
+ tool "cg"
+ name "Preserved"
+ value 1)
+ (object Attribute
+ tool "cg"
+ name "Unpreserved"
+ value 2)
+ (object Attribute
+ tool "cg"
+ name "All"
+ value 3)))
+ (object Attribute
+ tool "cg"
+ name "BodyAnnotations"
+ value "")
+ (object Attribute
+ tool "cg"
+ name "OperationIsOneWay"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "Context"
+ value "")
+ (object Attribute
+ tool "cg"
+ name "Raises"
+ value "")))
+ (object Attribute
+ tool "cg"
+ name "default__Has"
+ value (list Attribute_Set
+ (object Attribute
+ tool "cg"
+ name "CodeName"
+ value "")
+ (object Attribute
+ tool "cg"
+ name "Ordered"
+ value TRUE)
+ (object Attribute
+ tool "cg"
+ name "NameIfUnlabeled"
+ value "the_$supplier")
+ (object Attribute
+ tool "cg"
+ name "GenerateDataMember"
+ value TRUE)
+ (object Attribute
+ tool "cg"
+ name "DataMemberName"
+ value "$relationship")
+ (object Attribute
+ tool "cg"
+ name "DataMemberVisibility"
+ value ("DataMemberVisibilitySet" 14))
+ (object Attribute
+ tool "cg"
+ name "DataMemberVisibilitySet"
+ value (list Attribute_Set
+ (object Attribute
+ tool "cg"
+ name "Public"
+ value 45)
+ (object Attribute
+ tool "cg"
+ name "Protected"
+ value 44)
+ (object Attribute
+ tool "cg"
+ name "Private"
+ value 43)
+ (object Attribute
+ tool "cg"
+ name "Implementation"
+ value 14)
+ (object Attribute
+ tool "cg"
+ name "AtRelationshipVisibility"
+ value 210)))
+ (object Attribute
+ tool "cg"
+ name "DataMemberMutability"
+ value ("DataMemberMutabilitySet" 0))
+ (object Attribute
+ tool "cg"
+ name "DataMemberMutabilitySet"
+ value (list Attribute_Set
+ (object Attribute
+ tool "cg"
+ name "Unrestricted"
+ value 0)
+ (object Attribute
+ tool "cg"
+ name "Mutable"
+ value 1)
+ (object Attribute
+ tool "cg"
+ name "Const"
+ value 2)))
+ (object Attribute
+ tool "cg"
+ name "DataMemberIsVolatile"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "DataMemberFieldSize"
+ value "")
+ (object Attribute
+ tool "cg"
+ name "InitialValue"
+ value (value Text ""))
+ (object Attribute
+ tool "cg"
+ name "GenerateGetOperation"
+ value TRUE)
+ (object Attribute
+ tool "cg"
+ name "GenerateSetOperation"
+ value TRUE)
+ (object Attribute
+ tool "cg"
+ name "GetName"
+ value "get_$relationship")
+ (object Attribute
+ tool "cg"
+ name "SetName"
+ value "set_$relationship")
+ (object Attribute
+ tool "cg"
+ name "GetSetKinds"
+ value ("GetSetKindsSet" 200))
+ (object Attribute
+ tool "cg"
+ name "GetSetKindsSet"
+ value (list Attribute_Set
+ (object Attribute
+ tool "cg"
+ name "Common"
+ value 200)
+ (object Attribute
+ tool "cg"
+ name "Virtual"
+ value 201)
+ (object Attribute
+ tool "cg"
+ name "Abstract"
+ value 202)
+ (object Attribute
+ tool "cg"
+ name "Static"
+ value 203)
+ (object Attribute
+ tool "cg"
+ name "Friend"
+ value 204)))
+ (object Attribute
+ tool "cg"
+ name "ContainerClass"
+ value "")
+ (object Attribute
+ tool "cg"
+ name "SelectorName"
+ value "")
+ (object Attribute
+ tool "cg"
+ name "SelectorType"
+ value "")
+ (object Attribute
+ tool "cg"
+ name "GetIsConst"
+ value TRUE)
+ (object Attribute
+ tool "cg"
+ name "GetResultIsConst"
+ value ("GetResultIsConstSet" 2))
+ (object Attribute
+ tool "cg"
+ name "GetResultIsConstSet"
+ value (list Attribute_Set
+ (object Attribute
+ tool "cg"
+ name "False"
+ value 0)
+ (object Attribute
+ tool "cg"
+ name "True"
+ value 1)
+ (object Attribute
+ tool "cg"
+ name "Same_As_Function"
+ value 2)))
+ (object Attribute
+ tool "cg"
+ name "GetSetByReference"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "InlineGet"
+ value TRUE)
+ (object Attribute
+ tool "cg"
+ name "SetReturnsValue"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "InlineSet"
+ value TRUE)
+ (object Attribute
+ tool "cg"
+ name "ForwardReferenceOnly"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "GenerateForwardReference"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "IsReadOnly"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "BoundedHasRelType"
+ value ("HasRelTypeSet" 47))
+ (object Attribute
+ tool "cg"
+ name "HasRelTypeSet"
+ value (list Attribute_Set
+ (object Attribute
+ tool "cg"
+ name "Array"
+ value 24)
+ (object Attribute
+ tool "cg"
+ name "Sequence"
+ value 47)))))
+ (object Attribute
+ tool "cg"
+ name "default__Association"
+ value (list Attribute_Set
+ (object Attribute
+ tool "cg"
+ name "NameIfUnlabeled"
+ value "the_$targetClass")))
+ (object Attribute
+ tool "cg"
+ name "default__Inherit"
+ value (list Attribute_Set
+ (object Attribute
+ tool "cg"
+ name "InstanceArguments"
+ value "")))
+ (object Attribute
+ tool "cg"
+ name "default__Role"
+ value (list Attribute_Set
+ (object Attribute
+ tool "cg"
+ name "CodeName"
+ value "")
+ (object Attribute
+ tool "cg"
+ name "ForwardReferenceOnly"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "NameIfUnlabeled"
+ value "the_$targetClass")
+ (object Attribute
+ tool "cg"
+ name "GenerateDataMember"
+ value TRUE)
+ (object Attribute
+ tool "cg"
+ name "DataMemberName"
+ value "$target")
+ (object Attribute
+ tool "cg"
+ name "DataMemberVisibility"
+ value ("DataMemberVisibilitySet" 14))
+ (object Attribute
+ tool "cg"
+ name "DataMemberVisibilitySet"
+ value (list Attribute_Set
+ (object Attribute
+ tool "cg"
+ name "Public"
+ value 45)
+ (object Attribute
+ tool "cg"
+ name "Protected"
+ value 44)
+ (object Attribute
+ tool "cg"
+ name "Private"
+ value 43)
+ (object Attribute
+ tool "cg"
+ name "Implementation"
+ value 14)
+ (object Attribute
+ tool "cg"
+ name "AtRelationshipVisibility"
+ value 210)))
+ (object Attribute
+ tool "cg"
+ name "DataMemberMutability"
+ value ("DataMemberMutabilitySet" 0))
+ (object Attribute
+ tool "cg"
+ name "DataMemberMutabilitySet"
+ value (list Attribute_Set
+ (object Attribute
+ tool "cg"
+ name "Unrestricted"
+ value 0)
+ (object Attribute
+ tool "cg"
+ name "Mutable"
+ value 1)
+ (object Attribute
+ tool "cg"
+ name "Const"
+ value 2)))
+ (object Attribute
+ tool "cg"
+ name "DataMemberIsVolatile"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "DataMemberFieldSize"
+ value "")
+ (object Attribute
+ tool "cg"
+ name "InitialValue"
+ value (value Text ""))
+ (object Attribute
+ tool "cg"
+ name "ContainerClass"
+ value "")
+ (object Attribute
+ tool "cg"
+ name "ContainerGet"
+ value "$data.get($keys)")
+ (object Attribute
+ tool "cg"
+ name "ContainerSet"
+ value "$data.set($keys,$value)")
+ (object Attribute
+ tool "cg"
+ name "QualifiedContainer"
+ value "")
+ (object Attribute
+ tool "cg"
+ name "AssocClassContainer"
+ value "$supplier *")
+ (object Attribute
+ tool "cg"
+ name "AssocClassInitialValue"
+ value (value Text ""))
+ (object Attribute
+ tool "cg"
+ name "GetSetKinds"
+ value ("GetSetKindsSet" 200))
+ (object Attribute
+ tool "cg"
+ name "GetSetKindsSet"
+ value (list Attribute_Set
+ (object Attribute
+ tool "cg"
+ name "Common"
+ value 200)
+ (object Attribute
+ tool "cg"
+ name "Virtual"
+ value 201)
+ (object Attribute
+ tool "cg"
+ name "Abstract"
+ value 202)
+ (object Attribute
+ tool "cg"
+ name "Static"
+ value 203)
+ (object Attribute
+ tool "cg"
+ name "Friend"
+ value 204)))
+ (object Attribute
+ tool "cg"
+ name "GetSetByReference"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "GenerateGetOperation"
+ value TRUE)
+ (object Attribute
+ tool "cg"
+ name "GetName"
+ value "get_$target")
+ (object Attribute
+ tool "cg"
+ name "GetIsConst"
+ value TRUE)
+ (object Attribute
+ tool "cg"
+ name "GetResultIsConst"
+ value ("GetResultIsConstSet" 2))
+ (object Attribute
+ tool "cg"
+ name "GetResultIsConstSet"
+ value (list Attribute_Set
+ (object Attribute
+ tool "cg"
+ name "False"
+ value 0)
+ (object Attribute
+ tool "cg"
+ name "True"
+ value 1)
+ (object Attribute
+ tool "cg"
+ name "Same_As_Function"
+ value 2)))
+ (object Attribute
+ tool "cg"
+ name "InlineGet"
+ value TRUE)
+ (object Attribute
+ tool "cg"
+ name "GenerateSetOperation"
+ value TRUE)
+ (object Attribute
+ tool "cg"
+ name "SetName"
+ value "set_$target")
+ (object Attribute
+ tool "cg"
+ name "SetReturnsValue"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "InlineSet"
+ value TRUE)
+ (object Attribute
+ tool "cg"
+ name "QualifiedGetSetByReference"
+ value ("QualifiedGetSetByReferenceSet" 2))
+ (object Attribute
+ tool "cg"
+ name "QualifiedGetSetByReferenceSet"
+ value (list Attribute_Set
+ (object Attribute
+ tool "cg"
+ name "False"
+ value 0)
+ (object Attribute
+ tool "cg"
+ name "True"
+ value 1)
+ (object Attribute
+ tool "cg"
+ name "Same_As_GetSetByReference"
+ value 2)))
+ (object Attribute
+ tool "cg"
+ name "GenerateQualifiedGetOperation"
+ value TRUE)
+ (object Attribute
+ tool "cg"
+ name "QualifiedGetName"
+ value "get_$target")
+ (object Attribute
+ tool "cg"
+ name "QualifiedGetIsConst"
+ value TRUE)
+ (object Attribute
+ tool "cg"
+ name "QualifiedGetResultIsConst"
+ value ("GetResultIsConstSet" 2))
+ (object Attribute
+ tool "cg"
+ name "InlineQualifiedGet"
+ value TRUE)
+ (object Attribute
+ tool "cg"
+ name "GenerateQualifiedSetOperation"
+ value TRUE)
+ (object Attribute
+ tool "cg"
+ name "QualifiedSetName"
+ value "set_$target")
+ (object Attribute
+ tool "cg"
+ name "QualifiedSetReturnsValue"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "InlineQualifiedSet"
+ value TRUE)
+ (object Attribute
+ tool "cg"
+ name "GenerateAssocClassDataMember"
+ value TRUE)
+ (object Attribute
+ tool "cg"
+ name "AssocClassDataMemberName"
+ value "$target")
+ (object Attribute
+ tool "cg"
+ name "AssocClassDataMemberVisibility"
+ value ("DataMemberVisibilitySet" 14))
+ (object Attribute
+ tool "cg"
+ name "DataMemberVisibilitySet"
+ value (list Attribute_Set
+ (object Attribute
+ tool "cg"
+ name "Public"
+ value 45)
+ (object Attribute
+ tool "cg"
+ name "Protected"
+ value 44)
+ (object Attribute
+ tool "cg"
+ name "Private"
+ value 43)
+ (object Attribute
+ tool "cg"
+ name "Implementation"
+ value 14)
+ (object Attribute
+ tool "cg"
+ name "AtRelationshipVisibility"
+ value 210)))
+ (object Attribute
+ tool "cg"
+ name "AssocClassDataMemberMutability"
+ value ("DataMemberMutabilitySet" 0))
+ (object Attribute
+ tool "cg"
+ name "DataMemberMutabilitySet"
+ value (list Attribute_Set
+ (object Attribute
+ tool "cg"
+ name "Unrestricted"
+ value 0)
+ (object Attribute
+ tool "cg"
+ name "Mutable"
+ value 1)
+ (object Attribute
+ tool "cg"
+ name "Const"
+ value 2)))
+ (object Attribute
+ tool "cg"
+ name "AssocClassDataMemberIsVolatile"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "AssocClassGetSetKinds"
+ value ("GetSetKindsSet" 200))
+ (object Attribute
+ tool "cg"
+ name "GenerateAssocClassGetOperation"
+ value TRUE)
+ (object Attribute
+ tool "cg"
+ name "AssocClassGetName"
+ value "get_$target")
+ (object Attribute
+ tool "cg"
+ name "AssocClassGetIsConst"
+ value TRUE)
+ (object Attribute
+ tool "cg"
+ name "AssocClassGetResultIsConst"
+ value ("GetResultIsConstSet" 2))
+ (object Attribute
+ tool "cg"
+ name "InlineAssocClassGet"
+ value TRUE)
+ (object Attribute
+ tool "cg"
+ name "GenerateAssocClassSetOperation"
+ value TRUE)
+ (object Attribute
+ tool "cg"
+ name "AssocClassSetName"
+ value "set_$target")
+ (object Attribute
+ tool "cg"
+ name "AssocClassSetReturnsValue"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "InlineAssocClassSet"
+ value TRUE)
+ (object Attribute
+ tool "cg"
+ name "AssocClassForwardReferenceOnly"
+ value TRUE)
+ (object Attribute
+ tool "cg"
+ name "GenerateForwardReference"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "IsReadOnly"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "BoundedRoleType"
+ value ("AssocTypeSet" 47))
+ (object Attribute
+ tool "cg"
+ name "AssocTypeSet"
+ value (list Attribute_Set
+ (object Attribute
+ tool "cg"
+ name "Array"
+ value 24)
+ (object Attribute
+ tool "cg"
+ name "Sequence"
+ value 47)))))
+ (object Attribute
+ tool "cg"
+ name "default__Attribute"
+ value (list Attribute_Set
+ (object Attribute
+ tool "cg"
+ name "CodeName"
+ value "")
+ (object Attribute
+ tool "cg"
+ name "GenerateDataMember"
+ value TRUE)
+ (object Attribute
+ tool "cg"
+ name "DataMemberName"
+ value "$attribute")
+ (object Attribute
+ tool "cg"
+ name "DataMemberVisibility"
+ value ("DataMemberVisibilitySet" 14))
+ (object Attribute
+ tool "cg"
+ name "DataMemberVisibilitySet"
+ value (list Attribute_Set
+ (object Attribute
+ tool "cg"
+ name "Public"
+ value 45)
+ (object Attribute
+ tool "cg"
+ name "Protected"
+ value 44)
+ (object Attribute
+ tool "cg"
+ name "Private"
+ value 43)
+ (object Attribute
+ tool "cg"
+ name "Implementation"
+ value 14)
+ (object Attribute
+ tool "cg"
+ name "AtAttributeVisibility"
+ value 211)))
+ (object Attribute
+ tool "cg"
+ name "DataMemberMutability"
+ value ("DataMemberMutabilitySet" 0))
+ (object Attribute
+ tool "cg"
+ name "DataMemberMutabilitySet"
+ value (list Attribute_Set
+ (object Attribute
+ tool "cg"
+ name "Unrestricted"
+ value 0)
+ (object Attribute
+ tool "cg"
+ name "Mutable"
+ value 1)
+ (object Attribute
+ tool "cg"
+ name "Const"
+ value 2)))
+ (object Attribute
+ tool "cg"
+ name "DataMemberIsVolatile"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "DataMemberFieldSize"
+ value "")
+ (object Attribute
+ tool "cg"
+ name "GenerateGetOperation"
+ value TRUE)
+ (object Attribute
+ tool "cg"
+ name "GenerateSetOperation"
+ value TRUE)
+ (object Attribute
+ tool "cg"
+ name "GetName"
+ value "get_$attribute")
+ (object Attribute
+ tool "cg"
+ name "SetName"
+ value "set_$attribute")
+ (object Attribute
+ tool "cg"
+ name "GetSetKinds"
+ value ("GetSetKindsSet" 200))
+ (object Attribute
+ tool "cg"
+ name "GetSetKindsSet"
+ value (list Attribute_Set
+ (object Attribute
+ tool "cg"
+ name "Common"
+ value 200)
+ (object Attribute
+ tool "cg"
+ name "Virtual"
+ value 201)
+ (object Attribute
+ tool "cg"
+ name "Abstract"
+ value 202)
+ (object Attribute
+ tool "cg"
+ name "Static"
+ value 203)
+ (object Attribute
+ tool "cg"
+ name "Friend"
+ value 204)))
+ (object Attribute
+ tool "cg"
+ name "GetIsConst"
+ value TRUE)
+ (object Attribute
+ tool "cg"
+ name "GetResultIsConst"
+ value ("GetResultIsConstSet" 2))
+ (object Attribute
+ tool "cg"
+ name "GetResultIsConstSet"
+ value (list Attribute_Set
+ (object Attribute
+ tool "cg"
+ name "False"
+ value 0)
+ (object Attribute
+ tool "cg"
+ name "True"
+ value 1)
+ (object Attribute
+ tool "cg"
+ name "Same_As_Function"
+ value 2)))
+ (object Attribute
+ tool "cg"
+ name "GetSetByReference"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "InlineGet"
+ value TRUE)
+ (object Attribute
+ tool "cg"
+ name "SetReturnsValue"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "InlineSet"
+ value TRUE)
+ (object Attribute
+ tool "cg"
+ name "CaseSpecifier"
+ value "")
+ (object Attribute
+ tool "cg"
+ name "IsReadOnly"
+ value FALSE)))
+ (object Attribute
+ tool "cg"
+ name "default__Uses"
+ value (list Attribute_Set
+ (object Attribute
+ tool "cg"
+ name "ForwardReferenceOnly"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "BodyReferenceOnly"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "GenerateForwardReference"
+ value FALSE)))
+ (object Attribute
+ tool "cg"
+ name "default__Subsystem"
+ value (list Attribute_Set
+ (object Attribute
+ tool "cg"
+ name "Directory"
+ value "AUTO GENERATE")
+ (object Attribute
+ tool "cg"
+ name "DirectoryIsOnSearchList"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "PrecompiledHeader"
+ value "")))
+ (object Attribute
+ tool "cg"
+ name "default__Category"
+ value (list Attribute_Set
+ (object Attribute
+ tool "cg"
+ name "IsNamespace"
+ value FALSE)
+ (object Attribute
+ tool "cg"
+ name "Indent"
+ value 2)
+ (object Attribute
+ tool "cg"
+ name "CodeName"
+ value "")
+ (object Attribute
+ tool "cg"
+ name "GenerateEmptyRegions"
+ value ("GenerateEmptyRegionSet" 3))
+ (object Attribute
+ tool "cg"
+ name "GenerateEmptyRegionSet"
+ value (list Attribute_Set
+ (object Attribute
+ tool "cg"
+ name "None"
+ value 0)
+ (object Attribute
+ tool "cg"
+ name "Preserved"
+ value 1)
+ (object Attribute
+ tool "cg"
+ name "Unpreserved"
+ value 2)
+ (object Attribute
+ tool "cg"
+ name "All"
+ value 3)))))
+ (object Attribute
+ tool "MSVC"
+ name "propertyId"
+ value "809135966")
+ (object Attribute
+ tool "MSVC"
+ name "default__Project"
+ value (list Attribute_Set
+ (object Attribute
+ tool "MSVC"
+ name "Version"
+ value "5.0")))
+ (object Attribute
+ tool "MSVC"
+ name "default__Class"
+ value (list Attribute_Set
+ (object Attribute
+ tool "MSVC"
+ name "Type"
+ value ("MSVCClassTypeSet" 0))
+ (object Attribute
+ tool "MSVC"
+ name "MSVCClassTypeSet"
+ value (list Attribute_Set
+ (object Attribute
+ tool "MSVC"
+ name "Normal"
+ value 0)
+ (object Attribute
+ tool "MSVC"
+ name "Interface_Part"
+ value 1)
+ (object Attribute
+ tool "MSVC"
+ name "Connection_Part"
+ value 2)
+ (object Attribute
+ tool "MSVC"
+ name "Class_Factory"
+ value 3)))
+ (object Attribute
+ tool "MSVC"
+ name "CObjectFunctionality"
+ value ("CObjectFunctionalitySet" 0))
+ (object Attribute
+ tool "MSVC"
+ name "CObjectFunctionalitySet"
+ value (list Attribute_Set
+ (object Attribute
+ tool "MSVC"
+ name "None"
+ value 0)
+ (object Attribute
+ tool "MSVC"
+ name "Dynamic"
+ value 1)
+ (object Attribute
+ tool "MSVC"
+ name "Dyncreate"
+ value 2)
+ (object Attribute
+ tool "MSVC"
+ name "Serial"
+ value 3)))
+ (object Attribute
+ tool "MSVC"
+ name "GenerateOverrideGroup"
+ value FALSE)
+ (object Attribute
+ tool "MSVC"
+ name "GenerateDataGroup"
+ value FALSE)
+ (object Attribute
+ tool "MSVC"
+ name "AFX_DATA_Entries"
+ value (value Text ""))
+ (object Attribute
+ tool "MSVC"
+ name "GenerateFieldGroup"
+ value FALSE)
+ (object Attribute
+ tool "MSVC"
+ name "AFX_FIELD_Entries"
+ value (value Text ""))
+ (object Attribute
+ tool "MSVC"
+ name "GenerateMessageGroup"
+ value FALSE)
+ (object Attribute
+ tool "MSVC"
+ name "GenerateMessageMap"
+ value FALSE)
+ (object Attribute
+ tool "MSVC"
+ name "AFX_MSG_MAP_Entries"
+ value (value Text ""))
+ (object Attribute
+ tool "MSVC"
+ name "MESSAGE_MAP_Entries"
+ value (value Text ""))
+ (object Attribute
+ tool "MSVC"
+ name "OLEFactory"
+ value ("OLEFactorySet" 0))
+ (object Attribute
+ tool "MSVC"
+ name "OLEFactorySet"
+ value (list Attribute_Set
+ (object Attribute
+ tool "MSVC"
+ name "None"
+ value 0)
+ (object Attribute
+ tool "MSVC"
+ name "Built_in"
+ value 1)
+ (object Attribute
+ tool "MSVC"
+ name "Simple"
+ value 2)
+ (object Attribute
+ tool "MSVC"
+ name "Licensed"
+ value 3)))
+ (object Attribute
+ tool "MSVC"
+ name "OLEName"
+ value "")
+ (object Attribute
+ tool "MSVC"
+ name "OLEClassID"
+ value "")
+ (object Attribute
+ tool "MSVC"
+ name "GenerateOLECtlType"
+ value FALSE)
+ (object Attribute
+ tool "MSVC"
+ name "OLECtlType"
+ value "")
+ (object Attribute
+ tool "MSVC"
+ name "GenerateOLETypeLib"
+ value FALSE)
+ (object Attribute
+ tool "MSVC"
+ name "OLETypeLibID"
+ value "")
+ (object Attribute
+ tool "MSVC"
+ name "OLETypeLibMajor"
+ value "")
+ (object Attribute
+ tool "MSVC"
+ name "OLETypeLibMinor"
+ value "")
+ (object Attribute
+ tool "MSVC"
+ name "GeneratePropPageIDs"
+ value FALSE)
+ (object Attribute
+ tool "MSVC"
+ name "OLEPropPageIDs"
+ value (value Text ""))
+ (object Attribute
+ tool "MSVC"
+ name "GenerateDispatchMap"
+ value FALSE)
+ (object Attribute
+ tool "MSVC"
+ name "AFX_DISPATCH_Entries"
+ value (value Text ""))
+ (object Attribute
+ tool "MSVC"
+ name "AFX_DISPATCH_MAP_Entries"
+ value (value Text ""))
+ (object Attribute
+ tool "MSVC"
+ name "DISPATCH_MAP_Entries"
+ value (value Text ""))
+ (object Attribute
+ tool "MSVC"
+ name "StockProperties"
+ value (value Text ""))
+ (object Attribute
+ tool "MSVC"
+ name "StockFunctions"
+ value (value Text ""))
+ (object Attribute
+ tool "MSVC"
+ name "DispatchDefValue"
+ value "")
+ (object Attribute
+ tool "MSVC"
+ name "GenerateDispIdEnum"
+ value FALSE)
+ (object Attribute
+ tool "MSVC"
+ name "AFX_DISP_ID_Entries"
+ value (value Text ""))
+ (object Attribute
+ tool "MSVC"
+ name "GenerateInterfaceMap"
+ value FALSE)
+ (object Attribute
+ tool "MSVC"
+ name "INTERFACE_MAP_Entries"
+ value (value Text ""))
+ (object Attribute
+ tool "MSVC"
+ name "InitInterface"
+ value "")
+ (object Attribute
+ tool "MSVC"
+ name "GenerateEventMap"
+ value FALSE)
+ (object Attribute
+ tool "MSVC"
+ name "AFX_EVENT_Entries"
+ value (value Text ""))
+ (object Attribute
+ tool "MSVC"
+ name "AFX_EVENT_MAP_Entries"
+ value (value Text ""))
+ (object Attribute
+ tool "MSVC"
+ name "EVENT_MAP_Entries"
+ value (value Text ""))
+ (object Attribute
+ tool "MSVC"
+ name "StockEvents"
+ value (value Text ""))
+ (object Attribute
+ tool "MSVC"
+ name "GenerateEventSinkMap"
+ value FALSE)
+ (object Attribute
+ tool "MSVC"
+ name "AFX_EVENTSINK_Entries"
+ value (value Text ""))
+ (object Attribute
+ tool "MSVC"
+ name "AFX_EVENTSINK_MAP_Entries"
+ value (value Text ""))
+ (object Attribute
+ tool "MSVC"
+ name "EVENTSINK_MAP_Entries"
+ value (value Text ""))
+ (object Attribute
+ tool "MSVC"
+ name "PropNotifySinks"
+ value (value Text ""))
+ (object Attribute
+ tool "MSVC"
+ name "GenerateConnectionMap"
+ value FALSE)
+ (object Attribute
+ tool "MSVC"
+ name "CONNECTION_MAP_Entries"
+ value (value Text ""))
+ (object Attribute
+ tool "MSVC"
+ name "ConnectionPointIID"
+ value "")
+ (object Attribute
+ tool "MSVC"
+ name "InheritanceType"
+ value "")
+ (object Attribute
+ tool "MSVC"
+ name "DeclSpec"
+ value "")
+ (object Attribute
+ tool "MSVC"
+ name "OLECommands"
+ value (value Text ""))
+ (object Attribute
+ tool "MSVC"
+ name "MFCDeclares"
+ value (value Text ""))
+ (object Attribute
+ tool "MSVC"
+ name "MFCImplements"
+ value (value Text ""))
+ (object Attribute
+ tool "MSVC"
+ name "ATL_Declares"
+ value (value Text ""))
+ (object Attribute
+ tool "MSVC"
+ name "GenerateCOMMap"
+ value FALSE)
+ (object Attribute
+ tool "MSVC"
+ name "COM_MAP_Entries"
+ value (value Text ""))
+ (object Attribute
+ tool "MSVC"
+ name "GenerateConnectionPointMap"
+ value FALSE)
+ (object Attribute
+ tool "MSVC"
+ name "CONNECTION_POINT_MAP_Entries"
+ value (value Text ""))
+ (object Attribute
+ tool "MSVC"
+ name "GenerateMsgMap"
+ value FALSE)
+ (object Attribute
+ tool "MSVC"
+ name "MSG_MAP_Entries"
+ value (value Text ""))
+ (object Attribute
+ tool "MSVC"
+ name "GeneratePropertyMap"
+ value FALSE)
+ (object Attribute
+ tool "MSVC"
+ name "PROPERTY_MAP_Entries"
+ value (value Text ""))))
+ (object Attribute
+ tool "MSVC"
+ name "default__Operation"
+ value (list Attribute_Set
+ (object Attribute
+ tool "MSVC"
+ name "Type"
+ value ("MSVCOperationTypeSet" 0))
+ (object Attribute
+ tool "MSVC"
+ name "MSVCOperationTypeSet"
+ value (list Attribute_Set
+ (object Attribute
+ tool "MSVC"
+ name "Normal"
+ value 0)
+ (object Attribute
+ tool "MSVC"
+ name "Virtual_Override"
+ value 1)
+ (object Attribute
+ tool "MSVC"
+ name "Message_Handler"
+ value 2)
+ (object Attribute
+ tool "MSVC"
+ name "Dispatch_Handler"
+ value 3)
+ (object Attribute
+ tool "MSVC"
+ name "Event_Firing_Function"
+ value 4)
+ (object Attribute
+ tool "MSVC"
+ name "Event_Sink_Handler"
+ value 5)
+ (object Attribute
+ tool "MSVC"
+ name "Std_OLE_Method"
+ value 6)
+ (object Attribute
+ tool "MSVC"
+ name "Command_Parser"
+ value 7)
+ (object Attribute
+ tool "MSVC"
+ name "Property_Get_Function"
+ value 8)
+ (object Attribute
+ tool "MSVC"
+ name "Property_Set_Function"
+ value 9)
+ (object Attribute
+ tool "MSVC"
+ name "Property_Notify_Function"
+ value 10)
+ (object Attribute
+ tool "MSVC"
+ name "Macro_Generated_Function"
+ value 11)))
+ (object Attribute
+ tool "MSVC"
+ name "AFX_MSG_MAP_Entries"
+ value (value Text ""))
+ (object Attribute
+ tool "MSVC"
+ name "MESSAGE_MAP_Entries"
+ value (value Text ""))
+ (object Attribute
+ tool "MSVC"
+ name "AFX_DISPATCH_MAP_Entries"
+ value (value Text ""))
+ (object Attribute
+ tool "MSVC"
+ name "DISPATCH_MAP_Entries"
+ value (value Text ""))
+ (object Attribute
+ tool "MSVC"
+ name "AFX_EVENT_MAP_Entries"
+ value (value Text ""))
+ (object Attribute
+ tool "MSVC"
+ name "EVENT_MAP_Entries"
+ value (value Text ""))
+ (object Attribute
+ tool "MSVC"
+ name "AFX_EVENTSINK_MAP_Entries"
+ value (value Text ""))
+ (object Attribute
+ tool "MSVC"
+ name "EVENTSINK_MAP_Entries"
+ value (value Text ""))
+ (object Attribute
+ tool "MSVC"
+ name "CallType"
+ value "")
+ (object Attribute
+ tool "MSVC"
+ name "DeclSpec"
+ value "")
+ (object Attribute
+ tool "MSVC"
+ name "BodyImage"
+ value (value Text ""))))
+ (object Attribute
+ tool "MSVC"
+ name "default__Role"
+ value (list Attribute_Set
+ (object Attribute
+ tool "MSVC"
+ name "Type"
+ value ("MSVCAttributeTypeSet" 0))
+ (object Attribute
+ tool "MSVC"
+ name "MSVCAttributeTypeSet"
+ value (list Attribute_Set
+ (object Attribute
+ tool "MSVC"
+ name "Normal"
+ value 0)
+ (object Attribute
+ tool "MSVC"
+ name "Member_Property"
+ value 1)
+ (object Attribute
+ tool "MSVC"
+ name "Get_Set_Property"
+ value 2)
+ (object Attribute
+ tool "MSVC"
+ name "Dialog_Data"
+ value 3)
+ (object Attribute
+ tool "MSVC"
+ name "Field_Data"
+ value 4)
+ (object Attribute
+ tool "MSVC"
+ name "Stock_Property"
+ value 5)))
+ (object Attribute
+ tool "MSVC"
+ name "AFX_DISPATCH_MAP_Entries"
+ value (value Text ""))
+ (object Attribute
+ tool "MSVC"
+ name "DISPATCH_MAP_Entries"
+ value (value Text ""))
+ (object Attribute
+ tool "MSVC"
+ name "DeclSpec"
+ value "")
+ (object Attribute
+ tool "MSVC"
+ name "PointerBase"
+ value "")
+ (object Attribute
+ tool "MSVC"
+ name "CallType"
+ value "")
+ (object Attribute
+ tool "MSVC"
+ name "StockPropertyImplementation"
+ value "")))
+ (object Attribute
+ tool "MSVC"
+ name "default__Has"
+ value (list Attribute_Set
+ (object Attribute
+ tool "MSVC"
+ name "Type"
+ value ("MSVCAttributeTypeSet" 0))
+ (object Attribute
+ tool "MSVC"
+ name "MSVCAttributeTypeSet"
+ value (list Attribute_Set
+ (object Attribute
+ tool "MSVC"
+ name "Normal"
+ value 0)
+ (object Attribute
+ tool "MSVC"
+ name "Member_Property"
+ value 1)
+ (object Attribute
+ tool "MSVC"
+ name "Get_Set_Property"
+ value 2)
+ (object Attribute
+ tool "MSVC"
+ name "Dialog_Data"
+ value 3)
+ (object Attribute
+ tool "MSVC"
+ name "Field_Data"
+ value 4)
+ (object Attribute
+ tool "MSVC"
+ name "Stock_Property"
+ value 5)))
+ (object Attribute
+ tool "MSVC"
+ name "AFX_DISPATCH_MAP_Entries"
+ value (value Text ""))
+ (object Attribute
+ tool "MSVC"
+ name "DISPATCH_MAP_Entries"
+ value (value Text ""))
+ (object Attribute
+ tool "MSVC"
+ name "DeclSpec"
+ value "")
+ (object Attribute
+ tool "MSVC"
+ name "PointerBase"
+ value "")
+ (object Attribute
+ tool "MSVC"
+ name "CallType"
+ value "")
+ (object Attribute
+ tool "MSVC"
+ name "StockPropertyImplementation"
+ value "")))
+ (object Attribute
+ tool "MSVC"
+ name "default__Attribute"
+ value (list Attribute_Set
+ (object Attribute
+ tool "MSVC"
+ name "Type"
+ value ("MSVCAttributeTypeSet" 0))
+ (object Attribute
+ tool "MSVC"
+ name "MSVCAttributeTypeSet"
+ value (list Attribute_Set
+ (object Attribute
+ tool "MSVC"
+ name "Normal"
+ value 0)
+ (object Attribute
+ tool "MSVC"
+ name "Member_Property"
+ value 1)
+ (object Attribute
+ tool "MSVC"
+ name "Get_Set_Property"
+ value 2)
+ (object Attribute
+ tool "MSVC"
+ name "Dialog_Data"
+ value 3)
+ (object Attribute
+ tool "MSVC"
+ name "Field_Data"
+ value 4)
+ (object Attribute
+ tool "MSVC"
+ name "Stock_Property"
+ value 5)))
+ (object Attribute
+ tool "MSVC"
+ name "AFX_DISPATCH_MAP_Entries"
+ value (value Text ""))
+ (object Attribute
+ tool "MSVC"
+ name "DISPATCH_MAP_Entries"
+ value (value Text ""))
+ (object Attribute
+ tool "MSVC"
+ name "DeclSpec"
+ value "")
+ (object Attribute
+ tool "MSVC"
+ name "PointerBase"
+ value "")
+ (object Attribute
+ tool "MSVC"
+ name "CallType"
+ value "")
+ (object Attribute
+ tool "MSVC"
+ name "StockPropertyImplementation"
+ value "")))
+ (object Attribute
+ tool "MSVC"
+ name "default__Module-Spec"
+ value (list Attribute_Set
+ (object Attribute
+ tool "MSVC"
+ name "GenerateIncludesGroup"
+ value FALSE)
+ (object Attribute
+ tool "MSVC"
+ name "AFX_INCLUDES_Entries"
+ value (value Text ""))
+ (object Attribute
+ tool "MSVC"
+ name "GenerateInsertLocation"
+ value FALSE)))
+ (object Attribute
+ tool "MSVC"
+ name "default__Module-Body"
+ value (list Attribute_Set
+ (object Attribute
+ tool "MSVC"
+ name "GenerateIncludesGroup"
+ value FALSE)
+ (object Attribute
+ tool "MSVC"
+ name "AFX_INCLUDES_Entries"
+ value (value Text ""))
+ (object Attribute
+ tool "MSVC"
+ name "GenerateInsertLocation"
+ value FALSE)))
+ (object Attribute
+ tool "cg"
+ name "HiddenTool"
+ value FALSE)
+ (object Attribute
+ tool "TypeLibImporter"
+ name "HiddenTool"
+ value FALSE)
+ (object Attribute
+ tool "Visual Basic"
+ name "propertyId"
+ value "783606378")
+ (object Attribute
+ tool "Visual Basic"
+ name "default__Class"
+ value (list Attribute_Set
+ (object Attribute
+ tool "Visual Basic"
+ name "CreatableSet"
+ value (list Attribute_Set
+ (object Attribute
+ tool "Visual Basic"
+ name "Private"
+ value 221)
+ (object Attribute
+ tool "Visual Basic"
+ name "PublicNotCreatable"
+ value 213)
+ (object Attribute
+ tool "Visual Basic"
+ name "SingleUse"
+ value 214)
+ (object Attribute
+ tool "Visual Basic"
+ name "GlobalSingleUse"
+ value 215)
+ (object Attribute
+ tool "Visual Basic"
+ name "MultiUse"
+ value 219)
+ (object Attribute
+ tool "Visual Basic"
+ name "GlobalMultiUse"
+ value 220)))
+ (object Attribute
+ tool "Visual Basic"
+ name "OptionBase"
+ value "0")
+ (object Attribute
+ tool "Visual Basic"
+ name "OptionExplicit"
+ value TRUE)
+ (object Attribute
+ tool "Visual Basic"
+ name "OptionCompare"
+ value ("CompareSet" 202))
+ (object Attribute
+ tool "Visual Basic"
+ name "Creatable"
+ value ("CreatableSet" 221))
+ (object Attribute
+ tool "Visual Basic"
+ name "GenerateInitialization"
+ value FALSE)
+ (object Attribute
+ tool "Visual Basic"
+ name "GenerateTermination"
+ value FALSE)
+ (object Attribute
+ tool "Visual Basic"
+ name "CollectionClass"
+ value "Collection")
+ (object Attribute
+ tool "Visual Basic"
+ name "CompareSet"
+ value (list Attribute_Set
+ (object Attribute
+ tool "Visual Basic"
+ name "None"
+ value 202)
+ (object Attribute
+ tool "Visual Basic"
+ name "Binary"
+ value 203)
+ (object Attribute
+ tool "Visual Basic"
+ name "Text"
+ value 204)))))
+ (object Attribute
+ tool "Visual Basic"
+ name "default__Operation"
+ value (list Attribute_Set
+ (object Attribute
+ tool "Visual Basic"
+ name "OperationName"
+ value "$operation")
+ (object Attribute
+ tool "Visual Basic"
+ name "LibraryName"
+ value "")
+ (object Attribute
+ tool "Visual Basic"
+ name "AliasName"
+ value "")
+ (object Attribute
+ tool "Visual Basic"
+ name "IsStatic"
+ value FALSE)
+ (object Attribute
+ tool "Visual Basic"
+ name "EntryCode"
+ value (value Text ""))
+ (object Attribute
+ tool "Visual Basic"
+ name "ExitCode"
+ value (value Text ""))))
+ (object Attribute
+ tool "Visual Basic"
+ name "default__Attribute"
+ value (list Attribute_Set
+ (object Attribute
+ tool "Visual Basic"
+ name "IsConst"
+ value FALSE)
+ (object Attribute
+ tool "Visual Basic"
+ name "New"
+ value FALSE)
+ (object Attribute
+ tool "Visual Basic"
+ name "WithEvents"
+ value FALSE)
+ (object Attribute
+ tool "Visual Basic"
+ name "Subscript"
+ value "")
+ (object Attribute
+ tool "Visual Basic"
+ name "NameIfUnlabeled"
+ value "the$supplier")
+ (object Attribute
+ tool "Visual Basic"
+ name "GenerateDataMember"
+ value TRUE)
+ (object Attribute
+ tool "Visual Basic"
+ name "DataMemberName"
+ value "$relationship")
+ (object Attribute
+ tool "Visual Basic"
+ name "GenerateGetOperation"
+ value FALSE)
+ (object Attribute
+ tool "Visual Basic"
+ name "GenerateSetOperation"
+ value FALSE)
+ (object Attribute
+ tool "Visual Basic"
+ name "GenerateLetOperation"
+ value FALSE)))
+ (object Attribute
+ tool "Visual Basic"
+ name "default__Role"
+ value (list Attribute_Set
+ (object Attribute
+ tool "Visual Basic"
+ name "New"
+ value FALSE)
+ (object Attribute
+ tool "Visual Basic"
+ name "WithEvents"
+ value FALSE)
+ (object Attribute
+ tool "Visual Basic"
+ name "Subscript"
+ value "")
+ (object Attribute
+ tool "Visual Basic"
+ name "NameIfUnlabeled"
+ value "the$supplier")
+ (object Attribute
+ tool "Visual Basic"
+ name "GenerateDataMember"
+ value TRUE)
+ (object Attribute
+ tool "Visual Basic"
+ name "DataMemberName"
+ value "$relationship")
+ (object Attribute
+ tool "Visual Basic"
+ name "GenerateGetOperation"
+ value FALSE)
+ (object Attribute
+ tool "Visual Basic"
+ name "GenerateSetOperation"
+ value FALSE)
+ (object Attribute
+ tool "Visual Basic"
+ name "GenerateLetOperation"
+ value FALSE)))
+ (object Attribute
+ tool "Visual Basic"
+ name "default__Inherit"
+ value (list Attribute_Set
+ (object Attribute
+ tool "Visual Basic"
+ name "ImplementsDelegation"
+ value TRUE)))
+ (object Attribute
+ tool "Visual Basic"
+ name "default__Module-Spec"
+ value (list Attribute_Set
+ (object Attribute
+ tool "Visual Basic"
+ name "ProjectFile"
+ value "")))
+ (object Attribute
+ tool "Visual Basic"
+ name "HiddenTool"
+ value FALSE)
+ (object Attribute
+ tool "VisualStudio"
+ name "HiddenTool"
+ value FALSE))
+ quid "3FAA8E8700C1"))
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/pom.xml b/sdo-java/tags/1.0-incubator-M3/sdo/impl/pom.xml
new file mode 100644
index 0000000000..90221aa8a2
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/pom.xml
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <parent>
+ <groupId>org.apache.tuscany.sdo</groupId>
+ <artifactId>tuscany-sdo</artifactId>
+ <version>1.0-incubator-M3</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>tuscany-sdo-impl</artifactId>
+ <name>Tuscany SDO Implementation</name>
+ <description>Tuscany implementation of SDO API.</description>
+
+ <repositories>
+ <repository>
+ <id>codehaus</id>
+ <name>Codehaus maven repository</name>
+ <url>http://repository.codehaus.org/</url>
+ </repository>
+ </repositories>
+
+ <dependencies>
+ <dependency>
+ <groupId>commonj</groupId>
+ <artifactId>sdo-api-r${specVersion}</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.emf</groupId>
+ <artifactId>common</artifactId>
+ <version>${emfVersion}</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.emf</groupId>
+ <artifactId>ecore</artifactId>
+ <version>${emfVersion}</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.emf</groupId>
+ <artifactId>ecore-change</artifactId>
+ <version>${emfVersion}</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.emf</groupId>
+ <artifactId>ecore-xmi</artifactId>
+ <version>${emfVersion}</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.xsd</groupId>
+ <artifactId>xsd</artifactId>
+ <version>${emfVersion}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <!-- dependencies for optional code generation functions -->
+ <dependency>
+ <groupId>asm</groupId>
+ <artifactId>asm</artifactId>
+ <version>2.2</version>
+ <scope>provided</scope>
+ <optional>true</optional>
+ </dependency>
+
+ <!-- dependencies for optional StAX functions -->
+ <dependency>
+ <groupId>stax</groupId>
+ <artifactId>stax-api</artifactId>
+ <version>1.0.1</version>
+ <scope>provided</scope>
+ <optional>true</optional>
+ </dependency>
+
+ <!-- dependencies for test cases -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.woodstox</groupId>
+ <artifactId>wstx-asl</artifactId>
+ <version>3.2.0</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <overview>${basedir}/src/main/java/org/apache/tuscany/sdo/overview.html</overview>
+ <version>2.0</version>
+ <source>1.4</source>
+ </configuration>
+ <!-- <executions>
+ <execution>
+ <id>package</id>
+ <phase>package</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions> -->
+ </plugin>
+
+ </plugins>
+ </build>
+</project>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/AnyTypeDataObject.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/AnyTypeDataObject.java
new file mode 100644
index 0000000000..79deec6d29
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/AnyTypeDataObject.java
@@ -0,0 +1,37 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo;
+
+import commonj.sdo.DataObject;
+
+import org.eclipse.emf.ecore.xml.type.AnyType;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Any Type Data Object</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ *
+ * @see org.apache.tuscany.sdo.SDOPackage#getAnyTypeDataObject()
+ * @model extendedMetaData="kind='mixed'"
+ * @generated
+ */
+public interface AnyTypeDataObject extends DataObject, AnyType {
+} // AnyTypeDataObject
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/SDOExtendedMetaData.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/SDOExtendedMetaData.java
new file mode 100644
index 0000000000..ad546cc614
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/SDOExtendedMetaData.java
@@ -0,0 +1,39 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo;
+
+import java.util.List;
+
+import org.apache.tuscany.sdo.helper.SDOExtendedMetaDataImpl;
+import org.eclipse.emf.ecore.EModelElement;
+import org.eclipse.emf.ecore.util.ExtendedMetaData;
+
+public interface SDOExtendedMetaData extends ExtendedMetaData {
+
+ SDOExtendedMetaData INSTANCE = new SDOExtendedMetaDataImpl();
+
+ List getAliasNames(EModelElement eModelElement);
+
+ void setAliasNames(EModelElement eModelElement, List aliasNames);
+
+ void setAliasNames(EModelElement eModelElement, String aliasNames);
+
+ void setFeatureNamespaceMatchingLax(boolean featureNamespaceMatchingLax);
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/SDOFactory.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/SDOFactory.java
new file mode 100644
index 0000000000..6d07e4b01a
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/SDOFactory.java
@@ -0,0 +1,176 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo;
+
+import commonj.sdo.ChangeSummary;
+import commonj.sdo.DataGraph;
+import commonj.sdo.DataObject;
+import org.eclipse.emf.ecore.EFactory;
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Factory</b> for the model.
+ * It provides a create method for each non-abstract class of the model.
+ * <!-- end-user-doc -->
+ * @see org.apache.tuscany.sdo.SDOPackage
+ * @generated
+ */
+public interface SDOFactory extends EFactory{
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ SDOFactory eINSTANCE = org.apache.tuscany.sdo.impl.SDOFactoryImpl.init();
+
+ /**
+ * Returns a new object of class '<em>Change Summary</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Change Summary</em>'.
+ * @generated
+ */
+ ChangeSummary createChangeSummary();
+
+ /**
+ * Returns a new object of class '<em>Change Summary Setting</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Change Summary Setting</em>'.
+ * @generated
+ */
+ ChangeSummary.Setting createChangeSummarySetting();
+
+ /**
+ * Returns a new object of class '<em>Data Graph</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Data Graph</em>'.
+ * @generated
+ */
+ DataGraph createDataGraph();
+
+ /**
+ * Returns a new object of class '<em>Any Type Data Object</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Any Type Data Object</em>'.
+ * @generated
+ */
+ AnyTypeDataObject createAnyTypeDataObject();
+
+ /**
+ * Returns a new object of class '<em>Simple Any Type Data Object</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Simple Any Type Data Object</em>'.
+ * @generated
+ */
+ SimpleAnyTypeDataObject createSimpleAnyTypeDataObject();
+
+ /**
+ * Returns a new object of class '<em>Class</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Class</em>'.
+ * @generated
+ */
+ Type createClass();
+
+ /**
+ * Returns a new object of class '<em>Data Type</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Data Type</em>'.
+ * @generated
+ */
+ Type createDataType();
+
+ /**
+ * Returns a new object of class '<em>Attribute</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Attribute</em>'.
+ * @generated
+ */
+ Property createAttribute();
+
+ /**
+ * Returns a new object of class '<em>Reference</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Reference</em>'.
+ * @generated
+ */
+ Property createReference();
+
+ /**
+ * Returns a new object of class '<em>Enum</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Enum</em>'.
+ * @generated
+ */
+ Type createEnum();
+
+ /**
+ * Returns a new object of class '<em>Dynamic Data Object</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Dynamic Data Object</em>'.
+ * @generated
+ */
+ DataObject createDynamicDataObject();
+
+ /**
+ * Returns a new object of class '<em>Store Data Object</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Store Data Object</em>'.
+ * @generated
+ */
+ DataObject createStoreDataObject();
+
+ /**
+ * Returns a new object of class '<em>Dynamic Store Data Object</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Dynamic Store Data Object</em>'.
+ * @generated
+ */
+ DataObject createDynamicStoreDataObject();
+
+ /**
+ * Returns the package supported by this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the package supported by this factory.
+ * @generated
+ */
+ SDOPackage getSDOPackage();
+
+ ChangeSummary.Setting createChangeSummarySetting(EStructuralFeature eStructuralFeature, Object value, boolean isSet);
+
+} //SDOFactory
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/SDOPackage.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/SDOPackage.java
new file mode 100644
index 0000000000..4cc6d128c3
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/SDOPackage.java
@@ -0,0 +1,1627 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.emf.ecore.change.ChangePackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Package</b> for the model.
+ * It contains accessors for the meta objects to represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @see org.apache.tuscany.sdo.SDOFactory
+ * @model kind="package"
+ * @generated
+ */
+public interface SDOPackage extends EPackage{
+ /**
+ * The package name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNAME = "sdo";
+
+ /**
+ * The package namespace URI.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_URI = "http://www.apache.org/tuscany/2005/SDO";
+
+ /**
+ * The package namespace name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_PREFIX = "sdo";
+
+ /**
+ * The singleton instance of the package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ SDOPackage eINSTANCE = org.apache.tuscany.sdo.impl.SDOPackageImpl.init();
+
+ /**
+ * The meta object id for the '{@link org.apache.tuscany.sdo.impl.DataGraphImpl <em>Data Graph</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.apache.tuscany.sdo.impl.DataGraphImpl
+ * @see org.apache.tuscany.sdo.impl.SDOPackageImpl#getDataGraph()
+ * @generated
+ */
+ int DATA_GRAPH = 2;
+
+ /**
+ * The meta object id for the '{@link org.apache.tuscany.sdo.impl.ChangeSummaryImpl <em>Change Summary</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.apache.tuscany.sdo.impl.ChangeSummaryImpl
+ * @see org.apache.tuscany.sdo.impl.SDOPackageImpl#getChangeSummary()
+ * @generated
+ */
+ int CHANGE_SUMMARY = 0;
+
+ /**
+ * The feature id for the '<em><b>Object Changes</b></em>' map.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CHANGE_SUMMARY__OBJECT_CHANGES = ChangePackage.CHANGE_DESCRIPTION__OBJECT_CHANGES;
+
+ /**
+ * The feature id for the '<em><b>Objects To Detach</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CHANGE_SUMMARY__OBJECTS_TO_DETACH = ChangePackage.CHANGE_DESCRIPTION__OBJECTS_TO_DETACH;
+
+ /**
+ * The feature id for the '<em><b>Objects To Attach</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CHANGE_SUMMARY__OBJECTS_TO_ATTACH = ChangePackage.CHANGE_DESCRIPTION__OBJECTS_TO_ATTACH;
+
+ /**
+ * The feature id for the '<em><b>Resource Changes</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CHANGE_SUMMARY__RESOURCE_CHANGES = ChangePackage.CHANGE_DESCRIPTION__RESOURCE_CHANGES;
+
+ /**
+ * The feature id for the '<em><b>EData Graph</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CHANGE_SUMMARY__EDATA_GRAPH = ChangePackage.CHANGE_DESCRIPTION_FEATURE_COUNT + 0;
+
+//TODO T-153
+// /**
+// * The feature id for the '<em><b>EData Graph</b></em>' reference.
+// * <!-- begin-user-doc -->
+// * <!-- end-user-doc -->
+// * *handcrafted but could be generated
+// * @ordered
+// */
+// int CHANGE_SUMMARY__EDATA_OBJECT = ChangePackage.CHANGE_DESCRIPTION_FEATURE_COUNT + 1;
+
+ /**
+ * The number of structural features of the '<em>Change Summary</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ * @ordered
+ */
+//TODO T-153
+ int CHANGE_SUMMARY_FEATURE_COUNT = ChangePackage.CHANGE_DESCRIPTION_FEATURE_COUNT + 1;
+ //int CHANGE_SUMMARY_FEATURE_COUNT = ChangePackage.CHANGE_DESCRIPTION_FEATURE_COUNT + 2;
+
+ /**
+ * The meta object id for the '{@link org.apache.tuscany.sdo.impl.ChangeSummarySettingImpl <em>Change Summary Setting</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.apache.tuscany.sdo.impl.ChangeSummarySettingImpl
+ * @see org.apache.tuscany.sdo.impl.SDOPackageImpl#getChangeSummarySetting()
+ * @generated
+ */
+ int CHANGE_SUMMARY_SETTING = 1;
+
+ /**
+ * The feature id for the '<em><b>Feature Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CHANGE_SUMMARY_SETTING__FEATURE_NAME = ChangePackage.FEATURE_CHANGE__FEATURE_NAME;
+
+ /**
+ * The feature id for the '<em><b>Data Value</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CHANGE_SUMMARY_SETTING__DATA_VALUE = ChangePackage.FEATURE_CHANGE__DATA_VALUE;
+
+ /**
+ * The feature id for the '<em><b>Set</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CHANGE_SUMMARY_SETTING__SET = ChangePackage.FEATURE_CHANGE__SET;
+
+ /**
+ * The feature id for the '<em><b>Value</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CHANGE_SUMMARY_SETTING__VALUE = ChangePackage.FEATURE_CHANGE__VALUE;
+
+ /**
+ * The feature id for the '<em><b>Feature</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CHANGE_SUMMARY_SETTING__FEATURE = ChangePackage.FEATURE_CHANGE__FEATURE;
+
+ /**
+ * The feature id for the '<em><b>Reference Value</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CHANGE_SUMMARY_SETTING__REFERENCE_VALUE = ChangePackage.FEATURE_CHANGE__REFERENCE_VALUE;
+
+ /**
+ * The feature id for the '<em><b>List Changes</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CHANGE_SUMMARY_SETTING__LIST_CHANGES = ChangePackage.FEATURE_CHANGE__LIST_CHANGES;
+
+ /**
+ * The number of structural features of the '<em>Change Summary Setting</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CHANGE_SUMMARY_SETTING_FEATURE_COUNT = ChangePackage.FEATURE_CHANGE_FEATURE_COUNT + 0;
+
+ /**
+ * The feature id for the '<em><b>Resource Set</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int DATA_GRAPH__RESOURCE_SET = EcorePackage.EOBJECT_FEATURE_COUNT + 0;
+
+ /**
+ * The feature id for the '<em><b>Root Resource</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int DATA_GRAPH__ROOT_RESOURCE = EcorePackage.EOBJECT_FEATURE_COUNT + 1;
+
+ /**
+ * The feature id for the '<em><b>EChange Summary</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int DATA_GRAPH__ECHANGE_SUMMARY = EcorePackage.EOBJECT_FEATURE_COUNT + 2;
+
+ /**
+ * The feature id for the '<em><b>ERoot Object</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int DATA_GRAPH__EROOT_OBJECT = EcorePackage.EOBJECT_FEATURE_COUNT + 3;
+
+ /**
+ * The number of structural features of the '<em>Data Graph</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int DATA_GRAPH_FEATURE_COUNT = EcorePackage.EOBJECT_FEATURE_COUNT + 4;
+
+ /**
+ * The meta object id for the '{@link org.apache.tuscany.sdo.impl.DataObjectImpl <em>Data Object</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.apache.tuscany.sdo.impl.DataObjectImpl
+ * @see org.apache.tuscany.sdo.impl.SDOPackageImpl#getDataObject()
+ * @generated
+ */
+ int DATA_OBJECT = 3;
+
+ /**
+ * The meta object id for the '{@link commonj.sdo.Property <em>Property</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see commonj.sdo.Property
+ * @see org.apache.tuscany.sdo.impl.SDOPackageImpl#getProperty()
+ * @generated
+ */
+ int PROPERTY = 4;
+
+ /**
+ * The meta object id for the '{@link commonj.sdo.Sequence <em>Sequence</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see commonj.sdo.Sequence
+ * @see org.apache.tuscany.sdo.impl.SDOPackageImpl#getSequence()
+ * @generated
+ */
+ int SEQUENCE = 5;
+
+ /**
+ * The meta object id for the '{@link commonj.sdo.Type <em>Type</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see commonj.sdo.Type
+ * @see org.apache.tuscany.sdo.impl.SDOPackageImpl#getType()
+ * @generated
+ */
+ int TYPE = 6;
+
+ /**
+ * The number of structural features of the '<em>Data Object</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int DATA_OBJECT_FEATURE_COUNT = 0;
+
+ /**
+ * The number of structural features of the '<em>Property</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PROPERTY_FEATURE_COUNT = 0;
+
+ /**
+ * The number of structural features of the '<em>Sequence</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int SEQUENCE_FEATURE_COUNT = 0;
+
+ /**
+ * The number of structural features of the '<em>Type</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int TYPE_FEATURE_COUNT = 0;
+
+ /**
+ * The meta object id for the '{@link org.apache.tuscany.sdo.impl.AnyTypeDataObjectImpl <em>Any Type Data Object</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.apache.tuscany.sdo.impl.AnyTypeDataObjectImpl
+ * @see org.apache.tuscany.sdo.impl.SDOPackageImpl#getAnyTypeDataObject()
+ * @generated
+ */
+ int ANY_TYPE_DATA_OBJECT = 7;
+
+ /**
+ * The feature id for the '<em><b>Mixed</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ANY_TYPE_DATA_OBJECT__MIXED = DATA_OBJECT_FEATURE_COUNT + 0;
+
+ /**
+ * The feature id for the '<em><b>Any</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ANY_TYPE_DATA_OBJECT__ANY = DATA_OBJECT_FEATURE_COUNT + 1;
+
+ /**
+ * The feature id for the '<em><b>Any Attribute</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ANY_TYPE_DATA_OBJECT__ANY_ATTRIBUTE = DATA_OBJECT_FEATURE_COUNT + 2;
+
+ /**
+ * The number of structural features of the '<em>Any Type Data Object</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ANY_TYPE_DATA_OBJECT_FEATURE_COUNT = DATA_OBJECT_FEATURE_COUNT + 3;
+
+ /**
+ * The meta object id for the '{@link org.apache.tuscany.sdo.impl.SimpleAnyTypeDataObjectImpl <em>Simple Any Type Data Object</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.apache.tuscany.sdo.impl.SimpleAnyTypeDataObjectImpl
+ * @see org.apache.tuscany.sdo.impl.SDOPackageImpl#getSimpleAnyTypeDataObject()
+ * @generated
+ */
+ int SIMPLE_ANY_TYPE_DATA_OBJECT = 8;
+
+ /**
+ * The feature id for the '<em><b>Mixed</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int SIMPLE_ANY_TYPE_DATA_OBJECT__MIXED = ANY_TYPE_DATA_OBJECT__MIXED;
+
+ /**
+ * The feature id for the '<em><b>Any</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int SIMPLE_ANY_TYPE_DATA_OBJECT__ANY = ANY_TYPE_DATA_OBJECT__ANY;
+
+ /**
+ * The feature id for the '<em><b>Any Attribute</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int SIMPLE_ANY_TYPE_DATA_OBJECT__ANY_ATTRIBUTE = ANY_TYPE_DATA_OBJECT__ANY_ATTRIBUTE;
+
+ /**
+ * The feature id for the '<em><b>Raw Value</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int SIMPLE_ANY_TYPE_DATA_OBJECT__RAW_VALUE = ANY_TYPE_DATA_OBJECT_FEATURE_COUNT + 0;
+
+ /**
+ * The feature id for the '<em><b>Value</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int SIMPLE_ANY_TYPE_DATA_OBJECT__VALUE = ANY_TYPE_DATA_OBJECT_FEATURE_COUNT + 1;
+
+ /**
+ * The feature id for the '<em><b>Instance Type</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int SIMPLE_ANY_TYPE_DATA_OBJECT__INSTANCE_TYPE = ANY_TYPE_DATA_OBJECT_FEATURE_COUNT + 2;
+
+ /**
+ * The number of structural features of the '<em>Simple Any Type Data Object</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int SIMPLE_ANY_TYPE_DATA_OBJECT_FEATURE_COUNT = ANY_TYPE_DATA_OBJECT_FEATURE_COUNT + 3;
+
+ /**
+ * The meta object id for the '{@link org.apache.tuscany.sdo.impl.ClassImpl <em>Class</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.apache.tuscany.sdo.impl.ClassImpl
+ * @see org.apache.tuscany.sdo.impl.SDOPackageImpl#getClass_()
+ * @generated
+ */
+ int CLASS = 9;
+
+ /**
+ * The feature id for the '<em><b>EAnnotations</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS__EANNOTATIONS = EcorePackage.ECLASS__EANNOTATIONS;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS__NAME = EcorePackage.ECLASS__NAME;
+
+ /**
+ * The feature id for the '<em><b>Instance Class Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS__INSTANCE_CLASS_NAME = EcorePackage.ECLASS__INSTANCE_CLASS_NAME;
+
+ /**
+ * The feature id for the '<em><b>Instance Class</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS__INSTANCE_CLASS = EcorePackage.ECLASS__INSTANCE_CLASS;
+
+ /**
+ * The feature id for the '<em><b>Default Value</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS__DEFAULT_VALUE = EcorePackage.ECLASS__DEFAULT_VALUE;
+
+ /**
+ * The feature id for the '<em><b>EPackage</b></em>' container reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS__EPACKAGE = EcorePackage.ECLASS__EPACKAGE;
+
+ /**
+ * The feature id for the '<em><b>Abstract</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS__ABSTRACT = EcorePackage.ECLASS__ABSTRACT;
+
+ /**
+ * The feature id for the '<em><b>Interface</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS__INTERFACE = EcorePackage.ECLASS__INTERFACE;
+
+ /**
+ * The feature id for the '<em><b>ESuper Types</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS__ESUPER_TYPES = EcorePackage.ECLASS__ESUPER_TYPES;
+
+ /**
+ * The feature id for the '<em><b>EOperations</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS__EOPERATIONS = EcorePackage.ECLASS__EOPERATIONS;
+
+ /**
+ * The feature id for the '<em><b>EAll Attributes</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS__EALL_ATTRIBUTES = EcorePackage.ECLASS__EALL_ATTRIBUTES;
+
+ /**
+ * The feature id for the '<em><b>EAll References</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS__EALL_REFERENCES = EcorePackage.ECLASS__EALL_REFERENCES;
+
+ /**
+ * The feature id for the '<em><b>EReferences</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS__EREFERENCES = EcorePackage.ECLASS__EREFERENCES;
+
+ /**
+ * The feature id for the '<em><b>EAttributes</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS__EATTRIBUTES = EcorePackage.ECLASS__EATTRIBUTES;
+
+ /**
+ * The feature id for the '<em><b>EAll Containments</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS__EALL_CONTAINMENTS = EcorePackage.ECLASS__EALL_CONTAINMENTS;
+
+ /**
+ * The feature id for the '<em><b>EAll Operations</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS__EALL_OPERATIONS = EcorePackage.ECLASS__EALL_OPERATIONS;
+
+ /**
+ * The feature id for the '<em><b>EAll Structural Features</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS__EALL_STRUCTURAL_FEATURES = EcorePackage.ECLASS__EALL_STRUCTURAL_FEATURES;
+
+ /**
+ * The feature id for the '<em><b>EAll Super Types</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS__EALL_SUPER_TYPES = EcorePackage.ECLASS__EALL_SUPER_TYPES;
+
+ /**
+ * The feature id for the '<em><b>EID Attribute</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS__EID_ATTRIBUTE = EcorePackage.ECLASS__EID_ATTRIBUTE;
+
+ /**
+ * The feature id for the '<em><b>EStructural Features</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS__ESTRUCTURAL_FEATURES = EcorePackage.ECLASS__ESTRUCTURAL_FEATURES;
+
+ /**
+ * The number of structural features of the '<em>Class</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int CLASS_FEATURE_COUNT = EcorePackage.ECLASS_FEATURE_COUNT + 0;
+
+ /**
+ * The meta object id for the '{@link org.apache.tuscany.sdo.impl.DataTypeImpl <em>Data Type</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.apache.tuscany.sdo.impl.DataTypeImpl
+ * @see org.apache.tuscany.sdo.impl.SDOPackageImpl#getDataType()
+ * @generated
+ */
+ int DATA_TYPE = 10;
+
+ /**
+ * The feature id for the '<em><b>EAnnotations</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int DATA_TYPE__EANNOTATIONS = EcorePackage.EDATA_TYPE__EANNOTATIONS;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int DATA_TYPE__NAME = EcorePackage.EDATA_TYPE__NAME;
+
+ /**
+ * The feature id for the '<em><b>Instance Class Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int DATA_TYPE__INSTANCE_CLASS_NAME = EcorePackage.EDATA_TYPE__INSTANCE_CLASS_NAME;
+
+ /**
+ * The feature id for the '<em><b>Instance Class</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int DATA_TYPE__INSTANCE_CLASS = EcorePackage.EDATA_TYPE__INSTANCE_CLASS;
+
+ /**
+ * The feature id for the '<em><b>Default Value</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int DATA_TYPE__DEFAULT_VALUE = EcorePackage.EDATA_TYPE__DEFAULT_VALUE;
+
+ /**
+ * The feature id for the '<em><b>EPackage</b></em>' container reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int DATA_TYPE__EPACKAGE = EcorePackage.EDATA_TYPE__EPACKAGE;
+
+ /**
+ * The feature id for the '<em><b>Serializable</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int DATA_TYPE__SERIALIZABLE = EcorePackage.EDATA_TYPE__SERIALIZABLE;
+
+ /**
+ * The number of structural features of the '<em>Data Type</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int DATA_TYPE_FEATURE_COUNT = EcorePackage.EDATA_TYPE_FEATURE_COUNT + 0;
+
+ /**
+ * The meta object id for the '{@link org.apache.tuscany.sdo.impl.AttributeImpl <em>Attribute</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.apache.tuscany.sdo.impl.AttributeImpl
+ * @see org.apache.tuscany.sdo.impl.SDOPackageImpl#getAttribute()
+ * @generated
+ */
+ int ATTRIBUTE = 11;
+
+ /**
+ * The feature id for the '<em><b>EAnnotations</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ATTRIBUTE__EANNOTATIONS = EcorePackage.EATTRIBUTE__EANNOTATIONS;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ATTRIBUTE__NAME = EcorePackage.EATTRIBUTE__NAME;
+
+ /**
+ * The feature id for the '<em><b>Ordered</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ATTRIBUTE__ORDERED = EcorePackage.EATTRIBUTE__ORDERED;
+
+ /**
+ * The feature id for the '<em><b>Unique</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ATTRIBUTE__UNIQUE = EcorePackage.EATTRIBUTE__UNIQUE;
+
+ /**
+ * The feature id for the '<em><b>Lower Bound</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ATTRIBUTE__LOWER_BOUND = EcorePackage.EATTRIBUTE__LOWER_BOUND;
+
+ /**
+ * The feature id for the '<em><b>Upper Bound</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ATTRIBUTE__UPPER_BOUND = EcorePackage.EATTRIBUTE__UPPER_BOUND;
+
+ /**
+ * The feature id for the '<em><b>Many</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ATTRIBUTE__MANY = EcorePackage.EATTRIBUTE__MANY;
+
+ /**
+ * The feature id for the '<em><b>Required</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ATTRIBUTE__REQUIRED = EcorePackage.EATTRIBUTE__REQUIRED;
+
+ /**
+ * The feature id for the '<em><b>EType</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ATTRIBUTE__ETYPE = EcorePackage.EATTRIBUTE__ETYPE;
+
+ /**
+ * The feature id for the '<em><b>Changeable</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ATTRIBUTE__CHANGEABLE = EcorePackage.EATTRIBUTE__CHANGEABLE;
+
+ /**
+ * The feature id for the '<em><b>Volatile</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ATTRIBUTE__VOLATILE = EcorePackage.EATTRIBUTE__VOLATILE;
+
+ /**
+ * The feature id for the '<em><b>Transient</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ATTRIBUTE__TRANSIENT = EcorePackage.EATTRIBUTE__TRANSIENT;
+
+ /**
+ * The feature id for the '<em><b>Default Value Literal</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ATTRIBUTE__DEFAULT_VALUE_LITERAL = EcorePackage.EATTRIBUTE__DEFAULT_VALUE_LITERAL;
+
+ /**
+ * The feature id for the '<em><b>Default Value</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ATTRIBUTE__DEFAULT_VALUE = EcorePackage.EATTRIBUTE__DEFAULT_VALUE;
+
+ /**
+ * The feature id for the '<em><b>Unsettable</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ATTRIBUTE__UNSETTABLE = EcorePackage.EATTRIBUTE__UNSETTABLE;
+
+ /**
+ * The feature id for the '<em><b>Derived</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ATTRIBUTE__DERIVED = EcorePackage.EATTRIBUTE__DERIVED;
+
+ /**
+ * The feature id for the '<em><b>EContaining Class</b></em>' container reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ATTRIBUTE__ECONTAINING_CLASS = EcorePackage.EATTRIBUTE__ECONTAINING_CLASS;
+
+ /**
+ * The feature id for the '<em><b>ID</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ATTRIBUTE__ID = EcorePackage.EATTRIBUTE__ID;
+
+ /**
+ * The feature id for the '<em><b>EAttribute Type</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ATTRIBUTE__EATTRIBUTE_TYPE = EcorePackage.EATTRIBUTE__EATTRIBUTE_TYPE;
+
+ /**
+ * The number of structural features of the '<em>Attribute</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ATTRIBUTE_FEATURE_COUNT = EcorePackage.EATTRIBUTE_FEATURE_COUNT + 0;
+
+ /**
+ * The meta object id for the '{@link org.apache.tuscany.sdo.impl.ReferenceImpl <em>Reference</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.apache.tuscany.sdo.impl.ReferenceImpl
+ * @see org.apache.tuscany.sdo.impl.SDOPackageImpl#getReference()
+ * @generated
+ */
+ int REFERENCE = 12;
+
+ /**
+ * The feature id for the '<em><b>EAnnotations</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int REFERENCE__EANNOTATIONS = EcorePackage.EREFERENCE__EANNOTATIONS;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int REFERENCE__NAME = EcorePackage.EREFERENCE__NAME;
+
+ /**
+ * The feature id for the '<em><b>Ordered</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int REFERENCE__ORDERED = EcorePackage.EREFERENCE__ORDERED;
+
+ /**
+ * The feature id for the '<em><b>Unique</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int REFERENCE__UNIQUE = EcorePackage.EREFERENCE__UNIQUE;
+
+ /**
+ * The feature id for the '<em><b>Lower Bound</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int REFERENCE__LOWER_BOUND = EcorePackage.EREFERENCE__LOWER_BOUND;
+
+ /**
+ * The feature id for the '<em><b>Upper Bound</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int REFERENCE__UPPER_BOUND = EcorePackage.EREFERENCE__UPPER_BOUND;
+
+ /**
+ * The feature id for the '<em><b>Many</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int REFERENCE__MANY = EcorePackage.EREFERENCE__MANY;
+
+ /**
+ * The feature id for the '<em><b>Required</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int REFERENCE__REQUIRED = EcorePackage.EREFERENCE__REQUIRED;
+
+ /**
+ * The feature id for the '<em><b>EType</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int REFERENCE__ETYPE = EcorePackage.EREFERENCE__ETYPE;
+
+ /**
+ * The feature id for the '<em><b>Changeable</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int REFERENCE__CHANGEABLE = EcorePackage.EREFERENCE__CHANGEABLE;
+
+ /**
+ * The feature id for the '<em><b>Volatile</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int REFERENCE__VOLATILE = EcorePackage.EREFERENCE__VOLATILE;
+
+ /**
+ * The feature id for the '<em><b>Transient</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int REFERENCE__TRANSIENT = EcorePackage.EREFERENCE__TRANSIENT;
+
+ /**
+ * The feature id for the '<em><b>Default Value Literal</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int REFERENCE__DEFAULT_VALUE_LITERAL = EcorePackage.EREFERENCE__DEFAULT_VALUE_LITERAL;
+
+ /**
+ * The feature id for the '<em><b>Default Value</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int REFERENCE__DEFAULT_VALUE = EcorePackage.EREFERENCE__DEFAULT_VALUE;
+
+ /**
+ * The feature id for the '<em><b>Unsettable</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int REFERENCE__UNSETTABLE = EcorePackage.EREFERENCE__UNSETTABLE;
+
+ /**
+ * The feature id for the '<em><b>Derived</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int REFERENCE__DERIVED = EcorePackage.EREFERENCE__DERIVED;
+
+ /**
+ * The feature id for the '<em><b>EContaining Class</b></em>' container reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int REFERENCE__ECONTAINING_CLASS = EcorePackage.EREFERENCE__ECONTAINING_CLASS;
+
+ /**
+ * The feature id for the '<em><b>Containment</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int REFERENCE__CONTAINMENT = EcorePackage.EREFERENCE__CONTAINMENT;
+
+ /**
+ * The feature id for the '<em><b>Container</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int REFERENCE__CONTAINER = EcorePackage.EREFERENCE__CONTAINER;
+
+ /**
+ * The feature id for the '<em><b>Resolve Proxies</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int REFERENCE__RESOLVE_PROXIES = EcorePackage.EREFERENCE__RESOLVE_PROXIES;
+
+ /**
+ * The feature id for the '<em><b>EOpposite</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int REFERENCE__EOPPOSITE = EcorePackage.EREFERENCE__EOPPOSITE;
+
+ /**
+ * The feature id for the '<em><b>EReference Type</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int REFERENCE__EREFERENCE_TYPE = EcorePackage.EREFERENCE__EREFERENCE_TYPE;
+
+ /**
+ * The number of structural features of the '<em>Reference</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int REFERENCE_FEATURE_COUNT = EcorePackage.EREFERENCE_FEATURE_COUNT + 0;
+
+ /**
+ * The meta object id for the '{@link org.apache.tuscany.sdo.impl.EnumImpl <em>Enum</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.apache.tuscany.sdo.impl.EnumImpl
+ * @see org.apache.tuscany.sdo.impl.SDOPackageImpl#getEnum()
+ * @generated
+ */
+ int ENUM = 13;
+
+ /**
+ * The feature id for the '<em><b>EAnnotations</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ENUM__EANNOTATIONS = EcorePackage.EENUM__EANNOTATIONS;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ENUM__NAME = EcorePackage.EENUM__NAME;
+
+ /**
+ * The feature id for the '<em><b>Instance Class Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ENUM__INSTANCE_CLASS_NAME = EcorePackage.EENUM__INSTANCE_CLASS_NAME;
+
+ /**
+ * The feature id for the '<em><b>Instance Class</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ENUM__INSTANCE_CLASS = EcorePackage.EENUM__INSTANCE_CLASS;
+
+ /**
+ * The feature id for the '<em><b>Default Value</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ENUM__DEFAULT_VALUE = EcorePackage.EENUM__DEFAULT_VALUE;
+
+ /**
+ * The feature id for the '<em><b>EPackage</b></em>' container reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ENUM__EPACKAGE = EcorePackage.EENUM__EPACKAGE;
+
+ /**
+ * The feature id for the '<em><b>Serializable</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ENUM__SERIALIZABLE = EcorePackage.EENUM__SERIALIZABLE;
+
+ /**
+ * The feature id for the '<em><b>ELiterals</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ENUM__ELITERALS = EcorePackage.EENUM__ELITERALS;
+
+ /**
+ * The number of structural features of the '<em>Enum</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ENUM_FEATURE_COUNT = EcorePackage.EENUM_FEATURE_COUNT + 0;
+
+ /**
+ * The meta object id for the '{@link org.apache.tuscany.sdo.impl.DynamicDataObjectImpl <em>Dynamic Data Object</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.apache.tuscany.sdo.impl.DynamicDataObjectImpl
+ * @see org.apache.tuscany.sdo.impl.SDOPackageImpl#getDynamicDataObject()
+ * @generated
+ */
+ int DYNAMIC_DATA_OBJECT = 14;
+
+ /**
+ * The number of structural features of the '<em>Dynamic Data Object</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int DYNAMIC_DATA_OBJECT_FEATURE_COUNT = DATA_OBJECT_FEATURE_COUNT + 0;
+
+ /**
+ * The meta object id for the '{@link org.apache.tuscany.sdo.impl.StoreDataObjectImpl <em>Store Data Object</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.apache.tuscany.sdo.impl.StoreDataObjectImpl
+ * @see org.apache.tuscany.sdo.impl.SDOPackageImpl#getStoreDataObject()
+ * @generated
+ */
+ int STORE_DATA_OBJECT = 15;
+
+ /**
+ * The number of structural features of the '<em>Store Data Object</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int STORE_DATA_OBJECT_FEATURE_COUNT = DATA_OBJECT_FEATURE_COUNT + 0;
+
+ /**
+ * The meta object id for the '{@link org.apache.tuscany.sdo.impl.DynamicStoreDataObjectImpl <em>Dynamic Store Data Object</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.apache.tuscany.sdo.impl.DynamicStoreDataObjectImpl
+ * @see org.apache.tuscany.sdo.impl.SDOPackageImpl#getDynamicStoreDataObject()
+ * @generated
+ */
+ int DYNAMIC_STORE_DATA_OBJECT = 16;
+
+ /**
+ * The number of structural features of the '<em>Dynamic Store Data Object</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int DYNAMIC_STORE_DATA_OBJECT_FEATURE_COUNT = STORE_DATA_OBJECT_FEATURE_COUNT + 0;
+
+ /**
+ * The meta object id for the '<em>EJava List</em>' data type.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see java.util.List
+ * @see org.apache.tuscany.sdo.impl.SDOPackageImpl#getEJavaList()
+ * @generated
+ */
+ int EJAVA_LIST = 17;
+
+ /**
+ * The meta object id for the '<em>EObject Stream Exception</em>' data type.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see java.io.ObjectStreamException
+ * @see org.apache.tuscany.sdo.impl.SDOPackageImpl#getEObjectStreamException()
+ * @generated
+ */
+ int EOBJECT_STREAM_EXCEPTION = 18;
+
+
+ /**
+ * Returns the meta object for class '{@link commonj.sdo.ChangeSummary <em>Change Summary</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Change Summary</em>'.
+ * @see commonj.sdo.ChangeSummary
+ * @model instanceClass="commonj.sdo.ChangeSummary"
+ * @generated
+ */
+ EClass getChangeSummary();
+
+ /**
+ * Returns the meta object for the reference '{@link commonj.sdo.ChangeSummary#getEDataGraph <em>EData Graph</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>EData Graph</em>'.
+ * @see commonj.sdo.ChangeSummary#getEDataGraph()
+ * @see #getChangeSummary()
+ * @generated
+ */
+ EReference getChangeSummary_EDataGraph();
+
+// TODO T-153
+// /**
+// * Returns the meta object for the reference '{@link commonj.sdo.ChangeSummary#getEDataGraph <em>EData Graph</em>}'.
+// * <!-- begin-user-doc -->
+// * <!-- end-user-doc -->
+// * @return the meta object for the reference '<em>EData Graph</em>'.
+// * @see commonj.sdo.ChangeSummary#getEDataGraph()
+// * @see #getChangeSummary()
+// * *handcrafted but could be generated
+// */
+// EReference getChangeSummary_EDataObject();
+
+
+ /**
+ * Returns the meta object for class '{@link commonj.sdo.ChangeSummary.Setting <em>Change Summary Setting</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Change Summary Setting</em>'.
+ * @see commonj.sdo.ChangeSummary.Setting
+ * @model instanceClass="commonj.sdo.ChangeSummary$Setting"
+ * @generated
+ */
+ EClass getChangeSummarySetting();
+
+ /**
+ * Returns the meta object for class '{@link commonj.sdo.DataGraph <em>Data Graph</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Data Graph</em>'.
+ * @see commonj.sdo.DataGraph
+ * @model instanceClass="commonj.sdo.DataGraph"
+ * @generated
+ */
+ EClass getDataGraph();
+
+ /**
+ * Returns the meta object for the attribute '{@link commonj.sdo.DataGraph#getResourceSet <em>Resource Set</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Resource Set</em>'.
+ * @see commonj.sdo.DataGraph#getResourceSet()
+ * @see #getDataGraph()
+ * @generated
+ */
+ EAttribute getDataGraph_ResourceSet();
+
+ /**
+ * Returns the meta object for the attribute '{@link commonj.sdo.DataGraph#getRootResource <em>Root Resource</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Root Resource</em>'.
+ * @see commonj.sdo.DataGraph#getRootResource()
+ * @see #getDataGraph()
+ * @generated
+ */
+ EAttribute getDataGraph_RootResource();
+
+ /**
+ * Returns the meta object for the reference '{@link commonj.sdo.DataGraph#getEChangeSummary <em>EChange Summary</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>EChange Summary</em>'.
+ * @see commonj.sdo.DataGraph#getEChangeSummary()
+ * @see #getDataGraph()
+ * @generated
+ */
+ EReference getDataGraph_EChangeSummary();
+
+ /**
+ * Returns the meta object for the reference '{@link commonj.sdo.DataGraph#getERootObject <em>ERoot Object</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>ERoot Object</em>'.
+ * @see commonj.sdo.DataGraph#getERootObject()
+ * @see #getDataGraph()
+ * @generated
+ */
+ EReference getDataGraph_ERootObject();
+
+ /**
+ * Returns the meta object for class '{@link commonj.sdo.DataObject <em>Data Object</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Data Object</em>'.
+ * @see commonj.sdo.DataObject
+ * @model instanceClass="commonj.sdo.DataObject"
+ * @generated
+ */
+ EClass getDataObject();
+
+ /**
+ * Returns the meta object for class '{@link commonj.sdo.Property <em>Property</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Property</em>'.
+ * @see commonj.sdo.Property
+ * @model instanceClass="commonj.sdo.Property"
+ * @generated
+ */
+ EClass getProperty();
+
+ /**
+ * Returns the meta object for class '{@link commonj.sdo.Sequence <em>Sequence</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Sequence</em>'.
+ * @see commonj.sdo.Sequence
+ * @model instanceClass="commonj.sdo.Sequence"
+ * @generated
+ */
+ EClass getSequence();
+
+ /**
+ * Returns the meta object for class '{@link commonj.sdo.Type <em>Type</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Type</em>'.
+ * @see commonj.sdo.Type
+ * @model instanceClass="commonj.sdo.Type"
+ * @generated
+ */
+ EClass getType();
+
+ /**
+ * Returns the meta object for class '{@link org.apache.tuscany.sdo.AnyTypeDataObject <em>Any Type Data Object</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Any Type Data Object</em>'.
+ * @see org.apache.tuscany.sdo.AnyTypeDataObject
+ * @generated
+ */
+ EClass getAnyTypeDataObject();
+
+ /**
+ * Returns the meta object for class '{@link org.apache.tuscany.sdo.SimpleAnyTypeDataObject <em>Simple Any Type Data Object</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Simple Any Type Data Object</em>'.
+ * @see org.apache.tuscany.sdo.SimpleAnyTypeDataObject
+ * @generated
+ */
+ EClass getSimpleAnyTypeDataObject();
+
+ /**
+ * Returns the meta object for class '{@link commonj.sdo.Type <em>Class</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Class</em>'.
+ * @see commonj.sdo.Type
+ * @model instanceClass="commonj.sdo.Type"
+ * @generated
+ */
+ EClass getClass_();
+
+ /**
+ * Returns the meta object for class '{@link commonj.sdo.Type <em>Data Type</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Data Type</em>'.
+ * @see commonj.sdo.Type
+ * @model instanceClass="commonj.sdo.Type"
+ * @generated
+ */
+ EClass getDataType();
+
+ /**
+ * Returns the meta object for class '{@link commonj.sdo.Property <em>Attribute</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Attribute</em>'.
+ * @see commonj.sdo.Property
+ * @model instanceClass="commonj.sdo.Property"
+ * @generated
+ */
+ EClass getAttribute();
+
+ /**
+ * Returns the meta object for class '{@link commonj.sdo.Property <em>Reference</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Reference</em>'.
+ * @see commonj.sdo.Property
+ * @model instanceClass="commonj.sdo.Property"
+ * @generated
+ */
+ EClass getReference();
+
+ /**
+ * Returns the meta object for class '{@link commonj.sdo.Type <em>Enum</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Enum</em>'.
+ * @see commonj.sdo.Type
+ * @model instanceClass="commonj.sdo.Type"
+ * @generated
+ */
+ EClass getEnum();
+
+ /**
+ * Returns the meta object for class '{@link commonj.sdo.DataObject <em>Dynamic Data Object</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Dynamic Data Object</em>'.
+ * @see commonj.sdo.DataObject
+ * @model instanceClass="commonj.sdo.DataObject"
+ * @generated
+ */
+ EClass getDynamicDataObject();
+
+ /**
+ * Returns the meta object for class '{@link commonj.sdo.DataObject <em>Store Data Object</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Store Data Object</em>'.
+ * @see commonj.sdo.DataObject
+ * @model instanceClass="commonj.sdo.DataObject"
+ * @generated
+ */
+ EClass getStoreDataObject();
+
+ /**
+ * Returns the meta object for class '{@link commonj.sdo.DataObject <em>Dynamic Store Data Object</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Dynamic Store Data Object</em>'.
+ * @see commonj.sdo.DataObject
+ * @model instanceClass="commonj.sdo.DataObject"
+ * @generated
+ */
+ EClass getDynamicStoreDataObject();
+
+ /**
+ * Returns the meta object for data type '{@link java.util.List <em>EJava List</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for data type '<em>EJava List</em>'.
+ * @see java.util.List
+ * @model instanceClass="java.util.List" serializable="false"
+ * @generated
+ */
+ EDataType getEJavaList();
+
+ /**
+ * Returns the meta object for data type '{@link java.io.ObjectStreamException <em>EObject Stream Exception</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for data type '<em>EObject Stream Exception</em>'.
+ * @see java.io.ObjectStreamException
+ * @model instanceClass="java.io.ObjectStreamException" serializable="false"
+ * @generated
+ */
+ EDataType getEObjectStreamException();
+
+ /**
+ * Returns the factory that creates the instances of the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the factory that creates the instances of the model.
+ * @generated
+ */
+ SDOFactory getSDOFactory();
+
+} //SDOPackage
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/SDOTypeVisitor.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/SDOTypeVisitor.java
new file mode 100644
index 0000000000..5d3640100c
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/SDOTypeVisitor.java
@@ -0,0 +1,49 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo;
+
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+
+/**
+ * Visitor interface that allows applications to process SDO type metadata.
+ *
+ * @version $Rev$ $Date$
+ */
+public interface SDOTypeVisitor {
+ /**
+ * Visit a type definition.
+ *
+ * @param type the type to visit
+ */
+ void visitType(Type type);
+
+ /**
+ * Visit a property definition.
+ *
+ * @param property the property to visit
+ */
+ void visitProperty(Property property);
+
+ /**
+ * Visit after all properties.
+ */
+ void visitEnd();
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/SimpleAnyTypeDataObject.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/SimpleAnyTypeDataObject.java
new file mode 100644
index 0000000000..93ff2ebf14
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/SimpleAnyTypeDataObject.java
@@ -0,0 +1,35 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo;
+
+import org.eclipse.emf.ecore.xml.type.SimpleAnyType;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Simple Any Type Data Object</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ *
+ * @see org.apache.tuscany.sdo.SDOPackage#getSimpleAnyTypeDataObject()
+ * @model extendedMetaData="kind='simple'"
+ * @generated
+ */
+public interface SimpleAnyTypeDataObject extends AnyTypeDataObject, SimpleAnyType {
+} // SimpleAnyTypeDataObject
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/codegen/BytecodeInterfaceGenerator.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/codegen/BytecodeInterfaceGenerator.java
new file mode 100644
index 0000000000..3fe2cd952e
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/codegen/BytecodeInterfaceGenerator.java
@@ -0,0 +1,98 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.codegen;
+
+import java.util.List;
+
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+import org.objectweb.asm.ClassWriter;
+import org.objectweb.asm.Opcodes;
+
+import org.apache.tuscany.sdo.SDOTypeVisitor;
+
+/**
+ * Implementation of a generator that will directly emit bytecode for an interface that
+ * corresponds to the static properties of a SDO type.
+ *
+ * @version $Rev$ $Date$
+ */
+public class BytecodeInterfaceGenerator implements SDOTypeVisitor {
+ private final ClassWriter cw;
+
+ public BytecodeInterfaceGenerator() {
+ cw = new ClassWriter(false);
+ }
+
+ public void visitType(Type type) {
+ String name = type.getName();
+ int lastDot = name.lastIndexOf('.');
+ if (lastDot != -1) {
+ name = name.replace('.', '/');
+ } else {
+ name = Character.toUpperCase(name.charAt(0)) + name.substring(1);
+ }
+
+ List baseTypes = type.getBaseTypes();
+ String[] interfaces = new String[baseTypes.size()];
+ for (int i = 0; i < baseTypes.size(); i++) {
+ Type baseType = (Type) baseTypes.get(i);
+ interfaces[i] = baseType.getInstanceClass().getName().replace('.', '/');
+ }
+
+ cw.visit(Opcodes.V1_4,
+ Opcodes.ACC_PUBLIC + Opcodes.ACC_ABSTRACT + Opcodes.ACC_INTERFACE,
+ name, null, "java/lang/Object", interfaces);
+ }
+
+ public void visitProperty(Property property) {
+ String name = property.getName();
+ String propertyName = Character.toUpperCase(name.charAt(0)) + name.substring(1);
+ Class javaType = property.getType().getInstanceClass();
+ String desc = org.objectweb.asm.Type.getDescriptor(javaType);
+
+ if (property.isMany()) {
+ cw.visitMethod(Opcodes.ACC_PUBLIC + Opcodes.ACC_ABSTRACT, "get" + propertyName, "()Ljava/util/List;", null, null).visitEnd();
+ } else {
+ if (boolean.class.equals(javaType)) {
+ cw.visitMethod(Opcodes.ACC_PUBLIC + Opcodes.ACC_ABSTRACT, "is" + propertyName, "()Z", null, null).visitEnd();
+ } else {
+ cw.visitMethod(Opcodes.ACC_PUBLIC + Opcodes.ACC_ABSTRACT, "get" + propertyName, "()" + desc, null, null).visitEnd();
+ }
+ if (!property.isReadOnly()) {
+ cw.visitMethod(Opcodes.ACC_PUBLIC + Opcodes.ACC_ABSTRACT, "set" + propertyName, '(' + desc + ")V", null, null).visitEnd();
+ }
+ }
+ }
+
+ public void visitEnd() {
+ cw.visitEnd();
+ }
+
+ /**
+ * Return the bytecode for the interface class in a form that can be written
+ * to disk, added to a JAR file, or passed to a ClassLoader.
+ *
+ * @return the bytecode for the SDO Type's interface class
+ */
+ public byte[] getClassData() {
+ return cw.toByteArray();
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/codegen/GenerationException.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/codegen/GenerationException.java
new file mode 100644
index 0000000000..3d645be1da
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/codegen/GenerationException.java
@@ -0,0 +1,42 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.codegen;
+
+/**
+ * Exception indicating there was a problem with code generation.
+ *
+ * @version $Rev$ $Date$
+ */
+public abstract class GenerationException extends RuntimeException {
+ public GenerationException() {
+ }
+
+ public GenerationException(String message) {
+ super(message);
+ }
+
+ public GenerationException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public GenerationException(Throwable cause) {
+ super(cause);
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/codegen/JavaInterfaceGenerator.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/codegen/JavaInterfaceGenerator.java
new file mode 100644
index 0000000000..dc88a0d60d
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/codegen/JavaInterfaceGenerator.java
@@ -0,0 +1,179 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.codegen;
+
+import java.io.PrintWriter;
+import java.util.List;
+
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+
+import org.apache.tuscany.sdo.SDOTypeVisitor;
+
+/**
+ * Implementation of a generator that will output the source code for a Java interface
+ * that corresponds to the SDO Type's static properties.
+ *
+ * @version $Rev$ $Date$
+ */
+public class JavaInterfaceGenerator implements SDOTypeVisitor {
+
+ private static String canonicalize(String className) {
+ if (className == null) {
+ return "";
+ }
+ if (className.charAt(0) != '[') { // if not array
+ return className;
+ }
+ // process array
+ boolean invalidClassName = false;
+ int nestLevel = 1;
+ StringBuffer sb = new StringBuffer();
+ try {
+ while (className.charAt(nestLevel) == '[') {
+ nestLevel++;
+ }
+ char typeChar = className.charAt(nestLevel);
+ int end = nestLevel;
+ switch (typeChar) {
+ case 'L':
+ end = className.length() - 1;
+ if (className.charAt(end) != ';') {
+ invalidClassName = true;
+ } else {
+ sb.append(className.substring(nestLevel+1, end));
+ }
+ break;
+ case 'Z':
+ sb.append("boolean");
+ break;
+ case 'B':
+ sb.append("byte");
+ break;
+ case 'C':
+ sb.append("char");
+ break;
+ case 'D':
+ sb.append("double");
+ break;
+ case 'F':
+ sb.append("float");
+ break;
+ case 'I':
+ sb.append("int");
+ break;
+ case 'J':
+ sb.append("long");
+ break;
+ case 'S':
+ sb.append("short");
+ break;
+ default:
+ invalidClassName = true;
+ break;
+ }
+ if (end != (className.length() - 1)) {
+ invalidClassName = true; // we have not used all the characters
+ } else {
+ for (int i=0; i<nestLevel; i++) {
+ sb.append("[]");
+ }
+ }
+ } catch(Exception e) {
+ invalidClassName = true;
+ }
+ if (invalidClassName) {
+ System.err.println("unable to canonicalize class name: "+className);
+ return className;
+ }
+ return sb.toString();
+ }
+
+ private final PrintWriter writer;
+
+ /**
+ * Constructor providing the Writer to output the source to.
+ *
+ * @param writer where the generated source code will be written to
+ */
+ public JavaInterfaceGenerator(PrintWriter writer) {
+ this.writer = writer;
+ }
+
+ public void visitType(Type type) {
+ String name = type.getName();
+ int lastDot = name.lastIndexOf('.');
+ if (lastDot != -1) {
+ writer.print("package ");
+ writer.print(name.substring(0, lastDot));
+ writer.println(';');
+ writer.println();
+
+ name = name.substring(lastDot + 1);
+ } else {
+ name = Character.toUpperCase(name.charAt(0)) + name.substring(1);
+ }
+
+ writer.print("public interface ");
+ writer.print(name);
+ List baseTypes = type.getBaseTypes();
+ for (int i = 0; i < baseTypes.size(); i++) {
+ Type baseType = (Type) baseTypes.get(i);
+ if (i == 0) {
+ writer.print(" extends ");
+ } else {
+ writer.print(", ");
+ }
+ writer.print(baseType.getInstanceClass().getName());
+ }
+
+ writer.println(" {");
+ }
+
+ public void visitProperty(Property property) {
+ String name = property.getName();
+ String propertyName = Character.toUpperCase(name.charAt(0)) + name.substring(1);
+ String javaType = canonicalize(property.getType().getInstanceClass().getName());
+
+ if (!property.isMany()) {
+ writer.print(" ");
+ writer.print(javaType);
+ writer.print("boolean".equals(javaType) ? " is" : " get");
+ writer.print(propertyName);
+ writer.println("();");
+ if (!property.isReadOnly()) {
+ writer.print(" void set");
+ writer.print(propertyName);
+ writer.print('(');
+ writer.print(javaType);
+ writer.println(" value);");
+ }
+ } else {
+ writer.print(" java.util.List get");
+ writer.print(propertyName);
+ writer.println("();");
+ }
+ }
+
+ public void visitEnd() {
+ writer.println('}');
+ writer.flush();
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/codegen/NoJavaImplementationException.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/codegen/NoJavaImplementationException.java
new file mode 100644
index 0000000000..a6253e8131
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/codegen/NoJavaImplementationException.java
@@ -0,0 +1,61 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.codegen;
+
+import commonj.sdo.Type;
+
+/**
+ * Exception that indicates there is no Java mapping for an SDO type.
+ *
+ * @version $Rev$ $Date$
+ */
+public class NoJavaImplementationException extends GenerationException {
+ private final Type type;
+
+ /**
+ * Constructor supplying the Type that did not have a Java implementation.
+ * A default message is provided of the form "${URI}#${Name}"
+ *
+ * @param type the type that did not have a Java implementation.
+ */
+ public NoJavaImplementationException(Type type) {
+ super(type == null ? null : type.getURI() + "#" + type.getName());
+ this.type = type;
+ }
+
+ /**
+ * Constructor supplying a message and the Type that did not have a Java implementation.
+ *
+ * @param message the message
+ * @param type the type that did not have a Java implementation.
+ */
+ public NoJavaImplementationException(String message, Type type) {
+ super(message);
+ this.type = type;
+ }
+
+ /**
+ * Return the type that did not have a Java implementation.
+ * @return the type that did not have a Java implementation
+ */
+ public Type getType() {
+ return type;
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/BaseSDOExtendedMetaDataImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/BaseSDOExtendedMetaDataImpl.java
new file mode 100644
index 0000000000..422f5342d8
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/BaseSDOExtendedMetaDataImpl.java
@@ -0,0 +1,167 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.helper;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.ETypedElement;
+import org.eclipse.emf.ecore.EcoreFactory;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.emf.ecore.util.BasicExtendedMetaData;
+import org.eclipse.emf.ecore.util.ExtendedMetaData;
+import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
+
+/**
+ * A BasicExtendedMetaData that uses a supplied (SDO) ecore factory to create properties and types.
+ */
+public class BaseSDOExtendedMetaDataImpl extends BasicExtendedMetaData
+{
+ protected EcoreFactory ecoreFactory = EcoreFactory.eINSTANCE;
+ protected DemandMetaData demandMetaData = new DemandMetaData();
+
+ public static class DemandMetaData {
+ EClassifier getEObject() { return EcorePackage.eINSTANCE.getEObject(); }
+ EClassifier getAnyType() { return XMLTypePackage.eINSTANCE.getAnyType(); }
+ EClassifier getAnySimpleType() { return XMLTypePackage.eINSTANCE.getAnySimpleType(); }
+ EClassifier getXMLTypeDocumentRoot() { return XMLTypePackage.eINSTANCE.getXMLTypeDocumentRoot(); }
+ }
+
+ public BaseSDOExtendedMetaDataImpl(EPackage.Registry registry)
+ {
+ super(registry);
+ }
+
+ public EPackage demandPackage(String namespace)
+ {
+ EPackage ePackage = demandRegistry.getEPackage(namespace);
+ if (ePackage == null)
+ {
+ ePackage = ecoreFactory.createEPackage();
+ ePackage.setNsURI(namespace);
+ setQualified(ePackage, namespace != null);
+ if (namespace != null)
+ {
+ ePackage.setNsPrefix
+ (namespace.equals(ExtendedMetaData.XMLNS_URI) ?
+ namespace.equals(ExtendedMetaData.XML_URI) ?
+ "xml" :
+ "xmlns" :
+ computePrefix(namespace));
+ }
+ demandRegistry.put(namespace, ePackage);
+
+ // demandDocumentRoot(ePackage);
+
+ EClass documentRootEClass = ecoreFactory.createEClass();
+ documentRootEClass.getESuperTypes().add(demandMetaData.getXMLTypeDocumentRoot());
+ documentRootEClass.setName("DocumentRoot");
+ ePackage.getEClassifiers().add(documentRootEClass);
+ setDocumentRoot(documentRootEClass);
+ }
+ return ePackage;
+ }
+
+ public EClassifier demandType(String namespace, String name)
+ {
+ EPackage ePackage = demandPackage(namespace);
+ EClassifier eClassifier = getType(ePackage, name);
+ if (eClassifier != null)
+ {
+ return eClassifier;
+ }
+ else
+ {
+ EClass eClass = ecoreFactory.createEClass();
+ eClass.setName(name);
+ eClass.getESuperTypes().add(demandMetaData.getAnyType());
+ setContentKind(eClass, MIXED_CONTENT);
+ ePackage.getEClassifiers().add(eClass);
+ return eClass;
+ }
+ }
+
+ public EStructuralFeature demandFeature(String namespace, String name, boolean isElement, boolean isReference)
+ {
+ EPackage ePackage = demandPackage(namespace);
+ EClass documentRootEClass = getDocumentRoot(ePackage);
+ EStructuralFeature eStructuralFeature =
+ isElement ?
+ getLocalElement(documentRootEClass, namespace, name) :
+ getLocalAttribute(documentRootEClass, namespace, name);
+ if (eStructuralFeature != null)
+ {
+ return eStructuralFeature;
+ }
+ else
+ {
+ if (isReference)
+ {
+ EReference eReference = ecoreFactory.createEReference();
+ eReference.setContainment(isElement);
+ eReference.setEType(demandMetaData.getEObject());
+ eReference.setName(name);
+ eReference.setDerived(true);
+ eReference.setTransient(true);
+ eReference.setVolatile(true);
+ documentRootEClass.getEStructuralFeatures().add(eReference);
+
+ setFeatureKind(eReference, isElement ? ELEMENT_FEATURE : ATTRIBUTE_FEATURE);
+ setNamespace(eReference, namespace);
+
+ // Mark the bound as unspecified so that it won't be considered many
+ // but can nevertheless be recognized as being unspecified and perhaps still be treat as many.
+ //
+ if (isElement)
+ {
+ eReference.setUpperBound(ETypedElement.UNSPECIFIED_MULTIPLICITY);
+ }
+
+ return eReference;
+ }
+ else
+ {
+ EAttribute eAttribute = ecoreFactory.createEAttribute();
+ eAttribute.setName(name);
+ eAttribute.setEType(demandMetaData.getAnySimpleType());
+ eAttribute.setDerived(true);
+ eAttribute.setTransient(true);
+ eAttribute.setVolatile(true);
+ documentRootEClass.getEStructuralFeatures().add(eAttribute);
+
+ setFeatureKind(eAttribute, isElement ? ELEMENT_FEATURE : ATTRIBUTE_FEATURE);
+ setNamespace(eAttribute, namespace);
+
+ // Mark the bound as unspecified so that it won't be considered many
+ // but can nevertheless be recognized as being unspecified and perhaps still be treat as many.
+ //
+ if (isElement)
+ {
+ eAttribute.setUpperBound(ETypedElement.UNSPECIFIED_MULTIPLICITY);
+ }
+
+ return eAttribute;
+ }
+ }
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/BaseSDOXSDEcoreBuilder.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/BaseSDOXSDEcoreBuilder.java
new file mode 100644
index 0000000000..b7f4d2ddcc
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/BaseSDOXSDEcoreBuilder.java
@@ -0,0 +1,1609 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.helper;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EEnum;
+import org.eclipse.emf.ecore.EOperation;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EParameter;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.ETypedElement;
+import org.eclipse.emf.ecore.EcoreFactory;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.ecore.util.ExtendedMetaData;
+import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
+import org.eclipse.xsd.XSDAnnotation;
+import org.eclipse.xsd.XSDAttributeDeclaration;
+import org.eclipse.xsd.XSDAttributeUse;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDComponent;
+import org.eclipse.xsd.XSDContentTypeCategory;
+import org.eclipse.xsd.XSDDerivationMethod;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDFeature;
+import org.eclipse.xsd.XSDModelGroup;
+import org.eclipse.xsd.XSDModelGroupDefinition;
+import org.eclipse.xsd.XSDNamedComponent;
+import org.eclipse.xsd.XSDParticle;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+import org.eclipse.xsd.XSDTerm;
+import org.eclipse.xsd.XSDTypeDefinition;
+import org.eclipse.xsd.XSDVariety;
+import org.eclipse.xsd.XSDWildcard;
+import org.eclipse.xsd.ecore.XSDEcoreBuilder;
+import org.eclipse.xsd.util.XSDConstants;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * An XSDEcoreBuilder that uses a supplied (SDO) ecore factory to create properties and types.
+ */
+public class BaseSDOXSDEcoreBuilder extends XSDEcoreBuilder
+{
+ protected EcorePackage ecorePackage = EcorePackage.eINSTANCE;
+ protected EcoreFactory ecoreFactory = EcoreFactory.eINSTANCE;
+
+ public BaseSDOXSDEcoreBuilder(ExtendedMetaData extendedMetaData)
+ {
+ super(extendedMetaData);
+ }
+
+ public EPackage getEPackage(XSDNamedComponent xsdNamedComponent)
+ {
+ XSDSchema containingXSDSchema = xsdNamedComponent.getSchema();
+ if (containingXSDSchema != null && !xsdSchemas.contains(containingXSDSchema))
+ {
+ xsdSchemas.add(containingXSDSchema);
+ addInput(containingXSDSchema);
+ validate(containingXSDSchema);
+ }
+
+ String targetNamespace =
+ containingXSDSchema == null ?
+ xsdNamedComponent.getTargetNamespace() :
+ containingXSDSchema.getTargetNamespace();
+ EPackage ePackage = (EPackage)targetNamespaceToEPackageMap.get(targetNamespace);
+ if (ePackage == null)
+ {
+ ePackage = ecoreFactory.createEPackage();
+ setAnnotations(ePackage, containingXSDSchema);
+ addOutput(ePackage);
+ if (targetNamespace == null)
+ {
+ if (containingXSDSchema == null)
+ {
+ containingXSDSchema = rootSchema;
+ }
+ ePackage.setName(validName(containingXSDSchema.eResource().getURI().trimFileExtension().lastSegment(), true));
+ ePackage.setNsURI(containingXSDSchema.eResource().getURI().toString());
+
+ // Also register against the nsURI for the case that the target namespace is null.
+ //
+ // extendedMetaData.putPackage(ePackage.getNsURI(), ePackage);
+ }
+ else
+ {
+ String qualifiedPackageName = qualifiedPackageName(targetNamespace);
+ ePackage.setName(qualifiedPackageName);
+ ePackage.setNsURI(targetNamespace);
+ }
+
+ String nsPrefix = ePackage.getName();
+ int index = nsPrefix.lastIndexOf('.');
+ nsPrefix = index == -1 ? nsPrefix : nsPrefix.substring(index + 1);
+
+ // http://www.w3.org/TR/REC-xml-names/#xmlReserved
+ // Namespace Constraint: Leading "XML"
+ // Prefixes beginning with the three-letter sequence x, m, l, in any case combination,
+ // are reserved for use by XML and XML-related specifications.
+ //
+ if (nsPrefix.toLowerCase().startsWith("xml"))
+ {
+ nsPrefix = "_" + nsPrefix;
+ }
+ ePackage.setNsPrefix(nsPrefix);
+
+ extendedMetaData.setQualified(ePackage, targetNamespace != null);
+ extendedMetaData.putPackage(targetNamespace, ePackage);
+
+ targetNamespaceToEPackageMap.put(targetNamespace, ePackage);
+ }
+
+ return ePackage;
+ }
+
+ protected EClassifier computeEClassifier(XSDTypeDefinition xsdTypeDefinition)
+ {
+ if (xsdTypeDefinition == null)
+ {
+ return getBuiltInEClassifier(rootSchema.getSchemaForSchemaNamespace(), "anySimpleType");
+ }
+ else if (xsdTypeDefinition instanceof XSDSimpleTypeDefinition)
+ {
+ return computeEDataType((XSDSimpleTypeDefinition)xsdTypeDefinition);
+ }
+ else
+ {
+ return computeEClass((XSDComplexTypeDefinition)xsdTypeDefinition);
+ }
+ }
+
+ protected EDataType computeEDataType(XSDSimpleTypeDefinition xsdSimpleTypeDefinition)
+ {
+ if (xsdSimpleTypeDefinition == null)
+ {
+ return (EDataType)getBuiltInEClassifier(rootSchema.getSchemaForSchemaNamespace(), "anySimpleType");
+ }
+ else if (XSDConstants.isSchemaForSchemaNamespace(xsdSimpleTypeDefinition.getTargetNamespace()))
+ {
+ String name = xsdSimpleTypeDefinition.getName();
+ if (name != null)
+ {
+ EDataType result = (EDataType)getBuiltInEClassifier(xsdSimpleTypeDefinition.getTargetNamespace(), "anyType".equals(name) ? "anySimpleType" : name);
+ if (result != null)
+ {
+ return result;
+ }
+ }
+ }
+ else if (xsdSimpleTypeDefinition.getContainer() == null)
+ {
+ return (EDataType)getBuiltInEClassifier(rootSchema.getSchemaForSchemaNamespace(), "anySimpleType");
+ }
+
+ String explicitInstanceClassName = getEcoreAttribute(xsdSimpleTypeDefinition, "instanceClass");
+ if (explicitInstanceClassName != null)
+ {
+ EDataType eDataType = ecoreFactory.createEDataType();
+ setAnnotations(eDataType, xsdSimpleTypeDefinition);
+
+ String aliasName = getEcoreAttribute(xsdSimpleTypeDefinition, "name");
+ if (aliasName == null)
+ {
+ aliasName = validAliasName(xsdSimpleTypeDefinition, true);
+ }
+ eDataType.setName(aliasName);
+ extendedMetaData.setName(eDataType, xsdSimpleTypeDefinition.getAliasName());
+
+ eDataType.setInstanceClassName(explicitInstanceClassName);
+
+ EPackage ePackage = getEPackage(xsdSimpleTypeDefinition);
+ addToSortedList(ePackage.getEClassifiers(), eDataType);
+
+ checkForPrimitive(xsdSimpleTypeDefinition, eDataType);
+
+ handleFacets(xsdSimpleTypeDefinition, eDataType);
+
+ String constraints = getEcoreAttribute(xsdSimpleTypeDefinition, "constraints");
+ if (constraints != null)
+ {
+ EcoreUtil.setAnnotation(eDataType, EcorePackage.eNS_URI, "constraints", constraints);
+ }
+
+ if ("false".equals(getEcoreAttribute(xsdSimpleTypeDefinition, "serializable")))
+ {
+ eDataType.setSerializable(false);
+ }
+ return eDataType;
+ }
+ else
+ {
+ EEnum eEnum = computeEEnum(xsdSimpleTypeDefinition);
+ if (eEnum != null)
+ {
+ return eEnum;
+ }
+ else
+ {
+ XSDSimpleTypeDefinition baseTypeDefinition = xsdSimpleTypeDefinition.getBaseTypeDefinition();
+ if (baseTypeDefinition != null)
+ {
+ EDataType eDataType = ecoreFactory.createEDataType();
+ setAnnotations(eDataType, xsdSimpleTypeDefinition);
+
+ String name = getEcoreAttribute(xsdSimpleTypeDefinition, "name");
+ if (name == null)
+ {
+ name = validAliasName(xsdSimpleTypeDefinition, true);
+ }
+
+ eDataType.setName(name);
+ extendedMetaData.setName(eDataType, xsdSimpleTypeDefinition.getAliasName());
+
+ EPackage ePackage = getEPackage(xsdSimpleTypeDefinition);
+ addToSortedList(ePackage.getEClassifiers(), eDataType);
+
+ if (baseTypeDefinition.getVariety() != xsdSimpleTypeDefinition.getVariety())
+ {
+ if (xsdSimpleTypeDefinition.getVariety() == XSDVariety.LIST_LITERAL)
+ {
+ EDataType itemEDataType = getEDataType(xsdSimpleTypeDefinition.getItemTypeDefinition());
+ extendedMetaData.setItemType(eDataType, itemEDataType);
+ eDataType.setInstanceClassName("java.util.List");
+ }
+ else
+ {
+ String instanceClassName = null;
+ List memberTypes = new ArrayList();
+ for (Iterator i = xsdSimpleTypeDefinition.getMemberTypeDefinitions().iterator(); i.hasNext(); )
+ {
+ XSDSimpleTypeDefinition memberTypeDefinition = (XSDSimpleTypeDefinition)i.next();
+ EDataType memberEDataType = getEDataType(memberTypeDefinition);
+ memberTypes.add(memberEDataType);
+ String memberInstanceClassName = memberEDataType.getInstanceClassName();
+ if (memberInstanceClassName == null && memberEDataType instanceof EEnum)
+ {
+ memberInstanceClassName = "org.eclipse.emf.common.util.Enumerator";
+ }
+ if (instanceClassName == null)
+ {
+ instanceClassName = memberInstanceClassName;
+ }
+ else if (instanceClassName != memberInstanceClassName)
+ {
+ instanceClassName = "java.lang.Object";
+ }
+ }
+ extendedMetaData.setMemberTypes(eDataType, memberTypes);
+ eDataType.setInstanceClassName(instanceClassName);
+ }
+ }
+ else
+ {
+ EDataType baseEDataType = getEDataType(baseTypeDefinition);
+ extendedMetaData.setBaseType(eDataType, baseEDataType);
+ String instanceClassName = getInstanceClassName(xsdSimpleTypeDefinition, baseEDataType);
+ eDataType.setInstanceClassName
+ (instanceClassName == null ?
+ "org.eclipse.emf.common.util.Enumerator" :
+ instanceClassName);
+ }
+
+ checkForPrimitive(xsdSimpleTypeDefinition, eDataType);
+ handleFacets(xsdSimpleTypeDefinition, eDataType);
+
+ String constraints = getEcoreAttribute(xsdSimpleTypeDefinition, "constraints");
+ if (constraints != null)
+ {
+ EcoreUtil.setAnnotation(eDataType, EcorePackage.eNS_URI, "constraints", constraints);
+ }
+
+ if ("false".equals(getEcoreAttribute(xsdSimpleTypeDefinition, "serializable")))
+ {
+ eDataType.setSerializable(false);
+ }
+
+ return eDataType;
+ }
+ }
+ return (EDataType)getBuiltInEClassifier(rootSchema.getSchemaForSchemaNamespace(), "anySimpleType");
+ }
+ }
+
+ protected void checkForPrimitive(EDataType eDataType)
+ {
+ int index = PRIMITIVES.indexOf(eDataType.getInstanceClassName());
+ if (index != -1 || eDataType instanceof EEnum)
+ {
+ EDataType eDataTypeObject = ecoreFactory.createEDataType();
+ eDataTypeObject.setName(eDataType.getName() + "Object");
+ if (index != -1)
+ {
+ eDataTypeObject.setInstanceClassName(PRIMITIVE_WRAPPERS[index]);
+ }
+ else
+ {
+ eDataTypeObject.setInstanceClassName("org.eclipse.emf.common.util.Enumerator");
+ }
+ extendedMetaData.setName(eDataTypeObject, extendedMetaData.getName(eDataType) + ":Object");
+ addToSortedList(eDataType.getEPackage().getEClassifiers(), eDataTypeObject);
+ extendedMetaData.setBaseType(eDataTypeObject, eDataType);
+
+ typeToTypeObjectMap.put(eDataType, eDataTypeObject);
+ }
+ }
+
+ public EClass computeEClass(XSDComplexTypeDefinition xsdComplexTypeDefinition)
+ {
+ if (xsdComplexTypeDefinition == null)
+ {
+ return (EClass)getBuiltInEClassifier(rootSchema.getSchemaForSchemaNamespace(), "anyType");
+ }
+ else if (XSDConstants.isSchemaForSchemaNamespace(xsdComplexTypeDefinition.getTargetNamespace()))
+ {
+ String name = xsdComplexTypeDefinition.getName();
+ if (name != null)
+ {
+ EClass result = (EClass)getBuiltInEClassifier(xsdComplexTypeDefinition.getTargetNamespace(), name);
+ if (result != null)
+ {
+ return result;
+ }
+ }
+ }
+ else if (xsdComplexTypeDefinition.getContainer() == null)
+ {
+ return (EClass)getBuiltInEClassifier(rootSchema.getSchemaForSchemaNamespace(), "anyType");
+ }
+
+ EClass eClass = ecoreFactory.createEClass();
+ setAnnotations(eClass, xsdComplexTypeDefinition);
+ // Do this early to prevent recursive loop.
+ xsdComponentToEModelElementMap.put(xsdComplexTypeDefinition, eClass);
+
+ if ("true".equals(getEcoreAttribute(xsdComplexTypeDefinition, "interface")))
+ {
+ eClass.setInterface(true);
+ }
+
+ String instanceClassName = getEcoreAttribute(xsdComplexTypeDefinition, "instanceClass");
+ if (instanceClassName != null)
+ {
+ eClass.setInstanceClassName(instanceClassName);
+ }
+
+ String aliasName = getEcoreAttribute(xsdComplexTypeDefinition, "name");
+ if (aliasName == null)
+ {
+ aliasName = validAliasName(xsdComplexTypeDefinition, true);
+ }
+ eClass.setName(aliasName);
+ extendedMetaData.setName(eClass, xsdComplexTypeDefinition.getAliasName());
+
+ String constraints = getEcoreAttribute(xsdComplexTypeDefinition, "constraints");
+ if (constraints != null)
+ {
+ EcoreUtil.setAnnotation(eClass, EcorePackage.eNS_URI, "constraints", constraints);
+ }
+
+ EPackage ePackage = getEPackage(xsdComplexTypeDefinition);
+ addToSortedList(ePackage.getEClassifiers(), eClass);
+
+ if (xsdComplexTypeDefinition.isAbstract())
+ {
+ eClass.setAbstract(true);
+ }
+
+ EClass baseClass = null;
+ XSDTypeDefinition baseTypeDefinition = xsdComplexTypeDefinition.getBaseTypeDefinition();
+ if (!baseTypeDefinition.isCircular())
+ {
+ EClassifier baseType = getEClassifier(baseTypeDefinition);
+ if (baseType instanceof EClass && baseType != ecorePackage.getEObject())
+ {
+ eClass.getESuperTypes().add(baseClass = (EClass)baseType);
+ }
+ }
+
+ boolean isRestriction =
+ !eClass.getESuperTypes().isEmpty() &&
+ xsdComplexTypeDefinition.getDerivationMethod() == XSDDerivationMethod.RESTRICTION_LITERAL;
+
+ for (Iterator i = getEcoreTypeQNamesAttribute(xsdComplexTypeDefinition, "implements").iterator(); i.hasNext(); )
+ {
+ XSDTypeDefinition mixin = (XSDTypeDefinition)i.next();
+ if (!XSDConstants.isURType(mixin))
+ {
+ EClassifier mixinType = getEClassifier(mixin);
+ if (mixinType instanceof EClass && mixinType != ecorePackage.getEObject())
+ {
+ eClass.getESuperTypes().add(mixinType);
+ }
+ }
+ }
+
+ // 51210
+ // EAnnotation contentParticle = null;
+
+ if (xsdComplexTypeDefinition.getContentTypeCategory() == XSDContentTypeCategory.SIMPLE_LITERAL)
+ {
+ extendedMetaData.setContentKind(eClass, ExtendedMetaData.SIMPLE_CONTENT);
+ if (eClass.getEAllStructuralFeatures().isEmpty())
+ {
+ createFeature
+ (eClass,
+ "value",
+ getEClassifier(xsdComplexTypeDefinition.getSimpleType()),
+ null,
+ 0,
+ 1);
+ }
+ }
+ else
+ {
+ EStructuralFeature globalGroup = null;
+ boolean isMixed = xsdComplexTypeDefinition.getContentTypeCategory() == XSDContentTypeCategory.MIXED_LITERAL;
+ String featureMapName = getEcoreAttribute(xsdComplexTypeDefinition, "featureMap");
+ if (eClass.getESuperTypes().isEmpty() ?
+ "true".equals(getEcoreAttribute(xsdComplexTypeDefinition, "mixed")) :
+ extendedMetaData.getMixedFeature((EClass)eClass.getESuperTypes().get(0)) != null)
+ {
+ isMixed = true;
+ }
+ extendedMetaData.setContentKind
+ (eClass,
+ isMixed ?
+ ExtendedMetaData.MIXED_CONTENT :
+ xsdComplexTypeDefinition.getContentTypeCategory() == XSDContentTypeCategory.EMPTY_LITERAL ?
+ ExtendedMetaData.EMPTY_CONTENT :
+ ExtendedMetaData.ELEMENT_ONLY_CONTENT);
+ if (isMixed)
+ {
+ EStructuralFeature mixedFeature = extendedMetaData.getMixedFeature(eClass);
+ if (mixedFeature == null)
+ {
+ if (featureMapName == null)
+ {
+ featureMapName = "mixed";
+ }
+ mixedFeature =
+ createFeature
+ (eClass,
+ featureMapName,
+ ecorePackage.getEFeatureMapEntry(),
+ null,
+ 0,
+ -1);
+ extendedMetaData.setName(mixedFeature, ":mixed");
+ }
+ }
+ else
+ {
+ globalGroup = extendedMetaData.getElement(eClass, null, ":group");
+ if (globalGroup == null && featureMapName != null && eClass.getESuperTypes().isEmpty())
+ {
+ globalGroup =
+ createFeature
+ (eClass,
+ featureMapName,
+ ecorePackage.getEFeatureMapEntry(),
+ null,
+ 0,
+ -1);
+ extendedMetaData.setName(globalGroup, ":group");
+ extendedMetaData.setFeatureKind(globalGroup, ExtendedMetaData.GROUP_FEATURE);
+ }
+ }
+
+ if (xsdComplexTypeDefinition.getContent() != null)
+ {
+ // 51210
+ // Map particleMap = new HashMap();
+ Map groups = new HashMap();
+ List particleInformation = collectParticles((XSDParticle)xsdComplexTypeDefinition.getContent());
+ for (Iterator i = particleInformation.iterator(); i.hasNext(); )
+ {
+ EffectiveOccurrence effectiveOccurrence = (EffectiveOccurrence)i.next();
+ XSDParticle xsdParticle = effectiveOccurrence.xsdParticle;
+ EStructuralFeature group = (EStructuralFeature)groups.get(effectiveOccurrence.xsdModelGroup);
+ XSDTerm xsdTerm = xsdParticle.getTerm();
+ EStructuralFeature eStructuralFeature = null;
+ String name = getEcoreAttribute(xsdParticle, "name");
+ if (xsdTerm instanceof XSDModelGroup)
+ {
+ if (!isRestriction)
+ {
+ XSDModelGroup xsdModelGroup = (XSDModelGroup)xsdTerm;
+ if (name == null)
+ {
+ name = getEcoreAttribute(xsdParticle, "featureMap");
+ if (name == null)
+ {
+ name = getEcoreAttribute(xsdModelGroup, "name");
+ if (name == null)
+ {
+ name = getEcoreAttribute(xsdModelGroup, "featureMap");
+ if (name == null)
+ {
+ if (xsdModelGroup.getContainer() instanceof XSDModelGroupDefinition)
+ {
+ XSDModelGroupDefinition xsdModelGroupDefinition = (XSDModelGroupDefinition)xsdModelGroup.getContainer();
+ name = getEcoreAttribute(xsdModelGroupDefinition, "name");
+ if (name == null)
+ {
+ name = validName(xsdModelGroupDefinition.getName(), true);
+ }
+ }
+ else
+ {
+ name = "group";
+ }
+ }
+ }
+ }
+ }
+
+ eStructuralFeature =
+ createFeature
+ (eClass,
+ name,
+ ecorePackage.getEFeatureMapEntry(),
+ xsdParticle,
+ 0,
+ -1);
+ groups.put(xsdTerm, eStructuralFeature);
+ extendedMetaData.setName(eStructuralFeature, name + ":" + eClass.getEAllStructuralFeatures().indexOf(eStructuralFeature));
+ }
+ }
+ else if (xsdTerm instanceof XSDWildcard)
+ {
+ if (!isRestriction)
+ {
+ if (name == null)
+ {
+ name = getEcoreAttribute(xsdTerm, "name");
+ if (name == null)
+ {
+ name = "any";
+ }
+ }
+ eStructuralFeature =
+ createFeature
+ (eClass,
+ name,
+ ecorePackage.getEFeatureMapEntry(),
+ xsdParticle,
+ effectiveOccurrence.minOccurs,
+ effectiveOccurrence.maxOccurs);
+ // 51210
+ // particleMap.put(xsdParticle, eStructuralFeature);
+ }
+ }
+ else
+ {
+ XSDElementDeclaration xsdElementDeclaration = (XSDElementDeclaration)xsdTerm;
+
+ boolean isRedundant = false;
+ if (isRestriction)
+ {
+ isRedundant =
+ extendedMetaData.getElement
+ (baseClass, xsdElementDeclaration.getTargetNamespace(), xsdElementDeclaration.getName()) != null;
+
+ if (!isRedundant)
+ {
+ group =
+ extendedMetaData.getElementWildcardAffiliation
+ (baseClass, xsdElementDeclaration.getTargetNamespace(), xsdElementDeclaration.getName());
+ }
+ }
+
+ if (!isRedundant)
+ {
+ if (name == null)
+ {
+ name = getEcoreAttribute(xsdElementDeclaration, "name");
+ if (name == null)
+ {
+ name = validName(xsdElementDeclaration.getName(), true);
+ }
+ }
+
+ String groupName = getEcoreAttribute(xsdParticle, "featureMap");
+ if (groupName == null)
+ {
+ groupName = getEcoreAttribute(xsdElementDeclaration, "featureMap");
+ }
+
+ if (!"".equals(groupName) &&
+ (groupName != null ||
+ xsdElementDeclaration.isAbstract() ||
+ xsdElementDeclaration.getSubstitutionGroup().size() > 1))
+ {
+ if (groupName == null)
+ {
+ groupName = name + "Group";
+ }
+ eStructuralFeature =
+ createFeature
+ (eClass,
+ groupName,
+ ecorePackage.getEFeatureMapEntry(),
+ xsdParticle,
+ effectiveOccurrence.minOccurs,
+ effectiveOccurrence.maxOccurs);
+
+ eStructuralFeature.setChangeable(true);
+
+ extendedMetaData.setFeatureKind(eStructuralFeature, ExtendedMetaData.GROUP_FEATURE);
+ extendedMetaData.setName(eStructuralFeature, xsdElementDeclaration.getName() + ":group");
+
+ if (group != null)
+ {
+ extendedMetaData.setGroup(eStructuralFeature, group);
+ eStructuralFeature.setDerived(true);
+ eStructuralFeature.setTransient(true);
+ eStructuralFeature.setVolatile(true);
+ }
+ else if (isMixed)
+ {
+ eStructuralFeature.setDerived(true);
+ eStructuralFeature.setTransient(true);
+ eStructuralFeature.setVolatile(true);
+ }
+ else if (globalGroup != null)
+ {
+ extendedMetaData.setGroup(eStructuralFeature, globalGroup);
+ eStructuralFeature.setDerived(true);
+ eStructuralFeature.setTransient(true);
+ eStructuralFeature.setVolatile(true);
+ }
+
+ group = eStructuralFeature;
+ }
+
+ eStructuralFeature =
+ createFeature(eClass, xsdElementDeclaration, name, xsdParticle, effectiveOccurrence.minOccurs, effectiveOccurrence.maxOccurs);
+ // 51210
+ // particleMap.put(xsdParticle, eStructuralFeature);
+
+ // If the group is turned off, we better make the feature changeable.
+ //
+ if (!eStructuralFeature.isChangeable() && group == null && getEcoreAttribute(xsdParticle, xsdElementDeclaration, "changeable") == null)
+ {
+ eStructuralFeature.setChangeable(true);
+ }
+ }
+ }
+
+ if (eStructuralFeature != null)
+ {
+ if (group != null)
+ {
+ extendedMetaData.setGroup(eStructuralFeature, group);
+ eStructuralFeature.setDerived(true);
+ eStructuralFeature.setTransient(true);
+ eStructuralFeature.setVolatile(true);
+ }
+ else if (isMixed)
+ {
+ eStructuralFeature.setDerived(true);
+ eStructuralFeature.setTransient(true);
+ eStructuralFeature.setVolatile(true);
+ }
+ else if (globalGroup != null)
+ {
+ extendedMetaData.setGroup(eStructuralFeature, globalGroup);
+ eStructuralFeature.setDerived(true);
+ eStructuralFeature.setTransient(true);
+ eStructuralFeature.setVolatile(true);
+ }
+ }
+ }
+
+ // 51210
+ // contentParticle = computeParticleConstraints(eClass, particleMap, (XSDParticle)xsdComplexTypeDefinition.getContent());
+ }
+ }
+
+ // 51210
+ // EAnnotation attributeParticle = null;
+ // if (isRestriction)
+ // {
+ // attributeParticle = ecoreFactory.createEAnnotation();
+ // attributeParticle.setSource("attributes");
+ // }
+
+ XSDWildcard baseXSDWildcard = null;
+ Collection baseAttributeUses = Collections.EMPTY_LIST;
+ Map baseAttributeURIs = new HashMap();
+ if (baseTypeDefinition instanceof XSDComplexTypeDefinition)
+ {
+ XSDComplexTypeDefinition complexBaseTypeDefinition = (XSDComplexTypeDefinition)baseTypeDefinition;
+ baseXSDWildcard = complexBaseTypeDefinition.getAttributeWildcard();
+ baseAttributeUses = complexBaseTypeDefinition.getAttributeUses();
+ for (Iterator i = baseAttributeUses.iterator(); i.hasNext(); )
+ {
+ XSDAttributeUse xsdAttributeUse = (XSDAttributeUse)i.next();
+ baseAttributeURIs.put(xsdAttributeUse.getAttributeDeclaration().getURI(), xsdAttributeUse);
+ }
+ }
+
+ for (Iterator i = getAttributeUses(xsdComplexTypeDefinition).iterator(); i.hasNext(); )
+ {
+ XSDAttributeUse xsdAttributeUse = (XSDAttributeUse)i.next();
+ XSDAttributeDeclaration xsdAttributeDeclaration = xsdAttributeUse.getAttributeDeclaration();
+ if (baseAttributeURIs.remove(xsdAttributeDeclaration.getURI()) == null)
+ {
+ String name = getEcoreAttribute(xsdAttributeUse, "name");
+ if (name == null)
+ {
+ name = getEcoreAttribute(xsdAttributeDeclaration, "name");
+ }
+ if (name == null)
+ {
+ name = validName(xsdAttributeDeclaration.getName(), true);
+ }
+
+ EStructuralFeature eStructuralFeature =
+ createFeature(eClass, xsdAttributeDeclaration, name, xsdAttributeUse, xsdAttributeUse.isRequired());
+
+ if (isRestriction)
+ {
+ EStructuralFeature attributeWildcardEStructuralFeature =
+ extendedMetaData.getAttributeWildcardAffiliation
+ (baseClass, xsdAttributeDeclaration.getTargetNamespace(), xsdAttributeDeclaration.getName());
+ if (attributeWildcardEStructuralFeature != null)
+ {
+ extendedMetaData.setGroup(eStructuralFeature, attributeWildcardEStructuralFeature);
+ eStructuralFeature.setDerived(true);
+ eStructuralFeature.setTransient(true);
+ eStructuralFeature.setVolatile(true);
+ }
+ }
+ }
+ /* 51210
+ else if (isRestriction && !baseAttributeUses.contains(xsdAttributeUse))
+ {
+ EStructuralFeature eStructuralFeature =
+ extendedMetaData.getAttribute(eClass, xsdAttributeDeclaration.getTargetNamespace(), xsdAttributeDeclaration.getName());
+ if (eStructuralFeature != null)
+ {
+ EAnnotation attributeEAnnotation = ecoreFactory.createEAnnotation();
+ if (xsdAttributeUse.isRequired())
+ {
+ attributeEAnnotation.getDetails().put("minOccurs", "1");
+ }
+ attributeEAnnotation.getReferences().add(eStructuralFeature);
+
+ if (xsdAttributeDeclaration.getTypeDefinition() != null)
+ {
+ EClassifier type = getEClassifier(xsdAttributeDeclaration.getTypeDefinition());
+ if (type != eStructuralFeature.getEType() && type != null)
+ {
+ attributeEAnnotation.getReferences().add(type);
+ }
+ }
+
+ attributeParticle.getContents().add(attributeEAnnotation);
+ }
+ }
+ */
+ }
+
+ /* 51210
+ if (isRestriction && !baseAttributeURIs.isEmpty())
+ {
+ for (Iterator i = baseAttributeURIs.values().iterator(); i.hasNext(); )
+ {
+ XSDAttributeUse xsdAttributeUse = (XSDAttributeUse)i.next();
+ XSDAttributeDeclaration xsdAttributeDeclaration = xsdAttributeUse.getAttributeDeclaration();
+ EStructuralFeature eStructuralFeature =
+ extendedMetaData.getAttribute(eClass, xsdAttributeDeclaration.getTargetNamespace(), xsdAttributeDeclaration.getName());
+ if (eStructuralFeature != null)
+ {
+ EAnnotation attributeEAnnotation = ecoreFactory.createEAnnotation();
+ attributeEAnnotation.getReferences().add(eStructuralFeature);
+ attributeEAnnotation.getDetails().put("maxOccurs", "0");
+ attributeParticle.getContents().add(attributeEAnnotation);
+ }
+ }
+ }
+ */
+
+ XSDWildcard xsdWildcard = xsdComplexTypeDefinition.getAttributeWildcard();
+ if (xsdWildcard != null && baseXSDWildcard != xsdWildcard || XSDConstants.isURType(xsdComplexTypeDefinition))
+ {
+ if (isRestriction && !XSDConstants.isURType(xsdComplexTypeDefinition))
+ {
+ // 51210
+ // attributeParticle.getDetails().put
+ // ("wildcard", BasicExtendedMetaData.getEncodedWildcards(xsdComplexTypeDefinition.getTargetNamespace(), getWildcards(xsdWildcard)));
+ }
+ else
+ {
+ String name = getEcoreAttribute(xsdWildcard, "name");
+ if (name == null)
+ {
+ name = "anyAttribute";
+ }
+ createFeature
+ (eClass,
+ name,
+ ecorePackage.getEFeatureMapEntry(),
+ xsdWildcard,
+ 0,
+ -1);
+ }
+ }
+
+ if (isRestriction)
+ {
+ // 51210
+ // EAnnotation restrictionParticle = ecoreFactory.createEAnnotation();
+ // restrictionParticle.setSource("restriction");
+ // if (contentParticle != null)
+ // {
+ // restrictionParticle.getContents().add(contentParticle);
+ // }
+ // if (!attributeParticle.getContents().isEmpty() || !attributeParticle.getDetails().isEmpty())
+ // {
+ // restrictionParticle.getContents().add(attributeParticle);
+ // }
+ // contentParticle = restrictionParticle;
+
+ int baseContentKind = extendedMetaData.getContentKind((EClass)eClass.getESuperTypes().get(0));
+ if (baseContentKind == ExtendedMetaData.MIXED_CONTENT &&
+ xsdComplexTypeDefinition.getContentTypeCategory() == XSDContentTypeCategory.SIMPLE_LITERAL)
+ {
+ extendedMetaData.setContentKind(eClass, ExtendedMetaData.SIMPLE_CONTENT);
+ EStructuralFeature eStructuralFeature =
+ createFeature
+ (eClass,
+ "rawValue",
+ getBuiltInEClassifier(xsdComplexTypeDefinition.getSchema().getSchemaForSchemaNamespace(), "string"),
+ null,
+ 0,
+ 1);
+ eStructuralFeature.setDerived(true);
+ eStructuralFeature.setTransient(true);
+ eStructuralFeature.setVolatile(true);
+
+ eStructuralFeature =
+ createFeature
+ (eClass,
+ "value",
+ getBuiltInEClassifier(xsdComplexTypeDefinition.getSchema().getSchemaForSchemaNamespace(), "anySimpleType"),
+ null,
+ 0,
+ 1);
+ eStructuralFeature.setDerived(true);
+ eStructuralFeature.setTransient(true);
+ eStructuralFeature.setVolatile(true);
+
+ if ("SimpleAnyType".equals(eClass.getName()) && XMLTypePackage.eNS_URI.equals(eClass.getEPackage().getNsURI()))
+ {
+ eStructuralFeature =
+ createFeature
+ (eClass,
+ "instanceType",
+ ecorePackage.getEDataType(),
+ null,
+ 1,
+ 1);
+
+ ((EReference)eStructuralFeature).setResolveProxies(false);
+ }
+ }
+ else
+ {
+ extendedMetaData.setContentKind(eClass, baseContentKind);
+ }
+ }
+
+ // 51210
+ // extendedMetaData.setContent(eClass, contentParticle);
+
+ XSDAnnotation xsdAnnotation = xsdComplexTypeDefinition.getAnnotation();
+ if (xsdAnnotation != null)
+ {
+ List applicationInformationList = xsdAnnotation.getApplicationInformation(EcorePackage.eNS_URI);
+ for (Iterator i = applicationInformationList.iterator(); i.hasNext(); )
+ {
+ Element applicationInformation = (Element)i.next();
+ if ("operations".equals(applicationInformation.getAttributeNS(EcorePackage.eNS_URI, "key")))
+ {
+ for (Iterator j = getElements(applicationInformation, "operation").iterator(); j.hasNext(); )
+ {
+ EOperation eOperation = ecoreFactory.createEOperation();
+ Element operation = (Element)j.next();
+ String operationName = operation.getAttributeNS(null, "name");
+ eOperation.setName(operationName);
+ XSDTypeDefinition returnType = getEcoreTypeQNameAttribute(xsdComplexTypeDefinition, operation, null, "type");
+ if (returnType != null)
+ {
+ EClassifier returnEType = getEClassifier(returnType);
+ eOperation.setEType(returnEType);
+ }
+
+ List exceptions = getEcoreTypeQNamesAttribute(xsdComplexTypeDefinition, operation, null, "exceptions");
+ for (Iterator k = exceptions.iterator(); k.hasNext(); )
+ {
+ XSDTypeDefinition exceptionTypeDefinition = (XSDTypeDefinition)k.next();
+ eOperation.getEExceptions().add(getEClassifier(exceptionTypeDefinition));
+ }
+
+ for (Iterator k = getElements(operation, "parameter").iterator(); k.hasNext(); )
+ {
+ EParameter eParameter = ecoreFactory.createEParameter();
+ Element parameter = (Element)k.next();
+ String paramaterName = parameter.getAttributeNS(null, "name");
+ XSDTypeDefinition parameterType = getEcoreTypeQNameAttribute(xsdComplexTypeDefinition, parameter, null, "type");
+ EClassifier parameterEType = getEClassifier(parameterType);
+ eParameter.setName(paramaterName);
+ eParameter.setEType(parameterEType);
+
+ populateETypedElement(eParameter, parameter);
+ eOperation.getEParameters().add(eParameter);
+ }
+
+ List body = getElements(operation, "body");
+ if (!body.isEmpty())
+ {
+ EcoreUtil.setAnnotation(eOperation, "http://www.eclipse.org/emf/2002/GenModel", "body", getText((Element)body.get(0)));
+ }
+
+ populateETypedElement(eOperation, operation);
+ eClass.getEOperations().add(eOperation);
+ }
+ }
+ }
+ }
+ return eClass;
+ }
+
+ private String getText(Element element)
+ {
+ StringBuffer text = new StringBuffer();
+ for (Node node = element.getFirstChild(); node != null; node = node.getNextSibling())
+ {
+ switch (node.getNodeType())
+ {
+ case Node.TEXT_NODE:
+ case Node.CDATA_SECTION_NODE:
+ {
+ text.append(node.getNodeValue());
+ }
+ }
+ }
+ return text.toString();
+ }
+
+ private List getElements(Element element, String localName)
+ {
+ List result = new ArrayList();
+ for (Node node = element.getFirstChild(); node != null; node = node.getNextSibling())
+ {
+ if (node.getNodeType() == Node.ELEMENT_NODE)
+ {
+ Element child = (Element)node;
+ if (localName.equals(child.getLocalName()) && child.getNamespaceURI() == null)
+ {
+ result.add(child);
+ }
+ }
+ }
+ return result;
+ }
+
+ protected EStructuralFeature createFeature
+ (EClass eClass, String name, EClassifier type, XSDComponent xsdComponent, int minOccurs, int maxOccurs)
+ {
+ if (xsdComponent != null)
+ {
+ XSDSchema containingXSDSchema = xsdComponent.getSchema();
+ if (containingXSDSchema != null && !xsdSchemas.contains(containingXSDSchema))
+ {
+ xsdSchemas.add(containingXSDSchema);
+ addInput(containingXSDSchema);
+ validate(containingXSDSchema);
+ }
+ }
+ else if (extendedMetaData.getContentKind(eClass) == ExtendedMetaData.MIXED_CONTENT)
+ {
+ if (type == ecorePackage.getEFeatureMapEntry())
+ {
+ EAttribute eAttribute = ecoreFactory.createEAttribute();
+ setAnnotations(eAttribute, xsdComponent);
+ eAttribute.setName(Character.toLowerCase(name.charAt(0)) + name.substring(1));
+ eAttribute.setUnique(false);
+ eAttribute.setEType(type);
+ eAttribute.setLowerBound(minOccurs);
+ eAttribute.setUpperBound(maxOccurs);
+ eClass.getEStructuralFeatures().add(eAttribute);
+ extendedMetaData.setFeatureKind(eAttribute, ExtendedMetaData.ELEMENT_WILDCARD_FEATURE);
+ extendedMetaData.setName(eAttribute, ":" + eAttribute.getName());
+ return eAttribute;
+ }
+ else
+ {
+ EReference eReference = ecoreFactory.createEReference();
+ setAnnotations(eReference, xsdComponent);
+ eReference.setName(name);
+ eReference.setEType(ecorePackage.getEStringToStringMapEntry());
+ eReference.setLowerBound(0);
+ eReference.setUpperBound(-1);
+ eReference.setContainment(true);
+ eReference.setResolveProxies(false);
+ eReference.setTransient(true);
+ eClass.getEStructuralFeatures().add(eReference);
+ extendedMetaData.setFeatureKind(eReference, ExtendedMetaData.ATTRIBUTE_FEATURE);
+ return eReference;
+ }
+ }
+
+ if (type instanceof EClass)
+ {
+ EReference eReference = ecoreFactory.createEReference();
+ setAnnotations(eReference, xsdComponent);
+ eReference.setName(Character.toLowerCase(name.charAt(0)) + name.substring(1));
+ eReference.setEType(type);
+ eReference.setLowerBound(minOccurs);
+ eReference.setUpperBound(maxOccurs);
+
+ eClass.getEStructuralFeatures().add(eReference);
+ if (xsdComponent == null)
+ {
+ extendedMetaData.setName(eReference, ":" + eClass.getEAllStructuralFeatures().indexOf(eReference));
+ extendedMetaData.setFeatureKind(eReference, ExtendedMetaData.SIMPLE_FEATURE);
+ }
+ else
+ {
+ map(xsdComponent, eReference);
+ if (xsdComponent instanceof XSDParticle)
+ {
+ eReference.setContainment(true);
+ eReference.setResolveProxies(false);
+
+ XSDParticle xsdParticle = (XSDParticle)xsdComponent;
+
+ XSDTerm xsdTerm = ((XSDParticle)xsdComponent).getTerm();
+ if (xsdTerm instanceof XSDElementDeclaration)
+ {
+ XSDElementDeclaration xsdElementDeclaration = (XSDElementDeclaration)xsdTerm;
+ extendedMetaData.setFeatureKind(eReference, ExtendedMetaData.ELEMENT_FEATURE);
+ extendedMetaData.setName(eReference, xsdElementDeclaration.getName());
+ extendedMetaData.setNamespace(eReference, xsdElementDeclaration.getTargetNamespace());
+
+ XSDTypeDefinition xsdType = getEffectiveTypeDefinition(xsdParticle, xsdElementDeclaration);
+ if (xsdType instanceof XSDSimpleTypeDefinition)
+ {
+ eReference.setContainment(false);
+ eReference.setResolveProxies(!isLocalReferenceType((XSDSimpleTypeDefinition)xsdType));
+ }
+
+ if (maxOccurs == 1 && xsdElementDeclaration.isNillable())
+ {
+ eReference.setUnsettable(true);
+ }
+
+ if (xsdElementDeclaration.isAbstract())
+ {
+ eReference.setChangeable(false);
+ }
+
+ String opposite = getEcoreAttribute(xsdParticle, "opposite");
+ if (opposite != null)
+ {
+ eReferenceToOppositeNameMap.put(eReference, opposite);
+ }
+ }
+ else if (xsdTerm instanceof XSDWildcard)
+ {
+ // EATM shouldn't happen
+ XSDWildcard xsdWildcard = (XSDWildcard)xsdTerm;
+ extendedMetaData.setFeatureKind(eReference, ExtendedMetaData.ELEMENT_WILDCARD_FEATURE);
+ extendedMetaData.setWildcards(eReference, getWildcards(xsdWildcard));
+ extendedMetaData.setProcessingKind(eReference, xsdWildcard.getProcessContents().getValue() + 1);
+ extendedMetaData.setName(eReference, ":" + eClass.getEAllStructuralFeatures().indexOf(eReference));
+ }
+ else
+ {
+ extendedMetaData.setFeatureKind(eReference, ExtendedMetaData.GROUP_FEATURE);
+ extendedMetaData.setName(eReference, ":" + eClass.getEAllStructuralFeatures().indexOf(eReference));
+ }
+ }
+ else if (xsdComponent instanceof XSDElementDeclaration)
+ {
+ XSDElementDeclaration xsdElementDeclaration = (XSDElementDeclaration)xsdComponent;
+ eReference.setContainment(true);
+ eReference.setResolveProxies(false);
+ extendedMetaData.setFeatureKind(eReference, ExtendedMetaData.ELEMENT_FEATURE);
+ extendedMetaData.setName(eReference, xsdElementDeclaration.getName());
+ extendedMetaData.setNamespace(eReference, xsdElementDeclaration.getTargetNamespace());
+
+ XSDElementDeclaration substitutionGroupAffiliation = xsdElementDeclaration.getSubstitutionGroupAffiliation();
+ if (substitutionGroupAffiliation != null)
+ {
+ EStructuralFeature affiliation = getEStructuralFeature(substitutionGroupAffiliation);
+ extendedMetaData.setAffiliation(eReference, affiliation);
+ }
+ XSDTypeDefinition xsdType = getEffectiveTypeDefinition(null, xsdElementDeclaration);
+ if (xsdType instanceof XSDSimpleTypeDefinition)
+ {
+ eReference.setResolveProxies(!isLocalReferenceType((XSDSimpleTypeDefinition)xsdType));
+ }
+
+ if (maxOccurs == 1 && xsdElementDeclaration.isNillable())
+ {
+ eReference.setUnsettable(true);
+ }
+
+ if (xsdElementDeclaration.isAbstract())
+ {
+ eReference.setChangeable(false);
+ }
+ }
+ else if (xsdComponent instanceof XSDAttributeUse)
+ {
+ String opposite = getEcoreAttribute(xsdComponent, "opposite");
+ if (opposite != null)
+ {
+ eReferenceToOppositeNameMap.put(eReference, opposite);
+ }
+
+ XSDAttributeUse xsdAttributeUse = (XSDAttributeUse)xsdComponent;
+ XSDAttributeDeclaration xsdAttributeDeclaration = xsdAttributeUse.getAttributeDeclaration();
+ extendedMetaData.setFeatureKind(eReference, ExtendedMetaData.ATTRIBUTE_FEATURE);
+ extendedMetaData.setName(eReference, xsdAttributeDeclaration.getName());
+ extendedMetaData.setNamespace(eReference, xsdAttributeDeclaration.getTargetNamespace());
+ eReference.setResolveProxies
+ (!isLocalReferenceType((XSDSimpleTypeDefinition)getEffectiveTypeDefinition(xsdAttributeUse, xsdAttributeDeclaration)));
+ }
+ else if (xsdComponent instanceof XSDAttributeDeclaration)
+ {
+ XSDAttributeDeclaration xsdAttributeDeclaration = (XSDAttributeDeclaration)xsdComponent;
+ extendedMetaData.setFeatureKind(eReference, ExtendedMetaData.ATTRIBUTE_FEATURE);
+ extendedMetaData.setName(eReference, xsdAttributeDeclaration.getName());
+ extendedMetaData.setNamespace(eReference, xsdAttributeDeclaration.getTargetNamespace());
+ eReference.setResolveProxies
+ (!isLocalReferenceType((XSDSimpleTypeDefinition)getEffectiveTypeDefinition(null, xsdAttributeDeclaration)));
+ }
+ }
+
+ return eReference;
+ }
+ else
+ {
+ EAttribute eAttribute = ecoreFactory.createEAttribute();
+ setAnnotations(eAttribute, xsdComponent);
+ eAttribute.setName(Character.toLowerCase(name.charAt(0)) + name.substring(1));
+ eAttribute.setUnique(false);
+ eAttribute.setEType(type);
+ eAttribute.setLowerBound(minOccurs);
+ eAttribute.setUpperBound(maxOccurs);
+ eClass.getEStructuralFeatures().add(eAttribute);
+
+ if (xsdComponent == null)
+ {
+ extendedMetaData.setName(eAttribute, ":" + eClass.getEAllStructuralFeatures().indexOf(eAttribute));
+ extendedMetaData.setFeatureKind(eAttribute, ExtendedMetaData.SIMPLE_FEATURE);
+ }
+ else
+ {
+ map(xsdComponent, eAttribute);
+ if (xsdComponent instanceof XSDAttributeUse)
+ {
+ XSDAttributeUse xsdAttributeUse = (XSDAttributeUse)xsdComponent;
+ XSDAttributeDeclaration xsdAttributeDeclaration = xsdAttributeUse.getAttributeDeclaration();
+ extendedMetaData.setFeatureKind(eAttribute, ExtendedMetaData.ATTRIBUTE_FEATURE);
+ extendedMetaData.setName(eAttribute, xsdAttributeDeclaration.getName());
+ extendedMetaData.setNamespace(eAttribute, xsdAttributeDeclaration.getTargetNamespace());
+
+ String defaultValue = getEcoreAttribute(xsdComponent, "default");
+ if (defaultValue == null)
+ {
+ defaultValue = xsdAttributeUse.getLexicalValue();
+ }
+ eAttribute.setDefaultValueLiteral(defaultValue);
+ initialize(eAttribute, (XSDSimpleTypeDefinition)getEffectiveTypeDefinition(xsdAttributeUse, xsdAttributeDeclaration));
+ }
+ else if (xsdComponent instanceof XSDAttributeDeclaration)
+ {
+ XSDAttributeDeclaration xsdAttributeDeclaration = (XSDAttributeDeclaration)xsdComponent;
+ extendedMetaData.setFeatureKind(eAttribute, ExtendedMetaData.ATTRIBUTE_FEATURE);
+ extendedMetaData.setName(eAttribute, xsdAttributeDeclaration.getName());
+ extendedMetaData.setNamespace(eAttribute, xsdAttributeDeclaration.getTargetNamespace());
+
+ eAttribute.setDefaultValueLiteral(xsdAttributeDeclaration.getLexicalValue());
+ initialize(eAttribute, (XSDSimpleTypeDefinition)getEffectiveTypeDefinition(null, xsdAttributeDeclaration));
+ }
+ else if (xsdComponent instanceof XSDParticle)
+ {
+ XSDTerm xsdTerm = ((XSDParticle)xsdComponent).getTerm();
+ if (xsdTerm instanceof XSDElementDeclaration)
+ {
+ XSDElementDeclaration xsdElementDeclaration = (XSDElementDeclaration)xsdTerm;
+ extendedMetaData.setFeatureKind(eAttribute, ExtendedMetaData.ELEMENT_FEATURE);
+ extendedMetaData.setName(eAttribute, xsdElementDeclaration.getName());
+ extendedMetaData.setNamespace(eAttribute, xsdElementDeclaration.getTargetNamespace());
+
+ eAttribute.setDefaultValueLiteral(xsdElementDeclaration.getLexicalValue());
+ XSDTypeDefinition xsdType = getEffectiveTypeDefinition(xsdComponent, xsdElementDeclaration);
+ if (xsdType instanceof XSDSimpleTypeDefinition)
+ {
+ initialize(eAttribute, (XSDSimpleTypeDefinition)xsdType);
+ }
+
+ if (xsdElementDeclaration.isNillable())
+ {
+ if (!canSupportNull((EDataType)type))
+ {
+ eAttribute.setEType(type = (EDataType)typeToTypeObjectMap.get(type));
+ }
+ if (maxOccurs == 1)
+ {
+ eAttribute.setUnsettable(true);
+ }
+ }
+
+ if (xsdElementDeclaration.isAbstract())
+ {
+ eAttribute.setChangeable(false);
+ }
+ }
+ else if (xsdTerm instanceof XSDWildcard)
+ {
+ XSDWildcard xsdWildcard = (XSDWildcard)xsdTerm;
+ extendedMetaData.setFeatureKind(eAttribute, ExtendedMetaData.ELEMENT_WILDCARD_FEATURE);
+ extendedMetaData.setWildcards(eAttribute, getWildcards(xsdWildcard));
+ extendedMetaData.setProcessingKind(eAttribute, xsdWildcard.getProcessContents().getValue() + 1);
+ extendedMetaData.setName(eAttribute, ":" + eClass.getEAllStructuralFeatures().indexOf(eAttribute));
+ }
+ else
+ {
+ extendedMetaData.setFeatureKind(eAttribute, ExtendedMetaData.GROUP_FEATURE);
+ }
+ }
+ else if (xsdComponent instanceof XSDWildcard)
+ {
+ XSDWildcard xsdWildcard = (XSDWildcard)xsdComponent;
+ extendedMetaData.setFeatureKind(eAttribute, ExtendedMetaData.ATTRIBUTE_WILDCARD_FEATURE);
+ extendedMetaData.setWildcards(eAttribute, getWildcards(xsdWildcard));
+ extendedMetaData.setProcessingKind(eAttribute, xsdWildcard.getProcessContents().getValue() + 1);
+ extendedMetaData.setName(eAttribute, ":" + eClass.getEAllStructuralFeatures().indexOf(eAttribute));
+ }
+ else if (xsdComponent instanceof XSDElementDeclaration)
+ {
+ XSDElementDeclaration xsdElementDeclaration = (XSDElementDeclaration)xsdComponent;
+ extendedMetaData.setFeatureKind(eAttribute, ExtendedMetaData.ELEMENT_FEATURE);
+ extendedMetaData.setName(eAttribute, xsdElementDeclaration.getName());
+ extendedMetaData.setNamespace(eAttribute, xsdElementDeclaration.getTargetNamespace());
+
+ eAttribute.setDefaultValueLiteral(xsdElementDeclaration.getLexicalValue());
+ XSDTypeDefinition xsdType = getEffectiveTypeDefinition(null, xsdElementDeclaration);
+ if (xsdType instanceof XSDSimpleTypeDefinition)
+ {
+ initialize(eAttribute, (XSDSimpleTypeDefinition)xsdType);
+ }
+
+ XSDElementDeclaration substitutionGroupAffiliation = xsdElementDeclaration.getSubstitutionGroupAffiliation();
+ if (substitutionGroupAffiliation != null)
+ {
+ EStructuralFeature affiliation = getEStructuralFeature(substitutionGroupAffiliation);
+ extendedMetaData.setAffiliation(eAttribute, affiliation);
+ }
+
+ if (xsdElementDeclaration.isNillable() && !canSupportNull((EDataType)type))
+ {
+ eAttribute.setEType(type = (EDataType)typeToTypeObjectMap.get(type));
+ if (maxOccurs == 1)
+ {
+ eAttribute.setUnsettable(true);
+ }
+ }
+
+ if (xsdElementDeclaration.isAbstract())
+ {
+ eAttribute.setChangeable(false);
+ }
+ }
+ }
+
+ if (maxOccurs == 1 && (type.getDefaultValue() != null || eAttribute.getDefaultValueLiteral() != null))
+ {
+ eAttribute.setUnsettable(true);
+ }
+
+ return eAttribute;
+ }
+ }
+
+ protected EStructuralFeature createFeature
+ (EClass eClass, XSDElementDeclaration xsdElementDeclaration, String name, XSDComponent xsdComponent, int minOccurs, int maxOccurs)
+ {
+ XSDTypeDefinition elementTypeDefinition = getEffectiveTypeDefinition(xsdComponent, xsdElementDeclaration);
+ EClassifier eClassifier = getEClassifier(elementTypeDefinition);
+
+ XSDTypeDefinition referenceType = getEcoreTypeQNameAttribute(xsdComponent, "reference");
+ if (referenceType == null)
+ {
+ referenceType = getEcoreTypeQNameAttribute(xsdElementDeclaration, "reference");
+ }
+ if (referenceType != null)
+ {
+ EClassifier referenceClassifier = getEClassifier(referenceType);
+ boolean needsHolder = false;
+ if (elementTypeDefinition instanceof XSDSimpleTypeDefinition)
+ {
+ XSDSimpleTypeDefinition xsdSimpleTypeDefinition = (XSDSimpleTypeDefinition)elementTypeDefinition;
+ if (xsdSimpleTypeDefinition.getVariety() == XSDVariety.LIST_LITERAL)
+ {
+ needsHolder = true;
+
+ EPackage holderPackage = getEPackage(xsdElementDeclaration);
+ String holderName = xsdElementDeclaration.getName() + ":holder";
+ EClass holderClass = (EClass)extendedMetaData.getType(holderPackage, holderName);
+ if (holderClass == null)
+ {
+ // Create a holder class like an anonymous complex type.
+ //
+ holderClass = ecoreFactory.createEClass();
+ setAnnotations(holderClass, xsdElementDeclaration);
+ holderClass.setName(validName(holderName, true));
+ extendedMetaData.setName(holderClass, holderName);
+ extendedMetaData.setContentKind(holderClass, ExtendedMetaData.SIMPLE_CONTENT);
+
+ addToSortedList(holderPackage.getEClassifiers(), holderClass);
+
+ EReference holderReference =
+ (EReference)createFeature
+ (holderClass,
+ "value",
+ referenceClassifier,
+ null,
+ 0,
+ -1);
+
+ holderReference.setResolveProxies(!isLocalReferenceType(xsdSimpleTypeDefinition));
+ }
+ referenceClassifier = holderClass;
+ }
+ }
+ EStructuralFeature result =
+ createFeature
+ (eClass,
+ name,
+ referenceClassifier,
+ xsdComponent,
+ minOccurs,
+ maxOccurs);
+ ((EReference)result).setContainment(needsHolder);
+ if (needsHolder)
+ {
+ ((EReference)result).setUnsettable(false);
+ ((EReference)result).setResolveProxies(false);
+ }
+ initialize(result, xsdElementDeclaration, xsdComponent);
+ return result;
+ }
+ else
+ {
+ EStructuralFeature result =
+ createFeature
+ (eClass,
+ name,
+ eClassifier,
+ xsdComponent,
+ minOccurs,
+ maxOccurs);
+ initialize(result, xsdElementDeclaration, xsdComponent);
+ return result;
+ }
+ }
+
+ public EStructuralFeature getEStructuralFeature(XSDFeature xsdFeature)
+ {
+ if ("true".equals(getEcoreAttribute(xsdFeature, "ignore"))) return null;
+ EStructuralFeature eStructuralFeature = (EStructuralFeature)xsdComponentToEModelElementMap.get(xsdFeature);
+ if (eStructuralFeature == null)
+ {
+ EPackage ePackage = getEPackage(xsdFeature);
+ EClass documentEClass = extendedMetaData.getDocumentRoot(ePackage);
+ if (documentEClass == null)
+ {
+ // documentEClass = extendedMetaData.demandDocumentRoot(ePackage);
+ documentEClass = ecoreFactory.createEClass();
+ String name = getEcoreAttribute(xsdFeature.getSchema(), "documentRoot");
+ if (name == null)
+ {
+ name = "DocumentRoot";
+ }
+ documentEClass.setName(name);
+
+ extendedMetaData.setDocumentRoot(documentEClass);
+
+ ePackage.getEClassifiers().add(documentEClass);
+
+ createFeature
+ (documentEClass,
+ "mixed",
+ ecorePackage.getEFeatureMapEntry(),
+ null,
+ 0,
+ -1);
+
+ EStructuralFeature xmlnsPrefixMapFeature =
+ createFeature
+ (documentEClass,
+ "xMLNSPrefixMap",
+ ecorePackage.getEStringToStringMapEntry(),
+ null,
+ 0,
+ -1);
+ extendedMetaData.setName(xmlnsPrefixMapFeature, "xmlns:prefix");
+
+ EStructuralFeature xsiSchemaLocationMapFeature =
+ createFeature
+ (documentEClass,
+ "xSISchemaLocation",
+ ecorePackage.getEStringToStringMapEntry(),
+ null,
+ 0,
+ -1);
+ extendedMetaData.setName(xsiSchemaLocationMapFeature, "xsi:schemaLocation");
+ }
+
+ String name = getEcoreAttribute(xsdFeature, "name");
+ if (name == null)
+ {
+ name= validName(xsdFeature.getName(), true);
+ }
+
+ if (xsdFeature instanceof XSDElementDeclaration)
+ {
+ // Mark the bound as unspecified so that it won't be considered many
+ // but can nevertheless be recognized as being unspecified and perhaps still be treat as many.
+ //
+ EStructuralFeature result =
+ createFeature(documentEClass, (XSDElementDeclaration)xsdFeature, name, xsdFeature, 0, ETypedElement.UNSPECIFIED_MULTIPLICITY);
+
+ result.setDerived(true);
+ result.setTransient(true);
+ result.setVolatile(true);
+ return result;
+ }
+ else
+ {
+ EStructuralFeature result =
+ createFeature(documentEClass, (XSDAttributeDeclaration)xsdFeature, name, xsdFeature, false);
+ return result;
+ }
+ }
+
+ return eStructuralFeature;
+ }
+
+ public void generate(XSDSchema xsdSchema)
+ {
+ this.rootSchema = xsdSchema;
+ if (xsdSchemas.add(xsdSchema))
+ {
+ addInput(xsdSchema);
+ validate(xsdSchema);
+ }
+
+ Collection visitedElementDeclarations = new ArrayList();
+ Collection elementDeclarations = new ArrayList(xsdSchema.getElementDeclarations());
+
+ Collection visitedAttributeDeclarations = new ArrayList();
+ Collection attributeDeclarations = new ArrayList(xsdSchema.getAttributeDeclarations());
+
+ Collection visitedTypeDefinitions = new ArrayList();
+ Collection typeDefinitions = new ArrayList(xsdSchema.getTypeDefinitions());
+
+ while (!elementDeclarations.isEmpty() || !attributeDeclarations.isEmpty() || !typeDefinitions.isEmpty())
+ {
+ for (Iterator i = elementDeclarations.iterator(); i.hasNext(); )
+ {
+ XSDElementDeclaration xsdElementDeclaration = (XSDElementDeclaration)i.next();
+ getEStructuralFeature(xsdElementDeclaration);
+ }
+ visitedElementDeclarations.addAll(elementDeclarations);
+ elementDeclarations = new ArrayList(xsdSchema.getElementDeclarations());
+ elementDeclarations.removeAll(visitedElementDeclarations);
+
+ for (Iterator i = attributeDeclarations.iterator(); i.hasNext(); )
+ {
+ XSDAttributeDeclaration xsdAttributeDeclaration = (XSDAttributeDeclaration)i.next();
+ if (!XSDConstants.isSchemaInstanceNamespace(xsdAttributeDeclaration.getTargetNamespace()))
+ {
+ getEStructuralFeature(xsdAttributeDeclaration);
+ }
+ }
+ visitedAttributeDeclarations.addAll(attributeDeclarations);
+ attributeDeclarations = new ArrayList(xsdSchema.getAttributeDeclarations());
+ attributeDeclarations.removeAll(visitedAttributeDeclarations);
+
+ for (Iterator i = typeDefinitions.iterator(); i.hasNext(); )
+ {
+ XSDTypeDefinition xsdTypeDefinition = (XSDTypeDefinition)i.next();
+ getEClassifier(xsdTypeDefinition);
+ }
+ visitedTypeDefinitions.addAll(typeDefinitions);
+ typeDefinitions = new ArrayList(xsdSchema.getTypeDefinitions());
+ typeDefinitions.removeAll(visitedTypeDefinitions);
+ }
+
+ resolveNameConflicts();
+
+ for (Iterator i = xsdSchemas.iterator(); i.hasNext(); )
+ {
+ XSDSchema generatedXSDSchema = (XSDSchema)i.next();
+ EPackage ePackage = (EPackage)targetNamespaceToEPackageMap.get(generatedXSDSchema.getTargetNamespace());
+ if (ePackage != null)
+ {
+ String packageName= getEcoreAttribute(generatedXSDSchema, "package");
+ if (packageName != null)
+ {
+ ePackage.setName(packageName);
+ }
+ String packageNsPrefix= getEcoreAttribute(generatedXSDSchema, "nsPrefix");
+ if (packageNsPrefix != null)
+ {
+ ePackage.setNsPrefix(packageNsPrefix);
+ }
+ }
+ }
+
+ for (Iterator i = eReferenceToOppositeNameMap.entrySet().iterator(); i.hasNext(); )
+ {
+ Map.Entry entry = (Map.Entry)i.next();
+ EReference eReference = (EReference)entry.getKey();
+ String opposite = (String)entry.getValue();
+ EClass oppositeEClass = eReference.getEReferenceType();
+ if (eReference.getEOpposite() == null)
+ {
+ EStructuralFeature eOppositeFeature = oppositeEClass.getEStructuralFeature(opposite);
+
+ // Match by XML name if this fails.
+ if (eOppositeFeature == null)
+ {
+ for (Iterator j = oppositeEClass.getEAllStructuralFeatures().iterator(); j.hasNext(); )
+ {
+ EStructuralFeature feature = (EStructuralFeature)j.next();
+ if (opposite.equals(extendedMetaData.getName(feature)))
+ {
+ eOppositeFeature = feature;
+ break;
+ }
+ }
+ }
+
+ if (eOppositeFeature instanceof EReference)
+ {
+ EReference eOpposite = (EReference)eOppositeFeature;
+ eOpposite.setEOpposite(eReference);
+ eReference.setEOpposite(eOpposite);
+ }
+ }
+
+ if (eReference.getEOpposite() == null && eReference.isContainment())
+ {
+ EReference eOpposite = ecoreFactory.createEReference();
+ eOpposite.setName(opposite);
+ eOpposite.setEType(eReference.getEContainingClass());
+ eOpposite.setLowerBound(0);
+ eOpposite.setEOpposite(eReference);
+ eReference.setEOpposite(eOpposite);
+ eOpposite.setTransient(true);
+ oppositeEClass.getEStructuralFeatures().add(eOpposite);
+ }
+ }
+
+ eReferenceToOppositeNameMap.clear();
+ }
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/CopyHelperImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/CopyHelperImpl.java
new file mode 100644
index 0000000000..d768076ecb
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/CopyHelperImpl.java
@@ -0,0 +1,84 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.helper;
+
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.util.EcoreUtil.Copier;
+
+import commonj.sdo.ChangeSummary;
+import commonj.sdo.DataObject;
+import commonj.sdo.helper.CopyHelper;
+
+
+/**
+ * A helper for copying DataObjects.
+ */
+public class CopyHelperImpl implements CopyHelper
+{
+ public DataObject copyShallow(DataObject dataObject)
+ {
+ Copier copier = new Copier()
+ {
+ protected void copyContainment(EReference eReference, EObject eObject, EObject copyEObject)
+ {
+ }
+
+ protected void copyAttribute(EAttribute eAttribute, EObject eObject, EObject copyEObject) {
+ if(("ChangeSummaryType".equals(eAttribute.getEType().getName()) && "commonj.sdo".equals(eAttribute.getEType().getEPackage().getNsURI()))) {
+ boolean isLogging = ((ChangeSummary)eObject.eGet(eAttribute)).isLogging();
+ ChangeSummary destSum = (ChangeSummary)copyEObject.eGet(eAttribute);
+ if(isLogging) {
+ if(!destSum.isLogging()) destSum.beginLogging();
+ } else {
+ if(destSum.isLogging()) destSum.endLogging();
+ }
+ } else {
+ super.copyAttribute(eAttribute, eObject, copyEObject);
+ }
+ }
+ };
+ EObject result = copier.copy((EObject)dataObject);
+ copier.copyReferences();
+ return (DataObject)result;
+ }
+
+ public DataObject copy(DataObject dataObject)
+ {
+ Copier copier = new Copier()
+ {
+
+ protected void copyAttribute(EAttribute eAttribute, EObject eObject, EObject copyEObject) {
+ if(("ChangeSummaryType".equals(eAttribute.getEType().getName()) && "commonj.sdo".equals(eAttribute.getEType().getEPackage().getNsURI()))) {
+ throw new UnsupportedOperationException("This will be implemented when change summary serialization/deserialization is in place");
+ } else {
+ super.copyAttribute(eAttribute, eObject, copyEObject);
+ }
+ }
+ };
+ EObject result = copier.copy((EObject)dataObject);
+ copier.copyReferences();
+ return (DataObject)result;
+ }
+
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/CrossScopeCopyHelperImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/CrossScopeCopyHelperImpl.java
new file mode 100644
index 0000000000..b7a5534800
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/CrossScopeCopyHelperImpl.java
@@ -0,0 +1,255 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.helper;
+
+import java.util.Iterator;
+import java.util.Map;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.ecore.util.FeatureMap;
+import org.eclipse.emf.ecore.util.FeatureMapUtil;
+import org.eclipse.emf.ecore.util.InternalEList;
+import org.eclipse.emf.ecore.util.EcoreUtil.Copier;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Type;
+import commonj.sdo.helper.CopyHelper;
+import commonj.sdo.helper.TypeHelper;
+
+/**
+ * A CopyHelper implementation that creates the copy objects in a specific metadata scope.
+ * The target scope must contain a compatible version of the Types needed to create the copy objects.
+ */
+public class CrossScopeCopyHelperImpl implements CopyHelper
+{
+ protected TypeHelper scope;
+
+ public CrossScopeCopyHelperImpl(TypeHelper targetScope)
+ {
+ scope = targetScope;
+ }
+
+ public DataObject copyShallow(DataObject dataObject)
+ {
+ Copier copier = new CrossScopeCopier()
+ {
+ protected void copyContainment(EReference eReference, EObject eObject, EObject copyEObject)
+ {
+ }
+ protected void copyAttribute(EAttribute eAttribute, EObject eObject, EObject copyEObject)
+ {
+ if (eObject.eIsSet(eAttribute) && !FeatureMapUtil.isFeatureMap(eAttribute))
+ {
+ super.copyAttribute(eAttribute,eObject,copyEObject);
+ }
+ }
+ };
+ EObject result = copier.copy((EObject)dataObject);
+ copier.copyReferences();
+ return (DataObject)result;
+ }
+
+ public DataObject copy(DataObject dataObject)
+ {
+ Copier copier = new CrossScopeCopier();
+ DataObject result = (DataObject)copier.copy((EObject)dataObject);
+ copier.copyReferences();
+ return (DataObject)result;
+ }
+
+ protected class CrossScopeCopier extends EcoreUtil.Copier
+ {
+ protected boolean useOriginalReferences = false;
+
+ protected EClass getTarget(EClass eClass)
+ {
+ EClass target = (EClass)get(eClass);
+ if (target == null)
+ {
+ Type type = (Type)eClass;
+ target = (EClass)scope.getType(type.getURI(), type.getName());
+ }
+ return target;
+ }
+
+ protected EStructuralFeature getTarget(EStructuralFeature eStructuralFeature)
+ {
+ EClass eClass = getTarget(eStructuralFeature.getEContainingClass());
+ EStructuralFeature targetEf = eClass.getEStructuralFeature(eStructuralFeature.getName());
+ return targetEf;
+ }
+
+ /**
+ * This Method WILL BE REMOVED when EMF 3.0 is available
+ */
+ public void copyReferences()
+ {
+ for (Iterator i = entrySet().iterator(); i.hasNext();)
+ {
+ Map.Entry entry = (Map.Entry)i.next();
+ EObject eObject = (EObject)entry.getKey();
+ EObject copyEObject = (EObject)entry.getValue();
+ EClass eClass = eObject.eClass();
+ for (int j = 0, size = eClass.getFeatureCount(); j < size; ++j)
+ {
+ EStructuralFeature eStructuralFeature = eClass.getEStructuralFeature(j);
+ if (eStructuralFeature.isChangeable() && !eStructuralFeature.isDerived())
+ {
+ if (eStructuralFeature instanceof EReference)
+ {
+ EReference eReference = (EReference)eStructuralFeature;
+ if (!eReference.isContainment() && !eReference.isContainer())
+ {
+ copyReference(eReference, eObject, copyEObject);
+ }
+ }
+ else if (FeatureMapUtil.isFeatureMap(eStructuralFeature))
+ {
+ FeatureMap featureMap = (FeatureMap)eObject.eGet(eStructuralFeature);
+ FeatureMap copyFeatureMap = (FeatureMap)copyEObject.eGet(getTarget(eStructuralFeature));
+ int copyFeatureMapSize = copyFeatureMap.size();
+ for (int k = 0, featureMapSize = featureMap.size(); k < featureMapSize; ++k)
+ {
+ EStructuralFeature feature = featureMap.getEStructuralFeature(k);
+ if (feature instanceof EReference)
+ {
+ Object referencedEObject = featureMap.getValue(k);
+ Object copyReferencedEObject = get(referencedEObject);
+ if (copyReferencedEObject == null && referencedEObject != null)
+ {
+ EReference reference = (EReference)feature;
+ if (!useOriginalReferences || reference.isContainment() || reference.getEOpposite() != null)
+ {
+ continue;
+ }
+ copyReferencedEObject = referencedEObject;
+ }
+ // If we can't add it, it must aleady be in the list so find it and move it to the end.
+ //
+ if (!copyFeatureMap.add(feature, copyReferencedEObject))
+ {
+ for (int l = 0; l < copyFeatureMapSize; ++l)
+ {
+ if (copyFeatureMap.getEStructuralFeature(l) == feature && copyFeatureMap.getValue(l) == copyReferencedEObject)
+ {
+ copyFeatureMap.move(copyFeatureMap.size() - 1, l);
+ --copyFeatureMapSize;
+ break;
+ }
+ }
+ }
+ }
+ else
+ {
+ copyFeatureMap.add(featureMap.get(k));
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * This Method WILL BE REMOVED when EMF 3.0 is available
+ */
+ protected void copyReference(EReference eReference, EObject eObject, EObject copyEObject)
+ {
+ if (eObject.eIsSet(eReference))
+ {
+ if (eReference.isMany())
+ {
+ InternalEList source = (InternalEList)eObject.eGet(eReference);
+ InternalEList target = (InternalEList)copyEObject.eGet(getTarget(eReference));
+ if (source.isEmpty())
+ {
+ target.clear();
+ }
+ else
+ {
+ boolean isBidirectional = eReference.getEOpposite() != null;
+ int index = 0;
+ for (Iterator k = resolveProxies ? source.iterator() : source.basicIterator(); k.hasNext();)
+ {
+ Object referencedEObject = k.next();
+ Object copyReferencedEObject = get(referencedEObject);
+ if (copyReferencedEObject == null)
+ {
+ if (useOriginalReferences && !isBidirectional)
+ {
+ target.addUnique(index, referencedEObject);
+ ++index;
+ }
+ }
+ else
+ {
+ if (isBidirectional)
+ {
+ int position = target.indexOf(copyReferencedEObject);
+ if (position == -1)
+ {
+ target.addUnique(index, copyReferencedEObject);
+ }
+ else if (index != position)
+ {
+ target.move(index, copyReferencedEObject);
+ }
+ }
+ else
+ {
+ target.addUnique(index, copyReferencedEObject);
+ }
+ ++index;
+ }
+ }
+ }
+ }
+ else
+ {
+ Object referencedEObject = eObject.eGet(eReference, resolveProxies);
+ if (referencedEObject == null)
+ {
+ copyEObject.eSet(getTarget(eReference), null);
+ }
+ else
+ {
+ Object copyReferencedEObject = get(referencedEObject);
+ if (copyReferencedEObject == null)
+ {
+ if (useOriginalReferences && eReference.getEOpposite() == null)
+ {
+ copyEObject.eSet(getTarget(eReference), referencedEObject);
+ }
+ }
+ else
+ {
+ copyEObject.eSet(getTarget(eReference), copyReferencedEObject);
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/DataFactoryImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/DataFactoryImpl.java
new file mode 100644
index 0000000000..22ce0d3f6c
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/DataFactoryImpl.java
@@ -0,0 +1,65 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.helper;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Type;
+import commonj.sdo.helper.DataFactory;
+import commonj.sdo.helper.TypeHelper;
+
+/**
+ * A Factory for creating DataObjects.
+ * The created DataObjects are not connected to any other DataObjects.
+ */
+public class DataFactoryImpl implements DataFactory
+{
+ protected TypeHelper typeHelper;
+
+ public DataFactoryImpl(TypeHelper typeHelper)
+ {
+ this.typeHelper = typeHelper;
+ }
+
+ public DataObject create(String uri, String typeName)
+ {
+ Type type = typeHelper.getType(uri, typeName);
+ return create(type);
+ }
+
+ public DataObject create(Class interfaceClass)
+ {
+ //TODO more efficient implementation ... this is a really bad one!
+ Type type = typeHelper.getType(interfaceClass);
+ return create(type);
+ }
+
+ public DataObject create(Type type)
+ {
+ if ((type instanceof EClass) && !type.isAbstract())
+ {
+ EClass eClass = (EClass)type;
+ return (DataObject)EcoreUtil.create(eClass);
+ }
+ throw new IllegalArgumentException();
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/DataHelperImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/DataHelperImpl.java
new file mode 100644
index 0000000000..65c8dc216e
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/DataHelperImpl.java
@@ -0,0 +1,565 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.helper;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
+import java.util.Locale;
+import java.util.TimeZone;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+import commonj.sdo.helper.DataHelper;
+
+/**
+ * Data helper methods.
+ */
+public class DataHelperImpl implements DataHelper
+{
+ /**
+ * @param dateString - Must comply to the pattern of yyyy-MM-dd'T'HH:mm:ss'.'SSS'Z'
+ * @return null if dataString couldn't be parsed
+ */
+ public synchronized Date toDate(String dateString)
+ {
+ SimpleDateFormat format;
+ Date result = null;
+ boolean negative = false;
+ String formatString;
+ dateString = dateString.trim();
+
+ if (dateString == null)
+ {
+ return null;
+ }
+
+ // Determine if it is a negative Date, DateTime, or Duration
+
+ if (dateString.length() > 2 && dateString.charAt(0) == '-' && dateString.charAt(1) != '-')
+ {
+ negative = true;
+ dateString = dateString.substring(1);
+ }
+
+ // SDO Date Format ends with a Z
+
+ if (dateString.endsWith("Z"))
+ {
+ if (dateString.indexOf('.') != -1)
+ formatString = new String("yyyy-MM-dd'T'HH:mm:ss'.'S'Z'");
+ else
+ formatString = new String ("yyyy-MM-dd'T'HH:mm:ss'Z'");
+
+ format = new SimpleDateFormat(formatString);
+ format.setTimeZone(TimeZone.getTimeZone("UTC"));
+
+ result = checkFormat(dateString, format);
+
+ // If no match, continue to try further possibilities
+
+ if (result != null)
+ {
+ if (negative)
+ return handleBCE(result);
+ else
+ return result;
+ }
+
+ }
+
+ // Duration format begins with a P
+
+ if (dateString.startsWith("P"))
+ {
+ // Remove any spaces in the dateString
+
+ String durationString = dateString.replaceAll(" ", "");
+
+ // Build the formatString based on the contents of dateString
+
+ formatString = obtainDurationFormats(durationString);
+ format = new SimpleDateFormat(formatString);
+ result = checkFormat(durationString, format);
+ if (result != null)
+ {
+ if (negative)
+ return handleNegative(result);
+ else
+ return result;
+ }
+ }
+
+ formatString = obtainSpecificFormat(dateString);
+
+ if (formatString != null)
+ {
+ format = new SimpleDateFormat(formatString);
+ result = checkFormat(dateString, format);
+
+ if (result != null)
+ {
+ if (negative)
+ return handleBCE(result);
+ else
+ return result;
+ }
+ }
+
+ return null;
+ }
+
+ private synchronized Date checkFormat(String dateString, SimpleDateFormat format)
+ {
+ String formatPattern = format.toPattern();
+ StringBuffer addedFields = new StringBuffer();
+ String fieldsString, parseString;
+ SimpleDateFormat compositeFormat;
+ Date dateValue;
+
+ // For certain permissable input strings (e.g. those resulting from toYear
+ // toDay, toTime), there are fields missing which when converted to Date have
+ // default values. (e.g. Year -> 1970). Because of this, there can be great
+ // variation in how daylight savings time is accounted for. (e.g. In 1970 Britain
+ // was on DST year round, and during the summer of 1944 was on double daylight time.)
+ // Because these possible variations exist, it is assumed that the user would prefer
+ // the current handling of daylight savings time. As such, the year, month and day
+ // will default to their current values when absent. (The user should not be checking
+ // for Year=1970 (etc.) as evidence of taking the default, as explicitly setting a
+ // year to 1970 is valid and would then not be an instance of a default taken.)
+
+ if (!(formatPattern.startsWith("P")))
+ {
+ if (formatPattern.indexOf('y') == -1)
+ addedFields.append("yyyy ");
+
+ if (formatPattern.indexOf('M') == -1)
+ addedFields.append("MM ");
+
+ if (formatPattern.indexOf('d') == -1)
+ addedFields.append("dd ");
+ }
+
+ fieldsString = addedFields.toString();
+
+ if (fieldsString.length() == 0)
+ {
+ parseString = dateString;
+ compositeFormat = format;
+ }
+
+ else
+ {
+ compositeFormat = new SimpleDateFormat(fieldsString);
+ dateValue = new Date(System.currentTimeMillis());
+ parseString = compositeFormat.format(dateValue) + dateString;
+ compositeFormat.applyPattern(fieldsString + formatPattern);
+ }
+
+ try
+ {
+ return compositeFormat.parse(parseString);
+ }
+
+ catch (ParseException parseException)
+ {
+ }
+
+ return null;
+ }
+
+ public synchronized String obtainSpecificFormat(String dateString)
+ {
+ StringBuffer formatBuffer = new StringBuffer();
+ int colonIndex = dateString.indexOf(':');
+ int hyphenIndex = dateString.indexOf('-');
+
+ if (dateString.startsWith("--"))
+ {
+ if (dateString.charAt(2) == '-') // starts with ---
+ formatBuffer.append("'---'dd");
+ else if (dateString.substring(2).indexOf('-') == -1)
+ formatBuffer.append("'--'MM");
+ else
+ formatBuffer.append("'--'MM'-'dd");
+ }
+
+ else if (colonIndex == 1 || colonIndex == 2)
+ {
+ if (dateString.indexOf('.') != -1)
+ formatBuffer.append("HH:mm:ss'.'S");
+ else if (dateString.substring(colonIndex + 1).indexOf(':') != -1)
+ formatBuffer.append("HH:mm:ss");
+ else
+ formatBuffer.append("HH:mm");
+ }
+
+ else if (hyphenIndex != -1)
+ {
+ if (dateString.substring(hyphenIndex + 1).indexOf('-') == -1)
+ formatBuffer.append("yyyy-MM");
+ else if (colonIndex != -1)
+ {
+ if (dateString.indexOf('.') != -1)
+ formatBuffer.append("yyyy-MM-dd'T'HH:mm:ss'.'S");
+ else if (dateString.substring(colonIndex + 1).indexOf(':') != -1)
+ formatBuffer.append("yyyy-MM-dd'T'HH:mm:ss");
+ else
+ formatBuffer.append("yyyy-MM-dd'T'HH:mm");
+ }
+ else
+ formatBuffer.append ("yyyy-MM-dd");
+ }
+ else if (colonIndex == -1) // indexOf('-') == -1
+ {
+ formatBuffer.append("yyyy");
+ }
+ else
+ return null;
+
+ // Determine if a Time Zone is included and needs to be parsed.
+ // ---------------------------------
+ // The only letter allowed in the above formats is 'T'.
+ // All times zones include at least one letter other than 'T'.
+
+ int i = 0;
+ boolean letterFound = false;
+ char currentChar;
+ while (i < dateString.length() && !letterFound)
+ {
+ currentChar = dateString.charAt(i);
+ if (Character.isLetter(currentChar) && currentChar != 'T')
+ letterFound = true;;
+ i++;
+ }
+
+ if (letterFound)
+ formatBuffer.append(" z");
+
+ return formatBuffer.toString();
+ }
+
+ public synchronized String obtainDurationFormats(String dateString)
+ {
+ String firstPart, secondPart;
+ StringBuffer formatBuffer = new StringBuffer("'P'");
+
+ // Must divide it into two parts to distinguish between Months and Minutes
+
+ int time_index = dateString.indexOf('T');
+ if (time_index != -1)
+ {
+ firstPart = dateString.substring(0, time_index + 1);
+ secondPart = dateString.substring(time_index);
+ }
+ else
+ {
+ firstPart = dateString;
+ secondPart = null;
+ }
+
+ if (firstPart.indexOf('Y') != -1)
+ formatBuffer.append("yyyy'Y'");
+ if (firstPart.indexOf('M') != -1)
+ formatBuffer.append("MM'M'");
+ if (firstPart.indexOf('D') != -1)
+ formatBuffer.append("dd'D'");
+ if (time_index != -1)
+ {
+ formatBuffer.append("'T'");
+
+ if (secondPart.indexOf('H') != -1)
+ formatBuffer.append("HH'H'");
+ if (secondPart.indexOf('M') != -1)
+ formatBuffer.append("mm'M'");
+ if (secondPart.indexOf("S.") != -1)
+ formatBuffer.append("ss'S'.S");
+ else if (secondPart.indexOf('S') != -1)
+ formatBuffer.append("ss'S'");
+ }
+
+ return formatBuffer.toString().replaceAll("''", "");
+ }
+
+ // Return a negative Duration if a negative sign existed in dateString
+ public synchronized Date handleNegative(Date output)
+ {
+ return new Date(0 - output.getTime());
+ }
+
+ // Return the date in BCE if a negative sign existed in dateString
+
+ public synchronized Date handleBCE(Date output)
+ {
+ GregorianCalendar temp = new GregorianCalendar();
+ temp.setTime(output);
+ temp.set(GregorianCalendar.ERA, GregorianCalendar.BC);
+
+ return temp.getTime();
+ }
+
+ public synchronized Calendar toCalendar(String dateString)
+ {
+ if (dateString == null)
+ {
+ return null;
+ }
+
+ Date date = toDate(dateString);
+ if (date == null)
+ {
+ return null;
+ }
+
+ Calendar calendar = new GregorianCalendar();
+ calendar.setTime(date);
+
+ return calendar;
+ }
+
+ public synchronized Calendar toCalendar(String dateString, Locale locale)
+ {
+ if (dateString == null || locale == null)
+ {
+ return null;
+ }
+
+ Date date = toDate(dateString);
+ if (date == null)
+ {
+ return null;
+ }
+
+ Calendar calendar = new GregorianCalendar(locale);
+ calendar.setTime(date);
+ return calendar;
+ }
+
+ public synchronized String toDateTime(Date date)
+ {
+ if (date == null)
+ {
+ return null;
+ }
+
+ SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'.'SSS'Z'");
+ f.setTimeZone(TimeZone.getTimeZone("UTC"));
+
+ return f.format(date);
+ }
+
+ public synchronized String toDuration(Date date)
+ {
+ if (date == null)
+ {
+ return null;
+ }
+
+ SimpleDateFormat f = new SimpleDateFormat("'P'yyyy'Y' MM'M' dd'D' 'T' HH'H' mm'M' ss'S.'SSS");
+
+ return f.format(date);
+ }
+
+ public synchronized String toTime(Date date)
+ {
+ if (date == null)
+ {
+ return null;
+ }
+
+ SimpleDateFormat f = new SimpleDateFormat("HH:mm:ss'.'SSS zz");
+
+ return f.format(date);
+ }
+
+ public synchronized String toDay(Date date)
+ {
+ if (date == null)
+ {
+ return null;
+ }
+
+ SimpleDateFormat f = new SimpleDateFormat("---dd zz");
+
+ return f.format(date);
+ }
+
+ public synchronized String toMonth(Date date)
+ {
+ if (date == null)
+ {
+ return null;
+ }
+
+ SimpleDateFormat f = new SimpleDateFormat("--MM zz");
+
+ return f.format(date);
+ }
+
+ public synchronized String toMonthDay(Date date)
+ {
+ if (date == null)
+ {
+ return null;
+ }
+
+ SimpleDateFormat f = new SimpleDateFormat("--MM-dd zz");
+
+ return f.format(date);
+ }
+
+ public synchronized String toYear(Date date)
+ {
+ if (date == null)
+ {
+ return null;
+ }
+
+ SimpleDateFormat f = new SimpleDateFormat("yyyy zz");
+
+ return f.format(date);
+ }
+
+ public synchronized String toYearMonth(Date date)
+ {
+ if (date == null)
+ {
+ return null;
+ }
+
+ SimpleDateFormat f = new SimpleDateFormat("yyyy-MM zz");
+
+ return f.format(date);
+ }
+
+ public synchronized String toYearMonthDay(Date date)
+ {
+ if (date == null)
+ {
+ return null;
+ }
+
+ SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd zz");
+
+ return f.format(date);
+ }
+
+ public synchronized String toDateTime(Calendar calendar)
+ {
+ if (calendar == null)
+ {
+ return null;
+ }
+
+ return toDateTime(calendar.getTime());
+ }
+
+ public synchronized String toDuration(Calendar calendar)
+ {
+ if (calendar == null)
+ {
+ return null;
+ }
+
+ return toDuration(calendar.getTime());
+ }
+
+ public synchronized String toTime(Calendar calendar)
+ {
+ if (calendar == null)
+ {
+ return null;
+ }
+
+ return toTime(calendar.getTime());
+ }
+
+ public synchronized String toDay(Calendar calendar)
+ {
+ if (calendar == null)
+ {
+ return null;
+ }
+
+ return toDay(calendar.getTime());
+ }
+
+ public synchronized String toMonth(Calendar calendar)
+ {
+ if (calendar == null)
+ {
+ return null;
+ }
+
+ return toMonth(calendar.getTime());
+ }
+
+ public synchronized String toMonthDay(Calendar calendar)
+ {
+ if (calendar == null)
+ {
+ return null;
+ }
+
+ return toMonthDay(calendar.getTime());
+ }
+
+ public synchronized String toYear(Calendar calendar)
+ {
+ if (calendar == null)
+ {
+ return null;
+ }
+
+ return toYear(calendar.getTime());
+ }
+
+ public synchronized String toYearMonth(Calendar calendar)
+ {
+ if (calendar == null)
+ {
+ return null;
+ }
+
+ return toYearMonth(calendar.getTime());
+ }
+
+ public synchronized String toYearMonthDay(Calendar calendar)
+ {
+ if (calendar == null)
+ {
+ return null;
+ }
+
+ return toYearMonthDay(calendar.getTime());
+ }
+
+ public Object convert(Type type, Object value)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Object convert(Property property, Object value)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/EqualityHelperImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/EqualityHelperImpl.java
new file mode 100644
index 0000000000..d64c58dea2
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/EqualityHelperImpl.java
@@ -0,0 +1,81 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.helper;
+
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.helper.EqualityHelper;
+
+
+/**
+ * A helper for comparing DataObjects.
+ */
+public class EqualityHelperImpl implements EqualityHelper
+{
+ public boolean equalShallow(DataObject dataObject1, DataObject dataObject2)
+ {
+ EcoreUtil.EqualityHelper equalityHelper = new EcoreUtil.EqualityHelper()
+ {
+ protected boolean haveEqualFeature(EObject eObject1, EObject eObject2, EStructuralFeature feature)
+ {
+ if (feature instanceof EAttribute)
+ {
+ if(!("ChangeSummaryType".equals(feature.getEType().getName()) && "commonj.sdo".equals(feature.getEType().getEPackage().getNsURI()))) {
+ boolean eIsSet = eObject1.eIsSet(feature);
+ if (eIsSet != eObject2.eIsSet(feature) || !haveEqualAttribute(eObject1, eObject2, (EAttribute)feature))
+ {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ protected boolean equalFeatureMapValues(Object value1, Object value2, EStructuralFeature feature)
+ {
+ if (feature instanceof EAttribute)
+ {
+ return value1 == null ? value2 == null : value1.equals(value2);
+ }
+ return true;
+ }
+ };
+ return equalityHelper.equals((EObject)dataObject1, (EObject)dataObject2);
+ }
+
+ public boolean equal(DataObject dataObject1, DataObject dataObject2)
+ {
+ EcoreUtil.EqualityHelper equalityHelper = new EcoreUtil.EqualityHelper()
+ {
+ protected boolean haveEqualAttribute(EObject eObject1, EObject eObject2, EAttribute attribute) {
+ if(("ChangeSummaryType".equals(attribute.getEType().getName()) && "commonj.sdo".equals(attribute.getEType().getEPackage().getNsURI()))) {
+ throw new UnsupportedOperationException("This will be implemented when change summary serialzation/deserialization is in place");
+ } else {
+ return super.haveEqualAttribute(eObject1, eObject2, attribute);
+ }
+ }
+ };
+ return equalityHelper.equals((EObject)dataObject1, (EObject)dataObject2); }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/HelperContextImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/HelperContextImpl.java
new file mode 100644
index 0000000000..b031547891
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/HelperContextImpl.java
@@ -0,0 +1,98 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sdo.helper;
+
+import java.util.Iterator;
+
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.impl.EPackageRegistryImpl;
+import org.eclipse.emf.ecore.util.ExtendedMetaData;
+
+import commonj.sdo.helper.CopyHelper;
+import commonj.sdo.helper.DataFactory;
+import commonj.sdo.helper.DataHelper;
+import commonj.sdo.helper.EqualityHelper;
+import commonj.sdo.helper.HelperContext;
+import commonj.sdo.helper.TypeHelper;
+import commonj.sdo.helper.XMLHelper;
+import commonj.sdo.helper.XSDHelper;
+
+public class HelperContextImpl implements HelperContext
+{
+ private DataFactory dataFactory;
+ private TypeHelper typeHelper;
+ private XMLHelper xmlHelper;
+ private XSDHelper xsdHelper;
+
+ public HelperContextImpl(ExtendedMetaData extendedMetaData, boolean extensibleNamespaces) {
+ typeHelper = new TypeHelperImpl(extendedMetaData);
+ dataFactory = new DataFactoryImpl(typeHelper);
+ xmlHelper = new XMLHelperImpl(typeHelper);
+ xsdHelper = new XSDHelperImpl(typeHelper, extensibleNamespaces);
+ }
+
+ public HelperContextImpl(boolean extensibleNamespaces) {
+ this(new SDOExtendedMetaDataImpl(new EPackageRegistryImpl(getBuiltInModelRegistry())), extensibleNamespaces);
+ }
+
+ static protected EPackage.Registry builtInModelRegistry = null;
+ static protected EPackage.Registry getBuiltInModelRegistry()
+ {
+ if (builtInModelRegistry == null) {
+ builtInModelRegistry = new EPackageRegistryImpl();
+ for (Iterator iter = TypeHelperImpl.getBuiltInModels().iterator(); iter.hasNext(); )
+ {
+ EPackage ePackage = (EPackage)iter.next();
+ builtInModelRegistry.put(ePackage.getNsURI(), ePackage);
+ }
+ }
+ return builtInModelRegistry;
+ }
+
+ public CopyHelper getCopyHelper() {
+ return CopyHelper.INSTANCE;
+ }
+
+ public DataFactory getDataFactory() {
+ return dataFactory;
+ }
+
+ public DataHelper getDataHelper() {
+ return DataHelper.INSTANCE;
+ }
+
+ public EqualityHelper getEqualityHelper() {
+ return EqualityHelper.INSTANCE;
+ }
+
+ public TypeHelper getTypeHelper() {
+ return typeHelper;
+ }
+
+ public XMLHelper getXMLHelper() {
+ return xmlHelper;
+ }
+
+ public XSDHelper getXSDHelper() {
+ return xsdHelper;
+ }
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/HelperProviderImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/HelperProviderImpl.java
new file mode 100644
index 0000000000..a0092c4226
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/HelperProviderImpl.java
@@ -0,0 +1,236 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.helper;
+
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.NotSerializableException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.io.ObjectStreamException;
+import java.util.zip.GZIPInputStream;
+import java.util.zip.GZIPOutputStream;
+
+import org.apache.tuscany.sdo.util.DataObjectUtil;
+import org.apache.tuscany.sdo.util.resource.SDOObjectInputStream;
+
+import commonj.sdo.DataGraph;
+import commonj.sdo.DataObject;
+import commonj.sdo.helper.CopyHelper;
+import commonj.sdo.helper.DataFactory;
+import commonj.sdo.helper.DataHelper;
+import commonj.sdo.helper.EqualityHelper;
+import commonj.sdo.helper.HelperContext;
+import commonj.sdo.helper.TypeHelper;
+import commonj.sdo.helper.XMLDocument;
+import commonj.sdo.helper.XMLHelper;
+import commonj.sdo.helper.XSDHelper;
+import commonj.sdo.impl.HelperProvider;
+import commonj.sdo.impl.ExternalizableDelegator.Resolvable;
+
+
+/**
+ * Create and manage all the default helper INSTANCEs
+ */
+public class HelperProviderImpl extends HelperProvider
+{
+ protected CopyHelper copyHelper;
+
+ protected DataFactory dataFactory;
+
+ protected DataHelper dataHelper;
+
+ protected EqualityHelper equalityHelper;
+
+ protected TypeHelper typeHelper;
+
+ protected XMLHelper xmlHelper;
+
+ protected XSDHelper xsdHelper;
+
+ public HelperProviderImpl()
+ {
+ //FB HelperContext hc = SDOUtil.createHelperContext();
+ //FB The defulat HelperContext must use EMF's ClassLoader-delegating EPackage.Registry.INSTANCE, until we provide
+ //FB another way to get (ClassLoader scope) support for HelperContext.
+ HelperContext hc = new HelperContextImpl(new SDOExtendedMetaDataImpl(), false);
+ typeHelper = hc.getTypeHelper();
+ dataFactory = hc.getDataFactory();
+ xmlHelper = hc.getXMLHelper();
+ xsdHelper = hc.getXSDHelper();
+ copyHelper = new CopyHelperImpl();
+ equalityHelper = new EqualityHelperImpl();
+ dataHelper = new DataHelperImpl();
+ }
+
+ public CopyHelper copyHelper()
+ {
+ return copyHelper;
+ }
+
+ public DataFactory dataFactory()
+ {
+ return dataFactory;
+ }
+
+ public DataHelper dataHelper()
+ {
+ return dataHelper;
+ }
+
+ public EqualityHelper equalityHelper()
+ {
+ return equalityHelper;
+ }
+
+ public TypeHelper typeHelper()
+ {
+ return typeHelper;
+ }
+
+ public XMLHelper xmlHelper()
+ {
+ return xmlHelper;
+ }
+
+ public XSDHelper xsdHelper()
+ {
+ return xsdHelper;
+ }
+
+ public Resolvable resolvable()
+ {
+ return new ResolvableImpl();
+ }
+
+ public Resolvable resolvable(Object target)
+ {
+ return new ResolvableImpl(target);
+ }
+
+ protected class ResolvableImpl implements Resolvable
+ {
+ protected Object target;
+
+ public ResolvableImpl(Object target) { this.target = target; }
+
+ public ResolvableImpl() { this.target = null; }
+
+ public void writeExternal(ObjectOutput out) throws IOException
+ {
+ if (target instanceof DataObject)
+ {
+ writeDataObject((DataObject)target, out);
+ }
+ else
+ {
+ throw new NotSerializableException(); // should never happen
+ }
+ }
+
+ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
+ {
+ target = readDataObject(in);
+ }
+
+ public Object readResolve() throws ObjectStreamException
+ {
+ return target;
+ }
+
+ protected void writeDataObject(DataObject dataObject, ObjectOutput objectOutput) throws IOException
+ {
+ DataGraph dataGraph = dataObject.getDataGraph();
+ if (dataGraph != null)
+ {
+ objectOutput.writeByte(0);
+ objectOutput.writeUTF(DataObjectUtil.getXPath(dataObject));
+ objectOutput.writeObject(dataGraph);
+ }
+ else if (dataObject.getContainer() != null)
+ {
+ objectOutput.writeByte(0);
+ objectOutput.writeUTF(DataObjectUtil.getXPath(dataObject));
+ objectOutput.writeObject(dataObject.getRootObject());
+ }
+ else
+ {
+ // Root object
+ objectOutput.writeByte(1);
+
+ ByteArrayOutputStream compressedByteArrayOutputStream = new ByteArrayOutputStream();
+ GZIPOutputStream gzipOutputStream = new GZIPOutputStream(compressedByteArrayOutputStream);
+ XMLHelper xmlHelperLocal = xmlHelper;
+ if(objectOutput instanceof SDOObjectInputStream)
+ {
+ xmlHelperLocal = ((SDOObjectInputStream)objectOutput).getHelperContext().getXMLHelper();
+ }
+ xmlHelperLocal.save(dataObject, "commonj.sdo", "dataObject", gzipOutputStream);
+ gzipOutputStream.close(); // Flush the contents
+
+ byte[] byteArray = compressedByteArrayOutputStream.toByteArray();
+ objectOutput.writeInt(byteArray.length);
+ objectOutput.write(byteArray);
+ }
+ }
+
+ protected DataObject readDataObject(ObjectInput objectInput) throws IOException, ClassNotFoundException
+ {
+ boolean isRoot = objectInput.readByte() == 1;
+ if (isRoot)
+ {
+ // Root object: [rootXML] = length + XML contents
+ int length = objectInput.readInt();
+ byte[] compressedBytes = new byte [length];
+
+ int index = 0;
+ int bytesRead;
+ while (index < length) {
+ if ((bytesRead = objectInput.read(compressedBytes, index, length-index)) == -1) {
+ break;
+ }
+ index += bytesRead;
+ }
+
+ GZIPInputStream gzipInputStream = new GZIPInputStream(new ByteArrayInputStream(compressedBytes));
+ XMLHelper xmlHelperLocal = xmlHelper;
+ if(objectInput instanceof SDOObjectInputStream)
+ {
+ xmlHelperLocal = ((SDOObjectInputStream)objectInput).getHelperContext().getXMLHelper();
+ }
+ XMLDocument doc = xmlHelperLocal.load(gzipInputStream);
+ gzipInputStream.close();
+
+ return doc.getRootObject();
+ }
+ else
+ {
+ // Non root object: [path] [root]
+ String xpath = objectInput.readUTF();
+ Object object = objectInput.readObject();
+
+ DataObject root = object instanceof DataGraph ? ((DataGraph)object).getRootObject() : (DataObject)object;
+ return xpath.equals("") ? root : root.getDataObject(xpath);
+ }
+ }
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/SDOAnnotations.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/SDOAnnotations.java
new file mode 100644
index 0000000000..816fb3bf9f
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/SDOAnnotations.java
@@ -0,0 +1,51 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.helper;
+
+public class SDOAnnotations
+{
+ public static final String COLON = ":";
+ public static final String COMMONJ_SDO_NS = "commonj.sdo";
+ public static final String COMMONJ_SDO_NS_PREFIX = "sdo";
+ public static final String SDO_JAVA_NS = "commonj.sdo/java";
+ public static final String SDO_JAVA_NS_PREFIX = "sdoJava";
+
+ public static final String JAVA_PACKAGE = SDO_JAVA_NS_PREFIX + COLON + "package";
+ public static final String ALIAS_NAMES = COMMONJ_SDO_NS_PREFIX + COLON + "aliasName";
+ public static final String READ_ONLY = COMMONJ_SDO_NS_PREFIX + COLON + "readOnly";
+ public static final String INSTANCE_CLASS = SDO_JAVA_NS_PREFIX + COLON + "instanceClass";
+ public static final String ABSTRACT_TYPE = "abstract";
+ public static final String PROPERTY_TYPE = COMMONJ_SDO_NS_PREFIX + COLON + "propertyType";
+ public static final String OPPOSITE_PROPERTY = COMMONJ_SDO_NS_PREFIX + COLON + "oppositeProperty";
+
+
+ //used by the annotations map to uniquely identify schema elements that need to be annotated
+ //and to store the corresponding annotations in a map
+ public static final String SCHEMA = "schema";
+ public static final String ELEMENT = "element";
+ public static final String COMPLEX_TYPE = "complexType";
+ public static final String SIMPLE_TYPE = "simpleType";
+ public static final String ATTRIBUTE = "attribute";
+
+ public static String makeAnnotationMapKey(String namespace, String schemaElementType, String nameAttrValue)
+ {
+ return namespace + schemaElementType + nameAttrValue;
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/SDOExtendedMetaDataImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/SDOExtendedMetaDataImpl.java
new file mode 100644
index 0000000000..467c774ae7
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/SDOExtendedMetaDataImpl.java
@@ -0,0 +1,285 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.helper;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.StringTokenizer;
+
+import org.apache.tuscany.sdo.SDOExtendedMetaData;
+import org.apache.tuscany.sdo.impl.SDOFactoryImpl.SDOEcoreFactory;
+import org.apache.tuscany.sdo.model.ModelFactory;
+import org.apache.tuscany.sdo.model.impl.ModelFactoryImpl;
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EModelElement;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.EPackage.Registry;
+
+/**
+ * TODO make demand() methods synchronous?
+ */
+public class SDOExtendedMetaDataImpl
+ extends BaseSDOExtendedMetaDataImpl
+ implements SDOExtendedMetaData
+{
+
+ public SDOExtendedMetaDataImpl() {
+ this(EPackage.Registry.INSTANCE);
+ }
+
+ public SDOExtendedMetaDataImpl(Registry registry) {
+ super(registry);
+ ecoreFactory = new SDOEcoreFactory();
+ demandMetaData = new SDODemandMetaData();
+ }
+
+ public static class SDODemandMetaData extends DemandMetaData {
+ EClassifier getEObject() { return (EClassifier)((ModelFactoryImpl)ModelFactory.INSTANCE).getDataObject(); }
+ EClassifier getAnySimpleType() { return (EClassifier)((ModelFactoryImpl)ModelFactory.INSTANCE).getObject(); }
+ }
+
+ public EPackage getPackage(String namespace)
+ {
+ if ("".equals(namespace)) namespace = null; //FB
+ EPackage result = registry.getEPackage(namespace);
+ return result == null ? super.getPackage(namespace) : result;
+ }
+
+ /**
+ * Returns the listing of alias names as specified by the sdo:aliasNames
+ * property.
+ */
+ public List getAliasNames(EModelElement modelElement) {
+ EAnnotation eAnnotation = getAnnotation(modelElement, false);
+ List list = null;
+ if (eAnnotation != null) {
+ String aliasNames = (String)eAnnotation.getDetails().get("aliasNames");
+ if (aliasNames != null) {
+ list = new ArrayList();
+ StringTokenizer st = new StringTokenizer(aliasNames, " ");
+ while (st.hasMoreTokens()) {
+ String t = st.nextToken();
+ list.add(t);
+ }
+ }
+ }
+ return list;
+ }
+
+
+ public void setAliasNames(EModelElement modelElement, List aliasNames) {
+ if (aliasNames == null || aliasNames.isEmpty()) {
+ setAliasNames(modelElement, (String)null);
+ } else {
+ StringBuffer buf = new StringBuffer();
+ for (int n = 0; n < aliasNames.size(); n++) {
+ String name = (String) aliasNames.get(n);
+ buf.append(name);
+ buf.append(" ");
+ }
+ setAliasNames(modelElement, buf.toString());
+ }
+ }
+
+ /**
+ * Adds an alias name per sdo:aliasName
+ */
+ public void setAliasNames(EModelElement modelElement, String aliasNames) {
+ EAnnotation eAnnotation = getAnnotation(modelElement, true);
+ eAnnotation.getDetails().put("aliasNames", aliasNames);
+ }
+
+ public EPackage.Registry getRegistry()
+ {
+ return registry;
+ }
+
+ boolean featureNamespaceMatchingLax = true;
+
+ public void setFeatureNamespaceMatchingLax(boolean b) {
+ featureNamespaceMatchingLax = b;
+ }
+
+ protected boolean isFeatureNamespaceMatchingLax() {
+ return featureNamespaceMatchingLax;
+ }
+
+
+ /******************************************************************************************************
+ * Following methods, getLocalAttribute & getLocalElement, ARE TEMPORARY COPIES FROM THE BASE CLASS.
+ * One line (the last line)in each method is changed to support lax namespace matching.
+ * DO NOT EDIT THESE METHODS. THEY WILL BE REMOVED WHEN WE MOVE TO EMF 2.3, WHICH FIXES THE PROBLEM.
+ ******************************************************************************************************/
+
+ public EStructuralFeature getLocalAttribute(EClass eClass, String namespace, String name)
+ {
+ EStructuralFeature result = null;
+ if (isFeatureKindSpecific())
+ {
+ List allAttributes = getAllAttributes(eClass);
+ for (int i = 0, size = allAttributes.size(); i < size; ++i)
+ {
+ EStructuralFeature eStructuralFeature = (EStructuralFeature) allAttributes.get(i);
+ if (name.equals(getName(eStructuralFeature)))
+ {
+ String featureNamespace = getNamespace(eStructuralFeature);
+ if (namespace == null)
+ {
+ if (featureNamespace == null)
+ {
+ return eStructuralFeature;
+ }
+ else if (result == null)
+ {
+ result = eStructuralFeature;
+ }
+ }
+ else if (namespace.equals(featureNamespace))
+ {
+ return eStructuralFeature;
+ }
+ else if (featureNamespace == null && result == null)
+ {
+ result = eStructuralFeature;
+ }
+ }
+ }
+ }
+ else
+ {
+ for (int i = 0, size = eClass.getFeatureCount(); i < size; ++i)
+ {
+ EStructuralFeature eStructuralFeature = eClass.getEStructuralFeature(i);
+ switch (getFeatureKind(eStructuralFeature))
+ {
+ case UNSPECIFIED_FEATURE:
+ case ATTRIBUTE_FEATURE:
+ {
+ if (name.equals(getName(eStructuralFeature)))
+ {
+ String featureNamespace = getNamespace(eStructuralFeature);
+ if (namespace == null)
+ {
+ if (featureNamespace == null)
+ {
+ return eStructuralFeature;
+ }
+ else if (result == null)
+ {
+ result = eStructuralFeature;
+ }
+ }
+ else if (namespace.equals(featureNamespace))
+ {
+ return eStructuralFeature;
+ }
+ else if (featureNamespace == null && result == null)
+ {
+ result = eStructuralFeature;
+ }
+ }
+ break;
+ }
+ }
+ }
+ }
+
+ return isFeatureNamespaceMatchingLax() ? result : null;
+ }
+
+ protected EStructuralFeature getLocalElement(EClass eClass, String namespace, String name)
+ {
+ EStructuralFeature result = null;
+ if (isFeatureKindSpecific())
+ {
+ List allElements = getAllElements(eClass);
+ for (int i = 0, size = allElements.size(); i < size; ++i)
+ {
+ EStructuralFeature eStructuralFeature = (EStructuralFeature) allElements.get(i);
+ if (name.equals(getName(eStructuralFeature)))
+ {
+ String featureNamespace = getNamespace(eStructuralFeature);
+ if (namespace == null)
+ {
+ if (featureNamespace == null)
+ {
+ return eStructuralFeature;
+ }
+ else if (result == null)
+ {
+ result = eStructuralFeature;
+ }
+ }
+ else if (namespace.equals(featureNamespace))
+ {
+ return eStructuralFeature;
+ }
+ else if (featureNamespace == null && result == null)
+ {
+ result = eStructuralFeature;
+ }
+ }
+ }
+ }
+ else
+ {
+ for (int i = 0, size = eClass.getFeatureCount(); i < size; ++i)
+ {
+ EStructuralFeature eStructuralFeature = eClass.getEStructuralFeature(i);
+ switch (getFeatureKind(eStructuralFeature))
+ {
+ case UNSPECIFIED_FEATURE:
+ case ELEMENT_FEATURE:
+ {
+ if (name.equals(getName(eStructuralFeature)))
+ {
+ String featureNamespace = getNamespace(eStructuralFeature);
+ if (namespace == null)
+ {
+ if (featureNamespace == null)
+ {
+ return eStructuralFeature;
+ }
+ else if (result == null)
+ {
+ result = eStructuralFeature;
+ }
+ }
+ else if (namespace.equals(featureNamespace))
+ {
+ return eStructuralFeature;
+ }
+ else if (featureNamespace == null && result == null)
+ {
+ result = eStructuralFeature;
+ }
+ }
+ break;
+ }
+ }
+ }
+ }
+
+ return isFeatureNamespaceMatchingLax() ? result : null;
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/SDOXSDEcoreBuilder.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/SDOXSDEcoreBuilder.java
new file mode 100644
index 0000000000..f66a0c19f9
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/SDOXSDEcoreBuilder.java
@@ -0,0 +1,670 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.helper;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map.Entry;
+
+import javax.xml.XMLConstants;
+
+import org.apache.tuscany.sdo.SDOExtendedMetaData;
+import org.apache.tuscany.sdo.impl.SDOFactoryImpl.SDOEcoreFactory;
+import org.apache.tuscany.sdo.model.ModelFactory;
+import org.apache.tuscany.sdo.util.SDOUtil;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EEnum;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.util.ExtendedMetaData;
+import org.eclipse.emf.ecore.util.EcoreUtil.UsageCrossReferencer;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDComponent;
+import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDFeature;
+import org.eclipse.xsd.XSDNamedComponent;
+import org.eclipse.xsd.XSDParticle;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+import org.eclipse.xsd.XSDTerm;
+import org.eclipse.xsd.XSDTypeDefinition;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+
+public class SDOXSDEcoreBuilder extends BaseSDOXSDEcoreBuilder
+{
+ protected boolean replaceConflictingTypes = false;
+
+ public SDOXSDEcoreBuilder(ExtendedMetaData extendedMetaData, boolean replaceConflictingTypes)
+ {
+ super(extendedMetaData);
+ ecoreFactory = new SDOEcoreFactory();
+ this.replaceConflictingTypes = replaceConflictingTypes;
+ populateTypeToTypeObjectMap((EPackage)ModelFactory.INSTANCE);
+ }
+
+ /**
+ * Overrides method in EMF. This will cause the SDO Properties to be in the
+ * order in which the Attributes appeared in the XSD.
+ */
+ protected boolean useSortedAttributes()
+ {
+ return false;
+ }
+
+ /*
+ * Required for Java 1.4.2 support
+ * Node#lookupPrefix is only available since DOM Level 3 (Java 5)
+ * and it doesn't return rebound prefix.
+ * XSDConstants.lookupQualifier isn't supposed to return rebound prefix either.
+ * This lookupPrefix returns any bound prefix no matter rebound to other NameSpace or not, for {@link #getEPackage}.
+ */
+ static protected String lookupPrefix(Node element, String namespaceURI) {
+ String prefix = element.getPrefix();
+ if (prefix != null && namespaceURI != null && namespaceURI.equals(element.getNamespaceURI()))
+ return prefix;
+ NamedNodeMap attributes = element.getAttributes();
+ if (attributes != null)
+ for (int index = attributes.getLength(); index != 0;) {
+ Node attribute = attributes.item(--index);
+ if (XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(attribute.getNamespaceURI()) && attribute.getNodeValue().equals(namespaceURI)
+ && XMLConstants.XMLNS_ATTRIBUTE.equals(attribute.getPrefix()))
+ return attribute.getLocalName();
+ }
+ for (Node parent; (parent = element.getParentNode()) != null; element = parent)
+ if (parent.getNodeType() == Node.ELEMENT_NODE)
+ return lookupPrefix(parent, namespaceURI);
+ return null;
+ }
+
+ public EPackage getEPackage(XSDNamedComponent xsdNamedComponent) {
+ XSDSchema containingXSDSchema = xsdNamedComponent.getSchema();
+ String targetNamespace = containingXSDSchema == null ?
+ xsdNamedComponent.getTargetNamespace() : containingXSDSchema.getTargetNamespace();
+ EPackage ePackage = (EPackage) targetNamespaceToEPackageMap.get(targetNamespace);
+ if (ePackage != null)
+ return ePackage;
+ ePackage = super.getEPackage(xsdNamedComponent);
+ String nsPrefix = lookupPrefix(xsdNamedComponent.getElement(), targetNamespace);
+ if (nsPrefix != null)
+ ePackage.setNsPrefix(nsPrefix);
+ return ePackage;
+ }
+
+ public EClassifier getEClassifier(XSDTypeDefinition xsdTypeDefinition) {
+ EClassifier eClassifier = null;
+ if (xsdTypeDefinition != null)
+ {
+ if (rootSchema.getSchemaForSchemaNamespace().equals(xsdTypeDefinition.getTargetNamespace())) {
+ eClassifier =
+ getBuiltInEClassifier(xsdTypeDefinition.getURI(), xsdTypeDefinition.getName());
+ }
+ else if (xsdTypeDefinition.getContainer() == null) {
+ EPackage pkg = extendedMetaData.getPackage(xsdTypeDefinition.getTargetNamespace());
+ if(pkg != null) {
+ eClassifier = pkg.getEClassifier(xsdTypeDefinition.getName());
+ }
+ }
+ }
+ if (eClassifier == null) {
+ eClassifier = super.getEClassifier(xsdTypeDefinition);
+ }
+ return eClassifier;
+ }
+
+ public EDataType getEDataType(XSDSimpleTypeDefinition xsdSimpleTypeDefinition) {
+ EDataType eClassifier = null;
+ if (xsdSimpleTypeDefinition != null && rootSchema.getSchemaForSchemaNamespace().equals(xsdSimpleTypeDefinition.getTargetNamespace())) {
+ eClassifier =
+ (EDataType)getBuiltInEClassifier(
+ xsdSimpleTypeDefinition.getURI(),
+ xsdSimpleTypeDefinition.getName());
+ } else {
+ eClassifier = super.getEDataType(xsdSimpleTypeDefinition);
+ }
+ return (EDataType)eClassifier;
+ }
+
+ protected EClassifier getBuiltInEClassifier(String namespace, String name)
+ {
+ EClassifier eClassifier = (EClassifier)SDOUtil.getXSDSDOType(name);
+ if (eClassifier == null) {
+ eClassifier = super.getBuiltInEClassifier(namespace, name);
+ }
+ return eClassifier;
+ }
+
+ private void updateReferences(EObject oldEObject, EObject newEObject)
+ {
+ Collection usages = UsageCrossReferencer.find(oldEObject, targetNamespaceToEPackageMap.values());
+ for (Iterator iter = usages.iterator(); iter.hasNext(); )
+ {
+ EStructuralFeature.Setting setting = (EStructuralFeature.Setting)iter.next();
+ EObject referencingEObject = setting.getEObject();
+ EStructuralFeature eStructuralFeature = setting.getEStructuralFeature();
+ if (eStructuralFeature.isChangeable())
+ {
+ if (eStructuralFeature.isMany())
+ {
+ List refList = (List)referencingEObject.eGet(eStructuralFeature);
+ int refIndex = refList.indexOf(oldEObject);
+ if (refIndex != -1) refList.set(refIndex, newEObject);
+ }
+ else
+ {
+ referencingEObject.eSet(eStructuralFeature, newEObject);
+ }
+ }
+ }
+ }
+
+ private XSDTypeDefinition getXSDTypeDefinition(EClassifier eClassifier)
+ {
+ //TODO Maybe we should create a reverse (eModelElementToXSDComponentMap) for better performance.
+ // Use a HashMap subclass for xsdComponentToEModelElementMap that overrides put() to also add the
+ // reverse mapping in eModelElementToXSDComponentMap
+ XSDTypeDefinition xsdTypeDefinition = null;
+ for (Iterator i = xsdComponentToEModelElementMap.entrySet().iterator(); i.hasNext(); )
+ {
+ Entry e = (Entry) i.next();
+ if (eClassifier == e.getValue())
+ {
+ xsdTypeDefinition = (XSDTypeDefinition)e.getKey();
+ break;
+ }
+ }
+ return xsdTypeDefinition;
+ }
+
+ private boolean sameType(XSDTypeDefinition t1, XSDTypeDefinition t2)
+ {
+ XSDConcreteComponent n1 = t1, n2 = t2;
+ while (n1 != null && n2 != null)
+ {
+ if (n1.eClass() != n2.eClass()) break;
+ if (n1 instanceof XSDNamedComponent /*&& n2 instanceof XSDNamedComponent*/)
+ {
+ String s1 = ((XSDNamedComponent)n1).getName();
+ String s2 = ((XSDNamedComponent)n2).getName();
+ if (s1 == null ? s1 != s2 : !s1.equals(s2)) break;
+ }
+ n1 = n1.getContainer();
+ n2 = n2.getContainer();
+ }
+ return n1 == null && n2 == null;
+ }
+
+ protected void removeDuplicateEClassifier(EClassifier eClassifier, XSDTypeDefinition xsdTypeDefinition)
+ {
+ EPackage ePackage = eClassifier.getEPackage();
+ List eClassifiers = ePackage.getEClassifiers();
+ String name = eClassifier.getName();
+ int size = eClassifiers.size();
+ for (int index = eClassifiers.indexOf(eClassifier); ++index < size; )
+ {
+ EClassifier nextEClassifier = (EClassifier)eClassifiers.get(index);
+ if (!name.equals(nextEClassifier.getName())) break;
+ if (extendedMetaData.getName(eClassifier).equals(extendedMetaData.getName(nextEClassifier)))
+ {
+ XSDTypeDefinition nextXSDTypeDefinition = getXSDTypeDefinition(nextEClassifier);
+ if (!sameType(nextXSDTypeDefinition, xsdTypeDefinition))
+ {
+ //System.out.println("###EClassifier mismatch: ");
+ //System.out.println(" old: " + extendedMetaData.getName(nextEClassifier));
+ //System.out.println(" new: " + extendedMetaData.getName(eClassifier));
+ continue;
+ }
+ eClassifiers.remove(index);
+ updateReferences(nextEClassifier, eClassifier);
+ break;
+ }
+ }
+ }
+
+ protected void removeDuplicateDocumentRootFeature(EClass eClass, EStructuralFeature eStructuralFeature)
+ {
+ List eStructuralFeatures = eClass.getEStructuralFeatures();
+ int last = eStructuralFeatures.size() - 1;
+ String name = extendedMetaData.getName(eStructuralFeature);
+ for (int index = 0; index < last; index++)
+ {
+ EStructuralFeature otherEStructuralFeature = (EStructuralFeature)eStructuralFeatures.get(index);
+ if (name.equals(extendedMetaData.getName(otherEStructuralFeature)))
+ {
+ if (otherEStructuralFeature.eClass() != eStructuralFeature.eClass())
+ {
+ //System.out.println("###EStructuralFeature mismatch: ");
+ //System.out.println(" old: " + extendedMetaData.getName(otherEStructuralFeature));
+ //System.out.println(" new: " + extendedMetaData.getName(eStructuralFeature));
+ continue;
+ }
+ eStructuralFeatures.remove(index);
+ updateReferences(otherEStructuralFeature, eStructuralFeature);
+ break;
+ }
+ }
+ }
+
+ public EClass computeEClass(XSDComplexTypeDefinition xsdComplexTypeDefinition) {
+ if (xsdComplexTypeDefinition == null) return super.computeEClass(xsdComplexTypeDefinition);
+ EPackage ePackage = (EPackage)targetNamespaceToEPackageMap.get(xsdComplexTypeDefinition.getTargetNamespace());
+ if (ePackage != null && TypeHelperImpl.getBuiltInModels().contains(ePackage)) {
+ EClassifier eclassifier = ePackage.getEClassifier(xsdComplexTypeDefinition.getName());
+ if (eclassifier != null) return (EClass)eclassifier;
+ }
+ EClass eClass = super.computeEClass(xsdComplexTypeDefinition);
+ if (replaceConflictingTypes) removeDuplicateEClassifier(eClass, xsdComplexTypeDefinition);
+ String aliasNames = getEcoreAttribute(xsdComplexTypeDefinition.getElement(), "aliasName");
+ if (aliasNames != null) {
+ SDOExtendedMetaData.INSTANCE.setAliasNames(eClass, aliasNames);
+ }
+ return eClass;
+ }
+
+ protected EClassifier computeEClassifier(XSDTypeDefinition xsdTypeDefinition) {
+ if (xsdTypeDefinition == null) return super.computeEClassifier(xsdTypeDefinition);
+ EPackage ePackage = (EPackage)targetNamespaceToEPackageMap.get(xsdTypeDefinition.getTargetNamespace());
+ if (ePackage != null && TypeHelperImpl.getBuiltInModels().contains(ePackage)) {
+ EClassifier eclassifier = ePackage.getEClassifier(xsdTypeDefinition.getName());
+ if (eclassifier != null) return eclassifier;
+ }
+ EClassifier eclassifier = super.computeEClassifier(xsdTypeDefinition);
+ EClassifier etype = (EClassifier) typeToTypeObjectMap.get(eclassifier);
+ String aliasNames = getEcoreAttribute(xsdTypeDefinition.getElement(), "aliasName");
+ if (aliasNames != null) {
+ SDOExtendedMetaData.INSTANCE.setAliasNames(eclassifier, aliasNames);
+ if (etype != null) {
+ SDOExtendedMetaData.INSTANCE.setAliasNames(etype, aliasNames);
+ }
+ }
+ return eclassifier;
+ }
+
+ protected EDataType computeEDataType(XSDSimpleTypeDefinition xsdSimpleTypeDefinition) {
+ if (xsdSimpleTypeDefinition == null) return super.computeEDataType(xsdSimpleTypeDefinition);
+ EPackage ePackage = (EPackage)targetNamespaceToEPackageMap.get(xsdSimpleTypeDefinition.getTargetNamespace());
+ if (ePackage != null && TypeHelperImpl.getBuiltInModels().contains(ePackage)) {
+ EClassifier eclassifier = ePackage.getEClassifier(xsdSimpleTypeDefinition.getName());
+ if (eclassifier != null) return (EDataType)eclassifier;
+ }
+ EDataType eDataType = super.computeEDataType(xsdSimpleTypeDefinition);
+ if (replaceConflictingTypes) removeDuplicateEClassifier(eDataType, xsdSimpleTypeDefinition);
+ String aliasNames = getEcoreAttribute(xsdSimpleTypeDefinition.getElement(), "aliasName");
+ if (aliasNames != null) {
+ SDOExtendedMetaData.INSTANCE.setAliasNames(eDataType, aliasNames);
+ }
+ return eDataType;
+ }
+
+ protected EEnum computeEEnum(XSDSimpleTypeDefinition xsdSimpleTypeDefinition) {
+ return null;
+ }
+
+ protected EStructuralFeature createFeature(EClass eClass, String name, EClassifier type, XSDComponent xsdComponent, int minOccurs, int maxOccurs) {
+ EStructuralFeature feature = super.createFeature(eClass, name, type, xsdComponent, minOccurs, maxOccurs);
+
+ //FB What is the following for?
+ if (feature instanceof EReference)
+ {
+ EReference eReference = (EReference)feature;
+ if (xsdComponent != null && xsdComponent instanceof XSDParticle)
+ {
+ XSDTerm xsdTerm = ((XSDParticle)xsdComponent).getTerm();
+ if (xsdTerm instanceof XSDElementDeclaration)
+ {
+ XSDTypeDefinition elementTypeDefinition = getEffectiveTypeDefinition(xsdComponent, (XSDElementDeclaration)xsdTerm);
+ EClassifier eClassifier = getEClassifier(elementTypeDefinition);
+ if (elementTypeDefinition instanceof XSDSimpleTypeDefinition && eClassifier instanceof EClass)
+ {
+ eReference.setContainment(true);
+ }
+ }
+ }
+ }
+
+ feature.setName(name); // this is needed because super.createFeature() does EMF name mangling (toLower)
+
+ if (replaceConflictingTypes && "".equals(extendedMetaData.getName(eClass)))
+ removeDuplicateDocumentRootFeature(eClass, feature);
+
+ if (xsdComponent != null)
+ {
+ String aliasNames = getEcoreAttribute(xsdComponent.getElement(), "aliasName");
+ if (aliasNames != null)
+ {
+ SDOExtendedMetaData.INSTANCE.setAliasNames(feature, aliasNames);
+ }
+ }
+ return feature;
+ }
+
+ protected String getInstanceClassName(XSDTypeDefinition typeDefinition, EDataType baseEDataType) {
+ String name = getEcoreAttribute(typeDefinition, "extendedInstanceClass");
+ return (name != null) ? name : super.getInstanceClassName(typeDefinition, baseEDataType);
+ }
+
+ protected String getEcoreAttribute(Element element, String attribute)
+ {
+ String sdoAttribute = null;
+
+ if ("name".equals(attribute))
+ sdoAttribute = "name";
+ else if ("opposite".equals(attribute))
+ sdoAttribute = "oppositeProperty";
+ else if ("mixed".equals(attribute))
+ sdoAttribute = "sequence";
+ else if ("string".equals(attribute))
+ sdoAttribute = "string";
+ else if ("changeable".equals(attribute))
+ sdoAttribute = "readOnly";
+ else if ("aliasName".equals(attribute))
+ sdoAttribute = "aliasName";
+
+ if (sdoAttribute != null)
+ {
+ String value =
+ element != null && element.hasAttributeNS("commonj.sdo/xml", sdoAttribute) ?
+ element.getAttributeNS("commonj.sdo/xml", sdoAttribute) :
+ null;
+ if ("changeable".equals(attribute)) {
+ if ("true".equals(value)) value = "false";
+ else if ("false".equals(value)) value = "true";
+ }
+ return value;
+ }
+
+ if ("package".equals(attribute))
+ sdoAttribute = "package";
+ else if ("instanceClass".equals(attribute))
+ sdoAttribute = "instanceClass";
+ else if ("extendedInstanceClass".equals(attribute))
+ sdoAttribute = "extendedInstanceClass";
+ else if ("nestedInterfaces".equals(attribute))
+ sdoAttribute = "nestedInterfaces";
+
+ if (sdoAttribute != null)
+ {
+ return
+ element != null && element.hasAttributeNS("commonj.sdo/java", sdoAttribute) ?
+ element.getAttributeNS("commonj.sdo/java", sdoAttribute) :
+ null;
+ }
+
+ return super.getEcoreAttribute(element, attribute);
+ }
+
+ /*
+ protected String getEcoreAttribute(XSDConcreteComponent xsdConcreteComponent, String attribute)
+ {
+ String value = super.getEcoreAttribute(xsdConcreteComponent, attribute);
+ if ("package".equals(attribute) && value == null)
+ {
+ XSDSchema xsdSchema = (XSDSchema)xsdConcreteComponent;
+ value = getDefaultPackageName(xsdSchema.getTargetNamespace());
+ }
+ return value;
+ }
+ */
+
+ protected XSDTypeDefinition getEcoreTypeQNameAttribute(XSDConcreteComponent xsdConcreteComponent, String attribute)
+ {
+ if (xsdConcreteComponent == null) return null;
+ String sdoAttribute = null;
+
+ if ("reference".equals(attribute)) sdoAttribute = "propertyType";
+ if ("dataType".equals(attribute)) sdoAttribute = "dataType";
+
+ if (sdoAttribute != null)
+ {
+ Element element = xsdConcreteComponent.getElement();
+ return element == null ? null : getEcoreTypeQNameAttribute(xsdConcreteComponent, element, "commonj.sdo/xml", sdoAttribute);
+ }
+
+ return super.getEcoreTypeQNameAttribute(xsdConcreteComponent, attribute);
+ }
+
+ /**
+ * Override default EMF behavior so that the name is not mangled.
+ */
+ protected String validName(String name, int casing, String prefix) {
+ return name;
+ }
+
+ /**
+ * Override default EMF name mangling for anonymous types (simple and complex)
+ */
+ protected String validAliasName(XSDTypeDefinition xsdTypeDefinition, boolean isUpperCase) {
+ return getAliasName(xsdTypeDefinition);
+ }
+
+ protected String getAliasName(XSDNamedComponent xsdNamedComponent) {
+ String result = xsdNamedComponent.getName();
+ if (result == null)
+ {
+ XSDConcreteComponent container = xsdNamedComponent.getContainer();
+ if (container instanceof XSDNamedComponent)
+ {
+ result = getAliasName((XSDNamedComponent)container);
+ }
+ }
+ return result;
+ }
+
+ protected XSDTypeDefinition getEffectiveTypeDefinition(XSDComponent xsdComponent, XSDFeature xsdFeature) {
+ XSDTypeDefinition typeDef = getEcoreTypeQNameAttribute(xsdComponent, "dataType");
+
+ String isString = getEcoreAttribute(xsdComponent, xsdFeature, "string");
+ if ("true".equalsIgnoreCase(isString)) {
+ typeDef =
+ xsdFeature.resolveSimpleTypeDefinition(rootSchema.getSchemaForSchemaNamespace(), "string");
+ }
+ if (typeDef == null)
+ typeDef = xsdFeature.getType();
+ return typeDef;
+ }
+
+ /**
+ * Override EMF algorithm.
+ */
+ public String qualifiedPackageName(String namespace)
+ {
+ return getDefaultPackageName(namespace);
+ }
+
+ //Code below here to provide common URI to java packagname
+
+ public static String uncapNameStatic(String name)
+ {
+ if (name.length() == 0)
+ {
+ return name;
+ }
+ else
+ {
+ String lowerName = name.toLowerCase();
+ int i;
+ for (i = 0; i < name.length(); i++)
+ {
+ if (name.charAt(i) == lowerName.charAt(i))
+ {
+ break;
+ }
+ }
+ if (i > 1 && i < name.length() && !Character.isDigit(name.charAt(i)))
+ {
+ --i;
+ }
+ return name.substring(0, i).toLowerCase() + name.substring(i);
+ }
+ }
+
+ protected static String validNameStatic(String name, int casing, String prefix)
+ {
+ List parsedName = parseNameStatic(name, '_');
+ StringBuffer result = new StringBuffer();
+ for (Iterator i = parsedName.iterator(); i.hasNext(); )
+ {
+ String nameComponent = (String)i.next();
+ if (nameComponent.length() > 0)
+ {
+ if (result.length() > 0 || casing == UPPER_CASE)
+ {
+ result.append(Character.toUpperCase(nameComponent.charAt(0)));
+ result.append(nameComponent.substring(1));
+ }
+ else
+ {
+ result.append(nameComponent);
+ }
+ }
+ }
+
+ return
+ result.length() == 0 ?
+ prefix :
+ Character.isJavaIdentifierStart(result.charAt(0)) ?
+ casing == LOWER_CASE ?
+ uncapNameStatic(result.toString()) :
+ result.toString() :
+ prefix + result;
+ }
+
+ protected static List parseNameStatic(String sourceName, char separator)
+ {
+ List result = new ArrayList();
+ if (sourceName != null)
+ {
+ StringBuffer currentWord = new StringBuffer();
+ boolean lastIsLower = false;
+ for (int index = 0, length = sourceName.length(); index < length; ++index)
+ {
+ char curChar = sourceName.charAt(index);
+ if (!Character.isJavaIdentifierPart(curChar))
+ {
+ curChar = separator;
+ }
+ if (Character.isUpperCase(curChar) || (!lastIsLower && Character.isDigit(curChar)) || curChar == separator)
+ {
+ if (lastIsLower && currentWord.length() > 1 || curChar == separator && currentWord.length() > 0)
+ {
+ result.add(currentWord.toString());
+ currentWord = new StringBuffer();
+ }
+ lastIsLower = false;
+ }
+ else
+ {
+ if (!lastIsLower)
+ {
+ int currentWordLength = currentWord.length();
+ if (currentWordLength > 1)
+ {
+ char lastChar = currentWord.charAt(--currentWordLength);
+ currentWord.setLength(currentWordLength);
+ result.add(currentWord.toString());
+ currentWord = new StringBuffer();
+ currentWord.append(lastChar);
+ }
+ }
+ lastIsLower = true;
+ }
+
+ if (curChar != separator)
+ {
+ currentWord.append(curChar);
+ }
+ }
+
+ result.add(currentWord.toString());
+ }
+ return result;
+ }
+
+ public static String getDefaultPackageName(String targetNamespace)
+ {
+ if (targetNamespace == null)
+ return null;
+
+ URI uri = URI.createURI(targetNamespace);
+ List parsedName;
+ if (uri.isHierarchical())
+ {
+ String host = uri.host();
+ if (host != null && host.startsWith("www."))
+ {
+ host = host.substring(4);
+ }
+ parsedName = parseNameStatic(host, '.');
+ Collections.reverse(parsedName);
+ if (!parsedName.isEmpty())
+ {
+ parsedName.set(0, ((String)parsedName.get(0)).toLowerCase());
+ }
+
+ parsedName.addAll(parseNameStatic(uri.trimFileExtension().path(), '/'));
+ }
+ else
+ {
+ String opaquePart = uri.opaquePart();
+ int index = opaquePart.indexOf(":");
+ if (index != -1 && "urn".equalsIgnoreCase(uri.scheme()))
+ {
+ parsedName = parseNameStatic(opaquePart.substring(0, index), '-');
+ if (parsedName.size() > 0 && DOMAINS.contains(parsedName.get(parsedName.size() - 1)))
+ {
+ Collections.reverse(parsedName);
+ parsedName.set(0, ((String)parsedName.get(0)).toLowerCase());
+ }
+ parsedName.addAll(parseNameStatic(opaquePart.substring(index + 1), '/'));
+ }
+ else
+ {
+ parsedName = parseNameStatic(opaquePart, '/');
+ }
+ }
+
+ StringBuffer qualifiedPackageName = new StringBuffer();
+ for (Iterator i = parsedName.iterator(); i.hasNext(); )
+ {
+ String packageName = (String)i.next();
+ if (packageName.length() > 0)
+ {
+ if (qualifiedPackageName.length() > 0)
+ {
+ qualifiedPackageName.append('.');
+ }
+ qualifiedPackageName.append(validNameStatic(packageName, LOWER_CASE,"_"));
+ }
+ }
+
+ return qualifiedPackageName.toString().toLowerCase(); //make sure it's lower case .. we can't work with Axis if not.
+ }
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/SchemaBuilder.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/SchemaBuilder.java
new file mode 100644
index 0000000000..8ff7769041
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/SchemaBuilder.java
@@ -0,0 +1,786 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.helper;
+
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Vector;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sdo.util.SDOUtil;
+import org.eclipse.xsd.XSDAttributeDeclaration;
+import org.eclipse.xsd.XSDAttributeUse;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDCompositor;
+import org.eclipse.xsd.XSDConstraint;
+import org.eclipse.xsd.XSDDerivationMethod;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDFactory;
+import org.eclipse.xsd.XSDForm;
+import org.eclipse.xsd.XSDImport;
+import org.eclipse.xsd.XSDInclude;
+import org.eclipse.xsd.XSDModelGroup;
+import org.eclipse.xsd.XSDParticle;
+import org.eclipse.xsd.XSDProcessContents;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDSchemaContent;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+import org.eclipse.xsd.XSDTypeDefinition;
+import org.eclipse.xsd.XSDWildcard;
+
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+import commonj.sdo.helper.XSDHelper;
+
+public class SchemaBuilder extends SDOAnnotations
+{
+ public static final String DEFAULT_SCHEMA_LOCATION = "";
+ public static final String NAME_SPACE_PREFIX = "stn_";
+ private static int prefixCount = 1;
+
+ //public static final String MIXED = "mixed";
+ //public static final String GROUP = "group";
+ public static final String EFEATURE_MAP_ENTRY = "EFeatureMapEntry";
+
+ private Map schemaMap = null;
+ protected Map targetNamespacePrefixMap = new Hashtable();
+ protected Map schemaLocationMap = null;
+ protected TypeTable typeTable = null;
+ protected XSDFactory xsdFactory = XSDFactory.eINSTANCE;
+
+
+ protected SchemaBuilder(Map schemaMap,
+ Map nsPrefixMap,
+ TypeTable typeTable,
+ Map schemaLocMap )
+ {
+ this.schemaMap = schemaMap;
+ this.targetNamespacePrefixMap = nsPrefixMap;
+ this.typeTable = typeTable;
+ this.schemaLocationMap = schemaLocMap;
+ }
+
+
+
+
+ private QName addAttribute2ComplexType(String targetNamespace,
+ XSDComplexTypeDefinition complexType,
+ Property aProperty)
+ {
+ QName attributeSchemaType = null;
+ String prefix = null;
+
+ try
+ {
+ attributeSchemaType = buildSchema(aProperty.getType());
+ }
+ catch ( IllegalArgumentException e )
+ {
+ //schema cannot be generated for this type as there exists an xsd already
+ //so include that original XSD
+ attributeSchemaType = new QName(aProperty.getType().getURI(),
+ aProperty.getType().getName(),
+ generatePrefix());
+ if ( aProperty.getType().isDataType() )
+ {
+ typeTable.addSimpleSchemaType(aProperty.getType().getName(), attributeSchemaType);
+
+ XSDSimpleTypeDefinition simpleType = xsdFactory.createXSDSimpleTypeDefinition();
+ simpleType.setName(aProperty.getType().getName());
+ simpleType.setTargetNamespace(aProperty.getType().getURI());
+ typeTable.addXSDTypeDef(attributeSchemaType.getNamespaceURI(),
+ attributeSchemaType.getLocalPart(),
+ simpleType);
+ }
+ else
+ {
+ typeTable.addComplexSchemaType(aProperty.getType().getURI(),
+ aProperty.getType().getName(),
+ attributeSchemaType);
+
+ XSDComplexTypeDefinition extComplexType = xsdFactory.createXSDComplexTypeDefinition();
+ extComplexType.setName(aProperty.getType().getName());
+ extComplexType.setTargetNamespace(aProperty.getType().getURI());
+ typeTable.addXSDTypeDef(attributeSchemaType.getNamespaceURI(),
+ attributeSchemaType.getLocalPart(),
+ extComplexType);
+ }
+ includeExtXSD(aProperty.getType());
+ }
+ //ensure than an import is done rightaway so that the right prefixes will be used by the
+ //attribute whose type is set as 'this type'. Otherwise when setting the type for the attribute
+ //there will be a duplicate prefix (like Q1 or Q2... ) that will be created
+ prefix = addImports((XSDSchema)schemaMap.get(targetNamespace), attributeSchemaType);
+
+ XSDAttributeDeclaration attribute = xsdFactory.createXSDAttributeDeclaration();
+ attribute.setName(aProperty.getName());
+ XSDAttributeUse orderDateAttributeUse = xsdFactory.createXSDAttributeUse();
+ orderDateAttributeUse.setContent(attribute);
+ complexType.getAttributeContents().add(orderDateAttributeUse);
+ attribute.updateElement();
+
+ if ( aProperty.getType().isDataType() )
+ {
+ attribute.setTypeDefinition((XSDSimpleTypeDefinition)typeTable.getXSDTypeDef(attributeSchemaType.getNamespaceURI(),
+ attributeSchemaType.getLocalPart()));
+
+ }
+ else
+ {
+ attribute.setTypeDefinition((XSDSimpleTypeDefinition)typeTable.getXSDTypeDef(
+ typeTable.getSimpleSchemaTypeName("URI").getNamespaceURI(),
+ typeTable.getSimpleSchemaTypeName("URI").getLocalPart()));
+
+ }
+
+ if ( aProperty.getDefault() != null )
+ {
+ attribute.setConstraint(XSDConstraint.DEFAULT_LITERAL);
+ attribute.setLexicalValue(aProperty.getDefault().toString());
+ }
+
+ addAnnotations(attribute, aProperty );
+ if ( !aProperty.getType().isDataType() )
+ {
+ String value = prefix + COLON + attributeSchemaType.getLocalPart();
+ attribute.getElement().setAttribute(PROPERTY_TYPE, value);
+ }
+
+ return attributeSchemaType;
+ }
+
+ private QName addElement2ComplexType(String targetNamespace,
+ XSDComplexTypeDefinition complexType,
+ Property aProperty)
+ {
+ String prefix = null;
+ QName elementSchemaType = null;
+ try
+ {
+ elementSchemaType = buildSchema(aProperty.getType());
+ }
+ catch ( IllegalArgumentException e )
+ {
+ //schema cannot be generated for this type as there exists an xsd already
+ //so include that original XSD
+ elementSchemaType = new QName(aProperty.getType().getURI(),
+ aProperty.getType().getName(),
+ generatePrefix());
+ if ( aProperty.getType().isDataType() )
+ {
+ typeTable.addSimpleSchemaType(aProperty.getType().getName(), elementSchemaType);
+
+ XSDSimpleTypeDefinition simpleType = xsdFactory.createXSDSimpleTypeDefinition();
+ simpleType.setName(aProperty.getType().getName());
+ simpleType.setTargetNamespace(aProperty.getType().getURI());
+ typeTable.addXSDTypeDef(elementSchemaType.getNamespaceURI(),
+ elementSchemaType.getLocalPart(),
+ simpleType);
+ }
+ else
+ {
+ typeTable.addComplexSchemaType(aProperty.getType().getURI(),
+ aProperty.getType().getName(),
+ elementSchemaType);
+ XSDComplexTypeDefinition extComplexType = xsdFactory.createXSDComplexTypeDefinition();
+ extComplexType.setName(aProperty.getType().getName());
+ extComplexType.setTargetNamespace(aProperty.getType().getURI());
+ typeTable.addXSDTypeDef(elementSchemaType.getNamespaceURI(),
+ elementSchemaType.getLocalPart(),
+ extComplexType);
+ }
+ includeExtXSD(aProperty.getType());
+ }
+
+ //ensure than an import is done rightaway so that the right prefixes will be used by the
+ //element whose type is set as 'this type'. Otherwise when setting the type for the element
+ //there will be a duplicate prefix (like Q1 or Q2... ) that will be created
+ prefix = addImports((XSDSchema)schemaMap.get(targetNamespace), elementSchemaType);
+
+ //XmlSchemaElement element = new XmlSchemaElement();
+ XSDElementDeclaration element = xsdFactory.createXSDElementDeclaration();
+ element.setName(aProperty.getName());
+
+ XSDParticle aParticle = xsdFactory.createXSDParticle();
+ aParticle.setContent(element);
+
+ ((XSDModelGroup)((XSDParticle)complexType.getContent()).getContent()).
+ getContents().add(aParticle);
+
+ element.updateElement();
+
+ if ( aProperty.isMany() )
+ {
+ aParticle.setMaxOccurs(-1);
+ aParticle.setMinOccurs(0);
+
+ }
+
+ if ( aProperty.isContainment() )
+ {
+ element.setTypeDefinition(typeTable.getXSDTypeDef(elementSchemaType.getNamespaceURI(),
+ elementSchemaType.getLocalPart()));
+ }
+ else
+ {
+ if ( !aProperty.getType().isDataType() )
+ {
+ QName qName = typeTable.getSimpleSchemaTypeName("URI");
+ element.setTypeDefinition(typeTable.getXSDTypeDef(qName.getNamespaceURI(),
+ qName.getLocalPart()));
+ }
+ }
+
+ addAnnotations(element, aProperty);
+ if ( !aProperty.isContainment() && !aProperty.getType().isDataType() )
+ {
+ String value = prefix + COLON + elementSchemaType.getLocalPart();
+ element.getElement().setAttribute(PROPERTY_TYPE, value);
+ }
+ return elementSchemaType;
+
+ }
+
+ private void addAnnotations(XSDSchemaContent xsdContent, Property aProperty)
+ {
+ if ( !aProperty.getAliasNames().isEmpty() )
+ {
+ addAliasNamesAnnotation(xsdContent, aProperty.getAliasNames());
+ }
+
+ if ( aProperty.isReadOnly() )
+ {
+ xsdContent.getElement().setAttribute(READ_ONLY, Boolean.toString(aProperty.isReadOnly()));
+ }
+
+ if ( aProperty.getOpposite() != null )
+ {
+ xsdContent.getElement().setAttribute(OPPOSITE_PROPERTY, aProperty.getOpposite().getName());
+ }
+ }
+
+
+ private QName buildComplexSchemaTypeContents(String targetNamespace,
+ XSDComplexTypeDefinition complexType,
+ Type dataType)
+ {
+ //clipProperties(dataType);
+ List properties = dataType.getDeclaredProperties();
+ Iterator iterator = properties.iterator();
+ Property aProperty;
+ QName propertySchemaTypeName = null;
+
+ while ( iterator.hasNext() )
+ {
+ aProperty = (Property)iterator.next();
+ if ( aProperty.isContainment() || aProperty.isMany() || !aProperty.getType().isDataType() )
+ {
+ propertySchemaTypeName = addElement2ComplexType(targetNamespace, complexType, aProperty);
+ }
+ else
+ {
+ propertySchemaTypeName = addAttribute2ComplexType(targetNamespace, complexType, aProperty);
+ }
+
+ /*if ( !EFEATURE_MAP_ENTRY.equals(aProperty.getType().getName()) )
+ {
+ addContents2ComplexType(targetNamespace, complexType, aProperty);
+ }*/
+ }
+
+ return propertySchemaTypeName;
+
+ }
+
+ public QName buildComplexSchemaType(Type dataType)
+ {
+ //this is called from buildSchema only if isXSD(dataType) is false
+ QName complexSchemaTypeName = null ;
+ if ( !dataType.isDataType() &&
+ (complexSchemaTypeName = typeTable.getComplexSchemaTypeName(dataType.getURI(), dataType.getName())) == null )
+ {
+ XSDSchema xmlSchema = getXmlSchema(dataType);
+ String targetNamespace = dataType.getURI();
+ String targetNamespacePrefix = (String)targetNamespacePrefixMap.get(targetNamespace);
+
+ complexSchemaTypeName = new QName(targetNamespace,
+ dataType.getName(),
+ targetNamespacePrefix);
+
+ XSDComplexTypeDefinition complexType = xsdFactory.createXSDComplexTypeDefinition();
+ complexType.setName(dataType.getName());
+ complexType.setTargetNamespace(targetNamespace);
+ complexType.setAbstract(dataType.isAbstract());
+
+ xmlSchema.getTypeDefinitions().add(complexType);
+ xmlSchema.getContents().add(complexType);
+
+ complexType.updateElement();
+
+ addAnnotations(complexType, dataType);
+
+ handleBaseExtn(xmlSchema, dataType, complexType);
+ handleSDOSequence(dataType, complexType);
+ handleSDOOpenType(dataType, complexType);
+
+ //add before constructing the contents because a content element could
+ //possibly be of type 'complexType'.
+ typeTable.addComplexSchemaType(dataType.getURI(), dataType.getName(), complexSchemaTypeName);
+ typeTable.addXSDTypeDef(dataType.getURI(), dataType.getName(), complexType);
+
+ //now compose the contents for this complex type
+ buildComplexSchemaTypeContents(targetNamespace, complexType, dataType);
+
+ //finally create a global element for this type
+ createGlobalElement(xmlSchema, complexType, complexSchemaTypeName);
+ }
+
+ return complexSchemaTypeName;
+ }
+
+ private void addAnnotations(XSDTypeDefinition xsdType, Type dataType)
+ {
+ if ( dataType.isAbstract() )
+ {
+ if ( xsdType instanceof XSDComplexTypeDefinition )
+ {
+ ((XSDComplexTypeDefinition)xsdType).setAbstract(dataType.isAbstract());
+ }
+ else
+ {
+ xsdType.getElement().setAttribute(ABSTRACT_TYPE,
+ Boolean.toString(dataType.isAbstract()));
+ }
+ }
+
+ //add alias names if it exists
+ addAliasNamesAnnotation(xsdType,
+ dataType.getAliasNames());
+
+ //add instanceClass annotation
+ if ( dataType.getInstanceClass() != null )
+ {
+ xsdType.getElement().setAttribute(INSTANCE_CLASS, dataType.getInstanceClass().getName());
+ }
+ }
+
+
+ private QName buildSimpleSchemaType(Type dataType)
+ {
+ QName simpleSchemaTypeName = null;
+ if ( dataType.isDataType() &&
+ (simpleSchemaTypeName = typeTable.getSimpleSchemaTypeName(dataType.getName()) ) == null )
+ {
+ XSDSchema xmlSchema = getXmlSchema(dataType);
+ XSDSimpleTypeDefinition simpleType = xsdFactory.createXSDSimpleTypeDefinition();
+ //set the name
+ simpleType.setName(dataType.getName());
+ simpleType.setTargetNamespace(dataType.getURI());
+ //set abstract=true if abstract
+ simpleSchemaTypeName = new QName(dataType.getURI(),
+ dataType.getName(),
+ (String)targetNamespacePrefixMap.get(dataType.getURI()));
+ xmlSchema.getContents().add(simpleType);
+ simpleType.updateElement();
+
+ addAnnotations(simpleType, dataType);
+
+ if ( !dataType.getBaseTypes().isEmpty() )
+ {
+ Type baseType = (Type)dataType.getBaseTypes().get(0);
+
+ QName baseSchemaType = null;
+
+ try
+ {
+ baseSchemaType = buildSchema(baseType);
+ }
+ catch ( IllegalArgumentException e )
+ {
+ //this means that the base type comes from a original xsd and hence not generated
+ baseSchemaType = new QName(baseType.getURI(),
+ baseType.getName(),
+ generatePrefix());
+
+ typeTable.addSimpleSchemaType(baseType.getName(), baseSchemaType);
+
+ XSDSimpleTypeDefinition baseTypeDef = xsdFactory.createXSDSimpleTypeDefinition();
+ baseTypeDef.setName(baseType.getName());
+ baseTypeDef.setTargetNamespace(baseType.getURI());
+ typeTable.addXSDTypeDef(baseType.getURI(), baseType.getName(), baseTypeDef);
+
+ //include external XSD locations
+ includeExtXSD(baseType);
+ }
+
+ simpleType.setBaseTypeDefinition((XSDSimpleTypeDefinition)typeTable.
+ getXSDTypeDef(baseSchemaType.getNamespaceURI(),baseSchemaType.getLocalPart()));
+ addImports(xmlSchema, baseSchemaType);
+ }
+
+
+ typeTable.addSimpleSchemaType(dataType.getName(), simpleSchemaTypeName);
+ typeTable.addXSDTypeDef(dataType.getURI(), dataType.getName(), simpleType);
+ }
+ return simpleSchemaTypeName;
+ }
+
+ private void includeExtXSD(Type dataType)
+ {
+ //now we know there is a type for which the xsd must come from outside
+ //create a schema for the namespace of this type and add an include in it for
+ //the xsd that is defined externally
+ XSDSchema xmlSchema = getXmlSchema(dataType);
+
+ //ideally there could be more than one external schema defintions for a namespace
+ //and hence schemalocations will be a list of locations
+ //List schemaLocations = (List)schemaLocationMap.get(dataType.getURI());
+
+ //since as per the specs the input to XSDHelper is a map of <String, String> allowing
+ //only one schemalocation for a namespace. So for now this single location will be
+ //picked up and put into a list
+ List schemaLocations = new Vector();
+ if ( schemaLocationMap.get(dataType.getURI()) != null )
+ {
+ schemaLocations.add(schemaLocationMap.get(dataType.getURI()));
+ }
+
+ if ( schemaLocations.size() <= 0 )
+ {
+ schemaLocations.add(DEFAULT_SCHEMA_LOCATION);
+ }
+
+ Object schemaContent = null;
+ Iterator includesIterator = xmlSchema.getContents().iterator();
+ Iterator schemaLocIterator = schemaLocations.iterator();
+ String aSchemaLocation = null;
+ boolean includeExists = false;
+ //include all external schema locations
+ while ( schemaLocIterator.hasNext() )
+ {
+ aSchemaLocation = (String)schemaLocIterator.next();
+ while ( includesIterator.hasNext() )
+ {
+ schemaContent = includesIterator.next();
+ if ( schemaContent instanceof XSDInclude )
+ {
+ if ( !includeExists && aSchemaLocation.equals(
+ ((XSDInclude)schemaContent).getSchemaLocation()
+ ))
+ {
+ includeExists = true;
+ }
+ }
+ }
+
+ if ( !includeExists )
+ {
+ XSDInclude includeElement = xsdFactory.createXSDInclude();
+ includeElement.setSchemaLocation(aSchemaLocation);
+ xmlSchema.getContents().add(0, includeElement);
+ }
+ }
+ }
+
+ protected QName buildSchema(Type dataType) throws IllegalArgumentException
+ {
+ QName schemaTypeName = null;
+
+ if ( dataType.isDataType() )
+ {
+ schemaTypeName = typeTable.getSimpleSchemaTypeName(dataType.getName());
+ }
+ else
+ {
+ schemaTypeName = typeTable.getComplexSchemaTypeName(dataType.getURI(), dataType.getName());
+ }
+
+ //attempt to generate only if we have not done it already..i.e the type is
+ //not found in the typetable
+ if ( schemaTypeName == null )
+ {
+ XSDHelper xsdHelper = SDOUtil.createHelperContext().getXSDHelper();
+
+ if ( !xsdHelper.isXSD( dataType ) )
+ {
+ if ( dataType.isDataType() )
+ {
+ schemaTypeName = buildSimpleSchemaType(dataType);
+ }
+ else
+ {
+ schemaTypeName = buildComplexSchemaType(dataType);
+ }
+ }
+ else
+ {
+ throw new IllegalArgumentException("Cannot generate XSD since SDO Type '" +
+ dataType.getName() + "' was orginally generated from XSD. Use original XSD");
+ }
+ }
+ return schemaTypeName;
+ }
+
+
+ private XSDSchema getXmlSchema(Type dataType)
+ {
+ XSDSchema xmlSchema = null;
+
+ if ((xmlSchema = (XSDSchema) schemaMap.get(dataType.getURI())) == null)
+ {
+ String targetNamespacePrefix = generatePrefix();
+
+ xmlSchema = xsdFactory.createXSDSchema();
+ xmlSchema.setTargetNamespace(dataType.getURI());
+ xmlSchema.setAttributeFormDefault(XSDForm.QUALIFIED_LITERAL);
+ xmlSchema.setElementFormDefault(XSDForm.QUALIFIED_LITERAL);
+
+ targetNamespacePrefixMap.put(dataType.getURI(), targetNamespacePrefix);
+ schemaMap.put(dataType.getURI(), xmlSchema);
+
+ xmlSchema.getQNamePrefixToNamespaceMap().put(TypeTable.XS_URI_PREFIX, TypeTable.XML_SCHEMA_URI);
+ xmlSchema.setSchemaForSchemaQNamePrefix(TypeTable.XS_URI_PREFIX);
+
+ xmlSchema.getQNamePrefixToNamespaceMap().put(targetNamespacePrefix, dataType.getURI());
+ //xmlSchema.setSchemaForSchemaQNamePrefix(targetNamespacePrefix);
+
+ addSDONamespaces(xmlSchema);
+ addPackageAnnotation(xmlSchema, dataType);
+ }
+ return xmlSchema;
+ }
+
+
+ private void addSDONamespaces(XSDSchema xmlSchema)
+ {
+ xmlSchema.getQNamePrefixToNamespaceMap().put(COMMONJ_SDO_NS_PREFIX, COMMONJ_SDO_NS);
+ //xmlSchema.setSchemaForSchemaQNamePrefix(COMMONJ_SDO_NS_PREFIX);
+
+ xmlSchema.getQNamePrefixToNamespaceMap().put(SDO_JAVA_NS_PREFIX, SDO_JAVA_NS);
+ //xmlSchema.setSchemaForSchemaQNamePrefix(SDO_JAVA_NS_PREFIX);
+ }
+
+
+ /**
+ * JAM convert first name of an attribute into UpperCase as an example if
+ * there is a instance variable called foo in a bean , then Jam give that as
+ * Foo so this method is to correct that error
+ *
+ * @param wrongName
+ * @return the right name, using english as the locale for case conversion
+ */
+ public static String getCorrectName(String wrongName)
+ {
+ if (wrongName.length() > 1) {
+ return wrongName.substring(0, 1).toLowerCase(Locale.ENGLISH)
+ + wrongName.substring(1, wrongName.length());
+ } else {
+ return wrongName.substring(0, 1).toLowerCase(Locale.ENGLISH);
+ }
+ }
+
+ private String addImports(XSDSchema xmlSchema, QName schemaTypeName)
+ {
+ String prefix = null;
+ Iterator iterator = xmlSchema.getQNamePrefixToNamespaceMap().keySet().iterator();
+ while ( iterator.hasNext() )
+ {
+ prefix = (String)iterator.next();
+
+ if ( schemaTypeName.getNamespaceURI().equals(
+ xmlSchema.getQNamePrefixToNamespaceMap().get(prefix)) )
+ {
+ return prefix;
+ }
+ }
+
+ //the following lines are executed only if a prefix was not found which implies that the
+ //schemaTypeName was not imported earlier and also it does not belong to the targetnamespace
+ XSDImport importElement = xsdFactory.createXSDImport();
+ importElement.setNamespace(schemaTypeName.getNamespaceURI());
+ xmlSchema.getContents().add(0, importElement);
+ prefix = schemaTypeName.getPrefix();
+ if ( prefix == null || prefix.length() <= 0 )
+ {
+ prefix = generatePrefix();
+ }
+ xmlSchema.getQNamePrefixToNamespaceMap().put(prefix, schemaTypeName.getNamespaceURI());
+
+ return prefix;
+ }
+
+ private void handleSDOSequence(Type datatype, XSDComplexTypeDefinition complexType)
+ {
+ if ( datatype.isSequenced() )
+ {
+ complexType.setMixed(true);
+ XSDModelGroup choice = xsdFactory.createXSDModelGroup();
+ choice.setCompositor(XSDCompositor.CHOICE_LITERAL);
+ XSDParticle aParticle = xsdFactory.createXSDParticle();
+ aParticle.setContent(choice);
+ aParticle.setMaxOccurs(-1);
+ complexType.setContent(aParticle);
+ }
+ else
+ {
+ //hack to handle group property as choice
+ /*if ( getPropertyStartsWithName(datatype.getDeclaredProperties(), GROUP).size() > 0 )
+ {
+ XmlSchemaChoice choice = new XmlSchemaChoice();
+ choice.setMaxOccurs(Long.MAX_VALUE);
+ complexType.setParticle(choice);
+ }
+ else*/
+ {
+ XSDModelGroup sequence = xsdFactory.createXSDModelGroup();
+ sequence.setCompositor(XSDCompositor.SEQUENCE_LITERAL);
+ XSDParticle aParticle = xsdFactory.createXSDParticle();
+ aParticle.setContent(sequence);
+ complexType.setContent(aParticle);
+ }
+ }
+ }
+
+ private void handleSDOOpenType(Type datatype, XSDComplexTypeDefinition complexType)
+ {
+ if ( datatype.isOpen() /*&&
+ getPropertyStartsWithName(datatype.getDeclaredProperties(), GROUP).size() <= 0 */)
+ {
+ XSDWildcard elementWildcard = xsdFactory.createXSDWildcard();
+ elementWildcard.getLexicalNamespaceConstraint().add("##other");
+ elementWildcard.setProcessContents(XSDProcessContents.LAX_LITERAL);
+ // Create a particle to hold the wildcard.
+ XSDParticle wildcardParticle = xsdFactory.createXSDParticle();
+ wildcardParticle.setContent(elementWildcard);
+ wildcardParticle.setMaxOccurs(-1);
+ ((XSDModelGroup)((XSDParticle)complexType.getContent()).getContent()).
+ getContents().add(wildcardParticle);
+
+ XSDWildcard attributeWildcard = xsdFactory.createXSDWildcard();
+ attributeWildcard.getLexicalNamespaceConstraint().add("##other");
+ attributeWildcard.setProcessContents(XSDProcessContents.LAX_LITERAL);
+ complexType.setAttributeWildcard(attributeWildcard);
+ }
+ }
+
+ private void handleBaseExtn(XSDSchema xmlSchema,
+ Type datatype,
+ XSDComplexTypeDefinition complexType)
+ {
+ if ( datatype.getBaseTypes().size() > 0 )
+ {
+ Type baseType = (Type)datatype.getBaseTypes().get(0);
+ QName baseSchemaType = null;
+
+ try
+ {
+ baseSchemaType = buildSchema(baseType);
+ }
+ catch ( IllegalArgumentException e )
+ {
+ //schema cannot be generated for this type as there exists an xsd already
+ //so include that original XSD
+ baseSchemaType = new QName(baseType.getURI(),
+ baseType.getName(),
+ generatePrefix());
+
+ XSDSimpleTypeDefinition baseTypeDef = xsdFactory.createXSDSimpleTypeDefinition();
+ baseTypeDef.setName(baseType.getName());
+ baseTypeDef.setTargetNamespace(baseType.getURI());
+ typeTable.addXSDTypeDef(baseType.getURI(), baseType.getName(), baseTypeDef);
+
+ includeExtXSD(baseType);
+ }
+
+ complexType.setDerivationMethod(XSDDerivationMethod.EXTENSION_LITERAL);
+
+ if ( baseType.isDataType() )
+ {
+ XSDSimpleTypeDefinition anonymousSimpleTypeDefinition
+ = xsdFactory.createXSDSimpleTypeDefinition();
+ anonymousSimpleTypeDefinition.setBaseTypeDefinition((XSDSimpleTypeDefinition)typeTable.
+ getXSDTypeDef(baseSchemaType.getNamespaceURI(),baseSchemaType.getLocalPart()));
+ complexType.setContent(anonymousSimpleTypeDefinition);
+ }
+ else
+ {
+ complexType.setBaseTypeDefinition((XSDSimpleTypeDefinition)typeTable.
+ getXSDTypeDef(baseSchemaType.getNamespaceURI(),baseSchemaType.getLocalPart()));
+
+ }
+
+ addImports(xmlSchema, baseSchemaType);
+ }
+ }
+
+ private String formGlobalElementName(String typeName)
+ {
+ String firstChar = typeName.substring(0,1);
+ return typeName.replaceFirst(firstChar, firstChar.toLowerCase());
+ }
+
+ private void createGlobalElement(XSDSchema xmlSchema,
+ XSDComplexTypeDefinition complexType,
+ QName schemaElementName )
+ {
+ XSDElementDeclaration globalElement = xsdFactory.createXSDElementDeclaration();
+ globalElement.setTargetNamespace(xmlSchema.getTargetNamespace());
+ globalElement.setName(formGlobalElementName(complexType.getName()));
+ globalElement.setTypeDefinition
+ (typeTable.getXSDTypeDef(schemaElementName.getNamespaceURI(),
+ schemaElementName.getLocalPart()));
+ xmlSchema.getContents().add(globalElement);
+ xmlSchema.getElementDeclarations().add(globalElement);
+ }
+
+ private void addAliasNamesAnnotation(XSDSchemaContent typeDef,
+ List aliasNames)
+ {
+ if ( !aliasNames.isEmpty() )
+ {
+ StringBuffer sb = new StringBuffer();
+ Iterator iterator = aliasNames.iterator();
+ while ( iterator.hasNext() )
+ {
+ sb.append(iterator.next());
+ }
+ typeDef.getElement().setAttribute(ALIAS_NAMES, sb.toString());
+ }
+ }
+
+ private void addPackageAnnotation(XSDSchema xmlSchema, Type dataType)
+ {
+ if ( dataType.getInstanceClass() != null )
+ {
+ xmlSchema.updateElement();
+ xmlSchema.getElement().setAttribute(JAVA_PACKAGE,
+ dataType.getInstanceClass().getPackage().getName());
+ }
+ }
+
+ private String generatePrefix()
+ {
+ return NAME_SPACE_PREFIX + prefixCount++;
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/TypeHelperImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/TypeHelperImpl.java
new file mode 100644
index 0000000000..7ad8e68cf5
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/TypeHelperImpl.java
@@ -0,0 +1,305 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.helper;
+
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.tuscany.sdo.model.ModelFactory;
+import org.apache.tuscany.sdo.model.java.JavaFactory;
+import org.apache.tuscany.sdo.model.xml.XMLFactory;
+import org.apache.tuscany.sdo.util.SDOUtil;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.util.ExtendedMetaData;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+import commonj.sdo.helper.TypeHelper;
+
+
+/**
+ * Look up a Type given the uri and typeName or interfaceClass.
+ * SDO Types are available through the
+ * getType("commonj.sdo", typeName) method.
+ * Defines Types from DataObjects.
+ */
+public class TypeHelperImpl implements TypeHelper
+{
+ protected ExtendedMetaData extendedMetaData;
+
+ static protected Set builtInModels = null;
+
+ static public Set getBuiltInModels()
+ {
+ if (builtInModels == null) {
+ builtInModels = new HashSet();
+ builtInModels.add(ModelFactory.INSTANCE);
+ builtInModels.add(JavaFactory.INSTANCE);
+ builtInModels.add(XMLFactory.INSTANCE);
+ }
+ return TypeHelperImpl.builtInModels;
+ }
+
+ public ExtendedMetaData getExtendedMetaData()
+ {
+ return extendedMetaData;
+ }
+
+ public TypeHelperImpl(ExtendedMetaData extendedMetaData)
+ {
+ this.extendedMetaData = extendedMetaData;
+
+ // Register the standard (predefined) SDO types
+ getBuiltInModels(); // Simply accessing EMF packages causes auto registration in global registry
+
+ //MetadataFactoryImpl.init(); //FB do we want to preregister this?
+ }
+
+ public Type getType(String uri, String typeName)
+ {
+ EPackage ePackage = extendedMetaData.getPackage(uri);
+
+ if (ePackage != null)
+ {
+ EClassifier eClassifier = ePackage.getEClassifier(typeName);
+ if (eClassifier == null)
+ {
+ eClassifier = extendedMetaData.getType(ePackage, typeName);
+ }
+ return (Type)eClassifier;
+ }
+ return null;
+ }
+
+ public Type getType(Class interfaceClass)
+ {
+ Type type = SDOUtil.getJavaSDOType(interfaceClass);
+ if (type != null)
+ {
+ return type;
+ }
+
+ //TODO more efficient implementation ... this is a really bad one!
+
+ // check the local scope package registry
+ for (Iterator iter = ((SDOExtendedMetaDataImpl)extendedMetaData).getRegistry().values().iterator(); iter.hasNext(); )
+ {
+ Object value = iter.next();
+ if (value instanceof EPackage)
+ {
+ EPackage ePackage = (EPackage)value;
+ for (Iterator iter2 = ePackage.getEClassifiers().iterator(); iter2.hasNext(); )
+ {
+ EClassifier eClassifier = (EClassifier)iter2.next();
+ if (eClassifier.getInstanceClass() == interfaceClass)
+ {
+ return (Type)eClassifier;
+ }
+ }
+ }
+ }
+
+ // if it wasnt in the local scope look in the EMF global package registry
+ for (Iterator iter = EPackage.Registry.INSTANCE.values().iterator(); iter.hasNext(); )
+ {
+ Object value = iter.next();
+ if (value instanceof EPackage)
+ {
+ EPackage ePackage = (EPackage)value;
+ for (Iterator iter2 = ePackage.getEClassifiers().iterator(); iter2.hasNext(); )
+ {
+ EClassifier eClassifier = (EClassifier)iter2.next();
+ if (eClassifier.getInstanceClass() == interfaceClass)
+ {
+ return (Type)eClassifier;
+ }
+ }
+ }
+ }
+
+ return null;
+ }
+
+ public Type define(DataObject type)
+ {
+ if (!(type instanceof org.apache.tuscany.sdo.model.Type))
+ throw new IllegalArgumentException();
+ org.apache.tuscany.sdo.model.Type modeledType = (org.apache.tuscany.sdo.model.Type)type;
+
+ boolean isDataType = modeledType.isDataType();
+ Type definedType = SDOUtil.createType(this, modeledType.getUri(), modeledType.getName(), isDataType);
+ if (definedType == null)
+ {
+ // If type already defined, return the existing Type.
+ return getType(modeledType.getUri(), modeledType.getName());
+ }
+
+ SDOUtil.setJavaClassName(definedType, modeledType.getInstanceClassName());
+
+ if (!isDataType)
+ {
+ SDOUtil.setSequenced(definedType, modeledType.isSequenced());
+ SDOUtil.setOpen(definedType, modeledType.isOpen());
+ SDOUtil.setAbstract(definedType, modeledType.isAbstract());
+
+ for (Iterator iter = modeledType.getBaseType().iterator(); iter.hasNext(); )
+ {
+ Type baseType = getDefinedType((org.apache.tuscany.sdo.model.Type)iter.next());
+ SDOUtil.addBaseType(definedType, baseType);
+ }
+
+ for (Iterator iter = modeledType.getAliasName().iterator(); iter.hasNext(); )
+ {
+ String aliasName = (String)iter.next();
+ SDOUtil.addAliasName(definedType, aliasName);
+ }
+
+ for (Iterator iter = modeledType.getProperty().iterator(); iter.hasNext(); )
+ {
+ org.apache.tuscany.sdo.model.Property modeledProperty = (org.apache.tuscany.sdo.model.Property)iter.next();
+
+ Type propertyType = getDefinedType(modeledProperty.getType_());
+ Property definedProperty = SDOUtil.createProperty(definedType, modeledProperty.getName(), propertyType);
+
+ initializeProperty(definedProperty, modeledProperty);
+ }
+
+ // define a global property to accompany the type definition
+ if (!SDOUtil.isDocumentRoot(definedType))
+ {
+ String propertyName = definedType.getName();
+ if (!Character.isLowerCase(propertyName.charAt(0)))
+ {
+ propertyName = propertyName.substring(0, 1).toLowerCase() + propertyName.substring(1);
+ }
+ Property globalProperty = SDOUtil.createGlobalProperty(this, definedType.getURI(), propertyName, definedType);
+ SDOUtil.setContainment(globalProperty, true);
+ }
+ } // if (!isDataType)
+
+ SDOUtil.addTypeInstanceProperties(definedType, (DataObject)modeledType);
+
+ return definedType;
+ }
+
+ public List /* Type */define(List /* DataObject */types)
+ {
+ int count = types.size();
+ List definedTypes = new ArrayList(count);
+ for (int i = 0; i < count; i++)
+ {
+ definedTypes.add(define((DataObject)types.get(i)));
+ }
+ return definedTypes;
+ }
+
+ protected Type getDefinedType(org.apache.tuscany.sdo.model.Type modeledType)
+ {
+ if (modeledType instanceof Type)
+ {
+ return (Type)modeledType;
+ }
+ else
+ {
+ EClassifier eClassifier = extendedMetaData.getType(modeledType.getUri(), modeledType.getName());
+ if (eClassifier != null)
+ {
+ return (Type)eClassifier;
+ }
+ else
+ {
+ return define((DataObject)modeledType);
+ }
+ }
+ }
+
+ protected Property getDefinedProperty(org.apache.tuscany.sdo.model.Property modeledProperty)
+ {
+ if (modeledProperty instanceof Property)
+ {
+ return (Property)modeledProperty;
+ }
+ else
+ {
+ DataObject modeledContainingType = ((DataObject)modeledProperty).getContainer();
+
+ Type definedContainingType = getDefinedType((org.apache.tuscany.sdo.model.Type)modeledContainingType);
+ String propertyName = modeledProperty.getName();
+
+ return definedContainingType.getProperty(propertyName);
+ }
+ }
+
+ protected void initializeProperty(Property newProperty, org.apache.tuscany.sdo.model.Property modeledProperty)
+ {
+ SDOUtil.setMany(newProperty, modeledProperty.isMany());
+ SDOUtil.setDefault(newProperty, modeledProperty.getDefault_());
+ SDOUtil.setReadOnly(newProperty, modeledProperty.isReadOnly());
+ for (Iterator iter = modeledProperty.getAliasName().iterator(); iter.hasNext();)
+ {
+ String aliasName = (String)iter.next();
+ SDOUtil.addAliasName(newProperty, aliasName);
+ }
+ if (!newProperty.getType().isDataType())
+ {
+ SDOUtil.setContainment(newProperty, modeledProperty.isContainment());
+ if (modeledProperty.getOpposite_() != null)
+ {
+ SDOUtil.setOpposite(newProperty, getDefinedProperty(modeledProperty.getOpposite_()));
+ }
+ }
+ SDOUtil.addPropertyInstanceProperties(newProperty, (DataObject)modeledProperty);
+ }
+
+ public static final String TUSCANY_NO_URI="http://tuscany-no-uri";
+
+ public Property defineOpenContentProperty(String uri, DataObject property)
+ {
+ // validate property and get type
+ if (!(property instanceof org.apache.tuscany.sdo.model.impl.PropertyImpl))
+ throw new IllegalArgumentException();
+ org.apache.tuscany.sdo.model.Property modeledProperty = (org.apache.tuscany.sdo.model.Property)property;
+ Type propertyType = getDefinedType(modeledProperty.getType_());
+
+ if (uri == null) uri = TUSCANY_NO_URI;
+
+ Property newProperty = SDOUtil.createGlobalProperty(this, uri, modeledProperty.getName(), propertyType);
+
+ // Propagate the modeled property's attributes
+ initializeProperty(newProperty, modeledProperty);
+
+ return newProperty;
+ }
+
+ public Property getOpenContentProperty(String uri, String propertyName)
+ {
+ //return (Property)extendedMetaData.getElement(uri, propertyName);
+ EClass documentRoot = (EClass)extendedMetaData.getType(uri, "");
+ return documentRoot != null ? (Property)documentRoot.getEStructuralFeature(propertyName) : null;
+ }
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/TypeTable.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/TypeTable.java
new file mode 100644
index 0000000000..a28492e28e
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/TypeTable.java
@@ -0,0 +1,254 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.helper;
+
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Vector;
+
+import javax.xml.namespace.QName;
+
+//import org.apache.axiom.om.OMElement;
+import org.eclipse.xsd.XSDFactory;
+import org.eclipse.xsd.XSDTypeDefinition;
+import org.w3c.dom.Element;
+
+
+
+public class TypeTable
+{
+ public static final String XML_SCHEMA_URI = "http://www.w3.org/2001/XMLSchema";
+ public static final String XS_URI_PREFIX = "xs";
+ public static final QName XS_QNAME = new QName(XML_SCHEMA_URI, "schema", XS_URI_PREFIX);
+ public static final String DELIMITER = "#";
+
+ private Hashtable simpleXSDTypes;
+ private Hashtable complexXSDTypes;
+ private Hashtable xsdTypeDefs;
+
+ public static String asQualifiedName(String uri, String typeName)
+ {
+ return (uri + DELIMITER + typeName);
+ }
+
+
+ public TypeTable()
+ {
+ simpleXSDTypes = new Hashtable();
+ complexXSDTypes = new Hashtable();
+ xsdTypeDefs = new Hashtable();
+ populateSimpleXSDTypes();
+ populateStdSDOTypes();
+ }
+
+ private void populateStdSDOTypes()
+ {
+ simpleXSDTypes.put("Boolean",
+ new QName(XML_SCHEMA_URI, "boolean", XS_URI_PREFIX));
+ simpleXSDTypes.put("Byte",
+ new QName(XML_SCHEMA_URI, "byte", XS_URI_PREFIX));
+ simpleXSDTypes.put("Bytes",
+ new QName(XML_SCHEMA_URI, "hexBinary", XS_URI_PREFIX));
+ simpleXSDTypes.put("Character",
+ new QName(XML_SCHEMA_URI, "string", XS_URI_PREFIX));
+ simpleXSDTypes.put("DataObject",
+ new QName(XML_SCHEMA_URI, "anyType", XS_URI_PREFIX));
+ simpleXSDTypes.put("Date",
+ new QName(XML_SCHEMA_URI, "dateTime", XS_URI_PREFIX));
+ simpleXSDTypes.put("Day",
+ new QName(XML_SCHEMA_URI, "gDay", XS_URI_PREFIX));
+ simpleXSDTypes.put("Decimal",
+ new QName(XML_SCHEMA_URI, "decimal", XS_URI_PREFIX));
+ simpleXSDTypes.put("Double",
+ new QName(XML_SCHEMA_URI, "double", XS_URI_PREFIX));
+ simpleXSDTypes.put("Duration",
+ new QName(XML_SCHEMA_URI, "duration", XS_URI_PREFIX));
+ simpleXSDTypes.put("Float",
+ new QName(XML_SCHEMA_URI, "float", XS_URI_PREFIX));
+ simpleXSDTypes.put("Int",
+ new QName(XML_SCHEMA_URI, "int", XS_URI_PREFIX));
+ simpleXSDTypes.put("Integer",
+ new QName(XML_SCHEMA_URI, "integer", XS_URI_PREFIX));
+ simpleXSDTypes.put("Long",
+ new QName(XML_SCHEMA_URI, "long", XS_URI_PREFIX));
+ simpleXSDTypes.put("Month",
+ new QName(XML_SCHEMA_URI, "gMonth", XS_URI_PREFIX));
+ simpleXSDTypes.put("monthDay",
+ new QName(XML_SCHEMA_URI, "gMonthDay", XS_URI_PREFIX));
+ simpleXSDTypes.put("Object",
+ new QName(XML_SCHEMA_URI, "anySimpleType", XS_URI_PREFIX));
+ simpleXSDTypes.put("Short",
+ new QName(XML_SCHEMA_URI, "short", XS_URI_PREFIX));
+ simpleXSDTypes.put("String",
+ new QName(XML_SCHEMA_URI, "string", XS_URI_PREFIX));
+ simpleXSDTypes.put("Strings",
+ new QName(XML_SCHEMA_URI, "string", XS_URI_PREFIX));
+ simpleXSDTypes.put("Time",
+ new QName(XML_SCHEMA_URI, "time", XS_URI_PREFIX));
+ simpleXSDTypes.put("Year",
+ new QName(XML_SCHEMA_URI, "gYear", XS_URI_PREFIX));
+ simpleXSDTypes.put("YearMonth",
+ new QName(XML_SCHEMA_URI, "gYearMonth", XS_URI_PREFIX));
+ simpleXSDTypes.put("YearMonthDay",
+ new QName(XML_SCHEMA_URI, "date", XS_URI_PREFIX));
+ simpleXSDTypes.put("URI",
+ new QName(XML_SCHEMA_URI, "anyURI", XS_URI_PREFIX));
+ }
+
+ private void populateSimpleXSDTypes() {
+ //todo pls use the types from org.apache.ws.commons.schema.constants.Constants
+ simpleXSDTypes.put("int",
+ new QName(XML_SCHEMA_URI, "int", XS_URI_PREFIX));
+ simpleXSDTypes.put("java.lang.String",
+ new QName(XML_SCHEMA_URI, "string", XS_URI_PREFIX));
+ simpleXSDTypes.put("boolean",
+ new QName(XML_SCHEMA_URI, "boolean", XS_URI_PREFIX));
+ simpleXSDTypes.put("float",
+ new QName(XML_SCHEMA_URI, "float", XS_URI_PREFIX));
+ simpleXSDTypes.put("double",
+ new QName(XML_SCHEMA_URI, "double", XS_URI_PREFIX));
+ simpleXSDTypes.put("short",
+ new QName(XML_SCHEMA_URI, "short", XS_URI_PREFIX));
+ simpleXSDTypes.put("long",
+ new QName(XML_SCHEMA_URI, "long", XS_URI_PREFIX));
+ simpleXSDTypes.put("byte",
+ new QName(XML_SCHEMA_URI, "byte", XS_URI_PREFIX));
+ simpleXSDTypes.put("char",
+ new QName(XML_SCHEMA_URI, "anyType", XS_URI_PREFIX));
+ simpleXSDTypes.put("java.lang.Integer",
+ new QName(XML_SCHEMA_URI, "int", XS_URI_PREFIX));
+ simpleXSDTypes.put("java.lang.Double",
+ new QName(XML_SCHEMA_URI, "double", XS_URI_PREFIX));
+ simpleXSDTypes.put("java.lang.Float",
+ new QName(XML_SCHEMA_URI, "float", XS_URI_PREFIX));
+ simpleXSDTypes.put("java.lang.Long",
+ new QName(XML_SCHEMA_URI, "long", XS_URI_PREFIX));
+ simpleXSDTypes.put("java.lang.Character",
+ new QName(XML_SCHEMA_URI, "anyType", XS_URI_PREFIX));
+ simpleXSDTypes.put("java.lang.Boolean",
+ new QName(XML_SCHEMA_URI, "boolean", XS_URI_PREFIX));
+ simpleXSDTypes.put("java.lang.Byte",
+ new QName(XML_SCHEMA_URI, "byte", XS_URI_PREFIX));
+ simpleXSDTypes.put("java.lang.Short",
+ new QName(XML_SCHEMA_URI, "short", XS_URI_PREFIX));
+ simpleXSDTypes.put("java.util.Date",
+ new QName(XML_SCHEMA_URI, "dateTime", XS_URI_PREFIX));
+ simpleXSDTypes.put("java.util.Calendar",
+ new QName(XML_SCHEMA_URI, "dateTime", XS_URI_PREFIX));
+ simpleXSDTypes.put("java.lang.Object",
+ new QName(XML_SCHEMA_URI, "anyType", XS_URI_PREFIX));
+ simpleXSDTypes.put("java.math.BigDecimal",
+ new QName(XML_SCHEMA_URI, "decimal", XS_URI_PREFIX));
+
+ // Any types
+ simpleXSDTypes.put(Element.class.getName(),
+ new QName(XML_SCHEMA_URI, "anyType", XS_URI_PREFIX));
+ simpleXSDTypes.put(ArrayList.class.getName(),
+ new QName(XML_SCHEMA_URI, "anyType", XS_URI_PREFIX));
+ simpleXSDTypes.put(Vector.class.getName(),
+ new QName(XML_SCHEMA_URI, "anyType", XS_URI_PREFIX));
+ simpleXSDTypes.put(List.class.getName(),
+ new QName(XML_SCHEMA_URI, "anyType", XS_URI_PREFIX));
+ }
+
+ public QName getStdSdoType(String typename)
+ {
+ return (QName) simpleXSDTypes.get(typename);
+ }
+
+ public QName getComplexSchemaTypeName(String sdoURI, String sdoTypeName)
+ {
+ return (QName) complexXSDTypes.get(asQualifiedName(sdoURI, sdoTypeName));
+ }
+
+ public boolean isSimpleType(String typeName)
+ {
+ Iterator keys = simpleXSDTypes.keySet().iterator();
+ while (keys.hasNext()) {
+ String s = (String) keys.next();
+ if (s.equals(typeName)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public QName getSimpleSchemaTypeName(String typename)
+ {
+ return (QName) simpleXSDTypes.get(typename);
+ }
+
+ public void addSimpleSchemaType(String typeName, QName schemaType)
+ {
+ simpleXSDTypes.put(typeName, schemaType);
+ }
+
+
+ public void addComplexSchemaType(String namespaceURI, String name, QName schemaType)
+ {
+ complexXSDTypes.put(asQualifiedName(namespaceURI, name), schemaType);
+ }
+
+
+ public QName getQNamefortheType(String namespaceURI, String typeName)
+ {
+ if ( XML_SCHEMA_URI.equals(namespaceURI))
+ {
+ return getSimpleSchemaTypeName(typeName);
+ }
+ else
+ {
+ return getComplexSchemaTypeName(namespaceURI, typeName);
+ }
+ }
+
+ public void addXSDTypeDef(String namespaceURI, String typeName, XSDTypeDefinition aTypeDef)
+ {
+ if ( namespaceURI != null && typeName != null && aTypeDef != null )
+ {
+ xsdTypeDefs.put(asQualifiedName(namespaceURI, typeName), aTypeDef);
+ }
+ }
+
+ public XSDTypeDefinition getXSDTypeDef(String namespaceURI, String typeName)
+ {
+ XSDTypeDefinition typeDef = null;
+ if ( namespaceURI != null && typeName != null )
+ {
+ if ( XML_SCHEMA_URI.equals(namespaceURI) )
+ {
+ if ( ( typeDef = (XSDTypeDefinition)xsdTypeDefs.get(asQualifiedName(namespaceURI, typeName)) ) == null )
+ {
+ typeDef = XSDFactory.eINSTANCE.createXSDSimpleTypeDefinition();
+ typeDef.setName(typeName);
+ typeDef.setTargetNamespace(namespaceURI);
+ addXSDTypeDef(namespaceURI, typeName, typeDef);
+ }
+ }
+ else
+ {
+ typeDef = (XSDTypeDefinition)xsdTypeDefs.get(asQualifiedName(namespaceURI, typeName));
+ }
+ }
+ return typeDef;
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/XMLDocumentImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/XMLDocumentImpl.java
new file mode 100644
index 0000000000..da0e4750de
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/XMLDocumentImpl.java
@@ -0,0 +1,539 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.helper;
+
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.Reader;
+import java.io.Writer;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.stream.XMLStreamReader;
+
+import org.apache.tuscany.sdo.SimpleAnyTypeDataObject;
+import org.apache.tuscany.sdo.util.DataObjectUtil;
+import org.apache.tuscany.sdo.util.SDOUtil;
+import org.apache.tuscany.sdo.util.resource.SDOXMLResourceImpl;
+import org.eclipse.emf.common.util.EMap;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.ecore.util.ExtendedMetaData;
+import org.eclipse.emf.ecore.util.FeatureMap;
+import org.eclipse.emf.ecore.util.FeatureMapUtil;
+import org.eclipse.emf.ecore.xmi.XMLResource;
+import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
+import org.xml.sax.InputSource;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Type;
+import commonj.sdo.helper.XMLDocument;
+
+
+/**
+ * Represents an XML Document containing a tree of DataObjects.
+ *
+ * An example XMLDocument fragment is:
+ * <?xml version="1.0"?>
+ * <purchaseOrder orderDate="1999-10-20">
+ *
+ * created from this XML Schema fragment:
+ * <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ * <xsd:element name="purchaseOrder" type="PurchaseOrderType"/>
+ * <xsd:complexType name="PurchaseOrderType">
+ *
+ * Upon loading this XMLDocument:
+ * DataObject is an instance of Type PurchaseOrderType.
+ * RootElementURI is null because the XSD has no targetNamespace URI.
+ * RootElementName is purchaseOrder.
+ * Encoding is null because the document did not specify an encoding.
+ * XMLDeclaration is true because the document contained an XML declaration.
+ * XMLVersion is 1.0
+ * SchemaLocation and noNamespaceSchemaLocation are null because they are
+ * not specified in the document.
+ *
+ * When saving the root element, if the type of the root dataObject is not the
+ * type of global element specified by rootElementURI and rootElementName,
+ * or if a global element does not exist for rootElementURI and rootElementName,
+ * then an xsi:type declaration is written to record the root DataObject's Type.
+ *
+ * When loading the root element and an xsi:type declaration is found
+ * it is used as the type of the root DataObject. In this case,
+ * if validation is not being performed, it is not an error if the
+ * rootElementName is not a global element.
+ */
+public class XMLDocumentImpl implements XMLDocument
+{
+ protected ExtendedMetaData extendedMetaData;
+
+ protected EObject rootObject;
+
+ protected XMLResource resource;
+
+ protected EStructuralFeature rootElement;
+
+ protected EObject documentRoot;
+
+ protected final static String WHITESPACE_REGEX = "\\s";
+
+ //TODO clean up the options thing
+ protected XMLDocumentImpl(ExtendedMetaData extendedMetaData, Object options)
+ {
+ this.extendedMetaData = extendedMetaData;
+ ResourceSet resourceSet = DataObjectUtil.createResourceSet();
+
+ if (options instanceof Map)
+ {
+ Class resourceFactoryClass = (Class)((Map)options).get("GENERATED_LOADER");
+ if (resourceFactoryClass != null)
+ {
+ try
+ {
+ Object resourceFactory = resourceFactoryClass.newInstance();
+ resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("*", resourceFactory);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ resource = (XMLResource)resourceSet.createResource(URI.createURI("http:///temp.xml"));
+ DataObjectUtil.configureXMLResource(resource, extendedMetaData);
+ }
+
+ protected XMLDocumentImpl(ExtendedMetaData extendedMetaData)
+ {
+ this(extendedMetaData, null);
+ }
+
+ protected XMLDocumentImpl(ExtendedMetaData extendedMetaData, DataObject dataObject, String rootElementURI, String rootElementName)
+ {
+ this(extendedMetaData);
+
+ rootObject = (EObject)dataObject;
+
+ rootElement = extendedMetaData.getElement(rootElementURI, rootElementName);
+ if (rootElement == null)
+ {
+ rootElement = ExtendedMetaData.INSTANCE.demandFeature(rootElementURI, rootElementName, true);
+ }
+
+ EClass documentRootClass = rootElement.getEContainingClass();
+ documentRoot = EcoreUtil.create(documentRootClass);
+ resource.getContents().add(documentRoot);
+ }
+
+ protected void save(OutputStream outputStream, Object options) throws IOException
+ {
+ EObject oldContainer = null;
+ EReference oldContainmentReference = null;
+ int oldContainmentIndex = -1;
+
+ if (documentRoot != null)
+ {
+ //TODO also check if rootObject is directly contained in a resource
+ oldContainer = rootObject.eContainer();
+ if (oldContainer != null)
+ {
+ oldContainmentReference = rootObject.eContainmentFeature();
+ }
+ if (oldContainer != documentRoot || oldContainmentReference != rootElement)
+ {
+ if (oldContainmentReference != null && FeatureMapUtil.isMany(oldContainer, oldContainmentReference))
+ {
+ oldContainmentIndex = ((List)oldContainer.eGet(oldContainmentReference)).indexOf(rootObject);
+ }
+
+ Object rootValue =
+ rootElement instanceof EAttribute && rootObject instanceof SimpleAnyTypeDataObject ?
+ ((SimpleAnyTypeDataObject)rootObject).getValue() : rootObject;
+
+ documentRoot.eSet(rootElement, rootValue);
+ }
+ }
+
+ resource.save(outputStream, (Map)options);
+
+ if (oldContainer != null)
+ {
+ if (oldContainer != documentRoot || oldContainmentReference != rootElement)
+ {
+ if (FeatureMapUtil.isMany(oldContainer, oldContainmentReference))
+ {
+ ((List)oldContainer.eGet(oldContainmentReference)).add(oldContainmentIndex, rootObject);
+ }
+ else
+ {
+ oldContainer.eSet(oldContainmentReference, rootObject);
+ }
+ }
+ }
+ else if (documentRoot != null)
+ {
+ documentRoot.eSet(rootElement, null);
+ }
+ }
+
+ protected void save(Writer outputWriter, Object options) throws IOException
+ {
+ // TODO temporary brute-force implementation ... to be replaced
+ ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+ save(outputStream, options);
+ outputWriter.write(new String(outputStream.toByteArray()));
+ }
+
+ protected void load(InputStream inputStream, String locationURI, Object options) throws IOException
+ {
+ InputSource inputSource = new InputSource(inputStream);
+ load(inputSource, locationURI, options);
+ }
+
+ protected void load(Reader inputReader, String locationURI, Object options) throws IOException
+ {
+ InputSource inputSource = new InputSource(inputReader);
+ load(inputSource, locationURI, options);
+ }
+
+ protected final void load(XMLStreamReader reader, Map options) throws IOException
+ {
+ ((SDOXMLResourceImpl)resource).load(reader, options);
+ initLoadedRoot();
+ }
+
+ protected void load(InputSource inputSource, String locationURI, Object options) throws IOException
+ {
+ if (locationURI != null)
+ {
+ inputSource.setSystemId(locationURI);
+ resource.setURI(URI.createURI(locationURI));
+ }
+ resource.load(inputSource, (Map)options);
+ initLoadedRoot();
+ }
+
+ private void initLoadedRoot()
+ {
+ rootObject = null;
+ rootElement = null;
+ documentRoot = null;
+
+ if (!resource.getContents().isEmpty())
+ {
+ documentRoot = (EObject)resource.getContents().get(0);
+ EClass documentRootClass = documentRoot.eClass();
+ if ("".equals(extendedMetaData.getName(documentRootClass))) //TODO efficient way to check this? Maybe DataObject.getContainer should also check this?
+ {
+ FeatureMap featureMap = (FeatureMap)documentRoot.eGet(documentRootClass.getEStructuralFeature(0)); // get mixed feature
+ int size = featureMap.size();
+ for (int index = 0; index < size; index++)
+ {
+ EStructuralFeature feature = featureMap.getEStructuralFeature(index);
+ boolean isText =
+ feature == XMLTypePackage.Literals.XML_TYPE_DOCUMENT_ROOT__TEXT ||
+ feature == XMLTypePackage.Literals.XML_TYPE_DOCUMENT_ROOT__CDATA ||
+ feature == XMLTypePackage.Literals.XML_TYPE_DOCUMENT_ROOT__COMMENT;
+ if (!isText)
+ {
+ if (feature instanceof EReference)
+ {
+ rootObject = (EObject)featureMap.getValue(index);
+ documentRoot.eUnset(feature);
+ }
+ else //EAttribute
+ {
+ rootObject = (EObject)SDOUtil.createDataTypeWrapper((Type)feature.getEType(), featureMap.getValue(index));
+ }
+ rootElement = feature;
+ break;
+ }
+ } //for
+ if (rootObject == null)
+ rootObject = ((SDOXMLResourceImpl) resource).root;
+ }
+ else
+ {
+ rootObject = documentRoot;
+ documentRoot = null;
+ }
+ }
+ }
+
+ public DataObject getRootObject()
+ {
+ return (DataObject)rootObject;
+ }
+
+ public String getRootElementURI()
+ {
+ if (rootElement != null)
+ {
+ return extendedMetaData.getNamespace(rootElement);
+ }
+ else if (rootObject != null)
+ {
+ return extendedMetaData.getNamespace(rootObject.eClass());
+ }
+ return null;
+ }
+
+ public String getRootElementName()
+ {
+ if (rootElement != null)
+ {
+ return extendedMetaData.getName(rootElement);
+ }
+ else if (rootObject != null)
+ {
+ return extendedMetaData.getName(rootObject.eClass());
+ }
+ return null;
+ }
+
+ public String getEncoding()
+ {
+ return resource.getEncoding();
+ }
+
+ public void setEncoding(String encoding)
+ {
+ resource.setEncoding(encoding);
+ }
+
+ public boolean isXMLDeclaration()
+ {
+ return Boolean.FALSE.equals(resource.getDefaultSaveOptions().get(XMLResource.OPTION_DECLARE_XML));
+ }
+
+ public void setXMLDeclaration(boolean xmlDeclaration)
+ {
+ resource.getDefaultSaveOptions().put(XMLResource.OPTION_DECLARE_XML, xmlDeclaration ? Boolean.TRUE : Boolean.FALSE);
+ }
+
+ public String getXMLVersion()
+ {
+ return resource.getXMLVersion();
+ }
+
+ public void setXMLVersion(String xmlVersion)
+ {
+ resource.setXMLVersion(xmlVersion);
+ }
+
+ /**
+ * @return an EMap containing the schema locations or null when no map
+ */
+ protected EMap getSchemaLocationMap()
+ {
+ EMap result = null;
+ if ((documentRoot != null) && (extendedMetaData != null))
+ {
+ EReference xsiSchemaLocationMapFeature = extendedMetaData
+ .getXSISchemaLocationMapFeature(documentRoot.eClass());
+ if (xsiSchemaLocationMapFeature != null)
+ {
+ result = (EMap) documentRoot.eGet(xsiSchemaLocationMapFeature);
+ }
+ }
+ return result;
+ }
+
+ /**
+ * @param value
+ * from schema location map.
+ * @return string form of URI from provided value, deresolved if appropriate.
+ */
+ protected String deresolve(String value)
+ {
+ URI location = URI.createURI(value);
+ URI resourceURI = resource.getURI();
+ boolean shouldDeresolve = resourceURI != null && !resourceURI.isRelative()
+ && resourceURI.isHierarchical();
+ if (shouldDeresolve && !location.isRelative())
+ {
+ URI deresolvedURI = location.deresolve(resourceURI, true, true, false);
+ if (deresolvedURI.hasRelativePath())
+ {
+ location = deresolvedURI;
+ }
+ }
+ return location.toString();
+ }
+
+ /**
+ * @param value
+ * for schema location from input parameter.
+ * @return string form of URI from provided value, resolved if appropriate.
+ */
+ protected String resolve(String value)
+ {
+ URI location = URI.createURI(value);
+ URI resourceURI = resource.getURI();
+ boolean shouldResolve = resourceURI != null && resourceURI.isHierarchical()
+ && !resourceURI.isRelative();
+ if (shouldResolve && location.isRelative() && location.hasRelativePath())
+ {
+ location = location.resolve(resourceURI, false);
+ }
+ return location.toString();
+ }
+
+ public String getSchemaLocation()
+ {
+ EMap xsiSchemaLocationMap = getSchemaLocationMap();
+ if (xsiSchemaLocationMap != null)
+ {
+ if (!xsiSchemaLocationMap.isEmpty())
+ {
+ StringBuffer xsiSchemaLocation = new StringBuffer();
+ for (Iterator i = xsiSchemaLocationMap.entrySet().iterator(); i
+ .hasNext();)
+ {
+ Map.Entry entry = (Map.Entry) i.next();
+ String namespace = (String) entry.getKey();
+ if (namespace != null)
+ {
+ if (xsiSchemaLocation.length() > 0)
+ {
+ xsiSchemaLocation.append(' ');
+ }
+ xsiSchemaLocation.append(namespace);
+ xsiSchemaLocation.append(' ');
+ String value = entry.getValue().toString();
+ xsiSchemaLocation.append(deresolve(value));
+ }
+ }
+ return xsiSchemaLocation.toString().equals("") ? null
+ : xsiSchemaLocation.toString();
+ }
+ }
+ return null;
+ }
+
+ public void setSchemaLocation(String schemaLocation)
+ {
+ EMap xsiSchemaLocationMap = getSchemaLocationMap();
+ if (xsiSchemaLocationMap != null)
+ {
+ // only remove the entries from xsiSchemaLocationMap that contain a
+ // non-null key
+ for (Iterator i = xsiSchemaLocationMap.entrySet().iterator(); i.hasNext();)
+ {
+ Map.Entry entry = (Map.Entry) i.next();
+ if (entry.getKey() != null)
+ {
+ i.remove();
+ }
+ }
+ if (xsiSchemaLocationMap.size() == 0)
+ {
+ resource.getDefaultSaveOptions().put(
+ XMLResource.OPTION_SCHEMA_LOCATION, Boolean.FALSE);
+ }
+ if (schemaLocation != null)
+ {
+ String[] values = schemaLocation.split(WHITESPACE_REGEX);
+ for (int i = 0; i < values.length; i++) // note: also incremented in
+ // loop
+ {
+ String key = values[i++];
+ if (i < values.length)
+ {
+ xsiSchemaLocationMap.put(key, resolve(values[i]));
+ }
+ }
+ if (xsiSchemaLocationMap.size() != 0)
+ {
+ resource.getDefaultSaveOptions().put(
+ XMLResource.OPTION_SCHEMA_LOCATION, Boolean.TRUE);
+ }
+ }
+ }
+ }
+
+ public String getNoNamespaceSchemaLocation()
+ {
+ EMap xsiSchemaLocationMap = getSchemaLocationMap();
+ if (xsiSchemaLocationMap != null)
+ {
+ StringBuffer xsiSchemaLocation = new StringBuffer();
+ if (!xsiSchemaLocationMap.isEmpty())
+ {
+ Object valueObject = xsiSchemaLocationMap.get(null);
+ if (valueObject != null)
+ {
+ String valueString = (String) valueObject;
+ String[] values = valueString.split(WHITESPACE_REGEX);
+ for (int i = 0; i < values.length; i++)
+ {
+ if (xsiSchemaLocation.length() > 0)
+ {
+ xsiSchemaLocation.append(' ');
+ }
+ xsiSchemaLocation.append(deresolve(values[i]));
+ }
+ }
+ String result = xsiSchemaLocation.toString();
+ return result.equals("") ? null : result;
+ }
+ }
+ return null;
+ }
+
+ public void setNoNamespaceSchemaLocation(String schemaLocation)
+ {
+ EMap xsiSchemaLocationMap = getSchemaLocationMap();
+ if (xsiSchemaLocationMap != null)
+ {
+ // only remove the entries from xsiSchemaLocationMap that contain a null
+ // key
+ xsiSchemaLocationMap.removeKey(null);
+ if (xsiSchemaLocationMap.size() == 0)
+ {
+ resource.getDefaultSaveOptions().put(
+ XMLResource.OPTION_SCHEMA_LOCATION, Boolean.FALSE);
+ }
+ if (schemaLocation != null)
+ {
+ String[] values = schemaLocation.split(WHITESPACE_REGEX);
+ for (int i = 0; i < values.length; i++)
+ {
+ xsiSchemaLocationMap.put(null, resolve(values[i]));
+ }
+ if (xsiSchemaLocationMap.size() != 0)
+ {
+ resource.getDefaultSaveOptions().put(
+ XMLResource.OPTION_SCHEMA_LOCATION, Boolean.TRUE);
+ }
+ }
+ }
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/XMLHelperImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/XMLHelperImpl.java
new file mode 100644
index 0000000000..3d3951e07a
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/XMLHelperImpl.java
@@ -0,0 +1,132 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.helper;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.Reader;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.io.Writer;
+
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+
+import org.eclipse.emf.ecore.util.ExtendedMetaData;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.helper.TypeHelper;
+import commonj.sdo.helper.XMLDocument;
+import commonj.sdo.helper.XMLHelper;
+
+/**
+ * A helper to convert XML documents into DataObects and
+ * DataObjects into XML documnets.
+ */
+public class XMLHelperImpl implements XMLHelper
+{
+ ExtendedMetaData extendedMetaData;
+
+ public XMLHelperImpl(ExtendedMetaData extendedMetaData)
+ {
+ this.extendedMetaData = extendedMetaData;
+ }
+
+ public XMLHelperImpl(TypeHelper typeHelper)
+ {
+ this.extendedMetaData = ((TypeHelperImpl)typeHelper).extendedMetaData;
+ }
+
+ public XMLDocument load(String inputString)
+ {
+ try
+ {
+ return load(new StringReader(inputString), null, null);
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException(e); // should never happen
+ }
+ }
+
+ public XMLDocument load(InputStream inputStream) throws IOException
+ {
+ return load(inputStream, null, null);
+ }
+
+ public XMLDocument load(InputStream inputStream, String locationURI, Object options) throws IOException
+ {
+ XMLDocumentImpl document = new XMLDocumentImpl(extendedMetaData, options);
+ document.load(inputStream, locationURI, options);
+ return document;
+ }
+
+ public XMLDocument load(Reader inputReader, String locationURI, Object options) throws IOException
+ {
+ XMLDocumentImpl document = new XMLDocumentImpl(extendedMetaData, options);
+ document.load(inputReader, locationURI, options);
+ return document;
+ }
+
+ public XMLDocument load(Source inputSource, String locationURI, Object options) throws IOException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public String save(DataObject dataObject, String rootElementURI, String rootElementName)
+ {
+ StringWriter stringWriter = new StringWriter();
+ try
+ {
+ save(createDocument(dataObject, rootElementURI, rootElementName), stringWriter, null);
+ return stringWriter.toString();
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException(e); // should never happen
+ }
+ }
+
+ public void save(DataObject dataObject, String rootElementURI, String rootElementName, OutputStream outputStream) throws IOException
+ {
+ save(createDocument(dataObject, rootElementURI, rootElementName), outputStream, null);
+ }
+
+ public void save(XMLDocument xmlDocument, OutputStream outputStream, Object options) throws IOException
+ {
+ ((XMLDocumentImpl)xmlDocument).save(outputStream, options);
+ }
+
+ public void save(XMLDocument xmlDocument, Writer outputWriter, Object options) throws IOException
+ {
+ ((XMLDocumentImpl)xmlDocument).save(outputWriter, options);
+ }
+
+ public void save(XMLDocument xmlDocument, Result outputResult, Object options) throws IOException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public XMLDocument createDocument(DataObject dataObject, String rootElementURI, String rootElementName)
+ {
+ return new XMLDocumentImpl(extendedMetaData, dataObject, rootElementURI, rootElementName);
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/XMLStreamHelper.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/XMLStreamHelper.java
new file mode 100644
index 0000000000..0dc0c35f31
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/XMLStreamHelper.java
@@ -0,0 +1,112 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.helper;
+
+import java.util.Map;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.helper.XMLDocument;
+
+/**
+ * Helper interface for reading and writing SDO DataObjects from XML streams (StAX).
+ *
+ * @version $Rev$ $Date$
+ */
+public interface XMLStreamHelper {
+ /**
+ * Creates and returns an XMLDocument from an XML input stream.
+ * The reader must be positioned on a START_DOCUMENT event.
+ *
+ * @param reader the stream to read
+ * @return an XMLDocument created from the stream
+ * @throws XMLStreamException if there was a problem reading the stream
+ * @throws IllegalStateException if the reader is not positioned on a START_DOCUMENT event
+ */
+ XMLDocument load(XMLStreamReader reader) throws XMLStreamException, IllegalStateException;
+
+ /**
+ * Save a XMLDocument to an XML stream.
+ *
+ * @param document the document to be written
+ * @param writer the stream to write to
+ * @throws XMLStreamException if there was a problem writing to the stream
+ */
+ void save(XMLDocument document, XMLStreamWriter writer) throws XMLStreamException;
+
+ /**
+ * Creates and returns a XMLStreamReader that can be used to read an XMLDocument as a XML event stream.
+ * The reader will be positioned on a START_DOCUMENT event.
+ *
+ * @param document the XMLDocument to be read
+ * @return an XMLStreamReader that can be used to read the document
+ */
+ XMLStreamReader createXMLStreamReader(XMLDocument document) throws XMLStreamException;
+
+ /**
+ * Create a DataObject from an element in a XML stream.
+ * The reader must be positioned on a START_ELEMENT event.
+ *
+ * @param reader the stream to read
+ * @return a DataObject created from the element in the stream
+ * @throws XMLStreamException if there was a problem reading the stream
+ * @throws IllegalStateException if the reader is not positioned on a START_ELEMENT event
+ */
+ DataObject loadObject(XMLStreamReader reader) throws XMLStreamException, IllegalStateException;
+
+ /**
+ * Default Type to load DataObject if the element is unqualified/local without xsi:type
+ * or the qualified/global element or xsi:type fail to resolve.
+ * Can be null.
+ */
+ String OPTION_DEFAULT_ROOT_TYPE = "default root type";
+
+ /**
+ * Create a DataObject from an element in a XML stream.
+ * The reader must be positioned on a START_ELEMENT event.
+ *
+ * @param reader the stream to read
+ * @param options {@link OPTION_DEFAULT_ROOT_TYPE}; can be null or empty
+ * @return a DataObject created from the element in the stream
+ * @throws XMLStreamException if there was a problem reading the stream
+ * @throws IllegalStateException if the reader is not positioned on a START_ELEMENT event
+ */
+ DataObject loadObject(XMLStreamReader reader, Map options) throws XMLStreamException, IllegalStateException;
+
+ /**
+ * Save a DataObject to an XML stream.
+ *
+ * @param sdo the DataObject to be written
+ * @param writer the stream to write to
+ * @throws XMLStreamException if there was a problem writing to the stream
+ */
+ void saveObject(DataObject sdo, XMLStreamWriter writer) throws XMLStreamException;
+
+ /**
+ * Creates and returns a XMLStreamReader that can be used to read a DataObject as a XML event stream.
+ * The reader will be positioned on a START_ELEMENT event.
+ *
+ * @param sdo the DataObject to be read
+ * @return an XMLStreamReader that can be used to read the DataObject
+ */
+ XMLStreamReader createXMLStreamReader(DataObject sdo);
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/XMLStreamHelperImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/XMLStreamHelperImpl.java
new file mode 100644
index 0000000000..25b8e94b73
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/XMLStreamHelperImpl.java
@@ -0,0 +1,135 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.helper;
+
+import java.util.Map;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.tuscany.sdo.util.resource.DataObjectXMLStreamReader;
+import org.apache.tuscany.sdo.util.resource.XMLDocumentStreamReader;
+import org.apache.tuscany.sdo.util.resource.XMLStreamSerializer;
+import org.eclipse.emf.ecore.resource.Resource;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
+import commonj.sdo.helper.TypeHelper;
+import commonj.sdo.helper.XMLDocument;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class XMLStreamHelperImpl implements XMLStreamHelper
+{
+ TypeHelperImpl typeHelper;
+
+ public XMLStreamHelperImpl(TypeHelper typeHelper)
+ {
+ this.typeHelper = (TypeHelperImpl)typeHelper;
+ }
+
+ public XMLDocument load(XMLStreamReader reader) throws XMLStreamException, IllegalStateException
+ {
+ if (reader.getEventType() != XMLStreamConstants.START_DOCUMENT)
+ throw new IllegalStateException();
+
+ return loadDocument(reader, null);
+ }
+
+ public void save(XMLDocument document, XMLStreamWriter writer) throws XMLStreamException
+ {
+ XMLStreamReader reader = createXMLStreamReader(document);
+ new XMLStreamSerializer().serialize(reader, writer);
+ }
+
+ public XMLStreamReader createXMLStreamReader(XMLDocument document) throws XMLStreamException
+ {
+ XMLStreamReader reader = new DataObjectXMLStreamReader(document.getRootObject(), document.getRootElementURI(), document.getRootElementName(), typeHelper);
+ // Wrap the reader so that its position will be START_ELEMENT
+ return new XMLDocumentStreamReader(reader);
+
+ }
+
+ public final DataObject loadObject(XMLStreamReader reader, Map options) throws XMLStreamException, IllegalStateException
+ {
+ if (reader.getEventType() != XMLStreamConstants.START_ELEMENT)
+ throw new IllegalStateException();
+
+ // StAX2SAXAdapter won't produce START_DOCUMENT if the reader is posisitioned at START_ELEMENT and the EMF loader will fail
+ // Wrap the reader so it represents a document
+ reader = new XMLDocumentStreamReader(reader);
+
+ return loadDocument(reader, options).getRootObject();
+ }
+
+ public DataObject loadObject(XMLStreamReader reader) throws XMLStreamException, IllegalStateException
+ {
+ return loadObject(reader, null);
+ }
+
+ public void saveObject(DataObject sdo, XMLStreamWriter writer) throws XMLStreamException
+ {
+ XMLStreamReader reader = createXMLStreamReader(sdo);
+ new XMLStreamSerializer().serialize(new XMLDocumentStreamReader(reader), writer);
+ }
+
+ public XMLStreamReader createXMLStreamReader(DataObject dataObject)
+ {
+ String rootElementURI;
+ String rootElementName;
+
+ Property property = dataObject.getContainmentProperty();
+ if (property != null)
+ {
+ rootElementName = property.getName();
+ rootElementURI = property.getType().getURI();
+ }
+ else
+ {
+ rootElementName = dataObject.getType().getName();
+ rootElementURI = dataObject.getType().getURI();
+ }
+
+ return new DataObjectXMLStreamReader(dataObject, rootElementURI, rootElementName, typeHelper);
+ }
+
+ protected XMLDocument loadDocument(XMLStreamReader reader, Map options) throws XMLStreamException
+ {
+ try {
+ XMLDocumentImpl document = new XMLDocumentImpl(typeHelper.extendedMetaData, null);
+ document.load(reader, options);
+ return document;
+ }
+ catch (Exception e) {
+ if (e instanceof Resource.IOWrappedException)
+ {
+ Resource.IOWrappedException ioe = (Resource.IOWrappedException)e;
+ if (ioe.getWrappedException() instanceof XMLStreamException)
+ {
+ throw (XMLStreamException)ioe.getWrappedException();
+ }
+ }
+ throw new RuntimeException(e); // ????
+ }
+ }
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/XSDHelperImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/XSDHelperImpl.java
new file mode 100644
index 0000000000..79e23881e4
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/XSDHelperImpl.java
@@ -0,0 +1,301 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.helper;
+
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.io.Reader;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.apache.tuscany.sdo.impl.DynamicDataObjectImpl;
+import org.apache.tuscany.sdo.util.DataObjectUtil;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EModelElement;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.ecore.util.ExtendedMetaData;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.ecore.XSDEcoreBuilder;
+import org.eclipse.xsd.util.XSDResourceImpl;
+import org.xml.sax.InputSource;
+
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+import commonj.sdo.helper.TypeHelper;
+import commonj.sdo.helper.XSDHelper;
+
+
+/**
+ * Provides access to additional information when the
+ * Type or Property is defined by an XML Schema (XSD).
+ * Methods return null/false otherwise or if the information is unavailable.
+ * Defines Types from an XSD.
+ */
+public class XSDHelperImpl implements XSDHelper
+{
+ protected boolean extensibleNamespaces = false;
+ protected XSDEcoreBuilder ecoreBuilder;
+ protected ExtendedMetaData extendedMetaData;
+
+ public XSDHelperImpl(ExtendedMetaData extendedMetaData, String redefineBuiltIn, boolean extensibleNamespaces)
+ {
+ this.extendedMetaData = extendedMetaData;
+ this.extensibleNamespaces = extensibleNamespaces;
+ ecoreBuilder = new SDOXSDEcoreBuilder(extendedMetaData, extensibleNamespaces);
+
+ // Add the built-in models to the targetNamespaceToEPackageMap so they can't be (re)defined/overridden
+ for (Iterator iter = TypeHelperImpl.getBuiltInModels().iterator(); iter.hasNext(); ) {
+ EPackage ePackage = (EPackage)iter.next();
+ ecoreBuilder.getTargetNamespaceToEPackageMap().put(ePackage.getNsURI(), ePackage);
+ }
+
+ if (redefineBuiltIn != null) { // Redefining/regenerating this built-in model
+ ecoreBuilder.getTargetNamespaceToEPackageMap().remove(redefineBuiltIn);
+ }
+ }
+
+ public XSDHelperImpl(ExtendedMetaData extendedMetaData, String redefineBuiltIn)
+ {
+ this(extendedMetaData, redefineBuiltIn, false);
+ }
+
+ public XSDHelperImpl(TypeHelper typeHelper, boolean extensibleNamespaces)
+ {
+ this(((TypeHelperImpl)typeHelper).extendedMetaData, null, extensibleNamespaces);
+ }
+
+ public String getLocalName(Type type)
+ {
+ return extendedMetaData.getName((EClassifier)type);
+ }
+
+ public String getLocalName(Property property)
+ {
+ return extendedMetaData.getName((EStructuralFeature)property);
+ }
+
+ public String getNamespaceURI(Property property)
+ {
+ return extendedMetaData.getNamespace((EStructuralFeature)property);
+ }
+
+ public boolean isAttribute(Property property)
+ {
+ return extendedMetaData.getFeatureKind((EStructuralFeature)property) == ExtendedMetaData.ATTRIBUTE_FEATURE;
+ }
+
+ public boolean isElement(Property property)
+ {
+ return extendedMetaData.getFeatureKind((EStructuralFeature)property) == ExtendedMetaData.ELEMENT_FEATURE;
+ }
+
+ public boolean isMixed(Type type)
+ {
+ if (type instanceof EClass)
+ {
+ return extendedMetaData.getContentKind((EClass)type) == ExtendedMetaData.MIXED_CONTENT;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ public boolean isXSD(Type type)
+ {
+ return ((EModelElement)type).getEAnnotation(ExtendedMetaData.ANNOTATION_URI) != null;
+ }
+
+ public Property getGlobalProperty(String uri, String propertyName, boolean isElement)
+ {
+ if (isElement)
+ {
+ return (Property)extendedMetaData.getElement(uri, propertyName);
+ }
+ else
+ {
+ return (Property)extendedMetaData.getAttribute(uri, propertyName);
+ }
+ }
+
+ public String getAppinfo(Type type, String source)
+ {
+ return getAppinfo((EModelElement)type, source);
+ }
+
+ public String getAppinfo(Property property, String source)
+ {
+ return getAppinfo((EModelElement)property, source);
+ }
+
+ protected String getAppinfo(EModelElement eModelElement, String source)
+ {
+ return (String)eModelElement.getEAnnotation(source).getDetails().get("appinfo");
+ }
+
+ public List /*Type*/define(String xsd)
+ {
+ InputStream inputStream = new ByteArrayInputStream(xsd.getBytes());
+ return define(inputStream, "*.xsd");
+ }
+
+ public List /*Type*/define(Reader xsdReader, String schemaLocation)
+ {
+ InputSource inputSource = new InputSource(xsdReader);
+ return define(inputSource, schemaLocation);
+
+ }
+
+ public List /*Type*/define(InputStream xsdInputStream, String schemaLocation)
+ {
+ InputSource inputSource = new InputSource(xsdInputStream);
+ return define(inputSource, schemaLocation);
+ }
+
+ protected List /*Type*/define(InputSource inputSource, String schemaLocation)
+ {
+ try
+ {
+ ResourceSet resourceSet = DataObjectUtil.createResourceSet();
+ Resource model = resourceSet.createResource(URI.createURI(schemaLocation != null ? schemaLocation : "null.xsd"));
+ ((XSDResourceImpl)model).load(inputSource, null);
+
+ List newTypes = new ArrayList();
+ for (Iterator schemaIter = model.getContents().iterator(); schemaIter.hasNext(); )
+ {
+ XSDSchema schema = (XSDSchema)schemaIter.next();
+
+ EPackage ePackage = extendedMetaData.getPackage(schema.getTargetNamespace());
+ if (extensibleNamespaces || ePackage == null || TypeHelperImpl.getBuiltInModels().contains(ePackage))
+ {
+ Collection originalEPackages = new HashSet(ecoreBuilder.getTargetNamespaceToEPackageMap().values());
+ ecoreBuilder.generate(schema);
+ Collection newEPackages = ecoreBuilder.getTargetNamespaceToEPackageMap().values();
+
+ for (Iterator iter = newEPackages.iterator(); iter.hasNext();)
+ {
+ EPackage currentPackage = (EPackage)iter.next();
+ if (!originalEPackages.contains(currentPackage))
+ {
+ currentPackage.setEFactoryInstance(new DynamicDataObjectImpl.FactoryImpl());
+ EcoreUtil.freeze(currentPackage);
+ newTypes.addAll(currentPackage.getEClassifiers());
+ }
+ }
+ }
+ }
+
+ return newTypes;
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ throw new IllegalArgumentException(e.getMessage());
+ }
+ }
+
+ public String generate(List /*Type*/types) throws IllegalArgumentException
+ {
+ return generate(types, new Hashtable());
+ }
+
+ public String generate(List /*Type*/types, Map /*String, String*/namespaceToSchemaLocation) throws IllegalArgumentException
+ {
+ if ( types != null && !types.isEmpty() )
+ {
+ Hashtable schemaMap = new Hashtable();
+ Hashtable nsPrefixMap = new Hashtable();
+ TypeTable typeTable = new TypeTable();
+
+ SchemaBuilder schemaBuilder = new SchemaBuilder( schemaMap,
+ nsPrefixMap,
+ typeTable,
+ namespaceToSchemaLocation);
+
+ Iterator iterator = types.iterator();
+ Type dataType = null;
+
+ try
+ {
+ while ( iterator.hasNext() )
+ {
+ dataType = (Type)iterator.next();
+ schemaBuilder.buildSchema(dataType);
+ }
+
+ XSDSchema xmlSchema = null;
+ iterator = schemaMap.values().iterator();
+ StringWriter writer = new StringWriter();
+
+ TransformerFactory transformerFactory = TransformerFactory.newInstance();
+ Transformer transformer = transformerFactory.newTransformer();
+ transformer.setOutputProperty(OutputKeys.INDENT, "yes");
+ transformer.setOutputProperty(OutputKeys.METHOD, "xml");
+ transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
+
+ while ( iterator.hasNext() )
+ {
+ xmlSchema = (XSDSchema)iterator.next();
+
+ if(xmlSchema.getElement() == null)
+ {
+ xmlSchema.updateElement();
+ }
+
+ transformer.transform(new DOMSource(xmlSchema.getElement().getOwnerDocument()),
+ new StreamResult(writer));
+ }
+ writer.close();
+ return writer.getBuffer().toString();
+ }
+ catch ( Exception e )
+ {
+ //System.out.println("Unable to generate schema due to ..." + e);
+ //e.printStackTrace();
+ throw new IllegalArgumentException(e.getMessage());
+ }
+ }
+ else
+ {
+ //System.out.println("No SDO Types to generate schema ...");
+ return "";
+ }
+ }
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/AnyTypeDataObjectImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/AnyTypeDataObjectImpl.java
new file mode 100644
index 0000000000..b7d22c3be0
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/AnyTypeDataObjectImpl.java
@@ -0,0 +1,299 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.impl;
+
+import org.apache.tuscany.sdo.AnyTypeDataObject;
+import org.apache.tuscany.sdo.SDOPackage;
+import org.apache.tuscany.sdo.util.BasicSequence;
+import org.eclipse.emf.common.notify.NotificationChain;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+import org.eclipse.emf.ecore.util.BasicFeatureMap;
+import org.eclipse.emf.ecore.util.FeatureMap;
+import org.eclipse.emf.ecore.util.InternalEList;
+import org.eclipse.emf.ecore.xml.type.AnyType;
+import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>EData Object Any Type</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.apache.tuscany.sdo.impl.AnyTypeDataObjectImpl#getMixed <em>Mixed</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.impl.AnyTypeDataObjectImpl#getAny <em>Any</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.impl.AnyTypeDataObjectImpl#getAnyAttribute <em>Any Attribute</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class AnyTypeDataObjectImpl extends DataObjectImpl implements AnyTypeDataObject
+{
+ /**
+ * The cached value of the '{@link #getMixed() <em>Mixed</em>}' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getMixed()
+ * @generated
+ * @ordered
+ */
+ protected FeatureMap mixed = null;
+
+ /**
+ * The cached value of the '{@link #getAnyAttribute() <em>Any Attribute</em>}' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getAnyAttribute()
+ * @generated
+ * @ordered
+ */
+ protected FeatureMap anyAttribute = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected AnyTypeDataObjectImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EClass eStaticClass()
+ {
+ return SDOPackage.eINSTANCE.getAnyTypeDataObject();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public FeatureMap getMixed()
+ {
+ if (mixed == null)
+ {
+ //mixed = new BasicFeatureMap(this, SDOPackage.ANY_TYPE_DATA_OBJECT__MIXED);
+ mixed = new BasicSequence(new BasicFeatureMap(this, SDOPackage.ANY_TYPE_DATA_OBJECT__MIXED)).featureMap();
+ }
+ return mixed;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public FeatureMap getAny()
+ {
+ //return (FeatureMap)((FeatureMap)getMixed()).list(XMLTypePackage.eINSTANCE.getAnyType_Any());
+ return new BasicSequence((FeatureMap.Internal)((FeatureMap)getMixed()).list(XMLTypePackage.eINSTANCE.getAnyType_Any())).featureMap();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public FeatureMap getAnyAttribute()
+ {
+ if (anyAttribute == null)
+ {
+ //anyAttribute = new BasicFeatureMap(this, SDOPackage.ANY_TYPE_DATA_OBJECT__ANY_ATTRIBUTE);
+ anyAttribute = new BasicSequence(new BasicFeatureMap(this, SDOPackage.ANY_TYPE_DATA_OBJECT__ANY_ATTRIBUTE)).featureMap();
+ }
+ return anyAttribute;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs)
+ {
+ if (featureID >= 0)
+ {
+ switch (eDerivedStructuralFeatureID(featureID, baseClass))
+ {
+ case SDOPackage.ANY_TYPE_DATA_OBJECT__MIXED:
+ return ((InternalEList)getMixed()).basicRemove(otherEnd, msgs);
+ case SDOPackage.ANY_TYPE_DATA_OBJECT__ANY:
+ return ((InternalEList)getAny()).basicRemove(otherEnd, msgs);
+ case SDOPackage.ANY_TYPE_DATA_OBJECT__ANY_ATTRIBUTE:
+ return ((InternalEList)getAnyAttribute()).basicRemove(otherEnd, msgs);
+ default:
+ return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
+ }
+ }
+ return eBasicSetContainer(null, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object eGet(int featureID, boolean resolve, boolean coreType)
+ {
+ switch (featureID)
+ {
+ case SDOPackage.ANY_TYPE_DATA_OBJECT__MIXED:
+ if (coreType) return getMixed();
+ return ((FeatureMap.Internal)getMixed()).getWrapper();
+ case SDOPackage.ANY_TYPE_DATA_OBJECT__ANY:
+ if (coreType) return getAny();
+ return ((FeatureMap.Internal)getAny()).getWrapper();
+ case SDOPackage.ANY_TYPE_DATA_OBJECT__ANY_ATTRIBUTE:
+ if (coreType) return getAnyAttribute();
+ return ((FeatureMap.Internal)getAnyAttribute()).getWrapper();
+ }
+ return eDynamicGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void eSet(int featureID, Object newValue)
+ {
+ switch (featureID)
+ {
+ case SDOPackage.ANY_TYPE_DATA_OBJECT__MIXED:
+ ((FeatureMap.Internal)getMixed()).set(newValue);
+ return;
+ case SDOPackage.ANY_TYPE_DATA_OBJECT__ANY:
+ ((FeatureMap.Internal)getAny()).set(newValue);
+ return;
+ case SDOPackage.ANY_TYPE_DATA_OBJECT__ANY_ATTRIBUTE:
+ ((FeatureMap.Internal)getAnyAttribute()).set(newValue);
+ return;
+ }
+ eDynamicSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void eUnset(int featureID)
+ {
+ switch (featureID)
+ {
+ case SDOPackage.ANY_TYPE_DATA_OBJECT__MIXED:
+ getMixed().clear();
+ return;
+ case SDOPackage.ANY_TYPE_DATA_OBJECT__ANY:
+ getAny().clear();
+ return;
+ case SDOPackage.ANY_TYPE_DATA_OBJECT__ANY_ATTRIBUTE:
+ getAnyAttribute().clear();
+ return;
+ }
+ eDynamicUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean eIsSet(int featureID)
+ {
+ switch (featureID)
+ {
+ case SDOPackage.ANY_TYPE_DATA_OBJECT__MIXED:
+ return mixed != null && !mixed.isEmpty();
+ case SDOPackage.ANY_TYPE_DATA_OBJECT__ANY:
+ return !getAny().isEmpty();
+ case SDOPackage.ANY_TYPE_DATA_OBJECT__ANY_ATTRIBUTE:
+ return anyAttribute != null && !anyAttribute.isEmpty();
+ }
+ return eDynamicIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass)
+ {
+ if (baseClass == AnyType.class)
+ {
+ switch (derivedFeatureID)
+ {
+ case SDOPackage.ANY_TYPE_DATA_OBJECT__MIXED: return XMLTypePackage.ANY_TYPE__MIXED;
+ case SDOPackage.ANY_TYPE_DATA_OBJECT__ANY: return XMLTypePackage.ANY_TYPE__ANY;
+ case SDOPackage.ANY_TYPE_DATA_OBJECT__ANY_ATTRIBUTE: return XMLTypePackage.ANY_TYPE__ANY_ATTRIBUTE;
+ default: return -1;
+ }
+ }
+ return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass)
+ {
+ if (baseClass == AnyType.class)
+ {
+ switch (baseFeatureID)
+ {
+ case XMLTypePackage.ANY_TYPE__MIXED: return SDOPackage.ANY_TYPE_DATA_OBJECT__MIXED;
+ case XMLTypePackage.ANY_TYPE__ANY: return SDOPackage.ANY_TYPE_DATA_OBJECT__ANY;
+ case XMLTypePackage.ANY_TYPE__ANY_ATTRIBUTE: return SDOPackage.ANY_TYPE_DATA_OBJECT__ANY_ATTRIBUTE;
+ default: return -1;
+ }
+ }
+ return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString()
+ {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (mixed: ");
+ result.append(mixed);
+ result.append(", anyAttribute: ");
+ result.append(anyAttribute);
+ result.append(')');
+ return result.toString();
+ }
+
+} //EDataObjectAnyTypeImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/AttributeImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/AttributeImpl.java
new file mode 100644
index 0000000000..7c917b4dd2
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/AttributeImpl.java
@@ -0,0 +1,824 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.impl;
+
+import java.util.List;
+
+import org.apache.tuscany.sdo.SDOPackage;
+import org.apache.tuscany.sdo.util.BasicSequence;
+import org.apache.tuscany.sdo.util.DataObjectUtil;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.InternalEObject;
+import org.eclipse.emf.ecore.impl.EAttributeImpl;
+import org.eclipse.emf.ecore.util.FeatureMap;
+
+import commonj.sdo.Property;
+import commonj.sdo.Sequence;
+import commonj.sdo.Type;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Attribute</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * </p>
+ *
+ * @generated
+ */
+public class AttributeImpl extends EAttributeImpl implements Property, org.apache.tuscany.sdo.model.Property/*, DataObject*/
+{
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected AttributeImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ protected EClass eStaticClass()
+ {
+ return SDOPackage.eINSTANCE.getAttribute();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Object getDefault()
+ {
+ return getDefaultValue();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public boolean isReadOnly()
+ {
+ //return "true".equals(EcoreUtil.getAnnotation(this, "commonj.sdo", "readOnly"));
+ return !isChangeable(); //TODO semantics don't exactly match?
+ }
+
+ /**
+ * Single-valued SDO properties behave as EMF unsettable, multi-valued properties as EMF !unsettable
+ */
+ public boolean isUnsettable()
+ {
+ return !isMany();
+ }
+
+ public boolean isUnique()
+ {
+ return false;
+ }
+
+ protected List aliasNames = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public List getAliasNames()
+ {
+ if (aliasNames == null)
+ {
+ aliasNames = DataObjectUtil.getAliasNames(this);
+ }
+ return aliasNames;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Type getType()
+ {
+ return (Type)getEType();
+ /*
+ EClassifier eType = getEType();
+ //FB More temporary hacks
+ return eType instanceof Type ? (Type)getEType() : null;
+ */
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Type getContainingType()
+ {
+ return (Type)getEContainingClass();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Property getOpposite()
+ {
+ return null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public boolean isContainment()
+ {
+ return false;
+ }
+
+ protected EStructuralFeature.Internal.SettingDelegate createFeatureMapSettingDelegate()
+ {
+ return new InternalSettingDelegateSequence(this);
+ }
+
+ public static class InternalSettingDelegateSequence extends InternalSettingDelegateMany
+ {
+ InternalSettingDelegateSequence(EStructuralFeature feature)
+ {
+ super(InternalSettingDelegateMany.FEATURE_MAP, feature);
+ }
+
+ protected EStructuralFeature.Setting createDynamicSetting(InternalEObject owner)
+ {
+ FeatureMap.Internal featureMap = (FeatureMap.Internal)super.createDynamicSetting(owner);
+ new BasicSequence(featureMap);
+ return featureMap;
+ }
+ }
+
+ public boolean isNullable()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean isOpenContent()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public List getInstanceProperties() {
+ return DataObjectUtil.getMetaObjectInstanceProperties(this);
+ }
+
+ public Object get(Property property) {
+ return DataObjectUtil.getMetaObjectInstanceProperty(this, property);
+ }
+
+ /////////////////////////////////////////////////////////////////////////////////////////////////////////
+ // org.apache.tuscany.sdo.model.Property methods
+ /////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+ public List getAliasName() {
+ return this.getAliasNames();
+ }
+
+ public Sequence getAny() {
+ throw new UnsupportedOperationException();
+ }
+
+ public void unsetContainment() {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public boolean isSetContainment() {
+ return false;
+ }
+
+ public void setMany(boolean value) {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public void unsetMany() {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public boolean isSetMany() {
+ return isMany();
+ }
+
+ public void setReadOnly(boolean value) {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public void unsetReadOnly() {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public boolean isSetReadOnly() {
+ return isReadOnly();
+ }
+
+ public org.apache.tuscany.sdo.model.Type getType_() {
+ return (org.apache.tuscany.sdo.model.Type)getType();
+ }
+
+ public void setType(org.apache.tuscany.sdo.model.Type value) {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public Sequence getAnyAttribute() {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getDefault_() {
+ return (String) this.getDefault();
+ }
+
+ public void setDefault_(String value) {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public org.apache.tuscany.sdo.model.Property getOpposite_() {
+ return (org.apache.tuscany.sdo.model.Property) getOpposite();
+ }
+
+ public void setOpposite_(org.apache.tuscany.sdo.model.Property value) {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public void setContainment(boolean value) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setNullable(boolean value) {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public void unsetNullable() {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public boolean isSetNullable() {
+ return isUnsettable();
+ }
+
+ public void unsetName()
+ {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public boolean isSetName()
+ {
+ return true;
+ }
+
+ public void unsetOpposite()
+ {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public boolean isSetOpposite()
+ {
+ return getOpposite() != null;
+ }
+
+ public void unsetType()
+ {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public boolean isSetType()
+ {
+ return true;
+ }
+
+ public void unsetDefault()
+ {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public boolean isSetDefault()
+ {
+ return getDefault() != null;
+ }
+
+
+ /////////////////////////////////////////////////////////////////////////////////////////////////////////
+ // DataObject method implementations
+ /////////////////////////////////////////////////////////////////////////////////////////////////////////
+ /*
+ public Object get(int propertyIndex) {
+ return DataObjectUtil.get(this, propertyIndex);
+ }
+
+ public void set(int propertyIndex, Object value) {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public boolean isSet(int propertyIndex) {
+ return DataObjectUtil.isSet(this, propertyIndex);
+ }
+
+ public void unset(int propertyIndex) {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public Object get(Property property) {
+ return DataObjectUtil.get(this, ((EStructuralFeature)property).getFeatureID());
+ }
+
+ public void set(Property property, Object value) {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public boolean isSet(Property property) {
+ return DataObjectUtil.isSet(this, ((EStructuralFeature)property).getFeatureID());
+ }
+
+ public void unset(Property property) {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public DataObject getContainer() {
+ return (DataObject)eContainer();
+ }
+
+ public Property getContainmentProperty() {
+ return (Property)eContainmentFeature();
+ }
+
+ // Remaining DataObject methods are (will be) implemented as straight delegation to DataObjectUtil
+
+ public Object get(String path) {
+ return DataObjectUtil.get(this, path);
+ }
+
+ public void set(String path, Object value) {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public boolean isSet(String path) {
+ return DataObjectUtil.isSet(this, path);
+ }
+
+ public void unset(String path) {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public boolean getBoolean(String path) {
+ return DataObjectUtil.getBoolean(get(path));
+ }
+
+ public byte getByte(String path) {
+ return DataObjectUtil.getByte(get(path));
+ }
+
+ public char getChar(String path) {
+ return DataObjectUtil.getChar(get(path));
+ }
+
+ public double getDouble(String path) {
+ return DataObjectUtil.getDouble(get(path));
+ }
+
+ public float getFloat(String path) {
+ return DataObjectUtil.getFloat(get(path));
+ }
+
+ public int getInt(String path) {
+ return DataObjectUtil.getInt(get(path));
+ }
+
+ public long getLong(String path) {
+ return DataObjectUtil.getLong(get(path));
+ }
+
+ public short getShort(String path) {
+ return DataObjectUtil.getShort(get(path));
+ }
+
+ public byte[] getBytes(String path) {
+ return DataObjectUtil.getBytes(get(path));
+ }
+
+ public BigDecimal getBigDecimal(String path) {
+ return DataObjectUtil.getBigDecimal(get(path));
+ }
+
+ public BigInteger getBigInteger(String path) {
+ return DataObjectUtil.getBigInteger(get(path));
+ }
+
+ public DataObject getDataObject(String path) {
+ return (DataObject)get(path);
+ }
+
+ public Date getDate(String path) {
+ return DataObjectUtil.getDate(get(path));
+ }
+
+ public String getString(String path) {
+ return DataObjectUtil.getString(get(path));
+ }
+
+ public List getList(String path) {
+ return (List)get(path);
+ }
+
+ public Sequence getSequence(String path) {
+ return (Sequence)get(path);
+ }
+
+ public void setBoolean(String path, boolean value) {
+ set(path, new Boolean(value));
+ }
+
+ public void setByte(String path, byte value) {
+ set(path, new Byte(value));
+ }
+
+ public void setChar(String path, char value) {
+ set(path, new Character(value));
+ }
+
+ public void setDouble(String path, double value) {
+ set(path, new Double(value));
+ }
+
+ public void setFloat(String path, float value) {
+ set(path, new Float(value));
+ }
+
+ public void setInt(String path, int value) {
+ set(path, new Integer(value));
+ }
+
+ public void setLong(String path, long value) {
+ set(path, new Long(value));
+ }
+
+ public void setShort(String path, short value) {
+ set(path, new Short(value));
+ }
+
+ public void setBytes(String path, byte[] value) {
+ set(path, value);
+ }
+
+ public void setBigDecimal(String path, BigDecimal value) {
+ set(path, value);
+ }
+
+ public void setBigInteger(String path, BigInteger value) {
+ set(path, value);
+ }
+
+ public void setDataObject(String path, DataObject value) {
+ set(path, value);
+ }
+
+ public void setDate(String path, Date value) {
+ set(path, value);
+ }
+
+ public void setString(String path, String value) {
+ set(path, value);
+ }
+
+ public void setList(String path, List value) {
+ set(path, value);
+ }
+
+ public boolean getBoolean(int propertyIndex) {
+ return DataObjectUtil.getBoolean(this, propertyIndex);
+ }
+
+ public byte getByte(int propertyIndex) {
+ return DataObjectUtil.getByte(this, propertyIndex);
+ }
+
+ public char getChar(int propertyIndex) {
+ return DataObjectUtil.getChar(this, propertyIndex);
+ }
+
+ public double getDouble(int propertyIndex) {
+ return DataObjectUtil.getDouble(this, propertyIndex);
+ }
+
+ public float getFloat(int propertyIndex) {
+ return DataObjectUtil.getFloat(this, propertyIndex);
+ }
+
+ public int getInt(int propertyIndex) {
+ return DataObjectUtil.getInt(this, propertyIndex);
+ }
+
+ public long getLong(int propertyIndex) {
+ return DataObjectUtil.getLong(this, propertyIndex);
+ }
+
+ public short getShort(int propertyIndex) {
+ return DataObjectUtil.getShort(this, propertyIndex);
+ }
+
+ public byte[] getBytes(int propertyIndex) {
+ return DataObjectUtil.getBytes(this, propertyIndex);
+ }
+
+ public BigDecimal getBigDecimal(int propertyIndex) {
+ return DataObjectUtil.getBigDecimal(this, propertyIndex);
+ }
+
+ public BigInteger getBigInteger(int propertyIndex) {
+ return DataObjectUtil.getBigInteger(this, propertyIndex);
+ }
+
+ public DataObject getDataObject(int propertyIndex) {
+ return DataObjectUtil.getDataObject(this, propertyIndex);
+ }
+
+ public Date getDate(int propertyIndex) {
+ return DataObjectUtil.getDate(this, propertyIndex);
+ }
+
+ public String getString(int propertyIndex) {
+ return DataObjectUtil.getString(this, propertyIndex);
+ }
+
+ public List getList(int propertyIndex) {
+ return DataObjectUtil.getList(this, propertyIndex);
+ }
+
+ public Sequence getSequence(int propertyIndex) {
+ return DataObjectUtil.getSequence(this, propertyIndex);
+ }
+
+ public void setBoolean(int propertyIndex, boolean value) {
+ set(propertyIndex, new Boolean(value));
+ }
+
+ public void setByte(int propertyIndex, byte value) {
+ set(propertyIndex, new Byte(value));
+ }
+
+ public void setChar(int propertyIndex, char value) {
+ set(propertyIndex, new Character(value));
+ }
+
+ public void setDouble(int propertyIndex, double value) {
+ set(propertyIndex, new Double(value));
+ }
+
+ public void setFloat(int propertyIndex, float value) {
+ set(propertyIndex, new Float(value));
+ }
+
+ public void setInt(int propertyIndex, int value) {
+ set(propertyIndex, new Integer(value));
+ }
+
+ public void setLong(int propertyIndex, long value) {
+ set(propertyIndex, new Long(value));
+ }
+
+ public void setShort(int propertyIndex, short value) {
+ set(propertyIndex, new Short(value));
+ }
+
+ public void setBytes(int propertyIndex, byte[] value) {
+ set(propertyIndex, value);
+ }
+
+ public void setBigDecimal(int propertyIndex, BigDecimal value) {
+ set(propertyIndex, value);
+ }
+
+ public void setBigInteger(int propertyIndex, BigInteger value) {
+ set(propertyIndex, value);
+ }
+
+ public void setDataObject(int propertyIndex, DataObject value) {
+ set(propertyIndex, value);
+ }
+
+ public void setDate(int propertyIndex, Date value) {
+ set(propertyIndex, value);
+ }
+
+ public void setString(int propertyIndex, String value) {
+ set(propertyIndex, value);
+ }
+
+ public void setList(int propertyIndex, List value) {
+ set(propertyIndex, value);
+ }
+
+ public boolean getBoolean(Property property) {
+ return DataObjectUtil.getBoolean(this, property);
+ }
+
+ public byte getByte(Property property) {
+ return DataObjectUtil.getByte(this, property);
+ }
+
+ public char getChar(Property property) {
+ return DataObjectUtil.getChar(this, property);
+ }
+
+ public double getDouble(Property property) {
+ return DataObjectUtil.getDouble(this, property);
+ }
+
+ public float getFloat(Property property) {
+ return DataObjectUtil.getFloat(this, property);
+ }
+
+ public int getInt(Property property) {
+ return DataObjectUtil.getInt(this, property);
+ }
+
+ public long getLong(Property property) {
+ return DataObjectUtil.getLong(this, property);
+ }
+
+ public short getShort(Property property) {
+ return DataObjectUtil.getShort(this, property);
+ }
+
+ public byte[] getBytes(Property property) {
+ return DataObjectUtil.getBytes(this, property);
+ }
+
+ public BigDecimal getBigDecimal(Property property) {
+ return DataObjectUtil.getBigDecimal(this, property);
+ }
+
+ public BigInteger getBigInteger(Property property) {
+ return DataObjectUtil.getBigInteger(this, property);
+ }
+
+ public DataObject getDataObject(Property property) {
+ return DataObjectUtil.getDataObject(this, property);
+ }
+
+ public Date getDate(Property property) {
+ return DataObjectUtil.getDate(this, property);
+ }
+
+ public String getString(Property property) {
+ return DataObjectUtil.getString(this, property);
+ }
+
+ public List getList(Property property) {
+ return DataObjectUtil.getList(this, property);
+ }
+
+ public Sequence getSequence(Property property) {
+ return DataObjectUtil.getSequence(this, property);
+ }
+
+ public void setBoolean(Property property, boolean value) {
+ set(property, new Boolean(value));
+ }
+
+ public void setByte(Property property, byte value) {
+ set(property, new Byte(value));
+ }
+
+ public void setChar(Property property, char value) {
+ set(property, new Character(value));
+ }
+
+ public void setDouble(Property property, double value) {
+ set(property, new Double(value));
+ }
+
+ public void setFloat(Property property, float value) {
+ set(property, new Float(value));
+ }
+
+ public void setInt(Property property, int value) {
+ set(property, new Integer(value));
+ }
+
+ public void setLong(Property property, long value) {
+ set(property, new Long(value));
+ }
+
+ public void setShort(Property property, short value) {
+ set(property, new Short(value));
+ }
+
+ public void setBytes(Property property, byte[] value) {
+ set(property, value);
+ }
+
+ public void setBigDecimal(Property property, BigDecimal value) {
+ set(property, value);
+ }
+
+ public void setBigInteger(Property property, BigInteger value) {
+ set(property, value);
+ }
+
+ public void setDataObject(Property property, DataObject value) {
+ set(property, value);
+ }
+
+ public void setDate(Property property, Date value) {
+ set(property, value);
+ }
+
+ public void setString(Property property, String value) {
+ set(property, value);
+ }
+
+ public void setList(Property property, List value) {
+ set(property, value);
+ }
+
+ public DataObject createDataObject(String propertyName) {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public DataObject createDataObject(int propertyIndex) {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public DataObject createDataObject(Property property) {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public DataObject createDataObject(String propertyName, String namespaceURI, String typeName) {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public DataObject createDataObject(int propertyIndex, String namespaceURI, String typeName) {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public DataObject createDataObject(Property property, Type type) {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public void delete() {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public DataGraph getDataGraph() {
+ return DataObjectUtil.getDataGraph(this);
+ }
+
+ public Sequence getSequence() {
+ EAttribute mixedFeature = BasicExtendedMetaData.INSTANCE.getMixedFeature(eClass());
+ return mixedFeature != null ? (Sequence)eGet(mixedFeature, true, false) : null;
+ }
+
+ public List getInstanceProperties() {
+ return DataObjectUtil.getInstanceProperties(this);
+ }
+
+ public DataObject getRootObject() {
+ return DataObjectUtil.getRootObject(this);
+ }
+
+ public ChangeSummary getChangeSummary() {
+ // TODO: implement this method
+ throw new UnsupportedOperationException();
+ }
+
+ public void detach() {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ //DataObjectUtil.detach(this);
+ }
+
+ public Property getProperty(String propertyName) {
+ return DataObjectUtil.getProperty(this, propertyName);
+ }
+ */
+
+} //AttributeImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/ChangeSummaryImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/ChangeSummaryImpl.java
new file mode 100644
index 0000000000..61b68cbc5b
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/ChangeSummaryImpl.java
@@ -0,0 +1,800 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.impl;
+
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.tuscany.sdo.SDOFactory;
+import org.apache.tuscany.sdo.SDOPackage;
+import org.apache.tuscany.sdo.util.BasicSequence;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.common.util.BasicEList;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.common.util.UniqueEList;
+import org.eclipse.emf.ecore.*;
+import org.eclipse.emf.ecore.change.ChangeDescription;
+import org.eclipse.emf.ecore.change.FeatureChange;
+import org.eclipse.emf.ecore.change.impl.ChangeDescriptionImpl;
+import org.eclipse.emf.ecore.change.util.ChangeRecorder;
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.util.*;
+
+import commonj.sdo.ChangeSummary;
+import commonj.sdo.DataGraph;
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
+import commonj.sdo.Sequence;
+
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>EChange Summary</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.apache.tuscany.sdo.impl.ChangeSummaryImpl#getEDataGraph <em>EData Graph</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class ChangeSummaryImpl extends ChangeDescriptionImpl implements ChangeSummary
+{
+ /**
+ * The cached value of the '{@link #getEDataGraph() <em>EData Graph</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getEDataGraph()
+ * @generated
+ * @ordered
+ */
+ protected DataGraph eDataGraph = null;
+
+ protected DataObject dataObject = null;
+ protected SDOChangeRecorder changeRecorder = null;
+
+ protected Set cachedDeletedObjects = null;
+ protected List cachedCreatedObjects = null;
+ protected HashMap cachedSDOObjectChanges = new HashMap();
+ protected boolean isStale = false;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ChangeSummaryImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EClass eStaticClass()
+ {
+ return SDOPackage.eINSTANCE.getChangeSummary();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public boolean isLogging()
+ {
+ return changeRecorder != null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public DataGraph getEDataGraph()
+ {
+ return eDataGraph;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetEDataGraph(DataGraph newEDataGraph, NotificationChain msgs)
+ {
+ DataGraph oldEDataGraph = eDataGraph;
+ eDataGraph = newEDataGraph;
+ if (eNotificationRequired())
+ {
+ ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SDOPackage.CHANGE_SUMMARY__EDATA_GRAPH, oldEDataGraph, newEDataGraph);
+ if (msgs == null) msgs = notification; else msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setEDataGraph(DataGraph newEDataGraph)
+ {
+ if (newEDataGraph != eDataGraph)
+ {
+ NotificationChain msgs = null;
+ if (eDataGraph != null)
+ msgs = ((InternalEObject)eDataGraph).eInverseRemove(this, SDOPackage.DATA_GRAPH__ECHANGE_SUMMARY, DataGraph.class, msgs);
+ if (newEDataGraph != null)
+ msgs = ((InternalEObject)newEDataGraph).eInverseAdd(this, SDOPackage.DATA_GRAPH__ECHANGE_SUMMARY, DataGraph.class, msgs);
+ msgs = basicSetEDataGraph(newEDataGraph, msgs);
+ if (msgs != null) msgs.dispatch();
+ }
+ else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, SDOPackage.CHANGE_SUMMARY__EDATA_GRAPH, newEDataGraph, newEDataGraph));
+ }
+
+ public DataObject getDataObject()
+ {
+ return dataObject;
+ }
+
+ public void setDataObject(DataObject newDataObject)
+ {
+ dataObject = newDataObject;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void beginLogging()
+ {
+ if (isLogging())
+ {
+ throw new IllegalStateException("Already logging");
+ }
+
+ getObjectsToAttach().clear();
+ getObjectChanges().clear();
+ getResourceChanges().clear();
+ oldContainmentInformation = null;
+
+ beginRecording();
+// if (eNotificationRequired())
+// eNotify(new ENotificationImpl(this, Notification.SET, SDOPackage.ECHANGE_SUMMARY__LOGGING, false, true));
+ }
+
+ /**
+ *
+ */
+ private void beginRecording() {
+ changeRecorder = new SDOChangeRecorder();
+ if (eDataGraph != null)
+ {
+ changeRecorder.beginRecording(Collections.singleton(((DataGraphImpl)eDataGraph).getRootResource()));
+ }
+ else if (dataObject != null)
+ {
+ changeRecorder.beginRecording(Collections.singleton(dataObject));
+ }
+ else
+ {
+ throw new IllegalStateException("ChangeSummary not attached to any data objects");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void resumeLogging()
+ {
+ if (isLogging())
+ {
+ throw new IllegalStateException("Already logging");
+ }
+
+ oldContainmentInformation = null;
+
+ beginRecording();
+// if (eNotificationRequired())
+// eNotify(new ENotificationImpl(this, Notification.SET, SDOPackage.ECHANGE_SUMMARY__LOGGING, false, true));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs)
+ {
+ if (featureID >= 0)
+ {
+ switch (eDerivedStructuralFeatureID(featureID, baseClass))
+ {
+ case SDOPackage.CHANGE_SUMMARY__EDATA_GRAPH:
+ if (eDataGraph != null)
+ msgs = ((InternalEObject)eDataGraph).eInverseRemove(this, SDOPackage.DATA_GRAPH__ECHANGE_SUMMARY, DataGraph.class, msgs);
+ return basicSetEDataGraph((DataGraph)otherEnd, msgs);
+ default:
+ return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
+ }
+ }
+ if (eInternalContainer() != null)
+ msgs = eBasicRemoveFromContainer(msgs);
+ return eBasicSetContainer(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs)
+ {
+ if (featureID >= 0)
+ {
+ switch (eDerivedStructuralFeatureID(featureID, baseClass))
+ {
+ case SDOPackage.CHANGE_SUMMARY__OBJECT_CHANGES:
+ return ((InternalEList)getObjectChanges()).basicRemove(otherEnd, msgs);
+ case SDOPackage.CHANGE_SUMMARY__OBJECTS_TO_ATTACH:
+ return ((InternalEList)getObjectsToAttach()).basicRemove(otherEnd, msgs);
+ case SDOPackage.CHANGE_SUMMARY__RESOURCE_CHANGES:
+ return ((InternalEList)getResourceChanges()).basicRemove(otherEnd, msgs);
+ case SDOPackage.CHANGE_SUMMARY__EDATA_GRAPH:
+ return basicSetEDataGraph(null, msgs);
+ default:
+ return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
+ }
+ }
+ return eBasicSetContainer(null, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object eGet(int featureID, boolean resolve, boolean coreType)
+ {
+ switch (featureID)
+ {
+ case SDOPackage.CHANGE_SUMMARY__OBJECT_CHANGES:
+ if (coreType) return getObjectChanges();
+ else return getObjectChanges().map();
+ case SDOPackage.CHANGE_SUMMARY__OBJECTS_TO_DETACH:
+ return getObjectsToDetach();
+ case SDOPackage.CHANGE_SUMMARY__OBJECTS_TO_ATTACH:
+ return getObjectsToAttach();
+ case SDOPackage.CHANGE_SUMMARY__RESOURCE_CHANGES:
+ return getResourceChanges();
+ case SDOPackage.CHANGE_SUMMARY__EDATA_GRAPH:
+ return getEDataGraph();
+// case SDOPackage.CHANGE_SUMMARY__EDATA_OBJECT:
+// return getEDataObject();
+ }
+ return eDynamicGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void eSet(int featureID, Object newValue)
+ {
+ switch (featureID)
+ {
+ case SDOPackage.CHANGE_SUMMARY__OBJECT_CHANGES:
+ ((EStructuralFeature.Setting)getObjectChanges()).set(newValue);
+ return;
+ case SDOPackage.CHANGE_SUMMARY__OBJECTS_TO_DETACH:
+ getObjectsToDetach().clear();
+ getObjectsToDetach().addAll((Collection)newValue);
+ return;
+ case SDOPackage.CHANGE_SUMMARY__OBJECTS_TO_ATTACH:
+ getObjectsToAttach().clear();
+ getObjectsToAttach().addAll((Collection)newValue);
+ return;
+ case SDOPackage.CHANGE_SUMMARY__RESOURCE_CHANGES:
+ getResourceChanges().clear();
+ getResourceChanges().addAll((Collection)newValue);
+ return;
+ case SDOPackage.CHANGE_SUMMARY__EDATA_GRAPH:
+ setEDataGraph((DataGraph)newValue);
+ return;
+ }
+ eDynamicSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void eUnset(int featureID)
+ {
+ switch (featureID)
+ {
+ case SDOPackage.CHANGE_SUMMARY__OBJECT_CHANGES:
+ getObjectChanges().clear();
+ return;
+ case SDOPackage.CHANGE_SUMMARY__OBJECTS_TO_DETACH:
+ getObjectsToDetach().clear();
+ return;
+ case SDOPackage.CHANGE_SUMMARY__OBJECTS_TO_ATTACH:
+ getObjectsToAttach().clear();
+ return;
+ case SDOPackage.CHANGE_SUMMARY__RESOURCE_CHANGES:
+ getResourceChanges().clear();
+ return;
+ case SDOPackage.CHANGE_SUMMARY__EDATA_GRAPH:
+ setEDataGraph((DataGraph)null);
+ return;
+ }
+ eDynamicUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean eIsSet(int featureID)
+ {
+ switch (featureID)
+ {
+ case SDOPackage.CHANGE_SUMMARY__OBJECT_CHANGES:
+ return objectChanges != null && !objectChanges.isEmpty();
+ case SDOPackage.CHANGE_SUMMARY__OBJECTS_TO_DETACH:
+ return objectsToDetach != null && !objectsToDetach.isEmpty();
+ case SDOPackage.CHANGE_SUMMARY__OBJECTS_TO_ATTACH:
+ return objectsToAttach != null && !objectsToAttach.isEmpty();
+ case SDOPackage.CHANGE_SUMMARY__RESOURCE_CHANGES:
+ return resourceChanges != null && !resourceChanges.isEmpty();
+ case SDOPackage.CHANGE_SUMMARY__EDATA_GRAPH:
+ return eDataGraph != null;
+ }
+ return eDynamicIsSet(featureID);
+ }
+
+ protected void uncache()
+ {
+ cachedDeletedObjects = null;
+ cachedCreatedObjects = null;
+ cachedSDOObjectChanges.clear();
+ }
+
+ protected class SDOChangeRecorder extends ChangeRecorder
+ {
+ public SDOChangeRecorder()
+ {
+ super();
+ }
+
+ public void beginRecording(ChangeDescription changeDescription, Collection rootObjects)
+ {
+ uncache();
+ super.beginRecording(changeDescription, rootObjects);
+ }
+
+ protected ChangeDescription createChangeDescription()
+ {
+ return ChangeSummaryImpl.this;
+ }
+
+ protected FeatureChange createFeatureChange(EObject eObject, EStructuralFeature eStructuralFeature, Object value, boolean isSet)
+ {
+ Property property = (Property)eStructuralFeature;
+ if (property.isReadOnly())
+ {
+ if (((DataObject)eObject).getDataGraph() != null)
+ {
+ throw
+ new IllegalStateException
+ ("The property '" + property.getName() + "' of type '" +
+ property.getContainingType().getName() + "' is read only");
+ }
+ }
+ return (FeatureChange)SDOFactory.eINSTANCE.createChangeSummarySetting(eStructuralFeature, value, isSet);
+ }
+
+ protected void consolidateChanges()
+ {
+ uncache();
+ isStale = false;
+
+ // TODO remove this fixup when https://bugs.eclipse.org/bugs/show_bug.cgi?id=177235 is
+ // available to us (i.e. we update to EMF 2.3) -- see Tuscany-1164
+ boolean isUncontainedRoot = dataObject != null
+ && ((EObject)dataObject).eContainer() == null
+ && ((EObject)dataObject).eResource() == null;
+
+ super.consolidateChanges();
+
+ if(isUncontainedRoot && changeDescription.getObjectsToAttach().contains(dataObject)) {
+ changeDescription.getObjectsToAttach().remove(dataObject);
+ }
+
+ }
+
+ protected void addAdapter(Notifier notifier)
+ {
+ if (!loadingTargets) return; // Optimize ChangeSummary to not record changes in newly created DOs
+
+ if (notifier instanceof DataObjectImpl)
+ ((DataObjectImpl)notifier).setChangeRecorder(this);
+ else
+ super.addAdapter(notifier);
+ }
+
+ protected void removeAdapter(Notifier notifier)
+ {
+ if (notifier instanceof DataObjectImpl)
+ ((DataObjectImpl)notifier).setChangeRecorder(null);
+ else
+ super.removeAdapter(notifier);
+ }
+
+ public void notifyChanged(Notification notification)
+ {
+ super.notifyChanged(notification);
+
+ Object notifier = notification.getNotifier();
+ if (notifier instanceof EObject)
+ {
+ cachedSDOObjectChanges.remove(notifier);
+ Object feature = notification.getFeature();
+ if (feature instanceof Property && ((Property)feature).isContainment())
+ {
+ cachedCreatedObjects = null;
+ cachedDeletedObjects = null;
+ oldContainmentInformation = null;
+ }
+ isStale = true;
+ }
+ }
+
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void endLogging()
+ {
+ if (!isLogging())
+ {
+ throw new IllegalStateException("Not currently logging");
+ }
+
+ changeRecorder.endRecording();
+ changeRecorder.dispose();
+ changeRecorder = null;
+// if (eNotificationRequired())
+// eNotify(new ENotificationImpl(this, Notification.SET, SDOPackage.ECHANGE_SUMMARY__LOGGING, true, false));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public boolean isCreated(DataObject dataObject)
+ {
+ return getCachedCreatedObjects().contains(dataObject);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public boolean isDeleted(DataObject dataObject)
+ {
+ return getCachedDeletedObjects().contains(dataObject);
+ }
+
+ protected Set getCachedDeletedObjects()
+ {
+ if (cachedDeletedObjects == null)
+ {
+ if (isStale()) changeRecorder.consolidateChanges();
+ cachedDeletedObjects = new HashSet();
+ for (Iterator i = EcoreUtil.getAllContents(getObjectsToAttach()); i.hasNext(); )
+ {
+ cachedDeletedObjects.add(i.next());
+ }
+ }
+ return cachedDeletedObjects;
+ }
+
+ protected List getCachedCreatedObjects()
+ {
+ if (cachedCreatedObjects == null)
+ {
+ if (isStale()) changeRecorder.consolidateChanges();
+ cachedCreatedObjects = super.getObjectsToDetach();
+ }
+ return cachedCreatedObjects;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public List getChangedDataObjects()
+ {
+ EList result = new UniqueEList.FastCompare(getCachedDeletedObjects());
+ result.addAll(getCachedCreatedObjects());
+ for (Iterator i = getObjectChanges().iterator(); i.hasNext(); )
+ {
+ Map.Entry entry = (Map.Entry)i.next();
+ result.add(entry.getKey());
+ }
+ return result;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public List getOldValues(DataObject dataObject)
+ {
+ List sdoSettings = (List)cachedSDOObjectChanges.get(dataObject);
+ if (sdoSettings != null)
+ {
+ return sdoSettings;
+ }
+
+ if (isStale()) changeRecorder.consolidateChanges();
+ List settings = (List)getObjectChanges().get(dataObject);
+ if (settings == null)
+ {
+ settings = Collections.EMPTY_LIST;
+ }
+ else
+ {
+ for (int i = 0; i < settings.size(); i++)
+ {
+ FeatureChange change = (FeatureChange)settings.get(i);
+ EStructuralFeature feature = change.getFeature();
+ if (FeatureMapUtil.isFeatureMap(feature))
+ {
+ final List values = (List)change.getValue();
+ if (sdoSettings == null)
+ {
+ sdoSettings = new BasicEList(settings);
+ }
+ DelegatingFeatureMap featureMap = new DelegatingFeatureMap(((InternalEObject)dataObject), feature)
+ {
+ protected final List theList = values;
+
+ protected List delegateList()
+ {
+ return theList;
+ }
+ };
+
+ // create new settings and replace the setting for mixed feature
+ sdoSettings.set(i, SDOFactory.eINSTANCE.createChangeSummarySetting(feature, new BasicSequence(featureMap), change.isSet()));
+ // add all derived features
+ for (int k = 0; k < featureMap.size(); k++)
+ {
+ EStructuralFeature f = featureMap.getEStructuralFeature(k);
+ sdoSettings.add(SDOFactory.eINSTANCE.createChangeSummarySetting(f, featureMap.get(f, false), true));
+ }
+ }
+ }
+ }
+ sdoSettings = (sdoSettings != null) ? sdoSettings : settings;
+ cachedSDOObjectChanges.put(dataObject, sdoSettings);
+ return sdoSettings;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public boolean isModified(DataObject dataObject)
+ {
+ return getObjectChanges().containsKey(dataObject) && !isDeleted(dataObject) && !isCreated(dataObject);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void summarize()
+ {
+ if (!isLogging())
+ {
+ throw new IllegalStateException("Not currently logging");
+ }
+
+ changeRecorder.summarize();
+ }
+
+ public Setting getOldValue(DataObject dataObject, Property property)
+ {
+ for (Iterator i = getOldValues(dataObject).iterator(); i.hasNext(); )
+ {
+ Setting setting = (Setting)i.next();
+ if (setting.getProperty() == property)
+ {
+ return setting;
+ }
+ }
+
+ return null;
+ }
+
+ public DataObject getOldContainer(DataObject dataObject)
+ {
+ return (DataObject)getOldContainer((EObject)dataObject);
+ }
+
+ public Property getOldContainmentProperty(DataObject dataObject)
+ {
+ return (Property)getOldContainmentFeature((EObject)dataObject);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Sequence getOldSequence(DataObject dataObject)
+ {
+ EAttribute mixedFeature = BasicExtendedMetaData.INSTANCE.getMixedFeature((EClass)dataObject.getType());
+ if (mixedFeature != null)
+ {
+ return (Sequence)getOldValue(dataObject, (Property)mixedFeature).getValue();
+ }
+ return null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void undoChanges()
+ {
+ if (isLogging())
+ {
+ changeRecorder.summarize();
+ }
+ else
+ {
+ uncache();
+ }
+ apply();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public DataGraph getDataGraph()
+ {
+ return getEDataGraph();
+ }
+
+ protected Map getOldContainmentInformation()
+ {
+ if (oldContainmentInformation == null)
+ {
+ if (isStale()) changeRecorder.consolidateChanges();
+ super.getOldContainmentInformation();
+ }
+ return oldContainmentInformation;
+ }
+
+ protected boolean isStale()
+ {
+ return isLogging() && isStale;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public DataObject getRootObject()
+ {
+ if (eDataGraph != null)
+ {
+ return eDataGraph.getRootObject();
+ }
+ if (dataObject != null)
+ {
+ return dataObject;
+ }
+ return null;
+ }
+
+ static protected boolean isContainmentReference(Object feature)
+ {
+ return feature instanceof EReference && ((EReference) feature).isContainment();
+ }
+
+ public DataObject getOldDataObject(DataObject dataObject)
+ {
+ //TODO: Fix this method. Currently, it has the side effect of undoing the unset of contained children references
+ // of root deleted objects - i.e., when featureChange.apply(oldDataObject) is called.
+ //
+ List changes = (List) getObjectChanges().get(dataObject);
+ if (changes == null)
+ return dataObject;
+ EObject oldDataObject = EcoreUtil.copy((EObject)dataObject);
+ for (Iterator fIter = changes.iterator(); fIter.hasNext(); )
+ {
+ FeatureChange featureChange = (FeatureChange)fIter.next();
+ featureChange.apply(oldDataObject);
+ EStructuralFeature feature = featureChange.getFeature();
+ if (FeatureMapUtil.isFeatureMap(feature))
+ {
+ FeatureMap featureMap = (FeatureMap) oldDataObject.eGet(feature);
+ for (int index = featureMap.size(); index != 0;)
+ if (isContainmentReference(featureMap.getEStructuralFeature(--index)))
+ featureMap.setValue(index, getOldDataObject((DataObject) featureMap.getValue(index)));
+ }
+ else if (isContainmentReference(feature))
+ {
+ Object value = oldDataObject.eGet(feature);
+ if (feature.isMany())
+ {
+ changes = (List) value;
+ for (int index = changes.size(); index != 0;)
+ changes.set(--index, getOldDataObject((DataObject) changes.get(index))); // Java pushes stack from left to right
+ }
+ else
+ oldDataObject.eSet(feature, getOldDataObject((DataObject) value));
+ }
+ }
+
+ return (DataObject)oldDataObject;
+ }
+
+} //ChangeSummaryImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/ChangeSummarySettingImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/ChangeSummarySettingImpl.java
new file mode 100644
index 0000000000..d1cd1d3e05
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/ChangeSummarySettingImpl.java
@@ -0,0 +1,113 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.impl;
+
+
+import java.util.Map;
+
+import org.apache.tuscany.sdo.SDOPackage;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.change.impl.FeatureChangeImpl;
+
+import commonj.sdo.ChangeSummary;
+import commonj.sdo.Property;
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>EChange Summary Setting</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * </p>
+ *
+ * @generated
+ */
+public class ChangeSummarySettingImpl extends FeatureChangeImpl implements ChangeSummary.Setting
+{
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ChangeSummarySettingImpl()
+ {
+ super();
+ }
+
+ protected ChangeSummarySettingImpl(EStructuralFeature feature, Object value, boolean isSet)
+ {
+ super(feature, value, isSet);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EClass eStaticClass()
+ {
+ return SDOPackage.eINSTANCE.getChangeSummarySetting();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Object getValue()
+ {
+ EStructuralFeature feature = getFeature();
+ if (feature.isMany())
+ {
+ if (value == null)
+ {
+ EObject eObject = (EObject)((Map.Entry)eContainer()).getKey();
+ value = getListValue((EList)eObject.eGet(feature));
+ }
+ return value;
+ }
+ else
+ {
+ return super.getValue();
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Property getProperty()
+ {
+ return (Property)getFeature();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public boolean isSet()
+ {
+ return super.isSet();
+ }
+
+} //EChangeSummarySettingImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/ClassImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/ClassImpl.java
new file mode 100644
index 0000000000..7faa5c16f0
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/ClassImpl.java
@@ -0,0 +1,1109 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.impl;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.tuscany.sdo.SDOFactory;
+import org.apache.tuscany.sdo.SDOPackage;
+import org.apache.tuscany.sdo.model.ModelFactory;
+import org.apache.tuscany.sdo.model.impl.ModelFactoryImpl;
+import org.apache.tuscany.sdo.util.BasicSequence;
+import org.apache.tuscany.sdo.util.DataObjectUtil;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.common.util.UniqueEList;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.emf.ecore.impl.EClassImpl;
+import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
+import org.eclipse.emf.ecore.util.ExtendedMetaData;
+import org.eclipse.emf.ecore.util.FeatureMap;
+import org.eclipse.emf.ecore.util.FeatureMapUtil;
+
+import commonj.sdo.Property;
+import commonj.sdo.Sequence;
+import commonj.sdo.Type;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Class</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * </p>
+ *
+ * @generated
+ */
+public class ClassImpl extends EClassImpl implements Type, org.apache.tuscany.sdo.model.Type/*, DataObject*/
+{
+ private static final long serialVersionUID = 1L;
+
+ private static final Property UNINITIALIZED_PROPERTY = SDOFactory.eINSTANCE.createAttribute();
+
+ private Property changeSummaryPropertyCache = UNINITIALIZED_PROPERTY;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ClassImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ protected EClass eStaticClass()
+ {
+ return SDOPackage.eINSTANCE.getClass_();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String getURI()
+ {
+ return getEPackage().getNsURI();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public boolean isDataType()
+ {
+ return false;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public boolean isOpen()
+ {
+ final List properties = getExtendedProperties();
+ if (properties != Collections.EMPTY_LIST)
+ {
+ for (int i = 0, count = properties.size(); i < count; ++i)
+ {
+ EStructuralFeature eStructuralFeature = (EStructuralFeature)properties.get(i);
+ if (isOpenFeatureMap(eStructuralFeature))
+ return true;
+ }
+ }
+
+ for (final Iterator iterator = getBaseTypes().iterator() ; iterator.hasNext(); )
+ {
+ Type baseType = (Type)iterator.next();
+ if (baseType.isOpen())
+ return true;
+ }
+
+ return false;
+ }
+
+ private EAttribute sequenceFeature = (EAttribute)UNINITIALIZED_PROPERTY;
+
+ public EAttribute getSequenceFeature()
+ {
+ //FB This isn't quite right.
+ //FB What if there are multiple sequences? We'll need to provide a mixed-like combined Sequence.
+ if (sequenceFeature == UNINITIALIZED_PROPERTY)
+ {
+ for (final Iterator iterator = getBaseTypes().iterator() ; iterator.hasNext(); )
+ {
+ ClassImpl baseType = (ClassImpl)iterator.next();
+ sequenceFeature = baseType.getSequenceFeature();
+ if (sequenceFeature != null) return sequenceFeature;
+ }
+
+ List properties = getExtendedProperties();
+ if (properties != Collections.EMPTY_LIST)
+ {
+ for (int i = 0, count = properties.size(); i < count; ++i)
+ {
+ EStructuralFeature eStructuralFeature = (EStructuralFeature)properties.get(i);
+ if (isSequenceFeatureMap(eStructuralFeature))
+ {
+ sequenceFeature = (EAttribute)eStructuralFeature;
+ return sequenceFeature;
+ }
+ }
+ }
+
+ sequenceFeature = null;
+ }
+ return sequenceFeature;
+ }
+
+ protected boolean isSequenceFeatureMap(EStructuralFeature eStructuralFeature)
+ {
+ //return eStructuralFeature == ExtendedMetaData.INSTANCE.getMixedFeature(this);
+ switch (ExtendedMetaData.INSTANCE.getFeatureKind(eStructuralFeature))
+ {
+ case ExtendedMetaData.ELEMENT_WILDCARD_FEATURE:
+ //return eStructuralFeature.getUpperBound() != 1; //FB TODO - I think this may be needed
+ int contentKind = ExtendedMetaData.INSTANCE.getContentKind(this);
+ return contentKind == ExtendedMetaData.MIXED_CONTENT || contentKind == ExtendedMetaData.SIMPLE_CONTENT;
+ case ExtendedMetaData.GROUP_FEATURE:
+ return true;
+ }
+ return false;
+ }
+
+ public void setSequenceFeature(EAttribute sequenceFeature)
+ {
+ getEStructuralFeatures().add(sequenceFeature);
+ this.sequenceFeature = sequenceFeature;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public boolean isSequenced()
+ {
+ return getSequenceFeature() != null;
+ }
+
+ protected List aliasNames = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public List getAliasNames()
+ {
+ if (aliasNames == null)
+ {
+ aliasNames = DataObjectUtil.getAliasNames(this);
+ }
+ return aliasNames;
+ }
+
+ protected List declaredProperties = null;
+
+ public List getDeclaredProperties()
+ {
+ if (declaredProperties == null) {
+ initPropertyLists();
+ }
+ return declaredProperties;
+ }
+
+ protected List extendedProperties = null;
+
+ public List getExtendedProperties()
+ {
+ if (extendedProperties == null) {
+ initPropertyLists();
+ }
+ return extendedProperties;
+ }
+
+ protected List getTypeFeatures()
+ {
+ return getEStructuralFeatures();
+ }
+
+ protected void initPropertyLists()
+ {
+ List declaredProperties = new ArrayList();
+ List extendedProperties = Collections.EMPTY_LIST;
+
+ for (Iterator i = getTypeFeatures().iterator(); i.hasNext(); ) {
+ EStructuralFeature eStructuralFeature = (EStructuralFeature)i.next();
+ boolean isExtendedProperty = DataObjectUtil.isInternalProperty(eStructuralFeature);
+ if (isExtendedProperty) {
+ if (extendedProperties == Collections.EMPTY_LIST)
+ extendedProperties = new ArrayList();
+ extendedProperties.add(eStructuralFeature);
+ }
+ else
+ declaredProperties.add(eStructuralFeature);
+ }
+ this.declaredProperties = declaredProperties;
+ this.extendedProperties = extendedProperties;
+ }
+
+ public EList getEStructuralFeatures()
+ {
+ if (eStructuralFeatures == null)
+ {
+ eStructuralFeatures =
+ new EObjectContainmentWithInverseEList(EStructuralFeature.class, this, EcorePackage.ECLASS__ESTRUCTURAL_FEATURES, EcorePackage.ESTRUCTURAL_FEATURE__ECONTAINING_CLASS)
+ {
+ protected void didChange()
+ {
+ declaredProperties = extendedProperties = null;
+ }
+ };
+ }
+ return eStructuralFeatures;
+ }
+
+ protected List allProperties = null;
+ protected List allExtendedProperties = null;
+ protected EList allFeaturesCache = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public List getProperties()
+ {
+ final EList allFeatures = getEAllStructuralFeatures();
+ if (allFeatures != allFeaturesCache)
+ {
+ allFeaturesCache = allFeatures;
+ allProperties = allExtendedProperties = null;
+ }
+ if (allProperties == null)
+ {
+ List allProperties = new UniqueEList();
+ for (final Iterator iterator = getBaseTypes().iterator(); iterator.hasNext(); )
+ {
+ Type baseType = (Type)iterator.next();
+ allProperties.addAll(baseType.getProperties());
+ }
+ allProperties.addAll(getDeclaredProperties());
+ this.allProperties = allProperties;
+ }
+ return allProperties;
+ }
+
+ public List getAllExtendedProperties()
+ {
+ final EList allFeatures = getEAllStructuralFeatures();
+ if (allFeatures != allFeaturesCache)
+ {
+ allFeaturesCache = allFeatures;
+ allProperties = allExtendedProperties = null;
+ }
+ if (allProperties == null)
+ {
+ List allExtendedProperties = new UniqueEList();
+ for (final Iterator iterator = getBaseTypes().iterator(); iterator.hasNext(); )
+ {
+ Type baseType = (Type)iterator.next();
+ allExtendedProperties.addAll(((ClassImpl)baseType).getAllExtendedProperties());
+ }
+ allExtendedProperties.addAll(getExtendedProperties());
+ this.allExtendedProperties = allExtendedProperties;
+ }
+ return allExtendedProperties;
+ }
+
+ protected boolean isOpenFeatureMap(EStructuralFeature eStructuralFeature)
+ {
+ switch (ExtendedMetaData.INSTANCE.getFeatureKind(eStructuralFeature))
+ {
+ case ExtendedMetaData.ELEMENT_WILDCARD_FEATURE:
+ return eStructuralFeature != ExtendedMetaData.INSTANCE.getMixedFeature(this);
+ case ExtendedMetaData.ATTRIBUTE_WILDCARD_FEATURE:
+ //FB I think this is wrong ... case ExtendedMetaData.GROUP_FEATURE:
+ return true;
+ }
+ return false;
+ }
+
+ public void addOpenProperties(EObject dataObject, Collection propertyList)
+ {
+ for (final Iterator iterator = getBaseTypes().iterator(); iterator.hasNext(); )
+ {
+ ClassImpl baseType = (ClassImpl)iterator.next();
+ baseType.addOpenProperties(dataObject, propertyList);
+ }
+
+ for (final Iterator iter = getExtendedProperties().iterator(); iter.hasNext(); )
+ {
+ EStructuralFeature eStructuralFeature = (EStructuralFeature)iter.next();
+ if (isOpenFeatureMap(eStructuralFeature))
+ {
+ List features = (List)dataObject.eGet(eStructuralFeature);
+ for (int j = 0, size = features.size(); j < size; ++j)
+ {
+ FeatureMap.Entry entry = (FeatureMap.Entry)features.get(j);
+ EStructuralFeature entryFeature = entry.getEStructuralFeature();
+ Property property = BasicSequence.getFeatureProperty(entryFeature);
+ if (property != null) propertyList.add(entryFeature);
+ }
+ }
+ }
+ }
+
+ public Property getOpenProperty(EObject dataObject, String featureName)
+ {
+ for (final Iterator iterator = getBaseTypes().iterator(); iterator.hasNext(); )
+ {
+ ClassImpl baseType = (ClassImpl)iterator.next();
+ Property result = baseType.getOpenProperty(dataObject, featureName);
+ if (result != null) return result;
+ }
+
+ Set openFeatureSet = new HashSet();
+ for (final Iterator iter = getExtendedProperties().iterator(); iter.hasNext(); )
+ {
+ EStructuralFeature eStructuralFeature = (EStructuralFeature)iter.next();
+ //if (isOpenFeatureMap(eStructuralFeature))
+ //FB The above check excludes subsitition groups - i.e., doesn't support dObj.get("element.substitution")
+ if (FeatureMapUtil.isFeatureMap(eStructuralFeature))
+ {
+ List features = (List)dataObject.eGet(eStructuralFeature);
+ for (int j = 0, size = features.size(); j < size; ++j)
+ {
+ FeatureMap.Entry entry = (FeatureMap.Entry)features.get(j);
+ EStructuralFeature entryFeature = entry.getEStructuralFeature();
+ if (openFeatureSet.add(entryFeature))
+ {
+ Property property = BasicSequence.getFeatureProperty(entryFeature);
+ if (property != null)
+ {
+ if (property.getName().equals(featureName)) return (Property)entryFeature;
+ List aliasNames = property.getAliasNames();
+ for (int aliasCount = aliasNames.size(); aliasCount > 0; )
+ {
+ if (aliasNames.get(--aliasCount).equals(featureName)) return (Property)entryFeature;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return null;
+ }
+
+ /*
+ public Property getOpenProperty(DataObject dataObject, String featureName)
+ {
+ EObject eObject = (EObject)dataObject;
+ EClass eClass = eObject.eClass();
+ Set openFeatureSet = new HashSet();
+ for (int i = 0, count = eClass.getEAllStructuralFeatures().size(); i < count; ++i)
+ {
+ EStructuralFeature eStructuralFeature = eClass.getEStructuralFeature(i);
+ if (FeatureMapUtil.isFeatureMap(eStructuralFeature))
+ {
+ List features = (List)eObject.eGet(eStructuralFeature);
+ for (int j = 0, size = features.size(); j < size; ++j)
+ {
+ FeatureMap.Entry entry = (FeatureMap.Entry)features.get(j);
+ EStructuralFeature entryFeature = entry.getEStructuralFeature();
+ if (openFeatureSet.add(entryFeature))
+ {
+ Property property = (Property)entryFeature;
+ if (property.getName().equals(featureName)) return (Property)entryFeature;
+
+ List aliasNames = property.getAliasNames();
+ for (int aliasCount = aliasNames.size(); aliasCount > 0; )
+ {
+ if (aliasNames.get(--aliasCount).equals(featureName)) return (Property)entryFeature;
+ }
+ }
+ }
+ }
+ }
+ return null;
+ }
+ */
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public List getBaseTypes()
+ {
+ return getESuperTypes();
+ }
+
+ private void initAliasNames() {
+ Map result = new HashMap();
+ for (Iterator i = getProperties().iterator(); i.hasNext();)
+ {
+ Property property = (Property)i.next();
+ result.put(property.getName(), property);
+
+ List aliasNames = property.getAliasNames();
+ for (int count = aliasNames.size(); count > 0;)
+ {
+ result.put(aliasNames.get(--count), property);
+ }
+ }
+ propertyNameToPropertyMap = result;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Property getProperty(String propertyName)
+ {
+ if (propertyNameToPropertyMap == null) initAliasNames();
+ Property property = (Property)propertyNameToPropertyMap.get(propertyName);
+ if (property == null && !isOpen()) {
+ initAliasNames();
+ property = (Property)propertyNameToPropertyMap.get(propertyName);
+ }
+ return property;
+ }
+
+ protected Map propertyNameToPropertyMap;
+
+ public List getInstanceProperties() {
+ return DataObjectUtil.getMetaObjectInstanceProperties(this);
+ }
+
+ public Object get(Property property) {
+ return DataObjectUtil.getMetaObjectInstanceProperty(this, property);
+ }
+
+ /////////////////////////////////////////////////////////////////////////////////////////////////////////
+ // org.apache.tuscany.sdo.model.Type method implementations
+ /////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+ public List getBaseType() {
+ return this.getBaseTypes();
+ }
+
+ public List getProperty() {
+ return this.getProperties();
+ }
+
+ public List getAliasName() {
+ return this.getAliasNames();
+ }
+
+ public void unsetAbstract() {
+ eUnset(EcorePackage.eINSTANCE.getEClass_Abstract());
+ }
+
+ public boolean isSetAbstract() {
+ return eIsSet(EcorePackage.eINSTANCE.getEClass_Abstract());
+ }
+
+ public Sequence getAny() {
+ throw new UnsupportedOperationException();
+ }
+
+ public Sequence getAnyAttribute() {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setDataType(boolean value) {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ }
+
+ public void unsetDataType() {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ }
+
+ public boolean isSetDataType() {
+ return false;
+ }
+
+ public void setOpen(boolean value) {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ }
+
+ public void unsetOpen() {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ }
+
+ public boolean isSetOpen() {
+ return isOpen();
+ }
+
+ public void setSequenced(boolean value) {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ }
+
+ public void unsetSequenced() {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ }
+
+ public boolean isSetSequenced() {
+ return isSequenced();
+ }
+
+ public void unsetName()
+ {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ }
+
+ public boolean isSetName()
+ {
+ return true;
+ }
+
+ public void unsetUri()
+ {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ }
+
+ public boolean isSetUri()
+ {
+ return true;
+ }
+
+ public void setUri(String value) {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ }
+
+ public String getUri() {
+ return getURI();
+ }
+
+ public Property getChangeSummaryProperty() {
+ if (changeSummaryPropertyCache == UNINITIALIZED_PROPERTY) {
+ changeSummaryPropertyCache = null;
+
+ // Find property of type ChangeSummaryType, if one exists
+ Type csType = ((ModelFactoryImpl)ModelFactory.INSTANCE).getChangeSummaryType();
+ for (Iterator props = getProperties().iterator(); props.hasNext(); ) {
+ Property p = (Property)props.next();
+ if(csType == p.getType()) {
+ changeSummaryPropertyCache = p;
+ break;
+ }
+ }
+ }
+
+ return changeSummaryPropertyCache;
+ }
+
+ /////////////////////////////////////////////////////////////////////////////////////////////////////////
+ // DataObject method implementations
+ /////////////////////////////////////////////////////////////////////////////////////////////////////////
+ /*
+ public Object get(int propertyIndex) {
+ return DataObjectUtil.get(this, propertyIndex);
+ }
+
+ public void set(int propertyIndex, Object value) {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ }
+
+ public boolean isSet(int propertyIndex) {
+ return DataObjectUtil.isSet(this, propertyIndex);
+ }
+
+ public void unset(int propertyIndex) {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ }
+
+ public Object get(Property property) {
+ return DataObjectUtil.get(this, ((EStructuralFeature)property).getFeatureID());
+ }
+
+ public void set(Property property, Object value) {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ }
+
+ public boolean isSet(Property property) {
+ return DataObjectUtil.isSet(this, ((EStructuralFeature)property).getFeatureID());
+ }
+
+ public void unset(Property property) {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ }
+
+ public DataObject getContainer() {
+ return (DataObject)eContainer();
+ }
+
+ public Property getContainmentProperty() {
+ return (Property)eContainmentFeature();
+ }
+
+ public Type getType() {
+ return (Type)ModelPackageImpl.eINSTANCE.getType();
+ }
+
+ // Remaining DataObject methods are (will be) implemented as straight delegation to DataObjectUtil
+
+ public Object get(String path) {
+ return DataObjectUtil.get(this, path);
+ }
+
+ public void set(String path, Object value) {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ }
+
+ public boolean isSet(String path) {
+ return DataObjectUtil.isSet(this, path);
+ }
+
+ public void unset(String path) {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ }
+
+ public boolean getBoolean(String path) {
+ return DataObjectUtil.getBoolean(get(path));
+ }
+
+ public byte getByte(String path) {
+ return DataObjectUtil.getByte(get(path));
+ }
+
+ public char getChar(String path) {
+ return DataObjectUtil.getChar(get(path));
+ }
+
+ public double getDouble(String path) {
+ return DataObjectUtil.getDouble(get(path));
+ }
+
+ public float getFloat(String path) {
+ return DataObjectUtil.getFloat(get(path));
+ }
+
+ public int getInt(String path) {
+ return DataObjectUtil.getInt(get(path));
+ }
+
+ public long getLong(String path) {
+ return DataObjectUtil.getLong(get(path));
+ }
+
+ public short getShort(String path) {
+ return DataObjectUtil.getShort(get(path));
+ }
+
+ public byte[] getBytes(String path) {
+ return DataObjectUtil.getBytes(get(path));
+ }
+
+ public BigDecimal getBigDecimal(String path) {
+ return DataObjectUtil.getBigDecimal(get(path));
+ }
+
+ public BigInteger getBigInteger(String path) {
+ return DataObjectUtil.getBigInteger(get(path));
+ }
+
+ public DataObject getDataObject(String path) {
+ return (DataObject)get(path);
+ }
+
+ public Date getDate(String path) {
+ return DataObjectUtil.getDate(get(path));
+ }
+
+ public String getString(String path) {
+ return DataObjectUtil.getString(get(path));
+ }
+
+ public List getList(String path) {
+ return (List)get(path);
+ }
+
+ public Sequence getSequence(String path) {
+ return (Sequence)get(path);
+ }
+
+ public void setBoolean(String path, boolean value) {
+ set(path, new Boolean(value));
+ }
+
+ public void setByte(String path, byte value) {
+ set(path, new Byte(value));
+ }
+
+ public void setChar(String path, char value) {
+ set(path, new Character(value));
+ }
+
+ public void setDouble(String path, double value) {
+ set(path, new Double(value));
+ }
+
+ public void setFloat(String path, float value) {
+ set(path, new Float(value));
+ }
+
+ public void setInt(String path, int value) {
+ set(path, new Integer(value));
+ }
+
+ public void setLong(String path, long value) {
+ set(path, new Long(value));
+ }
+
+ public void setShort(String path, short value) {
+ set(path, new Short(value));
+ }
+
+ public void setBytes(String path, byte[] value) {
+ set(path, value);
+ }
+
+ public void setBigDecimal(String path, BigDecimal value) {
+ set(path, value);
+ }
+
+ public void setBigInteger(String path, BigInteger value) {
+ set(path, value);
+ }
+
+ public void setDataObject(String path, DataObject value) {
+ set(path, value);
+ }
+
+ public void setDate(String path, Date value) {
+ set(path, value);
+ }
+
+ public void setString(String path, String value) {
+ set(path, value);
+ }
+
+ public void setList(String path, List value) {
+ set(path, value);
+ }
+
+ public boolean getBoolean(int propertyIndex) {
+ return DataObjectUtil.getBoolean(this, propertyIndex);
+ }
+
+ public byte getByte(int propertyIndex) {
+ return DataObjectUtil.getByte(this, propertyIndex);
+ }
+
+ public char getChar(int propertyIndex) {
+ return DataObjectUtil.getChar(this, propertyIndex);
+ }
+
+ public double getDouble(int propertyIndex) {
+ return DataObjectUtil.getDouble(this, propertyIndex);
+ }
+
+ public float getFloat(int propertyIndex) {
+ return DataObjectUtil.getFloat(this, propertyIndex);
+ }
+
+ public int getInt(int propertyIndex) {
+ return DataObjectUtil.getInt(this, propertyIndex);
+ }
+
+ public long getLong(int propertyIndex) {
+ return DataObjectUtil.getLong(this, propertyIndex);
+ }
+
+ public short getShort(int propertyIndex) {
+ return DataObjectUtil.getShort(this, propertyIndex);
+ }
+
+ public byte[] getBytes(int propertyIndex) {
+ return DataObjectUtil.getBytes(this, propertyIndex);
+ }
+
+ public BigDecimal getBigDecimal(int propertyIndex) {
+ return DataObjectUtil.getBigDecimal(this, propertyIndex);
+ }
+
+ public BigInteger getBigInteger(int propertyIndex) {
+ return DataObjectUtil.getBigInteger(this, propertyIndex);
+ }
+
+ public DataObject getDataObject(int propertyIndex) {
+ return DataObjectUtil.getDataObject(this, propertyIndex);
+ }
+
+ public Date getDate(int propertyIndex) {
+ return DataObjectUtil.getDate(this, propertyIndex);
+ }
+
+ public String getString(int propertyIndex) {
+ return DataObjectUtil.getString(this, propertyIndex);
+ }
+
+ public List getList(int propertyIndex) {
+ return DataObjectUtil.getList(this, propertyIndex);
+ }
+
+ public Sequence getSequence(int propertyIndex) {
+ return DataObjectUtil.getSequence(this, propertyIndex);
+ }
+
+ public void setBoolean(int propertyIndex, boolean value) {
+ set(propertyIndex, new Boolean(value));
+ }
+
+ public void setByte(int propertyIndex, byte value) {
+ set(propertyIndex, new Byte(value));
+ }
+
+ public void setChar(int propertyIndex, char value) {
+ set(propertyIndex, new Character(value));
+ }
+
+ public void setDouble(int propertyIndex, double value) {
+ set(propertyIndex, new Double(value));
+ }
+
+ public void setFloat(int propertyIndex, float value) {
+ set(propertyIndex, new Float(value));
+ }
+
+ public void setInt(int propertyIndex, int value) {
+ set(propertyIndex, new Integer(value));
+ }
+
+ public void setLong(int propertyIndex, long value) {
+ set(propertyIndex, new Long(value));
+ }
+
+ public void setShort(int propertyIndex, short value) {
+ set(propertyIndex, new Short(value));
+ }
+
+ public void setBytes(int propertyIndex, byte[] value) {
+ set(propertyIndex, value);
+ }
+
+ public void setBigDecimal(int propertyIndex, BigDecimal value) {
+ set(propertyIndex, value);
+ }
+
+ public void setBigInteger(int propertyIndex, BigInteger value) {
+ set(propertyIndex, value);
+ }
+
+ public void setDataObject(int propertyIndex, DataObject value) {
+ set(propertyIndex, value);
+ }
+
+ public void setDate(int propertyIndex, Date value) {
+ set(propertyIndex, value);
+ }
+
+ public void setString(int propertyIndex, String value) {
+ set(propertyIndex, value);
+ }
+
+ public void setList(int propertyIndex, List value) {
+ set(propertyIndex, value);
+ }
+
+ public boolean getBoolean(Property property) {
+ return DataObjectUtil.getBoolean(this, property);
+ }
+
+ public byte getByte(Property property) {
+ return DataObjectUtil.getByte(this, property);
+ }
+
+ public char getChar(Property property) {
+ return DataObjectUtil.getChar(this, property);
+ }
+
+ public double getDouble(Property property) {
+ return DataObjectUtil.getDouble(this, property);
+ }
+
+ public float getFloat(Property property) {
+ return DataObjectUtil.getFloat(this, property);
+ }
+
+ public int getInt(Property property) {
+ return DataObjectUtil.getInt(this, property);
+ }
+
+ public long getLong(Property property) {
+ return DataObjectUtil.getLong(this, property);
+ }
+
+ public short getShort(Property property) {
+ return DataObjectUtil.getShort(this, property);
+ }
+
+ public byte[] getBytes(Property property) {
+ return DataObjectUtil.getBytes(this, property);
+ }
+
+ public BigDecimal getBigDecimal(Property property) {
+ return DataObjectUtil.getBigDecimal(this, property);
+ }
+
+ public BigInteger getBigInteger(Property property) {
+ return DataObjectUtil.getBigInteger(this, property);
+ }
+
+ public DataObject getDataObject(Property property) {
+ return DataObjectUtil.getDataObject(this, property);
+ }
+
+ public Date getDate(Property property) {
+ return DataObjectUtil.getDate(this, property);
+ }
+
+ public String getString(Property property) {
+ return DataObjectUtil.getString(this, property);
+ }
+
+ public List getList(Property property) {
+ return DataObjectUtil.getList(this, property);
+ }
+
+ public Sequence getSequence(Property property) {
+ return DataObjectUtil.getSequence(this, property);
+ }
+
+ public void setBoolean(Property property, boolean value) {
+ set(property, new Boolean(value));
+ }
+
+ public void setByte(Property property, byte value) {
+ set(property, new Byte(value));
+ }
+
+ public void setChar(Property property, char value) {
+ set(property, new Character(value));
+ }
+
+ public void setDouble(Property property, double value) {
+ set(property, new Double(value));
+ }
+
+ public void setFloat(Property property, float value) {
+ set(property, new Float(value));
+ }
+
+ public void setInt(Property property, int value) {
+ set(property, new Integer(value));
+ }
+
+ public void setLong(Property property, long value) {
+ set(property, new Long(value));
+ }
+
+ public void setShort(Property property, short value) {
+ set(property, new Short(value));
+ }
+
+ public void setBytes(Property property, byte[] value) {
+ set(property, value);
+ }
+
+ public void setBigDecimal(Property property, BigDecimal value) {
+ set(property, value);
+ }
+
+ public void setBigInteger(Property property, BigInteger value) {
+ set(property, value);
+ }
+
+ public void setDataObject(Property property, DataObject value) {
+ set(property, value);
+ }
+
+ public void setDate(Property property, Date value) {
+ set(property, value);
+ }
+
+ public void setString(Property property, String value) {
+ set(property, value);
+ }
+
+ public void setList(Property property, List value) {
+ set(property, value);
+ }
+
+ public DataObject createDataObject(String propertyName) {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ }
+
+ public DataObject createDataObject(int propertyIndex) {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ }
+
+ public DataObject createDataObject(Property property) {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ }
+
+ public DataObject createDataObject(String propertyName, String namespaceURI, String typeName) {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ }
+
+ public DataObject createDataObject(int propertyIndex, String namespaceURI, String typeName) {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ }
+
+ public DataObject createDataObject(Property property, Type type) {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ }
+
+ public void delete() {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ }
+
+ public DataGraph getDataGraph() {
+ return DataObjectUtil.getDataGraph(this);
+ }
+
+ public Sequence getSequence() {
+ EAttribute mixedFeature = BasicExtendedMetaData.INSTANCE.getMixedFeature(eClass());
+ return mixedFeature != null ? (Sequence)eGet(mixedFeature, true, false) : null;
+ }
+
+ public List getInstanceProperties() {
+ return DataObjectUtil.getInstanceProperties(this);
+ }
+
+ public DataObject getRootObject() {
+ return DataObjectUtil.getRootObject(this);
+ }
+
+ public ChangeSummary getChangeSummary() {
+ // TODO: implement this method
+ throw new UnsupportedOperationException();
+ }
+
+ public void detach() {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ //DataObjectUtil.detach(this);
+ }
+ */
+
+} //ClassTypeImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DataGraphImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DataGraphImpl.java
new file mode 100644
index 0000000000..49058b4448
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DataGraphImpl.java
@@ -0,0 +1,852 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.impl;
+
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.tuscany.sdo.SDOFactory;
+import org.apache.tuscany.sdo.SDOPackage;
+import org.apache.tuscany.sdo.helper.TypeHelperImpl;
+import org.apache.tuscany.sdo.util.DataObjectUtil;
+import org.apache.tuscany.sdo.util.resource.SDOObjectInputStream;
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.InternalEObject;
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.util.BasicExtendedMetaData;
+import org.eclipse.emf.ecore.util.ExtendedMetaData;
+
+import commonj.sdo.ChangeSummary;
+import commonj.sdo.DataGraph;
+import commonj.sdo.DataObject;
+import commonj.sdo.Type;
+import commonj.sdo.helper.TypeHelper;
+
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>EData Graph</b></em>'.
+ * @extends DataGraph, Adapter, Serializable
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.apache.tuscany.sdo.impl.DataGraphImpl#getResourceSet <em>Resource Set</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.impl.DataGraphImpl#getRootResource <em>Root Resource</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.impl.DataGraphImpl#getEChangeSummary <em>EChange Summary</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.impl.DataGraphImpl#getERootObject <em>ERoot Object</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class DataGraphImpl extends EObjectImpl implements DataGraph, Adapter, Serializable
+{
+ /**
+ * The default value of the '{@link #getResourceSet() <em>Resource Set</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getResourceSet()
+ * @generated
+ * @ordered
+ */
+ protected static final ResourceSet RESOURCE_SET_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getResourceSet() <em>Resource Set</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getResourceSet()
+ * @generated
+ * @ordered
+ */
+ protected ResourceSet resourceSet = RESOURCE_SET_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getRootResource() <em>Root Resource</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getRootResource()
+ * @generated
+ * @ordered
+ */
+ protected static final Resource ROOT_RESOURCE_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getEChangeSummary() <em>EChange Summary</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getEChangeSummary()
+ * @generated
+ * @ordered
+ */
+ protected ChangeSummary eChangeSummary = null;
+
+ /**
+ * The cached value of the '{@link #getERootObject() <em>ERoot Object</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getERootObject()
+ * @generated
+ * @ordered
+ */
+ protected EObject eRootObject = null;
+
+ /**
+ * The cached extended metadata to wrap the resource set's package registry.
+ */
+ protected ExtendedMetaData extendedMetaData;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected DataGraphImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EClass eStaticClass()
+ {
+ return SDOPackage.eINSTANCE.getDataGraph();
+ }
+
+ public boolean isAdapterForType(Object type)
+ {
+ return type == DataGraph.class;
+ }
+
+ public void notifyChanged(Notification msg)
+ {
+ }
+
+ public Notifier getTarget()
+ {
+ return getResourceSet();
+ }
+
+ public void setTarget(Notifier newTarget)
+ {
+ }
+
+ protected ExtendedMetaData getExtendedMetaData()
+ {
+ if (extendedMetaData == null)
+ {
+ getResourceSet();
+ }
+ return extendedMetaData;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public ResourceSet getResourceSet()
+ {
+ if (resourceSet == null)
+ {
+ if (eResource() != null)
+ {
+ resourceSet = eResource().getResourceSet();
+ }
+ if (resourceSet == null)
+ {
+ resourceSet = createResourceSet();
+ }
+ initializeResourceSet(resourceSet);
+ }
+ return resourceSet;
+ }
+
+ protected ResourceSet createResourceSet()
+ {
+ return DataObjectUtil.createResourceSet();
+ }
+
+ protected Resource createRootResource()
+ {
+ Resource result = resourceSet.createResource(URI.createURI("root.xml"));
+ result.getContents().clear();
+ return result;
+ }
+
+ protected Resource createChangeSummaryResource()
+ {
+ Resource result = resourceSet.createResource(URI.createURI("change-summary.xml"));
+ result.getContents().clear();
+ return result;
+ }
+
+ protected void initializeResourceSet(ResourceSet resourceSet)
+ {
+ if (resourceSet == null)
+ {
+ extendedMetaData = null;
+ }
+ else
+ {
+ extendedMetaData = new BasicExtendedMetaData(resourceSet.getPackageRegistry());
+ resourceSet.eAdapters().add(this);
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setResourceSetGen(ResourceSet newResourceSet)
+ {
+ ResourceSet oldResourceSet = resourceSet;
+ resourceSet = newResourceSet;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, SDOPackage.DATA_GRAPH__RESOURCE_SET, oldResourceSet, resourceSet));
+ }
+
+ public void setResourceSet(ResourceSet newResourceSet)
+ {
+ if (resourceSet != null)
+ {
+ resourceSet.eAdapters().remove(this);
+ }
+ setResourceSetGen(newResourceSet);
+ initializeResourceSet(newResourceSet);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Resource getRootResource()
+ {
+ if (eRootObject == null)
+ {
+ Resource result = getResourceSet().getResource(URI.createURI("root.xml"), false);
+ if (result == null)
+ {
+ result = createRootResource();
+ }
+
+ return result;
+ }
+ else
+ {
+ return eRootObject.eResource();
+ }
+ }
+
+ public Resource getDataGraphResource()
+ {
+ Resource result = eResource();
+ if (result == null)
+ {
+ result = getResourceSet().createResource(URI.createURI("all.datagraph"));
+ result.getContents().add(this);
+ }
+ return result;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeSummary getEChangeSummary()
+ {
+ return eChangeSummary;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetEChangeSummary(ChangeSummary newEChangeSummary, NotificationChain msgs)
+ {
+ ChangeSummary oldEChangeSummary = eChangeSummary;
+ eChangeSummary = newEChangeSummary;
+ if (eNotificationRequired())
+ {
+ ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SDOPackage.DATA_GRAPH__ECHANGE_SUMMARY, oldEChangeSummary, newEChangeSummary);
+ if (msgs == null) msgs = notification; else msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setEChangeSummary(ChangeSummary newEChangeSummary)
+ {
+ if (newEChangeSummary != eChangeSummary)
+ {
+ NotificationChain msgs = null;
+ if (eChangeSummary != null)
+ msgs = ((InternalEObject)eChangeSummary).eInverseRemove(this, SDOPackage.CHANGE_SUMMARY__EDATA_GRAPH, ChangeSummary.class, msgs);
+ if (newEChangeSummary != null)
+ msgs = ((InternalEObject)newEChangeSummary).eInverseAdd(this, SDOPackage.CHANGE_SUMMARY__EDATA_GRAPH, ChangeSummary.class, msgs);
+ msgs = basicSetEChangeSummary(newEChangeSummary, msgs);
+ if (msgs != null) msgs.dispatch();
+ }
+ else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, SDOPackage.DATA_GRAPH__ECHANGE_SUMMARY, newEChangeSummary, newEChangeSummary));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EObject getERootObject()
+ {
+ return eRootObject;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setERootObjectGen(EObject newERootObject)
+ {
+ EObject oldERootObject = eRootObject;
+ eRootObject = newERootObject;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, SDOPackage.DATA_GRAPH__EROOT_OBJECT, oldERootObject, eRootObject));
+ }
+
+ public void setERootObject(EObject newERootObject)
+ {
+ // If there is a resource set already...
+ //
+ if (resourceSet != null)
+ {
+ // Get the root resource and if there's a root object in it already, clear it.
+ // Then set the root object and add it to the root resource.
+ //
+ List contents = getRootResource().getContents();
+ if (eRootObject != null)
+ {
+ contents.clear();
+ }
+ setERootObjectGen(newERootObject);
+ if (newERootObject != null)
+ {
+ contents.add(newERootObject);
+ }
+ }
+ else
+ {
+ // Set the root object and see if it has a resource we can reuse.
+ //
+ setERootObjectGen(newERootObject);
+ Resource rootResource = newERootObject.eResource();
+ if (rootResource != null)
+ {
+ // If there is no resource set
+ //
+ if (rootResource.getResourceSet() == null)
+ {
+ // Demand create one and add this resource to it.
+ //
+ getResourceSet().getResources().add(rootResource);
+ }
+ else
+ {
+ // Reuse the existing resource set.
+ //
+ setResourceSet(rootResource.getResourceSet());
+ }
+ }
+ else
+ {
+ // Demand create the resource set and the root resource, and add to it's contents.
+ //
+ getResourceSet();
+ createRootResource().getContents().add(newERootObject);
+ }
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public EClassifier getEClassifier(String namespaceURI, String typeName)
+ {
+ ExtendedMetaData extendedMetaData = getExtendedMetaData();
+ EPackage ePackage = extendedMetaData.getPackage(namespaceURI);
+ if (ePackage != null)
+ {
+ EClassifier eClassifier = ePackage.getEClassifier(typeName);
+ if (eClassifier == null)
+ {
+ eClassifier = extendedMetaData.getType(ePackage, typeName);
+ }
+ return eClassifier;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Type getType(String namespaceURI, String typeName)
+ {
+ return TypeHelper.INSTANCE.getType(namespaceURI, typeName);
+ //EClassifier eClassifier = getEClassifier(namespaceURI, typeName);
+ //return eClassifier == null ? null : SDOUtil.getType(eClassifier);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs)
+ {
+ if (featureID >= 0)
+ {
+ switch (eDerivedStructuralFeatureID(featureID, baseClass))
+ {
+ case SDOPackage.DATA_GRAPH__ECHANGE_SUMMARY:
+ if (eChangeSummary != null)
+ msgs = ((InternalEObject)eChangeSummary).eInverseRemove(this, SDOPackage.CHANGE_SUMMARY__EDATA_GRAPH, ChangeSummary.class, msgs);
+ return basicSetEChangeSummary((ChangeSummary)otherEnd, msgs);
+ default:
+ return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
+ }
+ }
+ if (eInternalContainer() != null)
+ msgs = eBasicRemoveFromContainer(msgs);
+ return eBasicSetContainer(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs)
+ {
+ if (featureID >= 0)
+ {
+ switch (eDerivedStructuralFeatureID(featureID, baseClass))
+ {
+ case SDOPackage.DATA_GRAPH__ECHANGE_SUMMARY:
+ return basicSetEChangeSummary(null, msgs);
+ default:
+ return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
+ }
+ }
+ return eBasicSetContainer(null, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object eGet(int featureID, boolean resolve, boolean coreType)
+ {
+ switch (featureID)
+ {
+ case SDOPackage.DATA_GRAPH__RESOURCE_SET:
+ return getResourceSet();
+ case SDOPackage.DATA_GRAPH__ROOT_RESOURCE:
+ return getRootResource();
+ case SDOPackage.DATA_GRAPH__ECHANGE_SUMMARY:
+ return getEChangeSummary();
+ case SDOPackage.DATA_GRAPH__EROOT_OBJECT:
+ return getERootObject();
+ }
+ return eDynamicGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void eSet(int featureID, Object newValue)
+ {
+ switch (featureID)
+ {
+ case SDOPackage.DATA_GRAPH__RESOURCE_SET:
+ setResourceSet((ResourceSet)newValue);
+ return;
+ case SDOPackage.DATA_GRAPH__ECHANGE_SUMMARY:
+ setEChangeSummary((ChangeSummary)newValue);
+ return;
+ case SDOPackage.DATA_GRAPH__EROOT_OBJECT:
+ setERootObject((EObject)newValue);
+ return;
+ }
+ eDynamicSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void eUnset(int featureID)
+ {
+ switch (featureID)
+ {
+ case SDOPackage.DATA_GRAPH__RESOURCE_SET:
+ setResourceSet(RESOURCE_SET_EDEFAULT);
+ return;
+ case SDOPackage.DATA_GRAPH__ECHANGE_SUMMARY:
+ setEChangeSummary((ChangeSummary)null);
+ return;
+ case SDOPackage.DATA_GRAPH__EROOT_OBJECT:
+ setERootObject((EObject)null);
+ return;
+ }
+ eDynamicUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean eIsSet(int featureID)
+ {
+ switch (featureID)
+ {
+ case SDOPackage.DATA_GRAPH__RESOURCE_SET:
+ return RESOURCE_SET_EDEFAULT == null ? resourceSet != null : !RESOURCE_SET_EDEFAULT.equals(resourceSet);
+ case SDOPackage.DATA_GRAPH__ROOT_RESOURCE:
+ return ROOT_RESOURCE_EDEFAULT == null ? getRootResource() != null : !ROOT_RESOURCE_EDEFAULT.equals(getRootResource());
+ case SDOPackage.DATA_GRAPH__ECHANGE_SUMMARY:
+ return eChangeSummary != null;
+ case SDOPackage.DATA_GRAPH__EROOT_OBJECT:
+ return eRootObject != null;
+ }
+ return eDynamicIsSet(featureID);
+ }
+
+ public DataObject createEDataObject(Type type)
+ {
+ return DataObjectUtil.create(type);
+ }
+
+ public DataObject getRootObject()
+ {
+ return (DataObject)getERootObject();
+ }
+
+ public DataObject createRootObject(String namespaceURI, String typeName)
+ {
+ Type type = getType(namespaceURI, typeName);
+ if (type == null) {
+ throw new IllegalArgumentException(
+ "createRootObject given invalid parameters: getType("+
+ namespaceURI+", "+typeName+") returned null type");
+ }
+ if (getERootObject() != null) {
+ throw new IllegalStateException(
+ "createRootObject was called when a root object already exists");
+ }
+ DataObject dataObject = DataObjectUtil.create(type);
+ setERootObject((EObject)dataObject);
+ return dataObject;
+ }
+
+ public DataObject createRootObject(Type type)
+ {
+ if (type == null) {
+ throw new IllegalArgumentException(
+ "createRootObject must be provided a non-null type");
+ }
+ if (getERootObject() != null) {
+ throw new IllegalStateException(
+ "createRootObject was called when a root object already exists");
+ }
+ DataObject dataObject = DataObjectUtil.create(type);
+ setERootObject((EObject)dataObject);
+ return dataObject;
+ }
+
+ public ChangeSummary getChangeSummary()
+ {
+ //FB is this the right place to create the resources?
+ ChangeSummary changeSummary = getEChangeSummary();
+ if (changeSummary == null)
+ {
+ getRootResource();
+ changeSummary = createEChangeSummary();
+ setEChangeSummary(changeSummary);
+ }
+
+ if (((ChangeSummaryImpl)changeSummary).eResource() == null)
+ {
+ Resource changeSummaryResource = createChangeSummaryResource();
+ changeSummaryResource.getContents().add(changeSummary);
+ }
+
+ return changeSummary;
+ }
+
+ protected ChangeSummaryImpl createEChangeSummary()
+ {
+ return (ChangeSummaryImpl)SDOFactory.eINSTANCE.createChangeSummary();
+ }
+
+ public static class EDataGraphExternalizable implements Externalizable
+ {
+ protected DataGraphImpl eDataGraph;
+ //protected Map writeReplacements = new HashMap();
+
+ public EDataGraphExternalizable()
+ {
+ }
+
+ public EDataGraphExternalizable(DataGraphImpl eDataGraph)
+ {
+ this.eDataGraph = eDataGraph;
+ }
+
+ public void writeExternal(ObjectOutput objectOutput) throws IOException
+ {
+ ByteArrayOutputStream byteArrayOutputStream =
+ new ByteArrayOutputStream()
+ {
+ public byte [] toByteArray()
+ {
+ return super.toByteArray();
+ }
+ };
+
+ eDataGraph.getDataGraphResource().save(byteArrayOutputStream, null);
+ objectOutput.writeInt(byteArrayOutputStream.toByteArray().length);
+ objectOutput.write(byteArrayOutputStream.toByteArray());
+ }
+
+ public void readExternal(ObjectInput objectInput) throws IOException
+ {
+ int length = objectInput.readInt();
+ byte [] bytes = new byte [length];
+ objectInput.readFully(bytes);
+
+ ResourceSet resourceSet = createResourceSet();
+ Resource resource = resourceSet.createResource(URI.createURI("all.datagraph"));
+
+ HashMap map = null;
+ if(objectInput instanceof SDOObjectInputStream)
+ {
+ TypeHelperImpl th = (TypeHelperImpl)((SDOObjectInputStream)objectInput).getHelperContext().getTypeHelper();
+ map = new HashMap();
+ map.put("EXTENDED_META_DATA", th.getExtendedMetaData());
+ }
+ resource.load(new ByteArrayInputStream(bytes), map);
+ eDataGraph = (DataGraphImpl)resource.getContents().get(0);
+ }
+
+ protected ResourceSet createResourceSet()
+ {
+ return DataObjectUtil.createResourceSet();
+ }
+
+ /*
+ public Object getWriteReplacement(EObject eObject)
+ {
+ Object result = writeReplacements.get(eObject);
+ if (result == null)
+ {
+ result = new EDataObjectExternalizable(eDataGraph, eObject);
+ writeReplacements.put(eObject, result);
+ }
+ return result;
+ }
+ */
+
+ protected Object readResolve()
+ {
+ return eDataGraph;
+ }
+ }
+
+ /*
+ public static class EDataObjectExternalizable implements Externalizable
+ {
+ protected EObject eObject;
+ protected DataGraphImpl eDataGraph;
+
+ public EDataObjectExternalizable()
+ {
+ }
+
+ public EDataObjectExternalizable(DataGraphImpl eDataGraph, EObject eObject)
+ {
+ this.eDataGraph = eDataGraph;
+ this.eObject = eObject;
+ }
+
+ public void writeExternal(ObjectOutput objectOutput) throws IOException
+ {
+ // Write the data object reference too.
+ String uri = eObject.eResource().getURIFragment(eObject);
+ objectOutput.writeUTF(uri);
+ objectOutput.writeObject(eDataGraph.getWriteReplacement());
+ }
+
+ public void readExternal(ObjectInput objectInput) throws IOException, ClassNotFoundException
+ {
+ String uri = objectInput.readUTF();
+ eDataGraph = (DataGraphImpl)objectInput.readObject();
+ eObject = eDataGraph.getRootResource().getEObject(uri);
+ }
+
+ protected Object readResolve()
+ {
+ return eObject;
+ }
+ }
+ */
+
+ protected EDataGraphExternalizable eDataGraphExternalizable;
+ //protected Adapter modificationTracker;
+
+ public Object getWriteReplacement()
+ {
+ if (eDataGraphExternalizable == null)
+ {
+ eDataGraphExternalizable = createEDataGraphExternalizable();
+ /*
+ getRootResource().setTrackingModification(true);
+ modificationTracker =
+ new AdapterImpl()
+ {
+ public void notifyChanged(Notification notification)
+ {
+ if (notification.getFeatureID(Resource.class) == Resource.RESOURCE__IS_MODIFIED && notification.getNewBooleanValue())
+ {
+ eDataGraphExternalizable = null;
+ modificationTracker = null;
+ ((Resource)target).eAdapters().remove(this);
+ }
+ }
+ };
+ getRootResource().eAdapters().add(modificationTracker);
+ */
+ }
+ return eDataGraphExternalizable;
+ }
+
+ protected EDataGraphExternalizable createEDataGraphExternalizable()
+ {
+ return new EDataGraphExternalizable(this);
+ }
+
+ /*
+ public Object getWriteReplacement(EObject eObject)
+ {
+ return ((EDataGraphExternalizable)getWriteReplacement()).getWriteReplacement(eObject);
+ }
+ */
+
+ public Object writeReplace()
+ {
+ return getWriteReplacement();
+ }
+
+ public EObject eObjectForURIFragmentSegment(String uriFragmentSegment)
+ {
+ if (uriFragmentSegment.startsWith("@models."))
+ {
+ if (resourceSet != null)
+ {
+ int count = Integer.parseInt(uriFragmentSegment.substring(8));
+ for (Iterator i = resourceSet.getResources().iterator(); i.hasNext(); )
+ {
+ Resource ePackageResource = (Resource)i.next();
+ List resourceContents = ePackageResource.getContents();
+ if (resourceContents.size() == 1 && resourceContents.get(0) instanceof EPackage && count-- == 0)
+ {
+ return (EObject)resourceContents.get(0);
+ }
+ }
+ }
+
+ return null;
+ }
+ else
+ {
+ return super.eObjectForURIFragmentSegment(uriFragmentSegment);
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString()
+ {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (resourceSet: ");
+ result.append(resourceSet);
+ result.append(')');
+ return result.toString();
+ }
+
+} //EDataGraphImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DataObjectBase.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DataObjectBase.java
new file mode 100644
index 0000000000..4a210b2192
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DataObjectBase.java
@@ -0,0 +1,425 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.impl;
+
+
+import java.util.List;
+
+import org.apache.tuscany.sdo.SDOFactory;
+import org.apache.tuscany.sdo.util.BasicSequence;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.InternalEObject;
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.util.BasicFeatureMap;
+import org.eclipse.emf.ecore.util.EDataTypeEList;
+import org.eclipse.emf.ecore.util.EDataTypeUniqueEList;
+import org.eclipse.emf.ecore.util.EObjectContainmentEList;
+import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
+import org.eclipse.emf.ecore.util.EObjectEList;
+import org.eclipse.emf.ecore.util.EObjectResolvingEList;
+import org.eclipse.emf.ecore.util.EObjectWithInverseEList;
+import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.ecore.util.FeatureMap;
+import org.eclipse.emf.ecore.util.InternalEList;
+
+import commonj.sdo.Sequence;
+import commonj.sdo.Type;
+
+
+/**
+ * Base implementation of the SDO DataObject interface. Used as base class for generated (static) SDO classes
+ */
+public abstract class DataObjectBase extends DataObjectImpl
+{
+
+ protected int OPPOSITE_FEATURE_BASE = EOPPOSITE_FEATURE_BASE;
+ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ // Following methods should be proposed SPI for generated subclasses to use
+ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+ protected boolean isNotifying()
+ {
+ return changeRecorder != null;
+ }
+
+ protected interface ChangeKind
+ {
+ int SET = Notification.SET;
+ int UNSET = Notification.UNSET;
+ int RESOLVE = Notification.RESOLVE;
+ }
+
+ protected void notify(int changeKind, int property, Object oldValue, Object newValue)
+ {
+ eNotify(new ENotificationImpl(this, Notification.SET, property, oldValue, newValue));
+ }
+
+ protected void notify(int changeKind, int property, Object oldValue, Object newValue, boolean isSetChange)
+ {
+ eNotify(new ENotificationImpl(this, Notification.SET, property, oldValue, newValue, isSetChange));
+ }
+
+ protected void notify(int changeKind, int property, double oldDoubleValue, double newDoubleValue, boolean isSetChange)
+ {
+ eNotify(new ENotificationImpl(this, Notification.SET, property, oldDoubleValue, newDoubleValue, isSetChange));
+ }
+
+ protected void notify(int changeKind, int property, boolean oldBooleanValue, boolean newBooleanValue, boolean isSetChange)
+ {
+ eNotify(new ENotificationImpl(this, Notification.SET, property, oldBooleanValue, newBooleanValue, isSetChange));
+ }
+
+ public interface ListKind
+ {
+ int CONTAINMENT = 0;
+ int CONTAINMENT_UNSETTABLE = 1;
+ int CONTAINMENT_RESOLVING = 2;
+ int CONTAINMENT_RESOLVING_UNSETTABLE = 3;
+ int CONTAINMENT_INVERSE = 4;
+ int CONTAINMENT_INVERSE_UNSETTABLE = 5;
+ int CONTAINMENT_INVERSE_RESOLVING = 6;
+ int CONTAINMENT_INVERSE_RESOLVING_UNSETTABLE = 7;
+
+ int NONCONTAINMENT = 8;
+ int NONCONTAINMENT_UNSETTABLE = 9;
+ int NONCONTAINMENT_RESOLVING = 10;
+ int NONCONTAINMENT_RESOLVING_UNSETTABLE = 11;
+ int NONCONTAINMENT_INVERSE = 12;
+ int NONCONTAINMENT_INVERSE_UNSETTABLE = 13;
+ int NONCONTAINMENT_MANYINVERSE = 14;
+ int NONCONTAINMENT_MANYINVERSE_UNSETTABLE = 15;
+ int NONCONTAINMENT_INVERSE_RESOLVING = 16;
+ int NONCONTAINMENT_INVERSE_RESOLVING_UNSETTABLE = 17;
+ int NONCONTAINMENT_MANYINVERSE_RESOLVING = 18;
+ int NONCONTAINMENT_MANYINVERSE_RESOLVING_UNSETTABLE = 19;
+
+ int DATATYPE = 20;
+ int DATATYPE_UNSETTABLE = 21;
+ int DATATYPE_UNIQUE = 22;
+ int DATATYPE_UNIQUE_UNSETTABLE = 23;
+
+ int BASIC = 24;
+ }
+
+ /**
+ * @deprecated
+ */
+ protected List createPropertyList(int listKind, Class dataClass, int property)
+ {
+ return createPropertyList(listKind, dataClass, property, 0);
+ }
+
+ protected List createPropertyList(int listKind, Class dataClass, int property, int reverseProperty)
+ {
+ switch (listKind)
+ {
+ case ListKind.CONTAINMENT:
+ return new EObjectContainmentEList(dataClass, this, property);
+ case ListKind.CONTAINMENT_INVERSE_RESOLVING_UNSETTABLE:
+ return new EObjectContainmentWithInverseEList.Unsettable.Resolving(dataClass, this, property, reverseProperty);
+ case ListKind.CONTAINMENT_INVERSE_RESOLVING:
+ return new EObjectContainmentWithInverseEList.Resolving(dataClass, this, property, reverseProperty);
+ case ListKind.CONTAINMENT_INVERSE_UNSETTABLE:
+ return new EObjectContainmentWithInverseEList.Unsettable(dataClass, this, property, reverseProperty);
+ case ListKind.CONTAINMENT_INVERSE:
+ return new EObjectContainmentWithInverseEList(dataClass, this, property, reverseProperty);
+ case ListKind.CONTAINMENT_RESOLVING_UNSETTABLE:
+ return new EObjectContainmentEList.Unsettable.Resolving(dataClass, this, property);
+ case ListKind.CONTAINMENT_RESOLVING:
+ return new EObjectContainmentEList.Resolving(dataClass, this, property);
+ case ListKind.CONTAINMENT_UNSETTABLE:
+ return new EObjectContainmentEList.Unsettable(dataClass, this, property);
+ case ListKind.NONCONTAINMENT_MANYINVERSE_RESOLVING_UNSETTABLE:
+ return new EObjectWithInverseResolvingEList.Unsettable.ManyInverse(dataClass, this, property, reverseProperty);
+ case ListKind.NONCONTAINMENT_MANYINVERSE_RESOLVING:
+ return new EObjectWithInverseResolvingEList.ManyInverse(dataClass, this, property, reverseProperty);
+ case ListKind.NONCONTAINMENT_INVERSE_RESOLVING_UNSETTABLE:
+ return new EObjectWithInverseResolvingEList.Unsettable(dataClass, this, property, reverseProperty);
+ case ListKind.NONCONTAINMENT_INVERSE_RESOLVING:
+ return new EObjectWithInverseResolvingEList(dataClass, this, property, reverseProperty);
+ case ListKind.NONCONTAINMENT_MANYINVERSE_UNSETTABLE:
+ return new EObjectWithInverseEList.Unsettable.ManyInverse(dataClass, this, property, reverseProperty);
+ case ListKind.NONCONTAINMENT_MANYINVERSE:
+ return new EObjectWithInverseEList.ManyInverse(dataClass, this, property, reverseProperty);
+ case ListKind.NONCONTAINMENT_INVERSE_UNSETTABLE:
+ return new EObjectWithInverseEList.Unsettable(dataClass, this, property, reverseProperty);
+ case ListKind.NONCONTAINMENT_INVERSE:
+ return new EObjectWithInverseEList(dataClass, this, property, reverseProperty);
+ case ListKind.NONCONTAINMENT_RESOLVING_UNSETTABLE:
+ return new EObjectResolvingEList.Unsettable(dataClass, this, property);
+ case ListKind.NONCONTAINMENT_RESOLVING:
+ return new EObjectResolvingEList(dataClass, this, property);
+ case ListKind.NONCONTAINMENT_UNSETTABLE:
+ return new EObjectEList.Unsettable(dataClass, this, property);
+ case ListKind.NONCONTAINMENT:
+ return new EObjectEList(dataClass, this, property);
+ case ListKind.DATATYPE_UNIQUE_UNSETTABLE:
+ return new EDataTypeUniqueEList.Unsettable(dataClass, this, property);
+ case ListKind.DATATYPE_UNIQUE:
+ return new EDataTypeUniqueEList(dataClass, this, property);
+ case ListKind.DATATYPE_UNSETTABLE:
+ return new EDataTypeEList.Unsettable(dataClass, this, property);
+ case ListKind.DATATYPE:
+ return new EDataTypeEList(dataClass, this, property);
+ }
+ return null;
+ }
+
+ protected BasicSequence createSequence(int property) {
+ return new BasicSequence(new BasicFeatureMap(this, property));
+ }
+
+ protected Sequence createSequence(Sequence sequence, Type type, int propertyIndex) {
+ return new BasicSequence((FeatureMap.Internal)((FeatureMap.Internal.Wrapper)sequence).featureMap().list(((EClass)type).getEStructuralFeature(propertyIndex)));
+ }
+
+ protected void createChangeSummary(int property) {
+ ChangeSummaryImpl changeSummary = (ChangeSummaryImpl)SDOFactory.eINSTANCE.createChangeSummary();
+ set(property, changeSummary);
+ changeSummary.setDataObject(this);
+ }
+
+ /*
+ * get the value of the type's property at propertyIndex via the sequence
+ * @param seq
+ * @param type
+ * @param propertyIndex
+ * @return
+ */
+ protected Object get(Sequence seq, Type type, int propertyIndex) {
+ return ((FeatureMap.Internal.Wrapper)seq).featureMap().get(((EClass)type).getEStructuralFeature(propertyIndex), true);
+ }
+
+ protected List getList(Sequence seq, Type type, int propertyIndex) {
+ return ((FeatureMap.Internal.Wrapper)seq).featureMap().list(((EClass)type).getEStructuralFeature(propertyIndex));
+ }
+
+ protected void set(Sequence seq, Type type, int propertyIndex, Object newValue) {
+ ((FeatureMap.Internal)((FeatureMap.Internal.Wrapper)seq).featureMap()).set(((EClass)type).getEStructuralFeature(propertyIndex), newValue);
+ }
+
+ protected void unset(Sequence seq, Type type, int propertyIndex) {
+ ((FeatureMap.Internal)((FeatureMap.Internal.Wrapper)seq).featureMap()).clear(((EClass)type).getEStructuralFeature(propertyIndex));
+
+ }
+ protected boolean isSet(Sequence seq, Type type, int propertyIndex) {
+ return !((FeatureMap.Internal)((FeatureMap.Internal.Wrapper)seq).featureMap()).isEmpty(((EClass)type).getEStructuralFeature(propertyIndex));
+ }
+
+ protected boolean isSequenceEmpty(Sequence sequence) {
+ return ((FeatureMap.Internal.Wrapper)sequence).featureMap().isEmpty();
+ }
+
+ protected void setSequence(Sequence seq, Object newValue) {
+ ((FeatureMap.Internal)((FeatureMap.Internal.Wrapper)seq).featureMap()).set(newValue);
+ }
+
+ protected void unsetSequence(Sequence seq) {
+ ((FeatureMap.Internal.Wrapper)seq).featureMap().clear();
+ }
+
+ protected ChangeContext basicAdd(Sequence seq, Type type, int propertyIndex, Object newValue, ChangeContext changeContext) {
+ ChangeContextImpl changeContextImpl = (ChangeContextImpl)changeContext;
+ changeContextImpl.notificationChain = ((FeatureMap.Internal)((FeatureMap.Internal.Wrapper)seq).featureMap()).basicAdd(((EClass)type).getEStructuralFeature(propertyIndex), newValue, changeContextImpl.notificationChain);
+ return changeContextImpl;
+ }
+
+ protected Object get(int featureID, boolean resolve)
+ {
+ return null;
+ }
+
+ private ChangeContextImpl initializeChangeContext(ChangeContext changeContext)
+ {
+ ChangeContextImpl changeContextImpl;
+ if (changeContext == null)
+ {
+ changeContextImpl = new ChangeContextImpl(null);
+ } else
+ {
+ changeContextImpl = (ChangeContextImpl)changeContext;
+ }
+ return changeContextImpl;
+ }
+
+ protected interface ChangeContext {}
+
+
+ protected ChangeContext inverseRemove(Object otherEnd, int propertyIndex, ChangeContext changeContext)
+ {
+ ChangeContextImpl changeContextImpl = initializeChangeContext(changeContext);
+ changeContextImpl.notificationChain = super.eInverseRemove((InternalEObject)otherEnd, propertyIndex, changeContextImpl.notificationChain);
+ return changeContextImpl;
+ }
+
+ protected ChangeContext inverseAdd(Object otherEnd, int propertyIndex, ChangeContext changeContext)
+ {
+ ChangeContextImpl changeContextImpl = initializeChangeContext(changeContext);
+ changeContextImpl.notificationChain = super.eInverseAdd((InternalEObject)otherEnd, propertyIndex, changeContextImpl.notificationChain);
+ return changeContextImpl;
+ }
+
+ protected ChangeContext inverseRemove(Object thisEnd, Object otherEnd, int propertyIndex, Class baseClass, ChangeContext changeContext)
+ {
+ ChangeContextImpl changeContextImpl = initializeChangeContext(changeContext);
+ changeContextImpl.notificationChain = ((InternalEObject)thisEnd).eInverseRemove((InternalEObject)otherEnd, propertyIndex, baseClass, changeContextImpl.notificationChain);
+ return changeContextImpl;
+ }
+
+ protected ChangeContext inverseAdd(Object thisEnd, Object otherEnd, int propertyIndex, Class baseClass, ChangeContext changeContext)
+ {
+ ChangeContextImpl changeContextImpl = initializeChangeContext(changeContext);
+ changeContextImpl.notificationChain = ((InternalEObject)thisEnd).eInverseAdd((InternalEObject)otherEnd, propertyIndex, baseClass, changeContextImpl.notificationChain);
+ return changeContextImpl;
+ }
+
+ protected ChangeContext addNotification(Object notifier, int eventType, int featureID, Object oldValue, Object newValue, boolean isSetChanged, ChangeContext changeContext)
+ {
+ ENotificationImpl notification = new ENotificationImpl((InternalEObject)notifier, eventType, featureID, oldValue, newValue, isSetChanged );
+ ChangeContextImpl changeContextImpl = initializeChangeContext(changeContext);
+ if (changeContextImpl.notificationChain == null) changeContextImpl.notificationChain = notification; else changeContextImpl.notificationChain.add(notification);
+ return changeContextImpl;
+ }
+
+ protected ChangeContext addNotification(Object notifier, int eventType, int featureID, Object oldValue, Object newValue, ChangeContext changeContext)
+ {
+ ENotificationImpl notification = new ENotificationImpl((InternalEObject)notifier, eventType, featureID, oldValue, newValue);
+ ChangeContextImpl changeContextImpl = initializeChangeContext(changeContext);
+ if (changeContextImpl.notificationChain == null) changeContextImpl.notificationChain = notification; else changeContextImpl.notificationChain.add(notification);
+ return changeContextImpl;
+ }
+
+ protected ChangeContext removeFromList(List propertyList, Object objectToRemove, ChangeContext changeContext)
+ {
+ ChangeContextImpl changeContextImpl = initializeChangeContext(changeContext);
+ changeContextImpl.notificationChain = ((InternalEList)propertyList).basicRemove(objectToRemove, changeContextImpl.notificationChain);
+ return changeContextImpl;
+ }
+
+ protected ChangeContext removeFromSequence(Sequence sequence, Object otherEnd, ChangeContext changeContext)
+ {
+ ChangeContextImpl changeContextImpl = initializeChangeContext(changeContext);
+ changeContextImpl.notificationChain = ((InternalEList)((FeatureMap.Internal.Wrapper)sequence).featureMap()).basicRemove(otherEnd, changeContextImpl.notificationChain);
+ return changeContextImpl;
+ }
+
+ protected void dispatch(ChangeContext changeContext)
+ {
+ ChangeContextImpl changeContextImpl = initializeChangeContext(changeContext);
+ if (changeContextImpl.notificationChain != null)
+ {
+ changeContextImpl.notificationChain.dispatch();
+ }
+ }
+
+ protected boolean isProxy() // FB TODO : regen models and then remove this method
+ {
+ return eIsProxy();
+ }
+
+ protected boolean isProxy(Object object)
+ {
+ return ((EObject)object).eIsProxy();
+ }
+
+ protected Object resolveProxy(Object proxy)
+ {
+ return EcoreUtil.resolve((EObject)proxy, this);
+ }
+
+
+ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ // Following methods override EMF methods to work with pure SDO generated subclasses
+ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+ public EClass eStaticClass()
+ {
+ return (EClass)getType();
+ }
+
+ public Type getType() // must be overridem in subclasses
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ protected int internalConvertIndex(int internalIndex)
+ {
+ return internalIndex;
+ }
+
+ public Object eGet(int featureID, boolean resolve, boolean coreType)
+ {
+ Object result = get(internalConvertIndex(featureID), resolve);
+ if (coreType)
+ {
+ if (result instanceof FeatureMap.Internal.Wrapper) result = ((FeatureMap.Internal.Wrapper)result).featureMap();
+ }
+ return result;
+ }
+
+ public void eSet(int featureID, Object newValue)
+ {
+ set(internalConvertIndex(featureID), newValue);
+ }
+
+ public void eUnset(int featureID)
+ {
+ unset(internalConvertIndex(featureID));
+ }
+
+ public boolean eIsSet(int featureID)
+ {
+ return isSet(internalConvertIndex(featureID));
+ }
+
+ private class ChangeContextImpl implements ChangeContext
+ {
+ protected NotificationChain notificationChain;
+ public ChangeContextImpl(NotificationChain notificationChain) {
+ this.notificationChain = notificationChain;
+ }
+ }
+
+ //FB TODO ... review this? ... what about eInverseAdd?
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int propertyNumber, NotificationChain msgs)
+ {
+ return ((ChangeContextImpl)inverseRemove(otherEnd, propertyNumber, new ChangeContextImpl(msgs))).notificationChain;
+ }
+
+ public String toString()
+ {
+ StringBuffer result = new StringBuffer(getClass().getName());
+ result.append('@');
+ result.append(Integer.toHexString(hashCode()));
+ if (eIsProxy())
+ {
+ result.append(" (proxyURI: ");
+ result.append(eProxyURI());
+ result.append(')');
+ }
+ return result.toString();
+ }
+
+} //DataObjectBase
+
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DataObjectImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DataObjectImpl.java
new file mode 100644
index 0000000000..4ba255ebb0
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DataObjectImpl.java
@@ -0,0 +1,1518 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.impl;
+
+
+import java.io.ObjectStreamException;
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.Date;
+import java.util.List;
+
+import org.apache.tuscany.sdo.SDOPackage;
+import org.apache.tuscany.sdo.impl.ChangeSummaryImpl.SDOChangeRecorder;
+import org.apache.tuscany.sdo.util.DataObjectUtil;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.InternalEObject;
+import org.eclipse.emf.ecore.EStructuralFeature.Internal.DynamicValueHolder;
+import org.eclipse.emf.ecore.impl.BasicEObjectImpl;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.util.EContentsEList;
+import org.eclipse.emf.ecore.util.ECrossReferenceEList;
+
+import commonj.sdo.ChangeSummary;
+import commonj.sdo.DataGraph;
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
+import commonj.sdo.Sequence;
+import commonj.sdo.Type;
+import commonj.sdo.impl.ExternalizableDelegator;
+
+
+/**
+ * <!-- begin-user-doc -->
+ * Base implementation of the SDO DataObject interface. This implementation allocates the minimum storage
+ * overhead needed for SDO. It provides a complete implementation of the API, but does not, however, allocate
+ * any storage for the actual properties of the data object. It instead requires subclasses for this purpose.
+ * The subclass, DynamicDataObjectImpl serves as a concrete implementation class for dynamic data objects.
+ * Static data object storage is provided by generated classes, which also directly or indirectly derive from
+ * this class.
+ * <!-- end-user-doc -->
+ * <p>
+ * </p>
+ *
+ * @generated
+ */
+public abstract class DataObjectImpl extends BasicEObjectImpl implements DataObject
+{
+ protected InternalEObject eContainer;
+ protected int eContainerFeatureID;
+ protected SDOChangeRecorder changeRecorder;
+ protected Object location; // Resource.Internal (if object is directly contained in a resource) or URI (if it is a proxy)
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected DataObjectImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Object get(int propertyIndex)
+ {
+ return get(DataObjectUtil.getProperty(this, propertyIndex));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void set(int propertyIndex, Object value)
+ {
+ set(DataObjectUtil.getProperty(this, propertyIndex), value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public boolean isSet(int propertyIndex)
+ {
+ return isSet(DataObjectUtil.getProperty(this, propertyIndex));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void unset(int propertyIndex)
+ {
+ unset(DataObjectUtil.getProperty(this, propertyIndex));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Object get(Property property)
+ {
+ return eGet((EStructuralFeature)property, true, false);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void set(Property property, Object value)
+ {
+ eSet((EStructuralFeature)property, value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public boolean isSet(Property property)
+ {
+ return eIsSet((EStructuralFeature)property);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void unset(Property property)
+ {
+ eUnset((EStructuralFeature)property);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public DataObject getContainer()
+ {
+ return (DataObject)eContainer();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Property getContainmentProperty()
+ {
+ return (Property)eContainmentFeature();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Type getType()
+ {
+ return (Type)eClass();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Object writeReplace() throws ObjectStreamException
+ {
+ return new ExternalizableDelegator(this);
+ }
+
+
+ // Remaining DataObject methods are implemented as straight delegation to DataObjectUtil
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Object get(String path)
+ {
+ return DataObjectUtil.get(this, path);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void set(String path, Object value)
+ {
+ DataObjectUtil.set(this, path, value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public boolean isSet(String path)
+ {
+ return DataObjectUtil.isSet(this, path);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void unset(String path)
+ {
+ DataObjectUtil.unset(this, path);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public DataGraph getDataGraph()
+ {
+ return DataObjectUtil.getDataGraph(this);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public BigDecimal getBigDecimal(String path)
+ {
+ return DataObjectUtil.getBigDecimal(get(path));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public BigInteger getBigInteger(String path)
+ {
+ return DataObjectUtil.getBigInteger(get(path));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public boolean getBoolean(String path)
+ {
+ return DataObjectUtil.getBoolean(get(path));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public byte getByte(String path)
+ {
+ return DataObjectUtil.getByte(get(path));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public byte[] getBytes(String path)
+ {
+ return DataObjectUtil.getBytes(get(path));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public char getChar(String path)
+ {
+ return DataObjectUtil.getChar(get(path));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public DataObject getDataObject(String path)
+ {
+ return (DataObject)get(path);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Date getDate(String path)
+ {
+ return DataObjectUtil.getDate(get(path));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public double getDouble(String path)
+ {
+ return DataObjectUtil.getDouble(get(path));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public float getFloat(String path)
+ {
+ return DataObjectUtil.getFloat(get(path));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public int getInt(String path)
+ {
+ return DataObjectUtil.getInt(get(path));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public List getList(String path)
+ {
+ return (List)get(path);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public long getLong(String path)
+ {
+ return DataObjectUtil.getLong(get(path));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Sequence getSequence(String path)
+ {
+ return (Sequence)get(path);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public short getShort(String path)
+ {
+ return DataObjectUtil.getShort(get(path));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String getString(String path)
+ {
+ return DataObjectUtil.getString(get(path));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setBigDecimal(String path, BigDecimal value)
+ {
+ DataObjectUtil.setBigDecimal(this, path, value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setBigInteger(String path, BigInteger value)
+ {
+ DataObjectUtil.setBigInteger(this, path, value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setBoolean(String path, boolean value)
+ {
+ DataObjectUtil.setBoolean(this, path, value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setByte(String path, byte value)
+ {
+ DataObjectUtil.setByte(this, path, value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setBytes(String path, byte[] value)
+ {
+ DataObjectUtil.setBytes(this, path, value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setChar(String path, char value)
+ {
+ DataObjectUtil.setChar(this, path, value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setDataObject(String path, DataObject value)
+ {
+ DataObjectUtil.set(this, path, value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setDate(String path, Date value)
+ {
+ DataObjectUtil.setDate(this,path,value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setDouble(String path, double value)
+ {
+ DataObjectUtil.setDouble(this, path, value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setFloat(String path, float value)
+ {
+ DataObjectUtil.setFloat(this, path, value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setInt(String path, int value)
+ {
+ DataObjectUtil.setInt(this, path, value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setList(String path, List value)
+ {
+ DataObjectUtil.set(this, path, value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setLong(String path, long value)
+ {
+ DataObjectUtil.setLong(this, path, value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setShort(String path, short value)
+ {
+ DataObjectUtil.setShort(this, path, value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setString(String path, String value)
+ {
+ DataObjectUtil.setString(this, path, value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public BigDecimal getBigDecimal(int propertyIndex)
+ {
+ return DataObjectUtil.getBigDecimal(this, propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public BigInteger getBigInteger(int propertyIndex)
+ {
+ return DataObjectUtil.getBigInteger(this,propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public boolean getBoolean(int propertyIndex)
+ {
+ return DataObjectUtil.getBoolean(this, propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public byte getByte(int propertyIndex)
+ {
+ return DataObjectUtil.getByte(this, propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public byte[] getBytes(int propertyIndex)
+ {
+ return DataObjectUtil.getBytes(this, propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public char getChar(int propertyIndex)
+ {
+ return DataObjectUtil.getChar(this, propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public DataObject getDataObject(int propertyIndex)
+ {
+ return DataObjectUtil.getDataObject(this, propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Date getDate(int propertyIndex)
+ {
+ return DataObjectUtil.getDate(this,propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public double getDouble(int propertyIndex)
+ {
+ return DataObjectUtil.getDouble(this, propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public float getFloat(int propertyIndex)
+ {
+ return DataObjectUtil.getFloat(this,propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public int getInt(int propertyIndex)
+ {
+ return DataObjectUtil.getInt(this,propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public List getList(int propertyIndex)
+ {
+ return DataObjectUtil.getList(this, propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public long getLong(int propertyIndex)
+ {
+ return DataObjectUtil.getLong(this,propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Sequence getSequence(int propertyIndex)
+ {
+ return DataObjectUtil.getSequence(this, propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public short getShort(int propertyIndex)
+ {
+ return DataObjectUtil.getShort(this,propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String getString(int propertyIndex)
+ {
+ return DataObjectUtil.getString(this,propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setBigDecimal(int propertyIndex, BigDecimal value)
+ {
+ DataObjectUtil.setBigDecimal(this, propertyIndex, value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setBigInteger(int propertyIndex, BigInteger value)
+ {
+ DataObjectUtil.setBigInteger(this, propertyIndex, value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setBoolean(int propertyIndex, boolean value)
+ {
+ DataObjectUtil.setBoolean(this, propertyIndex, value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setByte(int propertyIndex, byte value)
+ {
+ DataObjectUtil.setByte(this, propertyIndex, value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setBytes(int propertyIndex, byte[] value)
+ {
+ DataObjectUtil.setBytes(this, propertyIndex, value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setChar(int propertyIndex, char value)
+ {
+ DataObjectUtil.setChar(this, propertyIndex, value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setDataObject(int propertyIndex, DataObject value)
+ {
+ DataObjectUtil.setDataObject(this, propertyIndex, value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setDate(int propertyIndex, Date value)
+ {
+ DataObjectUtil.setDate(this, propertyIndex, value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setDouble(int propertyIndex, double value)
+ {
+ DataObjectUtil.setDouble(this, propertyIndex, value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setFloat(int propertyIndex, float value)
+ {
+ DataObjectUtil.setFloat(this, propertyIndex, value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setInt(int propertyIndex, int value)
+ {
+ DataObjectUtil.setInt(this, propertyIndex, value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setList(int propertyIndex, List value)
+ {
+ DataObjectUtil.setList(this, propertyIndex, value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setLong(int propertyIndex, long value)
+ {
+ DataObjectUtil.setLong(this, propertyIndex, value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setShort(int propertyIndex, short value)
+ {
+ DataObjectUtil.setShort(this, propertyIndex, value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setString(int propertyIndex, String value)
+ {
+ DataObjectUtil.setString(this, propertyIndex, value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public BigDecimal getBigDecimal(Property property)
+ {
+ return DataObjectUtil.getBigDecimal(this, property);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public BigInteger getBigInteger(Property property)
+ {
+ return DataObjectUtil.getBigInteger(this, property);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public boolean getBoolean(Property property)
+ {
+ return DataObjectUtil.getBoolean(this, property);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public byte getByte(Property property)
+ {
+ return DataObjectUtil.getByte(this, property);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public byte[] getBytes(Property property)
+ {
+ return DataObjectUtil.getBytes(this, property);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public char getChar(Property property)
+ {
+ return DataObjectUtil.getChar(this, property);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public DataObject getDataObject(Property property)
+ {
+ return (DataObject)DataObjectUtil.getDataObject(this,property);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Date getDate(Property property)
+ {
+ return DataObjectUtil.getDate(this, property);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public double getDouble(Property property)
+ {
+ return DataObjectUtil.getDouble(this, property);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public float getFloat(Property property)
+ {
+ return DataObjectUtil.getFloat(this, property);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public int getInt(Property property)
+ {
+ return DataObjectUtil.getInt(this, property);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public List getList(Property property)
+ {
+ return (List)DataObjectUtil.getList(this, property);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public long getLong(Property property)
+ {
+ return DataObjectUtil.getLong(this, property);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Sequence getSequence(Property property)
+ {
+ return (Sequence)DataObjectUtil.getSequence(this, property);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public short getShort(Property property)
+ {
+ return DataObjectUtil.getShort(this, property);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String getString(Property property)
+ {
+ return DataObjectUtil.getString(this, property);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setBigDecimal(Property property, BigDecimal value)
+ {
+ DataObjectUtil.setBigDecimal(this,property, value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setBigInteger(Property property, BigInteger value)
+ {
+ DataObjectUtil.setBigInteger(this,property, value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setBoolean(Property property, boolean value)
+ {
+ DataObjectUtil.setBoolean(this,property, value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setByte(Property property, byte value)
+ {
+ DataObjectUtil.setByte(this,property, value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setBytes(Property property, byte[] value)
+ {
+ DataObjectUtil.setBytes(this,property, value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setChar(Property property, char value)
+ {
+ DataObjectUtil.setChar(this,property, value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setDataObject(Property property, DataObject value)
+ {
+ DataObjectUtil.setDataObject(this,property, value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setDate(Property property, Date value)
+ {
+ DataObjectUtil.setDate(this,property, value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setDouble(Property property, double value)
+ {
+ DataObjectUtil.setDouble(this,property, value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setFloat(Property property, float value)
+ {
+ DataObjectUtil.setFloat(this,property, value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setInt(Property property, int value)
+ {
+ DataObjectUtil.setInt(this,property, value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setList(Property property, List value)
+ {
+ DataObjectUtil.setList(this,property, value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setLong(Property property, long value)
+ {
+ DataObjectUtil.setLong(this,property, value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setShort(Property property, short value)
+ {
+ DataObjectUtil.setShort(this,property, value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setString(Property property, String value)
+ {
+ DataObjectUtil.setString(this,property, value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public DataObject createDataObject(String propertyName)
+ {
+ return DataObjectUtil.createDataObject(this, propertyName);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public DataObject createDataObject(int propertyIndex)
+ {
+ return DataObjectUtil.createDataObject(this, propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public DataObject createDataObject(Property property)
+ {
+ return DataObjectUtil.createDataObject(this,property);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public DataObject createDataObject(String propertyName, String namespaceURI, String typeName)
+ {
+ return DataObjectUtil.createDataObject(this, propertyName, namespaceURI, typeName);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public DataObject createDataObject(int propertyIndex, String namespaceURI, String typeName)
+ {
+ return DataObjectUtil.createDataObject(this, propertyIndex, namespaceURI, typeName);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public DataObject createDataObject(Property property, Type type)
+ {
+ return DataObjectUtil.createDataObject(this, property, type);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void delete()
+ {
+ DataObjectUtil.delete(this);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Sequence getSequence()
+ {
+ EAttribute sequenceFeature = ((ClassImpl)eClass()).getSequenceFeature();
+ return sequenceFeature != null ? (Sequence)eGet(sequenceFeature, true, false) : null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public List getInstanceProperties()
+ {
+ return DataObjectUtil.getInstanceProperties(this);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Property getInstanceProperty(String propertyName)
+ {
+ return DataObjectUtil.getInstanceProperty(this, propertyName);
+ }
+
+ /**
+ * @deprecated
+ */
+ public Property getProperty(String propertyName)
+ {
+ return DataObjectUtil.getInstanceProperty(this, propertyName);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public DataObject getRootObject()
+ {
+ return DataObjectUtil.getRootObject(this);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public ChangeSummary getChangeSummary()
+ {
+ return DataObjectUtil.getChangeSummary(this);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void detach()
+ {
+ DataObjectUtil.detach(this);
+ }
+
+ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ // Following methods customize BasicEObjectImpl, optimized for SDO
+ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EClass eStaticClass()
+ {
+ return SDOPackage.eINSTANCE.getDataObject();
+ }
+
+ public boolean eNotificationRequired()
+ {
+ return changeRecorder != null;
+ }
+
+ public void eNotify(Notification notification)
+ {
+ changeRecorder.notifyChanged(notification);
+ }
+
+ public void setChangeRecorder(SDOChangeRecorder changeRecorder)
+ {
+ if (this.changeRecorder != null)
+ {
+ this.changeRecorder.unsetTarget(this);
+ }
+
+ if (changeRecorder != null)
+ {
+ changeRecorder.setTarget(this);
+ }
+
+ this.changeRecorder = changeRecorder;
+ }
+
+ public InternalEObject eInternalContainer()
+ {
+ return eContainer;
+ }
+
+ public int eContainerFeatureID()
+ {
+ return eContainerFeatureID;
+ }
+
+ protected void eBasicSetContainer(InternalEObject newContainer, int newContainerFeatureID)
+ {
+ eContainer = newContainer;
+ eContainerFeatureID = newContainerFeatureID;
+ }
+
+ public EClass eClass()
+ {
+ return eStaticClass();
+ }
+
+ public EList eContents()
+ {
+ return new EContentsEList(this);
+ }
+
+ public EList eCrossReferences()
+ {
+ return new ECrossReferenceEList(this);
+ }
+
+ public Resource.Internal eDirectResource()
+ {
+ return location instanceof Resource.Internal ? (Resource.Internal)location : null;
+ }
+
+ protected EClass eDynamicClass()
+ {
+ return null;
+ }
+
+ protected boolean eHasSettings()
+ {
+ return false;
+ }
+
+ public boolean eIsProxy()
+ {
+ return location instanceof URI;
+ }
+
+ public URI eProxyURI()
+ {
+ return location instanceof URI ? (URI)location : null;
+ }
+
+ public void eSetClass(EClass eClass)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ protected void eSetDirectResource(Resource.Internal resource)
+ {
+ location = resource;
+ }
+
+ public void eSetProxyURI(URI uri)
+ {
+ location = uri;
+ }
+
+ protected DynamicValueHolder eSettings()
+ {
+ return null;
+ }
+
+ public Object eGet(int featureID, boolean resolve, boolean coreType)
+ {
+ return eDynamicGet(featureID, resolve, coreType);
+ }
+
+ public void eSet(int featureID, Object newValue)
+ {
+ eDynamicSet(featureID, newValue);
+ }
+
+ public void eUnset(int featureID)
+ {
+ eDynamicUnset(featureID);
+ }
+
+ public boolean eIsSet(int featureID)
+ {
+ return eDynamicIsSet(featureID);
+ }
+
+ public Object eDynamicGet(int featureID, boolean resolve, boolean coreType)
+ {
+ return eOpenGet(DataObjectUtil.getOpenFeature(this, featureID), resolve);
+ }
+
+ public void eDynamicSet(int featureID, Object newValue)
+ {
+ eOpenSet(DataObjectUtil.getOpenFeature(this, featureID), newValue);
+ }
+
+ public void eDynamicUnset(int featureID)
+ {
+ eOpenUnset(DataObjectUtil.getOpenFeature(this, featureID));
+ }
+
+ public boolean eDynamicIsSet(int featureID)
+ {
+ return eOpenIsSet(DataObjectUtil.getOpenFeature(this, featureID));
+ }
+
+ /*
+ public int eDerivedStructuralFeatureID(EStructuralFeature eStructuralFeature)
+ {
+ Class containerClass = eStructuralFeature.getContainerClass();
+ return
+ containerClass == null ?
+ eClass().getFeatureID(eStructuralFeature) :
+ containerClass.isInstance(this) ?
+ eDerivedStructuralFeatureID(eStructuralFeature.getFeatureID(), containerClass) :
+ -1;
+ }
+
+ public void eOpenSet(EStructuralFeature eFeature, Object newValue)
+ {
+ EStructuralFeature openFeature = ExtendedMetaData.INSTANCE.getAffiliation(eClass(), eFeature);
+ if (openFeature == null)
+ {
+ openFeature = (EStructuralFeature)eClass().getEStructuralFeature("any");
+ }
+ if (openFeature != null)
+ {
+ if (!FeatureMapUtil.isFeatureMap(openFeature))
+ {
+ openFeature = ExtendedMetaData.INSTANCE.getGroup(openFeature);
+ }
+ FeatureMap featureMap = (FeatureMap)eGet(openFeature);
+ ((FeatureMap.Internal)featureMap).set(eFeature, newValue);
+ }
+ else
+ {
+ throw new IllegalArgumentException("The feature '" + eFeature.getName() + "' is not a valid changeable feature");
+ }
+ }
+ */
+
+} //DataObjectImpl
+
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DataTypeImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DataTypeImpl.java
new file mode 100644
index 0000000000..dee124429f
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DataTypeImpl.java
@@ -0,0 +1,781 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.impl;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.tuscany.sdo.SDOPackage;
+import org.apache.tuscany.sdo.util.DataObjectUtil;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.impl.EDataTypeImpl;
+import org.eclipse.emf.ecore.util.ExtendedMetaData;
+
+import commonj.sdo.Property;
+import commonj.sdo.Sequence;
+import commonj.sdo.Type;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Data Type</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * </p>
+ *
+ * @generated
+ */
+public class DataTypeImpl extends EDataTypeImpl implements Type, org.apache.tuscany.sdo.model.Type/*, DataObject*/
+{
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected DataTypeImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ protected EClass eStaticClass()
+ {
+ return SDOPackage.eINSTANCE.getDataType();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String getURI()
+ {
+ return getEPackage().getNsURI();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public boolean isDataType()
+ {
+ return true;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public boolean isOpen()
+ {
+ return false;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public boolean isSequenced()
+ {
+ return false;
+ }
+
+ protected List aliasNames = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public List getAliasNames()
+ {
+ if (aliasNames == null)
+ {
+ aliasNames = DataObjectUtil.getAliasNames(this);
+ }
+ return aliasNames;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public List getDeclaredProperties()
+ {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public List getProperties()
+ {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public List getBaseTypes()
+ {
+ EDataType dataType = ExtendedMetaData.INSTANCE.getBaseType(this);
+ if (dataType == null)
+ {
+ return Collections.EMPTY_LIST;
+ }
+ else
+ {
+ return Collections.singletonList(dataType);
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Property getProperty(String propertyName)
+ {
+ return null;
+ }
+
+ public List getInstanceProperties() {
+ return DataObjectUtil.getMetaObjectInstanceProperties(this);
+ }
+
+ public Object get(Property property) {
+ return DataObjectUtil.getMetaObjectInstanceProperty(this, property);
+ }
+
+ /////////////////////////////////////////////////////////////////////////////////////////////////////////
+ // org.apache.tuscany.sdo.model.Type method implementations
+ /////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+ public List getBaseType() {
+ return this.getBaseTypes();
+ }
+
+ public List getProperty() {
+ return this.getProperties();
+ }
+
+ public List getAliasName() {
+ return this.getAliasNames();
+ }
+
+ public Sequence getAny() {
+ throw new UnsupportedOperationException();
+ }
+
+ public Sequence getAnyAttribute() {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean isAbstract()
+ {
+ return false;
+ }
+
+ public void setAbstract(boolean value) {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ }
+
+ public boolean isSetAbstract() {
+ return false;
+ }
+
+ public void unsetAbstract() {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ }
+
+ public void setDataType(boolean value) {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ }
+
+ public void unsetDataType() {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ }
+
+ public boolean isSetDataType() {
+ return true;
+ }
+
+ public void setOpen(boolean value) {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ }
+
+ public void unsetOpen() {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ }
+
+ public boolean isSetOpen() {
+ return false;
+ }
+
+ public void setSequenced(boolean value) {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ }
+
+ public void unsetSequenced() {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ }
+
+ public boolean isSetSequenced() {
+ return false;
+ }
+
+ public void unsetName()
+ {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ }
+
+ public boolean isSetName()
+ {
+ return true;
+ }
+
+ public void unsetUri()
+ {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ }
+
+ public boolean isSetUri()
+ {
+ return true;
+ }
+
+ public void setUri(String value) {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ }
+
+ public String getUri() {
+ return getURI();
+ }
+
+ /////////////////////////////////////////////////////////////////////////////////////////////////////////
+ // DataObject method implementations
+ /////////////////////////////////////////////////////////////////////////////////////////////////////////
+ /*
+ public Object get(int propertyIndex) {
+ Object ret = DataObjectUtil.get(this, propertyIndex);
+ return (ret != null) ?
+ ret : eGet(propertyIndex, true, false);
+ }
+
+ public void set(int propertyIndex, Object value) {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ }
+
+ public boolean isSet(int propertyIndex) {
+ return eIsSet(propertyIndex);
+ }
+
+ public void unset(int propertyIndex) {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ }
+
+ public Object get(Property property) {
+ Object ret = DataObjectUtil.get(this, ((EStructuralFeature)property).getFeatureID());
+ return (ret != null) ?
+ ret : eGet((EStructuralFeature)property, true, false);
+ }
+
+ public void set(Property property, Object value) {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ }
+
+ public boolean isSet(Property property) {
+ return eIsSet((EStructuralFeature)property);
+ }
+
+ public void unset(Property property) {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ }
+
+ public DataObject getContainer() {
+ return (DataObject)eContainer();
+ }
+
+ public Property getContainmentProperty() {
+ return (Property)eContainmentFeature();
+ }
+
+ public Type getType() {
+ return (Type)ModelPackageImpl.eINSTANCE.getType();
+ }
+
+ // Remaining DataObject methods are (will be) implemented as straight delegation to DataObjectUtil
+
+ public Object get(String path) {
+ return DataObjectUtil.get(this, path);
+ }
+
+ public void set(String path, Object value) {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ }
+
+ public boolean isSet(String path) {
+ return DataObjectUtil.isSet(this, path);
+ }
+
+ public void unset(String path) {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ }
+
+ public boolean getBoolean(String path) {
+ return DataObjectUtil.getBoolean(get(path));
+ }
+
+ public byte getByte(String path) {
+ return DataObjectUtil.getByte(get(path));
+ }
+
+ public char getChar(String path) {
+ return DataObjectUtil.getChar(get(path));
+ }
+
+ public double getDouble(String path) {
+ return DataObjectUtil.getDouble(get(path));
+ }
+
+ public float getFloat(String path) {
+ return DataObjectUtil.getFloat(get(path));
+ }
+
+ public int getInt(String path) {
+ return DataObjectUtil.getInt(get(path));
+ }
+
+ public long getLong(String path) {
+ return DataObjectUtil.getLong(get(path));
+ }
+
+ public short getShort(String path) {
+ return DataObjectUtil.getShort(get(path));
+ }
+
+ public byte[] getBytes(String path) {
+ return DataObjectUtil.getBytes(get(path));
+ }
+
+ public BigDecimal getBigDecimal(String path) {
+ return DataObjectUtil.getBigDecimal(get(path));
+ }
+
+ public BigInteger getBigInteger(String path) {
+ return DataObjectUtil.getBigInteger(get(path));
+ }
+
+ public DataObject getDataObject(String path) {
+ return (DataObject)get(path);
+ }
+
+ public Date getDate(String path) {
+ return DataObjectUtil.getDate(get(path));
+ }
+
+ public String getString(String path) {
+ return DataObjectUtil.getString(get(path));
+ }
+
+ public List getList(String path) {
+ return (List)get(path);
+ }
+
+ public Sequence getSequence(String path) {
+ return (Sequence)get(path);
+ }
+
+ public void setBoolean(String path, boolean value) {
+ set(path, new Boolean(value));
+ }
+
+ public void setByte(String path, byte value) {
+ set(path, new Byte(value));
+ }
+
+ public void setChar(String path, char value) {
+ set(path, new Character(value));
+ }
+
+ public void setDouble(String path, double value) {
+ set(path, new Double(value));
+ }
+
+ public void setFloat(String path, float value) {
+ set(path, new Float(value));
+ }
+
+ public void setInt(String path, int value) {
+ set(path, new Integer(value));
+ }
+
+ public void setLong(String path, long value) {
+ set(path, new Long(value));
+ }
+
+ public void setShort(String path, short value) {
+ set(path, new Short(value));
+ }
+
+ public void setBytes(String path, byte[] value) {
+ set(path, value);
+ }
+
+ public void setBigDecimal(String path, BigDecimal value) {
+ set(path, value);
+ }
+
+ public void setBigInteger(String path, BigInteger value) {
+ set(path, value);
+ }
+
+ public void setDataObject(String path, DataObject value) {
+ set(path, value);
+ }
+
+ public void setDate(String path, Date value) {
+ set(path, value);
+ }
+
+ public void setString(String path, String value) {
+ set(path, value);
+ }
+
+ public void setList(String path, List value) {
+ set(path, value);
+ }
+
+ public boolean getBoolean(int propertyIndex) {
+ return DataObjectUtil.getBoolean(this, propertyIndex);
+ }
+
+ public byte getByte(int propertyIndex) {
+ return DataObjectUtil.getByte(this, propertyIndex);
+ }
+
+ public char getChar(int propertyIndex) {
+ return DataObjectUtil.getChar(this, propertyIndex);
+ }
+
+ public double getDouble(int propertyIndex) {
+ return DataObjectUtil.getDouble(this, propertyIndex);
+ }
+
+ public float getFloat(int propertyIndex) {
+ return DataObjectUtil.getFloat(this, propertyIndex);
+ }
+
+ public int getInt(int propertyIndex) {
+ return DataObjectUtil.getInt(this, propertyIndex);
+ }
+
+ public long getLong(int propertyIndex) {
+ return DataObjectUtil.getLong(this, propertyIndex);
+ }
+
+ public short getShort(int propertyIndex) {
+ return DataObjectUtil.getShort(this, propertyIndex);
+ }
+
+ public byte[] getBytes(int propertyIndex) {
+ return DataObjectUtil.getBytes(this, propertyIndex);
+ }
+
+ public BigDecimal getBigDecimal(int propertyIndex) {
+ return DataObjectUtil.getBigDecimal(this, propertyIndex);
+ }
+
+ public BigInteger getBigInteger(int propertyIndex) {
+ return DataObjectUtil.getBigInteger(this, propertyIndex);
+ }
+
+ public DataObject getDataObject(int propertyIndex) {
+ return DataObjectUtil.getDataObject(this, propertyIndex);
+ }
+
+ public Date getDate(int propertyIndex) {
+ return DataObjectUtil.getDate(this, propertyIndex);
+ }
+
+ public String getString(int propertyIndex) {
+ return DataObjectUtil.getString(this, propertyIndex);
+ }
+
+ public List getList(int propertyIndex) {
+ return DataObjectUtil.getList(this, propertyIndex);
+ }
+
+ public Sequence getSequence(int propertyIndex) {
+ return DataObjectUtil.getSequence(this, propertyIndex);
+ }
+
+ public void setBoolean(int propertyIndex, boolean value) {
+ set(propertyIndex, new Boolean(value));
+ }
+
+ public void setByte(int propertyIndex, byte value) {
+ set(propertyIndex, new Byte(value));
+ }
+
+ public void setChar(int propertyIndex, char value) {
+ set(propertyIndex, new Character(value));
+ }
+
+ public void setDouble(int propertyIndex, double value) {
+ set(propertyIndex, new Double(value));
+ }
+
+ public void setFloat(int propertyIndex, float value) {
+ set(propertyIndex, new Float(value));
+ }
+
+ public void setInt(int propertyIndex, int value) {
+ set(propertyIndex, new Integer(value));
+ }
+
+ public void setLong(int propertyIndex, long value) {
+ set(propertyIndex, new Long(value));
+ }
+
+ public void setShort(int propertyIndex, short value) {
+ set(propertyIndex, new Short(value));
+ }
+
+ public void setBytes(int propertyIndex, byte[] value) {
+ set(propertyIndex, value);
+ }
+
+ public void setBigDecimal(int propertyIndex, BigDecimal value) {
+ set(propertyIndex, value);
+ }
+
+ public void setBigInteger(int propertyIndex, BigInteger value) {
+ set(propertyIndex, value);
+ }
+
+ public void setDataObject(int propertyIndex, DataObject value) {
+ set(propertyIndex, value);
+ }
+
+ public void setDate(int propertyIndex, Date value) {
+ set(propertyIndex, value);
+ }
+
+ public void setString(int propertyIndex, String value) {
+ set(propertyIndex, value);
+ }
+
+ public void setList(int propertyIndex, List value) {
+ set(propertyIndex, value);
+ }
+
+ public boolean getBoolean(Property property) {
+ return DataObjectUtil.getBoolean(this, property);
+ }
+
+ public byte getByte(Property property) {
+ return DataObjectUtil.getByte(this, property);
+ }
+
+ public char getChar(Property property) {
+ return DataObjectUtil.getChar(this, property);
+ }
+
+ public double getDouble(Property property) {
+ return DataObjectUtil.getDouble(this, property);
+ }
+
+ public float getFloat(Property property) {
+ return DataObjectUtil.getFloat(this, property);
+ }
+
+ public int getInt(Property property) {
+ return DataObjectUtil.getInt(this, property);
+ }
+
+ public long getLong(Property property) {
+ return DataObjectUtil.getLong(this, property);
+ }
+
+ public short getShort(Property property) {
+ return DataObjectUtil.getShort(this, property);
+ }
+
+ public byte[] getBytes(Property property) {
+ return DataObjectUtil.getBytes(this, property);
+ }
+
+ public BigDecimal getBigDecimal(Property property) {
+ return DataObjectUtil.getBigDecimal(this, property);
+ }
+
+ public BigInteger getBigInteger(Property property) {
+ return DataObjectUtil.getBigInteger(this, property);
+ }
+
+ public DataObject getDataObject(Property property) {
+ return DataObjectUtil.getDataObject(this, property);
+ }
+
+ public Date getDate(Property property) {
+ return DataObjectUtil.getDate(this, property);
+ }
+
+ public String getString(Property property) {
+ return DataObjectUtil.getString(this, property);
+ }
+
+ public List getList(Property property) {
+ return DataObjectUtil.getList(this, property);
+ }
+
+ public Sequence getSequence(Property property) {
+ return DataObjectUtil.getSequence(this, property);
+ }
+
+ public void setBoolean(Property property, boolean value) {
+ set(property, new Boolean(value));
+ }
+
+ public void setByte(Property property, byte value) {
+ set(property, new Byte(value));
+ }
+
+ public void setChar(Property property, char value) {
+ set(property, new Character(value));
+ }
+
+ public void setDouble(Property property, double value) {
+ set(property, new Double(value));
+ }
+
+ public void setFloat(Property property, float value) {
+ set(property, new Float(value));
+ }
+
+ public void setInt(Property property, int value) {
+ set(property, new Integer(value));
+ }
+
+ public void setLong(Property property, long value) {
+ set(property, new Long(value));
+ }
+
+ public void setShort(Property property, short value) {
+ set(property, new Short(value));
+ }
+
+ public void setBytes(Property property, byte[] value) {
+ set(property, value);
+ }
+
+ public void setBigDecimal(Property property, BigDecimal value) {
+ set(property, value);
+ }
+
+ public void setBigInteger(Property property, BigInteger value) {
+ set(property, value);
+ }
+
+ public void setDataObject(Property property, DataObject value) {
+ set(property, value);
+ }
+
+ public void setDate(Property property, Date value) {
+ set(property, value);
+ }
+
+ public void setString(Property property, String value) {
+ set(property, value);
+ }
+
+ public void setList(Property property, List value) {
+ set(property, value);
+ }
+
+ public DataObject createDataObject(String propertyName) {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ }
+
+ public DataObject createDataObject(int propertyIndex) {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ }
+
+ public DataObject createDataObject(Property property) {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ }
+
+ public DataObject createDataObject(String propertyName, String namespaceURI, String typeName) {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ }
+
+ public DataObject createDataObject(int propertyIndex, String namespaceURI, String typeName) {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ }
+
+ public DataObject createDataObject(Property property, Type type) {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ }
+
+ public void delete() {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ }
+
+ public DataGraph getDataGraph() {
+ return DataObjectUtil.getDataGraph(this);
+ }
+
+ public Sequence getSequence() {
+ EAttribute mixedFeature = BasicExtendedMetaData.INSTANCE.getMixedFeature(eClass());
+ return mixedFeature != null ? (Sequence)eGet(mixedFeature, true, false) : null;
+ }
+
+ public List getInstanceProperties() {
+ return DataObjectUtil.getInstanceProperties(this);
+ }
+
+ public DataObject getRootObject() {
+ return DataObjectUtil.getRootObject(this);
+ }
+
+ public ChangeSummary getChangeSummary() {
+ // TODO: implement this method
+ throw new UnsupportedOperationException();
+ }
+
+ public void detach() {
+ throw new UnsupportedOperationException("Type is frozen and cannot be modified");
+ }
+ */
+
+} //DataTypeImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DynamicDataObjectImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DynamicDataObjectImpl.java
new file mode 100644
index 0000000000..0e55aaa961
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DynamicDataObjectImpl.java
@@ -0,0 +1,208 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.impl;
+
+import org.apache.tuscany.sdo.SDOFactory;
+import org.apache.tuscany.sdo.SDOPackage;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.impl.EFactoryImpl;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Dynamic Data Object</b></em>'.
+ * @extends EStructuralFeature.Internal.DynamicValueHolder
+ * <!-- end-user-doc -->
+ * <p>
+ * </p>
+ *
+ * @generated
+ */
+public class DynamicDataObjectImpl extends DataObjectImpl implements DataObject, EStructuralFeature.Internal.DynamicValueHolder
+{
+ protected EClass eClass;
+ protected Object [] eSettings;
+
+ protected static final Object [] ENO_SETTINGS = new Object [0];
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected DynamicDataObjectImpl()
+ {
+ super();
+ }
+
+ /**
+ * Creates a dynamic DataObject.
+ */
+ public DynamicDataObjectImpl(EClass eClass)
+ {
+ super();
+ eSetClass(eClass);
+ Property csp = ((ClassImpl)eClass).getChangeSummaryProperty();
+ if (csp != null)
+ {
+ ChangeSummaryImpl changeSummary = (ChangeSummaryImpl)SDOFactory.eINSTANCE.createChangeSummary();
+ set(csp, changeSummary);
+ changeSummary.setDataObject(this);
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EClass eStaticClass()
+ {
+ return SDOPackage.eINSTANCE.getDynamicDataObject();
+ }
+
+ protected int eStaticFeatureCount()
+ {
+ return 0;
+ }
+
+ public int eDerivedStructuralFeatureID(EStructuralFeature eStructuralFeature)
+ {
+ return eClass().getFeatureID(eStructuralFeature);
+ }
+
+ protected boolean eHasSettings()
+ {
+ return eSettings != null;
+ }
+
+ protected EStructuralFeature.Internal.DynamicValueHolder eSettings()
+ {
+ if (eSettings == null)
+ {
+ int size = eClass().getFeatureCount() - eStaticFeatureCount();
+ eSettings = size == 0 ? ENO_SETTINGS : new Object [size];
+ }
+
+ return this;
+ }
+
+ protected EClass eDynamicClass()
+ {
+ return eClass;
+ }
+
+ public EClass eClass()
+ {
+ return eClass;
+ }
+
+ public void eSetClass(EClass eClass)
+ {
+ this.eClass = eClass;
+ }
+
+ public Object dynamicGet(int dynamicFeatureID)
+ {
+ return eSettings[dynamicFeatureID];
+ }
+
+ public void dynamicSet(int dynamicFeatureID, Object value)
+ {
+ eSettings[dynamicFeatureID] = value;
+ }
+
+ public void dynamicUnset(int dynamicFeatureID)
+ {
+ eSettings[dynamicFeatureID] = null;
+ }
+
+ public Object eDynamicGet(int featureID, boolean resolve, boolean coreType)
+ {
+ if (featureID < eClass().getFeatureCount())
+ {
+ EStructuralFeature eFeature = eClass().getEStructuralFeature(featureID);
+ return eSettingDelegate(eFeature).dynamicGet(this, eSettings(), featureID, resolve, coreType);
+ }
+ else
+ {
+ return super.eDynamicGet(featureID, resolve, coreType);
+ }
+ }
+
+ public void eDynamicSet(int featureID, Object newValue)
+ {
+ if (featureID < eClass().getFeatureCount())
+ {
+ EStructuralFeature eFeature = eClass().getEStructuralFeature(featureID);
+ eDynamicSet(featureID, eFeature, newValue);
+ }
+ else
+ {
+ super.eDynamicSet(featureID, newValue);
+ }
+ }
+
+ public void eDynamicUnset(int featureID)
+ {
+ if (featureID < eClass().getFeatureCount())
+ {
+ EStructuralFeature eFeature = eClass().getEStructuralFeature(featureID);
+ eDynamicUnset(featureID, eFeature);
+ }
+ else
+ {
+ super.eDynamicUnset(featureID);
+ }
+ }
+
+ public boolean eDynamicIsSet(int featureID)
+ {
+ if (featureID < eClass().getFeatureCount())
+ {
+ EStructuralFeature eFeature = eClass().getEStructuralFeature(featureID);
+ return eSettingDelegate(eFeature).dynamicIsSet(this, eSettings(), featureID);
+ }
+ else
+ {
+ return super.eDynamicIsSet(featureID);
+ }
+ }
+
+ /**
+ * An EFactoryImpl that creates DynamicEDataObjectImpl instances.
+ */
+ public static class FactoryImpl extends EFactoryImpl
+ {
+ public FactoryImpl()
+ {
+ }
+
+ public EObject basicCreate(EClass eClass)
+ {
+ return new DynamicDataObjectImpl(eClass);
+ }
+ }
+
+} //DynamicDataObjectImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DynamicStoreDataObjectImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DynamicStoreDataObjectImpl.java
new file mode 100644
index 0000000000..d9d39bad49
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DynamicStoreDataObjectImpl.java
@@ -0,0 +1,91 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.impl;
+
+import org.apache.tuscany.sdo.SDOPackage;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import commonj.sdo.DataObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Dynamic Store Data Object</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * </p>
+ *
+ * @generated
+ */
+public class DynamicStoreDataObjectImpl extends StoreDataObjectImpl implements DataObject
+{
+ protected EClass eClass;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected DynamicStoreDataObjectImpl()
+ {
+ super();
+ }
+
+ public DynamicStoreDataObjectImpl(InternalEObject.EStore eStore)
+ {
+ super(eStore);
+ }
+
+ public DynamicStoreDataObjectImpl(EClass eClass)
+ {
+ super(eClass);
+ }
+
+ public DynamicStoreDataObjectImpl(EClass eClass, InternalEObject.EStore eStore)
+ {
+ super(eClass, eStore);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EClass eStaticClass()
+ {
+ return SDOPackage.eINSTANCE.getDynamicStoreDataObject();
+ }
+
+ protected EClass eDynamicClass()
+ {
+ return eClass;
+ }
+
+ public EClass eClass()
+ {
+ return eClass;
+ }
+
+ public void eSetClass(EClass eClass)
+ {
+ this.eClass = eClass;
+ }
+
+} //DynamicStoreDataObjectImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/EnumImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/EnumImpl.java
new file mode 100644
index 0000000000..54f642d8cf
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/EnumImpl.java
@@ -0,0 +1,183 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.impl;
+
+import java.util.Collections;
+import java.util.List;
+
+//import org.apache.tuscany.sdo.SDOPackage;
+
+import org.apache.tuscany.sdo.util.DataObjectUtil;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.emf.ecore.impl.EEnumImpl;
+
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Enum</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * </p>
+ *
+ * @generated
+ * @deprecated SDO doesn't support Enum types
+ */
+public class EnumImpl extends EEnumImpl implements Type
+{
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EnumImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ protected EClass eStaticClass()
+ {
+ return EcorePackage.eINSTANCE.getEEnum();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String getURI()
+ {
+ return getEPackage().getNsURI();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public boolean isDataType()
+ {
+ return true;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public boolean isOpen()
+ {
+ return false;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public boolean isSequenced()
+ {
+ return false;
+ }
+
+ protected List aliasNames = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public List getAliasNames()
+ {
+ if (aliasNames == null)
+ {
+ aliasNames = DataObjectUtil.getAliasNames(this);
+ }
+ return aliasNames;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public List getDeclaredProperties()
+ {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public List getProperties()
+ {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public List getBaseTypes()
+ {
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Property getProperty(String propertyName)
+ {
+ return null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public boolean isAbstract()
+ {
+ return false;
+ }
+
+ public List getInstanceProperties()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Object get(Property property)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+} //EnumTypeImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/FactoryBase.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/FactoryBase.java
new file mode 100644
index 0000000000..4e57da60b3
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/FactoryBase.java
@@ -0,0 +1,352 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.impl;
+
+import org.apache.tuscany.sdo.SDOFactory;
+import org.apache.tuscany.sdo.impl.SDOFactoryImpl.SDOEcoreFactory;
+import org.apache.tuscany.sdo.util.DataObjectUtil;
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.ENamedElement;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.impl.EClassImpl;
+import org.eclipse.emf.ecore.impl.EPackageImpl;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+
+/**
+ * Base class for generated (static) SDO factories
+ */
+public class FactoryBase extends EPackageImpl
+{
+
+ public static final boolean IS_ATTRIBUTE = true;
+
+ protected FactoryBase(String namespaceURI, String namespacePrefix)
+ {
+ super(new SDOEFactoryImpl());
+ ecoreFactory = new SDOEcoreFactory();
+
+ int index = namespacePrefix.lastIndexOf(".");
+ setName(index != -1 ? namespacePrefix.substring(index + 1) : namespacePrefix);
+ setNsPrefix(namespacePrefix);
+
+ createResource(namespaceURI);
+ setNsURI(namespaceURI);
+ //FIXME ... figure out proper (scoped) way to register static packages
+ EPackage.Registry.INSTANCE.put(namespaceURI, this);
+
+ ((SDOEFactoryImpl)getEFactoryInstance()).sdoFactory = this;
+ }
+
+ protected FactoryBase(String namespaceURI, String namespacePrefix, String interfacePackage)
+ {
+ super(new SDOEFactoryImpl());
+ ecoreFactory = new SDOEcoreFactory();
+
+ int index = interfacePackage.lastIndexOf(".");
+ setName(index != -1 ? interfacePackage.substring(index + 1) : interfacePackage);
+ setNsPrefix(namespacePrefix);
+
+ createResource(namespaceURI);
+ setNsURI(namespaceURI);
+
+ // TODO this is a bit of a kludge until we figure out how to connect type scopes
+ if(namespaceURI.startsWith("commonj.sdo")) {
+ if("commonj.sdo".equals(namespaceURI) ||
+ "commonj.sdo/java".equals(namespaceURI) ||
+ "commonj.sdo/xml".equals(namespaceURI)
+ ) {
+ EPackage.Registry.INSTANCE.put(namespaceURI, this);
+ }
+ }
+
+ ((SDOEFactoryImpl)getEFactoryInstance()).sdoFactory = this;
+ }
+
+
+
+ public DataObject create(int typeNumber)
+ {
+ return null;
+ }
+
+ public Object createFromString(int typeNumber, String stringValue)
+ {
+ return ((SDOEFactoryImpl)getEFactoryInstance()).createFromString(typeNumber, stringValue);
+ }
+
+ public String convertToString(int typeNumber, Object objectValue)
+ {
+ return ((SDOEFactoryImpl)getEFactoryInstance()).convertToString(typeNumber, objectValue);
+ }
+
+ protected Type createType(boolean isDataType, int typeNumber)
+ {
+ if (isDataType)
+ return (Type)createEDataType(typeNumber);
+ else
+ return (Type)createEClass(typeNumber);
+ }
+
+ protected void createProperty(boolean isDataType, Type containingType, int internalPropertyNumber)
+ {
+ if (isDataType)
+ createEAttribute((EClass)containingType, internalPropertyNumber);
+ else
+ createEReference((EClass)containingType, internalPropertyNumber);
+ }
+
+ protected Property getProperty(Type type, int internalPropertyNumber)
+ {
+ return (Property)((EClass)type).getEAllStructuralFeatures().get(internalPropertyNumber);
+ }
+
+ protected void initializeType(Type type, Class instanceClass, String name)
+ {
+ initEClass((EClass)type, instanceClass, name, !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ }
+
+ protected void initializeType(Type type, Class instanceClass, String name, boolean isAbstract)
+ {
+ initEClass((EClass)type, instanceClass, name, isAbstract, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ }
+
+ protected void initializeType(Type type, Class instanceClass, String name, boolean isSerializable, boolean isGenerated)
+ {
+ initEDataType((EDataType)type, instanceClass, name, isSerializable, isGenerated);
+ }
+
+ protected void initializeProperty(Property property, Type type, String name, String defaultValue, int lower, int upper, Class containerClass, boolean isReadonly, boolean isUnsettable, boolean isDerived)
+ {
+ initEAttribute((EAttribute)property, type != sequence ? (EClassifier)type : ecorePackage.getEFeatureMapEntry(), name, defaultValue, lower, upper, containerClass, isDerived, isDerived, !isReadonly, isUnsettable, !IS_ID, !IS_UNIQUE, isDerived, IS_ORDERED);
+ }
+
+ protected void initializeProperty(Property property, Type type, String name, String defaultValue, int lower, int upper, Class containerClass, boolean isReadonly, boolean isUnsettable, boolean isDerived, boolean isComposite, Property oppositeProperty)
+ {
+ initEReference((EReference)property, (EClassifier)type, (EReference)oppositeProperty, name, defaultValue, lower, upper, containerClass, isDerived, isDerived, !isReadonly, isComposite, !isComposite /*resolve*/, isUnsettable, IS_UNIQUE, isDerived, IS_ORDERED);
+ }
+
+ protected void initXSD()
+ {
+ createDocumentRoot();
+ }
+
+ protected void addXSDMapping(String[] xsdMappings, String annotationSource)
+ {
+ addAnnotation((ENamedElement)this, annotationSource, xsdMappings);
+ }
+
+ protected void addXSDMapping(Type type, String[] xsdMappings)
+ {
+ addAnnotation((ENamedElement)type, ANNOTATION_SOURCE, xsdMappings);
+ }
+
+ protected void addXSDMapping(Property property, String[] xsdMappings)
+ {
+ addAnnotation((ENamedElement)property, ANNOTATION_SOURCE, xsdMappings);
+ }
+
+ protected void setInstanceProperty(Type type, String namespaceURI, String propertyName, String propertyValue)
+ {
+ setInstanceProperty((ENamedElement)type, namespaceURI, propertyName, propertyValue);
+ }
+
+ protected void setInstanceProperty(Property property, String namespaceURI, String propertyName, String propertyValue)
+ {
+ setInstanceProperty((ENamedElement)property, namespaceURI, propertyName, propertyValue);
+ }
+
+ private void setInstanceProperty(ENamedElement eNamedElement, String namespaceURI, String propertyName, String propertyValue)
+ {
+ EAnnotation annotation = eNamedElement.getEAnnotation(namespaceURI);
+ if (annotation == null)
+ {
+ addAnnotation(eNamedElement, namespaceURI, new String[]{propertyName, propertyValue});
+ } else
+ {
+ annotation.getDetails().put(propertyName, propertyValue);
+ }
+ }
+
+ protected Property createGlobalProperty(String name, Type type, String[] xsdMappings)
+ {
+ return createGlobalProperty(name, type, xsdMappings, false);
+ }
+
+ protected Property createGlobalProperty(String name, Type type, String[] xsdMappings, boolean asAttribute)
+ {
+ return createGlobalProperty(name, type, xsdMappings, asAttribute, ANNOTATION_SOURCE);
+ }
+
+ protected Property createGlobalProperty(String name, Type type, String[] xsdMappings, boolean asAttribute, String annotationSource)
+ {
+ int propertyNumber = documentRootEClass.getEStructuralFeatures().size();
+
+ EStructuralFeature globalProperty;
+ if(asAttribute) {
+ createEAttribute(documentRootEClass, propertyNumber);
+ EAttribute gatt = (EAttribute)documentRootEClass.getEStructuralFeatures().get(propertyNumber);
+ initEAttribute(gatt, (EDataType)type, name, null, 0, -2, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, IS_DERIVED, IS_ORDERED);
+ globalProperty = gatt;
+ } else {
+ createEReference(documentRootEClass, propertyNumber);
+ EReference gref = (EReference)documentRootEClass.getEStructuralFeatures().get(propertyNumber);
+ initEReference(gref, (EClass)type, null, name, null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
+ globalProperty = gref;
+ }
+ addAnnotation((ENamedElement)globalProperty, annotationSource, xsdMappings);
+ return (Property) globalProperty;
+ }
+
+ private static final Type sequence = SDOFactory.eINSTANCE.createDataType(); // dummy type
+
+ protected Type getSequence()
+ {
+ return sequence;
+ }
+
+ protected void addSuperType(Type subType, Type superType)
+ {
+ ((EClass)subType).getESuperTypes().add((EClass)superType);
+ }
+
+ //public static FactoryBase getStaticFactory(String namespaceURI)
+ // temporarily return Object - until everything is gen'd with new codegen pattern
+ public static Object getStaticFactory(String namespaceURI)
+ {
+ EPackage ePackage = EPackage.Registry.INSTANCE.getEPackage(namespaceURI);
+ //return (FactoryBase)ePackage;
+ return ePackage instanceof FactoryBase ? (Object)ePackage : (Object)ePackage.getEFactoryInstance();
+ }
+
+ // private EMF-specific methods
+
+ private static class SDOEFactoryImpl extends DynamicDataObjectImpl.FactoryImpl
+ {
+ protected FactoryBase sdoFactory;
+
+ public SDOEFactoryImpl()
+ {
+ super();
+ }
+
+ public EObject create(EClass eClass)
+ {
+ DataObject result = sdoFactory.create(eClass.getClassifierID());
+ if (result == null) {
+ return super.create(eClass);
+ }
+ return (EObject)result;
+ }
+
+ public Object createFromString(EDataType eDataType, String stringValue)
+ {
+ return sdoFactory.createFromString(eDataType.getClassifierID(), stringValue);
+ }
+
+ public String convertToString(EDataType eDataType, Object objectValue)
+ {
+ return sdoFactory.convertToString(eDataType.getClassifierID(), objectValue);
+ }
+
+ protected Object createFromString(int typeNumber, String stringValue)
+ {
+ return super.createFromString((EDataType)sdoFactory.getEClassifiers().get(typeNumber), stringValue);
+ }
+
+ protected String convertToString(int typeNumber, Object objectValue)
+ {
+ return super.convertToString((EDataType)sdoFactory.getEClassifiers().get(typeNumber), objectValue);
+ }
+ }
+
+ private static final int DOCUMENT_ROOT = 0;
+ private static final int DOCUMENT_ROOT__MIXED = 0;
+ private static final int DOCUMENT_ROOT__XMLNS_PREFIX_MAP = 1;
+ private static final int DOCUMENT_ROOT__XSI_SCHEMA_LOCATION = 2;
+ private static final String ANNOTATION_SOURCE = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData";
+ private EClass documentRootEClass = null;
+
+ private void createDocumentRoot()
+ {
+ documentRootEClass = ecoreFactory.createEClass();
+ ((EClassImpl)documentRootEClass).setClassifierID(DOCUMENT_ROOT);
+ getEClassifiers().add(DOCUMENT_ROOT, documentRootEClass);
+
+ createEAttribute(documentRootEClass, DOCUMENT_ROOT__MIXED);
+ createEReference(documentRootEClass, DOCUMENT_ROOT__XMLNS_PREFIX_MAP);
+ createEReference(documentRootEClass, DOCUMENT_ROOT__XSI_SCHEMA_LOCATION);
+
+ initEClass(documentRootEClass, null, "DocumentRoot", !IS_ABSTRACT, !IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute((EAttribute)documentRootEClass.getEStructuralFeatures().get(DOCUMENT_ROOT__MIXED), ecorePackage.getEFeatureMapEntry(), "mixed", null, 0, -1, null, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference((EReference)documentRootEClass.getEStructuralFeatures().get(DOCUMENT_ROOT__XMLNS_PREFIX_MAP), ecorePackage.getEStringToStringMapEntry(), null, "xMLNSPrefixMap", null, 0, -1, null, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference((EReference)documentRootEClass.getEStructuralFeatures().get(DOCUMENT_ROOT__XSI_SCHEMA_LOCATION), ecorePackage.getEStringToStringMapEntry(), null, "xSISchemaLocation", null, 0, -1, null, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ addAnnotation
+ (documentRootEClass,
+ ANNOTATION_SOURCE,
+ new String[]
+ {
+ "name", "",
+ "kind", "mixed"
+ });
+ addAnnotation
+ ((EAttribute)documentRootEClass.getEStructuralFeatures().get(DOCUMENT_ROOT__MIXED),
+ ANNOTATION_SOURCE,
+ new String[]
+ {
+ "kind", "elementWildcard",
+ "name", ":mixed"
+ });
+ addAnnotation
+ ((EReference)documentRootEClass.getEStructuralFeatures().get(DOCUMENT_ROOT__XMLNS_PREFIX_MAP),
+ ANNOTATION_SOURCE,
+ new String[]
+ {
+ "kind", "attribute",
+ "name", "xmlns:prefix"
+ });
+ addAnnotation
+ ((EReference)documentRootEClass.getEStructuralFeatures().get(DOCUMENT_ROOT__XSI_SCHEMA_LOCATION),
+ ANNOTATION_SOURCE,
+ new String[]
+ {
+ "kind", "attribute",
+ "name", "xsi:schemaLocation"
+ });
+ }
+
+ /**
+ * Initialize SDO runtime.
+ */
+ static
+ {
+ DataObjectUtil.initRuntime();
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/ReferenceImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/ReferenceImpl.java
new file mode 100644
index 0000000000..db341e5b8e
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/ReferenceImpl.java
@@ -0,0 +1,781 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.impl;
+
+import java.util.List;
+
+import org.apache.tuscany.sdo.SDOPackage;
+import org.apache.tuscany.sdo.util.DataObjectUtil;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.impl.EReferenceImpl;
+
+import commonj.sdo.Property;
+import commonj.sdo.Sequence;
+import commonj.sdo.Type;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Reference</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * </p>
+ *
+ * @generated
+ */
+public class ReferenceImpl extends EReferenceImpl implements Property,/* DataObject,*/ org.apache.tuscany.sdo.model.Property
+{
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ReferenceImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ protected EClass eStaticClass()
+ {
+ return SDOPackage.eINSTANCE.getReference();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Object getDefault()
+ {
+ return getDefaultValue();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public boolean isReadOnly()
+ {
+ //return "true".equals(EcoreUtil.getAnnotation(this, "commonj.sdo", "readOnly"));
+ return !isChangeable(); //TODO semantics don't exactly match?
+ }
+
+ /**
+ * Single-valued SDO properties behave as EMF unsettable, multi-valued properties as EMF !unsettable
+ */
+ public boolean isUnsettable()
+ {
+ return !isMany();
+ }
+
+ protected List aliasNames = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public List getAliasNames()
+ {
+ if (aliasNames == null)
+ {
+ aliasNames = DataObjectUtil.getAliasNames(this);
+ }
+ return aliasNames;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Type getType()
+ {
+ return (Type)getEType();
+ /*
+ EClassifier eType = getEType();
+ //FB More temporary hacks
+ return eType instanceof Type ? (Type)getEType() : null;
+ */
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Type getContainingType()
+ {
+ return (Type)getEContainingClass();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Property getOpposite()
+ {
+ return (Property)getEOpposite();
+ }
+
+ public boolean isNullable()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean isOpenContent()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public List getInstanceProperties() {
+ return DataObjectUtil.getMetaObjectInstanceProperties(this);
+ }
+
+ public Object get(Property property) {
+ return DataObjectUtil.getMetaObjectInstanceProperty(this, property);
+ }
+
+ /////////////////////////////////////////////////////////////////////////////////////////////////////////
+ // org.apache.tuscany.sdo.model.Property methods
+ /////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+ public List getAliasName() {
+ return this.getAliasNames();
+ }
+
+ public Sequence getAny() {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setMany(boolean value) {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public void unsetMany() {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public boolean isSetMany() {
+ return isMany();
+ }
+
+ public void setReadOnly(boolean value) {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public void unsetReadOnly() {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public boolean isSetReadOnly() {
+ return isReadOnly();
+ }
+
+ public org.apache.tuscany.sdo.model.Type getType_() {
+ return (org.apache.tuscany.sdo.model.Type)getType();
+ }
+
+ public void setType(org.apache.tuscany.sdo.model.Type value) {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public Sequence getAnyAttribute() {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getDefault_() {
+ return (String) this.getDefault();
+ }
+
+ public void setDefault_(String value) {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public org.apache.tuscany.sdo.model.Property getOpposite_() {
+ return (org.apache.tuscany.sdo.model.Property) getOpposite();
+ }
+
+ public void setOpposite_(org.apache.tuscany.sdo.model.Property value) {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public void unsetContainment() {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public boolean isSetContainment() {
+ return isContainment();
+ }
+
+ public void setNullable(boolean value) {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public void unsetNullable() {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public boolean isSetNullable() {
+ return isNullable();
+ }
+
+ public void unsetName()
+ {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public boolean isSetName()
+ {
+ return true;
+ }
+
+ public void unsetOpposite()
+ {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public boolean isSetOpposite()
+ {
+ return getOpposite() != null;
+ }
+
+ public void unsetType()
+ {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public boolean isSetType()
+ {
+ return true;
+ }
+
+ public void unsetDefault()
+ {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public boolean isSetDefault()
+ {
+ return getDefault() != null;
+ }
+
+
+ /////////////////////////////////////////////////////////////////////////////////////////////////////////
+ // DataObject method implementations
+ /////////////////////////////////////////////////////////////////////////////////////////////////////////
+ /*
+ public Object get(int propertyIndex) {
+ return DataObjectUtil.get(this, propertyIndex);
+ }
+
+ public void set(int propertyIndex, Object value) {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public boolean isSet(int propertyIndex) {
+ return DataObjectUtil.isSet(this, propertyIndex);
+ }
+
+ public void unset(int propertyIndex) {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public Object get(Property property) {
+ return DataObjectUtil.get(this, ((EStructuralFeature)property).getFeatureID());
+ }
+
+ public void set(Property property, Object value) {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public boolean isSet(Property property) {
+ return DataObjectUtil.isSet(this, ((EStructuralFeature)property).getFeatureID());
+ }
+
+ public void unset(Property property) {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public DataObject getContainer() {
+ return (DataObject)eContainer();
+ }
+
+ public Property getContainmentProperty() {
+ return (Property)eContainmentFeature();
+ }
+
+ // Remaining DataObject methods are (will be) implemented as straight delegation to DataObjectUtil
+
+ public Object get(String path) {
+ return DataObjectUtil.get(this, path);
+ }
+
+ public void set(String path, Object value) {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public boolean isSet(String path) {
+ return DataObjectUtil.isSet(this, path);
+ }
+
+ public void unset(String path) {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public boolean getBoolean(String path) {
+ return DataObjectUtil.getBoolean(get(path));
+ }
+
+ public byte getByte(String path) {
+ return DataObjectUtil.getByte(get(path));
+ }
+
+ public char getChar(String path) {
+ return DataObjectUtil.getChar(get(path));
+ }
+
+ public double getDouble(String path) {
+ return DataObjectUtil.getDouble(get(path));
+ }
+
+ public float getFloat(String path) {
+ return DataObjectUtil.getFloat(get(path));
+ }
+
+ public int getInt(String path) {
+ return DataObjectUtil.getInt(get(path));
+ }
+
+ public long getLong(String path) {
+ return DataObjectUtil.getLong(get(path));
+ }
+
+ public short getShort(String path) {
+ return DataObjectUtil.getShort(get(path));
+ }
+
+ public byte[] getBytes(String path) {
+ return DataObjectUtil.getBytes(get(path));
+ }
+
+ public BigDecimal getBigDecimal(String path) {
+ return DataObjectUtil.getBigDecimal(get(path));
+ }
+
+ public BigInteger getBigInteger(String path) {
+ return DataObjectUtil.getBigInteger(get(path));
+ }
+
+ public DataObject getDataObject(String path) {
+ return (DataObject)get(path);
+ }
+
+ public Date getDate(String path) {
+ return DataObjectUtil.getDate(get(path));
+ }
+
+ public String getString(String path) {
+ return DataObjectUtil.getString(get(path));
+ }
+
+ public List getList(String path) {
+ return (List)get(path);
+ }
+
+ public Sequence getSequence(String path) {
+ return (Sequence)get(path);
+ }
+
+ public void setBoolean(String path, boolean value) {
+ set(path, new Boolean(value));
+ }
+
+ public void setByte(String path, byte value) {
+ set(path, new Byte(value));
+ }
+
+ public void setChar(String path, char value) {
+ set(path, new Character(value));
+ }
+
+ public void setDouble(String path, double value) {
+ set(path, new Double(value));
+ }
+
+ public void setFloat(String path, float value) {
+ set(path, new Float(value));
+ }
+
+ public void setInt(String path, int value) {
+ set(path, new Integer(value));
+ }
+
+ public void setLong(String path, long value) {
+ set(path, new Long(value));
+ }
+
+ public void setShort(String path, short value) {
+ set(path, new Short(value));
+ }
+
+ public void setBytes(String path, byte[] value) {
+ set(path, value);
+ }
+
+ public void setBigDecimal(String path, BigDecimal value) {
+ set(path, value);
+ }
+
+ public void setBigInteger(String path, BigInteger value) {
+ set(path, value);
+ }
+
+ public void setDataObject(String path, DataObject value) {
+ set(path, value);
+ }
+
+ public void setDate(String path, Date value) {
+ set(path, value);
+ }
+
+ public void setString(String path, String value) {
+ set(path, value);
+ }
+
+ public void setList(String path, List value) {
+ set(path, value);
+ }
+
+ public boolean getBoolean(int propertyIndex) {
+ return DataObjectUtil.getBoolean(this, propertyIndex);
+ }
+
+ public byte getByte(int propertyIndex) {
+ return DataObjectUtil.getByte(this, propertyIndex);
+ }
+
+ public char getChar(int propertyIndex) {
+ return DataObjectUtil.getChar(this, propertyIndex);
+ }
+
+ public double getDouble(int propertyIndex) {
+ return DataObjectUtil.getDouble(this, propertyIndex);
+ }
+
+ public float getFloat(int propertyIndex) {
+ return DataObjectUtil.getFloat(this, propertyIndex);
+ }
+
+ public int getInt(int propertyIndex) {
+ return DataObjectUtil.getInt(this, propertyIndex);
+ }
+
+ public long getLong(int propertyIndex) {
+ return DataObjectUtil.getLong(this, propertyIndex);
+ }
+
+ public short getShort(int propertyIndex) {
+ return DataObjectUtil.getShort(this, propertyIndex);
+ }
+
+ public byte[] getBytes(int propertyIndex) {
+ return DataObjectUtil.getBytes(this, propertyIndex);
+ }
+
+ public BigDecimal getBigDecimal(int propertyIndex) {
+ return DataObjectUtil.getBigDecimal(this, propertyIndex);
+ }
+
+ public BigInteger getBigInteger(int propertyIndex) {
+ return DataObjectUtil.getBigInteger(this, propertyIndex);
+ }
+
+ public DataObject getDataObject(int propertyIndex) {
+ return DataObjectUtil.getDataObject(this, propertyIndex);
+ }
+
+ public Date getDate(int propertyIndex) {
+ return DataObjectUtil.getDate(this, propertyIndex);
+ }
+
+ public String getString(int propertyIndex) {
+ return DataObjectUtil.getString(this, propertyIndex);
+ }
+
+ public List getList(int propertyIndex) {
+ return DataObjectUtil.getList(this, propertyIndex);
+ }
+
+ public Sequence getSequence(int propertyIndex) {
+ return DataObjectUtil.getSequence(this, propertyIndex);
+ }
+
+ public void setBoolean(int propertyIndex, boolean value) {
+ set(propertyIndex, new Boolean(value));
+ }
+
+ public void setByte(int propertyIndex, byte value) {
+ set(propertyIndex, new Byte(value));
+ }
+
+ public void setChar(int propertyIndex, char value) {
+ set(propertyIndex, new Character(value));
+ }
+
+ public void setDouble(int propertyIndex, double value) {
+ set(propertyIndex, new Double(value));
+ }
+
+ public void setFloat(int propertyIndex, float value) {
+ set(propertyIndex, new Float(value));
+ }
+
+ public void setInt(int propertyIndex, int value) {
+ set(propertyIndex, new Integer(value));
+ }
+
+ public void setLong(int propertyIndex, long value) {
+ set(propertyIndex, new Long(value));
+ }
+
+ public void setShort(int propertyIndex, short value) {
+ set(propertyIndex, new Short(value));
+ }
+
+ public void setBytes(int propertyIndex, byte[] value) {
+ set(propertyIndex, value);
+ }
+
+ public void setBigDecimal(int propertyIndex, BigDecimal value) {
+ set(propertyIndex, value);
+ }
+
+ public void setBigInteger(int propertyIndex, BigInteger value) {
+ set(propertyIndex, value);
+ }
+
+ public void setDataObject(int propertyIndex, DataObject value) {
+ set(propertyIndex, value);
+ }
+
+ public void setDate(int propertyIndex, Date value) {
+ set(propertyIndex, value);
+ }
+
+ public void setString(int propertyIndex, String value) {
+ set(propertyIndex, value);
+ }
+
+ public void setList(int propertyIndex, List value) {
+ set(propertyIndex, value);
+ }
+
+ public boolean getBoolean(Property property) {
+ return DataObjectUtil.getBoolean(this, property);
+ }
+
+ public byte getByte(Property property) {
+ return DataObjectUtil.getByte(this, property);
+ }
+
+ public char getChar(Property property) {
+ return DataObjectUtil.getChar(this, property);
+ }
+
+ public double getDouble(Property property) {
+ return DataObjectUtil.getDouble(this, property);
+ }
+
+ public float getFloat(Property property) {
+ return DataObjectUtil.getFloat(this, property);
+ }
+
+ public int getInt(Property property) {
+ return DataObjectUtil.getInt(this, property);
+ }
+
+ public long getLong(Property property) {
+ return DataObjectUtil.getLong(this, property);
+ }
+
+ public short getShort(Property property) {
+ return DataObjectUtil.getShort(this, property);
+ }
+
+ public byte[] getBytes(Property property) {
+ return DataObjectUtil.getBytes(this, property);
+ }
+
+ public BigDecimal getBigDecimal(Property property) {
+ return DataObjectUtil.getBigDecimal(this, property);
+ }
+
+ public BigInteger getBigInteger(Property property) {
+ return DataObjectUtil.getBigInteger(this, property);
+ }
+
+ public DataObject getDataObject(Property property) {
+ return DataObjectUtil.getDataObject(this, property);
+ }
+
+ public Date getDate(Property property) {
+ return DataObjectUtil.getDate(this, property);
+ }
+
+ public String getString(Property property) {
+ return DataObjectUtil.getString(this, property);
+ }
+
+ public List getList(Property property) {
+ return DataObjectUtil.getList(this, property);
+ }
+
+ public Sequence getSequence(Property property) {
+ return DataObjectUtil.getSequence(this, property);
+ }
+
+ public void setBoolean(Property property, boolean value) {
+ set(property, new Boolean(value));
+ }
+
+ public void setByte(Property property, byte value) {
+ set(property, new Byte(value));
+ }
+
+ public void setChar(Property property, char value) {
+ set(property, new Character(value));
+ }
+
+ public void setDouble(Property property, double value) {
+ set(property, new Double(value));
+ }
+
+ public void setFloat(Property property, float value) {
+ set(property, new Float(value));
+ }
+
+ public void setInt(Property property, int value) {
+ set(property, new Integer(value));
+ }
+
+ public void setLong(Property property, long value) {
+ set(property, new Long(value));
+ }
+
+ public void setShort(Property property, short value) {
+ set(property, new Short(value));
+ }
+
+ public void setBytes(Property property, byte[] value) {
+ set(property, value);
+ }
+
+ public void setBigDecimal(Property property, BigDecimal value) {
+ set(property, value);
+ }
+
+ public void setBigInteger(Property property, BigInteger value) {
+ set(property, value);
+ }
+
+ public void setDataObject(Property property, DataObject value) {
+ set(property, value);
+ }
+
+ public void setDate(Property property, Date value) {
+ set(property, value);
+ }
+
+ public void setString(Property property, String value) {
+ set(property, value);
+ }
+
+ public void setList(Property property, List value) {
+ set(property, value);
+ }
+
+ public DataObject createDataObject(String propertyName) {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public DataObject createDataObject(int propertyIndex) {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public DataObject createDataObject(Property property) {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public DataObject createDataObject(String propertyName, String namespaceURI, String typeName) {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public DataObject createDataObject(int propertyIndex, String namespaceURI, String typeName) {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public DataObject createDataObject(Property property, Type type) {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public void delete() {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ }
+
+ public DataGraph getDataGraph() {
+ return DataObjectUtil.getDataGraph(this);
+ }
+
+ public Sequence getSequence() {
+ EAttribute mixedFeature = BasicExtendedMetaData.INSTANCE.getMixedFeature(eClass());
+ return mixedFeature != null ? (Sequence)eGet(mixedFeature, true, false) : null;
+ }
+
+ public List getInstanceProperties() {
+ return DataObjectUtil.getInstanceProperties(this);
+ }
+
+ public DataObject getRootObject() {
+ return DataObjectUtil.getRootObject(this);
+ }
+
+ public ChangeSummary getChangeSummary() {
+ // TODO: implement this method
+ throw new UnsupportedOperationException();
+ }
+
+ public void detach() {
+ throw new UnsupportedOperationException("Property is frozen and cannot be modified");
+ //DataObjectUtil.detach(this);
+ }
+
+ public Property getProperty(String propertyName) {
+ return DataObjectUtil.getProperty(this, propertyName);
+ }
+ */
+
+} //ReferenceImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/SDOFactoryImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/SDOFactoryImpl.java
new file mode 100644
index 0000000000..a209e9c330
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/SDOFactoryImpl.java
@@ -0,0 +1,325 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.impl;
+
+import org.apache.tuscany.sdo.AnyTypeDataObject;
+import org.apache.tuscany.sdo.SDOFactory;
+import org.apache.tuscany.sdo.SDOPackage;
+import org.apache.tuscany.sdo.SimpleAnyTypeDataObject;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.impl.EFactoryImpl;
+import org.eclipse.emf.ecore.impl.EcoreFactoryImpl;
+import org.eclipse.emf.ecore.plugin.EcorePlugin;
+
+import commonj.sdo.ChangeSummary;
+import commonj.sdo.DataGraph;
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Factory</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class SDOFactoryImpl extends EFactoryImpl implements SDOFactory
+{
+ /**
+ * Creates the default factory implementation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public static SDOFactory init()
+ {
+ try
+ {
+ SDOFactory theSDOFactory = (SDOFactory)EPackage.Registry.INSTANCE.getEFactory(SDOPackage.eNS_URI);
+ if (theSDOFactory != null)
+ {
+ return theSDOFactory;
+ }
+ }
+ catch (Exception exception)
+ {
+ EcorePlugin.INSTANCE.log(exception);
+ }
+ return new SDOFactoryImpl();
+ }
+
+ public static class SDOEcoreFactory extends EcoreFactoryImpl
+ {
+ public EClass createEClass() { return new ClassImpl(); }
+ public EDataType createEDataType() { return new DataTypeImpl(); }
+ //public EEnum createEEnum() { return new EnumImpl(); }
+ public EAttribute createEAttribute() { return new AttributeImpl(); }
+ public EReference createEReference() { return new ReferenceImpl(); }
+
+// public EFactory createEFactory()
+// {
+// EFactoryImpl eFactory = new EFactoryImpl() { OVERRIDE basicCreate(); } // TODO think about doing this
+// return eFactory;
+// }
+ }
+
+ /**
+ * Creates an instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public SDOFactoryImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EObject create(EClass eClass)
+ {
+ switch (eClass.getClassifierID())
+ {
+ case SDOPackage.CHANGE_SUMMARY: return (EObject)createChangeSummary();
+ case SDOPackage.CHANGE_SUMMARY_SETTING: return (EObject)createChangeSummarySetting();
+ case SDOPackage.DATA_GRAPH: return (EObject)createDataGraph();
+ case SDOPackage.ANY_TYPE_DATA_OBJECT: return createAnyTypeDataObject();
+ case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT: return createSimpleAnyTypeDataObject();
+ case SDOPackage.CLASS: return (EObject)createClass();
+ case SDOPackage.DATA_TYPE: return (EObject)createDataType();
+ case SDOPackage.ATTRIBUTE: return (EObject)createAttribute();
+ case SDOPackage.REFERENCE: return (EObject)createReference();
+ case SDOPackage.ENUM: return (EObject)createEnum();
+ case SDOPackage.DYNAMIC_DATA_OBJECT: return (EObject)createDynamicDataObject();
+ case SDOPackage.STORE_DATA_OBJECT: return (EObject)createStoreDataObject();
+ case SDOPackage.DYNAMIC_STORE_DATA_OBJECT: return (EObject)createDynamicStoreDataObject();
+ default:
+ throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object createFromString(EDataType eDataType, String initialValue)
+ {
+ switch (eDataType.getClassifierID())
+ {
+ default:
+ throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String convertToString(EDataType eDataType, Object instanceValue)
+ {
+ switch (eDataType.getClassifierID())
+ {
+ default:
+ throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeSummary createChangeSummary()
+ {
+ ChangeSummaryImpl changeSummary = new ChangeSummaryImpl();
+ return changeSummary;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeSummary.Setting createChangeSummarySetting()
+ {
+ ChangeSummarySettingImpl changeSummarySetting = new ChangeSummarySettingImpl();
+ return changeSummarySetting;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public DataGraph createDataGraph()
+ {
+ DataGraphImpl dataGraph = new DataGraphImpl();
+ return dataGraph;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public AnyTypeDataObject createAnyTypeDataObject()
+ {
+ AnyTypeDataObjectImpl anyTypeDataObject = new AnyTypeDataObjectImpl();
+ return anyTypeDataObject;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public SimpleAnyTypeDataObject createSimpleAnyTypeDataObject()
+ {
+ SimpleAnyTypeDataObjectImpl simpleAnyTypeDataObject = new SimpleAnyTypeDataObjectImpl();
+ return simpleAnyTypeDataObject;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Type createClass()
+ {
+ ClassImpl class_ = new ClassImpl();
+ return class_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Type createDataType()
+ {
+ DataTypeImpl dataType = new DataTypeImpl();
+ return dataType;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Property createAttribute()
+ {
+ AttributeImpl attribute = new AttributeImpl();
+ return attribute;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Property createReference()
+ {
+ ReferenceImpl reference = new ReferenceImpl();
+ return reference;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Type createEnum()
+ {
+ EnumImpl enum_ = new EnumImpl();
+ return enum_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public DataObject createDynamicDataObject()
+ {
+ DynamicDataObjectImpl dynamicDataObject = new DynamicDataObjectImpl();
+ return dynamicDataObject;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public DataObject createStoreDataObject()
+ {
+ StoreDataObjectImpl storeDataObject = new StoreDataObjectImpl();
+ return storeDataObject;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public DataObject createDynamicStoreDataObject()
+ {
+ DynamicStoreDataObjectImpl dynamicStoreDataObject = new DynamicStoreDataObjectImpl();
+ return dynamicStoreDataObject;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public SDOPackage getSDOPackage()
+ {
+ return (SDOPackage)getEPackage();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @deprecated
+ * @generated
+ */
+ public static SDOPackage getPackage()
+ {
+ return SDOPackage.eINSTANCE;
+ }
+
+ public ChangeSummary.Setting createChangeSummarySetting(EStructuralFeature eStructuralFeature, Object value, boolean isSet)
+ {
+ ChangeSummarySettingImpl eChangeSummarySetting = new ChangeSummarySettingImpl(eStructuralFeature, value, isSet);
+ return eChangeSummarySetting;
+ }
+
+} //SDOFactoryImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/SDOPackageImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/SDOPackageImpl.java
new file mode 100644
index 0000000000..e251220673
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/SDOPackageImpl.java
@@ -0,0 +1,2185 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.impl;
+
+import java.io.ObjectStreamException;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.tuscany.sdo.AnyTypeDataObject;
+import org.apache.tuscany.sdo.SDOFactory;
+import org.apache.tuscany.sdo.SDOPackage;
+import org.apache.tuscany.sdo.SimpleAnyTypeDataObject;
+import org.apache.tuscany.sdo.impl.SDOFactoryImpl.SDOEcoreFactory;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EOperation;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.emf.ecore.change.ChangePackage;
+import org.eclipse.emf.ecore.change.impl.ChangePackageImpl;
+import org.eclipse.emf.ecore.impl.EClassImpl;
+import org.eclipse.emf.ecore.impl.EPackageImpl;
+import org.eclipse.emf.ecore.impl.EcorePackageImpl;
+import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
+import org.eclipse.emf.ecore.xml.type.impl.XMLTypePackageImpl;
+
+import commonj.sdo.ChangeSummary;
+import commonj.sdo.DataGraph;
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
+import commonj.sdo.Sequence;
+import commonj.sdo.Type;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Package</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class SDOPackageImpl extends EPackageImpl implements SDOPackage
+{
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass changeSummaryEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass changeSummarySettingEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass dataGraphEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass dataObjectEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass propertyEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass sequenceEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass typeEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass anyTypeDataObjectEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass simpleAnyTypeDataObjectEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass classEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass dataTypeEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass attributeEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass referenceEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass enumEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass dynamicDataObjectEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass storeDataObjectEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass dynamicStoreDataObjectEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EDataType eJavaListEDataType = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EDataType eObjectStreamExceptionEDataType = null;
+
+ /**
+ * Creates an instance of the model <b>Package</b>, registered with
+ * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
+ * package URI value.
+ * <p>Note: the correct way to create the package is via the static
+ * factory method {@link #init init()}, which also performs
+ * initialization of the package, or returns the registered package,
+ * if one already exists.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.ecore.EPackage.Registry
+ * @see org.apache.tuscany.sdo.SDOPackage#eNS_URI
+ * @see #init()
+ * @generated NOT
+ */
+ private SDOPackageImpl()
+ {
+ super(eNS_URI, SDOFactory.eINSTANCE);
+ ecoreFactory = new SDOEcoreFactory();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static boolean isInited = false;
+
+ /**
+ * Creates, registers, and initializes the <b>Package</b> for this
+ * model, and for any others upon which it depends. Simple
+ * dependencies are satisfied by calling this method on all
+ * dependent packages before doing anything else. This method drives
+ * initialization for interdependent packages directly, in parallel
+ * with this package, itself.
+ * <p>Of this package and its interdependencies, all packages which
+ * have not yet been registered by their URI values are first created
+ * and registered. The packages are then initialized in two steps:
+ * meta-model objects for all of the packages are created before any
+ * are initialized, since one package's meta-model objects may refer to
+ * those of another.
+ * <p>Invocation of this method will not affect any packages that have
+ * already been initialized.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #eNS_URI
+ * @see #createPackageContents()
+ * @see #initializePackageContents()
+ * @generated
+ */
+ public static SDOPackage init()
+ {
+ if (isInited) return (SDOPackage)EPackage.Registry.INSTANCE.getEPackage(SDOPackage.eNS_URI);
+
+ // Obtain or create and register package
+ SDOPackageImpl theSDOPackage = (SDOPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof SDOPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new SDOPackageImpl());
+
+ isInited = true;
+
+ // Initialize simple dependencies
+ EcorePackageImpl.init();
+ XMLTypePackageImpl.init();
+ ChangePackageImpl.init();
+
+ // Create package meta-data objects
+ theSDOPackage.createPackageContents();
+
+ // Initialize created meta-data
+ theSDOPackage.initializePackageContents();
+
+ // Mark meta-data to indicate it can't be changed
+ theSDOPackage.freeze();
+
+ return theSDOPackage;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getChangeSummary()
+ {
+ return changeSummaryEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getChangeSummary_EDataGraph()
+ {
+ return (EReference)changeSummaryEClass.getEStructuralFeatures().get(0);
+ }
+
+// /**
+// * <!-- begin-user-doc -->
+// * <!-- end-user-doc -->
+// * <hand coded but could be generated>
+// */
+// public EReference getChangeSummary_EDataObject()
+// {
+// return (EReference)changeSummaryEClass.getEStructuralFeatures().get(1);
+// }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getChangeSummarySetting()
+ {
+ return changeSummarySettingEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getDataGraph()
+ {
+ return dataGraphEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getDataGraph_ResourceSet()
+ {
+ return (EAttribute)dataGraphEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getDataGraph_RootResource()
+ {
+ return (EAttribute)dataGraphEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getDataGraph_EChangeSummary()
+ {
+ return (EReference)dataGraphEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getDataGraph_ERootObject()
+ {
+ return (EReference)dataGraphEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getDataObject()
+ {
+ return dataObjectEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getProperty()
+ {
+ return propertyEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getSequence()
+ {
+ return sequenceEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getType()
+ {
+ return typeEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getAnyTypeDataObject()
+ {
+ return anyTypeDataObjectEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getSimpleAnyTypeDataObject()
+ {
+ return simpleAnyTypeDataObjectEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getClass_()
+ {
+ return classEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getDataType()
+ {
+ return dataTypeEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getAttribute()
+ {
+ return attributeEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getReference()
+ {
+ return referenceEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getEnum()
+ {
+ return enumEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getDynamicDataObject()
+ {
+ return dynamicDataObjectEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getStoreDataObject()
+ {
+ return storeDataObjectEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getDynamicStoreDataObject()
+ {
+ return dynamicStoreDataObjectEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EDataType getEJavaList()
+ {
+ return eJavaListEDataType;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EDataType getEObjectStreamException()
+ {
+ return eObjectStreamExceptionEDataType;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public SDOFactory getSDOFactory()
+ {
+ return (SDOFactory)getEFactoryInstance();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private boolean isCreated = false;
+
+ /**
+ * Creates the meta-model objects for the package. This method is
+ * guarded to have no affect on any invocation but its first.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void createPackageContents()
+ {
+ if (isCreated) return;
+ isCreated = true;
+
+ // Create classes and their features
+ changeSummaryEClass = createEClass(CHANGE_SUMMARY);
+ createEReference(changeSummaryEClass, CHANGE_SUMMARY__EDATA_GRAPH);
+
+ changeSummarySettingEClass = createEClass(CHANGE_SUMMARY_SETTING);
+
+ dataGraphEClass = createEClass(DATA_GRAPH);
+ createEAttribute(dataGraphEClass, DATA_GRAPH__RESOURCE_SET);
+ createEAttribute(dataGraphEClass, DATA_GRAPH__ROOT_RESOURCE);
+ createEReference(dataGraphEClass, DATA_GRAPH__ECHANGE_SUMMARY);
+ createEReference(dataGraphEClass, DATA_GRAPH__EROOT_OBJECT);
+
+ dataObjectEClass = createEClass(DATA_OBJECT);
+
+ propertyEClass = createEClass(PROPERTY);
+
+ sequenceEClass = createEClass(SEQUENCE);
+
+ typeEClass = createEClass(TYPE);
+
+ anyTypeDataObjectEClass = createEClass(ANY_TYPE_DATA_OBJECT);
+
+ simpleAnyTypeDataObjectEClass = createEClass(SIMPLE_ANY_TYPE_DATA_OBJECT);
+
+ classEClass = createEClass(CLASS);
+
+ dataTypeEClass = createEClass(DATA_TYPE);
+
+ attributeEClass = createEClass(ATTRIBUTE);
+
+ referenceEClass = createEClass(REFERENCE);
+
+ enumEClass = createEClass(ENUM);
+
+ dynamicDataObjectEClass = createEClass(DYNAMIC_DATA_OBJECT);
+
+ storeDataObjectEClass = createEClass(STORE_DATA_OBJECT);
+
+ dynamicStoreDataObjectEClass = createEClass(DYNAMIC_STORE_DATA_OBJECT);
+
+ // Create data types
+ eJavaListEDataType = createEDataType(EJAVA_LIST);
+ eObjectStreamExceptionEDataType = createEDataType(EOBJECT_STREAM_EXCEPTION);
+ }
+
+ protected EClass createEClass(int id)
+ {
+ EClassImpl c;
+ switch(id) {
+ case ANY_TYPE_DATA_OBJECT:
+ c = new ClassImpl() {
+ List baseTypes = null;
+ public List getBaseTypes() {
+ if (baseTypes == null)
+ baseTypes = Collections.singletonList(getDataObject());
+ return baseTypes;
+ }
+ public List getTypeFeatures() {
+ return getEAllStructuralFeatures();
+ }
+ };
+ break;
+ case SIMPLE_ANY_TYPE_DATA_OBJECT:
+ c = new ClassImpl() {
+ List baseTypes = null;
+ public List getBaseTypes() {
+ if (baseTypes == null)
+ baseTypes = Collections.singletonList(getAnyTypeDataObject());
+ return baseTypes;
+ }
+ };
+ break;
+ default:
+ c = (EClassImpl)ecoreFactory.createEClass();
+ }
+ c.setClassifierID(id);
+ getEClassifiers().add(c);
+ return c;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private boolean isInitialized = false;
+
+ /**
+ * Complete the initialization of the package and its meta-model. This
+ * method is guarded to have no affect on any invocation but its first.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void initializePackageContents()
+ {
+ if (isInitialized) return;
+ isInitialized = true;
+
+ // Initialize package
+ setName(eNAME);
+ setNsPrefix(eNS_PREFIX);
+ setNsURI(eNS_URI);
+
+ // Obtain other dependent packages
+ ChangePackageImpl theChangePackage = (ChangePackageImpl)EPackage.Registry.INSTANCE.getEPackage(ChangePackage.eNS_URI);
+ EcorePackageImpl theEcorePackage = (EcorePackageImpl)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI);
+ XMLTypePackageImpl theXMLTypePackage = (XMLTypePackageImpl)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI);
+
+ // Add supertypes to classes
+ changeSummaryEClass.getESuperTypes().add(theChangePackage.getChangeDescription());
+ changeSummarySettingEClass.getESuperTypes().add(theChangePackage.getFeatureChange());
+ dataGraphEClass.getESuperTypes().add(theEcorePackage.getEObject());
+ anyTypeDataObjectEClass.getESuperTypes().add(this.getDataObject());
+ anyTypeDataObjectEClass.getESuperTypes().add(theXMLTypePackage.getAnyType());
+ simpleAnyTypeDataObjectEClass.getESuperTypes().add(this.getAnyTypeDataObject());
+ simpleAnyTypeDataObjectEClass.getESuperTypes().add(theXMLTypePackage.getSimpleAnyType());
+ classEClass.getESuperTypes().add(theEcorePackage.getEClass());
+ classEClass.getESuperTypes().add(this.getType());
+ dataTypeEClass.getESuperTypes().add(theEcorePackage.getEDataType());
+ dataTypeEClass.getESuperTypes().add(this.getType());
+ attributeEClass.getESuperTypes().add(theEcorePackage.getEAttribute());
+ attributeEClass.getESuperTypes().add(this.getProperty());
+ referenceEClass.getESuperTypes().add(theEcorePackage.getEReference());
+ referenceEClass.getESuperTypes().add(this.getProperty());
+ enumEClass.getESuperTypes().add(theEcorePackage.getEEnum());
+ enumEClass.getESuperTypes().add(this.getType());
+ dynamicDataObjectEClass.getESuperTypes().add(this.getDataObject());
+ storeDataObjectEClass.getESuperTypes().add(this.getDataObject());
+ dynamicStoreDataObjectEClass.getESuperTypes().add(this.getStoreDataObject());
+
+ // Initialize classes and features; add operations and parameters
+ initEClass(changeSummaryEClass, ChangeSummary.class, "ChangeSummary", !IS_ABSTRACT, !IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getChangeSummary_EDataGraph(), this.getDataGraph(), this.getDataGraph_EChangeSummary(), "eDataGraph", null, 1, 1, ChangeSummary.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ addEOperation(changeSummaryEClass, null, "beginLogging");
+
+ addEOperation(changeSummaryEClass, null, "endLogging");
+
+ EOperation op = addEOperation(changeSummaryEClass, ecorePackage.getEBoolean(), "isCreated");
+ addEParameter(op, this.getDataObject(), "dataObject");
+
+ op = addEOperation(changeSummaryEClass, ecorePackage.getEBoolean(), "isDeleted");
+ addEParameter(op, this.getDataObject(), "dataObject");
+
+ op = addEOperation(changeSummaryEClass, this.getEJavaList(), "getOldValues");
+ addEParameter(op, this.getDataObject(), "dataObject");
+
+ op = addEOperation(changeSummaryEClass, ecorePackage.getEBoolean(), "isModified");
+ addEParameter(op, this.getDataObject(), "dataObject");
+
+ op = addEOperation(changeSummaryEClass, this.getChangeSummarySetting(), "getOldValue");
+ addEParameter(op, this.getDataObject(), "dataObject");
+ addEParameter(op, this.getProperty(), "property");
+
+ op = addEOperation(changeSummaryEClass, this.getDataObject(), "getOldContainer");
+ addEParameter(op, this.getDataObject(), "dataObject");
+
+ op = addEOperation(changeSummaryEClass, this.getProperty(), "getOldContainmentProperty");
+ addEParameter(op, this.getDataObject(), "dataObject");
+
+ op = addEOperation(changeSummaryEClass, this.getSequence(), "getOldSequence");
+ addEParameter(op, this.getDataObject(), "dataObject");
+
+ addEOperation(changeSummaryEClass, null, "undoChanges");
+
+ addEOperation(changeSummaryEClass, ecorePackage.getEBoolean(), "isLogging");
+
+ addEOperation(changeSummaryEClass, this.getDataGraph(), "getDataGraph");
+
+ addEOperation(changeSummaryEClass, this.getEJavaList(), "getChangedObjects");
+
+ addEOperation(changeSummaryEClass, this.getDataObject(), "getRootObject");
+
+ initEClass(changeSummarySettingEClass, ChangeSummary.Setting.class, "ChangeSummarySetting", !IS_ABSTRACT, !IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS);
+
+ addEOperation(changeSummarySettingEClass, ecorePackage.getEBoolean(), "isSet");
+
+ addEOperation(changeSummarySettingEClass, theEcorePackage.getEJavaObject(), "getValue");
+
+ addEOperation(changeSummarySettingEClass, this.getProperty(), "getProperty");
+
+ initEClass(dataGraphEClass, DataGraph.class, "DataGraph", !IS_ABSTRACT, !IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getDataGraph_ResourceSet(), theEcorePackage.getEResourceSet(), "resourceSet", null, 0, 1, DataGraph.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getDataGraph_RootResource(), theEcorePackage.getEResource(), "rootResource", null, 0, 1, DataGraph.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
+ initEReference(getDataGraph_EChangeSummary(), this.getChangeSummary(), this.getChangeSummary_EDataGraph(), "eChangeSummary", null, 1, 1, DataGraph.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getDataGraph_ERootObject(), theEcorePackage.getEObject(), null, "eRootObject", null, 1, 1, DataGraph.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ op = addEOperation(dataGraphEClass, this.getDataObject(), "createRootObject");
+ addEParameter(op, ecorePackage.getEString(), "namespaceURI");
+ addEParameter(op, ecorePackage.getEString(), "typeName");
+
+ op = addEOperation(dataGraphEClass, this.getDataObject(), "createRootObject");
+ addEParameter(op, this.getType(), "type");
+
+ op = addEOperation(dataGraphEClass, this.getType(), "getType");
+ addEParameter(op, ecorePackage.getEString(), "namespaceURI");
+ addEParameter(op, ecorePackage.getEString(), "typeName");
+
+ addEOperation(dataGraphEClass, this.getDataObject(), "getRootObject");
+
+ addEOperation(dataGraphEClass, this.getChangeSummary(), "getChangeSummary");
+
+ initEClass(dataObjectEClass, DataObject.class, "DataObject", IS_ABSTRACT, !IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS);
+
+ op = addEOperation(dataObjectEClass, theEcorePackage.getEJavaObject(), "get");
+ addEParameter(op, ecorePackage.getEString(), "path");
+
+ op = addEOperation(dataObjectEClass, null, "set");
+ addEParameter(op, ecorePackage.getEString(), "path");
+ addEParameter(op, theEcorePackage.getEJavaObject(), "value");
+
+ op = addEOperation(dataObjectEClass, ecorePackage.getEBoolean(), "isSet");
+ addEParameter(op, ecorePackage.getEString(), "path");
+
+ op = addEOperation(dataObjectEClass, null, "unset");
+ addEParameter(op, ecorePackage.getEString(), "path");
+
+ op = addEOperation(dataObjectEClass, theEcorePackage.getEJavaObject(), "get");
+ addEParameter(op, ecorePackage.getEInt(), "propertyIndex");
+
+ op = addEOperation(dataObjectEClass, null, "set");
+ addEParameter(op, ecorePackage.getEInt(), "propertyIndex");
+ addEParameter(op, theEcorePackage.getEJavaObject(), "value");
+
+ op = addEOperation(dataObjectEClass, ecorePackage.getEBoolean(), "isSet");
+ addEParameter(op, ecorePackage.getEInt(), "propertyIndex");
+
+ op = addEOperation(dataObjectEClass, null, "unset");
+ addEParameter(op, ecorePackage.getEInt(), "propertyIndex");
+
+ op = addEOperation(dataObjectEClass, theEcorePackage.getEJavaObject(), "get");
+ addEParameter(op, this.getProperty(), "property");
+
+ op = addEOperation(dataObjectEClass, null, "set");
+ addEParameter(op, this.getProperty(), "property");
+ addEParameter(op, theEcorePackage.getEJavaObject(), "value");
+
+ op = addEOperation(dataObjectEClass, ecorePackage.getEBoolean(), "isSet");
+ addEParameter(op, this.getProperty(), "property");
+
+ op = addEOperation(dataObjectEClass, null, "unset");
+ addEParameter(op, this.getProperty(), "property");
+
+ addEOperation(dataObjectEClass, this.getDataObject(), "getContainer");
+
+ addEOperation(dataObjectEClass, this.getProperty(), "getContainmentProperty");
+
+ addEOperation(dataObjectEClass, this.getDataGraph(), "getDataGraph");
+
+ addEOperation(dataObjectEClass, this.getType(), "getType");
+
+ op = addEOperation(dataObjectEClass, theEcorePackage.getEBigDecimal(), "getBigDecimal");
+ addEParameter(op, ecorePackage.getEString(), "path");
+
+ op = addEOperation(dataObjectEClass, theEcorePackage.getEBigInteger(), "getBigInteger");
+ addEParameter(op, ecorePackage.getEString(), "path");
+
+ op = addEOperation(dataObjectEClass, ecorePackage.getEBoolean(), "getBoolean");
+ addEParameter(op, ecorePackage.getEString(), "path");
+
+ op = addEOperation(dataObjectEClass, ecorePackage.getEByte(), "getByte");
+ addEParameter(op, ecorePackage.getEString(), "path");
+
+ op = addEOperation(dataObjectEClass, theEcorePackage.getEByteArray(), "getBytes");
+ addEParameter(op, ecorePackage.getEString(), "path");
+
+ op = addEOperation(dataObjectEClass, ecorePackage.getEChar(), "getChar");
+ addEParameter(op, ecorePackage.getEString(), "path");
+
+ op = addEOperation(dataObjectEClass, this.getDataObject(), "getDataObject");
+ addEParameter(op, ecorePackage.getEString(), "path");
+
+ op = addEOperation(dataObjectEClass, theEcorePackage.getEDate(), "getDate");
+ addEParameter(op, ecorePackage.getEString(), "path");
+
+ op = addEOperation(dataObjectEClass, ecorePackage.getEDouble(), "getDouble");
+ addEParameter(op, ecorePackage.getEString(), "path");
+
+ op = addEOperation(dataObjectEClass, ecorePackage.getEFloat(), "getFloat");
+ addEParameter(op, ecorePackage.getEString(), "path");
+
+ op = addEOperation(dataObjectEClass, ecorePackage.getEInt(), "getInt");
+ addEParameter(op, ecorePackage.getEString(), "path");
+
+ op = addEOperation(dataObjectEClass, this.getEJavaList(), "getList");
+ addEParameter(op, ecorePackage.getEString(), "path");
+
+ op = addEOperation(dataObjectEClass, ecorePackage.getELong(), "getLong");
+ addEParameter(op, ecorePackage.getEString(), "path");
+
+ op = addEOperation(dataObjectEClass, this.getSequence(), "getSequence");
+ addEParameter(op, ecorePackage.getEString(), "path");
+
+ op = addEOperation(dataObjectEClass, ecorePackage.getEShort(), "getShort");
+ addEParameter(op, ecorePackage.getEString(), "path");
+
+ op = addEOperation(dataObjectEClass, ecorePackage.getEString(), "getString");
+ addEParameter(op, ecorePackage.getEString(), "path");
+
+ op = addEOperation(dataObjectEClass, null, "setBigDecimal");
+ addEParameter(op, ecorePackage.getEString(), "path");
+ addEParameter(op, theEcorePackage.getEBigDecimal(), "value");
+
+ op = addEOperation(dataObjectEClass, null, "setBigInteger");
+ addEParameter(op, ecorePackage.getEString(), "path");
+ addEParameter(op, theEcorePackage.getEBigInteger(), "value");
+
+ op = addEOperation(dataObjectEClass, null, "setBoolean");
+ addEParameter(op, ecorePackage.getEString(), "path");
+ addEParameter(op, ecorePackage.getEBoolean(), "value");
+
+ op = addEOperation(dataObjectEClass, null, "setByte");
+ addEParameter(op, ecorePackage.getEString(), "path");
+ addEParameter(op, ecorePackage.getEByte(), "value");
+
+ op = addEOperation(dataObjectEClass, null, "setBytes");
+ addEParameter(op, ecorePackage.getEString(), "path");
+ addEParameter(op, theEcorePackage.getEByteArray(), "value");
+
+ op = addEOperation(dataObjectEClass, null, "setChar");
+ addEParameter(op, ecorePackage.getEString(), "path");
+ addEParameter(op, ecorePackage.getEChar(), "value");
+
+ op = addEOperation(dataObjectEClass, null, "setDataObject");
+ addEParameter(op, ecorePackage.getEString(), "path");
+ addEParameter(op, this.getDataObject(), "value");
+
+ op = addEOperation(dataObjectEClass, null, "setDate");
+ addEParameter(op, ecorePackage.getEString(), "path");
+ addEParameter(op, theEcorePackage.getEDate(), "value");
+
+ op = addEOperation(dataObjectEClass, null, "setDouble");
+ addEParameter(op, ecorePackage.getEString(), "path");
+ addEParameter(op, ecorePackage.getEDouble(), "value");
+
+ op = addEOperation(dataObjectEClass, null, "setFloat");
+ addEParameter(op, ecorePackage.getEString(), "path");
+ addEParameter(op, ecorePackage.getEFloat(), "value");
+
+ op = addEOperation(dataObjectEClass, null, "setInt");
+ addEParameter(op, ecorePackage.getEString(), "path");
+ addEParameter(op, ecorePackage.getEInt(), "value");
+
+ op = addEOperation(dataObjectEClass, null, "setList");
+ addEParameter(op, ecorePackage.getEString(), "path");
+ addEParameter(op, this.getEJavaList(), "value");
+
+ op = addEOperation(dataObjectEClass, null, "setLong");
+ addEParameter(op, ecorePackage.getEString(), "path");
+ addEParameter(op, ecorePackage.getELong(), "value");
+
+ op = addEOperation(dataObjectEClass, null, "setShort");
+ addEParameter(op, ecorePackage.getEString(), "path");
+ addEParameter(op, ecorePackage.getEShort(), "value");
+
+ op = addEOperation(dataObjectEClass, null, "setString");
+ addEParameter(op, ecorePackage.getEString(), "path");
+ addEParameter(op, ecorePackage.getEString(), "value");
+
+ op = addEOperation(dataObjectEClass, theEcorePackage.getEBigDecimal(), "getBigDecimal");
+ addEParameter(op, ecorePackage.getEInt(), "propertyIndex");
+
+ op = addEOperation(dataObjectEClass, theEcorePackage.getEBigInteger(), "getBigInteger");
+ addEParameter(op, ecorePackage.getEInt(), "propertyIndex");
+
+ op = addEOperation(dataObjectEClass, ecorePackage.getEBoolean(), "getBoolean");
+ addEParameter(op, ecorePackage.getEInt(), "propertyIndex");
+
+ op = addEOperation(dataObjectEClass, ecorePackage.getEByte(), "getByte");
+ addEParameter(op, ecorePackage.getEInt(), "propertyIndex");
+
+ op = addEOperation(dataObjectEClass, theEcorePackage.getEByteArray(), "getBytes");
+ addEParameter(op, ecorePackage.getEInt(), "propertyIndex");
+
+ op = addEOperation(dataObjectEClass, ecorePackage.getEChar(), "getChar");
+ addEParameter(op, ecorePackage.getEInt(), "propertyIndex");
+
+ op = addEOperation(dataObjectEClass, this.getDataObject(), "getDataObject");
+ addEParameter(op, ecorePackage.getEInt(), "propertyIndex");
+
+ op = addEOperation(dataObjectEClass, theEcorePackage.getEDate(), "getDate");
+ addEParameter(op, ecorePackage.getEInt(), "propertyIndex");
+
+ op = addEOperation(dataObjectEClass, ecorePackage.getEDouble(), "getDouble");
+ addEParameter(op, ecorePackage.getEInt(), "propertyIndex");
+
+ op = addEOperation(dataObjectEClass, ecorePackage.getEFloat(), "getFloat");
+ addEParameter(op, ecorePackage.getEInt(), "propertyIndex");
+
+ op = addEOperation(dataObjectEClass, ecorePackage.getEInt(), "getInt");
+ addEParameter(op, ecorePackage.getEInt(), "propertyIndex");
+
+ op = addEOperation(dataObjectEClass, this.getEJavaList(), "getList");
+ addEParameter(op, ecorePackage.getEInt(), "propertyIndex");
+
+ op = addEOperation(dataObjectEClass, ecorePackage.getELong(), "getLong");
+ addEParameter(op, ecorePackage.getEInt(), "propertyIndex");
+
+ op = addEOperation(dataObjectEClass, this.getSequence(), "getSequence");
+ addEParameter(op, ecorePackage.getEInt(), "propertyIndex");
+
+ op = addEOperation(dataObjectEClass, ecorePackage.getEShort(), "getShort");
+ addEParameter(op, ecorePackage.getEInt(), "propertyIndex");
+
+ op = addEOperation(dataObjectEClass, ecorePackage.getEString(), "getString");
+ addEParameter(op, ecorePackage.getEInt(), "propertyIndex");
+
+ op = addEOperation(dataObjectEClass, null, "setBigDecimal");
+ addEParameter(op, ecorePackage.getEInt(), "propertyIndex");
+ addEParameter(op, theEcorePackage.getEBigDecimal(), "value");
+
+ op = addEOperation(dataObjectEClass, null, "setBigInteger");
+ addEParameter(op, ecorePackage.getEInt(), "propertyIndex");
+ addEParameter(op, theEcorePackage.getEBigInteger(), "value");
+
+ op = addEOperation(dataObjectEClass, null, "setBoolean");
+ addEParameter(op, ecorePackage.getEInt(), "propertyIndex");
+ addEParameter(op, ecorePackage.getEBoolean(), "value");
+
+ op = addEOperation(dataObjectEClass, null, "setByte");
+ addEParameter(op, ecorePackage.getEInt(), "propertyIndex");
+ addEParameter(op, ecorePackage.getEByte(), "value");
+
+ op = addEOperation(dataObjectEClass, null, "setBytes");
+ addEParameter(op, ecorePackage.getEInt(), "propertyIndex");
+ addEParameter(op, theEcorePackage.getEByteArray(), "value");
+
+ op = addEOperation(dataObjectEClass, null, "setChar");
+ addEParameter(op, ecorePackage.getEInt(), "propertyIndex");
+ addEParameter(op, ecorePackage.getEChar(), "value");
+
+ op = addEOperation(dataObjectEClass, null, "setDataObject");
+ addEParameter(op, ecorePackage.getEInt(), "propertyIndex");
+ addEParameter(op, this.getDataObject(), "value");
+
+ op = addEOperation(dataObjectEClass, null, "setDate");
+ addEParameter(op, ecorePackage.getEInt(), "propertyIndex");
+ addEParameter(op, theEcorePackage.getEDate(), "value");
+
+ op = addEOperation(dataObjectEClass, null, "setDouble");
+ addEParameter(op, ecorePackage.getEInt(), "propertyIndex");
+ addEParameter(op, ecorePackage.getEDouble(), "value");
+
+ op = addEOperation(dataObjectEClass, null, "setFloat");
+ addEParameter(op, ecorePackage.getEInt(), "propertyIndex");
+ addEParameter(op, ecorePackage.getEFloat(), "value");
+
+ op = addEOperation(dataObjectEClass, null, "setInt");
+ addEParameter(op, ecorePackage.getEInt(), "propertyIndex");
+ addEParameter(op, ecorePackage.getEInt(), "value");
+
+ op = addEOperation(dataObjectEClass, null, "setList");
+ addEParameter(op, ecorePackage.getEInt(), "propertyIndex");
+ addEParameter(op, this.getEJavaList(), "value");
+
+ op = addEOperation(dataObjectEClass, null, "setLong");
+ addEParameter(op, ecorePackage.getEInt(), "propertyIndex");
+ addEParameter(op, ecorePackage.getELong(), "value");
+
+ op = addEOperation(dataObjectEClass, null, "setShort");
+ addEParameter(op, ecorePackage.getEInt(), "propertyIndex");
+ addEParameter(op, ecorePackage.getEShort(), "value");
+
+ op = addEOperation(dataObjectEClass, null, "setString");
+ addEParameter(op, ecorePackage.getEInt(), "propertyIndex");
+ addEParameter(op, ecorePackage.getEString(), "value");
+
+ op = addEOperation(dataObjectEClass, theEcorePackage.getEBigDecimal(), "getBigDecimal");
+ addEParameter(op, this.getProperty(), "property");
+
+ op = addEOperation(dataObjectEClass, theEcorePackage.getEBigInteger(), "getBigInteger");
+ addEParameter(op, this.getProperty(), "property");
+
+ op = addEOperation(dataObjectEClass, ecorePackage.getEBoolean(), "getBoolean");
+ addEParameter(op, this.getProperty(), "property");
+
+ op = addEOperation(dataObjectEClass, ecorePackage.getEByte(), "getByte");
+ addEParameter(op, this.getProperty(), "property");
+
+ op = addEOperation(dataObjectEClass, theEcorePackage.getEByteArray(), "getBytes");
+ addEParameter(op, this.getProperty(), "property");
+
+ op = addEOperation(dataObjectEClass, ecorePackage.getEChar(), "getChar");
+ addEParameter(op, this.getProperty(), "property");
+
+ op = addEOperation(dataObjectEClass, this.getDataObject(), "getDataObject");
+ addEParameter(op, this.getProperty(), "property");
+
+ op = addEOperation(dataObjectEClass, theEcorePackage.getEDate(), "getDate");
+ addEParameter(op, this.getProperty(), "property");
+
+ op = addEOperation(dataObjectEClass, ecorePackage.getEDouble(), "getDouble");
+ addEParameter(op, this.getProperty(), "property");
+
+ op = addEOperation(dataObjectEClass, ecorePackage.getEFloat(), "getFloat");
+ addEParameter(op, this.getProperty(), "property");
+
+ op = addEOperation(dataObjectEClass, ecorePackage.getEInt(), "getInt");
+ addEParameter(op, this.getProperty(), "property");
+
+ op = addEOperation(dataObjectEClass, this.getEJavaList(), "getList");
+ addEParameter(op, this.getProperty(), "property");
+
+ op = addEOperation(dataObjectEClass, ecorePackage.getELong(), "getLong");
+ addEParameter(op, this.getProperty(), "property");
+
+ op = addEOperation(dataObjectEClass, this.getSequence(), "getSequence");
+ addEParameter(op, this.getProperty(), "property");
+
+ op = addEOperation(dataObjectEClass, ecorePackage.getEShort(), "getShort");
+ addEParameter(op, this.getProperty(), "property");
+
+ op = addEOperation(dataObjectEClass, ecorePackage.getEString(), "getString");
+ addEParameter(op, this.getProperty(), "property");
+
+ op = addEOperation(dataObjectEClass, null, "setBigDecimal");
+ addEParameter(op, this.getProperty(), "property");
+ addEParameter(op, theEcorePackage.getEBigDecimal(), "value");
+
+ op = addEOperation(dataObjectEClass, null, "setBigInteger");
+ addEParameter(op, this.getProperty(), "property");
+ addEParameter(op, theEcorePackage.getEBigInteger(), "value");
+
+ op = addEOperation(dataObjectEClass, null, "setBoolean");
+ addEParameter(op, this.getProperty(), "property");
+ addEParameter(op, ecorePackage.getEBoolean(), "value");
+
+ op = addEOperation(dataObjectEClass, null, "setByte");
+ addEParameter(op, this.getProperty(), "property");
+ addEParameter(op, ecorePackage.getEByte(), "value");
+
+ op = addEOperation(dataObjectEClass, null, "setBytes");
+ addEParameter(op, this.getProperty(), "property");
+ addEParameter(op, theEcorePackage.getEByteArray(), "value");
+
+ op = addEOperation(dataObjectEClass, null, "setChar");
+ addEParameter(op, this.getProperty(), "property");
+ addEParameter(op, ecorePackage.getEChar(), "value");
+
+ op = addEOperation(dataObjectEClass, null, "setDataObject");
+ addEParameter(op, this.getProperty(), "property");
+ addEParameter(op, this.getDataObject(), "value");
+
+ op = addEOperation(dataObjectEClass, null, "setDate");
+ addEParameter(op, this.getProperty(), "property");
+ addEParameter(op, theEcorePackage.getEDate(), "value");
+
+ op = addEOperation(dataObjectEClass, null, "setDouble");
+ addEParameter(op, this.getProperty(), "property");
+ addEParameter(op, ecorePackage.getEDouble(), "value");
+
+ op = addEOperation(dataObjectEClass, null, "setFloat");
+ addEParameter(op, this.getProperty(), "property");
+ addEParameter(op, ecorePackage.getEFloat(), "value");
+
+ op = addEOperation(dataObjectEClass, null, "setInt");
+ addEParameter(op, this.getProperty(), "property");
+ addEParameter(op, ecorePackage.getEInt(), "value");
+
+ op = addEOperation(dataObjectEClass, null, "setList");
+ addEParameter(op, this.getProperty(), "property");
+ addEParameter(op, this.getEJavaList(), "value");
+
+ op = addEOperation(dataObjectEClass, null, "setLong");
+ addEParameter(op, this.getProperty(), "property");
+ addEParameter(op, ecorePackage.getELong(), "value");
+
+ op = addEOperation(dataObjectEClass, null, "setShort");
+ addEParameter(op, this.getProperty(), "property");
+ addEParameter(op, ecorePackage.getEShort(), "value");
+
+ op = addEOperation(dataObjectEClass, null, "setString");
+ addEParameter(op, this.getProperty(), "property");
+ addEParameter(op, ecorePackage.getEString(), "value");
+
+ op = addEOperation(dataObjectEClass, this.getDataObject(), "createDataObject");
+ addEParameter(op, ecorePackage.getEString(), "propertyName");
+
+ op = addEOperation(dataObjectEClass, this.getDataObject(), "createDataObject");
+ addEParameter(op, ecorePackage.getEInt(), "propertyIndex");
+
+ op = addEOperation(dataObjectEClass, this.getDataObject(), "createDataObject");
+ addEParameter(op, this.getProperty(), "property");
+
+ op = addEOperation(dataObjectEClass, this.getDataObject(), "createDataObject");
+ addEParameter(op, ecorePackage.getEString(), "propertyName");
+ addEParameter(op, ecorePackage.getEString(), "namespaceURI");
+ addEParameter(op, ecorePackage.getEString(), "typeName");
+
+ op = addEOperation(dataObjectEClass, this.getDataObject(), "createDataObject");
+ addEParameter(op, ecorePackage.getEInt(), "propertyIndex");
+ addEParameter(op, ecorePackage.getEString(), "namespaceURI");
+ addEParameter(op, ecorePackage.getEString(), "typeName");
+
+ op = addEOperation(dataObjectEClass, this.getDataObject(), "createDataObject");
+ addEParameter(op, this.getProperty(), "property");
+ addEParameter(op, this.getType(), "type");
+
+ addEOperation(dataObjectEClass, null, "delete");
+
+ addEOperation(dataObjectEClass, this.getSequence(), "getSequence");
+
+ addEOperation(dataObjectEClass, this.getEJavaList(), "getInstanceProperties");
+
+ op = addEOperation(dataObjectEClass, this.getProperty(), "getProperty");
+ addEParameter(op, ecorePackage.getEString(), "propertyName");
+
+ addEOperation(dataObjectEClass, this.getDataObject(), "getRootObject");
+
+ addEOperation(dataObjectEClass, this.getChangeSummary(), "getChangeSummary");
+
+ addEOperation(dataObjectEClass, null, "detach");
+
+ initEClass(propertyEClass, Property.class, "Property", IS_ABSTRACT, IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS);
+
+ addEOperation(propertyEClass, ecorePackage.getEString(), "getName");
+
+ addEOperation(propertyEClass, this.getType(), "getType");
+
+ addEOperation(propertyEClass, ecorePackage.getEBoolean(), "isMany");
+
+ addEOperation(propertyEClass, ecorePackage.getEBoolean(), "isContainment");
+
+ addEOperation(propertyEClass, ecorePackage.getEBoolean(), "isReadOnly");
+
+ addEOperation(propertyEClass, this.getType(), "getContainingType");
+
+ addEOperation(propertyEClass, this.getEJavaList(), "getAliasNames");
+
+ addEOperation(propertyEClass, this.getProperty(), "getOpposite");
+
+ addEOperation(propertyEClass, theEcorePackage.getEJavaObject(), "getDefault");
+
+ initEClass(sequenceEClass, Sequence.class, "Sequence", IS_ABSTRACT, IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS);
+
+ addEOperation(sequenceEClass, ecorePackage.getEInt(), "size");
+
+ op = addEOperation(sequenceEClass, this.getProperty(), "getProperty");
+ addEParameter(op, ecorePackage.getEInt(), "index");
+
+ op = addEOperation(sequenceEClass, theEcorePackage.getEJavaObject(), "getValue");
+ addEParameter(op, ecorePackage.getEInt(), "index");
+
+ op = addEOperation(sequenceEClass, theEcorePackage.getEJavaObject(), "setValue");
+ addEParameter(op, ecorePackage.getEInt(), "index");
+ addEParameter(op, theEcorePackage.getEJavaObject(), "value");
+
+ op = addEOperation(sequenceEClass, ecorePackage.getEBoolean(), "add");
+ addEParameter(op, ecorePackage.getEString(), "propertyName");
+ addEParameter(op, theEcorePackage.getEJavaObject(), "value");
+
+ op = addEOperation(sequenceEClass, ecorePackage.getEBoolean(), "add");
+ addEParameter(op, ecorePackage.getEInt(), "propertIndex");
+ addEParameter(op, theEcorePackage.getEJavaObject(), "value");
+
+ op = addEOperation(sequenceEClass, ecorePackage.getEBoolean(), "add");
+ addEParameter(op, this.getProperty(), "property");
+ addEParameter(op, theEcorePackage.getEJavaObject(), "value");
+
+ op = addEOperation(sequenceEClass, null, "add");
+ addEParameter(op, ecorePackage.getEInt(), "index");
+ addEParameter(op, ecorePackage.getEString(), "propertyName");
+ addEParameter(op, theEcorePackage.getEJavaObject(), "value");
+
+ op = addEOperation(sequenceEClass, null, "add");
+ addEParameter(op, ecorePackage.getEInt(), "index");
+ addEParameter(op, ecorePackage.getEInt(), "propertyIndex");
+ addEParameter(op, theEcorePackage.getEJavaObject(), "value");
+
+ op = addEOperation(sequenceEClass, null, "add");
+ addEParameter(op, ecorePackage.getEInt(), "index");
+ addEParameter(op, this.getProperty(), "property");
+ addEParameter(op, theEcorePackage.getEJavaObject(), "value");
+
+ op = addEOperation(sequenceEClass, null, "add");
+ addEParameter(op, ecorePackage.getEString(), "text");
+
+ op = addEOperation(sequenceEClass, null, "add");
+ addEParameter(op, ecorePackage.getEInt(), "index");
+ addEParameter(op, ecorePackage.getEString(), "text");
+
+ initEClass(typeEClass, Type.class, "Type", IS_ABSTRACT, IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS);
+
+ addEOperation(typeEClass, ecorePackage.getEString(), "getName");
+
+ addEOperation(typeEClass, ecorePackage.getEString(), "getURI");
+
+ addEOperation(typeEClass, theEcorePackage.getEJavaClass(), "getInstanceClass");
+
+ op = addEOperation(typeEClass, ecorePackage.getEBoolean(), "isInstance");
+ addEParameter(op, theEcorePackage.getEJavaObject(), "object");
+
+ addEOperation(typeEClass, ecorePackage.getEBoolean(), "isDataType");
+
+ addEOperation(typeEClass, ecorePackage.getEBoolean(), "isSequenced");
+
+ addEOperation(typeEClass, ecorePackage.getEBoolean(), "isOpen");
+
+ addEOperation(typeEClass, ecorePackage.getEBoolean(), "isAbstract");
+
+ addEOperation(typeEClass, this.getEJavaList(), "getBaseTypes");
+
+ addEOperation(typeEClass, this.getEJavaList(), "getAliasNames");
+
+ addEOperation(typeEClass, this.getEJavaList(), "getProperties");
+
+ addEOperation(typeEClass, this.getEJavaList(), "getDeclaredProperties");
+
+ op = addEOperation(typeEClass, this.getProperty(), "getProperty");
+ addEParameter(op, ecorePackage.getEString(), "propertyName");
+
+ initEClass(anyTypeDataObjectEClass, AnyTypeDataObject.class, "AnyTypeDataObject", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+
+ initEClass(simpleAnyTypeDataObjectEClass, SimpleAnyTypeDataObject.class, "SimpleAnyTypeDataObject", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+
+ initEClass(classEClass, Type.class, "Class", !IS_ABSTRACT, !IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS);
+
+ initEClass(dataTypeEClass, Type.class, "DataType", !IS_ABSTRACT, !IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS);
+
+ initEClass(attributeEClass, Property.class, "Attribute", !IS_ABSTRACT, !IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS);
+
+ initEClass(referenceEClass, Property.class, "Reference", !IS_ABSTRACT, !IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS);
+
+ initEClass(enumEClass, Type.class, "Enum", !IS_ABSTRACT, !IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS);
+
+ initEClass(dynamicDataObjectEClass, DataObject.class, "DynamicDataObject", !IS_ABSTRACT, !IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS);
+
+ initEClass(storeDataObjectEClass, DataObject.class, "StoreDataObject", !IS_ABSTRACT, !IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS);
+
+ initEClass(dynamicStoreDataObjectEClass, DataObject.class, "DynamicStoreDataObject", !IS_ABSTRACT, !IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS);
+
+ // Initialize data types
+ initEDataType(eJavaListEDataType, List.class, "EJavaList", !IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
+ initEDataType(eObjectStreamExceptionEDataType, ObjectStreamException.class, "EObjectStreamException", !IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
+
+ // Create resource
+ createResource(eNS_URI);
+
+ // Create annotations
+ // http://www.eclipse.org/emf/2002/GenModel
+ createGenModelAnnotations();
+ // http:///org/eclipse/emf/ecore/util/ExtendedMetaData
+ createExtendedMetaDataAnnotations();
+ }
+
+ /**
+ * Initializes the annotations for <b>http://www.eclipse.org/emf/2002/GenModel</b>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void createGenModelAnnotations()
+ {
+ String source = "http://www.eclipse.org/emf/2002/GenModel";
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(0),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.get(this, path);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(1),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.set(this, path, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(2),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.isSet(this, path);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(3),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.unset(this, path);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(4),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.get(this, propertyIndex);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(5),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.set(this, propertyIndex, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(6),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.isSet(this, propertyIndex);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(7),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.unset(this, propertyIndex);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(8),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.get(this, property);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(9),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.set(this, property, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(10),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.isSet(this, property);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(11),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.unset(this, property);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(12),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getContainer(this);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(13),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getContainmentProperty(this);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(14),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getDataGraph(this);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(15),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getType(this);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(16),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getBigDecimal(this, path);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(17),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getBigInteger(this, path);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(18),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getBoolean(this, path);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(19),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getByte(this, path);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(20),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getBytes(this, path);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(21),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getChar(this, path);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(22),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getDataObject(this, path);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(23),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getDate(this, path);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(24),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getDouble(this, path);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(25),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getFloat(this, path);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(26),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getInt(this, path);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(27),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getList(this, path);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(28),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getLong(this, path);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(29),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getSequence(this, path);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(30),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getShort(this, path);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(31),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getString(this, path);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(32),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.setBigDecimal(this, path, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(33),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.setBigInteger(this, path, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(34),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.setBoolean(this, path, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(35),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.setByte(this, path, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(36),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.setBytes(this, path, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(37),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.setChar(this, path, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(38),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.setDataObject(this, path, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(39),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.setDate(this, path, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(40),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.setDouble(this, path, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(41),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.setFloat(this, path, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(42),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.setInt(this, path, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(43),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.setList(this, path, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(44),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.setLong(this, path, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(45),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.setShort(this, path, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(46),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.setString(this, path, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(47),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getBigDecimal(this, propertyIndex);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(48),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getBigInteger(this, propertyIndex);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(49),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getBoolean(this, propertyIndex);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(50),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getByte(this, propertyIndex);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(51),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getBytes(this, propertyIndex);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(52),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getChar(this, propertyIndex);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(53),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getDataObject(this, propertyIndex);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(54),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getDate(this, propertyIndex);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(55),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getDouble(this, propertyIndex);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(56),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getFloat(this, propertyIndex);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(57),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getInt(this, propertyIndex);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(58),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getList(this, propertyIndex);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(59),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getLong(this, propertyIndex);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(60),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getSequence(this, propertyIndex);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(61),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getShort(this, propertyIndex);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(62),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getString(this, propertyIndex);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(63),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.setBigDecimal(this, propertyIndex, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(64),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.setBigInteger(this, propertyIndex, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(65),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.setBoolean(this, propertyIndex, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(66),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.setByte(this, propertyIndex, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(67),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.setBytes(this, propertyIndex, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(68),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.setChar(this, propertyIndex, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(69),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.setDataObject(this, propertyIndex, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(70),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.setDate(this, propertyIndex, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(71),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.setDouble(this, propertyIndex, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(72),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.setFloat(this, propertyIndex, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(73),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.setInt(this, propertyIndex, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(74),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.setList(this, propertyIndex, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(75),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.setLong(this, propertyIndex, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(76),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.setShort(this, propertyIndex, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(77),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.setString(this, propertyIndex, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(78),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getBigDecimal(this, property);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(79),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getBigInteger(this, property);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(80),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getBoolean(this, property);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(81),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getByte(this, property);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(82),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getBytes(this, property);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(83),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getChar(this, property);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(84),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getDataObject(this, property);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(85),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getDate(this, property);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(86),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getDouble(this, property);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(87),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getFloat(this, property);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(88),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getInt(this, property);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(89),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getList(this, property);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(90),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getLong(this, property);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(91),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getSequence(this, property);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(92),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getShort(this, property);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(93),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getString(this, property);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(94),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.setBigDecimal(this, property, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(95),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.setBigInteger(this, property, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(96),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.setBoolean(this, property, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(97),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.setByte(this, property, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(98),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.setBytes(this, property, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(99),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.setChar(this, property, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(100),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.setDataObject(this, property, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(101),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.setDate(this, property, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(102),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.setDouble(this, property, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(103),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.setFloat(this, property, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(104),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.setInt(this, property, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(105),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.setList(this, property, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(106),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.setLong(this, property, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(107),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.setShort(this, property, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(108),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.setString(this, property, value);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(109),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.createDataObject(this, propertyName);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(110),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.createDataObject(this, propertyIndex);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(111),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.createDataObject(this, property);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(112),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.createDataObject(this, propertyName, namespaceURI, typeName);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(113),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.createDataObject(this, propertyIndex, namespaceURI, typeName);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(114),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.createDataObject(this, property, type);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(115),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.delete(this);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(116),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getSequence(this);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(117),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getInstanceProperties(this);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(118),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getProperty(this, propertyName);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(119),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getRootObject(this);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(120),
+ source,
+ new String[]
+ {
+ "body", "return <%org.apache.sdo.util.SDOUtil%>.getChangeSummary(this);"
+ });
+ addAnnotation
+ ((EOperation)dataObjectEClass.getEOperations().get(121),
+ source,
+ new String[]
+ {
+ "body", "<%org.apache.sdo.util.SDOUtil%>.detach(this);"
+ });
+ }
+
+ /**
+ * Initializes the annotations for <b>http:///org/eclipse/emf/ecore/util/ExtendedMetaData</b>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void createExtendedMetaDataAnnotations()
+ {
+ String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData";
+ addAnnotation
+ (anyTypeDataObjectEClass,
+ source,
+ new String[]
+ {
+ "kind", "mixed"
+ });
+ addAnnotation
+ (simpleAnyTypeDataObjectEClass,
+ source,
+ new String[]
+ {
+ "kind", "simple"
+ });
+ }
+
+} //SDOPackageImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/SimpleAnyTypeDataObjectImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/SimpleAnyTypeDataObjectImpl.java
new file mode 100644
index 0000000000..e257e30d27
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/SimpleAnyTypeDataObjectImpl.java
@@ -0,0 +1,333 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.impl;
+
+import java.util.Iterator;
+
+import org.apache.tuscany.sdo.SDOPackage;
+import org.apache.tuscany.sdo.SimpleAnyTypeDataObject;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.ecore.util.FeatureMap;
+import org.eclipse.emf.ecore.xml.type.SimpleAnyType;
+import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>EData Object Simple Any Type</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.apache.tuscany.sdo.impl.SimpleAnyTypeDataObjectImpl#getRawValue <em>Raw Value</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.impl.SimpleAnyTypeDataObjectImpl#getValue <em>Value</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.impl.SimpleAnyTypeDataObjectImpl#getInstanceType <em>Instance Type</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class SimpleAnyTypeDataObjectImpl extends AnyTypeDataObjectImpl implements SimpleAnyTypeDataObject
+{
+ /**
+ * The default value of the '{@link #getRawValue() <em>Raw Value</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getRawValue()
+ * @generated
+ * @ordered
+ */
+ protected static final String RAW_VALUE_EDEFAULT = null;
+
+ /**
+ * The default value of the '{@link #getValue() <em>Value</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getValue()
+ * @generated
+ * @ordered
+ */
+ protected static final Object VALUE_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getInstanceType() <em>Instance Type</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getInstanceType()
+ * @generated
+ * @ordered
+ */
+ protected EDataType instanceType = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected SimpleAnyTypeDataObjectImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EClass eStaticClass()
+ {
+ return SDOPackage.eINSTANCE.getSimpleAnyTypeDataObject();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String getRawValue()
+ {
+ StringBuffer value = new StringBuffer();
+ for (Iterator i = getMixed().iterator(); i.hasNext(); )
+ {
+ FeatureMap.Entry entry = (FeatureMap.Entry)i.next();
+ if (entry.getEStructuralFeature() == XMLTypePackage.eINSTANCE.getXMLTypeDocumentRoot_Text())
+ {
+ value.append(entry.getValue());
+ }
+ }
+ return value.toString();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setRawValue(String newRawValue)
+ {
+ getMixed().clear();
+ if (newRawValue != null)
+ {
+ getMixed().add(XMLTypePackage.eINSTANCE.getXMLTypeDocumentRoot_Text(), newRawValue);
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Object getValue()
+ {
+ return EcoreUtil.createFromString(instanceType, getRawValue());
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void setValue(Object newValue)
+ {
+ setRawValue(EcoreUtil.convertToString(instanceType, newValue));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EDataType getInstanceType()
+ {
+ return instanceType;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setInstanceType(EDataType newInstanceType)
+ {
+ EDataType oldInstanceType = instanceType;
+ instanceType = newInstanceType;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__INSTANCE_TYPE, oldInstanceType, instanceType));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object eGet(int featureID, boolean resolve, boolean coreType)
+ {
+ switch (featureID)
+ {
+ case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__MIXED:
+ if (coreType) return getMixed();
+ return ((FeatureMap.Internal)getMixed()).getWrapper();
+ case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__ANY:
+ if (coreType) return getAny();
+ return ((FeatureMap.Internal)getAny()).getWrapper();
+ case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__ANY_ATTRIBUTE:
+ if (coreType) return getAnyAttribute();
+ return ((FeatureMap.Internal)getAnyAttribute()).getWrapper();
+ case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__RAW_VALUE:
+ return getRawValue();
+ case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__VALUE:
+ return getValue();
+ case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__INSTANCE_TYPE:
+ return getInstanceType();
+ }
+ return eDynamicGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void eSet(int featureID, Object newValue)
+ {
+ switch (featureID)
+ {
+ case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__MIXED:
+ ((FeatureMap.Internal)getMixed()).set(newValue);
+ return;
+ case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__ANY:
+ ((FeatureMap.Internal)getAny()).set(newValue);
+ return;
+ case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__ANY_ATTRIBUTE:
+ ((FeatureMap.Internal)getAnyAttribute()).set(newValue);
+ return;
+ case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__RAW_VALUE:
+ setRawValue((String)newValue);
+ return;
+ case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__VALUE:
+ setValue((Object)newValue);
+ return;
+ case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__INSTANCE_TYPE:
+ setInstanceType((EDataType)newValue);
+ return;
+ }
+ eDynamicSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void eUnset(int featureID)
+ {
+ switch (featureID)
+ {
+ case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__MIXED:
+ getMixed().clear();
+ return;
+ case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__ANY:
+ getAny().clear();
+ return;
+ case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__ANY_ATTRIBUTE:
+ getAnyAttribute().clear();
+ return;
+ case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__RAW_VALUE:
+ setRawValue(RAW_VALUE_EDEFAULT);
+ return;
+ case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__VALUE:
+ setValue(VALUE_EDEFAULT);
+ return;
+ case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__INSTANCE_TYPE:
+ setInstanceType((EDataType)null);
+ return;
+ }
+ eDynamicUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean eIsSet(int featureID)
+ {
+ switch (featureID)
+ {
+ case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__MIXED:
+ return mixed != null && !mixed.isEmpty();
+ case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__ANY:
+ return !getAny().isEmpty();
+ case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__ANY_ATTRIBUTE:
+ return anyAttribute != null && !anyAttribute.isEmpty();
+ case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__RAW_VALUE:
+ return RAW_VALUE_EDEFAULT == null ? getRawValue() != null : !RAW_VALUE_EDEFAULT.equals(getRawValue());
+ case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__VALUE:
+ return VALUE_EDEFAULT == null ? getValue() != null : !VALUE_EDEFAULT.equals(getValue());
+ case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__INSTANCE_TYPE:
+ return instanceType != null;
+ }
+ return eDynamicIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass)
+ {
+ if (baseClass == SimpleAnyType.class)
+ {
+ switch (derivedFeatureID)
+ {
+ case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__RAW_VALUE: return XMLTypePackage.SIMPLE_ANY_TYPE__RAW_VALUE;
+ case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__VALUE: return XMLTypePackage.SIMPLE_ANY_TYPE__VALUE;
+ case SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__INSTANCE_TYPE: return XMLTypePackage.SIMPLE_ANY_TYPE__INSTANCE_TYPE;
+ default: return -1;
+ }
+ }
+ return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass)
+ {
+ if (baseClass == SimpleAnyType.class)
+ {
+ switch (baseFeatureID)
+ {
+ case XMLTypePackage.SIMPLE_ANY_TYPE__RAW_VALUE: return SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__RAW_VALUE;
+ case XMLTypePackage.SIMPLE_ANY_TYPE__VALUE: return SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__VALUE;
+ case XMLTypePackage.SIMPLE_ANY_TYPE__INSTANCE_TYPE: return SDOPackage.SIMPLE_ANY_TYPE_DATA_OBJECT__INSTANCE_TYPE;
+ default: return -1;
+ }
+ }
+ return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
+ }
+
+} //EDataObjectSimpleAnyTypeImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/StoreDataObjectImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/StoreDataObjectImpl.java
new file mode 100644
index 0000000000..0cf7f3586c
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/StoreDataObjectImpl.java
@@ -0,0 +1,314 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.impl;
+
+import org.apache.tuscany.sdo.SDOPackage;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.InternalEObject;
+import org.eclipse.emf.ecore.impl.EStoreEObjectImpl.EStoreEList;
+import org.eclipse.emf.ecore.impl.EStoreEObjectImpl.EStoreFeatureMap;
+import org.eclipse.emf.ecore.util.FeatureMap;
+import org.eclipse.emf.ecore.util.FeatureMapUtil;
+
+import commonj.sdo.DataObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Store Data Object</b></em>'.
+ * @extends EStructuralFeature.Internal.DynamicValueHolder
+ * <!-- end-user-doc -->
+ * <p>
+ * </p>
+ *
+ * @generated
+ */
+public class StoreDataObjectImpl extends DataObjectImpl implements DataObject, EStructuralFeature.Internal.DynamicValueHolder
+{
+ //TODO consider factoring the eSettings code into a new base class that this and DynamicDataObjectImpl could extend
+
+ protected static final Object [] ENO_SETTINGS = new Object [0];
+ protected static final InternalEObject EUNINITIALIZED_CONTAINER = new DynamicDataObjectImpl();
+
+ protected Object [] eSettings;
+ protected InternalEObject.EStore eStore;
+
+ /**
+ * Creates a store-based DataObject.
+ */
+ public StoreDataObjectImpl()
+ {
+ super();
+ eContainer = EUNINITIALIZED_CONTAINER;
+ }
+
+ /**
+ * Creates a store-based DataObject.
+ */
+ public StoreDataObjectImpl(InternalEObject.EStore eStore)
+ {
+ super();
+ eSetStore(eStore);
+ eContainer = EUNINITIALIZED_CONTAINER;
+ }
+
+ /**
+ * Creates a store-based DataObject.
+ */
+ public StoreDataObjectImpl(EClass eClass)
+ {
+ super();
+ eSetClass(eClass);
+ eContainer = EUNINITIALIZED_CONTAINER;
+ }
+
+ /**
+ * Creates a store-based DataObject.
+ */
+ public StoreDataObjectImpl(EClass eClass, InternalEObject.EStore eStore)
+ {
+ super();
+ eSetClass(eClass);
+ eSetStore(eStore);
+ eContainer = EUNINITIALIZED_CONTAINER;
+ }
+
+ protected boolean eIsCaching()
+ {
+ return true;
+ }
+
+ public Object dynamicGet(int dynamicFeatureID)
+ {
+ Object result = eSettings[dynamicFeatureID];
+ if (result == null)
+ {
+ EStructuralFeature eStructuralFeature = eDynamicFeature(dynamicFeatureID);
+ if (!eStructuralFeature.isTransient())
+ {
+ if (FeatureMapUtil.isFeatureMap(eStructuralFeature))
+ {
+ eSettings[dynamicFeatureID] = result = createFeatureMap(eStructuralFeature);
+ }
+ else if (eStructuralFeature.isMany())
+ {
+ eSettings[dynamicFeatureID] = result = createList(eStructuralFeature);
+ }
+ else
+ {
+ result = eStore().get(this, eStructuralFeature, InternalEObject.EStore.NO_INDEX);
+ if (eIsCaching())
+ {
+ eSettings[dynamicFeatureID] = result;
+ }
+ }
+ }
+ }
+ return result;
+ }
+
+ public void dynamicSet(int dynamicFeatureID, Object value)
+ {
+ EStructuralFeature eStructuralFeature = eDynamicFeature(dynamicFeatureID);
+ if (eStructuralFeature.isTransient())
+ {
+ eSettings[dynamicFeatureID] = value;
+ }
+ else
+ {
+ eStore().set(this, eStructuralFeature, InternalEObject.EStore.NO_INDEX, value == NIL ? null : value);
+ if (eIsCaching())
+ {
+ eSettings[dynamicFeatureID] = value;
+ }
+ }
+ }
+
+ public void dynamicUnset(int dynamicFeatureID)
+ {
+ eStore().unset(this, eDynamicFeature(dynamicFeatureID));
+ eSettings[dynamicFeatureID] = null;
+ }
+
+ public Object eDynamicGet(int featureID, boolean resolve, boolean coreType)
+ {
+ if (featureID < eClass().getFeatureCount())
+ {
+ EStructuralFeature eFeature = eClass().getEStructuralFeature(featureID);
+ return eSettingDelegate(eFeature).dynamicGet(this, eSettings(), featureID, resolve, coreType);
+ }
+ else
+ {
+ return super.eDynamicGet(featureID, resolve, coreType);
+ }
+ }
+
+ public void eDynamicSet(int featureID, Object newValue)
+ {
+ if (featureID < eClass().getFeatureCount())
+ {
+ EStructuralFeature eFeature = eClass().getEStructuralFeature(featureID);
+ eDynamicSet(featureID, eFeature, newValue);
+ }
+ else
+ {
+ super.eDynamicSet(featureID, newValue);
+ }
+ }
+
+ public void eDynamicUnset(int featureID)
+ {
+ if (featureID < eClass().getFeatureCount())
+ {
+ EStructuralFeature eFeature = eClass().getEStructuralFeature(featureID);
+ eDynamicUnset(featureID, eFeature);
+ }
+ else
+ {
+ super.eDynamicUnset(featureID);
+ }
+ }
+
+ public boolean eDynamicIsSet(int featureID)
+ {
+ if (featureID < eClass().getFeatureCount())
+ {
+ EStructuralFeature eFeature = eClass().getEStructuralFeature(featureID);
+ return eFeature.isTransient() ?
+ eSettingDelegate(eFeature).dynamicIsSet(this, eSettings(), featureID) :
+ eStore().isSet(this, eFeature);
+ }
+ else
+ {
+ return super.eDynamicIsSet(featureID);
+ }
+ }
+
+ /*
+ public boolean eDynamicIsSet(EStructuralFeature eStructuralFeature)
+ {
+ return
+ eStructuralFeature.isTransient() ?
+ super.eDynamicIsSet(eStructuralFeature) :
+ eStore().isSet(this, eStructuralFeature);
+ }
+ */
+
+ protected EList createList(EStructuralFeature eStructuralFeature)
+ {
+ return new EStoreEList(this, eStructuralFeature, eStore());
+ }
+
+ protected FeatureMap createFeatureMap(EStructuralFeature eStructuralFeature)
+ {
+ return new EStoreFeatureMap(this, eStructuralFeature, eStore());
+ }
+
+ public EObject eContainer()
+ {
+ if (eContainer == EUNINITIALIZED_CONTAINER)
+ {
+ eInitializeContainer();
+ }
+
+ return eContainer;
+ }
+
+ public int eContainerFeatureID()
+ {
+ if (eContainer == EUNINITIALIZED_CONTAINER)
+ {
+ eInitializeContainer();
+ }
+
+ return eContainerFeatureID;
+ }
+
+ protected void eInitializeContainer()
+ {
+ eContainer = eStore().getContainer(this);
+ if (eContainer != null)
+ {
+ EStructuralFeature eContainingFeature = eStore().getContainingFeature(this);
+ if (eContainingFeature instanceof EReference)
+ {
+ EReference eContainingReference = (EReference)eContainingFeature;
+ EReference eOpposite = eContainingReference.getEOpposite();
+ if (eOpposite != null)
+ {
+ eContainerFeatureID = eClass().getFeatureID(eOpposite);
+ return;
+ }
+ }
+
+ eContainerFeatureID = EOPPOSITE_FEATURE_BASE - eContainer.eClass().getFeatureID(eContainingFeature);
+ }
+ }
+
+ public InternalEObject.EStore eStore()
+ {
+ return eStore;
+ }
+
+ public void eSetStore(InternalEObject.EStore store)
+ {
+ this.eStore = store;
+ }
+
+ protected int eStaticFeatureCount()
+ {
+ return 0;
+ }
+
+ public int eDerivedStructuralFeatureID(EStructuralFeature eStructuralFeature)
+ {
+ return eClass().getFeatureID(eStructuralFeature);
+ }
+
+ protected boolean eHasSettings()
+ {
+ return eSettings != null;
+ }
+
+ protected EStructuralFeature.Internal.DynamicValueHolder eSettings()
+ {
+ if (eSettings == null)
+ {
+ int size = eClass().getFeatureCount() - eStaticFeatureCount();
+ eSettings = size == 0 ? ENO_SETTINGS : new Object [size];
+ }
+
+ return this;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EClass eStaticClass()
+ {
+ return SDOPackage.eINSTANCE.getStoreDataObject();
+ }
+
+} //StoreDataObjectImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/BaseDataGraphType.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/BaseDataGraphType.java
new file mode 100644
index 0000000000..e57b11474b
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/BaseDataGraphType.java
@@ -0,0 +1,213 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.model;
+
+import commonj.sdo.ChangeSummary;
+import commonj.sdo.Sequence;
+
+import java.io.Serializable;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Base Data Graph Type</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.apache.tuscany.sdo.model.BaseDataGraphType#getModels <em>Models</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.model.BaseDataGraphType#getXsd <em>Xsd</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.model.BaseDataGraphType#getChangeSummary <em>Change Summary</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.model.BaseDataGraphType#getAnyAttribute <em>Any Attribute</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @extends Serializable
+ * @generated
+ */
+public interface BaseDataGraphType extends Serializable
+{
+ /**
+ * Returns the value of the '<em><b>Models</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Models</em>' containment reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Models</em>' containment reference.
+ * @see #isSetModels()
+ * @see #unsetModels()
+ * @see #setModels(ModelsType)
+ * @generated
+ */
+ ModelsType getModels();
+
+ /**
+ * Sets the value of the '{@link org.apache.tuscany.sdo.model.BaseDataGraphType#getModels <em>Models</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Models</em>' containment reference.
+ * @see #isSetModels()
+ * @see #unsetModels()
+ * @see #getModels()
+ * @generated
+ */
+ void setModels(ModelsType value);
+
+ /**
+ * Unsets the value of the '{@link org.apache.tuscany.sdo.model.BaseDataGraphType#getModels <em>Models</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetModels()
+ * @see #getModels()
+ * @see #setModels(ModelsType)
+ * @generated
+ */
+ void unsetModels();
+
+ /**
+ * Returns whether the value of the '{@link org.apache.tuscany.sdo.model.BaseDataGraphType#getModels <em>Models</em>}' containment reference is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Models</em>' containment reference is set.
+ * @see #unsetModels()
+ * @see #getModels()
+ * @see #setModels(ModelsType)
+ * @generated
+ */
+ boolean isSetModels();
+
+ /**
+ * Returns the value of the '<em><b>Xsd</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Xsd</em>' containment reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Xsd</em>' containment reference.
+ * @see #isSetXsd()
+ * @see #unsetXsd()
+ * @see #setXsd(XSDType)
+ * @generated
+ */
+ XSDType getXsd();
+
+ /**
+ * Sets the value of the '{@link org.apache.tuscany.sdo.model.BaseDataGraphType#getXsd <em>Xsd</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Xsd</em>' containment reference.
+ * @see #isSetXsd()
+ * @see #unsetXsd()
+ * @see #getXsd()
+ * @generated
+ */
+ void setXsd(XSDType value);
+
+ /**
+ * Unsets the value of the '{@link org.apache.tuscany.sdo.model.BaseDataGraphType#getXsd <em>Xsd</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetXsd()
+ * @see #getXsd()
+ * @see #setXsd(XSDType)
+ * @generated
+ */
+ void unsetXsd();
+
+ /**
+ * Returns whether the value of the '{@link org.apache.tuscany.sdo.model.BaseDataGraphType#getXsd <em>Xsd</em>}' containment reference is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Xsd</em>' containment reference is set.
+ * @see #unsetXsd()
+ * @see #getXsd()
+ * @see #setXsd(XSDType)
+ * @generated
+ */
+ boolean isSetXsd();
+
+ /**
+ * Returns the value of the '<em><b>Change Summary</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Change Summary</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Change Summary</em>' attribute.
+ * @see #isSetChangeSummary()
+ * @see #unsetChangeSummary()
+ * @see #setChangeSummary(ChangeSummary)
+ * @generated
+ */
+ ChangeSummary getChangeSummary();
+
+ /**
+ * Sets the value of the '{@link org.apache.tuscany.sdo.model.BaseDataGraphType#getChangeSummary <em>Change Summary</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Change Summary</em>' attribute.
+ * @see #isSetChangeSummary()
+ * @see #unsetChangeSummary()
+ * @see #getChangeSummary()
+ * @generated
+ */
+ void setChangeSummary(ChangeSummary value);
+
+ /**
+ * Unsets the value of the '{@link org.apache.tuscany.sdo.model.BaseDataGraphType#getChangeSummary <em>Change Summary</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetChangeSummary()
+ * @see #getChangeSummary()
+ * @see #setChangeSummary(ChangeSummary)
+ * @generated
+ */
+ void unsetChangeSummary();
+
+ /**
+ * Returns whether the value of the '{@link org.apache.tuscany.sdo.model.BaseDataGraphType#getChangeSummary <em>Change Summary</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Change Summary</em>' attribute is set.
+ * @see #unsetChangeSummary()
+ * @see #getChangeSummary()
+ * @see #setChangeSummary(ChangeSummary)
+ * @generated
+ */
+ boolean isSetChangeSummary();
+
+ /**
+ * Returns the value of the '<em><b>Any Attribute</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Any Attribute</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Any Attribute</em>' attribute list.
+ * @generated
+ */
+ Sequence getAnyAttribute();
+
+} // BaseDataGraphType
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/DataGraphType.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/DataGraphType.java
new file mode 100644
index 0000000000..2c83244789
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/DataGraphType.java
@@ -0,0 +1,53 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.model;
+
+import commonj.sdo.Sequence;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Data Graph Type</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.apache.tuscany.sdo.model.DataGraphType#getAny <em>Any</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public interface DataGraphType extends BaseDataGraphType
+{
+ /**
+ * Returns the value of the '<em><b>Any</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Any</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Any</em>' attribute list.
+ * @generated
+ */
+ Sequence getAny();
+
+} // DataGraphType
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/DataObject.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/DataObject.java
new file mode 100644
index 0000000000..9e3b2a1386
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/DataObject.java
@@ -0,0 +1,35 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.model;
+
+import java.io.Serializable;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Data Object</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ *
+ * @extends Serializable
+ * @generated
+ */
+public interface DataObject extends Serializable
+{
+} // DataObject
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/ModelFactory.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/ModelFactory.java
new file mode 100644
index 0000000000..c8fe69167e
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/ModelFactory.java
@@ -0,0 +1,106 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.model;
+
+import commonj.sdo.helper.HelperContext;
+
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Factory</b> for the model.
+ * It provides a create method for each non-abstract class of the model.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public interface ModelFactory
+{
+
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ ModelFactory INSTANCE = org.apache.tuscany.sdo.model.impl.ModelFactoryImpl.init();
+
+ /**
+ * Returns a new object of class '<em>Data Graph Type</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Data Graph Type</em>'.
+ * @generated
+ */
+ DataGraphType createDataGraphType();
+
+ /**
+ * Returns a new object of class '<em>Models Type</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Models Type</em>'.
+ * @generated
+ */
+ ModelsType createModelsType();
+
+ /**
+ * Returns a new object of class '<em>Property</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Property</em>'.
+ * @generated
+ */
+ Property createProperty();
+
+ /**
+ * Returns a new object of class '<em>Type</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Type</em>'.
+ * @generated
+ */
+ Type createType();
+
+ /**
+ * Returns a new object of class '<em>Types</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Types</em>'.
+ * @generated
+ */
+ Types createTypes();
+
+ /**
+ * Returns a new object of class '<em>XSD Type</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>XSD Type</em>'.
+ * @generated
+ */
+ XSDType createXSDType();
+
+ /**
+ * Registers the types supported by this Factory within the supplied scope.argument
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param scope an instance of HelperContext used to manage the scoping of types.
+ * @generated
+ */
+ public void register(HelperContext scope);
+
+} //ModelFactory
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/ModelsType.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/ModelsType.java
new file mode 100644
index 0000000000..4159ac9dc1
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/ModelsType.java
@@ -0,0 +1,62 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.model;
+
+import commonj.sdo.Sequence;
+
+import java.io.Serializable;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Models Type</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <!-- begin-model-doc -->
+ *
+ * Expected type is emof:Package.
+ *
+ * <!-- end-model-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.apache.tuscany.sdo.model.ModelsType#getAny <em>Any</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @extends Serializable
+ * @generated
+ */
+public interface ModelsType extends Serializable
+{
+ /**
+ * Returns the value of the '<em><b>Any</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Any</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Any</em>' attribute list.
+ * @generated
+ */
+ Sequence getAny();
+
+} // ModelsType
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/Property.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/Property.java
new file mode 100644
index 0000000000..15ee4c2f99
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/Property.java
@@ -0,0 +1,503 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.model;
+
+import commonj.sdo.Sequence;
+
+import java.io.Serializable;
+
+import java.util.List;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Property</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.apache.tuscany.sdo.model.Property#getAliasName <em>Alias Name</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.model.Property#getAny <em>Any</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.model.Property#getName <em>Name</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.model.Property#isMany <em>Many</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.model.Property#isContainment <em>Containment</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.model.Property#getDefault <em>Default</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.model.Property#isReadOnly <em>Read Only</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.model.Property#getType_ <em>Type</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.model.Property#getOpposite <em>Opposite</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.model.Property#isNullable <em>Nullable</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.model.Property#getAnyAttribute <em>Any Attribute</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @extends Serializable
+ * @generated
+ */
+public interface Property extends Serializable
+{
+ /**
+ * Returns the value of the '<em><b>Alias Name</b></em>' attribute list.
+ * The list contents are of type {@link java.lang.String}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Alias Name</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Alias Name</em>' attribute list.
+ * @generated
+ */
+ List getAliasName();
+
+ /**
+ * Returns the value of the '<em><b>Any</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Any</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Any</em>' attribute list.
+ * @generated
+ */
+ Sequence getAny();
+
+ /**
+ * Returns the value of the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Name</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Name</em>' attribute.
+ * @see #isSetName()
+ * @see #unsetName()
+ * @see #setName(String)
+ * @generated
+ */
+ String getName();
+
+ /**
+ * Sets the value of the '{@link org.apache.tuscany.sdo.model.Property#getName <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Name</em>' attribute.
+ * @see #isSetName()
+ * @see #unsetName()
+ * @see #getName()
+ * @generated
+ */
+ void setName(String value);
+
+ /**
+ * Unsets the value of the '{@link org.apache.tuscany.sdo.model.Property#getName <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetName()
+ * @see #getName()
+ * @see #setName(String)
+ * @generated
+ */
+ void unsetName();
+
+ /**
+ * Returns whether the value of the '{@link org.apache.tuscany.sdo.model.Property#getName <em>Name</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Name</em>' attribute is set.
+ * @see #unsetName()
+ * @see #getName()
+ * @see #setName(String)
+ * @generated
+ */
+ boolean isSetName();
+
+ /**
+ * Returns the value of the '<em><b>Many</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Many</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Many</em>' attribute.
+ * @see #isSetMany()
+ * @see #unsetMany()
+ * @see #setMany(boolean)
+ * @generated
+ */
+ boolean isMany();
+
+ /**
+ * Sets the value of the '{@link org.apache.tuscany.sdo.model.Property#isMany <em>Many</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Many</em>' attribute.
+ * @see #isSetMany()
+ * @see #unsetMany()
+ * @see #isMany()
+ * @generated
+ */
+ void setMany(boolean value);
+
+ /**
+ * Unsets the value of the '{@link org.apache.tuscany.sdo.model.Property#isMany <em>Many</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetMany()
+ * @see #isMany()
+ * @see #setMany(boolean)
+ * @generated
+ */
+ void unsetMany();
+
+ /**
+ * Returns whether the value of the '{@link org.apache.tuscany.sdo.model.Property#isMany <em>Many</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Many</em>' attribute is set.
+ * @see #unsetMany()
+ * @see #isMany()
+ * @see #setMany(boolean)
+ * @generated
+ */
+ boolean isSetMany();
+
+ /**
+ * Returns the value of the '<em><b>Containment</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Containment</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Containment</em>' attribute.
+ * @see #isSetContainment()
+ * @see #unsetContainment()
+ * @see #setContainment(boolean)
+ * @generated
+ */
+ boolean isContainment();
+
+ /**
+ * Sets the value of the '{@link org.apache.tuscany.sdo.model.Property#isContainment <em>Containment</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Containment</em>' attribute.
+ * @see #isSetContainment()
+ * @see #unsetContainment()
+ * @see #isContainment()
+ * @generated
+ */
+ void setContainment(boolean value);
+
+ /**
+ * Unsets the value of the '{@link org.apache.tuscany.sdo.model.Property#isContainment <em>Containment</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetContainment()
+ * @see #isContainment()
+ * @see #setContainment(boolean)
+ * @generated
+ */
+ void unsetContainment();
+
+ /**
+ * Returns whether the value of the '{@link org.apache.tuscany.sdo.model.Property#isContainment <em>Containment</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Containment</em>' attribute is set.
+ * @see #unsetContainment()
+ * @see #isContainment()
+ * @see #setContainment(boolean)
+ * @generated
+ */
+ boolean isSetContainment();
+
+ /**
+ * Returns the value of the '<em><b>Default</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Default</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Default</em>' attribute.
+ * @see #isSetDefault()
+ * @see #unsetDefault()
+ * @see #setDefault_(String)
+ * @generated
+ */
+ String getDefault_();
+
+ /**
+ * Sets the value of the '{@link org.apache.tuscany.sdo.model.Property#getDefault <em>Default</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Default</em>' attribute.
+ * @see #isSetDefault()
+ * @see #unsetDefault()
+ * @see #getDefault_()
+ * @generated
+ */
+ void setDefault_(String value);
+
+ /**
+ * Unsets the value of the '{@link org.apache.tuscany.sdo.model.Property#getDefault <em>Default</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetDefault()
+ * @see #getDefault_()
+ * @see #setDefault_(String)
+ * @generated
+ */
+ void unsetDefault();
+
+ /**
+ * Returns whether the value of the '{@link org.apache.tuscany.sdo.model.Property#getDefault <em>Default</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Default</em>' attribute is set.
+ * @see #unsetDefault()
+ * @see #getDefault_()
+ * @see #setDefault_(String)
+ * @generated
+ */
+ boolean isSetDefault();
+
+ /**
+ * Returns the value of the '<em><b>Read Only</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Read Only</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Read Only</em>' attribute.
+ * @see #isSetReadOnly()
+ * @see #unsetReadOnly()
+ * @see #setReadOnly(boolean)
+ * @generated
+ */
+ boolean isReadOnly();
+
+ /**
+ * Sets the value of the '{@link org.apache.tuscany.sdo.model.Property#isReadOnly <em>Read Only</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Read Only</em>' attribute.
+ * @see #isSetReadOnly()
+ * @see #unsetReadOnly()
+ * @see #isReadOnly()
+ * @generated
+ */
+ void setReadOnly(boolean value);
+
+ /**
+ * Unsets the value of the '{@link org.apache.tuscany.sdo.model.Property#isReadOnly <em>Read Only</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetReadOnly()
+ * @see #isReadOnly()
+ * @see #setReadOnly(boolean)
+ * @generated
+ */
+ void unsetReadOnly();
+
+ /**
+ * Returns whether the value of the '{@link org.apache.tuscany.sdo.model.Property#isReadOnly <em>Read Only</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Read Only</em>' attribute is set.
+ * @see #unsetReadOnly()
+ * @see #isReadOnly()
+ * @see #setReadOnly(boolean)
+ * @generated
+ */
+ boolean isSetReadOnly();
+
+ /**
+ * Returns the value of the '<em><b>Type</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Type</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Type</em>' reference.
+ * @see #isSetType()
+ * @see #unsetType()
+ * @see #setType(Type)
+ * @generated
+ */
+ Type getType_();
+
+ /**
+ * Sets the value of the '{@link org.apache.tuscany.sdo.model.Property#getType_ <em>Type</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Type</em>' reference.
+ * @see #isSetType()
+ * @see #unsetType()
+ * @see #getType_()
+ * @generated
+ */
+ void setType(Type value);
+
+ /**
+ * Unsets the value of the '{@link org.apache.tuscany.sdo.model.Property#getType_ <em>Type</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetType()
+ * @see #getType_()
+ * @see #setType(Type)
+ * @generated
+ */
+ void unsetType();
+
+ /**
+ * Returns whether the value of the '{@link org.apache.tuscany.sdo.model.Property#getType_ <em>Type</em>}' reference is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Type</em>' reference is set.
+ * @see #unsetType()
+ * @see #getType_()
+ * @see #setType(Type)
+ * @generated
+ */
+ boolean isSetType();
+
+ /**
+ * Returns the value of the '<em><b>Opposite</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Opposite</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Opposite</em>' reference.
+ * @see #isSetOpposite()
+ * @see #unsetOpposite()
+ * @see #setOpposite_(Property)
+ * @generated
+ */
+ Property getOpposite_();
+
+ /**
+ * Sets the value of the '{@link org.apache.tuscany.sdo.model.Property#getOpposite <em>Opposite</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Opposite</em>' reference.
+ * @see #isSetOpposite()
+ * @see #unsetOpposite()
+ * @see #getOpposite_()
+ * @generated
+ */
+ void setOpposite_(Property value);
+
+ /**
+ * Unsets the value of the '{@link org.apache.tuscany.sdo.model.Property#getOpposite <em>Opposite</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetOpposite()
+ * @see #getOpposite_()
+ * @see #setOpposite_(Property)
+ * @generated
+ */
+ void unsetOpposite();
+
+ /**
+ * Returns whether the value of the '{@link org.apache.tuscany.sdo.model.Property#getOpposite <em>Opposite</em>}' reference is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Opposite</em>' reference is set.
+ * @see #unsetOpposite()
+ * @see #getOpposite_()
+ * @see #setOpposite_(Property)
+ * @generated
+ */
+ boolean isSetOpposite();
+
+ /**
+ * Returns the value of the '<em><b>Nullable</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Nullable</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Nullable</em>' attribute.
+ * @see #isSetNullable()
+ * @see #unsetNullable()
+ * @see #setNullable(boolean)
+ * @generated
+ */
+ boolean isNullable();
+
+ /**
+ * Sets the value of the '{@link org.apache.tuscany.sdo.model.Property#isNullable <em>Nullable</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Nullable</em>' attribute.
+ * @see #isSetNullable()
+ * @see #unsetNullable()
+ * @see #isNullable()
+ * @generated
+ */
+ void setNullable(boolean value);
+
+ /**
+ * Unsets the value of the '{@link org.apache.tuscany.sdo.model.Property#isNullable <em>Nullable</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetNullable()
+ * @see #isNullable()
+ * @see #setNullable(boolean)
+ * @generated
+ */
+ void unsetNullable();
+
+ /**
+ * Returns whether the value of the '{@link org.apache.tuscany.sdo.model.Property#isNullable <em>Nullable</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Nullable</em>' attribute is set.
+ * @see #unsetNullable()
+ * @see #isNullable()
+ * @see #setNullable(boolean)
+ * @generated
+ */
+ boolean isSetNullable();
+
+ /**
+ * Returns the value of the '<em><b>Any Attribute</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Any Attribute</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Any Attribute</em>' attribute list.
+ * @generated
+ */
+ Sequence getAnyAttribute();
+
+} // Property
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/TextType.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/TextType.java
new file mode 100644
index 0000000000..741343e5a8
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/TextType.java
@@ -0,0 +1,57 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.model;
+
+import java.io.Serializable;
+
+import java.util.List;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Text Type</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.apache.tuscany.sdo.model.TextType#getText <em>Text</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @extends Serializable
+ * @generated
+ */
+public interface TextType extends Serializable
+{
+ /**
+ * Returns the value of the '<em><b>Text</b></em>' attribute list.
+ * The list contents are of type {@link java.lang.String}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Text</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Text</em>' attribute list.
+ * @generated
+ */
+ List getText();
+
+} // TextType
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/Type.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/Type.java
new file mode 100644
index 0000000000..26a02f7cc0
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/Type.java
@@ -0,0 +1,431 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.model;
+
+import commonj.sdo.Sequence;
+
+import java.io.Serializable;
+
+import java.util.List;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Type</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.apache.tuscany.sdo.model.Type#getBaseType <em>Base Type</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.model.Type#getProperty <em>Property</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.model.Type#getAliasName <em>Alias Name</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.model.Type#getAny <em>Any</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.model.Type#getName <em>Name</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.model.Type#getUri <em>Uri</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.model.Type#isDataType <em>Data Type</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.model.Type#isOpen <em>Open</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.model.Type#isSequenced <em>Sequenced</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.model.Type#isAbstract <em>Abstract</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.model.Type#getAnyAttribute <em>Any Attribute</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @extends Serializable
+ * @generated
+ */
+public interface Type extends Serializable
+{
+ /**
+ * Returns the value of the '<em><b>Base Type</b></em>' reference list.
+ * The list contents are of type {@link org.apache.tuscany.sdo.model.Type}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Base Type</em>' reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Base Type</em>' reference list.
+ * @generated
+ */
+ List getBaseType();
+
+ /**
+ * Returns the value of the '<em><b>Property</b></em>' containment reference list.
+ * The list contents are of type {@link org.apache.tuscany.sdo.model.Property}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Property</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Property</em>' containment reference list.
+ * @generated
+ */
+ List getProperty();
+
+ /**
+ * Returns the value of the '<em><b>Alias Name</b></em>' attribute list.
+ * The list contents are of type {@link java.lang.String}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Alias Name</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Alias Name</em>' attribute list.
+ * @generated
+ */
+ List getAliasName();
+
+ /**
+ * Returns the value of the '<em><b>Any</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Any</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Any</em>' attribute list.
+ * @generated
+ */
+ Sequence getAny();
+
+ /**
+ * Returns the value of the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Name</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Name</em>' attribute.
+ * @see #isSetName()
+ * @see #unsetName()
+ * @see #setName(String)
+ * @generated
+ */
+ String getName();
+
+ /**
+ * Sets the value of the '{@link org.apache.tuscany.sdo.model.Type#getName <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Name</em>' attribute.
+ * @see #isSetName()
+ * @see #unsetName()
+ * @see #getName()
+ * @generated
+ */
+ void setName(String value);
+
+ /**
+ * Unsets the value of the '{@link org.apache.tuscany.sdo.model.Type#getName <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetName()
+ * @see #getName()
+ * @see #setName(String)
+ * @generated
+ */
+ void unsetName();
+
+ /**
+ * Returns whether the value of the '{@link org.apache.tuscany.sdo.model.Type#getName <em>Name</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Name</em>' attribute is set.
+ * @see #unsetName()
+ * @see #getName()
+ * @see #setName(String)
+ * @generated
+ */
+ boolean isSetName();
+
+ /**
+ * Returns the value of the '<em><b>Uri</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Uri</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Uri</em>' attribute.
+ * @see #isSetUri()
+ * @see #unsetUri()
+ * @see #setUri(String)
+ * @generated
+ */
+ String getUri();
+
+ /**
+ * Sets the value of the '{@link org.apache.tuscany.sdo.model.Type#getUri <em>Uri</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Uri</em>' attribute.
+ * @see #isSetUri()
+ * @see #unsetUri()
+ * @see #getUri()
+ * @generated
+ */
+ void setUri(String value);
+
+ /**
+ * Unsets the value of the '{@link org.apache.tuscany.sdo.model.Type#getUri <em>Uri</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetUri()
+ * @see #getUri()
+ * @see #setUri(String)
+ * @generated
+ */
+ void unsetUri();
+
+ /**
+ * Returns whether the value of the '{@link org.apache.tuscany.sdo.model.Type#getUri <em>Uri</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Uri</em>' attribute is set.
+ * @see #unsetUri()
+ * @see #getUri()
+ * @see #setUri(String)
+ * @generated
+ */
+ boolean isSetUri();
+
+ /**
+ * Returns the value of the '<em><b>Data Type</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Data Type</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Data Type</em>' attribute.
+ * @see #isSetDataType()
+ * @see #unsetDataType()
+ * @see #setDataType(boolean)
+ * @generated
+ */
+ boolean isDataType();
+
+ /**
+ * Sets the value of the '{@link org.apache.tuscany.sdo.model.Type#isDataType <em>Data Type</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Data Type</em>' attribute.
+ * @see #isSetDataType()
+ * @see #unsetDataType()
+ * @see #isDataType()
+ * @generated
+ */
+ void setDataType(boolean value);
+
+ /**
+ * Unsets the value of the '{@link org.apache.tuscany.sdo.model.Type#isDataType <em>Data Type</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetDataType()
+ * @see #isDataType()
+ * @see #setDataType(boolean)
+ * @generated
+ */
+ void unsetDataType();
+
+ /**
+ * Returns whether the value of the '{@link org.apache.tuscany.sdo.model.Type#isDataType <em>Data Type</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Data Type</em>' attribute is set.
+ * @see #unsetDataType()
+ * @see #isDataType()
+ * @see #setDataType(boolean)
+ * @generated
+ */
+ boolean isSetDataType();
+
+ /**
+ * Returns the value of the '<em><b>Open</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Open</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Open</em>' attribute.
+ * @see #isSetOpen()
+ * @see #unsetOpen()
+ * @see #setOpen(boolean)
+ * @generated
+ */
+ boolean isOpen();
+
+ /**
+ * Sets the value of the '{@link org.apache.tuscany.sdo.model.Type#isOpen <em>Open</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Open</em>' attribute.
+ * @see #isSetOpen()
+ * @see #unsetOpen()
+ * @see #isOpen()
+ * @generated
+ */
+ void setOpen(boolean value);
+
+ /**
+ * Unsets the value of the '{@link org.apache.tuscany.sdo.model.Type#isOpen <em>Open</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetOpen()
+ * @see #isOpen()
+ * @see #setOpen(boolean)
+ * @generated
+ */
+ void unsetOpen();
+
+ /**
+ * Returns whether the value of the '{@link org.apache.tuscany.sdo.model.Type#isOpen <em>Open</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Open</em>' attribute is set.
+ * @see #unsetOpen()
+ * @see #isOpen()
+ * @see #setOpen(boolean)
+ * @generated
+ */
+ boolean isSetOpen();
+
+ /**
+ * Returns the value of the '<em><b>Sequenced</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Sequenced</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Sequenced</em>' attribute.
+ * @see #isSetSequenced()
+ * @see #unsetSequenced()
+ * @see #setSequenced(boolean)
+ * @generated
+ */
+ boolean isSequenced();
+
+ /**
+ * Sets the value of the '{@link org.apache.tuscany.sdo.model.Type#isSequenced <em>Sequenced</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Sequenced</em>' attribute.
+ * @see #isSetSequenced()
+ * @see #unsetSequenced()
+ * @see #isSequenced()
+ * @generated
+ */
+ void setSequenced(boolean value);
+
+ /**
+ * Unsets the value of the '{@link org.apache.tuscany.sdo.model.Type#isSequenced <em>Sequenced</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetSequenced()
+ * @see #isSequenced()
+ * @see #setSequenced(boolean)
+ * @generated
+ */
+ void unsetSequenced();
+
+ /**
+ * Returns whether the value of the '{@link org.apache.tuscany.sdo.model.Type#isSequenced <em>Sequenced</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Sequenced</em>' attribute is set.
+ * @see #unsetSequenced()
+ * @see #isSequenced()
+ * @see #setSequenced(boolean)
+ * @generated
+ */
+ boolean isSetSequenced();
+
+ /**
+ * Returns the value of the '<em><b>Abstract</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Abstract</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Abstract</em>' attribute.
+ * @see #isSetAbstract()
+ * @see #unsetAbstract()
+ * @see #setAbstract(boolean)
+ * @generated
+ */
+ boolean isAbstract();
+
+ /**
+ * Sets the value of the '{@link org.apache.tuscany.sdo.model.Type#isAbstract <em>Abstract</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Abstract</em>' attribute.
+ * @see #isSetAbstract()
+ * @see #unsetAbstract()
+ * @see #isAbstract()
+ * @generated
+ */
+ void setAbstract(boolean value);
+
+ /**
+ * Unsets the value of the '{@link org.apache.tuscany.sdo.model.Type#isAbstract <em>Abstract</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetAbstract()
+ * @see #isAbstract()
+ * @see #setAbstract(boolean)
+ * @generated
+ */
+ void unsetAbstract();
+
+ /**
+ * Returns whether the value of the '{@link org.apache.tuscany.sdo.model.Type#isAbstract <em>Abstract</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Abstract</em>' attribute is set.
+ * @see #unsetAbstract()
+ * @see #isAbstract()
+ * @see #setAbstract(boolean)
+ * @generated
+ */
+ boolean isSetAbstract();
+
+ /**
+ * Returns the value of the '<em><b>Any Attribute</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Any Attribute</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Any Attribute</em>' attribute list.
+ * @generated
+ */
+ Sequence getAnyAttribute();
+
+ String getInstanceClassName();
+
+} // Type
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/Types.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/Types.java
new file mode 100644
index 0000000000..26fb9c57ce
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/Types.java
@@ -0,0 +1,59 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.model;
+
+import java.io.Serializable;
+
+import java.util.List;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Types</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.apache.tuscany.sdo.model.Types#getType_ <em>Type</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @extends Serializable
+ * @generated
+ */
+public interface Types extends Serializable
+{
+ /**
+ * Returns the value of the '<em><b>Type</b></em>' containment reference list.
+ * The list contents are of type {@link org.apache.tuscany.sdo.model.Type}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Type</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Type</em>' containment reference list.
+ * @generated
+ */
+ List getType_();
+
+ List getTypeList();
+
+} // Types
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/XSDType.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/XSDType.java
new file mode 100644
index 0000000000..32cde02086
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/XSDType.java
@@ -0,0 +1,62 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.model;
+
+import commonj.sdo.Sequence;
+
+import java.io.Serializable;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>XSD Type</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <!-- begin-model-doc -->
+ *
+ * Expected type is xsd:schema.
+ *
+ * <!-- end-model-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.apache.tuscany.sdo.model.XSDType#getAny <em>Any</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @extends Serializable
+ * @generated
+ */
+public interface XSDType extends Serializable
+{
+ /**
+ * Returns the value of the '<em><b>Any</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Any</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Any</em>' attribute list.
+ * @generated
+ */
+ Sequence getAny();
+
+} // XSDType
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/BaseDataGraphTypeImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/BaseDataGraphTypeImpl.java
new file mode 100644
index 0000000000..4cc93f09df
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/BaseDataGraphTypeImpl.java
@@ -0,0 +1,625 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.model.impl;
+
+import commonj.sdo.ChangeSummary;
+import commonj.sdo.Sequence;
+import commonj.sdo.Type;
+
+import org.apache.tuscany.sdo.impl.DataObjectBase;
+
+import org.apache.tuscany.sdo.model.BaseDataGraphType;
+import org.apache.tuscany.sdo.model.ModelFactory;
+import org.apache.tuscany.sdo.model.ModelsType;
+import org.apache.tuscany.sdo.model.XSDType;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Base Data Graph Type</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.apache.tuscany.sdo.model.impl.BaseDataGraphTypeImpl#getModels <em>Models</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.model.impl.BaseDataGraphTypeImpl#getXsd <em>Xsd</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.model.impl.BaseDataGraphTypeImpl#getChangeSummary <em>Change Summary</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.model.impl.BaseDataGraphTypeImpl#getAnyAttribute <em>Any Attribute</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public abstract class BaseDataGraphTypeImpl extends DataObjectBase implements BaseDataGraphType
+{
+
+ public final static int MODELS = 0;
+
+ public final static int XSD = 1;
+
+ public final static int CHANGE_SUMMARY = 2;
+
+ public final static int ANY_ATTRIBUTE = -1;
+
+ public final static int SDO_PROPERTY_COUNT = 3;
+
+ public final static int EXTENDED_PROPERTY_COUNT = -1;
+
+
+ /**
+ * The internal feature id for the '<em><b>Models</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_MODELS = 0;
+
+ /**
+ * The internal feature id for the '<em><b>Xsd</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_XSD = 1;
+
+ /**
+ * The internal feature id for the '<em><b>Change Summary</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_CHANGE_SUMMARY = 2;
+
+ /**
+ * The internal feature id for the '<em><b>Any Attribute</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_ANY_ATTRIBUTE = 3;
+
+ /**
+ * The number of properties for this type.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_PROPERTY_COUNT = 4;
+
+ protected int internalConvertIndex(int internalIndex)
+ {
+ switch (internalIndex)
+ {
+ case INTERNAL_MODELS: return MODELS;
+ case INTERNAL_XSD: return XSD;
+ case INTERNAL_CHANGE_SUMMARY: return CHANGE_SUMMARY;
+ case INTERNAL_ANY_ATTRIBUTE: return ANY_ATTRIBUTE;
+ }
+ return super.internalConvertIndex(internalIndex);
+ }
+
+
+ /**
+ * The cached value of the '{@link #getModels() <em>Models</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getModels()
+ * @generated
+ * @ordered
+ */
+
+ protected ModelsType models = null;
+
+ /**
+ * This is true if the Models containment reference has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean models_set_ = false;
+
+ /**
+ * The cached value of the '{@link #getXsd() <em>Xsd</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getXsd()
+ * @generated
+ * @ordered
+ */
+
+ protected XSDType xsd = null;
+
+ /**
+ * This is true if the Xsd containment reference has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean xsd_set_ = false;
+
+ /**
+ * The default value of the '{@link #getChangeSummary() <em>Change Summary</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getChangeSummary()
+ * @generated
+ * @ordered
+ */
+ protected static final ChangeSummary CHANGE_SUMMARY_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getChangeSummary() <em>Change Summary</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getChangeSummary()
+ * @generated
+ * @ordered
+ */
+ protected ChangeSummary changeSummary = CHANGE_SUMMARY_DEFAULT_;
+
+ /**
+ * This is true if the Change Summary attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean changeSummary_set_ = false;
+
+ /**
+ * The cached value of the '{@link #getAnyAttribute() <em>Any Attribute</em>}' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getAnyAttribute()
+ * @generated
+ * @ordered
+ */
+
+ protected Sequence anyAttribute = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public BaseDataGraphTypeImpl()
+ {
+ super();
+ createChangeSummary(CHANGE_SUMMARY);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Type getType()
+ {
+ return ((ModelFactoryImpl)ModelFactory.INSTANCE).getBaseDataGraphType();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ModelsType getModels()
+ {
+ return models;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeContext basicSetModels(ModelsType newModels, ChangeContext changeContext)
+ {
+ ModelsType oldModels = models;
+ models = newModels;
+ boolean oldModels_set_ = models_set_;
+ models_set_ = true;
+ if (isNotifying())
+ {
+ addNotification(this, ChangeKind.SET, MODELS, oldModels, newModels, !oldModels_set_, changeContext);
+ }
+ return changeContext;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setModels(ModelsType newModels)
+ {
+ if (newModels != models)
+ {
+ ChangeContext changeContext = null;
+ if (models != null)
+ changeContext = inverseRemove(models, this, OPPOSITE_FEATURE_BASE - MODELS, null, changeContext);
+ if (newModels != null)
+ changeContext = inverseAdd(newModels, this, OPPOSITE_FEATURE_BASE - MODELS, null, changeContext);
+ changeContext = basicSetModels(newModels, changeContext);
+ if (changeContext != null) dispatch(changeContext);
+ }
+ else
+ {
+ boolean oldModels_set_ = models_set_;
+ models_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, MODELS, newModels, newModels, !oldModels_set_);
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeContext basicUnsetModels(ChangeContext changeContext)
+ {
+ ModelsType oldModels = models;
+ models = null;
+ boolean oldModels_set_ = models_set_;
+ models_set_ = false;
+ if (isNotifying())
+ {
+ addNotification(this, ChangeKind.UNSET, MODELS, oldModels, null, !oldModels_set_, changeContext);
+ }
+ return changeContext;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetModels()
+ {
+ if (models != null)
+ {
+ ChangeContext changeContext = null;
+ changeContext = inverseRemove(models, this, EOPPOSITE_FEATURE_BASE - MODELS, null, changeContext);
+ changeContext = basicUnsetModels(changeContext);
+ if (changeContext != null) dispatch(changeContext);
+ }
+ else
+ {
+ boolean oldModels_set_ = models_set_;
+ models_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, MODELS, null, null, oldModels_set_);
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetModels()
+ {
+ return models_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public XSDType getXsd()
+ {
+ return xsd;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeContext basicSetXsd(XSDType newXsd, ChangeContext changeContext)
+ {
+ XSDType oldXsd = xsd;
+ xsd = newXsd;
+ boolean oldXsd_set_ = xsd_set_;
+ xsd_set_ = true;
+ if (isNotifying())
+ {
+ addNotification(this, ChangeKind.SET, XSD, oldXsd, newXsd, !oldXsd_set_, changeContext);
+ }
+ return changeContext;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setXsd(XSDType newXsd)
+ {
+ if (newXsd != xsd)
+ {
+ ChangeContext changeContext = null;
+ if (xsd != null)
+ changeContext = inverseRemove(xsd, this, OPPOSITE_FEATURE_BASE - XSD, null, changeContext);
+ if (newXsd != null)
+ changeContext = inverseAdd(newXsd, this, OPPOSITE_FEATURE_BASE - XSD, null, changeContext);
+ changeContext = basicSetXsd(newXsd, changeContext);
+ if (changeContext != null) dispatch(changeContext);
+ }
+ else
+ {
+ boolean oldXsd_set_ = xsd_set_;
+ xsd_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, XSD, newXsd, newXsd, !oldXsd_set_);
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeContext basicUnsetXsd(ChangeContext changeContext)
+ {
+ XSDType oldXsd = xsd;
+ xsd = null;
+ boolean oldXsd_set_ = xsd_set_;
+ xsd_set_ = false;
+ if (isNotifying())
+ {
+ addNotification(this, ChangeKind.UNSET, XSD, oldXsd, null, !oldXsd_set_, changeContext);
+ }
+ return changeContext;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetXsd()
+ {
+ if (xsd != null)
+ {
+ ChangeContext changeContext = null;
+ changeContext = inverseRemove(xsd, this, EOPPOSITE_FEATURE_BASE - XSD, null, changeContext);
+ changeContext = basicUnsetXsd(changeContext);
+ if (changeContext != null) dispatch(changeContext);
+ }
+ else
+ {
+ boolean oldXsd_set_ = xsd_set_;
+ xsd_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, XSD, null, null, oldXsd_set_);
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetXsd()
+ {
+ return xsd_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeSummary getChangeSummary()
+ {
+ return changeSummary;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setChangeSummary(ChangeSummary newChangeSummary)
+ {
+ ChangeSummary oldChangeSummary = changeSummary;
+ changeSummary = newChangeSummary;
+ boolean oldChangeSummary_set_ = changeSummary_set_;
+ changeSummary_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, CHANGE_SUMMARY, oldChangeSummary, changeSummary, !oldChangeSummary_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetChangeSummary()
+ {
+ ChangeSummary oldChangeSummary = changeSummary;
+ boolean oldChangeSummary_set_ = changeSummary_set_;
+ changeSummary = CHANGE_SUMMARY_DEFAULT_;
+ changeSummary_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, CHANGE_SUMMARY, oldChangeSummary, CHANGE_SUMMARY_DEFAULT_, oldChangeSummary_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetChangeSummary()
+ {
+ return changeSummary_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Sequence getAnyAttribute()
+ {
+ if (anyAttribute == null)
+ {
+ anyAttribute = createSequence(INTERNAL_ANY_ATTRIBUTE);
+ }
+ return anyAttribute;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeContext inverseRemove(Object otherEnd, int propertyIndex, ChangeContext changeContext)
+ {
+ switch (propertyIndex)
+ {
+ case MODELS:
+ return basicUnsetModels(changeContext);
+ case XSD:
+ return basicUnsetXsd(changeContext);
+ case ANY_ATTRIBUTE:
+ return removeFromSequence(getAnyAttribute(), otherEnd, changeContext);
+ }
+ return super.inverseRemove(otherEnd, propertyIndex, changeContext);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object get(int propertyIndex, boolean resolve)
+ {
+ switch (propertyIndex)
+ {
+ case MODELS:
+ return getModels();
+ case XSD:
+ return getXsd();
+ case CHANGE_SUMMARY:
+ return getChangeSummary();
+ case ANY_ATTRIBUTE:
+ // XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view
+ //if (coreType)
+ return getAnyAttribute();
+ }
+ return super.get(propertyIndex, resolve);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void set(int propertyIndex, Object newValue)
+ {
+ switch (propertyIndex)
+ {
+ case MODELS:
+ setModels((ModelsType)newValue);
+ return;
+ case XSD:
+ setXsd((XSDType)newValue);
+ return;
+ case CHANGE_SUMMARY:
+ setChangeSummary((ChangeSummary)newValue);
+ return;
+ case ANY_ATTRIBUTE:
+ setSequence(getAnyAttribute(), newValue);
+ return;
+ }
+ super.set(propertyIndex, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unset(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case MODELS:
+ unsetModels();
+ return;
+ case XSD:
+ unsetXsd();
+ return;
+ case CHANGE_SUMMARY:
+ unsetChangeSummary();
+ return;
+ case ANY_ATTRIBUTE:
+ unsetSequence(getAnyAttribute());
+ return;
+ }
+ super.unset(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSet(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case MODELS:
+ return isSetModels();
+ case XSD:
+ return isSetXsd();
+ case CHANGE_SUMMARY:
+ return isSetChangeSummary();
+ case ANY_ATTRIBUTE:
+ return anyAttribute != null && !isSequenceEmpty(getAnyAttribute());
+ }
+ return super.isSet(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString()
+ {
+ if (isProxy(this)) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (changeSummary: ");
+ if (changeSummary_set_) result.append(changeSummary); else result.append("<unset>");
+ result.append(", anyAttribute: ");
+ result.append(anyAttribute);
+ result.append(')');
+ return result.toString();
+ }
+
+} //BaseDataGraphTypeImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/DataGraphTypeImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/DataGraphTypeImpl.java
new file mode 100644
index 0000000000..0d06288bce
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/DataGraphTypeImpl.java
@@ -0,0 +1,258 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.model.impl;
+
+import commonj.sdo.Sequence;
+import commonj.sdo.Type;
+
+import org.apache.tuscany.sdo.model.DataGraphType;
+import org.apache.tuscany.sdo.model.ModelFactory;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Data Graph Type</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.apache.tuscany.sdo.model.impl.DataGraphTypeImpl#getAny <em>Any</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class DataGraphTypeImpl extends BaseDataGraphTypeImpl implements DataGraphType
+{
+
+ public final static int ANY = BaseDataGraphTypeImpl.EXTENDED_PROPERTY_COUNT + -1;
+
+ public final static int SDO_PROPERTY_COUNT = BaseDataGraphTypeImpl.SDO_PROPERTY_COUNT + 0;
+
+ public final static int EXTENDED_PROPERTY_COUNT = BaseDataGraphTypeImpl.EXTENDED_PROPERTY_COUNT - 1;
+
+
+ /**
+ * The internal feature id for the '<em><b>Models</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_MODELS = BaseDataGraphTypeImpl.MODELS;
+
+ /**
+ * The internal feature id for the '<em><b>Xsd</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_XSD = BaseDataGraphTypeImpl.XSD;
+
+ /**
+ * The internal feature id for the '<em><b>Change Summary</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_CHANGE_SUMMARY = BaseDataGraphTypeImpl.CHANGE_SUMMARY;
+
+ /**
+ * The internal feature id for the '<em><b>Any Attribute</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_ANY_ATTRIBUTE = BaseDataGraphTypeImpl.ANY_ATTRIBUTE;
+
+ /**
+ * The internal feature id for the '<em><b>Any</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_ANY = BaseDataGraphTypeImpl.INTERNAL_PROPERTY_COUNT + 0;
+
+ /**
+ * The number of properties for this type.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_PROPERTY_COUNT = BaseDataGraphTypeImpl.INTERNAL_PROPERTY_COUNT + 1;
+
+ protected int internalConvertIndex(int internalIndex)
+ {
+ switch (internalIndex)
+ {
+ case INTERNAL_MODELS: return MODELS;
+ case INTERNAL_XSD: return XSD;
+ case INTERNAL_CHANGE_SUMMARY: return CHANGE_SUMMARY;
+ case INTERNAL_ANY_ATTRIBUTE: return ANY_ATTRIBUTE;
+ case INTERNAL_ANY: return ANY;
+ }
+ return super.internalConvertIndex(internalIndex);
+ }
+
+
+ /**
+ * The cached value of the '{@link #getAny() <em>Any</em>}' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getAny()
+ * @generated
+ * @ordered
+ */
+
+ protected Sequence any = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public DataGraphTypeImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Type getType()
+ {
+ return ((ModelFactoryImpl)ModelFactory.INSTANCE).getDataGraphType();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Sequence getAny()
+ {
+ if (any == null)
+ {
+ any = createSequence(INTERNAL_ANY);
+ }
+ return any;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeContext inverseRemove(Object otherEnd, int propertyIndex, ChangeContext changeContext)
+ {
+ switch (propertyIndex)
+ {
+ case ANY:
+ return removeFromSequence(getAny(), otherEnd, changeContext);
+ }
+ return super.inverseRemove(otherEnd, propertyIndex, changeContext);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object get(int propertyIndex, boolean resolve)
+ {
+ switch (propertyIndex)
+ {
+ case ANY:
+ // XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view
+ //if (coreType)
+ return getAny();
+ }
+ return super.get(propertyIndex, resolve);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void set(int propertyIndex, Object newValue)
+ {
+ switch (propertyIndex)
+ {
+ case ANY:
+ setSequence(getAny(), newValue);
+ return;
+ }
+ super.set(propertyIndex, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unset(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case ANY:
+ unsetSequence(getAny());
+ return;
+ }
+ super.unset(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSet(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case ANY:
+ return any != null && !isSequenceEmpty(getAny());
+ }
+ return super.isSet(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString()
+ {
+ if (isProxy(this)) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (any: ");
+ result.append(any);
+ result.append(')');
+ return result.toString();
+ }
+
+} //DataGraphTypeImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/DataObjectImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/DataObjectImpl.java
new file mode 100644
index 0000000000..dfa7b69597
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/DataObjectImpl.java
@@ -0,0 +1,84 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.model.impl;
+
+import commonj.sdo.Type;
+
+import org.apache.tuscany.sdo.impl.DataObjectBase;
+
+import org.apache.tuscany.sdo.model.DataObject;
+import org.apache.tuscany.sdo.model.ModelFactory;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Data Object</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * </p>
+ *
+ * @generated
+ */
+public abstract class DataObjectImpl extends DataObjectBase implements DataObject
+{
+
+ public final static int SDO_PROPERTY_COUNT = 0;
+
+ public final static int EXTENDED_PROPERTY_COUNT = 0;
+
+
+ /**
+ * The number of properties for this type.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_PROPERTY_COUNT = 0;
+
+ protected int internalConvertIndex(int internalIndex)
+ {
+ switch (internalIndex)
+ {
+ }
+ return super.internalConvertIndex(internalIndex);
+ }
+
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public DataObjectImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Type getType()
+ {
+ return ((ModelFactoryImpl)ModelFactory.INSTANCE).getDataObject();
+ }
+
+} //DataObjectImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/ModelFactoryImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/ModelFactoryImpl.java
new file mode 100644
index 0000000000..55abf57156
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/ModelFactoryImpl.java
@@ -0,0 +1,2452 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.model.impl;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+import java.util.TimeZone;
+
+import org.apache.tuscany.sdo.SDOFactory;
+import org.apache.tuscany.sdo.helper.TypeHelperImpl;
+import org.apache.tuscany.sdo.impl.FactoryBase;
+import org.apache.tuscany.sdo.model.BaseDataGraphType;
+import org.apache.tuscany.sdo.model.DataGraphType;
+import org.apache.tuscany.sdo.model.ModelFactory;
+import org.apache.tuscany.sdo.model.ModelsType;
+import org.apache.tuscany.sdo.model.Property;
+import org.apache.tuscany.sdo.model.TextType;
+import org.apache.tuscany.sdo.model.Type;
+import org.apache.tuscany.sdo.model.Types;
+import org.apache.tuscany.sdo.model.XSDType;
+import org.apache.tuscany.sdo.util.SDOUtil;
+import org.eclipse.emf.ecore.xml.type.XMLTypeFactory;
+import org.eclipse.emf.ecore.xml.type.util.XMLTypeUtil;
+
+import commonj.sdo.ChangeSummary;
+import commonj.sdo.DataObject;
+import commonj.sdo.helper.DataHelper;
+import commonj.sdo.helper.HelperContext;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the commonj.sdo model factory.
+ * This model is generated from sdoModel.xsd, in the sdo-api project.
+ * Until the SDO code generator supports name conflicts and regen/merge, follow the following steps to regenerate this model:
+ * 1. Regenerate the model into a temporary directory:
+ * XSD2JavaGenerator -generateBuiltIn commonj.sdo -targetDirectory <temp-dir> -javaPackage org.apache.tuscany.sdo.model <sdo-api-dir>/src/main/resources/xml/sdoModel.xsd
+ * 2. Rename the following methods in the generated Property/PropertyImpl interface and implementation class:
+ * getDefault() to getDefault_();
+ * setDefault() to setDefault_();
+ * getOpposite() to getOpposite_();
+ * setOpposite() to setOpposite_();
+ * 3. Copy the following method from the old to new generated Type/TypeImpl interface and implemention class (resolve any missing imports):
+ * String getInstanceClassName();
+ * 4. Copy the following method from the old to new generated Types/TypesImpl interface and implemention class (resolve any missing imports):
+ * List getTypeList();
+ * 5. Delete all the createXXXFromString() and convertXXXToString() methods in the newly generated ModelFactoryImpl and
+ * replace them with the ones from this file (resolve any missing imports).
+ * 6. Comment out the call to registerStaticTypes of ModelFactory.class in the init() method
+ * 7. Change org.apache.tuscany.sdo.model.DataObject.class to commonj.sdo.DataObject.class for the following method found in method initializeMetaData();
+ * initializeType(dataObjectType, commonj.sdo.DataObject.class, "DataObject", true); // generated as org.apache.tuscany.sdo.model.DataObject.class
+ * 8. Add the following case to the generated create() method:
+ * case DATA_OBJECT: return SDOFactory.eINSTANCE.createAnyTypeDataObject();
+ * 9. Move this JavaDoc comment into the newly generated ModelFactoryImpl class.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class ModelFactoryImpl extends FactoryBase implements ModelFactory
+{
+
+ /**
+ * The package namespace URI.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String NAMESPACE_URI = "commonj.sdo";
+
+ /**
+ * The package namespace name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String NAMESPACE_PREFIX = "sdo";
+
+ /**
+ * The version of the generator pattern used to generate this class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String PATTERN_VERSION = "1.1";
+
+ public static final int BASE_DATA_GRAPH_TYPE = 1;
+ public static final int DATA_GRAPH_TYPE = 2;
+ public static final int DATA_OBJECT = 3;
+ public static final int MODELS_TYPE = 4;
+ public static final int PROPERTY = 5;
+ public static final int TEXT_TYPE = 6;
+ public static final int TYPE = 7;
+ public static final int TYPES = 8;
+ public static final int XSD_TYPE = 9;
+ public static final int BASE64_BYTES = 10;
+ public static final int BOOLEAN = 11;
+ public static final int BOOLEAN_OBJECT = 12;
+ public static final int BYTE = 13;
+ public static final int BYTE_OBJECT = 14;
+ public static final int BYTES = 15;
+ public static final int CHANGE_SUMMARY_TYPE = 16;
+ public static final int CHARACTER = 17;
+ public static final int CHARACTER_OBJECT = 18;
+ public static final int DATE = 19;
+ public static final int DATE_TIME = 20;
+ public static final int DAY = 21;
+ public static final int DECIMAL = 22;
+ public static final int DOUBLE = 23;
+ public static final int DOUBLE_OBJECT = 24;
+ public static final int DURATION = 25;
+ public static final int FLOAT = 26;
+ public static final int FLOAT_OBJECT = 27;
+ public static final int INT = 28;
+ public static final int INTEGER = 29;
+ public static final int INT_OBJECT = 30;
+ public static final int LONG = 31;
+ public static final int LONG_OBJECT = 32;
+ public static final int MONTH = 33;
+ public static final int MONTH_DAY = 34;
+ public static final int OBJECT = 35;
+ public static final int SHORT = 36;
+ public static final int SHORT_OBJECT = 37;
+ public static final int STRING = 38;
+ public static final int STRINGS = 39;
+ public static final int TIME = 40;
+ public static final int URI = 41;
+ public static final int YEAR = 42;
+ public static final int YEAR_MONTH = 43;
+ public static final int YEAR_MONTH_DAY = 44;
+
+ /**
+ * Creates an instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ModelFactoryImpl()
+ {
+ super(NAMESPACE_URI, NAMESPACE_PREFIX, "org.apache.tuscany.sdo.model");
+ }
+
+ /**
+ * Registers the Factory instance so that it is available within the supplied scope.
+ * @argument scope a HelperContext instance that will make the types supported by this Factory available.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void register(HelperContext scope) {
+ if(scope == null) {
+ throw new IllegalArgumentException("Scope can not be null");
+ }
+ TypeHelperImpl th = (TypeHelperImpl)scope.getTypeHelper();
+ th.getExtendedMetaData().putPackage(NAMESPACE_URI, this);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public DataObject create(int typeNumber)
+ {
+ switch (typeNumber)
+ {
+ case DATA_GRAPH_TYPE: return (DataObject)createDataGraphType();
+ case MODELS_TYPE: return (DataObject)createModelsType();
+ case PROPERTY: return (DataObject)createProperty();
+ case TYPE: return (DataObject)createType();
+ case TYPES: return (DataObject)createTypes();
+ case XSD_TYPE: return (DataObject)createXSDType();
+ case DATA_OBJECT: return SDOFactory.eINSTANCE.createAnyTypeDataObject();
+ default:
+ return super.create(typeNumber);
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object createFromString(int typeNumber, String initialValue)
+ {
+ switch (typeNumber)
+ {
+ case BASE64_BYTES:
+ return createBase64BytesFromString(initialValue);
+ case BOOLEAN:
+ return createBooleanFromString(initialValue);
+ case BOOLEAN_OBJECT:
+ return createBooleanObjectFromString(initialValue);
+ case BYTE:
+ return createByteFromString(initialValue);
+ case BYTE_OBJECT:
+ return createByteObjectFromString(initialValue);
+ case BYTES:
+ return createBytesFromString(initialValue);
+ case CHANGE_SUMMARY_TYPE:
+ return createChangeSummaryTypeFromString(initialValue);
+ case CHARACTER:
+ return createCharacterFromString(initialValue);
+ case CHARACTER_OBJECT:
+ return createCharacterObjectFromString(initialValue);
+ case DATE:
+ return createDateFromString(initialValue);
+ case DATE_TIME:
+ return createDateTimeFromString(initialValue);
+ case DAY:
+ return createDayFromString(initialValue);
+ case DECIMAL:
+ return createDecimalFromString(initialValue);
+ case DOUBLE:
+ return createDoubleFromString(initialValue);
+ case DOUBLE_OBJECT:
+ return createDoubleObjectFromString(initialValue);
+ case DURATION:
+ return createDurationFromString(initialValue);
+ case FLOAT:
+ return createFloatFromString(initialValue);
+ case FLOAT_OBJECT:
+ return createFloatObjectFromString(initialValue);
+ case INT:
+ return createIntFromString(initialValue);
+ case INTEGER:
+ return createIntegerFromString(initialValue);
+ case INT_OBJECT:
+ return createIntObjectFromString(initialValue);
+ case LONG:
+ return createLongFromString(initialValue);
+ case LONG_OBJECT:
+ return createLongObjectFromString(initialValue);
+ case MONTH:
+ return createMonthFromString(initialValue);
+ case MONTH_DAY:
+ return createMonthDayFromString(initialValue);
+ case OBJECT:
+ return createObjectFromString(initialValue);
+ case SHORT:
+ return createShortFromString(initialValue);
+ case SHORT_OBJECT:
+ return createShortObjectFromString(initialValue);
+ case STRING:
+ return createStringFromString(initialValue);
+ case STRINGS:
+ return createStringsFromString(initialValue);
+ case TIME:
+ return createTimeFromString(initialValue);
+ case URI:
+ return createURIFromString(initialValue);
+ case YEAR:
+ return createYearFromString(initialValue);
+ case YEAR_MONTH:
+ return createYearMonthFromString(initialValue);
+ case YEAR_MONTH_DAY:
+ return createYearMonthDayFromString(initialValue);
+ default:
+ throw new IllegalArgumentException("The type number '" + typeNumber + "' is not a valid datatype");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String convertToString(int typeNumber, Object instanceValue)
+ {
+ switch (typeNumber)
+ {
+ case BASE64_BYTES:
+ return convertBase64BytesToString(instanceValue);
+ case BOOLEAN:
+ return convertBooleanToString(instanceValue);
+ case BOOLEAN_OBJECT:
+ return convertBooleanObjectToString(instanceValue);
+ case BYTE:
+ return convertByteToString(instanceValue);
+ case BYTE_OBJECT:
+ return convertByteObjectToString(instanceValue);
+ case BYTES:
+ return convertBytesToString(instanceValue);
+ case CHANGE_SUMMARY_TYPE:
+ return convertChangeSummaryTypeToString(instanceValue);
+ case CHARACTER:
+ return convertCharacterToString(instanceValue);
+ case CHARACTER_OBJECT:
+ return convertCharacterObjectToString(instanceValue);
+ case DATE:
+ return convertDateToString(instanceValue);
+ case DATE_TIME:
+ return convertDateTimeToString(instanceValue);
+ case DAY:
+ return convertDayToString(instanceValue);
+ case DECIMAL:
+ return convertDecimalToString(instanceValue);
+ case DOUBLE:
+ return convertDoubleToString(instanceValue);
+ case DOUBLE_OBJECT:
+ return convertDoubleObjectToString(instanceValue);
+ case DURATION:
+ return convertDurationToString(instanceValue);
+ case FLOAT:
+ return convertFloatToString(instanceValue);
+ case FLOAT_OBJECT:
+ return convertFloatObjectToString(instanceValue);
+ case INT:
+ return convertIntToString(instanceValue);
+ case INTEGER:
+ return convertIntegerToString(instanceValue);
+ case INT_OBJECT:
+ return convertIntObjectToString(instanceValue);
+ case LONG:
+ return convertLongToString(instanceValue);
+ case LONG_OBJECT:
+ return convertLongObjectToString(instanceValue);
+ case MONTH:
+ return convertMonthToString(instanceValue);
+ case MONTH_DAY:
+ return convertMonthDayToString(instanceValue);
+ case OBJECT:
+ return convertObjectToString(instanceValue);
+ case SHORT:
+ return convertShortToString(instanceValue);
+ case SHORT_OBJECT:
+ return convertShortObjectToString(instanceValue);
+ case STRING:
+ return convertStringToString(instanceValue);
+ case STRINGS:
+ return convertStringsToString(instanceValue);
+ case TIME:
+ return convertTimeToString(instanceValue);
+ case URI:
+ return convertURIToString(instanceValue);
+ case YEAR:
+ return convertYearToString(instanceValue);
+ case YEAR_MONTH:
+ return convertYearMonthToString(instanceValue);
+ case YEAR_MONTH_DAY:
+ return convertYearMonthDayToString(instanceValue);
+ default:
+ throw new IllegalArgumentException("The type number '" + typeNumber + "' is not a valid datatype");
+ }
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public DataGraphType createDataGraphType()
+ {
+ DataGraphTypeImpl dataGraphType = new DataGraphTypeImpl();
+ return dataGraphType;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ModelsType createModelsType()
+ {
+ ModelsTypeImpl modelsType = new ModelsTypeImpl();
+ return modelsType;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Property createProperty()
+ {
+ PropertyImpl property = new PropertyImpl();
+ return property;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Type createType()
+ {
+ TypeImpl type = new TypeImpl();
+ return type;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Types createTypes()
+ {
+ TypesImpl types = new TypesImpl();
+ return types;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public XSDType createXSDType()
+ {
+ XSDTypeImpl xsdType = new XSDTypeImpl();
+ return xsdType;
+ }
+
+ // Following creates and initializes SDO metadata for the supported types.
+ protected commonj.sdo.Type baseDataGraphTypeType = null;
+
+ public commonj.sdo.Type getBaseDataGraphType()
+ {
+ return baseDataGraphTypeType;
+ }
+
+ protected commonj.sdo.Type dataGraphTypeType = null;
+
+ public commonj.sdo.Type getDataGraphType()
+ {
+ return dataGraphTypeType;
+ }
+
+ protected commonj.sdo.Type dataObjectType = null;
+
+ public commonj.sdo.Type getDataObject()
+ {
+ return dataObjectType;
+ }
+
+ protected commonj.sdo.Type modelsTypeType = null;
+
+ public commonj.sdo.Type getModelsType()
+ {
+ return modelsTypeType;
+ }
+
+ protected commonj.sdo.Type propertyType = null;
+
+ public commonj.sdo.Type getProperty()
+ {
+ return propertyType;
+ }
+
+ protected commonj.sdo.Type textTypeType = null;
+
+ public commonj.sdo.Type getTextType()
+ {
+ return textTypeType;
+ }
+
+ protected commonj.sdo.Type typeType = null;
+
+ public commonj.sdo.Type getType()
+ {
+ return typeType;
+ }
+
+ protected commonj.sdo.Type typesType = null;
+
+ public commonj.sdo.Type getTypes()
+ {
+ return typesType;
+ }
+
+ protected commonj.sdo.Type xsdTypeType = null;
+
+ public commonj.sdo.Type getXSDType()
+ {
+ return xsdTypeType;
+ }
+
+ protected commonj.sdo.Type base64BytesType = null;
+
+ public commonj.sdo.Type getBase64Bytes()
+ {
+ return base64BytesType;
+ }
+
+ protected commonj.sdo.Type boolean_Type = null;
+
+ public commonj.sdo.Type getBoolean()
+ {
+ return boolean_Type;
+ }
+
+ protected commonj.sdo.Type booleanObjectType = null;
+
+ public commonj.sdo.Type getBooleanObject()
+ {
+ return booleanObjectType;
+ }
+
+ protected commonj.sdo.Type byte_Type = null;
+
+ public commonj.sdo.Type getByte()
+ {
+ return byte_Type;
+ }
+
+ protected commonj.sdo.Type byteObjectType = null;
+
+ public commonj.sdo.Type getByteObject()
+ {
+ return byteObjectType;
+ }
+
+ protected commonj.sdo.Type bytesType = null;
+
+ public commonj.sdo.Type getBytes()
+ {
+ return bytesType;
+ }
+
+ protected commonj.sdo.Type changeSummaryTypeType = null;
+
+ public commonj.sdo.Type getChangeSummaryType()
+ {
+ return changeSummaryTypeType;
+ }
+
+ protected commonj.sdo.Type characterType = null;
+
+ public commonj.sdo.Type getCharacter()
+ {
+ return characterType;
+ }
+
+ protected commonj.sdo.Type characterObjectType = null;
+
+ public commonj.sdo.Type getCharacterObject()
+ {
+ return characterObjectType;
+ }
+
+ protected commonj.sdo.Type dateType = null;
+
+ public commonj.sdo.Type getDate()
+ {
+ return dateType;
+ }
+
+ protected commonj.sdo.Type dateTimeType = null;
+
+ public commonj.sdo.Type getDateTime()
+ {
+ return dateTimeType;
+ }
+
+ protected commonj.sdo.Type dayType = null;
+
+ public commonj.sdo.Type getDay()
+ {
+ return dayType;
+ }
+
+ protected commonj.sdo.Type decimalType = null;
+
+ public commonj.sdo.Type getDecimal()
+ {
+ return decimalType;
+ }
+
+ protected commonj.sdo.Type double_Type = null;
+
+ public commonj.sdo.Type getDouble()
+ {
+ return double_Type;
+ }
+
+ protected commonj.sdo.Type doubleObjectType = null;
+
+ public commonj.sdo.Type getDoubleObject()
+ {
+ return doubleObjectType;
+ }
+
+ protected commonj.sdo.Type durationType = null;
+
+ public commonj.sdo.Type getDuration()
+ {
+ return durationType;
+ }
+
+ protected commonj.sdo.Type float_Type = null;
+
+ public commonj.sdo.Type getFloat()
+ {
+ return float_Type;
+ }
+
+ protected commonj.sdo.Type floatObjectType = null;
+
+ public commonj.sdo.Type getFloatObject()
+ {
+ return floatObjectType;
+ }
+
+ protected commonj.sdo.Type int_Type = null;
+
+ public commonj.sdo.Type getInt()
+ {
+ return int_Type;
+ }
+
+ protected commonj.sdo.Type integerType = null;
+
+ public commonj.sdo.Type getInteger()
+ {
+ return integerType;
+ }
+
+ protected commonj.sdo.Type intObjectType = null;
+
+ public commonj.sdo.Type getIntObject()
+ {
+ return intObjectType;
+ }
+
+ protected commonj.sdo.Type long_Type = null;
+
+ public commonj.sdo.Type getLong()
+ {
+ return long_Type;
+ }
+
+ protected commonj.sdo.Type longObjectType = null;
+
+ public commonj.sdo.Type getLongObject()
+ {
+ return longObjectType;
+ }
+
+ protected commonj.sdo.Type monthType = null;
+
+ public commonj.sdo.Type getMonth()
+ {
+ return monthType;
+ }
+
+ protected commonj.sdo.Type monthDayType = null;
+
+ public commonj.sdo.Type getMonthDay()
+ {
+ return monthDayType;
+ }
+
+ protected commonj.sdo.Type objectType = null;
+
+ public commonj.sdo.Type getObject()
+ {
+ return objectType;
+ }
+
+ protected commonj.sdo.Type short_Type = null;
+
+ public commonj.sdo.Type getShort()
+ {
+ return short_Type;
+ }
+
+ protected commonj.sdo.Type shortObjectType = null;
+
+ public commonj.sdo.Type getShortObject()
+ {
+ return shortObjectType;
+ }
+
+ protected commonj.sdo.Type stringType = null;
+
+ public commonj.sdo.Type getString()
+ {
+ return stringType;
+ }
+
+ protected commonj.sdo.Type stringsType = null;
+
+ public commonj.sdo.Type getStrings()
+ {
+ return stringsType;
+ }
+
+ protected commonj.sdo.Type timeType = null;
+
+ public commonj.sdo.Type getTime()
+ {
+ return timeType;
+ }
+
+ protected commonj.sdo.Type uriType = null;
+
+ public commonj.sdo.Type getURI()
+ {
+ return uriType;
+ }
+
+ protected commonj.sdo.Type yearType = null;
+
+ public commonj.sdo.Type getYear()
+ {
+ return yearType;
+ }
+
+ protected commonj.sdo.Type yearMonthType = null;
+
+ public commonj.sdo.Type getYearMonth()
+ {
+ return yearMonthType;
+ }
+
+ protected commonj.sdo.Type yearMonthDayType = null;
+
+ public commonj.sdo.Type getYearMonthDay()
+ {
+ return yearMonthDayType;
+ }
+
+
+ private static boolean isInited = false;
+
+ public static ModelFactoryImpl init()
+ {
+ if (isInited) return (ModelFactoryImpl)FactoryBase.getStaticFactory(ModelFactoryImpl.NAMESPACE_URI);
+ ModelFactoryImpl theModelFactoryImpl = new ModelFactoryImpl();
+ isInited = true;
+
+ // Initialize simple dependencies
+ SDOUtil.registerStaticTypes(SDOFactory.class);
+ //SDOUtil.registerStaticTypes(ModelFactory.class);
+
+ // Create package meta-data objects
+ theModelFactoryImpl.createMetaData();
+
+ // Initialize created meta-data
+ theModelFactoryImpl.initializeMetaData();
+
+ // Mark meta-data to indicate it can't be changed
+ //theModelFactoryImpl.freeze(); //FB do we need to freeze / should we freeze ????
+
+ return theModelFactoryImpl;
+ }
+
+ private boolean isCreated = false;
+
+ public void createMetaData()
+ {
+ if (isCreated) return;
+ isCreated = true;
+
+ // Create types and their properties
+ baseDataGraphTypeType = createType(false, BASE_DATA_GRAPH_TYPE);
+ createProperty(false, baseDataGraphTypeType,BaseDataGraphTypeImpl.INTERNAL_MODELS);
+ createProperty(false, baseDataGraphTypeType,BaseDataGraphTypeImpl.INTERNAL_XSD);
+ createProperty(true, baseDataGraphTypeType,BaseDataGraphTypeImpl.INTERNAL_CHANGE_SUMMARY);
+ createProperty(true, baseDataGraphTypeType,BaseDataGraphTypeImpl.INTERNAL_ANY_ATTRIBUTE);
+ dataGraphTypeType = createType(false, DATA_GRAPH_TYPE);
+ createProperty(true, dataGraphTypeType,DataGraphTypeImpl.INTERNAL_ANY);
+ dataObjectType = createType(false, DATA_OBJECT);
+ modelsTypeType = createType(false, MODELS_TYPE);
+ createProperty(true, modelsTypeType,ModelsTypeImpl.INTERNAL_ANY);
+ propertyType = createType(false, PROPERTY);
+ createProperty(true, propertyType,PropertyImpl.INTERNAL_ALIAS_NAME);
+ createProperty(true, propertyType,PropertyImpl.INTERNAL_ANY);
+ createProperty(true, propertyType,PropertyImpl.INTERNAL_NAME);
+ createProperty(true, propertyType,PropertyImpl.INTERNAL_MANY);
+ createProperty(true, propertyType,PropertyImpl.INTERNAL_CONTAINMENT);
+ createProperty(true, propertyType,PropertyImpl.INTERNAL_DEFAULT);
+ createProperty(true, propertyType,PropertyImpl.INTERNAL_READ_ONLY);
+ createProperty(false, propertyType,PropertyImpl.INTERNAL_TYPE);
+ createProperty(false, propertyType,PropertyImpl.INTERNAL_OPPOSITE);
+ createProperty(true, propertyType,PropertyImpl.INTERNAL_NULLABLE);
+ createProperty(true, propertyType,PropertyImpl.INTERNAL_ANY_ATTRIBUTE);
+ textTypeType = createType(false, TEXT_TYPE);
+ createProperty(true, textTypeType,TextTypeImpl.INTERNAL_TEXT);
+ typeType = createType(false, TYPE);
+ createProperty(false, typeType,TypeImpl.INTERNAL_BASE_TYPE);
+ createProperty(false, typeType,TypeImpl.INTERNAL_PROPERTY);
+ createProperty(true, typeType,TypeImpl.INTERNAL_ALIAS_NAME);
+ createProperty(true, typeType,TypeImpl.INTERNAL_ANY);
+ createProperty(true, typeType,TypeImpl.INTERNAL_NAME);
+ createProperty(true, typeType,TypeImpl.INTERNAL_URI);
+ createProperty(true, typeType,TypeImpl.INTERNAL_DATA_TYPE);
+ createProperty(true, typeType,TypeImpl.INTERNAL_OPEN);
+ createProperty(true, typeType,TypeImpl.INTERNAL_SEQUENCED);
+ createProperty(true, typeType,TypeImpl.INTERNAL_ABSTRACT);
+ createProperty(true, typeType,TypeImpl.INTERNAL_ANY_ATTRIBUTE);
+ typesType = createType(false, TYPES);
+ createProperty(false, typesType,TypesImpl.INTERNAL_TYPE);
+ xsdTypeType = createType(false, XSD_TYPE);
+ createProperty(true, xsdTypeType,XSDTypeImpl.INTERNAL_ANY);
+
+ // Create data types
+ base64BytesType = createType(true, BASE64_BYTES );
+ boolean_Type = createType(true, BOOLEAN );
+ booleanObjectType = createType(true, BOOLEAN_OBJECT );
+ byte_Type = createType(true, BYTE );
+ byteObjectType = createType(true, BYTE_OBJECT );
+ bytesType = createType(true, BYTES );
+ changeSummaryTypeType = createType(true, CHANGE_SUMMARY_TYPE );
+ characterType = createType(true, CHARACTER );
+ characterObjectType = createType(true, CHARACTER_OBJECT );
+ dateType = createType(true, DATE );
+ dateTimeType = createType(true, DATE_TIME );
+ dayType = createType(true, DAY );
+ decimalType = createType(true, DECIMAL );
+ double_Type = createType(true, DOUBLE );
+ doubleObjectType = createType(true, DOUBLE_OBJECT );
+ durationType = createType(true, DURATION );
+ float_Type = createType(true, FLOAT );
+ floatObjectType = createType(true, FLOAT_OBJECT );
+ int_Type = createType(true, INT );
+ integerType = createType(true, INTEGER );
+ intObjectType = createType(true, INT_OBJECT );
+ long_Type = createType(true, LONG );
+ longObjectType = createType(true, LONG_OBJECT );
+ monthType = createType(true, MONTH );
+ monthDayType = createType(true, MONTH_DAY );
+ objectType = createType(true, OBJECT );
+ short_Type = createType(true, SHORT );
+ shortObjectType = createType(true, SHORT_OBJECT );
+ stringType = createType(true, STRING );
+ stringsType = createType(true, STRINGS );
+ timeType = createType(true, TIME );
+ uriType = createType(true, URI );
+ yearType = createType(true, YEAR );
+ yearMonthType = createType(true, YEAR_MONTH );
+ yearMonthDayType = createType(true, YEAR_MONTH_DAY );
+ }
+
+ private boolean isInitialized = false;
+
+ public void initializeMetaData()
+ {
+ if (isInitialized) return;
+ isInitialized = true;
+ commonj.sdo.Property property = null;
+
+ // Add supertypes to types
+ addSuperType(dataGraphTypeType, baseDataGraphTypeType);
+
+ // Initialize types and properties
+ initializeType(baseDataGraphTypeType, BaseDataGraphType.class, "BaseDataGraphType", true);
+ property = getProperty(baseDataGraphTypeType, BaseDataGraphTypeImpl.INTERNAL_MODELS);
+ initializeProperty(property, this.getModelsType(), "models", null, 0, 1, BaseDataGraphType.class, false, true, false, true , null);
+
+ property = getProperty(baseDataGraphTypeType, BaseDataGraphTypeImpl.INTERNAL_XSD);
+ initializeProperty(property, this.getXSDType(), "xsd", null, 0, 1, BaseDataGraphType.class, false, true, false, true , null);
+
+ property = getProperty(baseDataGraphTypeType, BaseDataGraphTypeImpl.INTERNAL_CHANGE_SUMMARY);
+ initializeProperty(property, this.getChangeSummaryType(), "changeSummary", null, 0, 1, BaseDataGraphType.class, false, true, false);
+
+ property = getProperty(baseDataGraphTypeType, BaseDataGraphTypeImpl.INTERNAL_ANY_ATTRIBUTE);
+ initializeProperty(property, getSequence(), "anyAttribute", null, 0, -1, BaseDataGraphType.class, false, false, false);
+
+ initializeType(dataGraphTypeType, DataGraphType.class, "DataGraphType", false);
+ property = getProperty(dataGraphTypeType, DataGraphTypeImpl.INTERNAL_ANY);
+ initializeProperty(property, getSequence(), "any", null, 0, 1, DataGraphType.class, false, false, false);
+
+ initializeType(dataObjectType, commonj.sdo.DataObject.class, "DataObject", true);
+ initializeType(modelsTypeType, ModelsType.class, "ModelsType", false);
+ property = getProperty(modelsTypeType, ModelsTypeImpl.INTERNAL_ANY);
+ initializeProperty(property, getSequence(), "any", null, 0, -1, ModelsType.class, false, false, false);
+
+ initializeType(propertyType, Property.class, "Property", false);
+ property = getProperty(propertyType, PropertyImpl.INTERNAL_ALIAS_NAME);
+ initializeProperty(property, this.getString(), "aliasName", null, 0, -1, Property.class, false, false, false);
+
+ property = getProperty(propertyType, PropertyImpl.INTERNAL_ANY);
+ initializeProperty(property, getSequence(), "any", null, 0, -1, Property.class, false, false, false);
+
+ property = getProperty(propertyType, PropertyImpl.INTERNAL_NAME);
+ initializeProperty(property, this.getString(), "name", null, 0, 1, Property.class, false, true, false);
+
+ property = getProperty(propertyType, PropertyImpl.INTERNAL_MANY);
+ initializeProperty(property, this.getBoolean(), "many", null, 0, 1, Property.class, false, true, false);
+
+ property = getProperty(propertyType, PropertyImpl.INTERNAL_CONTAINMENT);
+ initializeProperty(property, this.getBoolean(), "containment", null, 0, 1, Property.class, false, true, false);
+
+ property = getProperty(propertyType, PropertyImpl.INTERNAL_DEFAULT);
+ initializeProperty(property, this.getString(), "default", null, 0, 1, Property.class, false, true, false);
+
+ property = getProperty(propertyType, PropertyImpl.INTERNAL_READ_ONLY);
+ initializeProperty(property, this.getBoolean(), "readOnly", null, 0, 1, Property.class, false, true, false);
+
+ property = getProperty(propertyType, PropertyImpl.INTERNAL_TYPE);
+ initializeProperty(property, this.getType(), "type", null, 0, 1, Property.class, false, true, false, false , null);
+ setInstanceProperty (property, "commonj.sdo/xml", "propertyType", "sdo:Type");
+
+ property = getProperty(propertyType, PropertyImpl.INTERNAL_OPPOSITE);
+ initializeProperty(property, this.getProperty(), "opposite", null, 0, 1, Property.class, false, true, false, false , null);
+ setInstanceProperty (property, "commonj.sdo/xml", "propertyType", "sdo:Property");
+
+ property = getProperty(propertyType, PropertyImpl.INTERNAL_NULLABLE);
+ initializeProperty(property, this.getBoolean(), "nullable", null, 0, 1, Property.class, false, true, false);
+
+ property = getProperty(propertyType, PropertyImpl.INTERNAL_ANY_ATTRIBUTE);
+ initializeProperty(property, getSequence(), "anyAttribute", null, 0, -1, Property.class, false, false, false);
+
+ initializeType(textTypeType, TextType.class, "TextType", true);
+ property = getProperty(textTypeType, TextTypeImpl.INTERNAL_TEXT);
+ initializeProperty(property, this.getString(), "text", null, 0, -1, TextType.class, false, false, false);
+
+ initializeType(typeType, Type.class, "Type", false);
+ property = getProperty(typeType, TypeImpl.INTERNAL_BASE_TYPE);
+ initializeProperty(property, this.getType(), "baseType", null, 0, -1, Type.class, false, false, false, false , null);
+ setInstanceProperty (property, "commonj.sdo/xml", "propertyType", "sdo:Type");
+
+ property = getProperty(typeType, TypeImpl.INTERNAL_PROPERTY);
+ initializeProperty(property, this.getProperty(), "property", null, 0, -1, Type.class, false, false, false, true , null);
+
+ property = getProperty(typeType, TypeImpl.INTERNAL_ALIAS_NAME);
+ initializeProperty(property, this.getString(), "aliasName", null, 0, -1, Type.class, false, false, false);
+
+ property = getProperty(typeType, TypeImpl.INTERNAL_ANY);
+ initializeProperty(property, getSequence(), "any", null, 0, -1, Type.class, false, false, false);
+
+ property = getProperty(typeType, TypeImpl.INTERNAL_NAME);
+ initializeProperty(property, this.getString(), "name", null, 0, 1, Type.class, false, true, false);
+ setInstanceProperty (property, "commonj.sdo/xml", "dataType", "sdo:String");
+
+ property = getProperty(typeType, TypeImpl.INTERNAL_URI);
+ initializeProperty(property, this.getURI(), "uri", null, 0, 1, Type.class, false, true, false);
+
+ property = getProperty(typeType, TypeImpl.INTERNAL_DATA_TYPE);
+ initializeProperty(property, this.getBoolean(), "dataType", null, 0, 1, Type.class, false, true, false);
+
+ property = getProperty(typeType, TypeImpl.INTERNAL_OPEN);
+ initializeProperty(property, this.getBoolean(), "open", null, 0, 1, Type.class, false, true, false);
+
+ property = getProperty(typeType, TypeImpl.INTERNAL_SEQUENCED);
+ initializeProperty(property, this.getBoolean(), "sequenced", null, 0, 1, Type.class, false, true, false);
+
+ property = getProperty(typeType, TypeImpl.INTERNAL_ABSTRACT);
+ initializeProperty(property, this.getBoolean(), "abstract", null, 0, 1, Type.class, false, true, false);
+
+ property = getProperty(typeType, TypeImpl.INTERNAL_ANY_ATTRIBUTE);
+ initializeProperty(property, getSequence(), "anyAttribute", null, 0, -1, Type.class, false, false, false);
+
+ initializeType(typesType, Types.class, "Types", false);
+ property = getProperty(typesType, TypesImpl.INTERNAL_TYPE);
+ initializeProperty(property, this.getType(), "type", null, 0, -1, Types.class, false, false, false, true , null);
+
+ initializeType(xsdTypeType, XSDType.class, "XSDType", false);
+ property = getProperty(xsdTypeType, XSDTypeImpl.INTERNAL_ANY);
+ initializeProperty(property, getSequence(), "any", null, 0, -1, XSDType.class, false, false, false);
+
+ // Initialize data types
+ initializeType(base64BytesType, byte[].class, "Base64Bytes", true, false);
+ setInstanceProperty (base64BytesType, "commonj.sdo/java", "instanceClass", "byte[]");
+
+ initializeType(boolean_Type, boolean.class, "Boolean", true, false);
+ setInstanceProperty (boolean_Type, "commonj.sdo/java", "instanceClass", "boolean");
+
+ initializeType(booleanObjectType, Boolean.class, "BooleanObject", true, false);
+
+ initializeType(byte_Type, byte.class, "Byte", true, false);
+ setInstanceProperty (byte_Type, "commonj.sdo/java", "instanceClass", "byte");
+
+ initializeType(byteObjectType, Byte.class, "ByteObject", true, false);
+
+ initializeType(bytesType, byte[].class, "Bytes", true, false);
+ setInstanceProperty (bytesType, "commonj.sdo/java", "instanceClass", "byte[]");
+
+ initializeType(changeSummaryTypeType, ChangeSummary.class, "ChangeSummaryType", true, false);
+ setInstanceProperty (changeSummaryTypeType, "commonj.sdo/java", "instanceClass", "commonj.sdo.ChangeSummary");
+
+ initializeType(characterType, char.class, "Character", true, false);
+ setInstanceProperty (characterType, "commonj.sdo/java", "instanceClass", "char");
+
+ initializeType(characterObjectType, Character.class, "CharacterObject", true, false);
+
+ initializeType(dateType, Date.class, "Date", true, false);
+ setInstanceProperty (dateType, "commonj.sdo/java", "instanceClass", "java.util.Date");
+
+ initializeType(dateTimeType, String.class, "DateTime", true, false);
+ setInstanceProperty (dateTimeType, "commonj.sdo/java", "instanceClass", "java.lang.String");
+
+ initializeType(dayType, String.class, "Day", true, false);
+ setInstanceProperty (dayType, "commonj.sdo/java", "instanceClass", "java.lang.String");
+
+ initializeType(decimalType, BigDecimal.class, "Decimal", true, false);
+ setInstanceProperty (decimalType, "commonj.sdo/java", "instanceClass", "java.math.BigDecimal");
+
+ initializeType(double_Type, double.class, "Double", true, false);
+ setInstanceProperty (double_Type, "commonj.sdo/java", "instanceClass", "double");
+
+ initializeType(doubleObjectType, Double.class, "DoubleObject", true, false);
+
+ initializeType(durationType, String.class, "Duration", true, false);
+ setInstanceProperty (durationType, "commonj.sdo/java", "instanceClass", "java.lang.String");
+
+ initializeType(float_Type, float.class, "Float", true, false);
+ setInstanceProperty (float_Type, "commonj.sdo/java", "instanceClass", "float");
+
+ initializeType(floatObjectType, Float.class, "FloatObject", true, false);
+
+ initializeType(int_Type, int.class, "Int", true, false);
+ setInstanceProperty (int_Type, "commonj.sdo/java", "instanceClass", "int");
+
+ initializeType(integerType, BigInteger.class, "Integer", true, false);
+ setInstanceProperty (integerType, "commonj.sdo/java", "instanceClass", "java.math.BigInteger");
+
+ initializeType(intObjectType, Integer.class, "IntObject", true, false);
+
+ initializeType(long_Type, long.class, "Long", true, false);
+ setInstanceProperty (long_Type, "commonj.sdo/java", "instanceClass", "long");
+
+ initializeType(longObjectType, Long.class, "LongObject", true, false);
+
+ initializeType(monthType, String.class, "Month", true, false);
+ setInstanceProperty (monthType, "commonj.sdo/java", "instanceClass", "java.lang.String");
+
+ initializeType(monthDayType, String.class, "MonthDay", true, false);
+ setInstanceProperty (monthDayType, "commonj.sdo/java", "instanceClass", "java.lang.String");
+
+ initializeType(objectType, Object.class, "Object", true, false);
+ setInstanceProperty (objectType, "commonj.sdo/java", "instanceClass", "java.lang.Object");
+
+ initializeType(short_Type, short.class, "Short", true, false);
+ setInstanceProperty (short_Type, "commonj.sdo/java", "instanceClass", "short");
+
+ initializeType(shortObjectType, Short.class, "ShortObject", true, false);
+
+ initializeType(stringType, String.class, "String", true, false);
+ setInstanceProperty (stringType, "commonj.sdo/java", "instanceClass", "java.lang.String");
+
+ initializeType(stringsType, List.class, "Strings", true, false);
+ setInstanceProperty (stringsType, "commonj.sdo/java", "instanceClass", "java.util.List");
+
+ initializeType(timeType, String.class, "Time", true, false);
+ setInstanceProperty (timeType, "commonj.sdo/java", "instanceClass", "java.lang.String");
+
+ initializeType(uriType, String.class, "URI", true, false);
+ setInstanceProperty (uriType, "commonj.sdo/java", "instanceClass", "java.lang.String");
+
+ initializeType(yearType, String.class, "Year", true, false);
+ setInstanceProperty (yearType, "commonj.sdo/java", "instanceClass", "java.lang.String");
+
+ initializeType(yearMonthType, String.class, "YearMonth", true, false);
+ setInstanceProperty (yearMonthType, "commonj.sdo/java", "instanceClass", "java.lang.String");
+
+ initializeType(yearMonthDayType, String.class, "YearMonthDay", true, false);
+ setInstanceProperty (yearMonthDayType, "commonj.sdo/java", "instanceClass", "java.lang.String");
+
+ createXSDMetaData();
+ }
+
+ protected void createXSDMetaData()
+ {
+ super.initXSD();
+
+ commonj.sdo.Property property = null;
+
+
+ addXSDMapping
+ (baseDataGraphTypeType,
+ new String[]
+ {
+ "name", "BaseDataGraphType",
+ "kind", "elementOnly"
+ });
+
+ addXSDMapping
+ (getProperty(baseDataGraphTypeType, BaseDataGraphTypeImpl.INTERNAL_MODELS),
+ new String[]
+ {
+ "kind", "element",
+ "name", "models"
+ });
+
+ addXSDMapping
+ (getProperty(baseDataGraphTypeType, BaseDataGraphTypeImpl.INTERNAL_XSD),
+ new String[]
+ {
+ "kind", "element",
+ "name", "xsd"
+ });
+
+ addXSDMapping
+ (getProperty(baseDataGraphTypeType, BaseDataGraphTypeImpl.INTERNAL_CHANGE_SUMMARY),
+ new String[]
+ {
+ "kind", "element",
+ "name", "changeSummary"
+ });
+
+ addXSDMapping
+ (getProperty(baseDataGraphTypeType, BaseDataGraphTypeImpl.INTERNAL_ANY_ATTRIBUTE),
+ new String[]
+ {
+ "kind", "attributeWildcard",
+ "wildcards", "##other",
+ "name", ":3",
+ "processing", "lax"
+ });
+
+ addXSDMapping
+ (dataGraphTypeType,
+ new String[]
+ {
+ "name", "DataGraphType",
+ "kind", "elementOnly"
+ });
+
+ addXSDMapping
+ (getProperty(dataGraphTypeType, DataGraphTypeImpl.INTERNAL_ANY),
+ new String[]
+ {
+ "kind", "elementWildcard",
+ "wildcards", "##other",
+ "name", ":4",
+ "processing", "lax"
+ });
+
+ addXSDMapping
+ (dataObjectType,
+ new String[]
+ {
+ "name", "DataObject",
+ "kind", "empty"
+ });
+
+ property = createGlobalProperty
+ ("datagraph",
+ this.getDataGraphType(),
+ new String[]
+ {
+ "kind", "element",
+ "name", "datagraph",
+ "namespace", "##targetNamespace"
+ });
+
+ property = createGlobalProperty
+ ("dataObject",
+ this.getDataObject(),
+ new String[]
+ {
+ "kind", "element",
+ "name", "dataObject",
+ "namespace", "##targetNamespace"
+ });
+
+ property = createGlobalProperty
+ ("type",
+ this.getType(),
+ new String[]
+ {
+ "kind", "element",
+ "name", "type",
+ "namespace", "##targetNamespace"
+ });
+
+ property = createGlobalProperty
+ ("types",
+ this.getTypes(),
+ new String[]
+ {
+ "kind", "element",
+ "name", "types",
+ "namespace", "##targetNamespace"
+ });
+
+ property = createGlobalProperty
+ ("ref",
+ this.getString(),
+ new String[]
+ {
+ "kind", "attribute",
+ "name", "ref",
+ "namespace", "##targetNamespace"
+ },
+ IS_ATTRIBUTE);
+
+ property = createGlobalProperty
+ ("unset",
+ this.getString(),
+ new String[]
+ {
+ "kind", "attribute",
+ "name", "unset",
+ "namespace", "##targetNamespace"
+ },
+ IS_ATTRIBUTE);
+
+ addXSDMapping
+ (modelsTypeType,
+ new String[]
+ {
+ "name", "ModelsType",
+ "kind", "elementOnly"
+ });
+
+ addXSDMapping
+ (getProperty(modelsTypeType, ModelsTypeImpl.INTERNAL_ANY),
+ new String[]
+ {
+ "kind", "elementWildcard",
+ "wildcards", "##other",
+ "name", ":0",
+ "processing", "lax"
+ });
+
+ addXSDMapping
+ (propertyType,
+ new String[]
+ {
+ "name", "Property",
+ "kind", "elementOnly"
+ });
+
+ addXSDMapping
+ (getProperty(propertyType, PropertyImpl.INTERNAL_ALIAS_NAME),
+ new String[]
+ {
+ "kind", "element",
+ "name", "aliasName",
+ "namespace", "##targetNamespace"
+ });
+
+ addXSDMapping
+ (getProperty(propertyType, PropertyImpl.INTERNAL_ANY),
+ new String[]
+ {
+ "kind", "elementWildcard",
+ "wildcards", "##other",
+ "name", ":1",
+ "processing", "lax"
+ });
+
+ addXSDMapping
+ (getProperty(propertyType, PropertyImpl.INTERNAL_NAME),
+ new String[]
+ {
+ "kind", "attribute",
+ "name", "name"
+ });
+
+ addXSDMapping
+ (getProperty(propertyType, PropertyImpl.INTERNAL_MANY),
+ new String[]
+ {
+ "kind", "attribute",
+ "name", "many"
+ });
+
+ addXSDMapping
+ (getProperty(propertyType, PropertyImpl.INTERNAL_CONTAINMENT),
+ new String[]
+ {
+ "kind", "attribute",
+ "name", "containment"
+ });
+
+ addXSDMapping
+ (getProperty(propertyType, PropertyImpl.INTERNAL_DEFAULT),
+ new String[]
+ {
+ "kind", "attribute",
+ "name", "default"
+ });
+
+ addXSDMapping
+ (getProperty(propertyType, PropertyImpl.INTERNAL_READ_ONLY),
+ new String[]
+ {
+ "kind", "attribute",
+ "name", "readOnly"
+ });
+
+ addXSDMapping
+ (getProperty(propertyType, PropertyImpl.INTERNAL_TYPE),
+ new String[]
+ {
+ "kind", "attribute",
+ "name", "type"
+ });
+
+ addXSDMapping
+ (getProperty(propertyType, PropertyImpl.INTERNAL_OPPOSITE),
+ new String[]
+ {
+ "kind", "attribute",
+ "name", "opposite"
+ });
+
+ addXSDMapping
+ (getProperty(propertyType, PropertyImpl.INTERNAL_NULLABLE),
+ new String[]
+ {
+ "kind", "attribute",
+ "name", "nullable"
+ });
+
+ addXSDMapping
+ (getProperty(propertyType, PropertyImpl.INTERNAL_ANY_ATTRIBUTE),
+ new String[]
+ {
+ "kind", "attributeWildcard",
+ "wildcards", "##any",
+ "name", ":10",
+ "processing", "lax"
+ });
+
+ addXSDMapping
+ (textTypeType,
+ new String[]
+ {
+ "name", "TextType",
+ "kind", "elementOnly"
+ });
+
+ addXSDMapping
+ (getProperty(textTypeType, TextTypeImpl.INTERNAL_TEXT),
+ new String[]
+ {
+ "kind", "element",
+ "name", "text",
+ "namespace", "##targetNamespace"
+ });
+
+ addXSDMapping
+ (typeType,
+ new String[]
+ {
+ "name", "Type",
+ "kind", "elementOnly"
+ });
+
+ addXSDMapping
+ (getProperty(typeType, TypeImpl.INTERNAL_BASE_TYPE),
+ new String[]
+ {
+ "kind", "element",
+ "name", "baseType",
+ "namespace", "##targetNamespace"
+ });
+
+ addXSDMapping
+ (getProperty(typeType, TypeImpl.INTERNAL_PROPERTY),
+ new String[]
+ {
+ "kind", "element",
+ "name", "property",
+ "namespace", "##targetNamespace"
+ });
+
+ addXSDMapping
+ (getProperty(typeType, TypeImpl.INTERNAL_ALIAS_NAME),
+ new String[]
+ {
+ "kind", "element",
+ "name", "aliasName",
+ "namespace", "##targetNamespace"
+ });
+
+ addXSDMapping
+ (getProperty(typeType, TypeImpl.INTERNAL_ANY),
+ new String[]
+ {
+ "kind", "elementWildcard",
+ "wildcards", "##other",
+ "name", ":3",
+ "processing", "lax"
+ });
+
+ addXSDMapping
+ (getProperty(typeType, TypeImpl.INTERNAL_NAME),
+ new String[]
+ {
+ "kind", "attribute",
+ "name", "name"
+ });
+
+ addXSDMapping
+ (getProperty(typeType, TypeImpl.INTERNAL_URI),
+ new String[]
+ {
+ "kind", "attribute",
+ "name", "uri"
+ });
+
+ addXSDMapping
+ (getProperty(typeType, TypeImpl.INTERNAL_DATA_TYPE),
+ new String[]
+ {
+ "kind", "attribute",
+ "name", "dataType"
+ });
+
+ addXSDMapping
+ (getProperty(typeType, TypeImpl.INTERNAL_OPEN),
+ new String[]
+ {
+ "kind", "attribute",
+ "name", "open"
+ });
+
+ addXSDMapping
+ (getProperty(typeType, TypeImpl.INTERNAL_SEQUENCED),
+ new String[]
+ {
+ "kind", "attribute",
+ "name", "sequenced"
+ });
+
+ addXSDMapping
+ (getProperty(typeType, TypeImpl.INTERNAL_ABSTRACT),
+ new String[]
+ {
+ "kind", "attribute",
+ "name", "abstract"
+ });
+
+ addXSDMapping
+ (getProperty(typeType, TypeImpl.INTERNAL_ANY_ATTRIBUTE),
+ new String[]
+ {
+ "kind", "attributeWildcard",
+ "wildcards", "##any",
+ "name", ":10",
+ "processing", "lax"
+ });
+
+ addXSDMapping
+ (typesType,
+ new String[]
+ {
+ "name", "Types",
+ "kind", "elementOnly"
+ });
+
+ addXSDMapping
+ (getProperty(typesType, TypesImpl.INTERNAL_TYPE),
+ new String[]
+ {
+ "kind", "element",
+ "name", "type",
+ "namespace", "##targetNamespace"
+ });
+
+ addXSDMapping
+ (xsdTypeType,
+ new String[]
+ {
+ "name", "XSDType",
+ "kind", "elementOnly"
+ });
+
+ addXSDMapping
+ (getProperty(xsdTypeType, XSDTypeImpl.INTERNAL_ANY),
+ new String[]
+ {
+ "kind", "elementWildcard",
+ "wildcards", "http://www.w3.org/2001/XMLSchema",
+ "name", ":0",
+ "processing", "lax"
+ });
+
+ addXSDMapping
+ (base64BytesType,
+ new String[]
+ {
+ "name", "Base64Bytes"
+ });
+
+ addXSDMapping
+ (boolean_Type,
+ new String[]
+ {
+ "name", "Boolean"
+ });
+
+ addXSDMapping
+ (booleanObjectType,
+ new String[]
+ {
+ "name", "Boolean:Object",
+ "baseType", "Boolean"
+ });
+
+ addXSDMapping
+ (byte_Type,
+ new String[]
+ {
+ "name", "Byte"
+ });
+
+ addXSDMapping
+ (byteObjectType,
+ new String[]
+ {
+ "name", "Byte:Object",
+ "baseType", "Byte"
+ });
+
+ addXSDMapping
+ (bytesType,
+ new String[]
+ {
+ "name", "Bytes"
+ });
+
+ addXSDMapping
+ (changeSummaryTypeType,
+ new String[]
+ {
+ "name", "ChangeSummaryType"
+ });
+
+ addXSDMapping
+ (characterType,
+ new String[]
+ {
+ "name", "Character"
+ });
+
+ addXSDMapping
+ (characterObjectType,
+ new String[]
+ {
+ "name", "Character:Object",
+ "baseType", "Character"
+ });
+
+ addXSDMapping
+ (dateType,
+ new String[]
+ {
+ "name", "Date"
+ });
+
+ addXSDMapping
+ (dateTimeType,
+ new String[]
+ {
+ "name", "DateTime"
+ });
+
+ addXSDMapping
+ (dayType,
+ new String[]
+ {
+ "name", "Day"
+ });
+
+ addXSDMapping
+ (decimalType,
+ new String[]
+ {
+ "name", "Decimal"
+ });
+
+ addXSDMapping
+ (double_Type,
+ new String[]
+ {
+ "name", "Double"
+ });
+
+ addXSDMapping
+ (doubleObjectType,
+ new String[]
+ {
+ "name", "Double:Object",
+ "baseType", "Double"
+ });
+
+ addXSDMapping
+ (durationType,
+ new String[]
+ {
+ "name", "Duration"
+ });
+
+ addXSDMapping
+ (float_Type,
+ new String[]
+ {
+ "name", "Float"
+ });
+
+ addXSDMapping
+ (floatObjectType,
+ new String[]
+ {
+ "name", "Float:Object",
+ "baseType", "Float"
+ });
+
+ addXSDMapping
+ (int_Type,
+ new String[]
+ {
+ "name", "Int"
+ });
+
+ addXSDMapping
+ (integerType,
+ new String[]
+ {
+ "name", "Integer"
+ });
+
+ addXSDMapping
+ (intObjectType,
+ new String[]
+ {
+ "name", "Int:Object",
+ "baseType", "Int"
+ });
+
+ addXSDMapping
+ (long_Type,
+ new String[]
+ {
+ "name", "Long"
+ });
+
+ addXSDMapping
+ (longObjectType,
+ new String[]
+ {
+ "name", "Long:Object",
+ "baseType", "Long"
+ });
+
+ addXSDMapping
+ (monthType,
+ new String[]
+ {
+ "name", "Month"
+ });
+
+ addXSDMapping
+ (monthDayType,
+ new String[]
+ {
+ "name", "MonthDay"
+ });
+
+ addXSDMapping
+ (objectType,
+ new String[]
+ {
+ "name", "Object"
+ });
+
+ addXSDMapping
+ (short_Type,
+ new String[]
+ {
+ "name", "Short"
+ });
+
+ addXSDMapping
+ (shortObjectType,
+ new String[]
+ {
+ "name", "Short:Object",
+ "baseType", "Short"
+ });
+
+ addXSDMapping
+ (stringType,
+ new String[]
+ {
+ "name", "String"
+ });
+
+ addXSDMapping
+ (stringsType,
+ new String[]
+ {
+ "name", "Strings"
+ });
+
+ addXSDMapping
+ (timeType,
+ new String[]
+ {
+ "name", "Time"
+ });
+
+ addXSDMapping
+ (uriType,
+ new String[]
+ {
+ "name", "URI"
+ });
+
+ addXSDMapping
+ (yearType,
+ new String[]
+ {
+ "name", "Year"
+ });
+
+ addXSDMapping
+ (yearMonthType,
+ new String[]
+ {
+ "name", "YearMonth"
+ });
+
+ addXSDMapping
+ (yearMonthDayType,
+ new String[]
+ {
+ "name", "YearMonthDay"
+ });
+
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public byte[] createBase64BytesFromString(String initialValue)
+ {
+ return XMLTypeFactory.eINSTANCE.createBase64Binary(initialValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String convertBase64BytesToString(Object instanceValue)
+ {
+ if (instanceValue instanceof byte[])
+ {
+ return XMLTypeFactory.eINSTANCE.convertBase64Binary((byte[])instanceValue);
+ }
+ else
+ {
+ return XMLTypeFactory.eINSTANCE.convertBase64Binary(instanceValue.toString().getBytes());
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Boolean createBooleanFromString(String initialValue)
+ {
+ return XMLTypeFactory.eINSTANCE.createBooleanObject(initialValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String convertBooleanToString(Object instanceValue)
+ {
+ return XMLTypeFactory.eINSTANCE.convertBooleanObject((Boolean)instanceValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Boolean createBooleanObjectFromString(String initialValue)
+ {
+ return (Boolean)createBooleanFromString(initialValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String convertBooleanObjectToString(Object instanceValue)
+ {
+ return convertBooleanToString(instanceValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Byte createByteFromString(String initialValue)
+ {
+ return XMLTypeFactory.eINSTANCE.createByteObject(initialValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String convertByteToString(Object instanceValue)
+ {
+ return XMLTypeFactory.eINSTANCE.convertByteObject((Byte)instanceValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Byte createByteObjectFromString(String initialValue)
+ {
+ return (Byte)createByteFromString(initialValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String convertByteObjectToString(Object instanceValue)
+ {
+ return convertByteToString(instanceValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public byte[] createBytesFromString(String initialValue)
+ {
+ return XMLTypeFactory.eINSTANCE.createHexBinary(initialValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String convertBytesToString(Object instanceValue)
+ {
+ if (instanceValue instanceof byte[]) {
+ return XMLTypeFactory.eINSTANCE.convertHexBinary((byte[])instanceValue);
+ } else {
+ return XMLTypeFactory.eINSTANCE.convertHexBinary(instanceValue.toString().getBytes());
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public ChangeSummary createChangeSummaryTypeFromString(String initialValue)
+ {
+ return null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String convertChangeSummaryTypeToString(Object instanceValue)
+ {
+ return "change summary serialization goes here ...";
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Character createCharacterFromString(String initialValue)
+ {
+ return (initialValue == null && initialValue.length() > 0)
+ ? null : (new Character(XMLTypeUtil.normalize(initialValue, true).charAt(0)));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String convertCharacterToString(Object instanceValue)
+ {
+ return String.valueOf(((Character)instanceValue).charValue());
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Character createCharacterObjectFromString(String initialValue)
+ {
+ return (Character)createCharacterFromString(initialValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String convertCharacterObjectToString(Object instanceValue)
+ {
+ return convertCharacterToString(instanceValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Date createDateFromString(String initialValue)
+ {
+ // XMLCalendar cal = (XMLCalendar) XMLTypeFactory.eINSTANCE.createDate(initialValue);
+ // return (cal != null) ? cal.getDate() : null;
+ return DataHelper.INSTANCE.toDate(initialValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String convertDateToString(Object instanceValue)
+ {
+ if (instanceValue == null)
+ {
+ return null;
+ }
+
+ SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'.'SSS'Z'");
+ f.setTimeZone(TimeZone.getTimeZone("GMT"));
+
+ return f.format((Date)instanceValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String createDateTimeFromString(String initialValue)
+ {
+ return initialValue;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String convertDateTimeToString(Object instanceValue)
+ {
+ return (String)instanceValue;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String createDayFromString(String initialValue)
+ {
+ return initialValue;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String convertDayToString(Object instanceValue)
+ {
+ return (String)instanceValue;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public BigDecimal createDecimalFromString(String initialValue)
+ {
+ return XMLTypeFactory.eINSTANCE.createDecimal(initialValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String convertDecimalToString(Object instanceValue)
+ {
+ return XMLTypeFactory.eINSTANCE.convertDecimal((BigDecimal)instanceValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Double createDoubleFromString(String initialValue)
+ {
+ return XMLTypeFactory.eINSTANCE.createDoubleObject(initialValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String convertDoubleToString(Object instanceValue)
+ {
+ return XMLTypeFactory.eINSTANCE.convertDoubleObject((Double)instanceValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Double createDoubleObjectFromString(String initialValue)
+ {
+ return (Double)createDoubleFromString(initialValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String convertDoubleObjectToString(Object instanceValue)
+ {
+ return convertDoubleToString(instanceValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String createDurationFromString(String initialValue)
+ {
+ return initialValue;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String convertDurationToString(Object instanceValue)
+ {
+ return (String)instanceValue;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Float createFloatFromString(String initialValue)
+ {
+ return XMLTypeFactory.eINSTANCE.createFloatObject(initialValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String convertFloatToString(Object instanceValue)
+ {
+ return XMLTypeFactory.eINSTANCE.convertFloatObject((Float)instanceValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Float createFloatObjectFromString(String initialValue)
+ {
+ return (Float)createFloatFromString(initialValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String convertFloatObjectToString(Object instanceValue)
+ {
+ return convertFloatToString(instanceValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Integer createIntFromString(String initialValue)
+ {
+ return XMLTypeFactory.eINSTANCE.createIntObject(initialValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String convertIntToString(Object instanceValue)
+ {
+ return XMLTypeFactory.eINSTANCE.convertIntObject((Integer)instanceValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public BigInteger createIntegerFromString(String initialValue)
+ {
+ return XMLTypeFactory.eINSTANCE.createInteger(initialValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String convertIntegerToString(Object instanceValue)
+ {
+ return XMLTypeFactory.eINSTANCE.convertInteger((BigInteger)instanceValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Integer createIntObjectFromString(String initialValue)
+ {
+ return (Integer)createIntFromString(initialValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String convertIntObjectToString(Object instanceValue)
+ {
+ return convertIntToString(instanceValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Long createLongFromString(String initialValue)
+ {
+ return XMLTypeFactory.eINSTANCE.createLongObject(initialValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String convertLongToString(Object instanceValue)
+ {
+ return XMLTypeFactory.eINSTANCE.convertLongObject((Long)instanceValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Long createLongObjectFromString(String initialValue)
+ {
+ return (Long)createLongFromString(initialValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String convertLongObjectToString(Object instanceValue)
+ {
+ return convertLongToString(instanceValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String createMonthFromString(String initialValue)
+ {
+ return initialValue;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String convertMonthToString(Object instanceValue)
+ {
+ return (String)instanceValue;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String createMonthDayFromString(String initialValue)
+ {
+ return initialValue;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String convertMonthDayToString(Object instanceValue)
+ {
+ return (String)instanceValue;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Object createObjectFromString(String initialValue)
+ {
+ return initialValue;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String convertObjectToString(Object instanceValue)
+ {
+ return (instanceValue != null) ? instanceValue.toString() : null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Short createShortFromString(String initialValue)
+ {
+ return XMLTypeFactory.eINSTANCE.createShortObject(initialValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String convertShortToString(Object instanceValue)
+ {
+ return XMLTypeFactory.eINSTANCE.convertShortObject((Short)instanceValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Short createShortObjectFromString(String initialValue)
+ {
+ return (Short)createShortFromString(initialValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String convertShortObjectToString(Object instanceValue)
+ {
+ return convertShortToString(instanceValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String createStringFromString(String initialValue)
+ {
+ return initialValue;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String convertStringToString(Object instanceValue)
+ {
+ return (instanceValue != null) ? instanceValue.toString() : null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public List createStringsFromString(String initialValue)
+ {
+ return XMLTypeFactory.eINSTANCE.createENTITIES(initialValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String convertStringsToString(Object instanceValue)
+ {
+ return XMLTypeFactory.eINSTANCE.convertENTITIES((List)instanceValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String createTimeFromString(String initialValue)
+ {
+ return initialValue;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String convertTimeToString(Object instanceValue)
+ {
+ return (String)instanceValue;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String createURIFromString(String initialValue)
+ {
+ return initialValue;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String convertURIToString(Object instanceValue)
+ {
+ return (instanceValue != null) ? instanceValue.toString() : null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String createYearFromString(String initialValue)
+ {
+ return initialValue;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String convertYearToString(Object instanceValue)
+ {
+ return (String)instanceValue;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String createYearMonthFromString(String initialValue)
+ {
+ return initialValue;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String convertYearMonthToString(Object instanceValue)
+ {
+ return (String)instanceValue;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String createYearMonthDayFromString(String initialValue)
+ {
+ return initialValue;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String convertYearMonthDayToString(Object instanceValue)
+ {
+ return (String)instanceValue;
+ }
+
+} //ModelFactoryImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/ModelsTypeImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/ModelsTypeImpl.java
new file mode 100644
index 0000000000..0d138c96c9
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/ModelsTypeImpl.java
@@ -0,0 +1,220 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.model.impl;
+
+import commonj.sdo.Sequence;
+import commonj.sdo.Type;
+
+import org.apache.tuscany.sdo.impl.DataObjectBase;
+
+import org.apache.tuscany.sdo.model.ModelFactory;
+import org.apache.tuscany.sdo.model.ModelsType;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Models Type</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.apache.tuscany.sdo.model.impl.ModelsTypeImpl#getAny <em>Any</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class ModelsTypeImpl extends DataObjectBase implements ModelsType
+{
+
+ public final static int ANY = -1;
+
+ public final static int SDO_PROPERTY_COUNT = 0;
+
+ public final static int EXTENDED_PROPERTY_COUNT = -1;
+
+
+ /**
+ * The internal feature id for the '<em><b>Any</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_ANY = 0;
+
+ /**
+ * The number of properties for this type.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_PROPERTY_COUNT = 1;
+
+ protected int internalConvertIndex(int internalIndex)
+ {
+ switch (internalIndex)
+ {
+ case INTERNAL_ANY: return ANY;
+ }
+ return super.internalConvertIndex(internalIndex);
+ }
+
+
+ /**
+ * The cached value of the '{@link #getAny() <em>Any</em>}' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getAny()
+ * @generated
+ * @ordered
+ */
+
+ protected Sequence any = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ModelsTypeImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Type getType()
+ {
+ return ((ModelFactoryImpl)ModelFactory.INSTANCE).getModelsType();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Sequence getAny()
+ {
+ if (any == null)
+ {
+ any = createSequence(INTERNAL_ANY);
+ }
+ return any;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeContext inverseRemove(Object otherEnd, int propertyIndex, ChangeContext changeContext)
+ {
+ switch (propertyIndex)
+ {
+ case ANY:
+ return removeFromSequence(getAny(), otherEnd, changeContext);
+ }
+ return super.inverseRemove(otherEnd, propertyIndex, changeContext);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object get(int propertyIndex, boolean resolve)
+ {
+ switch (propertyIndex)
+ {
+ case ANY:
+ // XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view
+ //if (coreType)
+ return getAny();
+ }
+ return super.get(propertyIndex, resolve);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void set(int propertyIndex, Object newValue)
+ {
+ switch (propertyIndex)
+ {
+ case ANY:
+ setSequence(getAny(), newValue);
+ return;
+ }
+ super.set(propertyIndex, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unset(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case ANY:
+ unsetSequence(getAny());
+ return;
+ }
+ super.unset(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSet(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case ANY:
+ return any != null && !isSequenceEmpty(getAny());
+ }
+ return super.isSet(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString()
+ {
+ if (isProxy(this)) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (any: ");
+ result.append(any);
+ result.append(')');
+ return result.toString();
+ }
+
+} //ModelsTypeImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/PropertyImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/PropertyImpl.java
new file mode 100644
index 0000000000..015c1080b0
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/PropertyImpl.java
@@ -0,0 +1,1170 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.model.impl;
+
+import commonj.sdo.Sequence;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.tuscany.sdo.impl.DataObjectBase;
+
+import org.apache.tuscany.sdo.model.ModelFactory;
+import org.apache.tuscany.sdo.model.Property;
+import org.apache.tuscany.sdo.model.Type;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Property</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.apache.tuscany.sdo.model.impl.PropertyImpl#getAliasName <em>Alias Name</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.model.impl.PropertyImpl#getAny <em>Any</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.model.impl.PropertyImpl#getName <em>Name</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.model.impl.PropertyImpl#isMany <em>Many</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.model.impl.PropertyImpl#isContainment <em>Containment</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.model.impl.PropertyImpl#getDefault <em>Default</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.model.impl.PropertyImpl#isReadOnly <em>Read Only</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.model.impl.PropertyImpl#getType_ <em>Type</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.model.impl.PropertyImpl#getOpposite <em>Opposite</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.model.impl.PropertyImpl#isNullable <em>Nullable</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.model.impl.PropertyImpl#getAnyAttribute <em>Any Attribute</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class PropertyImpl extends DataObjectBase implements Property
+{
+
+ public final static int ALIAS_NAME = 0;
+
+ public final static int ANY = -1;
+
+ public final static int NAME = 1;
+
+ public final static int MANY = 2;
+
+ public final static int CONTAINMENT = 3;
+
+ public final static int DEFAULT = 4;
+
+ public final static int READ_ONLY = 5;
+
+ public final static int TYPE = 6;
+
+ public final static int OPPOSITE = 7;
+
+ public final static int NULLABLE = 8;
+
+ public final static int ANY_ATTRIBUTE = -2;
+
+ public final static int SDO_PROPERTY_COUNT = 9;
+
+ public final static int EXTENDED_PROPERTY_COUNT = -2;
+
+
+ /**
+ * The internal feature id for the '<em><b>Alias Name</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_ALIAS_NAME = 0;
+
+ /**
+ * The internal feature id for the '<em><b>Any</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_ANY = 1;
+
+ /**
+ * The internal feature id for the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_NAME = 2;
+
+ /**
+ * The internal feature id for the '<em><b>Many</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_MANY = 3;
+
+ /**
+ * The internal feature id for the '<em><b>Containment</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_CONTAINMENT = 4;
+
+ /**
+ * The internal feature id for the '<em><b>Default</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_DEFAULT = 5;
+
+ /**
+ * The internal feature id for the '<em><b>Read Only</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_READ_ONLY = 6;
+
+ /**
+ * The internal feature id for the '<em><b>Type</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_TYPE = 7;
+
+ /**
+ * The internal feature id for the '<em><b>Opposite</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_OPPOSITE = 8;
+
+ /**
+ * The internal feature id for the '<em><b>Nullable</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_NULLABLE = 9;
+
+ /**
+ * The internal feature id for the '<em><b>Any Attribute</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_ANY_ATTRIBUTE = 10;
+
+ /**
+ * The number of properties for this type.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_PROPERTY_COUNT = 11;
+
+ protected int internalConvertIndex(int internalIndex)
+ {
+ switch (internalIndex)
+ {
+ case INTERNAL_ALIAS_NAME: return ALIAS_NAME;
+ case INTERNAL_ANY: return ANY;
+ case INTERNAL_NAME: return NAME;
+ case INTERNAL_MANY: return MANY;
+ case INTERNAL_CONTAINMENT: return CONTAINMENT;
+ case INTERNAL_DEFAULT: return DEFAULT;
+ case INTERNAL_READ_ONLY: return READ_ONLY;
+ case INTERNAL_TYPE: return TYPE;
+ case INTERNAL_OPPOSITE: return OPPOSITE;
+ case INTERNAL_NULLABLE: return NULLABLE;
+ case INTERNAL_ANY_ATTRIBUTE: return ANY_ATTRIBUTE;
+ }
+ return super.internalConvertIndex(internalIndex);
+ }
+
+
+ /**
+ * The cached value of the '{@link #getAliasName() <em>Alias Name</em>}' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getAliasName()
+ * @generated
+ * @ordered
+ */
+
+ protected List aliasName = null;
+
+ /**
+ * The cached value of the '{@link #getAny() <em>Any</em>}' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getAny()
+ * @generated
+ * @ordered
+ */
+
+ protected Sequence any = null;
+
+ /**
+ * The default value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected static final String NAME_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected String name = NAME_DEFAULT_;
+
+ /**
+ * This is true if the Name attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean name_set_ = false;
+
+ /**
+ * The default value of the '{@link #isMany() <em>Many</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isMany()
+ * @generated
+ * @ordered
+ */
+ protected static final boolean MANY_DEFAULT_ = false;
+
+ /**
+ * The cached value of the '{@link #isMany() <em>Many</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isMany()
+ * @generated
+ * @ordered
+ */
+ protected boolean many = MANY_DEFAULT_;
+
+ /**
+ * This is true if the Many attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean many_set_ = false;
+
+ /**
+ * The default value of the '{@link #isContainment() <em>Containment</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isContainment()
+ * @generated
+ * @ordered
+ */
+ protected static final boolean CONTAINMENT_DEFAULT_ = false;
+
+ /**
+ * The cached value of the '{@link #isContainment() <em>Containment</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isContainment()
+ * @generated
+ * @ordered
+ */
+ protected boolean containment = CONTAINMENT_DEFAULT_;
+
+ /**
+ * This is true if the Containment attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean containment_set_ = false;
+
+ /**
+ * The default value of the '{@link #getDefault_() <em>Default</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getDefault_()
+ * @generated
+ * @ordered
+ */
+ protected static final String DEFAULT_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getDefault_() <em>Default</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getDefault_()
+ * @generated
+ * @ordered
+ */
+ protected String default_ = DEFAULT_DEFAULT_;
+
+ /**
+ * This is true if the Default attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean default_set_ = false;
+
+ /**
+ * The default value of the '{@link #isReadOnly() <em>Read Only</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isReadOnly()
+ * @generated
+ * @ordered
+ */
+ protected static final boolean READ_ONLY_DEFAULT_ = false;
+
+ /**
+ * The cached value of the '{@link #isReadOnly() <em>Read Only</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isReadOnly()
+ * @generated
+ * @ordered
+ */
+ protected boolean readOnly = READ_ONLY_DEFAULT_;
+
+ /**
+ * This is true if the Read Only attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean readOnly_set_ = false;
+
+ /**
+ * The cached value of the '{@link #getType_() <em>Type</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getType_()
+ * @generated
+ * @ordered
+ */
+
+ protected Type type = null;
+
+ /**
+ * This is true if the Type reference has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean type_set_ = false;
+
+ /**
+ * The cached value of the '{@link #getOpposite_() <em>Opposite</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getOpposite_()
+ * @generated
+ * @ordered
+ */
+
+ protected Property opposite = null;
+
+ /**
+ * This is true if the Opposite reference has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean opposite_set_ = false;
+
+ /**
+ * The default value of the '{@link #isNullable() <em>Nullable</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isNullable()
+ * @generated
+ * @ordered
+ */
+ protected static final boolean NULLABLE_DEFAULT_ = false;
+
+ /**
+ * The cached value of the '{@link #isNullable() <em>Nullable</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isNullable()
+ * @generated
+ * @ordered
+ */
+ protected boolean nullable = NULLABLE_DEFAULT_;
+
+ /**
+ * This is true if the Nullable attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean nullable_set_ = false;
+
+ /**
+ * The cached value of the '{@link #getAnyAttribute() <em>Any Attribute</em>}' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getAnyAttribute()
+ * @generated
+ * @ordered
+ */
+
+ protected Sequence anyAttribute = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public PropertyImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public commonj.sdo.Type getType()
+ {
+ return ((ModelFactoryImpl)ModelFactory.INSTANCE).getProperty();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public List getAliasName()
+ {
+ if (aliasName == null)
+ {
+ aliasName = createPropertyList(ListKind.DATATYPE, String.class, ALIAS_NAME, 0);
+ }
+ return aliasName;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Sequence getAny()
+ {
+ if (any == null)
+ {
+ any = createSequence(INTERNAL_ANY);
+ }
+ return any;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getName()
+ {
+ return name;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setName(String newName)
+ {
+ String oldName = name;
+ name = newName;
+ boolean oldName_set_ = name_set_;
+ name_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, NAME, oldName, name, !oldName_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetName()
+ {
+ String oldName = name;
+ boolean oldName_set_ = name_set_;
+ name = NAME_DEFAULT_;
+ name_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, NAME, oldName, NAME_DEFAULT_, oldName_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetName()
+ {
+ return name_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isMany()
+ {
+ return many;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setMany(boolean newMany)
+ {
+ boolean oldMany = many;
+ many = newMany;
+ boolean oldMany_set_ = many_set_;
+ many_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, MANY, oldMany, many, !oldMany_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetMany()
+ {
+ boolean oldMany = many;
+ boolean oldMany_set_ = many_set_;
+ many = MANY_DEFAULT_;
+ many_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, MANY, oldMany, MANY_DEFAULT_, oldMany_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetMany()
+ {
+ return many_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isContainment()
+ {
+ return containment;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setContainment(boolean newContainment)
+ {
+ boolean oldContainment = containment;
+ containment = newContainment;
+ boolean oldContainment_set_ = containment_set_;
+ containment_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, CONTAINMENT, oldContainment, containment, !oldContainment_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetContainment()
+ {
+ boolean oldContainment = containment;
+ boolean oldContainment_set_ = containment_set_;
+ containment = CONTAINMENT_DEFAULT_;
+ containment_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, CONTAINMENT, oldContainment, CONTAINMENT_DEFAULT_, oldContainment_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetContainment()
+ {
+ return containment_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getDefault_()
+ {
+ return default_;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setDefault_(String newDefault)
+ {
+ String oldDefault = default_;
+ default_ = newDefault;
+ boolean oldDefault_set_ = default_set_;
+ default_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, DEFAULT, oldDefault, default_, !oldDefault_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetDefault()
+ {
+ String oldDefault = default_;
+ boolean oldDefault_set_ = default_set_;
+ default_ = DEFAULT_DEFAULT_;
+ default_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, DEFAULT, oldDefault, DEFAULT_DEFAULT_, oldDefault_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetDefault()
+ {
+ return default_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isReadOnly()
+ {
+ return readOnly;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setReadOnly(boolean newReadOnly)
+ {
+ boolean oldReadOnly = readOnly;
+ readOnly = newReadOnly;
+ boolean oldReadOnly_set_ = readOnly_set_;
+ readOnly_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, READ_ONLY, oldReadOnly, readOnly, !oldReadOnly_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetReadOnly()
+ {
+ boolean oldReadOnly = readOnly;
+ boolean oldReadOnly_set_ = readOnly_set_;
+ readOnly = READ_ONLY_DEFAULT_;
+ readOnly_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, READ_ONLY, oldReadOnly, READ_ONLY_DEFAULT_, oldReadOnly_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetReadOnly()
+ {
+ return readOnly_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Type getType_()
+ {
+ if (type != null && isProxy(type))
+ {
+ Object oldType = type;
+ type = (Type)resolveProxy(oldType);
+ if (type != oldType)
+ {
+ if (isNotifying())
+ notify(ChangeKind.RESOLVE, TYPE, oldType, type);
+ }
+ }
+ return type;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Type basicGetType()
+ {
+ return type;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setType(Type newType)
+ {
+ Type oldType = type;
+ type = newType;
+ boolean oldType_set_ = type_set_;
+ type_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, TYPE, oldType, type, !oldType_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetType()
+ {
+ Type oldType = type;
+ boolean oldType_set_ = type_set_;
+ type = null;
+ type_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, TYPE, oldType, null, oldType_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetType()
+ {
+ return type_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Property getOpposite_()
+ {
+ if (opposite != null && isProxy(opposite))
+ {
+ Object oldOpposite = opposite;
+ opposite = (Property)resolveProxy(oldOpposite);
+ if (opposite != oldOpposite)
+ {
+ if (isNotifying())
+ notify(ChangeKind.RESOLVE, OPPOSITE, oldOpposite, opposite);
+ }
+ }
+ return opposite;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Property basicGetOpposite()
+ {
+ return opposite;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setOpposite_(Property newOpposite)
+ {
+ Property oldOpposite = opposite;
+ opposite = newOpposite;
+ boolean oldOpposite_set_ = opposite_set_;
+ opposite_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, OPPOSITE, oldOpposite, opposite, !oldOpposite_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetOpposite()
+ {
+ Property oldOpposite = opposite;
+ boolean oldOpposite_set_ = opposite_set_;
+ opposite = null;
+ opposite_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, OPPOSITE, oldOpposite, null, oldOpposite_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetOpposite()
+ {
+ return opposite_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isNullable()
+ {
+ return nullable;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setNullable(boolean newNullable)
+ {
+ boolean oldNullable = nullable;
+ nullable = newNullable;
+ boolean oldNullable_set_ = nullable_set_;
+ nullable_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, NULLABLE, oldNullable, nullable, !oldNullable_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetNullable()
+ {
+ boolean oldNullable = nullable;
+ boolean oldNullable_set_ = nullable_set_;
+ nullable = NULLABLE_DEFAULT_;
+ nullable_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, NULLABLE, oldNullable, NULLABLE_DEFAULT_, oldNullable_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetNullable()
+ {
+ return nullable_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Sequence getAnyAttribute()
+ {
+ if (anyAttribute == null)
+ {
+ anyAttribute = createSequence(INTERNAL_ANY_ATTRIBUTE);
+ }
+ return anyAttribute;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeContext inverseRemove(Object otherEnd, int propertyIndex, ChangeContext changeContext)
+ {
+ switch (propertyIndex)
+ {
+ case ANY:
+ return removeFromSequence(getAny(), otherEnd, changeContext);
+ case ANY_ATTRIBUTE:
+ return removeFromSequence(getAnyAttribute(), otherEnd, changeContext);
+ }
+ return super.inverseRemove(otherEnd, propertyIndex, changeContext);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object get(int propertyIndex, boolean resolve)
+ {
+ switch (propertyIndex)
+ {
+ case ALIAS_NAME:
+ return getAliasName();
+ case ANY:
+ // XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view
+ //if (coreType)
+ return getAny();
+ case NAME:
+ return getName();
+ case MANY:
+ return isMany() ? Boolean.TRUE : Boolean.FALSE;
+ case CONTAINMENT:
+ return isContainment() ? Boolean.TRUE : Boolean.FALSE;
+ case DEFAULT:
+ return getDefault_();
+ case READ_ONLY:
+ return isReadOnly() ? Boolean.TRUE : Boolean.FALSE;
+ case TYPE:
+ if (resolve) return getType_();
+ return basicGetType();
+ case OPPOSITE:
+ if (resolve) return getOpposite_();
+ return basicGetOpposite();
+ case NULLABLE:
+ return isNullable() ? Boolean.TRUE : Boolean.FALSE;
+ case ANY_ATTRIBUTE:
+ // XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view
+ //if (coreType)
+ return getAnyAttribute();
+ }
+ return super.get(propertyIndex, resolve);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void set(int propertyIndex, Object newValue)
+ {
+ switch (propertyIndex)
+ {
+ case ALIAS_NAME:
+ getAliasName().clear();
+ getAliasName().addAll((Collection)newValue);
+ return;
+ case ANY:
+ setSequence(getAny(), newValue);
+ return;
+ case NAME:
+ setName((String)newValue);
+ return;
+ case MANY:
+ setMany(((Boolean)newValue).booleanValue());
+ return;
+ case CONTAINMENT:
+ setContainment(((Boolean)newValue).booleanValue());
+ return;
+ case DEFAULT:
+ setDefault_((String)newValue);
+ return;
+ case READ_ONLY:
+ setReadOnly(((Boolean)newValue).booleanValue());
+ return;
+ case TYPE:
+ setType((Type)newValue);
+ return;
+ case OPPOSITE:
+ setOpposite_((Property)newValue);
+ return;
+ case NULLABLE:
+ setNullable(((Boolean)newValue).booleanValue());
+ return;
+ case ANY_ATTRIBUTE:
+ setSequence(getAnyAttribute(), newValue);
+ return;
+ }
+ super.set(propertyIndex, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unset(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case ALIAS_NAME:
+ getAliasName().clear();
+ return;
+ case ANY:
+ unsetSequence(getAny());
+ return;
+ case NAME:
+ unsetName();
+ return;
+ case MANY:
+ unsetMany();
+ return;
+ case CONTAINMENT:
+ unsetContainment();
+ return;
+ case DEFAULT:
+ unsetDefault();
+ return;
+ case READ_ONLY:
+ unsetReadOnly();
+ return;
+ case TYPE:
+ unsetType();
+ return;
+ case OPPOSITE:
+ unsetOpposite();
+ return;
+ case NULLABLE:
+ unsetNullable();
+ return;
+ case ANY_ATTRIBUTE:
+ unsetSequence(getAnyAttribute());
+ return;
+ }
+ super.unset(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSet(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case ALIAS_NAME:
+ return aliasName != null && !aliasName.isEmpty();
+ case ANY:
+ return any != null && !isSequenceEmpty(getAny());
+ case NAME:
+ return isSetName();
+ case MANY:
+ return isSetMany();
+ case CONTAINMENT:
+ return isSetContainment();
+ case DEFAULT:
+ return isSetDefault();
+ case READ_ONLY:
+ return isSetReadOnly();
+ case TYPE:
+ return isSetType();
+ case OPPOSITE:
+ return isSetOpposite();
+ case NULLABLE:
+ return isSetNullable();
+ case ANY_ATTRIBUTE:
+ return anyAttribute != null && !isSequenceEmpty(getAnyAttribute());
+ }
+ return super.isSet(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString()
+ {
+ if (isProxy(this)) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (aliasName: ");
+ result.append(aliasName);
+ result.append(", any: ");
+ result.append(any);
+ result.append(", name: ");
+ if (name_set_) result.append(name); else result.append("<unset>");
+ result.append(", many: ");
+ if (many_set_) result.append(many); else result.append("<unset>");
+ result.append(", containment: ");
+ if (containment_set_) result.append(containment); else result.append("<unset>");
+ result.append(", default: ");
+ if (default_set_) result.append(default_); else result.append("<unset>");
+ result.append(", readOnly: ");
+ if (readOnly_set_) result.append(readOnly); else result.append("<unset>");
+ result.append(", nullable: ");
+ if (nullable_set_) result.append(nullable); else result.append("<unset>");
+ result.append(", anyAttribute: ");
+ result.append(anyAttribute);
+ result.append(')');
+ return result.toString();
+ }
+
+} //PropertyImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/TextTypeImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/TextTypeImpl.java
new file mode 100644
index 0000000000..ca2f56240e
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/TextTypeImpl.java
@@ -0,0 +1,206 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.model.impl;
+
+import commonj.sdo.Type;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.tuscany.sdo.impl.DataObjectBase;
+
+import org.apache.tuscany.sdo.model.ModelFactory;
+import org.apache.tuscany.sdo.model.TextType;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Text Type</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.apache.tuscany.sdo.model.impl.TextTypeImpl#getText <em>Text</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public abstract class TextTypeImpl extends DataObjectBase implements TextType
+{
+
+ public final static int TEXT = 0;
+
+ public final static int SDO_PROPERTY_COUNT = 1;
+
+ public final static int EXTENDED_PROPERTY_COUNT = 0;
+
+
+ /**
+ * The internal feature id for the '<em><b>Text</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_TEXT = 0;
+
+ /**
+ * The number of properties for this type.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_PROPERTY_COUNT = 1;
+
+ protected int internalConvertIndex(int internalIndex)
+ {
+ switch (internalIndex)
+ {
+ case INTERNAL_TEXT: return TEXT;
+ }
+ return super.internalConvertIndex(internalIndex);
+ }
+
+
+ /**
+ * The cached value of the '{@link #getText() <em>Text</em>}' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getText()
+ * @generated
+ * @ordered
+ */
+
+ protected List text = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public TextTypeImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Type getType()
+ {
+ return ((ModelFactoryImpl)ModelFactory.INSTANCE).getTextType();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public List getText()
+ {
+ if (text == null)
+ {
+ text = createPropertyList(ListKind.DATATYPE, String.class, TEXT, 0);
+ }
+ return text;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object get(int propertyIndex, boolean resolve)
+ {
+ switch (propertyIndex)
+ {
+ case TEXT:
+ return getText();
+ }
+ return super.get(propertyIndex, resolve);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void set(int propertyIndex, Object newValue)
+ {
+ switch (propertyIndex)
+ {
+ case TEXT:
+ getText().clear();
+ getText().addAll((Collection)newValue);
+ return;
+ }
+ super.set(propertyIndex, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unset(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case TEXT:
+ getText().clear();
+ return;
+ }
+ super.unset(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSet(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case TEXT:
+ return text != null && !text.isEmpty();
+ }
+ return super.isSet(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString()
+ {
+ if (isProxy(this)) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (text: ");
+ result.append(text);
+ result.append(')');
+ return result.toString();
+ }
+
+} //TextTypeImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/TypeImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/TypeImpl.java
new file mode 100644
index 0000000000..65448153b1
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/TypeImpl.java
@@ -0,0 +1,1067 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.model.impl;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.tuscany.sdo.impl.DataObjectBase;
+import org.apache.tuscany.sdo.model.ModelFactory;
+import org.apache.tuscany.sdo.model.Property;
+import org.apache.tuscany.sdo.model.Type;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.util.BasicExtendedMetaData;
+
+import commonj.sdo.Sequence;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Type</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.apache.tuscany.sdo.model.impl.TypeImpl#getBaseType <em>Base Type</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.model.impl.TypeImpl#getProperty <em>Property</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.model.impl.TypeImpl#getAliasName <em>Alias Name</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.model.impl.TypeImpl#getAny <em>Any</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.model.impl.TypeImpl#getName <em>Name</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.model.impl.TypeImpl#getUri <em>Uri</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.model.impl.TypeImpl#isDataType <em>Data Type</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.model.impl.TypeImpl#isOpen <em>Open</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.model.impl.TypeImpl#isSequenced <em>Sequenced</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.model.impl.TypeImpl#isAbstract <em>Abstract</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.model.impl.TypeImpl#getAnyAttribute <em>Any Attribute</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class TypeImpl extends DataObjectBase implements Type
+{
+
+ public final static int BASE_TYPE = 0;
+
+ public final static int PROPERTY = 1;
+
+ public final static int ALIAS_NAME = 2;
+
+ public final static int ANY = -1;
+
+ public final static int NAME = 3;
+
+ public final static int URI = 4;
+
+ public final static int DATA_TYPE = 5;
+
+ public final static int OPEN = 6;
+
+ public final static int SEQUENCED = 7;
+
+ public final static int ABSTRACT = 8;
+
+ public final static int ANY_ATTRIBUTE = -2;
+
+ public final static int SDO_PROPERTY_COUNT = 9;
+
+ public final static int EXTENDED_PROPERTY_COUNT = -2;
+
+
+ /**
+ * The internal feature id for the '<em><b>Base Type</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_BASE_TYPE = 0;
+
+ /**
+ * The internal feature id for the '<em><b>Property</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_PROPERTY = 1;
+
+ /**
+ * The internal feature id for the '<em><b>Alias Name</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_ALIAS_NAME = 2;
+
+ /**
+ * The internal feature id for the '<em><b>Any</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_ANY = 3;
+
+ /**
+ * The internal feature id for the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_NAME = 4;
+
+ /**
+ * The internal feature id for the '<em><b>Uri</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_URI = 5;
+
+ /**
+ * The internal feature id for the '<em><b>Data Type</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_DATA_TYPE = 6;
+
+ /**
+ * The internal feature id for the '<em><b>Open</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_OPEN = 7;
+
+ /**
+ * The internal feature id for the '<em><b>Sequenced</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_SEQUENCED = 8;
+
+ /**
+ * The internal feature id for the '<em><b>Abstract</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_ABSTRACT = 9;
+
+ /**
+ * The internal feature id for the '<em><b>Any Attribute</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_ANY_ATTRIBUTE = 10;
+
+ /**
+ * The number of properties for this type.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_PROPERTY_COUNT = 11;
+
+ protected int internalConvertIndex(int internalIndex)
+ {
+ switch (internalIndex)
+ {
+ case INTERNAL_BASE_TYPE: return BASE_TYPE;
+ case INTERNAL_PROPERTY: return PROPERTY;
+ case INTERNAL_ALIAS_NAME: return ALIAS_NAME;
+ case INTERNAL_ANY: return ANY;
+ case INTERNAL_NAME: return NAME;
+ case INTERNAL_URI: return URI;
+ case INTERNAL_DATA_TYPE: return DATA_TYPE;
+ case INTERNAL_OPEN: return OPEN;
+ case INTERNAL_SEQUENCED: return SEQUENCED;
+ case INTERNAL_ABSTRACT: return ABSTRACT;
+ case INTERNAL_ANY_ATTRIBUTE: return ANY_ATTRIBUTE;
+ }
+ return super.internalConvertIndex(internalIndex);
+ }
+
+
+ /**
+ * The cached value of the '{@link #getBaseType() <em>Base Type</em>}' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getBaseType()
+ * @generated
+ * @ordered
+ */
+
+ protected List baseType = null;
+
+ /**
+ * The cached value of the '{@link #getProperty() <em>Property</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getProperty()
+ * @generated
+ * @ordered
+ */
+
+ protected List property = null;
+
+ /**
+ * The cached value of the '{@link #getAliasName() <em>Alias Name</em>}' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getAliasName()
+ * @generated
+ * @ordered
+ */
+
+ protected List aliasName = null;
+
+ /**
+ * The cached value of the '{@link #getAny() <em>Any</em>}' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getAny()
+ * @generated
+ * @ordered
+ */
+
+ protected Sequence any = null;
+
+ /**
+ * The default value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected static final String NAME_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected String name = NAME_DEFAULT_;
+
+ /**
+ * This is true if the Name attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean name_set_ = false;
+
+ /**
+ * The default value of the '{@link #getUri() <em>Uri</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getUri()
+ * @generated
+ * @ordered
+ */
+ protected static final String URI_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getUri() <em>Uri</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getUri()
+ * @generated
+ * @ordered
+ */
+ protected String uri = URI_DEFAULT_;
+
+ /**
+ * This is true if the Uri attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean uri_set_ = false;
+
+ /**
+ * The default value of the '{@link #isDataType() <em>Data Type</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isDataType()
+ * @generated
+ * @ordered
+ */
+ protected static final boolean DATA_TYPE_DEFAULT_ = false;
+
+ /**
+ * The cached value of the '{@link #isDataType() <em>Data Type</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isDataType()
+ * @generated
+ * @ordered
+ */
+ protected boolean dataType = DATA_TYPE_DEFAULT_;
+
+ /**
+ * This is true if the Data Type attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean dataType_set_ = false;
+
+ /**
+ * The default value of the '{@link #isOpen() <em>Open</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isOpen()
+ * @generated
+ * @ordered
+ */
+ protected static final boolean OPEN_DEFAULT_ = false;
+
+ /**
+ * The cached value of the '{@link #isOpen() <em>Open</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isOpen()
+ * @generated
+ * @ordered
+ */
+ protected boolean open = OPEN_DEFAULT_;
+
+ /**
+ * This is true if the Open attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean open_set_ = false;
+
+ /**
+ * The default value of the '{@link #isSequenced() <em>Sequenced</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSequenced()
+ * @generated
+ * @ordered
+ */
+ protected static final boolean SEQUENCED_DEFAULT_ = false;
+
+ /**
+ * The cached value of the '{@link #isSequenced() <em>Sequenced</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSequenced()
+ * @generated
+ * @ordered
+ */
+ protected boolean sequenced = SEQUENCED_DEFAULT_;
+
+ /**
+ * This is true if the Sequenced attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean sequenced_set_ = false;
+
+ /**
+ * The default value of the '{@link #isAbstract() <em>Abstract</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isAbstract()
+ * @generated
+ * @ordered
+ */
+ protected static final boolean ABSTRACT_DEFAULT_ = false;
+
+ /**
+ * The cached value of the '{@link #isAbstract() <em>Abstract</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isAbstract()
+ * @generated
+ * @ordered
+ */
+ protected boolean abstract_ = ABSTRACT_DEFAULT_;
+
+ /**
+ * This is true if the Abstract attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean abstract_set_ = false;
+
+ /**
+ * The cached value of the '{@link #getAnyAttribute() <em>Any Attribute</em>}' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getAnyAttribute()
+ * @generated
+ * @ordered
+ */
+
+ protected Sequence anyAttribute = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public TypeImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public commonj.sdo.Type getType()
+ {
+ return ((ModelFactoryImpl)ModelFactory.INSTANCE).getType();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public List getBaseType()
+ {
+ if (baseType == null)
+ {
+ baseType = createPropertyList(ListKind.NONCONTAINMENT_RESOLVING, Type.class, BASE_TYPE, 0);
+ }
+ return baseType;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public List getProperty()
+ {
+ if (property == null)
+ {
+ property = createPropertyList(ListKind.CONTAINMENT, Property.class, PROPERTY, 0);
+ }
+ return property;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public List getAliasName()
+ {
+ if (aliasName == null)
+ {
+ aliasName = createPropertyList(ListKind.DATATYPE, String.class, ALIAS_NAME, 0);
+ }
+ return aliasName;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Sequence getAny()
+ {
+ if (any == null)
+ {
+ any = createSequence(INTERNAL_ANY);
+ }
+ return any;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getName()
+ {
+ return name;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setName(String newName)
+ {
+ String oldName = name;
+ name = newName;
+ boolean oldName_set_ = name_set_;
+ name_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, NAME, oldName, name, !oldName_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetName()
+ {
+ String oldName = name;
+ boolean oldName_set_ = name_set_;
+ name = NAME_DEFAULT_;
+ name_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, NAME, oldName, NAME_DEFAULT_, oldName_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetName()
+ {
+ return name_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getUri()
+ {
+ return uri;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setUri(String newUri)
+ {
+ String oldUri = uri;
+ uri = newUri;
+ boolean oldUri_set_ = uri_set_;
+ uri_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, URI, oldUri, uri, !oldUri_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetUri()
+ {
+ String oldUri = uri;
+ boolean oldUri_set_ = uri_set_;
+ uri = URI_DEFAULT_;
+ uri_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, URI, oldUri, URI_DEFAULT_, oldUri_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetUri()
+ {
+ return uri_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isDataType()
+ {
+ return dataType;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setDataType(boolean newDataType)
+ {
+ boolean oldDataType = dataType;
+ dataType = newDataType;
+ boolean oldDataType_set_ = dataType_set_;
+ dataType_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, DATA_TYPE, oldDataType, dataType, !oldDataType_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetDataType()
+ {
+ boolean oldDataType = dataType;
+ boolean oldDataType_set_ = dataType_set_;
+ dataType = DATA_TYPE_DEFAULT_;
+ dataType_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, DATA_TYPE, oldDataType, DATA_TYPE_DEFAULT_, oldDataType_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetDataType()
+ {
+ return dataType_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isOpen()
+ {
+ return open;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setOpen(boolean newOpen)
+ {
+ boolean oldOpen = open;
+ open = newOpen;
+ boolean oldOpen_set_ = open_set_;
+ open_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, OPEN, oldOpen, open, !oldOpen_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetOpen()
+ {
+ boolean oldOpen = open;
+ boolean oldOpen_set_ = open_set_;
+ open = OPEN_DEFAULT_;
+ open_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, OPEN, oldOpen, OPEN_DEFAULT_, oldOpen_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetOpen()
+ {
+ return open_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSequenced()
+ {
+ return sequenced;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setSequenced(boolean newSequenced)
+ {
+ boolean oldSequenced = sequenced;
+ sequenced = newSequenced;
+ boolean oldSequenced_set_ = sequenced_set_;
+ sequenced_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, SEQUENCED, oldSequenced, sequenced, !oldSequenced_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetSequenced()
+ {
+ boolean oldSequenced = sequenced;
+ boolean oldSequenced_set_ = sequenced_set_;
+ sequenced = SEQUENCED_DEFAULT_;
+ sequenced_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, SEQUENCED, oldSequenced, SEQUENCED_DEFAULT_, oldSequenced_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetSequenced()
+ {
+ return sequenced_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isAbstract()
+ {
+ return abstract_;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setAbstract(boolean newAbstract)
+ {
+ boolean oldAbstract = abstract_;
+ abstract_ = newAbstract;
+ boolean oldAbstract_set_ = abstract_set_;
+ abstract_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, ABSTRACT, oldAbstract, abstract_, !oldAbstract_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetAbstract()
+ {
+ boolean oldAbstract = abstract_;
+ boolean oldAbstract_set_ = abstract_set_;
+ abstract_ = ABSTRACT_DEFAULT_;
+ abstract_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, ABSTRACT, oldAbstract, ABSTRACT_DEFAULT_, oldAbstract_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetAbstract()
+ {
+ return abstract_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Sequence getAnyAttribute()
+ {
+ if (anyAttribute == null)
+ {
+ anyAttribute = createSequence(INTERNAL_ANY_ATTRIBUTE);
+ }
+ return anyAttribute;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeContext inverseRemove(Object otherEnd, int propertyIndex, ChangeContext changeContext)
+ {
+ switch (propertyIndex)
+ {
+ case PROPERTY:
+ return removeFromList(getProperty(), otherEnd, changeContext);
+ case ANY:
+ return removeFromSequence(getAny(), otherEnd, changeContext);
+ case ANY_ATTRIBUTE:
+ return removeFromSequence(getAnyAttribute(), otherEnd, changeContext);
+ }
+ return super.inverseRemove(otherEnd, propertyIndex, changeContext);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object get(int propertyIndex, boolean resolve)
+ {
+ switch (propertyIndex)
+ {
+ case BASE_TYPE:
+ return getBaseType();
+ case PROPERTY:
+ return getProperty();
+ case ALIAS_NAME:
+ return getAliasName();
+ case ANY:
+ // XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view
+ //if (coreType)
+ return getAny();
+ case NAME:
+ return getName();
+ case URI:
+ return getUri();
+ case DATA_TYPE:
+ return isDataType() ? Boolean.TRUE : Boolean.FALSE;
+ case OPEN:
+ return isOpen() ? Boolean.TRUE : Boolean.FALSE;
+ case SEQUENCED:
+ return isSequenced() ? Boolean.TRUE : Boolean.FALSE;
+ case ABSTRACT:
+ return isAbstract() ? Boolean.TRUE : Boolean.FALSE;
+ case ANY_ATTRIBUTE:
+ // XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view
+ //if (coreType)
+ return getAnyAttribute();
+ }
+ return super.get(propertyIndex, resolve);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void set(int propertyIndex, Object newValue)
+ {
+ switch (propertyIndex)
+ {
+ case BASE_TYPE:
+ getBaseType().clear();
+ getBaseType().addAll((Collection)newValue);
+ return;
+ case PROPERTY:
+ getProperty().clear();
+ getProperty().addAll((Collection)newValue);
+ return;
+ case ALIAS_NAME:
+ getAliasName().clear();
+ getAliasName().addAll((Collection)newValue);
+ return;
+ case ANY:
+ setSequence(getAny(), newValue);
+ return;
+ case NAME:
+ setName((String)newValue);
+ return;
+ case URI:
+ setUri((String)newValue);
+ return;
+ case DATA_TYPE:
+ setDataType(((Boolean)newValue).booleanValue());
+ return;
+ case OPEN:
+ setOpen(((Boolean)newValue).booleanValue());
+ return;
+ case SEQUENCED:
+ setSequenced(((Boolean)newValue).booleanValue());
+ return;
+ case ABSTRACT:
+ setAbstract(((Boolean)newValue).booleanValue());
+ return;
+ case ANY_ATTRIBUTE:
+ setSequence(getAnyAttribute(), newValue);
+ return;
+ }
+ super.set(propertyIndex, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unset(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case BASE_TYPE:
+ getBaseType().clear();
+ return;
+ case PROPERTY:
+ getProperty().clear();
+ return;
+ case ALIAS_NAME:
+ getAliasName().clear();
+ return;
+ case ANY:
+ unsetSequence(getAny());
+ return;
+ case NAME:
+ unsetName();
+ return;
+ case URI:
+ unsetUri();
+ return;
+ case DATA_TYPE:
+ unsetDataType();
+ return;
+ case OPEN:
+ unsetOpen();
+ return;
+ case SEQUENCED:
+ unsetSequenced();
+ return;
+ case ABSTRACT:
+ unsetAbstract();
+ return;
+ case ANY_ATTRIBUTE:
+ unsetSequence(getAnyAttribute());
+ return;
+ }
+ super.unset(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSet(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case BASE_TYPE:
+ return baseType != null && !baseType.isEmpty();
+ case PROPERTY:
+ return property != null && !property.isEmpty();
+ case ALIAS_NAME:
+ return aliasName != null && !aliasName.isEmpty();
+ case ANY:
+ return any != null && !isSequenceEmpty(getAny());
+ case NAME:
+ return isSetName();
+ case URI:
+ return isSetUri();
+ case DATA_TYPE:
+ return isSetDataType();
+ case OPEN:
+ return isSetOpen();
+ case SEQUENCED:
+ return isSetSequenced();
+ case ABSTRACT:
+ return isSetAbstract();
+ case ANY_ATTRIBUTE:
+ return anyAttribute != null && !isSequenceEmpty(getAnyAttribute());
+ }
+ return super.isSet(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString()
+ {
+ if (isProxy(this)) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (aliasName: ");
+ result.append(aliasName);
+ result.append(", any: ");
+ result.append(any);
+ result.append(", name: ");
+ if (name_set_) result.append(name); else result.append("<unset>");
+ result.append(", uri: ");
+ if (uri_set_) result.append(uri); else result.append("<unset>");
+ result.append(", dataType: ");
+ if (dataType_set_) result.append(dataType); else result.append("<unset>");
+ result.append(", open: ");
+ if (open_set_) result.append(open); else result.append("<unset>");
+ result.append(", sequenced: ");
+ if (sequenced_set_) result.append(sequenced); else result.append("<unset>");
+ result.append(", abstract: ");
+ if (abstract_set_) result.append(abstract_); else result.append("<unset>");
+ result.append(", anyAttribute: ");
+ result.append(anyAttribute);
+ result.append(')');
+ return result.toString();
+ }
+
+ EStructuralFeature javaClassFeature = null;
+
+ public String getInstanceClassName()
+ {
+ //FB EStructuralFeature javaClassFeature = JavaFactory.getGlobal_JavaClass();
+ //FB TODO figure out proper way to access global properties
+ if (javaClassFeature == null)
+ {
+ javaClassFeature = BasicExtendedMetaData.INSTANCE.getAttribute("commonj.sdo/java", "javaClass");
+ }
+
+ Sequence anyAttribute = getAnyAttribute();
+ int count = anyAttribute.size();
+ for (int i = 0; i < count; i++)
+ {
+ EStructuralFeature eFeature = (EStructuralFeature)anyAttribute.getProperty(i);
+ if (eFeature == javaClassFeature)
+ {
+ return (String)anyAttribute.getValue(i);
+ }
+ }
+ return null;
+ }
+
+} //TypeImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/TypesImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/TypesImpl.java
new file mode 100644
index 0000000000..3031bd71d0
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/TypesImpl.java
@@ -0,0 +1,210 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.model.impl;
+
+import commonj.sdo.Type;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.tuscany.sdo.impl.DataObjectBase;
+
+import org.apache.tuscany.sdo.model.ModelFactory;
+import org.apache.tuscany.sdo.model.Types;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Types</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.apache.tuscany.sdo.model.impl.TypesImpl#getType_ <em>Type</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class TypesImpl extends DataObjectBase implements Types
+{
+
+ public final static int TYPE = 0;
+
+ public final static int SDO_PROPERTY_COUNT = 1;
+
+ public final static int EXTENDED_PROPERTY_COUNT = 0;
+
+
+ /**
+ * The internal feature id for the '<em><b>Type</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_TYPE = 0;
+
+ /**
+ * The number of properties for this type.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_PROPERTY_COUNT = 1;
+
+ protected int internalConvertIndex(int internalIndex)
+ {
+ switch (internalIndex)
+ {
+ case INTERNAL_TYPE: return TYPE;
+ }
+ return super.internalConvertIndex(internalIndex);
+ }
+
+
+ /**
+ * The cached value of the '{@link #getType_() <em>Type</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getType_()
+ * @generated
+ * @ordered
+ */
+
+ protected List type = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public TypesImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Type getType()
+ {
+ return ((ModelFactoryImpl)ModelFactory.INSTANCE).getTypes();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public List getType_()
+ {
+ if (type == null)
+ {
+ type = createPropertyList(ListKind.CONTAINMENT, org.apache.tuscany.sdo.model.Type.class, TYPE, 0);
+ }
+ return type;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeContext inverseRemove(Object otherEnd, int propertyIndex, ChangeContext changeContext)
+ {
+ switch (propertyIndex)
+ {
+ case TYPE:
+ return removeFromList(getType_(), otherEnd, changeContext);
+ }
+ return super.inverseRemove(otherEnd, propertyIndex, changeContext);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object get(int propertyIndex, boolean resolve)
+ {
+ switch (propertyIndex)
+ {
+ case TYPE:
+ return getType_();
+ }
+ return super.get(propertyIndex, resolve);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void set(int propertyIndex, Object newValue)
+ {
+ switch (propertyIndex)
+ {
+ case TYPE:
+ getType_().clear();
+ getType_().addAll((Collection)newValue);
+ return;
+ }
+ super.set(propertyIndex, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unset(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case TYPE:
+ getType_().clear();
+ return;
+ }
+ super.unset(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSet(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case TYPE:
+ return type != null && !type.isEmpty();
+ }
+ return super.isSet(propertyIndex);
+ }
+
+ public List getTypeList()
+ {
+ return getType_();
+ }
+
+} //TypesImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/XSDTypeImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/XSDTypeImpl.java
new file mode 100644
index 0000000000..5cdd22cf65
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/XSDTypeImpl.java
@@ -0,0 +1,220 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.model.impl;
+
+import commonj.sdo.Sequence;
+import commonj.sdo.Type;
+
+import org.apache.tuscany.sdo.impl.DataObjectBase;
+
+import org.apache.tuscany.sdo.model.ModelFactory;
+import org.apache.tuscany.sdo.model.XSDType;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>XSD Type</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.apache.tuscany.sdo.model.impl.XSDTypeImpl#getAny <em>Any</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class XSDTypeImpl extends DataObjectBase implements XSDType
+{
+
+ public final static int ANY = -1;
+
+ public final static int SDO_PROPERTY_COUNT = 0;
+
+ public final static int EXTENDED_PROPERTY_COUNT = -1;
+
+
+ /**
+ * The internal feature id for the '<em><b>Any</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_ANY = 0;
+
+ /**
+ * The number of properties for this type.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_PROPERTY_COUNT = 1;
+
+ protected int internalConvertIndex(int internalIndex)
+ {
+ switch (internalIndex)
+ {
+ case INTERNAL_ANY: return ANY;
+ }
+ return super.internalConvertIndex(internalIndex);
+ }
+
+
+ /**
+ * The cached value of the '{@link #getAny() <em>Any</em>}' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getAny()
+ * @generated
+ * @ordered
+ */
+
+ protected Sequence any = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public XSDTypeImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Type getType()
+ {
+ return ((ModelFactoryImpl)ModelFactory.INSTANCE).getXSDType();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Sequence getAny()
+ {
+ if (any == null)
+ {
+ any = createSequence(INTERNAL_ANY);
+ }
+ return any;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeContext inverseRemove(Object otherEnd, int propertyIndex, ChangeContext changeContext)
+ {
+ switch (propertyIndex)
+ {
+ case ANY:
+ return removeFromSequence(getAny(), otherEnd, changeContext);
+ }
+ return super.inverseRemove(otherEnd, propertyIndex, changeContext);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object get(int propertyIndex, boolean resolve)
+ {
+ switch (propertyIndex)
+ {
+ case ANY:
+ // XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view
+ //if (coreType)
+ return getAny();
+ }
+ return super.get(propertyIndex, resolve);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void set(int propertyIndex, Object newValue)
+ {
+ switch (propertyIndex)
+ {
+ case ANY:
+ setSequence(getAny(), newValue);
+ return;
+ }
+ super.set(propertyIndex, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unset(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case ANY:
+ unsetSequence(getAny());
+ return;
+ }
+ super.unset(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSet(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case ANY:
+ return any != null && !isSequenceEmpty(getAny());
+ }
+ return super.isSet(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString()
+ {
+ if (isProxy(this)) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (any: ");
+ result.append(any);
+ result.append(')');
+ return result.toString();
+ }
+
+} //XSDTypeImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/java/JavaFactory.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/java/JavaFactory.java
new file mode 100644
index 0000000000..50be023db5
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/java/JavaFactory.java
@@ -0,0 +1,61 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.model.java;
+
+import commonj.sdo.helper.HelperContext;
+
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Factory</b> for the model.
+ * It provides a create method for each non-abstract class of the model.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public interface JavaFactory
+{
+
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ JavaFactory INSTANCE = org.apache.tuscany.sdo.model.java.impl.JavaFactoryImpl.init();
+
+ /**
+ * Returns a new object of class '<em>Info</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Info</em>'.
+ * @generated
+ */
+ JavaInfo createJavaInfo();
+
+ /**
+ * Registers the types supported by this Factory within the supplied scope.argument
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param scope an instance of HelperContext used to manage the scoping of types.
+ * @generated
+ */
+ public void register(HelperContext scope);
+
+} //JavaFactory
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/java/JavaInfo.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/java/JavaInfo.java
new file mode 100644
index 0000000000..b5eabb0f4a
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/java/JavaInfo.java
@@ -0,0 +1,92 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.model.java;
+
+import java.io.Serializable;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Info</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.apache.tuscany.sdo.model.java.JavaInfo#getJavaClass <em>Java Class</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @extends Serializable
+ * @generated
+ */
+public interface JavaInfo extends Serializable
+{
+ /**
+ * Returns the value of the '<em><b>Java Class</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Java Class</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Java Class</em>' attribute.
+ * @see #isSetJavaClass()
+ * @see #unsetJavaClass()
+ * @see #setJavaClass(String)
+ * @generated
+ */
+ String getJavaClass();
+
+ /**
+ * Sets the value of the '{@link org.apache.tuscany.sdo.model.java.JavaInfo#getJavaClass <em>Java Class</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Java Class</em>' attribute.
+ * @see #isSetJavaClass()
+ * @see #unsetJavaClass()
+ * @see #getJavaClass()
+ * @generated
+ */
+ void setJavaClass(String value);
+
+ /**
+ * Unsets the value of the '{@link org.apache.tuscany.sdo.model.java.JavaInfo#getJavaClass <em>Java Class</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetJavaClass()
+ * @see #getJavaClass()
+ * @see #setJavaClass(String)
+ * @generated
+ */
+ void unsetJavaClass();
+
+ /**
+ * Returns whether the value of the '{@link org.apache.tuscany.sdo.model.java.JavaInfo#getJavaClass <em>Java Class</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Java Class</em>' attribute is set.
+ * @see #unsetJavaClass()
+ * @see #getJavaClass()
+ * @see #setJavaClass(String)
+ * @generated
+ */
+ boolean isSetJavaClass();
+
+} // JavaInfo
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/java/impl/JavaFactoryImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/java/impl/JavaFactoryImpl.java
new file mode 100644
index 0000000000..61411f4bca
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/java/impl/JavaFactoryImpl.java
@@ -0,0 +1,658 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.model.java.impl;
+
+import commonj.sdo.helper.HelperContext;
+import org.apache.tuscany.sdo.helper.TypeHelperImpl;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+
+import org.apache.tuscany.sdo.SDOFactory;
+
+import org.apache.tuscany.sdo.impl.FactoryBase;
+
+import org.apache.tuscany.sdo.model.ModelFactory;
+
+import org.apache.tuscany.sdo.model.impl.ModelFactoryImpl;
+
+import org.apache.tuscany.sdo.model.java.*;
+
+import org.apache.tuscany.sdo.util.SDOUtil;
+import org.eclipse.emf.ecore.xml.type.XMLTypeFactory;
+import org.eclipse.emf.ecore.xml.type.util.XMLTypeUtil;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the commonj.sdo/java model factory.
+ * This model is generated from sdoJava.xsd, in the sdo-api project.
+ * Until the SDO code generator supports name conflicts and regen/merge, follow the following steps to regenerate this model:
+ * 1. Regenerate the model into a temporary directory:
+ * XSD2JavaGenerator -generateBuiltIn commonj.sdo/java -targetDirectory <temp-dir> -javaPackage org.apache.tuscany.sdo.model.java <sdo-api-dir>/src/main/resources/xml/sdoJava.xsd
+ * 2. Delete all the createXXXFromString() and convertXXXToString() methods in the newly generated JavaFactoryImpl and
+ * replace them with the ones from this file.
+ * 3. Move this JavaDoc comment into the newly generated JavaFactoryImpl class.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class JavaFactoryImpl extends FactoryBase implements JavaFactory
+{
+
+ /**
+ * The package namespace URI.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String NAMESPACE_URI = "commonj.sdo/java";
+
+ /**
+ * The package namespace name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String NAMESPACE_PREFIX = "sdoJava";
+
+ /**
+ * The version of the generator pattern used to generate this class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String PATTERN_VERSION = "1.1";
+
+ public static final int JAVA_INFO = 1;
+ public static final int BOOLEAN_OBJECT = 2;
+ public static final int BYTE_OBJECT = 3;
+ public static final int CHARACTER_OBJECT = 4;
+ public static final int DOUBLE_OBJECT = 5;
+ public static final int FLOAT_OBJECT = 6;
+ public static final int INT_OBJECT = 7;
+ public static final int LONG_OBJECT = 8;
+ public static final int SHORT_OBJECT = 9;
+
+ /**
+ * Creates an instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public JavaFactoryImpl()
+ {
+ super(NAMESPACE_URI, NAMESPACE_PREFIX, "org.apache.tuscany.sdo.model.java");
+ }
+
+ /**
+ * Registers the Factory instance so that it is available within the supplied scope.
+ * @argument scope a HelperContext instance that will make the types supported by this Factory available.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void register(HelperContext scope) {
+ if(scope == null) {
+ throw new IllegalArgumentException("Scope can not be null");
+ }
+ TypeHelperImpl th = (TypeHelperImpl)scope.getTypeHelper();
+ th.getExtendedMetaData().putPackage(NAMESPACE_URI, this);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public DataObject create(int typeNumber)
+ {
+ switch (typeNumber)
+ {
+ case JAVA_INFO: return (DataObject)createJavaInfo();
+ default:
+ return super.create(typeNumber);
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object createFromString(int typeNumber, String initialValue)
+ {
+ switch (typeNumber)
+ {
+ case BOOLEAN_OBJECT:
+ return createBooleanObjectFromString(initialValue);
+ case BYTE_OBJECT:
+ return createByteObjectFromString(initialValue);
+ case CHARACTER_OBJECT:
+ return createCharacterObjectFromString(initialValue);
+ case DOUBLE_OBJECT:
+ return createDoubleObjectFromString(initialValue);
+ case FLOAT_OBJECT:
+ return createFloatObjectFromString(initialValue);
+ case INT_OBJECT:
+ return createIntObjectFromString(initialValue);
+ case LONG_OBJECT:
+ return createLongObjectFromString(initialValue);
+ case SHORT_OBJECT:
+ return createShortObjectFromString(initialValue);
+ default:
+ throw new IllegalArgumentException("The type number '" + typeNumber + "' is not a valid datatype");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String convertToString(int typeNumber, Object instanceValue)
+ {
+ switch (typeNumber)
+ {
+ case BOOLEAN_OBJECT:
+ return convertBooleanObjectToString(instanceValue);
+ case BYTE_OBJECT:
+ return convertByteObjectToString(instanceValue);
+ case CHARACTER_OBJECT:
+ return convertCharacterObjectToString(instanceValue);
+ case DOUBLE_OBJECT:
+ return convertDoubleObjectToString(instanceValue);
+ case FLOAT_OBJECT:
+ return convertFloatObjectToString(instanceValue);
+ case INT_OBJECT:
+ return convertIntObjectToString(instanceValue);
+ case LONG_OBJECT:
+ return convertLongObjectToString(instanceValue);
+ case SHORT_OBJECT:
+ return convertShortObjectToString(instanceValue);
+ default:
+ throw new IllegalArgumentException("The type number '" + typeNumber + "' is not a valid datatype");
+ }
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public JavaInfo createJavaInfo()
+ {
+ JavaInfoImpl javaInfo = new JavaInfoImpl();
+ return javaInfo;
+ }
+
+ // Following creates and initializes SDO metadata for the supported types.
+ protected Type javaInfoType = null;
+
+ public Type getJavaInfo()
+ {
+ return javaInfoType;
+ }
+
+ protected Type booleanObjectType = null;
+
+ public Type getBooleanObject()
+ {
+ return booleanObjectType;
+ }
+
+ protected Type byteObjectType = null;
+
+ public Type getByteObject()
+ {
+ return byteObjectType;
+ }
+
+ protected Type characterObjectType = null;
+
+ public Type getCharacterObject()
+ {
+ return characterObjectType;
+ }
+
+ protected Type doubleObjectType = null;
+
+ public Type getDoubleObject()
+ {
+ return doubleObjectType;
+ }
+
+ protected Type floatObjectType = null;
+
+ public Type getFloatObject()
+ {
+ return floatObjectType;
+ }
+
+ protected Type intObjectType = null;
+
+ public Type getIntObject()
+ {
+ return intObjectType;
+ }
+
+ protected Type longObjectType = null;
+
+ public Type getLongObject()
+ {
+ return longObjectType;
+ }
+
+ protected Type shortObjectType = null;
+
+ public Type getShortObject()
+ {
+ return shortObjectType;
+ }
+
+
+ private static boolean isInited = false;
+
+ public static JavaFactoryImpl init()
+ {
+ if (isInited) return (JavaFactoryImpl)FactoryBase.getStaticFactory(JavaFactoryImpl.NAMESPACE_URI);
+ JavaFactoryImpl theJavaFactoryImpl = new JavaFactoryImpl();
+ isInited = true;
+
+ // Initialize simple dependencies
+ SDOUtil.registerStaticTypes(SDOFactory.class);
+ SDOUtil.registerStaticTypes(ModelFactory.class);
+
+ // Create package meta-data objects
+ theJavaFactoryImpl.createMetaData();
+
+ // Initialize created meta-data
+ theJavaFactoryImpl.initializeMetaData();
+
+ // Mark meta-data to indicate it can't be changed
+ //theJavaFactoryImpl.freeze(); //FB do we need to freeze / should we freeze ????
+
+ return theJavaFactoryImpl;
+ }
+
+ private boolean isCreated = false;
+
+ public void createMetaData()
+ {
+ if (isCreated) return;
+ isCreated = true;
+
+ // Create types and their properties
+ javaInfoType = createType(false, JAVA_INFO);
+ createProperty(true, javaInfoType,JavaInfoImpl.INTERNAL_JAVA_CLASS);
+
+ // Create data types
+ booleanObjectType = createType(true, BOOLEAN_OBJECT );
+ byteObjectType = createType(true, BYTE_OBJECT );
+ characterObjectType = createType(true, CHARACTER_OBJECT );
+ doubleObjectType = createType(true, DOUBLE_OBJECT );
+ floatObjectType = createType(true, FLOAT_OBJECT );
+ intObjectType = createType(true, INT_OBJECT );
+ longObjectType = createType(true, LONG_OBJECT );
+ shortObjectType = createType(true, SHORT_OBJECT );
+ }
+
+ private boolean isInitialized = false;
+
+ public void initializeMetaData()
+ {
+ if (isInitialized) return;
+ isInitialized = true;
+
+ // Obtain other dependent packages
+ ModelFactoryImpl theModelPackageImpl = (ModelFactoryImpl)FactoryBase.getStaticFactory(ModelFactoryImpl.NAMESPACE_URI);
+ Property property = null;
+
+ // Add supertypes to types
+
+ // Initialize types and properties
+ initializeType(javaInfoType, JavaInfo.class, "JavaInfo", false);
+ property = getProperty(javaInfoType, JavaInfoImpl.INTERNAL_JAVA_CLASS);
+ initializeProperty(property, theModelPackageImpl.getString(), "javaClass", null, 0, 1, JavaInfo.class, false, true, false);
+
+ // Initialize data types
+ initializeType(booleanObjectType, Boolean.class, "BooleanObject", true, false);
+ setInstanceProperty (booleanObjectType, "commonj.sdo/java", "instanceClass", "java.lang.Boolean");
+
+ initializeType(byteObjectType, Byte.class, "ByteObject", true, false);
+ setInstanceProperty (byteObjectType, "commonj.sdo/java", "instanceClass", "java.lang.Byte");
+
+ initializeType(characterObjectType, Character.class, "CharacterObject", true, false);
+ setInstanceProperty (characterObjectType, "commonj.sdo/java", "instanceClass", "java.lang.Character");
+
+ initializeType(doubleObjectType, Double.class, "DoubleObject", true, false);
+ setInstanceProperty (doubleObjectType, "commonj.sdo/java", "instanceClass", "java.lang.Double");
+
+ initializeType(floatObjectType, Float.class, "FloatObject", true, false);
+ setInstanceProperty (floatObjectType, "commonj.sdo/java", "instanceClass", "java.lang.Float");
+
+ initializeType(intObjectType, Integer.class, "IntObject", true, false);
+ setInstanceProperty (intObjectType, "commonj.sdo/java", "instanceClass", "java.lang.Integer");
+
+ initializeType(longObjectType, Long.class, "LongObject", true, false);
+ setInstanceProperty (longObjectType, "commonj.sdo/java", "instanceClass", "java.lang.Long");
+
+ initializeType(shortObjectType, Short.class, "ShortObject", true, false);
+ setInstanceProperty (shortObjectType, "commonj.sdo/java", "instanceClass", "java.lang.Short");
+
+ createXSDMetaData(theModelPackageImpl);
+ }
+
+ protected void createXSDMetaData(ModelFactoryImpl theModelPackageImpl)
+ {
+ super.initXSD();
+
+ Property property = null;
+
+
+ property = createGlobalProperty
+ ("extendedInstanceClass",
+ theModelPackageImpl.getString(),
+ new String[]
+ {
+ "kind", "attribute",
+ "name", "extendedInstanceClass",
+ "namespace", "##targetNamespace"
+ },
+ IS_ATTRIBUTE);
+
+ property = createGlobalProperty
+ ("instanceClass",
+ theModelPackageImpl.getString(),
+ new String[]
+ {
+ "kind", "attribute",
+ "name", "instanceClass",
+ "namespace", "##targetNamespace"
+ },
+ IS_ATTRIBUTE);
+
+ property = createGlobalProperty
+ ("javaClass",
+ theModelPackageImpl.getString(),
+ new String[]
+ {
+ "kind", "attribute",
+ "name", "javaClass",
+ "namespace", "##targetNamespace"
+ },
+ IS_ATTRIBUTE);
+
+ property = createGlobalProperty
+ ("nestedInterfaces",
+ theModelPackageImpl.getBoolean(),
+ new String[]
+ {
+ "kind", "attribute",
+ "name", "nestedInterfaces",
+ "namespace", "##targetNamespace"
+ },
+ IS_ATTRIBUTE);
+
+ property = createGlobalProperty
+ ("package",
+ theModelPackageImpl.getString(),
+ new String[]
+ {
+ "kind", "attribute",
+ "name", "package",
+ "namespace", "##targetNamespace"
+ },
+ IS_ATTRIBUTE);
+
+ addXSDMapping
+ (javaInfoType,
+ new String[]
+ {
+ "name", "JavaInfo",
+ "kind", "empty"
+ });
+
+ addXSDMapping
+ (getProperty(javaInfoType, JavaInfoImpl.INTERNAL_JAVA_CLASS),
+ new String[]
+ {
+ "kind", "attribute",
+ "name", "javaClass"
+ });
+
+ addXSDMapping
+ (booleanObjectType,
+ new String[]
+ {
+ "name", "BooleanObject"
+ });
+
+ addXSDMapping
+ (byteObjectType,
+ new String[]
+ {
+ "name", "ByteObject"
+ });
+
+ addXSDMapping
+ (characterObjectType,
+ new String[]
+ {
+ "name", "CharacterObject"
+ });
+
+ addXSDMapping
+ (doubleObjectType,
+ new String[]
+ {
+ "name", "DoubleObject"
+ });
+
+ addXSDMapping
+ (floatObjectType,
+ new String[]
+ {
+ "name", "FloatObject"
+ });
+
+ addXSDMapping
+ (intObjectType,
+ new String[]
+ {
+ "name", "IntObject"
+ });
+
+ addXSDMapping
+ (longObjectType,
+ new String[]
+ {
+ "name", "LongObject"
+ });
+
+ addXSDMapping
+ (shortObjectType,
+ new String[]
+ {
+ "name", "ShortObject"
+ });
+
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Boolean createBooleanObjectFromString(String initialValue)
+ {
+ return XMLTypeFactory.eINSTANCE.createBooleanObject(initialValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String convertBooleanObjectToString(Object instanceValue)
+ {
+ return XMLTypeFactory.eINSTANCE.convertBooleanObject((Boolean)instanceValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Byte createByteObjectFromString(String initialValue)
+ {
+ return XMLTypeFactory.eINSTANCE.createByteObject(initialValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String convertByteObjectToString(Object instanceValue)
+ {
+ return XMLTypeFactory.eINSTANCE.convertByteObject((Byte)instanceValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Character createCharacterObjectFromString(String initialValue)
+ {
+ return (initialValue == null && initialValue.length() > 0)
+ ? null : (new Character(XMLTypeUtil.normalize(initialValue, true).charAt(0)));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String convertCharacterObjectToString(Object instanceValue)
+ {
+ return instanceValue == null ? null : instanceValue.toString();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Double createDoubleObjectFromString(String initialValue)
+ {
+ return XMLTypeFactory.eINSTANCE.createDoubleObject(initialValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String convertDoubleObjectToString(Object instanceValue)
+ {
+ return XMLTypeFactory.eINSTANCE.convertDoubleObject((Double)instanceValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Float createFloatObjectFromString(String initialValue)
+ {
+ return XMLTypeFactory.eINSTANCE.createFloatObject(initialValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String convertFloatObjectToString(Object instanceValue)
+ {
+ return XMLTypeFactory.eINSTANCE.convertFloatObject((Float)instanceValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Integer createIntObjectFromString(String initialValue)
+ {
+ return XMLTypeFactory.eINSTANCE.createIntObject(initialValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String convertIntObjectToString(Object instanceValue)
+ {
+ return XMLTypeFactory.eINSTANCE.convertIntObject((Integer)instanceValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Long createLongObjectFromString(String initialValue)
+ {
+ return XMLTypeFactory.eINSTANCE.createLongObject(initialValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String convertLongObjectToString(Object instanceValue)
+ {
+ return XMLTypeFactory.eINSTANCE.convertLongObject((Long)instanceValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public Short createShortObjectFromString(String initialValue)
+ {
+ return XMLTypeFactory.eINSTANCE.createShortObject(initialValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String convertShortObjectToString(Object instanceValue)
+ {
+ return XMLTypeFactory.eINSTANCE.convertShortObject((Short)instanceValue);
+ }
+
+} //JavaFactoryImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/java/impl/JavaInfoImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/java/impl/JavaInfoImpl.java
new file mode 100644
index 0000000000..1f175d4233
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/java/impl/JavaInfoImpl.java
@@ -0,0 +1,256 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.model.java.impl;
+
+import commonj.sdo.Type;
+
+import org.apache.tuscany.sdo.impl.DataObjectBase;
+
+import org.apache.tuscany.sdo.model.java.JavaFactory;
+import org.apache.tuscany.sdo.model.java.JavaInfo;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Info</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.apache.tuscany.sdo.model.java.impl.JavaInfoImpl#getJavaClass <em>Java Class</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class JavaInfoImpl extends DataObjectBase implements JavaInfo
+{
+
+ public final static int JAVA_CLASS = 0;
+
+ public final static int SDO_PROPERTY_COUNT = 1;
+
+ public final static int EXTENDED_PROPERTY_COUNT = 0;
+
+
+ /**
+ * The internal feature id for the '<em><b>Java Class</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_JAVA_CLASS = 0;
+
+ /**
+ * The number of properties for this type.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_PROPERTY_COUNT = 1;
+
+ protected int internalConvertIndex(int internalIndex)
+ {
+ switch (internalIndex)
+ {
+ case INTERNAL_JAVA_CLASS: return JAVA_CLASS;
+ }
+ return super.internalConvertIndex(internalIndex);
+ }
+
+
+ /**
+ * The default value of the '{@link #getJavaClass() <em>Java Class</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getJavaClass()
+ * @generated
+ * @ordered
+ */
+ protected static final String JAVA_CLASS_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getJavaClass() <em>Java Class</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getJavaClass()
+ * @generated
+ * @ordered
+ */
+ protected String javaClass = JAVA_CLASS_DEFAULT_;
+
+ /**
+ * This is true if the Java Class attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean javaClass_set_ = false;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public JavaInfoImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Type getType()
+ {
+ return ((JavaFactoryImpl)JavaFactory.INSTANCE).getJavaInfo();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getJavaClass()
+ {
+ return javaClass;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setJavaClass(String newJavaClass)
+ {
+ String oldJavaClass = javaClass;
+ javaClass = newJavaClass;
+ boolean oldJavaClass_set_ = javaClass_set_;
+ javaClass_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, JAVA_CLASS, oldJavaClass, javaClass, !oldJavaClass_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetJavaClass()
+ {
+ String oldJavaClass = javaClass;
+ boolean oldJavaClass_set_ = javaClass_set_;
+ javaClass = JAVA_CLASS_DEFAULT_;
+ javaClass_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, JAVA_CLASS, oldJavaClass, JAVA_CLASS_DEFAULT_, oldJavaClass_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetJavaClass()
+ {
+ return javaClass_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object get(int propertyIndex, boolean resolve)
+ {
+ switch (propertyIndex)
+ {
+ case JAVA_CLASS:
+ return getJavaClass();
+ }
+ return super.get(propertyIndex, resolve);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void set(int propertyIndex, Object newValue)
+ {
+ switch (propertyIndex)
+ {
+ case JAVA_CLASS:
+ setJavaClass((String)newValue);
+ return;
+ }
+ super.set(propertyIndex, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unset(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case JAVA_CLASS:
+ unsetJavaClass();
+ return;
+ }
+ super.unset(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSet(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case JAVA_CLASS:
+ return isSetJavaClass();
+ }
+ return super.isSet(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString()
+ {
+ if (isProxy(this)) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (javaClass: ");
+ if (javaClass_set_) result.append(javaClass); else result.append("<unset>");
+ result.append(')');
+ return result.toString();
+ }
+
+} //JavaInfoImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/xml/XMLFactory.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/xml/XMLFactory.java
new file mode 100644
index 0000000000..84a60cf849
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/xml/XMLFactory.java
@@ -0,0 +1,61 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.model.xml;
+
+import commonj.sdo.helper.HelperContext;
+
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Factory</b> for the model.
+ * It provides a create method for each non-abstract class of the model.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public interface XMLFactory
+{
+
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ XMLFactory INSTANCE = org.apache.tuscany.sdo.model.xml.impl.XMLFactoryImpl.init();
+
+ /**
+ * Returns a new object of class '<em>Info</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Info</em>'.
+ * @generated
+ */
+ XMLInfo createXMLInfo();
+
+ /**
+ * Registers the types supported by this Factory within the supplied scope.argument
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param scope an instance of HelperContext used to manage the scoping of types.
+ * @generated
+ */
+ public void register(HelperContext scope);
+
+} //XMLFactory
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/xml/XMLInfo.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/xml/XMLInfo.java
new file mode 100644
index 0000000000..85cad641c9
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/xml/XMLInfo.java
@@ -0,0 +1,92 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.model.xml;
+
+import java.io.Serializable;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Info</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.apache.tuscany.sdo.model.xml.XMLInfo#isXmlElement <em>Xml Element</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @extends Serializable
+ * @generated
+ */
+public interface XMLInfo extends Serializable
+{
+ /**
+ * Returns the value of the '<em><b>Xml Element</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Xml Element</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Xml Element</em>' attribute.
+ * @see #isSetXmlElement()
+ * @see #unsetXmlElement()
+ * @see #setXmlElement(boolean)
+ * @generated
+ */
+ boolean isXmlElement();
+
+ /**
+ * Sets the value of the '{@link org.apache.tuscany.sdo.model.xml.XMLInfo#isXmlElement <em>Xml Element</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Xml Element</em>' attribute.
+ * @see #isSetXmlElement()
+ * @see #unsetXmlElement()
+ * @see #isXmlElement()
+ * @generated
+ */
+ void setXmlElement(boolean value);
+
+ /**
+ * Unsets the value of the '{@link org.apache.tuscany.sdo.model.xml.XMLInfo#isXmlElement <em>Xml Element</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetXmlElement()
+ * @see #isXmlElement()
+ * @see #setXmlElement(boolean)
+ * @generated
+ */
+ void unsetXmlElement();
+
+ /**
+ * Returns whether the value of the '{@link org.apache.tuscany.sdo.model.xml.XMLInfo#isXmlElement <em>Xml Element</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Xml Element</em>' attribute is set.
+ * @see #unsetXmlElement()
+ * @see #isXmlElement()
+ * @see #setXmlElement(boolean)
+ * @generated
+ */
+ boolean isSetXmlElement();
+
+} // XMLInfo
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/xml/impl/XMLFactoryImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/xml/impl/XMLFactoryImpl.java
new file mode 100644
index 0000000000..7d510e9636
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/xml/impl/XMLFactoryImpl.java
@@ -0,0 +1,334 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.model.xml.impl;
+
+import commonj.sdo.helper.HelperContext;
+import org.apache.tuscany.sdo.helper.TypeHelperImpl;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+
+import org.apache.tuscany.sdo.SDOFactory;
+
+import org.apache.tuscany.sdo.impl.FactoryBase;
+
+import org.apache.tuscany.sdo.model.ModelFactory;
+
+import org.apache.tuscany.sdo.model.impl.ModelFactoryImpl;
+
+import org.apache.tuscany.sdo.model.xml.*;
+
+import org.apache.tuscany.sdo.util.SDOUtil;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the commonj.sdo/xml model factory.
+ * This model is generated from sdoXML.xsd, in the sdo-api project.
+ * Until the SDO code generator supports name conflicts and regen/merge, follow the following steps to regenerate this model:
+ * 1. Regenerate the model into a temporary directory:
+ * XSD2JavaGenerator -generateBuiltIn commonj.sdo/xml -prefix XML -targetDirectory <temp-dir> -javaPackage org.apache.tuscany.sdo.model.xml <sdo-api-dir>/src/main/resources/xml/sdoXML.xsd
+ * 2. Move this JavaDoc comment into the newly generated XMLFactoryImpl class.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class XMLFactoryImpl extends FactoryBase implements XMLFactory
+{
+
+ /**
+ * The package namespace URI.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String NAMESPACE_URI = "commonj.sdo/xml";
+
+ /**
+ * The package namespace name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String NAMESPACE_PREFIX = "sdoXML";
+
+ /**
+ * The version of the generator pattern used to generate this class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String PATTERN_VERSION = "1.1";
+
+ public static final int XML_INFO = 1;
+
+ /**
+ * Creates an instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public XMLFactoryImpl()
+ {
+ super(NAMESPACE_URI, NAMESPACE_PREFIX, "org.apache.tuscany.sdo.model.xml");
+ }
+
+ /**
+ * Registers the Factory instance so that it is available within the supplied scope.
+ * @argument scope a HelperContext instance that will make the types supported by this Factory available.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void register(HelperContext scope) {
+ if(scope == null) {
+ throw new IllegalArgumentException("Scope can not be null");
+ }
+ TypeHelperImpl th = (TypeHelperImpl)scope.getTypeHelper();
+ th.getExtendedMetaData().putPackage(NAMESPACE_URI, this);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public DataObject create(int typeNumber)
+ {
+ switch (typeNumber)
+ {
+ case XML_INFO: return (DataObject)createXMLInfo();
+ default:
+ return super.create(typeNumber);
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public XMLInfo createXMLInfo()
+ {
+ XMLInfoImpl xmlInfo = new XMLInfoImpl();
+ return xmlInfo;
+ }
+
+ // Following creates and initializes SDO metadata for the supported types.
+ protected Type xmlInfoType = null;
+
+ public Type getXMLInfo()
+ {
+ return xmlInfoType;
+ }
+
+
+ private static boolean isInited = false;
+
+ public static XMLFactoryImpl init()
+ {
+ if (isInited) return (XMLFactoryImpl)FactoryBase.getStaticFactory(XMLFactoryImpl.NAMESPACE_URI);
+ XMLFactoryImpl theXMLFactoryImpl = new XMLFactoryImpl();
+ isInited = true;
+
+ // Initialize simple dependencies
+ SDOUtil.registerStaticTypes(SDOFactory.class);
+ SDOUtil.registerStaticTypes(ModelFactory.class);
+
+ // Create package meta-data objects
+ theXMLFactoryImpl.createMetaData();
+
+ // Initialize created meta-data
+ theXMLFactoryImpl.initializeMetaData();
+
+ // Mark meta-data to indicate it can't be changed
+ //theXMLFactoryImpl.freeze(); //FB do we need to freeze / should we freeze ????
+
+ return theXMLFactoryImpl;
+ }
+
+ private boolean isCreated = false;
+
+ public void createMetaData()
+ {
+ if (isCreated) return;
+ isCreated = true;
+
+ // Create types and their properties
+ xmlInfoType = createType(false, XML_INFO);
+ createProperty(true, xmlInfoType,XMLInfoImpl.INTERNAL_XML_ELEMENT);
+ }
+
+ private boolean isInitialized = false;
+
+ public void initializeMetaData()
+ {
+ if (isInitialized) return;
+ isInitialized = true;
+
+ // Obtain other dependent packages
+ ModelFactoryImpl theModelPackageImpl = (ModelFactoryImpl)FactoryBase.getStaticFactory(ModelFactoryImpl.NAMESPACE_URI);
+ Property property = null;
+
+ // Add supertypes to types
+
+ // Initialize types and properties
+ initializeType(xmlInfoType, XMLInfo.class, "XMLInfo", false);
+ property = getProperty(xmlInfoType, XMLInfoImpl.INTERNAL_XML_ELEMENT);
+ initializeProperty(property, theModelPackageImpl.getBoolean(), "xmlElement", null, 0, 1, XMLInfo.class, false, true, false);
+
+ createXSDMetaData(theModelPackageImpl);
+ }
+
+ protected void createXSDMetaData(ModelFactoryImpl theModelPackageImpl)
+ {
+ super.initXSD();
+
+ Property property = null;
+
+
+ property = createGlobalProperty
+ ("aliasName",
+ theModelPackageImpl.getString(),
+ new String[]
+ {
+ "kind", "attribute",
+ "name", "aliasName",
+ "namespace", "##targetNamespace"
+ },
+ IS_ATTRIBUTE);
+
+ property = createGlobalProperty
+ ("dataType",
+ theModelPackageImpl.getURI(),
+ new String[]
+ {
+ "kind", "attribute",
+ "name", "dataType",
+ "namespace", "##targetNamespace"
+ },
+ IS_ATTRIBUTE);
+
+ property = createGlobalProperty
+ ("many",
+ theModelPackageImpl.getBoolean(),
+ new String[]
+ {
+ "kind", "attribute",
+ "name", "many",
+ "namespace", "##targetNamespace"
+ },
+ IS_ATTRIBUTE);
+
+ property = createGlobalProperty
+ ("name",
+ theModelPackageImpl.getString(),
+ new String[]
+ {
+ "kind", "attribute",
+ "name", "name",
+ "namespace", "##targetNamespace"
+ },
+ IS_ATTRIBUTE);
+
+ property = createGlobalProperty
+ ("oppositeProperty",
+ theModelPackageImpl.getString(),
+ new String[]
+ {
+ "kind", "attribute",
+ "name", "oppositeProperty",
+ "namespace", "##targetNamespace"
+ },
+ IS_ATTRIBUTE);
+
+ property = createGlobalProperty
+ ("propertyType",
+ theModelPackageImpl.getURI(),
+ new String[]
+ {
+ "kind", "attribute",
+ "name", "propertyType",
+ "namespace", "##targetNamespace"
+ },
+ IS_ATTRIBUTE);
+
+ property = createGlobalProperty
+ ("readOnly",
+ theModelPackageImpl.getBoolean(),
+ new String[]
+ {
+ "kind", "attribute",
+ "name", "readOnly",
+ "namespace", "##targetNamespace"
+ },
+ IS_ATTRIBUTE);
+
+ property = createGlobalProperty
+ ("sequence",
+ theModelPackageImpl.getBoolean(),
+ new String[]
+ {
+ "kind", "attribute",
+ "name", "sequence",
+ "namespace", "##targetNamespace"
+ },
+ IS_ATTRIBUTE);
+
+ property = createGlobalProperty
+ ("string",
+ theModelPackageImpl.getBoolean(),
+ new String[]
+ {
+ "kind", "attribute",
+ "name", "string",
+ "namespace", "##targetNamespace"
+ },
+ IS_ATTRIBUTE);
+
+ property = createGlobalProperty
+ ("xmlElement",
+ theModelPackageImpl.getBoolean(),
+ new String[]
+ {
+ "kind", "attribute",
+ "name", "xmlElement",
+ "namespace", "##targetNamespace"
+ },
+ IS_ATTRIBUTE);
+
+ addXSDMapping
+ (xmlInfoType,
+ new String[]
+ {
+ "name", "XMLInfo",
+ "kind", "empty"
+ });
+
+ addXSDMapping
+ (getProperty(xmlInfoType, XMLInfoImpl.INTERNAL_XML_ELEMENT),
+ new String[]
+ {
+ "kind", "attribute",
+ "name", "xmlElement"
+ });
+
+ }
+
+} //XMLFactoryImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/xml/impl/XMLInfoImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/xml/impl/XMLInfoImpl.java
new file mode 100644
index 0000000000..6e3c9ecf30
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/xml/impl/XMLInfoImpl.java
@@ -0,0 +1,256 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.model.xml.impl;
+
+import commonj.sdo.Type;
+
+import org.apache.tuscany.sdo.impl.DataObjectBase;
+
+import org.apache.tuscany.sdo.model.xml.XMLFactory;
+import org.apache.tuscany.sdo.model.xml.XMLInfo;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Info</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.apache.tuscany.sdo.model.xml.impl.XMLInfoImpl#isXmlElement <em>Xml Element</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class XMLInfoImpl extends DataObjectBase implements XMLInfo
+{
+
+ public final static int XML_ELEMENT = 0;
+
+ public final static int SDO_PROPERTY_COUNT = 1;
+
+ public final static int EXTENDED_PROPERTY_COUNT = 0;
+
+
+ /**
+ * The internal feature id for the '<em><b>Xml Element</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_XML_ELEMENT = 0;
+
+ /**
+ * The number of properties for this type.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_PROPERTY_COUNT = 1;
+
+ protected int internalConvertIndex(int internalIndex)
+ {
+ switch (internalIndex)
+ {
+ case INTERNAL_XML_ELEMENT: return XML_ELEMENT;
+ }
+ return super.internalConvertIndex(internalIndex);
+ }
+
+
+ /**
+ * The default value of the '{@link #isXmlElement() <em>Xml Element</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isXmlElement()
+ * @generated
+ * @ordered
+ */
+ protected static final boolean XML_ELEMENT_DEFAULT_ = false;
+
+ /**
+ * The cached value of the '{@link #isXmlElement() <em>Xml Element</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isXmlElement()
+ * @generated
+ * @ordered
+ */
+ protected boolean xmlElement = XML_ELEMENT_DEFAULT_;
+
+ /**
+ * This is true if the Xml Element attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean xmlElement_set_ = false;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public XMLInfoImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Type getType()
+ {
+ return ((XMLFactoryImpl)XMLFactory.INSTANCE).getXMLInfo();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isXmlElement()
+ {
+ return xmlElement;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setXmlElement(boolean newXmlElement)
+ {
+ boolean oldXmlElement = xmlElement;
+ xmlElement = newXmlElement;
+ boolean oldXmlElement_set_ = xmlElement_set_;
+ xmlElement_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, XML_ELEMENT, oldXmlElement, xmlElement, !oldXmlElement_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetXmlElement()
+ {
+ boolean oldXmlElement = xmlElement;
+ boolean oldXmlElement_set_ = xmlElement_set_;
+ xmlElement = XML_ELEMENT_DEFAULT_;
+ xmlElement_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, XML_ELEMENT, oldXmlElement, XML_ELEMENT_DEFAULT_, oldXmlElement_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetXmlElement()
+ {
+ return xmlElement_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object get(int propertyIndex, boolean resolve)
+ {
+ switch (propertyIndex)
+ {
+ case XML_ELEMENT:
+ return isXmlElement() ? Boolean.TRUE : Boolean.FALSE;
+ }
+ return super.get(propertyIndex, resolve);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void set(int propertyIndex, Object newValue)
+ {
+ switch (propertyIndex)
+ {
+ case XML_ELEMENT:
+ setXmlElement(((Boolean)newValue).booleanValue());
+ return;
+ }
+ super.set(propertyIndex, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unset(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case XML_ELEMENT:
+ unsetXmlElement();
+ return;
+ }
+ super.unset(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSet(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case XML_ELEMENT:
+ return isSetXmlElement();
+ }
+ return super.isSet(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString()
+ {
+ if (isProxy(this)) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (xmlElement: ");
+ if (xmlElement_set_) result.append(xmlElement); else result.append("<unset>");
+ result.append(')');
+ return result.toString();
+ }
+
+} //XMLInfoImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/BasicSequence.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/BasicSequence.java
new file mode 100644
index 0000000000..51f6f5b35f
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/BasicSequence.java
@@ -0,0 +1,158 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.util;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.util.FeatureMap;
+import org.eclipse.emf.ecore.util.FeatureMapUtil;
+import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
+
+import commonj.sdo.Property;
+import commonj.sdo.Sequence;
+
+/**
+ * SDO Sequance implementation which delegates to a feature map.
+ */
+public class BasicSequence implements Sequence, FeatureMap.Internal.Wrapper
+{
+ protected FeatureMap.Internal featureMap;
+
+ public BasicSequence(FeatureMap.Internal featureMap)
+ {
+ this.featureMap = featureMap;
+ featureMap.setWrapper(this);
+ }
+
+ public FeatureMap featureMap()
+ {
+ return featureMap;
+ }
+
+ public int size()
+ {
+ return featureMap.size();
+ }
+
+ public Property getProperty(int index)
+ {
+ EStructuralFeature feature = featureMap.getEStructuralFeature(index);
+ return getFeatureProperty(feature);
+ }
+
+ public static Property getFeatureProperty(EStructuralFeature feature)
+ {
+ boolean isText =
+ feature == XMLTypePackage.Literals.XML_TYPE_DOCUMENT_ROOT__TEXT ||
+ feature == XMLTypePackage.Literals.XML_TYPE_DOCUMENT_ROOT__CDATA ||
+ feature == XMLTypePackage.Literals.XML_TYPE_DOCUMENT_ROOT__COMMENT;
+ return isText ? null : (Property)feature;
+ }
+
+ public Object getValue(int index)
+ {
+ return featureMap.getValue(index);
+ }
+
+ public Object setValue(int index, Object value)
+ {
+ return featureMap.setValue(index, value);
+ }
+
+ protected EStructuralFeature getEStructuralFeature(String propertyName)
+ {
+ return featureMap.getEObject().eClass().getEStructuralFeature(propertyName);
+ }
+
+ protected EStructuralFeature getEStructuralFeature(int propertyIndex)
+ {
+ return featureMap.getEObject().eClass().getEStructuralFeature(propertyIndex);
+ }
+
+ public boolean add(String propertyName, Object value)
+ {
+ return featureMap.add(getEStructuralFeature(propertyName), value);
+ }
+
+ public boolean add(int propertyIndex, Object value)
+ {
+ return featureMap.add(getEStructuralFeature(propertyIndex), value);
+ }
+
+ public boolean add(Property property, Object value)
+ {
+ return featureMap.add((EStructuralFeature)property, value);
+ }
+
+ public void add(int index, String propertyName, Object value)
+ {
+ featureMap.add(index, getEStructuralFeature(propertyName), value);
+ }
+
+ public void add(int index, int propertyIndex, Object value)
+ {
+ featureMap.add(index, getEStructuralFeature(propertyIndex), value);
+ }
+
+ public void add(int index, Property property, Object value)
+ {
+ featureMap.add(index, (EStructuralFeature)property, value);
+ }
+
+ /**
+ * @deprecated
+ */
+ public void add(String text)
+ {
+ FeatureMapUtil.addText(featureMap, text);
+ }
+
+ /**
+ * @deprecated
+ */
+ public void add(int index, String text)
+ {
+ FeatureMapUtil.addText(featureMap, index, text);
+ }
+
+ public void addText(String text)
+ {
+ FeatureMapUtil.addText(featureMap, text);
+ }
+
+ public void addText(int index, String text)
+ {
+ FeatureMapUtil.addText(featureMap, index, text);
+ }
+
+ public void remove(int index)
+ {
+ featureMap.remove(index);
+ }
+
+ public void move(int toIndex, int fromIndex)
+ {
+ featureMap.move(toIndex, fromIndex);
+ }
+
+ public String toString()
+ {
+ return featureMap.toString();
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/DataGraphResourceFactoryImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/DataGraphResourceFactoryImpl.java
new file mode 100644
index 0000000000..c3f321d9f9
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/DataGraphResourceFactoryImpl.java
@@ -0,0 +1,705 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.util;
+
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.tuscany.sdo.SDOFactory;
+import org.apache.tuscany.sdo.SDOPackage;
+import org.apache.tuscany.sdo.helper.TypeHelperImpl;
+import org.apache.tuscany.sdo.impl.ChangeSummaryImpl;
+import org.apache.tuscany.sdo.impl.DataGraphImpl;
+import org.apache.tuscany.sdo.impl.DynamicDataObjectImpl;
+import org.eclipse.emf.common.util.EMap;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.ecore.util.ExtendedMetaData;
+import org.eclipse.emf.ecore.xmi.EcoreBuilder;
+import org.eclipse.emf.ecore.xmi.NameInfo;
+import org.eclipse.emf.ecore.xmi.XMLHelper;
+import org.eclipse.emf.ecore.xmi.XMLLoad;
+import org.eclipse.emf.ecore.xmi.XMLResource;
+import org.eclipse.emf.ecore.xmi.XMLSave;
+import org.eclipse.emf.ecore.xmi.impl.SAXXMLHandler;
+import org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl;
+import org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl;
+import org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl;
+import org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl;
+import org.eclipse.emf.ecore.xmi.util.DefaultEcoreBuilder;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.xml.sax.InputSource;
+import org.xml.sax.helpers.DefaultHandler;
+
+import commonj.sdo.ChangeSummary;
+import commonj.sdo.helper.TypeHelper;
+
+
+public class DataGraphResourceFactoryImpl extends ResourceFactoryImpl
+{
+ /**
+ * Constructor for DataGraphResourceFactoryImpl.
+ */
+ public DataGraphResourceFactoryImpl()
+ {
+ super();
+ }
+
+ public Resource createResource(URI uri)
+ {
+ XMLResourceImpl result = new DataGraphResourceImpl(uri);
+
+ ExtendedMetaData extendedMetaData = ((TypeHelperImpl)TypeHelper.INSTANCE).getExtendedMetaData();
+ DataObjectUtil.configureXMLResource(result, extendedMetaData);
+
+ result.getDefaultSaveOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE);
+ result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_DEPRECATED_METHODS, Boolean.TRUE);
+ //result.setEncoding("UTF-8");
+ //result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_LEXICAL_HANDLER, Boolean.TRUE);
+ //result.getDefaultSaveOptions().put(XMLResource.OPTION_LINE_WIDTH, new Integer(80));
+
+ return result;
+ }
+
+ public static class DataGraphResourceImpl extends XMLResourceImpl
+ {
+ public DataGraphResourceImpl(URI uri)
+ {
+ super(uri);
+ }
+
+ public static class HelperImpl extends XMLHelperImpl
+ {
+ protected DataGraphImpl eDataGraph;
+
+ protected List resources;
+ protected List uris;
+
+ public HelperImpl(XMLResource xmlResource)
+ {
+ super(xmlResource);
+ }
+
+ public void setResource(XMLResource resource)
+ {
+ super.setResource(resource);
+ if (!resource.getContents().isEmpty())
+ {
+ eDataGraph = (DataGraphImpl)resource.getContents().get(0);
+
+ resources = new ArrayList();
+ uris = new ArrayList();
+
+ resources.add(eDataGraph.getRootResource());
+ uris.add("#" + resource.getURIFragment(eDataGraph) + "/@eRootObject");
+
+ if (eDataGraph.getEChangeSummary() != null)
+ {
+ // Ensure that resource exists.
+ //
+ resources.add(((EObject)eDataGraph.getChangeSummary()).eResource());
+ uris.add("#" + resource.getURIFragment(eDataGraph) + "/@eChangeSummary");
+ }
+
+ if (eDataGraph.eResource() != null && eDataGraph.eResource().getResourceSet() != null)
+ {
+ int count = 0;
+ for (Iterator i = eDataGraph.eResource().getResourceSet().getResources().iterator(); i.hasNext();)
+ {
+ Resource ePackageResource = (Resource)i.next();
+ List resourceContents = ePackageResource.getContents();
+ if (resourceContents.size() == 1 && resourceContents.get(0) instanceof EPackage)
+ {
+ resources.add(ePackageResource);
+ uris.add("#" + resource.getURIFragment(eDataGraph) + "/@models." + count++);
+ }
+ }
+ }
+ }
+ }
+
+ public String getID(EObject eObject)
+ {
+ return super.getID(eObject);
+ }
+
+ public String getIDREF(EObject eObject)
+ {
+ String fragment = super.getIDREF(eObject);
+ if (fragment.startsWith("/"))
+ {
+ int index = resources.indexOf(eObject.eResource());
+ if (index != -1)
+ {
+ fragment = ((String)uris.get(index)).substring(1) + fragment.substring(1);
+ }
+ }
+ return fragment;
+ }
+
+ public String getHREF(EObject eObject)
+ {
+ return super.getHREF(eObject);
+ }
+
+ protected URI getHREF(Resource otherResource, EObject obj)
+ {
+ int index = resources.indexOf(otherResource);
+ if (index == -1)
+ {
+ return super.getHREF(otherResource, obj);
+ }
+ else
+ {
+ return createHREF((String)uris.get(index), otherResource.getURIFragment(obj));
+ }
+ }
+
+ protected URI createHREF(String baseURI, String fragment)
+ {
+ if (fragment.startsWith("/"))
+ {
+ return URI.createURI(baseURI + fragment.substring(1));
+ }
+ else
+ {
+ return URI.createURI("#" + fragment);
+ }
+ }
+
+ public void populateNameInfo(NameInfo nameInfo, EClass c)
+ {
+ if (c == SDOPackage.eINSTANCE.getDataGraph())
+ {
+ if (extendedMetaData != null)
+ {
+ extendedMetaData.demandPackage("commonj.sdo").setNsPrefix("sdo");
+ }
+ nameInfo.setQualifiedName(getQName("commonj.sdo", "datagraph"));
+ nameInfo.setNamespaceURI("commonj.sdo");
+ nameInfo.setLocalPart("datagraph");
+ }
+ else if (c == SDOPackage.eINSTANCE.getChangeSummary())
+ {
+ if (extendedMetaData != null)
+ {
+ extendedMetaData.demandPackage("commonj.sdo").setNsPrefix("sdo");
+ }
+ nameInfo.setQualifiedName("changeSummary");
+ nameInfo.setNamespaceURI(null);
+ nameInfo.setLocalPart("changeSummary");
+ }
+ else
+ {
+ super.populateNameInfo(nameInfo, c);
+ }
+ }
+
+ public String getQName(EClass c)
+ {
+ if (c == SDOPackage.eINSTANCE.getDataGraph())
+ {
+ if (extendedMetaData != null)
+ {
+ extendedMetaData.demandPackage("commonj.sdo").setNsPrefix("sdo");
+ }
+ return getQName("commonj.sdo", "datagraph");
+ }
+ else if (c == SDOPackage.eINSTANCE.getChangeSummary())
+ {
+ if (extendedMetaData != null)
+ {
+ extendedMetaData.demandPackage("commonj.sdo").setNsPrefix("sdo");
+ }
+ return getQName((String)null, "changeSummary");
+ }
+ else
+ {
+ return super.getQName(c);
+ }
+ }
+ }
+
+ protected XMLHelper createXMLHelper()
+ {
+ return new HelperImpl(this);
+ }
+
+ protected EObject getEObjectByID(String id)
+ {
+ List contents = getContents();
+ if (contents.size() >= 1)
+ {
+ Object rootObject = contents.get(0);
+ if (rootObject instanceof DataGraphImpl)
+ {
+ DataGraphImpl eDataGraph = (DataGraphImpl)rootObject;
+ EObject result = eDataGraph.getRootResource().getEObject(id);
+ if (result != null)
+ {
+ return result;
+ }
+ else
+ {
+ ChangeSummary eChangeSummary = eDataGraph.getEChangeSummary();
+ if (eChangeSummary != null)
+ {
+ result = ((EObject)eDataGraph.getChangeSummary()).eResource().getEObject(id);
+ if (result != null)
+ {
+ return result;
+ }
+ }
+ }
+ }
+ }
+ return super.getEObjectByID(id);
+ }
+
+ public static class SaveImpl extends XMLSaveImpl
+ {
+ protected DataGraphImpl eDataGraph;
+
+ public SaveImpl(XMLHelper xmlHelper)
+ {
+ super(xmlHelper);
+ }
+
+ public void traverse(List contents)
+ {
+ if (contents.size() >= 1 && contents.get(0) instanceof DataGraphImpl)
+ {
+ eDataGraph = (DataGraphImpl)contents.get(0);
+
+ Object datagraphMark = null;
+ if (!toDOM)
+ {
+ if (declareXML)
+ {
+ doc.add("<?xml version=\"" + xmlVersion + "\" encoding=\"" + encoding + "\"?>");
+ doc.addLine();
+ }
+ String elementName = helper.getQName(eDataGraph.eClass());
+ doc.startElement(elementName);
+ datagraphMark = doc.mark();
+ }
+ else
+ {
+ helper.populateNameInfo(nameInfo, eDataGraph.eClass());
+ currentNode = document.createElementNS(nameInfo.getNamespaceURI(), nameInfo.getQualifiedName());
+ document.appendChild(currentNode);
+ // not calling handler since there is no corresponding EObject
+ }
+
+ if (eDataGraph.eResource() != null && eDataGraph.eResource().getResourceSet() != null)
+ {
+ List ePackages = new ArrayList();
+ for (Iterator i = eDataGraph.eResource().getResourceSet().getResources().iterator(); i.hasNext();)
+ {
+ List resourceContents = ((Resource)i.next()).getContents();
+ if (resourceContents.size() == 1 && resourceContents.get(0) instanceof EPackage)
+ {
+ ePackages.add(resourceContents.get(0));
+ }
+ }
+ if (!ePackages.isEmpty())
+ {
+ if (!toDOM)
+ {
+ doc.startElement("models");
+ doc.addAttribute("xmlns", "");
+ }
+ else
+ {
+ currentNode = currentNode.appendChild(document.createElementNS(null, "models"));
+ ((Element)currentNode).setAttributeNS(ExtendedMetaData.XMLNS_URI, ExtendedMetaData.XMLNS_PREFIX, "");
+ // not calling handler since there is no corresponding EObject
+ }
+ for (Iterator i = ePackages.iterator(); i.hasNext();)
+ {
+ writeTopObject((EPackage)i.next());
+ }
+ if (!toDOM)
+ {
+ doc.endElement();
+ }
+ else
+ {
+ currentNode = currentNode.getParentNode();
+ }
+ }
+ }
+
+ // use namespace declarations defined in the document (if any)
+ EObject eRootObject = eDataGraph.getERootObject();
+ EReference xmlnsPrefixMapFeature = extendedMetaData.getXMLNSPrefixMapFeature(eRootObject.eClass());
+ if (xmlnsPrefixMapFeature != null)
+ {
+ EMap xmlnsPrefixMap = (EMap)eRootObject.eGet(xmlnsPrefixMapFeature);
+ helper.setPrefixToNamespaceMap(xmlnsPrefixMap);
+ }
+ ChangeSummary changeSummary = eDataGraph.getEChangeSummary();
+
+ if (changeSummary != null)
+ {
+ helper.setMustHavePrefix(true);
+ if (changeSummary.isLogging())
+ {
+ ((ChangeSummaryImpl)changeSummary).summarize();
+ writeTopObject((EObject)changeSummary);
+ }
+ else
+ {
+ writeTopObject((EObject)changeSummary);
+ }
+ helper.setMustHavePrefix(false);
+ }
+
+ if (eRootObject != null && writeTopObject(eRootObject) == null && !toDOM)
+ {
+ doc.addLine();
+ doc.setMixed(false);
+ }
+ if (!toDOM)
+ {
+ doc.endElement();
+ // reset to add namespace declarations
+ //
+ doc.resetToMark(datagraphMark);
+ }
+ else
+ {
+ currentNode = document.getFirstChild();
+ }
+ addNamespaceDeclarations();
+ }
+ else
+ {
+ super.traverse(contents);
+ }
+ }
+
+ protected void writeTopAttributes(EObject top)
+ {
+ if (top == eDataGraph.getEChangeSummary())
+ {
+ if (!toDOM)
+ {
+ doc.addAttribute("xmlns", "");
+ doc.addAttribute("logging", String.valueOf(eDataGraph.getEChangeSummary().isLogging()));
+ }
+ else
+ {
+ ((Element)currentNode).setAttributeNS(ExtendedMetaData.XMLNS_URI, ExtendedMetaData.XMLNS_PREFIX, "");
+ ((Element)currentNode).setAttributeNS("", "logging", String.valueOf(eDataGraph.getEChangeSummary().isLogging()));
+ }
+ }
+ }
+
+ protected EObject getSchemaLocationRoot(EObject eObject)
+ {
+ return eDataGraph.getERootObject();
+ }
+ }
+
+ protected XMLSave createXMLSave()
+ {
+ return new SaveImpl(createXMLHelper());
+ }
+
+ public static class LoadImpl extends XMLLoadImpl
+ {
+ protected boolean resumeLogging = false;
+
+ public void load(XMLResource resource, InputSource inputSource, Map options) throws IOException
+ {
+ super.load(resource, inputSource, options);
+ if (resumeLogging) ((ChangeSummaryImpl)((DataGraphImpl)resource.getContents().get(0)).getChangeSummary()).resumeLogging();
+ }
+
+ public void load(XMLResource resource, InputStream inputStream, Map options) throws IOException
+ {
+ super.load(resource, inputStream, options);
+ if (resumeLogging) ((ChangeSummaryImpl)((DataGraphImpl)resource.getContents().get(0)).getChangeSummary()).resumeLogging();
+ }
+
+ public void load(XMLResource resource, Node node, Map options) throws IOException
+ {
+ super.load(resource, node, options);
+ if (resumeLogging) ((ChangeSummaryImpl)((DataGraphImpl)resource.getContents().get(0)).getChangeSummary()).resumeLogging();
+ }
+
+ public LoadImpl(XMLHelper xmlHelper)
+ {
+ super(xmlHelper);
+ }
+
+ protected DefaultHandler makeDefaultHandler()
+ {
+ return new SAXXMLHandler(resource, helper, options)
+ {
+ protected DataGraphImpl eDataGraph;
+
+ protected boolean isInModels;
+
+ protected List ePackages = new ArrayList();
+
+ protected EObject createDocumentRoot(String prefix, String uri, String name, EFactory eFactory, boolean top)
+ {
+ return null;
+ }
+
+ protected void setAttribValue(EObject object, String name, String value)
+ {
+ if ("logging".equals(name) && object instanceof ChangeSummaryImpl)
+ {
+ resumeLogging = Boolean.valueOf(value).booleanValue();
+ }
+ else
+ {
+ super.setAttribValue(object, name, value);
+ }
+ }
+
+ protected EMap recordNamespacesSchemaLocations(EObject root)
+ {
+ EObject dgroot = eDataGraph.getERootObject();
+ if (dgroot == null)
+ {
+ return null;
+ }
+ EMap prefixToNamespaceMap = super.recordNamespacesSchemaLocations(dgroot);
+ if (prefixToNamespaceMap != null)
+ {
+ for (Iterator i = prefixToNamespaceMap.iterator(); i.hasNext();)
+ {
+ Map.Entry entry = (Map.Entry)i.next();
+ String prefix = (String)entry.getKey();
+ String namespace = (String)entry.getValue();
+ if (namespace.equals("commonj.sdo"))
+ {
+ prefixToNamespaceMap.removeKey(prefix);
+ break;
+ }
+ }
+ }
+ return prefixToNamespaceMap;
+ }
+
+ protected void handleFeature(String prefix, String name)
+ {
+ if (isInModels && objects.size() == 2)
+ {
+ EObject modelObject = createObjectByType(prefix, name, false);
+ processObject(modelObject);
+ ePackages.add(modelObject);
+ }
+ else if (objects.size() == 1)
+ {
+ eDataGraph = (DataGraphImpl)objects.peek();
+ eDataGraph.getResourceSet();
+ if ("".equals(prefix) && "changeSummary".equals(name))
+ {
+ ChangeSummary eChangeSummary = (ChangeSummary)createObjectFromFactory(SDOFactory.eINSTANCE, "ChangeSummary");
+ eDataGraph.setEChangeSummary(eChangeSummary);
+ processObject((EObject)eChangeSummary);
+ }
+ else if ("".equals(prefix) && "models".equals(name))
+ {
+ isInModels = true;
+ types.push(OBJECT_TYPE);
+ objects.push(eDataGraph);
+ mixedTargets.push(null);
+ }
+ else if (eDataGraph.getERootObject() == null)
+ {
+ if (useNewMethods)
+ {
+ handleSchemaLocation();
+ }
+ processSchemaLocations(prefix, name);
+ if (processAnyXML)
+ {
+ // Ensure that anything can be handled, even if it's not recognized.
+ //
+ String namespaceURI = helper.getURI(prefix);
+ if (extendedMetaData.getPackage(namespaceURI) == null)
+ {
+ EStructuralFeature rootFeature = extendedMetaData.demandFeature(namespaceURI, name, true);
+ rootFeature.getEContainingClass().getEPackage().setEFactoryInstance(new DynamicDataObjectImpl.FactoryImpl());
+ }
+ }
+
+ //FB TEMPORARY allow loading proper serialization (global element instead of type name)
+ //FB Proper fix is to reimplement DataGraph as proper DataObject, and remove this entire class
+ EStructuralFeature rootFeature = extendedMetaData.getElement(helper.getURI(prefix), name);
+ if (rootFeature != null) name = rootFeature.getEType().getName();
+
+ EObject rootObject = createObjectByType(prefix, name, false);
+
+ eDataGraph.setERootObject(rootObject);
+ processObject(rootObject);
+ if (rootObject != null
+ && rootObject.eClass() == ExtendedMetaData.INSTANCE.getDocumentRoot(rootObject.eClass().getEPackage()))
+ {
+ super.handleFeature(prefix, name);
+
+ // Remove the document root from the stack.
+ //
+ Object mixedTarget = mixedTargets.pop();
+ Object object = objects.pop();
+ mixedTargets.pop();
+ objects.pop();
+ mixedTargets.push(mixedTarget);
+ objects.push(object);
+ }
+ }
+ }
+ else
+ {
+ super.handleFeature(prefix, name);
+ }
+ }
+
+ public void endElement(String uri, String localName, String name)
+ {
+ if (isInModels && objects.size() == 2)
+ {
+ if (!ePackages.isEmpty())
+ {
+ for (Iterator i = ePackages.iterator(); i.hasNext();)
+ {
+ EPackage ePackage = (EPackage)i.next();
+ ePackage.setEFactoryInstance(new DynamicDataObjectImpl.FactoryImpl());
+ Resource resource = resourceSet.createResource(URI.createURI("*.ecore"));
+ resource.getContents().add(ePackage);
+ if (ePackage.getNsURI() != null)
+ {
+ resource.setURI(URI.createURI(ePackage.getNsURI()));
+ }
+
+ if (extendedMetaData != null)
+ {
+ extendedMetaData.putPackage(extendedMetaData.getNamespace(ePackage), ePackage);
+ }
+ else
+ {
+ packageRegistry.put(ePackage.getNsURI(), ePackage);
+ }
+ }
+ handleForwardReferences();
+ }
+ isInModels = false;
+ }
+ super.endElement(uri, localName, name);
+ }
+
+ protected EPackage getPackageForURI(String uriString)
+ {
+ if ("commonj.sdo".equals(uriString))
+ {
+ return SDOPackage.eINSTANCE;
+ }
+ else
+ {
+ return super.getPackageForURI(uriString);
+ }
+ }
+
+ protected EObject createObjectFromFactory(EFactory factory, String typeName)
+ {
+ if (factory == SDOFactory.eINSTANCE)
+ {
+ if ("datagraph".equals(typeName))
+ {
+ return super.createObjectFromFactory(factory, "DataGraph");
+ }
+ }
+ return super.createObjectFromFactory(factory, typeName);
+ }
+
+ protected EcoreBuilder createEcoreBuilder(Map options, ExtendedMetaData extendedMetaData)
+ {
+ return new DefaultEcoreBuilder(extendedMetaData)
+ {
+ public Collection generate(Map urisToLocations) throws Exception
+ {
+ Collection result = super.generate(urisToLocations);
+ return updateDynamicFactory(result);
+ }
+
+ public Collection generate(Collection urisToLocations) throws Exception
+ {
+ Collection result = super.generate(urisToLocations);
+ return updateDynamicFactory(result);
+ }
+
+ protected Collection updateDynamicFactory(Collection result)
+ {
+ for (Iterator i = result.iterator(); i.hasNext();)
+ {
+ Resource resource = (Resource)i.next();
+ for (Iterator j = EcoreUtil.getObjectsByType(resource.getContents(), EcorePackage.eINSTANCE.getEPackage()).iterator(); j.hasNext();)
+ {
+ EPackage ePackage = (EPackage)j.next();
+ ePackage.setEFactoryInstance(new DynamicDataObjectImpl.FactoryImpl());
+ }
+ }
+ return result;
+ }
+
+ };
+ }
+
+ protected EPackage handleMissingPackage(String uriString)
+ {
+ EPackage result = super.handleMissingPackage(uriString);
+ if (processAnyXML && objects.size() == 1)
+ {
+ result = extendedMetaData.demandPackage(uriString);
+ }
+ return result;
+ }
+ };
+ }
+ }
+
+ protected XMLLoad createXMLLoad()
+ {
+ return new LoadImpl(createXMLHelper());
+ }
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/DataObjectUtil.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/DataObjectUtil.java
new file mode 100644
index 0000000000..8da3b47e6e
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/DataObjectUtil.java
@@ -0,0 +1,2805 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.util;
+
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TimeZone;
+
+import org.apache.tuscany.sdo.SDOExtendedMetaData;
+import org.apache.tuscany.sdo.SDOFactory;
+import org.apache.tuscany.sdo.SDOPackage;
+import org.apache.tuscany.sdo.impl.ClassImpl;
+import org.apache.tuscany.sdo.impl.DataGraphImpl;
+import org.apache.tuscany.sdo.model.ModelFactory;
+import org.apache.tuscany.sdo.model.impl.ModelFactoryImpl;
+import org.apache.tuscany.sdo.util.resource.SDOURIConverterImpl;
+import org.apache.tuscany.sdo.util.resource.SDOXMLResourceFactoryImpl;
+import org.eclipse.emf.common.util.BasicEList;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.common.util.UniqueEList;
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EModelElement;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.emf.ecore.impl.EStringToStringMapEntryImpl;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.ecore.util.ExtendedMetaData;
+import org.eclipse.emf.ecore.util.FeatureMap;
+import org.eclipse.emf.ecore.util.FeatureMapUtil;
+import org.eclipse.emf.ecore.xmi.XMLOptions;
+import org.eclipse.emf.ecore.xmi.XMLParserPool;
+import org.eclipse.emf.ecore.xmi.XMLResource;
+import org.eclipse.emf.ecore.xmi.impl.EMOFResourceFactoryImpl;
+import org.eclipse.emf.ecore.xmi.impl.EcoreResourceFactoryImpl;
+import org.eclipse.emf.ecore.xmi.impl.XMLOptionsImpl;
+import org.eclipse.emf.ecore.xmi.impl.XMLParserPoolImpl;
+import org.eclipse.emf.ecore.xml.type.XMLTypeFactory;
+import org.eclipse.xsd.util.XSDResourceFactoryImpl;
+
+import commonj.sdo.ChangeSummary;
+import commonj.sdo.DataGraph;
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
+import commonj.sdo.Sequence;
+import commonj.sdo.Type;
+import commonj.sdo.helper.DataHelper;
+import commonj.sdo.helper.TypeHelper;
+import commonj.sdo.impl.HelperProvider;
+
+
+public final class DataObjectUtil
+{
+ public static void setString(DataObject dataObject, Property property, String value) {
+ dataObject.set(property, getSetValue(property, value));
+ }
+
+ public static void setShort(DataObject dataObject, Property property, short value) {
+ dataObject.set(property, getSetValue(property, value));
+ }
+
+ public static void setLong(DataObject dataObject, Property property, long value) {
+ dataObject.set(property, getSetValue(property, value));
+ }
+
+ public static void setList(DataObject dataObject, Property property, List value) {
+ dataObject.set(property, value);
+ }
+
+ public static void setInt(DataObject dataObject, Property property, int value) {
+ dataObject.set(property, getSetValue(property, value));
+ }
+
+ public static void setFloat(DataObject dataObject, Property property, float value) {
+ dataObject.set(property, getSetValue(property, value));
+ }
+
+ public static void setDouble(DataObject dataObject, Property property, double value) {
+ dataObject.set(property, getSetValue(property, value));
+ }
+
+ public static void setDate(DataObject dataObject, Property property, Date value) {
+ dataObject.set(property, getSetValue(property, value));
+ }
+
+ public static void setDataObject(DataObject dataObject, Property property, DataObject value) {
+ dataObject.set(property, value);
+ }
+
+ public static void setChar(DataObject dataObject, Property property, char value) {
+ dataObject.set(property, getSetValue(property, value));
+ }
+
+ public static void setBytes(DataObject dataObject, Property property, byte[] value) {
+ dataObject.set(property, getSetValue(property, value));
+ }
+
+ public static void setByte(DataObject dataObject, Property property, byte value) {
+ dataObject.set(property, getSetValue(property, value));
+ }
+
+ public static void setBoolean(DataObject dataObject, Property property, boolean value) {
+ dataObject.set(property, getSetValue(property, value));
+ }
+
+ public static void setBigInteger(DataObject dataObject, Property property, BigInteger value)
+ {
+ dataObject.set(property, getSetValue(property, value));
+ }
+
+ public static void setBigDecimal(DataObject dataObject, Property property, BigDecimal value)
+ {
+ dataObject.set(property, getSetValue(property, value));
+ }
+
+ public static String getString(DataObject dataObject, Property property)
+ {
+ return getString(dataObject.get(property));
+ }
+
+ public static short getShort(DataObject dataObject, Property property)
+ {
+ return getShort(dataObject.get(property));
+ }
+
+ public static Sequence getSequence(DataObject dataObject, Property property)
+ {
+ return (Sequence)dataObject.get(property);
+ }
+
+ public static long getLong(DataObject dataObject, Property property)
+ {
+ return getLong(dataObject.get(property));
+ }
+
+ public static List getList(DataObject dataObject, Property property)
+ {
+ return (List)dataObject.get(property);
+ }
+
+ public static int getInt(DataObject dataObject, Property property)
+ {
+ return getInt(dataObject.get(property));
+ }
+
+ public static float getFloat(DataObject dataObject, Property property)
+ {
+ return getFloat(dataObject.get(property));
+ }
+
+ public static double getDouble(DataObject dataObject, Property property)
+ {
+ return getDouble(dataObject.get(property));
+ }
+
+ public static Date getDate(DataObject dataObject, Property property)
+ {
+ return getDate(dataObject.get(property));
+ }
+
+ public static DataObject getDataObject(DataObject dataObject, Property property)
+ {
+ return (DataObject)dataObject.get(property);
+ }
+
+ public static char getChar(DataObject dataObject, Property property)
+ {
+ return getChar(dataObject.get(property));
+ }
+
+ public static byte[] getBytes(DataObject dataObject, Property property)
+ {
+ return getBytes(dataObject.get(property));
+ }
+
+ public static byte getByte(DataObject dataObject, Property property)
+ {
+ return getByte(dataObject.get(property));
+ }
+
+ public static boolean getBoolean(DataObject dataObject, Property property)
+ {
+ return getBoolean(dataObject.get(property));
+ }
+
+ public static BigInteger getBigInteger(DataObject dataObject, Property property)
+ {
+ return getBigInteger(dataObject.get(property));
+ }
+
+ public static BigDecimal getBigDecimal(DataObject dataObject, Property property)
+ {
+ return getBigDecimal(dataObject.get(property));
+ }
+
+
+ public static void setString(DataObject dataObject, int propertyIndex, String value) {
+ setString(dataObject,getProperty(dataObject, propertyIndex), value);
+ }
+
+ public static void setShort(DataObject dataObject, int propertyIndex, short value) {
+ setShort(dataObject,getProperty(dataObject, propertyIndex), value);
+ }
+
+ public static void setLong(DataObject dataObject, int propertyIndex, long value) {
+ setLong(dataObject,getProperty(dataObject, propertyIndex), value);
+ }
+
+ public static void setList(DataObject dataObject, int propertyIndex, List value) {
+ setList(dataObject,getProperty(dataObject, propertyIndex), value);
+ }
+
+ public static void setInt(DataObject dataObject, int propertyIndex, int value) {
+ setInt(dataObject,getProperty(dataObject, propertyIndex), value);
+ }
+
+ public static void setFloat(DataObject dataObject, int propertyIndex, float value) {
+ setFloat(dataObject,getProperty(dataObject, propertyIndex), value);
+ }
+
+ public static void setDouble(DataObject dataObject, int propertyIndex, double value) {
+ setDouble(dataObject,getProperty(dataObject, propertyIndex), value);
+ }
+
+ public static void setDate(DataObject dataObject, int propertyIndex, Date value) {
+ setDate(dataObject,getProperty(dataObject, propertyIndex), value);
+ }
+
+ public static void setDataObject(DataObject dataObject, int propertyIndex, DataObject value) {
+ dataObject.set(getProperty(dataObject, propertyIndex), value);
+ }
+
+ public static void setChar(DataObject dataObject, int propertyIndex, char value) {
+ setChar(dataObject,getProperty(dataObject, propertyIndex), value);
+ }
+
+ public static void setBytes(DataObject dataObject, int propertyIndex, byte[] value) {
+ setBytes(dataObject,getProperty(dataObject, propertyIndex), value);
+ }
+
+ public static void setByte(DataObject dataObject, int propertyIndex, byte value) {
+ setByte(dataObject,getProperty(dataObject, propertyIndex), value);
+ }
+
+ public static void setBoolean(DataObject dataObject, int propertyIndex, boolean value) {
+ setBoolean(dataObject,getProperty(dataObject, propertyIndex), value);
+ }
+
+ public static void setBigInteger(DataObject dataObject, int propertyIndex, BigInteger value)
+ {
+ setBigInteger(dataObject,getProperty(dataObject, propertyIndex), value);
+ }
+
+ public static void setBigDecimal(DataObject dataObject, int propertyIndex, BigDecimal value)
+ {
+ setBigDecimal(dataObject,getProperty(dataObject, propertyIndex), value);
+ }
+
+ public static String getString(DataObject dataObject, int propertyIndex)
+ {
+ return getString(dataObject.get(getProperty(dataObject, propertyIndex)));
+ }
+
+ public static short getShort(DataObject dataObject, int propertyIndex)
+ {
+ return getShort(dataObject.get(getProperty(dataObject, propertyIndex)));
+ }
+
+
+ public static Sequence getSequence(DataObject dataObject, int propertyIndex)
+ {
+ return (Sequence)dataObject.get(propertyIndex);
+ }
+
+ public static long getLong(DataObject dataObject, int propertyIndex)
+ {
+ return getLong(dataObject.get(getProperty(dataObject, propertyIndex)));
+ }
+
+ public static List getList(DataObject dataObject, int propertyIndex)
+ {
+ return (List)dataObject.get(getProperty(dataObject, propertyIndex));
+ }
+
+ public static int getInt(DataObject dataObject, int propertyIndex)
+ {
+ return getInt(dataObject.get(getProperty(dataObject, propertyIndex)));
+ }
+
+ public static float getFloat(DataObject dataObject, int propertyIndex)
+ {
+ return getFloat(dataObject.get(getProperty(dataObject, propertyIndex)));
+ }
+
+ public static double getDouble(DataObject dataObject, int propertyIndex)
+ {
+ return getDouble(dataObject.get(getProperty(dataObject, propertyIndex)));
+ }
+
+ public static Date getDate(DataObject dataObject, int propertyIndex)
+ {
+ return getDate(dataObject.get(getProperty(dataObject, propertyIndex)));
+ }
+
+ public static DataObject getDataObject(DataObject dataObject, int propertyIndex)
+ {
+ return (DataObject)dataObject.get(getProperty(dataObject, propertyIndex));
+ }
+
+ public static char getChar(DataObject dataObject, int propertyIndex)
+ {
+ return getChar(dataObject.get(getProperty(dataObject, propertyIndex)));
+ }
+
+ public static byte[] getBytes(DataObject dataObject, int propertyIndex)
+ {
+ return getBytes(dataObject.get(getProperty(dataObject, propertyIndex)));
+ }
+
+ public static byte getByte(DataObject dataObject, int propertyIndex)
+ {
+ return getByte(dataObject.get(getProperty(dataObject, propertyIndex)));
+ }
+
+ public static boolean getBoolean(DataObject dataObject, int propertyIndex)
+ {
+ return getBoolean(dataObject.get(getProperty(dataObject, propertyIndex)));
+ }
+
+ public static BigInteger getBigInteger(DataObject dataObject, int propertyIndex)
+ {
+ return getBigInteger(dataObject.get(getProperty(dataObject, propertyIndex)));
+ }
+
+ public static BigDecimal getBigDecimal(DataObject dataObject, int propertyIndex)
+ {
+ return getBigDecimal(dataObject.get(getProperty(dataObject, propertyIndex)));
+ }
+
+ public static void detach(DataObject dataObject) {
+ EcoreUtil.remove((EObject)dataObject);
+ }
+
+ public static DataObject getRootObject(DataObject dataObject)
+ {
+ return (DataObject)EcoreUtil.getRootContainer((EObject)dataObject);
+ }
+
+ public static boolean isInternalProperty(EStructuralFeature eStructuralFeature)
+ {
+ //return FeatureMapUtil.isFeatureMap(eStructuralFeature);
+ return !(eStructuralFeature.getEType() instanceof Type);
+ }
+
+ public static List getInstanceProperties(DataObject dataObject)
+ {
+ Type type = dataObject.getType();
+ List result = new UniqueEList(type.getProperties());
+ ((ClassImpl)type).addOpenProperties((EObject)dataObject, result);
+ return result;
+ }
+
+ public static void delete(DataObject dataObject)
+ {
+ EObject eDataObject = (EObject)dataObject;
+ EcoreUtil.remove(eDataObject);
+ List contents = new ArrayList((eDataObject).eContents());
+ for (int i = 0, size = contents.size(); i < size; ++i)
+ {
+ ((DataObject)contents.get(i)).delete();
+ }
+ EClass eClass = eDataObject.eClass();
+ for (int i = 0, size = eClass.getFeatureCount(); i < size; ++i)
+ {
+ EStructuralFeature eStructuralFeature = eClass.getEStructuralFeature(i);
+ if (eStructuralFeature.isChangeable() && !eStructuralFeature.isDerived() && !((Property)eStructuralFeature).isReadOnly())
+ {
+ eDataObject.eUnset(eStructuralFeature);
+ }
+ }
+ }
+
+ public static DataObject createDataObject(DataObject dataObject, Property property, Type type)
+ {
+ if (!property.isContainment())
+ {
+ throw new IllegalArgumentException("The property '" + property.getName() + "' of '" + property.getContainingType().getName()
+ + "' isn't a containment");
+ }
+ DataObject result = DataObjectUtil.create(type);
+ if (FeatureMapUtil.isMany((EObject)dataObject, (EStructuralFeature)property))
+ {
+ ((List)dataObject.get(property)).add(result);
+ }
+ else
+ {
+ dataObject.set(property, result);
+ }
+ return result;
+ }
+
+ public static DataObject createDataObject(DataObject dataObject, int propertyIndex, String namespaceURI, String typeName)
+ {
+ Property property = DataObjectUtil.getProperty(dataObject, propertyIndex);
+ Type type = DataObjectUtil.getType(dataObject, namespaceURI, typeName);
+ return createDataObject(dataObject, property, type);
+ }
+
+ public static DataObject createDataObject(DataObject dataObject, String propertyName, String namespaceURI, String typeName)
+ {
+ Property property = getInstanceProperty(dataObject, propertyName);
+ Type type = DataObjectUtil.getType(dataObject, namespaceURI, typeName);
+ return createDataObject(dataObject, property, type);
+ }
+
+ public static DataObject createDataObject(DataObject dataObject, Property property)
+ {
+ Type type = property.getType();
+ return createDataObject(dataObject, property, type);
+ }
+
+ public static DataObject createDataObject(DataObject dataObject, int propertyIndex)
+ {
+ Property property = getProperty(dataObject, propertyIndex);
+ Type type = property.getType();
+ return createDataObject(dataObject,property, type);
+ }
+
+ public static DataObject createDataObject(DataObject dataObject, String propertyName)
+ {
+ Property property = (Property)getInstanceProperty(dataObject, propertyName);
+ Type type = property.getType();
+ return createDataObject(dataObject,property, type);
+ }
+
+ public static void setString(DataObject dataObject, String path, String value)
+ {
+ Property property = dataObject.getType().getProperty(path);
+ if (property != null)
+ {
+ dataObject.set(property, DataObjectUtil.getSetValue(property, value));
+ }
+ else
+ {
+ DataObjectUtil.Accessor accessor = DataObjectUtil.Accessor.create((EObject)dataObject, path);
+ accessor.setAndRecyle(DataObjectUtil.getSetValue(accessor.getProperty(), value));
+ }
+ }
+
+
+ public static void setShort(DataObject dataObject, String path, short value)
+ {
+ Property property = dataObject.getType().getProperty(path);
+ if (property != null)
+ {
+ dataObject.set(property, DataObjectUtil.getSetValue(property, value));
+ }
+ else
+ {
+ DataObjectUtil.Accessor accessor = DataObjectUtil.Accessor.create((EObject)dataObject, path);
+ accessor.setAndRecyle(DataObjectUtil.getSetValue(accessor.getProperty(), value));
+ }
+ }
+
+ public static void setLong(DataObject dataObject, String path, long value)
+ {
+ Property property = dataObject.getType().getProperty(path);
+ if (property != null)
+ {
+ dataObject.set(property, DataObjectUtil.getSetValue(property, value));
+ }
+ else
+ {
+ DataObjectUtil.Accessor accessor = DataObjectUtil.Accessor.create((EObject)dataObject, path);
+ accessor.setAndRecyle(DataObjectUtil.getSetValue(accessor.getProperty(), value));
+ }
+ }
+
+ public static void setList(DataObject dataObject, String path, List value)
+ {
+ dataObject.set(path, value);
+ }
+
+ public static void setInt(DataObject dataObject, String path, int value)
+ {
+ Property property = dataObject.getType().getProperty(path);
+ if (property != null)
+ {
+ dataObject.set(property, DataObjectUtil.getSetValue(property, value));
+ }
+ else
+ {
+ DataObjectUtil.Accessor accessor = DataObjectUtil.Accessor.create((EObject)dataObject, path);
+ accessor.setAndRecyle(DataObjectUtil.getSetValue(accessor.getProperty(), value));
+ }
+ }
+
+ public static void setFloat(DataObject dataObject, String path, float value)
+ {
+ Property property = dataObject.getType().getProperty(path);
+ if (property != null)
+ {
+ dataObject.set(property, DataObjectUtil.getSetValue(property, value));
+ }
+ else
+ {
+ DataObjectUtil.Accessor accessor = DataObjectUtil.Accessor.create((EObject)dataObject, path);
+ accessor.setAndRecyle(DataObjectUtil.getSetValue(accessor.getProperty(), value));
+ }
+ }
+
+ public static void setDouble(DataObject dataObject, String path, double value)
+ {
+ Property property = dataObject.getType().getProperty(path);
+ if (property != null)
+ {
+ dataObject.set(property, DataObjectUtil.getSetValue(property, value));
+ }
+ else
+ {
+ DataObjectUtil.Accessor accessor = DataObjectUtil.Accessor.create((EObject)dataObject, path);
+ accessor.setAndRecyle(DataObjectUtil.getSetValue(accessor.getProperty(), value));
+ }
+ }
+
+ public static void setDate(DataObject dataObject, String path, Date value)
+ {
+ Property property = dataObject.getType().getProperty(path);
+ if (property != null)
+ {
+ dataObject.set(property, DataObjectUtil.getSetValue(property, value));
+ }
+ else
+ {
+ DataObjectUtil.Accessor accessor = DataObjectUtil.Accessor.create((EObject)dataObject, path);
+ accessor.setAndRecyle(DataObjectUtil.getSetValue(accessor.getProperty(), value));
+ }
+ }
+
+ public static void setDataObject(DataObject dataObject, String path, DataObject value)
+ {
+ dataObject.set(path, value);
+ }
+
+ public static void setChar(DataObject dataObject, String path, char value)
+ {
+ Property property = dataObject.getType().getProperty(path);
+ if (property != null)
+ {
+ dataObject.set(property, DataObjectUtil.getSetValue(property, value));
+ }
+ else
+ {
+ DataObjectUtil.Accessor accessor = DataObjectUtil.Accessor.create((EObject)dataObject, path);
+ accessor.setAndRecyle(DataObjectUtil.getSetValue(accessor.getProperty(), value));
+ }
+ }
+
+ public static void setBytes(DataObject dataObject, String path, byte[] value)
+ {
+ Property property = dataObject.getType().getProperty(path);
+ if (property != null)
+ {
+ dataObject.set(property, DataObjectUtil.getSetValue(property, value));
+ }
+ else
+ {
+ DataObjectUtil.Accessor accessor = DataObjectUtil.Accessor.create((EObject)dataObject, path);
+ accessor.setAndRecyle(DataObjectUtil.getSetValue(accessor.getProperty(), value));
+ }
+ }
+
+ public static void setByte(DataObject dataObject, String path, byte value)
+ {
+ Property property = dataObject.getType().getProperty(path);
+ if (property != null)
+ {
+ dataObject.set(property, DataObjectUtil.getSetValue(property, value));
+ }
+ else
+ {
+ DataObjectUtil.Accessor accessor = DataObjectUtil.Accessor.create((EObject)dataObject, path);
+ accessor.setAndRecyle(DataObjectUtil.getSetValue(accessor.getProperty(), value));
+ }
+ }
+
+ public static void setBoolean(DataObject dataObject, String path, boolean value)
+ {
+ Property property = dataObject.getType().getProperty(path);
+ if (property != null)
+ {
+ dataObject.set(property, DataObjectUtil.getSetValue(property, value));
+ }
+ else
+ {
+ DataObjectUtil.Accessor accessor = DataObjectUtil.Accessor.create((EObject)dataObject, path);
+ accessor.setAndRecyle(DataObjectUtil.getSetValue(accessor.getProperty(), value));
+ }
+ }
+
+ public static void setBigInteger(DataObject dataObject, String path, BigInteger value)
+ {
+ Property property = dataObject.getType().getProperty(path);
+ if (property != null)
+ {
+ dataObject.set(property, DataObjectUtil.getSetValue(property, value));
+ }
+ else
+ {
+ DataObjectUtil.Accessor accessor = DataObjectUtil.Accessor.create((EObject)dataObject, path);
+ accessor.setAndRecyle(DataObjectUtil.getSetValue(accessor.getProperty(), value));
+ }
+ }
+
+ public static void setBigDecimal(DataObject dataObject, String path, BigDecimal value)
+ {
+ Property property = dataObject.getType().getProperty(path);
+ if (property != null)
+ {
+ dataObject.set(property, DataObjectUtil.getSetValue(property, value));
+ }
+ else
+ {
+ DataObjectUtil.Accessor accessor = DataObjectUtil.Accessor.create((EObject)dataObject, path);
+ accessor.setAndRecyle(DataObjectUtil.getSetValue(accessor.getProperty(), value));
+ }
+ }
+
+ public static DataGraph getDataGraph(DataObject dataObject)
+ {
+ Resource resource = ((EObject)dataObject).eResource();
+ if (resource != null)
+ {
+ ResourceSet resourceSet = resource.getResourceSet();
+ if (resourceSet != null)
+ {
+ return (DataGraphImpl)EcoreUtil.getAdapter(resourceSet.eAdapters(), DataGraph.class);
+ }
+ }
+ return null;
+ }
+
+ public static ChangeSummary getChangeSummary(DataObject dataObject)
+ {
+ DataGraph dataGraph = getDataGraph(dataObject);
+ if (dataGraph != null)
+ {
+ return dataGraph.getChangeSummary();
+ }
+ else
+ {
+ for (DataObject csDataObject = dataObject; csDataObject != null; csDataObject = csDataObject.getContainer())
+ {
+ Property csp = ((ClassImpl)csDataObject.getType()).getChangeSummaryProperty();
+ if (csp != null) return (ChangeSummary)csDataObject.get(csp);
+ }
+ }
+ return null;
+ }
+
+ public static void unset(DataObject dataObject, String path)
+ {
+ Property property = dataObject.getType().getProperty(path);
+ if (property != null)
+ {
+ dataObject.unset(property);
+ }
+ else
+ {
+ DataObjectUtil.Accessor.create((EObject)dataObject, path).unsetAndRecyle();
+ }
+ }
+
+ public static boolean isSet(DataObject dataObject, String path)
+ {
+ Property property = dataObject.getType().getProperty(path);
+ if (property != null)
+ {
+ return dataObject.isSet(property);
+ }
+ else
+ {
+ return DataObjectUtil.Accessor.create(
+ (EObject)dataObject, path).isSetAndRecyle();
+ }
+ }
+
+ public static void set(DataObject dataObject, String path, Object value)
+ {
+ Property property = dataObject.getType().getProperty(path);
+ if (property != null)
+ {
+ dataObject.set(property, value);
+ }
+ else
+ {
+ DataObjectUtil.Accessor.create(
+ (EObject)dataObject, path).setAndRecyle(value);
+ }
+ }
+
+ public static Object get(DataObject dataObject, String path)
+ {
+ Property property = dataObject.getType().getProperty(path);
+ if (property != null) {
+ return dataObject.get(property);
+ } else {
+ return Accessor.create((EObject)dataObject, path).getAndRecyle();
+ }
+ }
+
+ public static BigDecimal getBigDecimal(Object value)
+ {
+ if (value instanceof BigDecimal)
+ {
+ return (BigDecimal)value;
+ }
+
+ if (value instanceof BigInteger)
+ {
+ return new BigDecimal((BigInteger)value);
+ }
+
+ if (value instanceof Long)
+ {
+ return new BigDecimal(((Long)value).longValue());
+ }
+
+ if (value instanceof Number)
+ {
+ return new BigDecimal(((Number)value).doubleValue());
+ }
+
+ if (value instanceof String)
+ {
+ return new BigDecimal((String)value);
+ }
+
+ if (value == null)
+ {
+ return null;
+ }
+
+ throw new ClassCastException("The value of type '" + value.getClass().getName() + "' cannot be converted to BigDecimal");
+ }
+
+ public static Object getSetValue(Property property, BigDecimal value)
+ {
+ EStructuralFeature eStructuralFeature = (EStructuralFeature)property;
+ EClassifier eType = eStructuralFeature.getEType();
+ if (value == null)
+ {
+ return eType.getDefaultValue();
+ }
+
+ String name = eType.getInstanceClassName();
+ if (name == "java.math.BigDecimal")
+ {
+ return value;
+ }
+
+ if (name == "java.math.BigInteger")
+ {
+ return value.toBigInteger();
+ }
+
+ if (name == "java.lang.Byte" || name == "byte")
+ {
+ return new Byte(value.byteValue());
+ }
+
+ if (name == "java.lang.Double" || name == "double")
+ {
+ return new Double(value.doubleValue());
+ }
+
+ if (name == "java.lang.Float" || name == "float")
+ {
+ return new Float(value.floatValue());
+ }
+
+ if (name == "java.lang.Integer" || name == "int")
+ {
+ return new Integer(value.intValue());
+ }
+
+ if (name == "java.lang.Long" || name == "long")
+ {
+ return new Long(value.longValue());
+ }
+
+ if (name == "java.lang.Short" || name == "short")
+ {
+ return new Short(value.shortValue());
+ }
+
+ if (name == "java.lang.String")
+ {
+ return String.valueOf(value);
+ }
+
+ //Instead of throwing an ClassCastException we will pass the value to the property
+ return value;
+ }
+
+ public static BigInteger getBigInteger(Object value)
+ {
+ if (value instanceof BigInteger)
+ {
+ return (BigInteger)value;
+ }
+
+ if (value instanceof BigDecimal)
+ {
+ return ((BigDecimal)value).toBigInteger();
+ }
+
+ if (value instanceof Number)
+ {
+ return BigInteger.valueOf(((Number)value).longValue());
+ }
+
+ if (value instanceof String)
+ {
+ return new BigInteger((String)value);
+ }
+
+ if (value instanceof byte[])
+ {
+ return new BigInteger((byte[])value);
+ }
+
+ if (value == null)
+ {
+ return null;
+ }
+
+ throw new ClassCastException("The value of type '" + value.getClass().getName() + "' cannot be converted to BigInteger");
+ }
+
+ public static Object getSetValue(Property property, BigInteger value)
+ {
+ EStructuralFeature eStructuralFeature = (EStructuralFeature)property;
+ EClassifier eType = eStructuralFeature.getEType();
+ if (value == null)
+ {
+ return eType.getDefaultValue();
+ }
+
+ String name = eType.getInstanceClassName();
+ if (name == "java.math.BigInteger")
+ {
+ return value;
+ }
+
+ if (name == "java.math.BigDecimal")
+ {
+ return new BigDecimal(value);
+ }
+
+ if (name == "java.lang.Byte" || name == "byte")
+ {
+ return new Byte(value.byteValue());
+ }
+
+ if (name == "java.lang.Double" || name == "double")
+ {
+ return new Double(value.doubleValue());
+ }
+
+ if (name == "java.lang.Float" || name == "float")
+ {
+ return new Float(value.floatValue());
+ }
+
+ if (name == "java.lang.Integer" || name == "int")
+ {
+ return new Integer(value.intValue());
+ }
+
+ if (name == "java.lang.Long" || name == "long")
+ {
+ return new Long(value.longValue());
+ }
+
+ if (name == "java.lang.Short" || name == "short")
+ {
+ return new Short(value.shortValue());
+ }
+
+ if (name == "java.lang.String")
+ {
+ return String.valueOf(value);
+ }
+
+ if (name == "byte[]")
+ {
+ return value.toByteArray();
+ }
+
+ //Instead of throwing an ClassCastException we will pass the value to the property
+ return value;
+ }
+
+ public static boolean getBoolean(Object value)
+ {
+ if (value instanceof Boolean)
+ {
+ return ((Boolean)value).booleanValue();
+ }
+
+ if (value instanceof String)
+ {
+ return Boolean.valueOf((String)value).booleanValue();
+ }
+
+ if (value == null)
+ {
+ return false;
+ }
+
+ throw new ClassCastException("The value of type '" + value.getClass().getName() + "' cannot be converted to boolean");
+ }
+
+ public static Object getSetValue(Property property, boolean value)
+ {
+ EStructuralFeature eStructuralFeature = (EStructuralFeature)property;
+ String name = eStructuralFeature.getEType().getInstanceClassName();
+ if (name == "java.lang.Boolean" || name == "boolean")
+ {
+ return value ? Boolean.TRUE : Boolean.FALSE;
+ }
+
+ if (name == "java.lang.String")
+ {
+ return String.valueOf(value);
+ }
+
+ //Instead of throwing an ClassCastException we will pass the value to the property
+ return value ? Boolean.TRUE : Boolean.FALSE;
+ }
+
+ public static byte getByte(Object value)
+ {
+ if (value instanceof Number)
+ {
+ return ((Number)value).byteValue();
+ }
+
+ if (value instanceof String)
+ {
+ return Byte.parseByte((String)value);
+ }
+
+ if (value == null)
+ {
+ return 0;
+ }
+
+ throw new ClassCastException("The value of type '" + value.getClass().getName() + "' cannot be converted to byte");
+ }
+
+ public static Object getSetValue(Property property, byte value)
+ {
+ EStructuralFeature eStructuralFeature = (EStructuralFeature)property;
+ String name = eStructuralFeature.getEType().getInstanceClassName();
+ if (name == "java.lang.Byte" || name == "byte")
+ {
+ return new Byte(value);
+ }
+
+ if (name == "java.lang.Double" || name == "double")
+ {
+ return new Double(value);
+ }
+
+ if (name == "java.lang.Float" || name == "float")
+ {
+ return new Float(value);
+ }
+
+ if (name == "java.lang.Integer" || name == "int")
+ {
+ return new Integer(value);
+ }
+
+ if (name == "java.lang.Long" || name == "long")
+ {
+ return new Long(value);
+ }
+
+ if (name == "java.lang.Short" || name == "short")
+ {
+ return new Short(value);
+ }
+
+ if (name == "java.math.BigDecimal")
+ {
+ return getBigDecimal(new Byte(value));
+ }
+
+ if (name == "java.math.BigInteger")
+ {
+ return getBigInteger(new Byte(value));
+ }
+
+ if (name == "java.lang.String")
+ {
+ return String.valueOf(value);
+ }
+
+ //Instead of throwing an ClassCastException we will pass the value to the property
+ return new Byte(value);
+ }
+
+ public static byte[] getBytes(Object value)
+ {
+ if (value instanceof byte[])
+ {
+ return (byte[])value;
+ }
+
+ if (value instanceof BigInteger)
+ {
+ return ((BigInteger)value).toByteArray();
+ }
+
+ if (value == null)
+ {
+ return null;
+ }
+
+ throw new ClassCastException("The value of type '" + value.getClass().getName() + "' cannot be converted to byte array");
+ }
+
+ public static Object getSetValue(Property property, byte[] value)
+ {
+ EStructuralFeature eStructuralFeature = (EStructuralFeature)property;
+ EClassifier eType = eStructuralFeature.getEType();
+ if (value == null)
+ {
+ return eType.getDefaultValue();
+ }
+
+ String name = eType.getInstanceClassName();
+ if (name == "byte[]")
+ {
+ return value;
+ }
+
+ if (name == "java.math.BigInteger")
+ {
+ return new BigInteger(value);
+ }
+
+ //Instead of throwing an ClassCastException we will pass the value to the property
+ return value;
+ }
+
+ public static char getChar(Object value)
+ {
+ if (value instanceof Character)
+ {
+ return ((Character)value).charValue();
+ }
+
+ if (value instanceof String)
+ {
+ return ((String)value).charAt(0);
+ }
+
+ if (value == null)
+ {
+ return 0;
+ }
+
+ throw new ClassCastException("The value of type '" + value.getClass().getName() + "' cannot be converted to char");
+ }
+
+ public static Object getSetValue(Property property, char value)
+ {
+ EStructuralFeature eStructuralFeature = (EStructuralFeature)property;
+ String name = eStructuralFeature.getEType().getInstanceClassName();
+ if (name == "java.lang.Character" || name == "char")
+ {
+ return new Character(value);
+ }
+
+ if (name == "java.lang.String")
+ {
+ return String.valueOf(value);
+ }
+
+ //Instead of throwing an ClassCastException we will pass the value to the property
+ return new Character(value);
+ }
+
+ public static Date getDate(Object value)
+ {
+ if (value instanceof String) {
+ return DataHelper.INSTANCE.toDate((String)value);
+ }
+
+ //if (value instanceof XMLCalendar)
+ //{
+ //return ((XMLCalendar)value).getDate();
+ //}
+
+ if (value instanceof Date)
+ {
+ return (Date)value;
+ }
+
+ if (value instanceof Long)
+ {
+ return new Date(((Long)value).longValue());
+ }
+
+ if (value == null)
+ {
+ return null;
+ }
+
+ throw new ClassCastException("The value of type '" + value.getClass().getName() + "' cannot be converted to Date");
+ }
+
+ public static Object getSetValue(Property property, Date value)
+ {
+ EStructuralFeature eStructuralFeature = (EStructuralFeature)property;
+ EClassifier eType = eStructuralFeature.getEType();
+ if (value == null)
+ {
+ return eType.getDefaultValue();
+ }
+
+ String name = eType.getInstanceClassName();
+
+ if (name == "java.lang.String")
+ {
+ String typeName = getDateTypeName((EDataType)eType);
+ if ("DateTime".equals(typeName)) {
+ return DataHelper.INSTANCE.toDateTime(value);
+ }
+ else if ("Day".equals(typeName)) {
+ return DataHelper.INSTANCE.toDay(value);
+ }
+ else if ("Duration".equals(typeName)) {
+ return DataHelper.INSTANCE.toDuration(value);
+ }
+ else if ("Month".equals(typeName)) {
+ return DataHelper.INSTANCE.toMonth(value);
+ }
+ else if ("MonthDay".equals(typeName)) {
+ return DataHelper.INSTANCE.toMonthDay(value);
+ }
+ else if ("Time".equals(typeName)) {
+ return DataHelper.INSTANCE.toTime(value);
+ }
+ else if ("Year".equals(typeName)) {
+ return DataHelper.INSTANCE.toYear(value);
+ }
+ else if ("YearMonth".equals(typeName)) {
+ return DataHelper.INSTANCE.toYearMonth(value);
+ }
+ else if ("YearMonthDay".equals(typeName)) {
+ return DataHelper.INSTANCE.toYearMonthDay(value);
+ }
+ else if ("String".equals(typeName))
+ {
+ return DataHelper.INSTANCE.toDateTime(value);
+ }
+
+ // Instead of throwing an ClassCastException we will pass the value to the property
+ return value;
+ }
+
+ //if (name == "java.util.Date")
+ //{
+ //return new XMLCalendar(value, XMLCalendar.DATE);
+ //}
+
+ if (name == "java.lang.Long" || name == "long")
+ {
+ return new Long(value.getTime());
+ }
+
+ // Instead of throwing an ClassCastException we will pass the value to the property
+ return value;
+ }
+
+ protected static String getDateTypeName(EDataType eDataType)
+ {
+ String name = eDataType.getName();
+ if (("DateTime".equals(name)) ||
+ ("Day".equals(name)) ||
+ ("Duration".equals(name)) ||
+ ("Month".equals(name)) ||
+ ("MonthDay".equals(name)) ||
+ ("Time".equals(name)) ||
+ ("Year".equals(name)) ||
+ ("YearMonth".equals(name)) ||
+ ("YearMonthDay".equals(name)) ||
+ ("String".equals(name)))
+ {
+ return name;
+ }
+
+ EDataType baseType = ExtendedMetaData.INSTANCE.getBaseType(eDataType);
+ if (baseType != null)
+ {
+ return getDateTypeName(baseType);
+ }
+
+ List memberTypes = ExtendedMetaData.INSTANCE.getMemberTypes(eDataType);
+ if (!memberTypes.isEmpty())
+ {
+ for (int i = 0, size = memberTypes.size(); i < size; ++i)
+ {
+ EDataType memberType = (EDataType)memberTypes.get(i);
+ String memberTypeName = getDateTypeName(memberType);
+ if (("DateTime".equals(memberTypeName)) ||
+ ("Day".equals(memberTypeName)) ||
+ ("Duration".equals(memberTypeName)) ||
+ ("Month".equals(memberTypeName)) ||
+ ("MonthDay".equals(memberTypeName)) ||
+ ("Time".equals(memberTypeName)) ||
+ ("Year".equals(memberTypeName)) ||
+ ("YearMonth".equals(memberTypeName)) ||
+ ("YearMonthDay".equals(memberTypeName)) ||
+ ("String".equals(memberTypeName)))
+ {
+ return memberTypeName;
+ }
+ }
+ }
+
+ return "";
+ }
+
+ public static double getDouble(Object value)
+ {
+ if (value instanceof Number)
+ {
+ return ((Number)value).doubleValue();
+ }
+
+ if (value instanceof String)
+ {
+ return Double.parseDouble((String)value);
+ }
+
+ if (value == null)
+ {
+ return 0;
+ }
+
+ throw new ClassCastException("The value of type '" + value.getClass().getName() + "' cannot be converted to double");
+ }
+
+ public static Object getSetValue(Property property, double value)
+ {
+ EStructuralFeature eStructuralFeature = (EStructuralFeature)property;
+ String name = eStructuralFeature.getEType().getInstanceClassName();
+ if (name == "java.lang.Byte" || name == "byte")
+ {
+ return new Byte((byte)value);
+ }
+
+ if (name == "java.lang.Double" || name == "double")
+ {
+ return new Double(value);
+ }
+
+ if (name == "java.lang.Float" || name == "float")
+ {
+ return new Float(value);
+ }
+
+ if (name == "java.lang.Integer" || name == "int")
+ {
+ return new Integer((int)value);
+ }
+
+ if (name == "java.lang.Long" || name == "long")
+ {
+ return new Long((long)value);
+ }
+
+ if (name == "java.lang.Short" || name == "short")
+ {
+ return new Short((short)value);
+ }
+
+ if (name == "java.math.BigDecimal")
+ {
+ return getBigDecimal(new Double(value));
+ }
+
+ if (name == "java.math.BigInteger")
+ {
+ return getBigInteger(new Double(value));
+ }
+
+ if (name == "java.lang.String")
+ {
+ return String.valueOf(value);
+ }
+
+ //Instead of throwing an ClassCastException we will pass the value to the property
+ return new Double(value);
+ }
+
+ public static float getFloat(Object value)
+ {
+ if (value instanceof Number)
+ {
+ return ((Number)value).floatValue();
+ }
+
+ if (value instanceof String)
+ {
+ return Float.parseFloat((String)value);
+ }
+
+ if (value == null)
+ {
+ return 0;
+ }
+
+ throw new ClassCastException("The value of type '" + value.getClass().getName() + "' cannot be converted to float");
+ }
+
+ public static Object getSetValue(Property property, float value)
+ {
+ EStructuralFeature eStructuralFeature = (EStructuralFeature)property;
+ String name = eStructuralFeature.getEType().getInstanceClassName();
+ if (name == "java.lang.Byte" || name == "byte")
+ {
+ return new Byte((byte)value);
+ }
+
+ if (name == "java.lang.Double" || name == "double")
+ {
+ return new Double(value);
+ }
+
+ if (name == "java.lang.Float" || name == "float")
+ {
+ return new Float(value);
+ }
+
+ if (name == "java.lang.Integer" || name == "int")
+ {
+ return new Integer((int)value);
+ }
+
+ if (name == "java.lang.Long" || name == "long")
+ {
+ return new Long((long)value);
+ }
+
+ if (name == "java.lang.Short" || name == "short")
+ {
+ return new Short((short)value);
+ }
+
+ if (name == "java.math.BigDecimal")
+ {
+ return getBigDecimal(new Float(value));
+ }
+
+ if (name == "java.math.BigInteger")
+ {
+ return getBigInteger(new Float(value));
+ }
+
+ if (name == "java.lang.String")
+ {
+ return String.valueOf(value);
+ }
+
+ // Instead of throwing an ClassCastException we will pass the value to the property
+ return new Float(value);
+ }
+
+ public static int getInt(Object value)
+ {
+ if (value instanceof Number)
+ {
+ return ((Number)value).intValue();
+ }
+
+ if (value instanceof String)
+ {
+ return Integer.parseInt((String)value);
+ }
+
+ if (value == null)
+ {
+ return 0;
+ }
+
+ throw new ClassCastException("The value of type '" + value.getClass().getName() + "' cannot be converted to int");
+ }
+
+ public static Object getSetValue(Property property, int value)
+ {
+ EStructuralFeature eStructuralFeature = (EStructuralFeature)property;
+ String name = eStructuralFeature.getEType().getInstanceClassName();
+ if (name == "java.lang.Byte" || name == "byte")
+ {
+ return new Byte((byte)value);
+ }
+
+ if (name == "java.lang.Double" || name == "double")
+ {
+ return new Double(value);
+ }
+
+ if (name == "java.lang.Float" || name == "float")
+ {
+ return new Float(value);
+ }
+
+ if (name == "java.lang.Integer" || name == "int")
+ {
+ return new Integer(value);
+ }
+
+ if (name == "java.lang.Long" || name == "long")
+ {
+ return new Long(value);
+ }
+
+ if (name == "java.lang.Short" || name == "short")
+ {
+ return new Short((short)value);
+ }
+
+ if (name == "java.math.BigDecimal")
+ {
+ return getBigDecimal(new Integer(value));
+ }
+
+ if (name == "java.math.BigInteger")
+ {
+ return getBigInteger(new Integer(value));
+ }
+
+ if (name == "java.lang.String")
+ {
+ return String.valueOf(value);
+ }
+
+ // Instead of throwing an ClassCastException we will pass the value to the property
+ return new Integer(value);
+ }
+
+ public static long getLong(Object value)
+ {
+ if (value instanceof Number)
+ {
+ return ((Number)value).longValue();
+ }
+
+ if (value instanceof String)
+ {
+ return Long.parseLong((String)value);
+ }
+
+ if (value instanceof Date)
+ {
+ return ((Date)value).getTime();
+ }
+
+ if (value == null)
+ {
+ return 0;
+ }
+
+ throw new ClassCastException("The value of type '" + value.getClass().getName() + "' cannot be converted to long");
+ }
+
+ public static Object getSetValue(Property property, long value)
+ {
+ EStructuralFeature eStructuralFeature = (EStructuralFeature)property;
+ String name = eStructuralFeature.getEType().getInstanceClassName();
+ if (name == "java.lang.Byte" || name == "byte")
+ {
+ return new Byte((byte)value);
+ }
+
+ if (name == "java.lang.Double" || name == "double")
+ {
+ return new Double(value);
+ }
+
+ if (name == "java.lang.Float" || name == "float")
+ {
+ return new Float(value);
+ }
+
+ if (name == "java.lang.Integer" || name == "int")
+ {
+ return new Integer((int)value);
+ }
+
+ if (name == "java.lang.Long" || name == "long")
+ {
+ return new Long(value);
+ }
+
+ if (name == "java.lang.Short" || name == "short")
+ {
+ return new Short((short)value);
+ }
+
+ if (name == "java.math.BigDecimal")
+ {
+ return getBigDecimal(new Long(value));
+ }
+
+ if (name == "java.math.BigInteger")
+ {
+ return getBigInteger(new Long(value));
+ }
+
+ if (name == "java.lang.String")
+ {
+ return String.valueOf(value);
+ }
+
+ if (name == "java.util.Date")
+ {
+ return new Date(value);
+ }
+
+ // Instead of throwing an ClassCastException we will pass the value to the property
+ return new Long(value);
+ }
+
+ public static short getShort(Object value)
+ {
+ if (value instanceof Number)
+ {
+ return ((Number)value).shortValue();
+ }
+
+ if (value instanceof String)
+ {
+ return Short.parseShort((String)value);
+ }
+
+ if (value == null)
+ {
+ return 0;
+ }
+
+ throw new ClassCastException("The value of type '" + value.getClass().getName() + "' cannot be converted to short");
+ }
+
+ public static Object getSetValue(Property property, short value)
+ {
+ EStructuralFeature eStructuralFeature = (EStructuralFeature)property;
+ String name = eStructuralFeature.getEType().getInstanceClassName();
+ if (name == "java.lang.Byte" || name == "byte")
+ {
+ return new Byte((byte)value);
+ }
+
+ if (name == "java.lang.Double" || name == "double")
+ {
+ return new Double(value);
+ }
+
+ if (name == "java.lang.Float" || name == "float")
+ {
+ return new Float(value);
+ }
+
+ if (name == "java.lang.Integer" || name == "int")
+ {
+ return new Integer(value);
+ }
+
+ if (name == "java.lang.Long" || name == "long")
+ {
+ return new Long(value);
+ }
+
+ if (name == "java.lang.Short" || name == "short")
+ {
+ return new Short(value);
+ }
+
+ if (name == "java.math.BigDecimal")
+ {
+ return getBigDecimal(new Short(value));
+ }
+
+ if (name == "java.math.BigInteger")
+ {
+ return getBigInteger(new Short(value));
+ }
+
+ if (name == "java.lang.String")
+ {
+ return String.valueOf(value);
+ }
+
+ // Instead of throwing an ClassCastException we will pass the value to the property
+ return new Short(value);
+ }
+
+ public static String getString(Object value)
+ {
+ if (value instanceof String)
+ {
+ return (String)value;
+ }
+
+ if (value instanceof Number || value instanceof Boolean || value instanceof Character)
+ {
+ return String.valueOf(value);
+ }
+
+ if (value instanceof Date)
+ {
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy'-'MM'-'dd'T'H':'mm':'ss.S'Z'");
+ sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
+ return sdf.format((Date) value);
+ }
+
+ if (value instanceof byte[]) {
+ return XMLTypeFactory.eINSTANCE.convertHexBinary((byte[])value);
+ }
+
+ if (value == null)
+ {
+ return null;
+ }
+
+ throw new ClassCastException("The value of type '" + value.getClass().getName() + "' cannot be converted to String");
+ }
+
+ public static Object getSetValue(Property property, String value)
+ {
+ EStructuralFeature eStructuralFeature = (EStructuralFeature)property;
+ EClassifier eType = eStructuralFeature.getEType();
+ if (value == null)
+ {
+ return eType.getDefaultValue();
+ }
+
+ String name = eType.getInstanceClassName();
+ if (name == "java.lang.String")
+ {
+ return value;
+ }
+
+ if (name == "java.lang.Byte" || name == "byte")
+ {
+ return Byte.valueOf(value);
+ }
+
+ if (name == "java.util.Date")
+ {
+ return DataHelper.INSTANCE.toDate(value);
+ }
+
+ if (name == "java.lang.Double" || name == "double" || name == "java.lang.Number")
+ {
+ return Double.valueOf(value);
+ }
+
+ if (name == "java.lang.Float" || name == "float")
+ {
+ return new Float(value);
+ }
+
+ if (name == "java.lang.Integer" || name == "int")
+ {
+ return Integer.valueOf(value);
+ }
+
+ if (name == "java.lang.Long" || name == "long")
+ {
+ return Long.valueOf(value);
+ }
+
+ if (name == "java.lang.Short" || name == "short")
+ {
+ return Short.valueOf(value);
+ }
+
+ if (name == "java.lang.Character" || name == "char")
+ {
+ return new Character(value.charAt(0));
+ }
+
+ if (name == "java.math.BigDecimal")
+ {
+ return getBigDecimal(value);
+ }
+
+ if (name == "java.math.BigInteger")
+ {
+ return getBigInteger(value);
+ }
+
+ if (name == "java.lang.Boolean" || name == "boolean")
+ {
+ return Boolean.valueOf(value);
+ }
+
+ // Instead of throwing an ClassCastException we will pass the value to the property
+ return value;
+ }
+
+ public static EStructuralFeature getOpenFeature(EObject eObject, int featureID)
+ {
+ EClass eClass = eObject.eClass();
+ int openFeatureCount = featureID - eClass.getFeatureCount();
+ Set openFeatureSet = new HashSet();
+ for (int i = 0, count = eClass.getEAllStructuralFeatures().size(); i < count; ++i)
+ {
+ EStructuralFeature eStructuralFeature = eClass.getEStructuralFeature(i);
+ if (!eStructuralFeature.isDerived() && FeatureMapUtil.isFeatureMap(eStructuralFeature))
+ {
+ List features = (List)eObject.eGet(eStructuralFeature);
+ for (int j = 0, size = features.size(); j < size; ++j)
+ {
+ FeatureMap.Entry entry = (FeatureMap.Entry)features.get(j);
+ EStructuralFeature entryFeature = entry.getEStructuralFeature();
+ if (openFeatureSet.add(entryFeature))
+ {
+ if (--openFeatureCount < 0) return entryFeature;
+ }
+ }
+ }
+ }
+ throw new IndexOutOfBoundsException();
+ }
+
+ public static List getAliasNames(EStructuralFeature eStructuralFeature)
+ {
+ List list = SDOExtendedMetaData.INSTANCE.getAliasNames(eStructuralFeature);
+ if (list == null) {
+ list = new ArrayList();
+ }
+ return list;
+ }
+
+ public static List getAliasNames(EClassifier eClassifier)
+ {
+ List list = SDOExtendedMetaData.INSTANCE.getAliasNames(eClassifier);
+ if (list == null) {
+ list = new ArrayList();
+ }
+ return list;
+ }
+
+ /**
+ * Process the default EMF path and minimal XPath syntax.
+ * This design is still under review and construction.
+ *
+ * Syntax:
+ *
+ *<pre>
+ * path = /? (step '/')* step
+ * step = feature
+ * | feature '.' index_from_0
+ * | feature '[' index_from_1 ']'
+ * | reference '[' attribute '=' value ']'
+ * | ..
+ * | '@' step
+ *</pre>
+ *
+ * feature = the name of an attribute or reference
+ * attribute = the name of an attribute
+ * reference = the name of a reference
+ * index = positive integer
+ * value = the string value of an attribute
+ * leading / begins at the root
+ * .. is containing object
+ *
+ * features must be multi-valued to use '.' and '[' operations.
+ * Only the last step may have an attribute as the feature.
+ */
+ public static final class Accessor //TODO rewrite this using SDO APIs
+ {
+ /**
+ * Creates an accessor for the path of the object.
+ */
+ public static Accessor create(EObject eObject, String path)
+ {
+ Accessor result = pool.get();
+ result.init(eObject, path);
+ return result;
+ }
+
+ /**
+ * Only the get and recycle methods should be call; they are the only synchronized methods.
+ */
+ protected static class Pool extends BasicEList
+ {
+ protected Accessor[] accessors;
+
+ public Pool()
+ {
+ super(10);
+ }
+
+ protected Object[] newData(int capacity)
+ {
+ return accessors = new Accessor [capacity];
+ }
+
+ /**
+ * Returns a recyled instance or a new instance.
+ */
+ public synchronized Accessor get()
+ {
+ if (size > 0)
+ {
+ return accessors[--size];
+ }
+ else
+ {
+ return new Accessor();
+ }
+ }
+
+ /** Safely gives the accessor back for recycled use.
+ */
+ public synchronized void recycle(Accessor accessor)
+ {
+ int minimumCapacity = size + 1;
+ if (minimumCapacity > data.length)
+ {
+ grow(minimumCapacity);
+ }
+ accessors[size++] = accessor;
+ }
+ }
+
+ /**
+ * A static thread safe pool of Accessors.
+ */
+ static final Pool pool = new Pool();
+
+ protected static final int NO_INDEX = -1;
+
+ protected EObject eObject;
+
+ protected EStructuralFeature feature;
+
+ protected int index;
+
+ RuntimeException runtimeException;
+
+ protected Accessor()
+ {
+ }
+
+ protected Accessor(EObject eObject, String path)
+ {
+ init(eObject, path);
+ }
+
+ protected void init(EObject eObject, String path)
+ {
+ this.eObject = eObject;
+ runtimeException = null;
+
+ // This should only be called with a path right now.
+ //
+ //feature = getType(eObject).getProperty(path).getEStructuralFeature();
+ //if (feature == null)
+ {
+ process(path);
+ }
+ //else
+ {
+ //index = NO_INDEX;
+ }
+ }
+
+ public Object get()
+ {
+ if (feature == null)
+ {
+ return eObject;
+ }
+ else
+ {
+ Object value = eObject.eGet(feature, true);
+ if (index >= 0)
+ {
+ value = ((List)value).get(index);
+ if (value instanceof FeatureMap.Entry)
+ {
+ value = ((FeatureMap.Entry)value).getValue();
+ }
+ }
+ else if (FeatureMapUtil.isFeatureMap(feature))
+ {
+ value = new BasicSequence((FeatureMap.Internal)value);
+ }
+ return value;
+ }
+ }
+
+ public Object getAndRecyle()
+ {
+ Object result = get();
+ pool.recycle(this);
+ return result;
+ }
+
+ protected final void assertSuccessfulProcess()
+ {
+ if (runtimeException != null)
+ throw runtimeException;
+ }
+
+ public void set(Object newValue)
+ {
+ assertSuccessfulProcess();
+ if (index >= 0)
+ {
+ List list = (List)eObject.eGet(feature, true);
+ list.set(index, newValue);
+ }
+ else
+ {
+ // EATM newValue = string2Enum(feature, newValue);
+ eObject.eSet(feature, newValue);
+ }
+ }
+
+ public void setAndRecyle(Object newValue)
+ {
+ set(newValue);
+ pool.recycle(this);
+ }
+
+ public boolean isSet()
+ {
+ return feature != null && eObject.eIsSet(feature);
+ }
+
+ public boolean isSetAndRecyle()
+ {
+ boolean result = isSet();
+ pool.recycle(this);
+ return result;
+ }
+
+ public void unset()
+ {
+ assertSuccessfulProcess();
+ eObject.eUnset(feature);
+ }
+
+ public void unsetAndRecyle()
+ {
+ unset();
+ pool.recycle(this);
+ }
+
+ public void recycle()
+ {
+ pool.recycle(this);
+ }
+
+ public EObject getEObject()
+ {
+ return eObject;
+ }
+
+ protected void setEObject(EObject eObject)
+ {
+ this.eObject = eObject;
+ feature = null;
+ index = NO_INDEX;
+ }
+
+ public EStructuralFeature getEStructuralFeature()
+ {
+ return feature;
+ }
+
+ public Property getProperty()
+ {
+ assertSuccessfulProcess();
+ return (Property)feature;
+ }
+
+ protected void setFeatureName(String name)
+ {
+ if (name != null)
+ {
+ feature = (EStructuralFeature)((DataObject)eObject).getInstanceProperty(name);
+ if (feature == null)
+ {
+ int index = name.lastIndexOf('.');
+ if (index == -1)
+ runtimeException = new IllegalArgumentException("Class '" + eObject.eClass().getName() + "' does not have a feature named '" + name + '\'');
+ else
+ {
+ int propertyNameEnd = index;
+ try
+ {
+ index = Integer.parseInt(name.substring(++index));
+ // NumberFormatException may be thrown
+ String propertyName = name.substring(0, propertyNameEnd);
+ feature = (EStructuralFeature)((DataObject)eObject).getInstanceProperty(propertyName);
+ if (feature != null)
+ {
+ setIndex(index);
+ return;
+ }
+ runtimeException = new IllegalArgumentException("Class '" + eObject.eClass().getName() + "' does not have a feature named '" + name + "' or '" + propertyName + '\'');
+ }
+ catch(NumberFormatException eNumberFormat)
+ {
+ runtimeException = eNumberFormat;
+ }
+ }
+ setEObject(null);
+ }
+ }
+ else
+ {
+ feature = null;
+ }
+ index = NO_INDEX;
+ }
+
+ protected int getIndex()
+ {
+ return index;
+ }
+
+ /*
+ * calling constraint, this method is not to be used for semantic of setting index to NO_INDEX
+ */
+ protected void setIndex(int index)
+ {
+ if (index < 0) {
+ // The index value should not be less than 0.
+ runtimeException = new IndexOutOfBoundsException("Index value is too low");
+ setEObject(null);
+ return;
+ }
+ if (!FeatureMapUtil.isMany(eObject, feature))
+ {
+ runtimeException = new IndexOutOfBoundsException("Index applies only to multi-valued features");
+ setEObject(null);
+ return;
+ }
+ int size = ((List) eObject.eGet(feature)).size();
+ if (index >= size)
+ {
+ // The index value should be less than size.
+ runtimeException = new IndexOutOfBoundsException("Index value should have been less than " + size);
+ setEObject(null);
+ }
+ this.index = index;
+ }
+
+ protected void process(String pathString)
+ {
+ TokenList tokens = new TokenList(pathString.toCharArray());
+ String token;
+ int size = tokens.size();
+ int x = 0;
+
+ if ("/".equals(tokens.peek(0)))
+ {
+ setEObject(EcoreUtil.getRootContainer(eObject));
+ x++;
+ }
+
+ for (; x < size; x++)
+ {
+ token = tokens.peek(x);
+ char c = token.charAt(0);
+ if ('/' == c)
+ {
+ setEObject((EObject)get());
+ if (eObject == null) break;
+ }
+ else if ("..".equals(token))
+ {
+ setEObject(eObject.eContainer());
+ if (eObject == null) break;
+ }
+ else if ('[' == c)
+ {
+ x++; // skip [
+ token = tokens.peek(x); // name or index
+ char following = tokens.peek(x + 1).charAt(0);
+ if ('=' != following)
+ {
+ try
+ {
+ setIndex(Integer.parseInt(token) - 1);
+ // runtimeException may be recorded
+ }
+ catch(NumberFormatException eNumberFormat)
+ {
+ runtimeException = eNumberFormat;
+ setEObject(null);
+ break;
+ }
+ if (runtimeException != null)
+ break;
+ x++; // skip ]
+ }
+ else
+ {
+ x++; // done name
+ x++; // skip =
+ String attributeValue = tokens.peek(x); // value
+ if ("\"".equals(attributeValue))
+ {
+ x++; // skip "
+ attributeValue = tokens.peek(++x);
+ }
+ x++; // skip ]
+ int index = matchingIndex((List)get(), token, attributeValue);
+ if (index < 0)
+ {
+ setEObject(null);
+ break;
+ }
+ else
+ {
+ setIndex(index);
+ }
+ }
+ }
+ else if ('@' == c)
+ {
+ // skip @
+ }
+ else
+ {
+ setFeatureName(token);
+ if (eObject == null) break;
+ }
+ }
+ }
+
+ protected static int matchingIndex(List dataObjects, String attributeName, String attributeValue)
+ {
+ for (int i = 0, size = dataObjects.size(); i < size; i++)
+ {
+ DataObject dataObject = (DataObject)dataObjects.get(i);
+ Property property = getInstanceProperty(dataObject, attributeName);
+ if (property != null)
+ {
+ Object test = dataObject.get(property);
+ if (test != null)
+ {
+ String testString = EcoreUtil.convertToString((EDataType)property.getType(), test);
+ if (attributeValue.equals(testString))
+ {
+ return i;
+ }
+ }
+ }
+ }
+ return -1;
+ }
+
+ protected static class TokenList extends BasicEList
+ {
+ public TokenList(char[] path)
+ {
+ super(4);
+
+ int pathLength = path.length;
+ StringBuffer token = new StringBuffer();
+ char cPrev;
+ char c = 0;
+ char cNext;
+ char stringConstant = 0;
+ for (int pos = 0; pos < pathLength; pos++)
+ {
+ cPrev = c;
+ c = path[pos];
+ cNext = pos < pathLength - 1 ? path[pos + 1] : 0;
+
+ if (stringConstant != 0)
+ {
+ if (c == stringConstant)
+ {
+ endToken(token, true);
+ stringConstant = 0;
+ }
+ else
+ {
+ token.append(c);
+ }
+ }
+ else
+ {
+ switch (c)
+ {
+ case ' ':
+ case 0xA:
+ case 0xD:
+ case 0x9:
+ if (cPrev != ' ')
+ {
+ endToken(token, false);
+ }
+ c = ' ';
+ break;
+
+ case '"':
+ case '\'':
+ endToken(token, false);
+ stringConstant = c;
+ break;
+
+ // double or single tokens
+ case '/':
+ case ':':
+ if (cPrev != c)
+ {
+ endToken(token, false);
+ }
+ token.append(c);
+ if (cNext != c)
+ {
+ endToken(token, false);
+ }
+ break;
+
+ // double token (..)
+ case '.':
+ if (cNext == '.')
+ endToken(token, false);
+ token.append(c);
+ if (cPrev == '.')
+ endToken(token, false);
+ break;
+
+ // single tokens
+ case '*':
+ case '@':
+ case '[':
+ case ']':
+ case '(':
+ case ')':
+ case '|':
+ endToken(token, false);
+ add(String.valueOf(c));
+ break;
+
+ // TODO: < > <= >= + - !=
+ case '!':
+ endToken(token, false);
+ token.append(c);
+ break;
+
+ case '=':
+ endToken(token, false);
+ add(String.valueOf(c));
+ break;
+
+ default:
+ token.append(c);
+ }
+ }
+ }
+ endToken(token, false);
+ }
+
+ public String peek()
+ {
+ return size > 0 ? (String)data[0] : " ";
+ }
+
+ public String peek(int index)
+ {
+ return index < size ? (String)data[index] : " ";
+ }
+
+ public TokenList pop()
+ {
+ remove(0);
+ return this;
+ }
+
+ public TokenList pop(int count)
+ {
+ while (count-- > 0)
+ {
+ remove(count);
+ }
+ return this;
+ }
+
+ protected void endToken(StringBuffer token, boolean includeEmpty)
+ {
+ if (includeEmpty || token.length() > 0)
+ {
+ add(token.toString());
+ }
+ token.setLength(0);
+ }
+
+ protected boolean canContainNull()
+ {
+ return false;
+ }
+
+ protected Object[] newData(int capacity)
+ {
+ return new String [capacity];
+ }
+ }
+
+ public String toString()
+ {
+ StringBuffer result = new StringBuffer("Accessor (object:");
+ result.append(eObject == null ? "null" : eObject.toString());
+ result.append(", feature:");
+ result.append(feature == null ? "null" : feature.getName());
+ result.append(", index:");
+ result.append(index);
+ result.append(")");
+ return result.toString();
+ }
+ }
+
+ public static Type getType(DataObject dataObject, String namespaceURI, String typeName)
+ {
+ DataGraph dataGraph = dataObject.getDataGraph();
+ if (dataGraph != null)
+ {
+ return dataGraph.getType(namespaceURI, typeName);
+ }
+ else
+ {
+ //TODO think about where else to find the type
+ return TypeHelper.INSTANCE.getType(namespaceURI, typeName);
+ }
+ }
+
+ public static Property getInstanceProperty(DataObject dataObject, String propertyName)
+ {
+ ClassImpl type = (ClassImpl)dataObject.getType();
+ Property property = type.getProperty(propertyName);
+ if (property == null)
+ {
+ property = type.getOpenProperty((EObject)dataObject, propertyName);
+ //throw new IllegalArgumentException("Type '" + dataObject.getType().getName() + "' does not have a property named '" + propertyName + "'");
+ }
+
+ return property;
+ }
+
+ public static Property getProperty(DataObject dataObject, int propertyIndex)
+ {
+ List typeProperties = dataObject.getType().getProperties();
+
+ Property property = propertyIndex < typeProperties.size() ?
+ (Property)typeProperties.get(propertyIndex) :
+ (Property)dataObject.getInstanceProperties().get(propertyIndex);
+
+ //FB maybe should catch bad index exception and throw IllegalArgumentException?
+ return property;
+ }
+
+ public static Property getContainmentProperty(Property property)
+ {
+ if (property.isContainment())
+ {
+ return property;
+ }
+ throw new IllegalArgumentException("The property '" + property.getName() + "' of '" + property.getContainingType().getName()
+ + "' isn't a containment");
+ }
+
+ public static DataObject create(Type type)
+ {
+ return (DataObject)EcoreUtil.create((EClass)type);
+ }
+
+ public static ResourceSet createResourceSet()
+ {
+ ResourceSet result = new ResourceSetImpl();
+ configureResourceSet(result);
+ return result;
+ }
+
+ protected static Map registrations;
+
+ protected static Map getRegistrations()
+ {
+ if (registrations == null)
+ {
+ Map result = new HashMap();
+
+ Resource.Factory factory = Resource.Factory.Registry.INSTANCE.getFactory(URI.createURI("*.datagraph"));
+ result.put("datagraph", factory instanceof DataGraphResourceFactoryImpl ? factory : new DataGraphResourceFactoryImpl());
+
+ factory = Resource.Factory.Registry.INSTANCE.getFactory(URI.createURI("*.ecore"));
+ result.put("ecore", factory instanceof EcoreResourceFactoryImpl ? factory : new EcoreResourceFactoryImpl());
+
+ factory = Resource.Factory.Registry.INSTANCE.getFactory(URI.createURI("*.emof"));
+ result.put("emof", factory instanceof EMOFResourceFactoryImpl ? factory : new EMOFResourceFactoryImpl());
+
+ factory = Resource.Factory.Registry.INSTANCE.getFactory(URI.createURI("*.xsd"));
+ result.put("xsd", factory instanceof XSDResourceFactoryImpl ? factory : new XSDResourceFactoryImpl());
+
+ factory = Resource.Factory.Registry.INSTANCE.getFactory(URI.createURI("*.wsdl"));
+ result.put("wsdl", factory instanceof XSDResourceFactoryImpl ? factory : new XSDResourceFactoryImpl());
+
+ factory = Resource.Factory.Registry.INSTANCE.getFactory(URI.createURI("*.*"));
+ result.put("*", factory instanceof SDOXMLResourceFactoryImpl ? factory : new SDOXMLResourceFactoryImpl());
+
+ registrations = result;
+ }
+
+ return registrations;
+ }
+
+ protected static void configureResourceSet(ResourceSet resourceSet)
+ {
+ resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().putAll(getRegistrations());
+// resourceSet.setURIConverter(new SDOURIConverterImpl());
+ }
+
+ public static EClass createDocumentRoot()
+ {
+ EClass documentRootEClass = (EClass)SDOFactory.eINSTANCE.createClass();
+ documentRootEClass.setName("DocumentRoot");
+ ExtendedMetaData.INSTANCE.setName(documentRootEClass, "");
+ ExtendedMetaData.INSTANCE.setContentKind(documentRootEClass, ExtendedMetaData.MIXED_CONTENT);
+
+ EAttribute mixed = (EAttribute)SDOFactory.eINSTANCE.createAttribute();
+ mixed.setName("mixed");
+ mixed.setEType(EcorePackage.eINSTANCE.getEFeatureMapEntry());
+ mixed.setUpperBound(EStructuralFeature.UNBOUNDED_MULTIPLICITY);
+ ExtendedMetaData.INSTANCE.setName(mixed, ":mixed");
+ ExtendedMetaData.INSTANCE.setFeatureKind(mixed, ExtendedMetaData.ELEMENT_WILDCARD_FEATURE);
+ documentRootEClass.getEStructuralFeatures().add(mixed);
+
+ EReference xmlnsPrefixMap = (EReference)SDOFactory.eINSTANCE.createReference();
+ xmlnsPrefixMap.setName("xMLNSPrefixMap");
+ xmlnsPrefixMap.setEType(EcorePackage.eINSTANCE.getEStringToStringMapEntry());
+ xmlnsPrefixMap.setUpperBound(EStructuralFeature.UNBOUNDED_MULTIPLICITY);
+ xmlnsPrefixMap.setContainment(true);
+ xmlnsPrefixMap.setTransient(true);
+ ExtendedMetaData.INSTANCE.setName(xmlnsPrefixMap, "xmlns:prefix");
+ ExtendedMetaData.INSTANCE.setFeatureKind(xmlnsPrefixMap, ExtendedMetaData.ATTRIBUTE_FEATURE);
+ documentRootEClass.getEStructuralFeatures().add(xmlnsPrefixMap);
+
+ EReference xsiSchemaLocation = (EReference)SDOFactory.eINSTANCE.createReference();
+ xsiSchemaLocation.setName("xSISchemaLocation");
+ xsiSchemaLocation.setEType(EcorePackage.eINSTANCE.getEStringToStringMapEntry());
+ xsiSchemaLocation.setUpperBound(EStructuralFeature.UNBOUNDED_MULTIPLICITY);
+ xsiSchemaLocation.setContainment(true);
+ xsiSchemaLocation.setTransient(true);
+ ExtendedMetaData.INSTANCE.setName(xsiSchemaLocation, "xsi:schemaLocation");
+ ExtendedMetaData.INSTANCE.setFeatureKind(xsiSchemaLocation, ExtendedMetaData.ATTRIBUTE_FEATURE);
+ documentRootEClass.getEStructuralFeatures().add(xsiSchemaLocation);
+
+ return documentRootEClass;
+ }
+
+ /**
+ * Configure EMF to support the SDO runtime by registering a specialized Ecore factory, SDOEcoreFactory.
+ * This static initializion must run before any SDO metadata is created or loaded.
+ * As long as SDO helper classes (e.g., TypeHelper, XMLHelper, etc.) are accessed though their
+ * corresponding INSTANCE fields (e.g., TypeHelper.INSTANCE), or using the SDOUtil methods (e.g.,
+ * SDOUtil.createTypeHelper(), this will always be the case.
+ */
+ /*
+ static
+ {
+ EPackage.Registry.INSTANCE.put(EcorePackage.eNS_URI, new EPackage.Descriptor()
+ {
+ public EPackage getEPackage()
+ {
+ return EcorePackage.eINSTANCE;
+ }
+
+ public EFactory getEFactory()
+ {
+ return new SDOFactoryImpl.SDOEcoreFactory();
+ }
+ });
+ }
+ */
+
+ protected static StringBuffer getXPath(DataObject dataObject, StringBuffer path)
+ {
+ DataObject container = dataObject.getContainer();
+ if (container == null) return path;
+
+ boolean first = path.length() == 0;
+ Property property = dataObject.getContainmentProperty();
+ if (SDOUtil.isMany(property, dataObject))
+ {
+ List list = container.getList(property);
+ int pos = list.indexOf(dataObject);
+ path.insert(0, property.getName() + "." + pos + (first ? "" : "/"));
+ }
+ else
+ {
+ path.insert(0, property.getName() + (first ? "" : "/"));
+ }
+
+ return getXPath(container, path);
+ }
+
+ public static String getXPath(DataObject dataObject)
+ {
+ StringBuffer path = getXPath(dataObject, new StringBuffer());
+ return path.toString();
+ }
+
+ protected static XMLParserPool globalXMLParserPool = new XMLParserPoolImpl();
+
+ public static void configureXMLResource(XMLResource resource, ExtendedMetaData extendedMetaData)
+ {
+ XMLOptions xmlOptions = new XMLOptionsImpl();
+ xmlOptions.setProcessAnyXML(true);
+ resource.getDefaultLoadOptions().put(XMLResource.OPTION_XML_OPTIONS, xmlOptions);
+
+ resource.getDefaultSaveOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, extendedMetaData);
+ resource.getDefaultLoadOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, extendedMetaData);
+
+ resource.getDefaultLoadOptions().put(XMLResource.OPTION_USE_PARSER_POOL, globalXMLParserPool);
+
+ resource.getDefaultLoadOptions().put(XMLResource.OPTION_USE_DEPRECATED_METHODS, Boolean.FALSE);
+
+ resource.getDefaultSaveOptions().put(XMLResource.OPTION_CONFIGURATION_CACHE, Boolean.TRUE);
+ resource.getDefaultLoadOptions().put(XMLResource.OPTION_CONFIGURATION_CACHE, Boolean.TRUE);
+
+ resource.getDefaultLoadOptions().put(XMLResource.OPTION_ANY_TYPE, SDOPackage.eINSTANCE.getAnyTypeDataObject());
+ resource.getDefaultSaveOptions().put(XMLResource.OPTION_ANY_TYPE, SDOPackage.eINSTANCE.getAnyTypeDataObject());
+
+ resource.getDefaultLoadOptions().put(XMLResource.OPTION_ANY_SIMPLE_TYPE, SDOPackage.eINSTANCE.getSimpleAnyTypeDataObject());
+ resource.getDefaultSaveOptions().put(XMLResource.OPTION_ANY_SIMPLE_TYPE, SDOPackage.eINSTANCE.getSimpleAnyTypeDataObject());
+
+ //resource.getDefaultLoadOptions().put(XMLResource.OPTION_USE_XML_NAME_TO_FEATURE_MAP, globalHashMap);
+
+ //resource.getDefaultSaveOptions().put(XMLResource.OPTION_FORMATTED, Boolean.FALSE);
+ }
+
+ /**
+ * @deprecated SDO runtime initialization is no longer required
+ */
+ public static void initRuntime()
+ {
+ // NOOP since init is done during static initialization of this class. See above.
+ }
+
+ /*
+ public static Object get(org.apache.tuscany.sdo.model.Property property, int propertyIndex) {
+ switch(propertyIndex)
+ {
+ case ModelPackageImpl.PROPERTY__ALIAS_NAME:
+ return property.getAliasName();
+ case ModelPackageImpl.PROPERTY__ANY:
+ return property.getAny();
+ case ModelPackageImpl.PROPERTY__ANY_ATTRIBUTE:
+ return property.getAnyAttribute();
+ case ModelPackageImpl.PROPERTY__CONTAINMENT:
+ return Boolean.valueOf(property.isContainment());
+ case ModelPackageImpl.PROPERTY__DEFAULT:
+ return property.getDefault_();
+ case ModelPackageImpl.PROPERTY__MANY:
+ return Boolean.valueOf(property.isMany());
+ case ModelPackageImpl.PROPERTY__NAME:
+ return property.getName();
+ case ModelPackageImpl.PROPERTY__OPPOSITE:
+ return property.getOpposite_();
+ case ModelPackageImpl.PROPERTY__READ_ONLY:
+ return Boolean.valueOf(property.isReadOnly());
+ case ModelPackageImpl.PROPERTY__TYPE:
+ return property.getType_();
+ }
+ return null;
+ }
+
+ public static boolean isSet(org.apache.tuscany.sdo.model.Property property, int propertyIndex) {
+ switch(propertyIndex)
+ {
+ case ModelPackageImpl.PROPERTY__ALIAS_NAME:
+ return !property.getAliasName().isEmpty();
+ case ModelPackageImpl.PROPERTY__ANY:
+ return false;
+ case ModelPackageImpl.PROPERTY__ANY_ATTRIBUTE:
+ return false;
+ case ModelPackageImpl.PROPERTY__CONTAINMENT:
+ return property.isSetContainment();
+ case ModelPackageImpl.PROPERTY__DEFAULT:
+ return property.getDefault_() != null;
+ case ModelPackageImpl.PROPERTY__MANY:
+ return property.isSetMany();
+ case ModelPackageImpl.PROPERTY__NAME:
+ return property.getName() != null;
+ case ModelPackageImpl.PROPERTY__OPPOSITE:
+ return property.getOpposite_() != null;
+ case ModelPackageImpl.PROPERTY__READ_ONLY:
+ return property.isSetReadOnly();
+ case ModelPackageImpl.PROPERTY__TYPE:
+ return property.getType_() != null;
+ }
+ return false;
+ }
+
+ public static Object get(org.apache.tuscany.sdo.model.Type type, int propertyIndex) {
+ switch (propertyIndex)
+ {
+ case ModelPackageImpl.TYPE__BASE_TYPE:
+ return type.getBaseType();
+ case ModelPackageImpl.TYPE__PROPERTY:
+ return type.getProperty();
+ case ModelPackageImpl.TYPE__ALIAS_NAME:
+ return type.getAliasName();
+ case ModelPackageImpl.TYPE__ANY:
+ return type.getAny();
+ case ModelPackageImpl.TYPE__ABSTRACT:
+ return Boolean.valueOf(type.isAbstract());
+ case ModelPackageImpl.TYPE__DATA_TYPE:
+ return Boolean.valueOf(type.isDataType());
+ case ModelPackageImpl.TYPE__NAME:
+ return type.getName();
+ case ModelPackageImpl.TYPE__OPEN:
+ return Boolean.valueOf(type.isOpen());
+ case ModelPackageImpl.TYPE__SEQUENCED:
+ return Boolean.valueOf(type.isSequenced());
+ case ModelPackageImpl.TYPE__URI:
+ return type.getUri();
+ case ModelPackageImpl.TYPE__ANY_ATTRIBUTE:
+ return type.getAnyAttribute();
+ }
+ return null;
+ }
+
+ public static boolean isSet(org.apache.tuscany.sdo.model.Type type, int propertyIndex) {
+ //FB Note that this implementation has the undesirable effect of invoking lazy creation of feature lists
+ switch (propertyIndex)
+ {
+ case ModelPackageImpl.TYPE__BASE_TYPE:
+ return !type.getBaseType().isEmpty();
+ case ModelPackageImpl.TYPE__PROPERTY:
+ return !type.getProperty().isEmpty();
+ case ModelPackageImpl.TYPE__ALIAS_NAME:
+ return !type.getAliasName().isEmpty();
+ case ModelPackageImpl.TYPE__ANY:
+ return false;
+ case ModelPackageImpl.TYPE__ABSTRACT:
+ return type.isSetAbstract();
+ case ModelPackageImpl.TYPE__DATA_TYPE:
+ return type.isSetDataType();
+ case ModelPackageImpl.TYPE__NAME:
+ return type.getName() != null;
+ case ModelPackageImpl.TYPE__OPEN:
+ return type.isSetOpen();
+ case ModelPackageImpl.TYPE__SEQUENCED:
+ return type.isSetSequenced();
+ case ModelPackageImpl.TYPE__URI:
+ return type.getUri() != null;
+ case ModelPackageImpl.TYPE__ANY_ATTRIBUTE:
+ return false;
+ }
+ return false;
+ }
+ */
+
+ /**
+ * Returns a unique list of meta object instance properties (stored in EAnnotations)
+ *
+ * @param metaObject - A Type or Property instance
+ * @return A list of commonj.sdo.Property instances
+ */
+ public static List getMetaObjectInstanceProperties(EModelElement metaObject)
+ {
+ // Use the default helper context for now
+ TypeHelper typeHelper = HelperProvider.getDefaultContext().getTypeHelper();
+
+ List result = new UniqueEList();
+ List annotations = metaObject.getEAnnotations();
+ int size = annotations.size();
+ for (int i=0; i<size; i++)
+ {
+ EAnnotation annotation = (EAnnotation)annotations.get(i);
+ String propertyURI = annotation.getSource();
+
+ for (Iterator iter = annotation.getDetails().iterator(); iter.hasNext(); )
+ {
+ EStringToStringMapEntryImpl entry = (EStringToStringMapEntryImpl)iter.next();
+ String propertyName = entry.getTypedKey();
+
+ Property globalProperty = getGlobalProperty(typeHelper, propertyURI, propertyName);
+ if (globalProperty != null)
+ {
+ result.add(globalProperty);
+ }
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Return the value of the specified mata object instance property (stored in EAnnotations)
+ *
+ * @param metaObject - A Type or Property instance
+ * @param property - The instance property to retrieve
+ * @return The value of the instance property
+ */
+ public static Object getMetaObjectInstanceProperty(EModelElement metaObject, Property property)
+ {
+ String value = EcoreUtil.getAnnotation(metaObject, property.getContainingType().getURI(), property.getName());
+ //TODO if (property.isMany()) ... // create list of values from from string
+ return SDOUtil.createFromString(property.getType(), value);
+ }
+
+ protected static Property getGlobalProperty(TypeHelper typeHelper, String uri, String name)
+ {
+ Property property;
+ if (ExtendedMetaData.ANNOTATION_URI.equals(uri)) {
+ if ("minExclusive".equals(name) ||
+ "minInclusive".equals(name) ||
+ "maxExclusive".equals(name) ||
+ "maxInclusive".equals(name) ||
+ "totalDigits".equals(name) ||
+ "fractionDigits".equals(name) ||
+ "length".equals(name) ||
+ "minLength".equals(name) ||
+ "maxLength".equals(name) ||
+ "enumeration".equals(name) ||
+ "whiteSpace".equals(name) ||
+ "pattern".equals(name))
+ {
+ //TODO Use standard facet properties, once SDO defines them
+ //TODO property = getSDOFacetProperty(name);
+ //TEMP For now just expose a string property for the EMF (ExtendedMetaData) facets
+ property = SDOUtil.createGlobalProperty(typeHelper, uri, name, ((ModelFactoryImpl)ModelFactory.INSTANCE).getString());
+ }
+ else
+ {
+ //TODO Should we consider exposing more ExtendedMetaData?
+ property = null;
+ }
+ }
+ else
+ {
+ property = typeHelper.getOpenContentProperty(uri, name);
+ if (property == null)
+ {
+ property = SDOUtil.createGlobalProperty(typeHelper, uri, name, ((ModelFactoryImpl)ModelFactory.INSTANCE).getString());
+ }
+ }
+ return property;
+ }
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/SDOUtil.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/SDOUtil.java
new file mode 100644
index 0000000000..f0769de2d5
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/SDOUtil.java
@@ -0,0 +1,922 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.util;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.OutputStream;
+import java.lang.reflect.Field;
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.security.AccessController;
+import java.security.PrivilegedExceptionAction;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.tuscany.sdo.SDOExtendedMetaData;
+import org.apache.tuscany.sdo.SDOFactory;
+import org.apache.tuscany.sdo.SimpleAnyTypeDataObject;
+import org.apache.tuscany.sdo.helper.CrossScopeCopyHelperImpl;
+import org.apache.tuscany.sdo.helper.DataFactoryImpl;
+import org.apache.tuscany.sdo.helper.HelperContextImpl;
+import org.apache.tuscany.sdo.helper.SDOExtendedMetaDataImpl;
+import org.apache.tuscany.sdo.helper.TypeHelperImpl;
+import org.apache.tuscany.sdo.helper.XMLHelperImpl;
+import org.apache.tuscany.sdo.helper.XMLStreamHelper;
+import org.apache.tuscany.sdo.helper.XMLStreamHelperImpl;
+import org.apache.tuscany.sdo.helper.XSDHelperImpl;
+import org.apache.tuscany.sdo.impl.ClassImpl;
+import org.apache.tuscany.sdo.impl.DataGraphImpl;
+import org.apache.tuscany.sdo.impl.DynamicDataObjectImpl;
+import org.apache.tuscany.sdo.model.ModelFactory;
+import org.apache.tuscany.sdo.model.impl.ModelFactoryImpl;
+import org.apache.tuscany.sdo.util.resource.SDOObjectInputStream;
+import org.apache.tuscany.sdo.util.resource.SDOObjectOutputStream;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.common.util.UniqueEList;
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EModelElement;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.ETypedElement;
+import org.eclipse.emf.ecore.EcoreFactory;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.emf.ecore.impl.EPackageImpl;
+import org.eclipse.emf.ecore.impl.EPackageRegistryImpl;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.ecore.util.ExtendedMetaData;
+import org.eclipse.emf.ecore.util.FeatureMap;
+import org.eclipse.emf.ecore.util.FeatureMapUtil;
+import org.eclipse.emf.ecore.xmi.XMLResource;
+import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
+
+import commonj.sdo.DataGraph;
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
+import commonj.sdo.Sequence;
+import commonj.sdo.Type;
+import commonj.sdo.helper.CopyHelper;
+import commonj.sdo.helper.DataFactory;
+import commonj.sdo.helper.HelperContext;
+import commonj.sdo.helper.TypeHelper;
+import commonj.sdo.helper.XMLHelper;
+import commonj.sdo.helper.XSDHelper;
+
+/**
+ * This class provides some useful static utility functions which are not specified in the SDO
+ * specification itself. Use of the functions in this class is recommended, instead of resorting
+ * to low-level implementation-specific APIs.
+ */
+public final class SDOUtil
+{
+ /**
+ * Line Break String such as "\n", "\r\n", "\r" and "", absence/null is the default (line.separator System Property)
+ */
+ static public final String XML_SAVE_LineBreak = "LineBreak",
+ /**
+ * Indent String such as "\t", "", etc. absence/null is the default (" ")
+ */
+ XML_SAVE_INDENT = "indent",
+ /**
+ * Margin String such as " ", "\t\t", etc. Absence/null/"" is the default (no margin)
+ */
+ XML_SAVE_MARGIN = "margin",
+ /**
+ * Attribute formatting that exceeds the specified width as Integer will cause a line break so that formatting will continue indented on the next line
+ */
+ XML_SAVE_LineWidth = XMLResource.OPTION_LINE_WIDTH,
+ /**
+ * Boolean to save a doctype declaration
+ */
+ XML_SAVE_DocType = XMLResource.OPTION_SAVE_DOCTYPE,
+ /**
+ * Boolean to process the schemaLocation/noNamespaceSchemaLocation attributes occurring in the instance document to {@link XSDHelper#define convert XSD(s) to Types}
+ */
+ XML_LOAD_SCHEMA = "ProcessSchemaLocations",
+ /**
+ * To tolerate malformed elements and attributes (default unless set by System property XML.load.form.lax). 0 not to.
+ */
+ XML_LOAD_LaxForm = "load malform";
+
+ /**
+ * Create a DataObject wrapper for an instance of the specified dataType.
+ * This method is typically used to create a root object that can be passed to the XMLHelper.save()
+ * method when the root element to be serialized is an XMLSchema simpleType.
+ * @param dataType a Type for which isDataType() returns true.
+ * @param value the instance value.
+ * @return a DataObject wrapper for the specified value.
+ */
+ public static DataObject createDataTypeWrapper(Type dataType, Object value)
+ {
+ SimpleAnyTypeDataObject simpleAnyType = SDOFactory.eINSTANCE.createSimpleAnyTypeDataObject();
+ simpleAnyType.setInstanceType((EDataType)dataType);
+ simpleAnyType.setValue(value);
+ return simpleAnyType;
+ }
+
+ /**
+ * Creates an instance of a data type from the specified string.
+ * @param dataType a Type, for which isDataType() returns true, to instantiate.
+ * @param literal the string value of the dataType.
+ * @return an instance of the dataType.
+ * @see #convertToString(Type, Object)
+ */
+ public static Object createFromString(Type dataType, String literal)
+ {
+ return EcoreUtil.createFromString((EDataType)dataType, literal);
+ }
+
+ /**
+ * Converts an instance of a data type to a string literal representation.
+ * @param dataType the Type, for which isDataType() returns true, of the value to convert.
+ * @param value a value of the dataType.
+ * @return the string literal representation of the value.
+ * @see #createFromString(Type, String)
+ */
+ public static String convertToString(Type dataType, Object value)
+ {
+ return EcoreUtil.convertToString((EDataType)dataType, value);
+ }
+
+ /**
+ * Get the SDO built-in type corresponding to the specified XSD type in the XML Schema
+ * namespace ("http://www.w3.org/2001/XMLSchema").
+ * @param xsdType a type name in the XML Schema namespace.
+ * @return the SDO built-in Type corresponding to the specified XSD type.
+ */
+ public static Type getXSDSDOType(String xsdType)
+ {
+ Type type = null;
+ //if ("anyType".equals(xsdType)) {
+ // type = (Type)SDOPackage.eINSTANCE.getDataObject();
+ //} else {
+ String name = (String)xsdToSdoMappings.get(xsdType);
+ if (name != null) {
+ type = (Type)((ModelFactoryImpl)ModelFactory.INSTANCE).getEClassifier(name);
+ } else {
+ type = (Type)SDOExtendedMetaData.INSTANCE.getType(XMLTypePackage.eINSTANCE, xsdType);
+ }
+ //}
+ return type;
+ }
+
+ /**
+ * Gets the Sequence corresponding to the specified substitutable Property of the specified DataObject.
+ * @param dataObject the data object.
+ * @param head a substitution group head property.
+ * @return the Sequence corresponding to the specified substitutable Property of the specified DataObject or
+ * null if the specified Property isn't a substitution head.
+ */
+ public static Sequence getSubstitutionValues(DataObject dataObject, Property head)
+ {
+ final EStructuralFeature group = ExtendedMetaData.INSTANCE.getGroup((EStructuralFeature)head);
+ return null == group
+ ? null
+ : (Sequence)((FeatureMap.Internal)((EObject)dataObject).eGet(group)).getWrapper();
+ }
+
+ /**
+ * Get the SDO built-in type corresponding to the specified Java instanceClass.
+ * @param javaClass the Java instanceClass of the type.
+ * @return the SDO built-in Type corresponding to the specified instanceClass.
+ */
+ public static Type getJavaSDOType(Class javaClass)
+ {
+ String name = (String)javaToSdoMappings.get(javaClass);
+ if (name != null)
+ {
+ return (Type)((ModelFactoryImpl)ModelFactory.INSTANCE).getEClassifier(name);
+ }
+ return null;
+ }
+
+ /**
+ * Return whether at least one value is required for a valid instance of the specified property.
+ * @param the property in question.
+ * @return true if the property is required.
+ */
+ public static boolean isRequired(Property property)
+ {
+ return ((EStructuralFeature)property).isRequired();
+ }
+
+ /**
+ * Returns whether the Property is many-valued given the specified context.
+ * @param property The Property in question
+ * @param context The context to check whether the specified Property is many-valued
+ * @return true if the Property is many-valued given the specified context.
+ */
+ public static boolean isMany(Property property, DataObject context)
+ {
+ return FeatureMapUtil.isMany((EObject) context, (EStructuralFeature) property);
+ }
+
+ /**
+ * Create an empty data graph.
+ * @return the new data graph instance.
+ */
+ public static DataGraph createDataGraph()
+ {
+ return SDOFactory.eINSTANCE.createDataGraph();
+ }
+
+ /**
+ * Set the root object of a data graph.
+ * @param dataGraph the data graph in which to set the root object.
+ * @param rootObject the root object.
+ */
+ public static void setRootObject(DataGraph dataGraph, DataObject rootObject)
+ {
+ ((DataGraphImpl)dataGraph).setERootObject((EObject)rootObject);
+ }
+
+ /**
+ * Load a serialized data graph from the specified insputStream.
+ * @param inputStream the inputStream of the data graph.
+ * @param options loader control options, or null.
+ * @return the de-serialized data graph.
+ * @throws IOException
+ */
+ public static DataGraph loadDataGraph(InputStream inputStream, Map options) throws IOException
+ {
+ ResourceSet resourceSet = DataObjectUtil.createResourceSet();
+ Resource resource = resourceSet.createResource(URI.createURI("all.datagraph"));
+ resource.load(inputStream, options);
+ return (DataGraph)resource.getContents().get(0);
+ }
+
+ static final Object LOADING_SCOPE = XMLResource.OPTION_EXTENDED_META_DATA;
+
+ protected static void registerLoadingScope(Map options, TypeHelper scope)
+ {
+ Object extendedMetaData = ((TypeHelperImpl) scope).getExtendedMetaData();
+ options.put(LOADING_SCOPE, extendedMetaData);
+ }
+
+ /**
+ * Load a serialized data graph from the specified insputStream.
+ *
+ * @param inputStream
+ * the inputStream of the data graph.
+ * @param options
+ * loader control options, or null.
+ * @param scope
+ * To register deserialized Types and utilize already registered Types in order to instantiate expected DataObject instances, null for
+ * {@link TypeHelper.INSTANCE TypeHelper.INSTANCE}.
+ * @return the de-serialized data graph.
+ * @throws IOException
+ */
+ public static DataGraph loadDataGraph(InputStream inputStream, Map options, TypeHelper scope) throws IOException
+ {
+ DataGraph result = null;
+ if (scope == null || scope == TypeHelper.INSTANCE) {
+ result = loadDataGraph(inputStream, options);
+ } else if (options == null) {
+ options = new HashMap();
+ registerLoadingScope(options, scope);
+ result = loadDataGraph(inputStream, options);
+ } else if (options.containsKey(LOADING_SCOPE)) {
+ Object restore = options.get(LOADING_SCOPE);
+ registerLoadingScope(options, scope);
+ try
+ {
+ result = loadDataGraph(inputStream, options);
+ }
+ finally
+ {
+ options.put(LOADING_SCOPE, restore);
+ }
+ } else {
+ registerLoadingScope(options, scope);
+ try
+ {
+ result = loadDataGraph(inputStream, options);
+ }
+ finally
+ {
+ options.remove(LOADING_SCOPE);
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Serialize the specified data graph to the specified outputStream.
+ * @param dataGraph the data graph to save.
+ * @param outputStream the outputStream for the data graph.
+ * @param options serializer control options, or null.
+ * @throws IOException
+ */
+ public static void saveDataGraph(DataGraph dataGraph, OutputStream outputStream, Map options) throws IOException
+ {
+ ((DataGraphImpl)dataGraph).getDataGraphResource().save(outputStream, options);
+ }
+
+ /**
+ * Registers the specified {@link Type type}(s) to be serialized along with
+ * the {@link DataObject data object}(s) in the graph. For example, the list of types returned from
+ * {@link TypeHelper#define} can be registered with this method, allowing deserialization of
+ * instances of a dynamically defined model.
+ * @param dataGraph the DataGraph in which to register the specified type(s).
+ * @param types a list containing the type(s) to be registered (TBD or null to automatically register all
+ * types used by the objects in the DataGraph).
+ */
+ public static void registerDataGraphTypes(DataGraph dataGraph, List/*Type*/ types)
+ {
+ //if (types == null)
+ // types = SDOUtil.getDataGraphTypes(dataGraph);
+
+ Set/*EPackage*/ packages = new HashSet();
+ for (final Iterator iterator = types.iterator(); iterator.hasNext(); ) {
+ EClassifier type = (EClassifier)iterator.next();
+ packages.add(type.getEPackage());
+ }
+
+ ResourceSet resourceSet = ((DataGraphImpl)dataGraph).getResourceSet();
+
+ for (Iterator iterator = packages.iterator(); iterator.hasNext(); ) {
+ EPackage typePackage = (EPackage)iterator.next();
+ Resource resource = typePackage.eResource();
+ if (resource == null) {
+ resource = resourceSet.createResource(URI.createURI(".ecore"));
+ resource.setURI(URI.createURI(typePackage.getNsURI()));
+ resource.getContents().add(typePackage);
+ }
+ else if (resource.getResourceSet() != resourceSet)
+ resourceSet.getResources().add(resource);
+ }
+ }
+
+ /**
+ * Create a HelperContext to provide access to a consistent set of
+ * Helpers which make use of a new TypeHelper instance to provide
+ * scope for type definitions.
+ * @param extensibleNamespaces true if the contents of a namespaces should be incrementally modifiable
+ * @return the new HelperContext
+ */
+ public static HelperContext createHelperContext(boolean extensibleNamespaces)
+ {
+ return new HelperContextImpl(extensibleNamespaces);
+ }
+
+ /**
+ * Create a HelperContext.
+ * @return the new HelperContext
+ * @see #createHelperContext(boolean)
+ */
+ public static HelperContext createHelperContext()
+ {
+ return createHelperContext(false);
+ }
+
+ /**
+ * Create a new TypeHelper instance. The returned type helper will have visibility of types registered
+ * directly by calling a define method on it or by calling define on an associated XSDHelper. It will
+ * also have visibility of static types registered by calling SDOUtil.registerStaticTypes in the
+ * same classLoader scope.
+ * @return the new TypeHelper.
+ * @deprecated see {@link #createHelperContext(TypeHelper)}
+ */
+ public static TypeHelper createTypeHelper()
+ {
+ EPackage.Registry registry = new EPackageRegistryImpl(EPackage.Registry.INSTANCE);
+ ExtendedMetaData extendedMetaData = new SDOExtendedMetaDataImpl(registry); //TODO create subclass that makes demand() methods synchronous
+ return new TypeHelperImpl(extendedMetaData);
+ }
+
+ /**
+ * Create a new DataFactory, with visibility to types in the specified TypeHelper scope.
+ * @param scope the TypeHelper to use for locating types.
+ * @return the new DataFactory.
+ * @deprecated see {@link #createHelperContext(TypeHelper)}
+ */
+ public static DataFactory createDataFactory(TypeHelper scope)
+ {
+ return new DataFactoryImpl(scope);
+ }
+
+ /**
+ * Create a new XMLHelper, with visibility to types in the specified TypeHelper scope.
+ * @param scope the TypeHelper to use for locating types.
+ * @return the new XMLHelper.
+ * @deprecated see {@link #createHelperContext(TypeHelper)}
+ */
+ public static XMLHelper createXMLHelper(TypeHelper scope)
+ {
+ return new XMLHelperImpl(scope);
+ }
+
+ /**
+ * Create a new XSDHelper, with visibility to types in the specified TypeHelper scope.
+ * @param scope the TypeHelper to use for locating and populating types.
+ * @return the new XSDHelper.
+ * @deprecated see {@link #createHelperContext(TypeHelper)}
+ */
+ public static XSDHelper createXSDHelper(TypeHelper scope)
+ {
+ return new XSDHelperImpl(scope, false);
+ }
+
+ /**
+ * Create a new XMLStreamHelper, with visibility to types in the specified TypeHelper scope.
+ * @param scope the TypeHelper to use for locating types.
+ * @return the new XMLStreamHelper.
+ */
+ public static XMLStreamHelper createXMLStreamHelper(TypeHelper scope)
+ {
+ return new XMLStreamHelperImpl(scope);
+ }
+
+ /**
+ * Create a new cross scope CopyHelper.
+ * @param targetScope the TypeHelper containing the Types to use to create the copy objects.
+ * @return the new CopyHelper.
+ */
+ public static CopyHelper createCrossScopeCopyHelper(TypeHelper targetScope)
+ {
+ return new CrossScopeCopyHelperImpl(targetScope);
+ }
+
+ /**
+ * Create a new ObjectInputStream, under the helperContextScope
+ * @param scope the TypeHelper to use for locating types.
+ * @return the new XMLStreamHelper.
+ */
+ public static ObjectInputStream createObjectInputStream(InputStream inputStream, HelperContext helperContext) throws IOException
+ {
+ return new SDOObjectInputStream(inputStream, helperContext);
+ }
+
+ /**
+ * Create a new ObjectOutputStream, under the helperContextScope.
+ * @param scope the TypeHelper to use for locating types.
+ * @return the new XMLStreamHelper.
+ */
+ public static ObjectOutputStream createObjectOutputStream(OutputStream outputStream, HelperContext helperContext) throws IOException
+ {
+ return new SDOObjectOutputStream(outputStream, helperContext);
+ }
+
+ /**
+ * Gets all of the types associated with a uri.
+ *
+ * @param scope
+ * the TypeHelper to use for locating types.
+ * @param uri.
+ * Uri of the Types
+ * @return List. List containing instances of Type, null if uri is not found.
+ */
+ public static List getTypes(TypeHelper scope, String uri) {
+
+ EPackage ePackage = ((TypeHelperImpl) scope).getExtendedMetaData().getPackage(uri);
+ if (ePackage != null) {
+ return new ArrayList(ePackage.getEClassifiers());
+ }
+ return null;
+ }
+
+ public static List getOpenContentProperties(DataObject dataObject)
+ {
+ List result = new UniqueEList();
+ ((ClassImpl)dataObject.getType()).addOpenProperties((EObject)dataObject, result);
+ return result;
+ }
+
+ public static boolean isDocumentRoot(Type type)
+ {
+ return "".equals(SDOExtendedMetaData.INSTANCE.getName((EClassifier)type));
+ }
+
+ public static Type createType(TypeHelper scope, String uri, String name, boolean isDataType)
+ {
+ ExtendedMetaData extendedMetaData = ((TypeHelperImpl)scope).getExtendedMetaData();
+ if ("".equals(uri)) uri = null; //FB
+
+ EPackage ePackage = extendedMetaData.getPackage(uri);
+ if (ePackage == null)
+ {
+ ePackage = EcoreFactory.eINSTANCE.createEPackage();
+ ePackage.setEFactoryInstance(new DynamicDataObjectImpl.FactoryImpl());
+ ePackage.setNsURI(uri);
+ String packagePrefix = uri != null ? URI.createURI(uri).trimFileExtension().lastSegment() : ""; //FB
+ ePackage.setName(packagePrefix);
+ ePackage.setNsPrefix(packagePrefix);
+ extendedMetaData.putPackage(uri, ePackage);
+ }
+
+ EClassifier eClassifier = ePackage.getEClassifier(name);
+ if (eClassifier != null) // already defined?
+ {
+ //throw new IllegalArgumentException();
+ return null;
+ }
+
+ if (name != null)
+ {
+ eClassifier = isDataType ? (EClassifier)SDOFactory.eINSTANCE.createDataType() : (EClassifier)SDOFactory.eINSTANCE.createClass();
+ eClassifier.setName(name);
+ }
+ else
+ {
+ eClassifier = DataObjectUtil.createDocumentRoot();
+ }
+
+ ePackage.getEClassifiers().add(eClassifier);
+
+ return (Type)eClassifier;
+ }
+
+ public static void addBaseType(Type type, Type baseType)
+ {
+ ((EClass)type).getESuperTypes().add(baseType);
+ }
+
+ public static void addAliasName(Type type, String aliasName)
+ {
+ throw new UnsupportedOperationException(); // TODO: implement this method properly
+ //type.getAliasNames().add(aliasName);
+ }
+
+ public static void setOpen(Type type, boolean isOpen)
+ {
+ if (isOpen == type.isOpen()) return;
+
+ if (isOpen)
+ {
+ EAttribute eAttribute = (EAttribute)SDOFactory.eINSTANCE.createAttribute();
+ ((EClass)type).getEStructuralFeatures().add(eAttribute);
+
+ eAttribute.setName("any");
+ eAttribute.setUnique(false);
+ eAttribute.setUpperBound(ETypedElement.UNBOUNDED_MULTIPLICITY);
+ eAttribute.setEType(EcorePackage.eINSTANCE.getEFeatureMapEntry());
+ ExtendedMetaData.INSTANCE.setFeatureKind(eAttribute, ExtendedMetaData.ELEMENT_WILDCARD_FEATURE);
+ ExtendedMetaData.INSTANCE.setProcessingKind(eAttribute, ExtendedMetaData.LAX_PROCESSING);
+ ExtendedMetaData.INSTANCE.setWildcards(eAttribute, Collections.singletonList("##any"));
+
+ //FB TBD Add an "anyAttribute" EAttribute as well.
+
+ if (type.isSequenced()) {
+ eAttribute.setDerived(true);
+ eAttribute.setTransient(true);
+ eAttribute.setVolatile(true);
+ }
+ }
+ else
+ {
+ EClass eClass = (EClass)type;
+ EAttribute any = (EAttribute)eClass.getEStructuralFeature("any");
+ eClass.getEStructuralFeatures().remove(any);
+ }
+ }
+
+ public static void setSequenced(Type type, boolean isSequenced)
+ {
+ if (isSequenced == type.isSequenced()) return;
+
+ // currently, we require setSequenced to be called first, before anything else is added to the type.
+ if (type.isDataType() || !type.getProperties().isEmpty())
+ {
+ if (type.getName() != "DocumentRoot") // document root is a special case
+ throw new IllegalArgumentException();
+ }
+
+ if (isSequenced) {
+ EClass eClass = (EClass)type;
+ ExtendedMetaData.INSTANCE.setContentKind(eClass, ExtendedMetaData.MIXED_CONTENT);
+ EAttribute mixedFeature = (EAttribute)SDOFactory.eINSTANCE.createAttribute();
+ mixedFeature.setName("mixed");
+ mixedFeature.setUnique(false);
+ mixedFeature.setEType(EcorePackage.eINSTANCE.getEFeatureMapEntry());
+ mixedFeature.setLowerBound(0);
+ mixedFeature.setUpperBound(-1);
+ //eClass.getEStructuralFeatures().add(mixedFeature);
+ ((ClassImpl)eClass).setSequenceFeature(mixedFeature);
+ ExtendedMetaData.INSTANCE.setFeatureKind(mixedFeature, ExtendedMetaData.ELEMENT_WILDCARD_FEATURE);
+ ExtendedMetaData.INSTANCE.setName(mixedFeature, ":mixed");
+ }
+ else
+ {
+ // nothing to do, because of current restriction that setSequence must be called first.
+ }
+ }
+
+ public static void setAbstract(Type type, boolean isAbstract)
+ {
+ ((EClass)type).setAbstract(isAbstract);
+ }
+
+ public static void setJavaClassName(Type type, String javaClassName)
+ {
+ ((EClassifier)type).setInstanceClassName(javaClassName);
+ }
+
+ public static Property createProperty(Type containingType, String name, Type propertyType)
+ {
+ EStructuralFeature eStructuralFeature =
+ propertyType.isDataType() ?
+ (EStructuralFeature)SDOFactory.eINSTANCE.createAttribute() :
+ (EStructuralFeature)SDOFactory.eINSTANCE.createReference();
+
+ eStructuralFeature.setName(name);
+ eStructuralFeature.setEType((EClassifier)propertyType);
+ ((EClass)containingType).getEStructuralFeatures().add(eStructuralFeature);
+
+ if ("".equals(ExtendedMetaData.INSTANCE.getName((EClass)containingType))) // DocumentRoot containingType?
+ {
+ ExtendedMetaData.INSTANCE.setNamespace(eStructuralFeature, containingType.getURI());
+ //FB???eStructuralFeature.setUnique(false);
+ //FB???eStructuralFeature.setUpperBound(ETypedElement.UNSPECIFIED_MULTIPLICITY);
+ }
+
+ if (containingType.isSequenced()) {
+ eStructuralFeature.setDerived(true);
+ eStructuralFeature.setTransient(true);
+ eStructuralFeature.setVolatile(true);
+ ExtendedMetaData.INSTANCE.setFeatureKind(eStructuralFeature, ExtendedMetaData.ELEMENT_FEATURE);
+ }
+ else
+ {
+ //FB TBD ... figure out how to decide whether to use ELEMENT_FEATURE or ATTRIBUTE_FEATURE
+ //ExtendedMetaData.INSTANCE.setFeatureKind(eStructuralFeature, ExtendedMetaData.ELEMENT_FEATURE);
+ }
+
+ return (Property)eStructuralFeature;
+ }
+
+ public static Property createGlobalProperty(TypeHelper scope, String uri, String name, Type type)
+ {
+ ExtendedMetaData extendedMetaData = ((TypeHelperImpl)scope).getExtendedMetaData();
+
+ // get/create document root
+ EPackage ePackage = extendedMetaData.getPackage(uri);
+ Type documentRoot = ePackage != null ? (Type)extendedMetaData.getType(ePackage, "") : null;
+ if (documentRoot == null)
+ {
+ documentRoot = SDOUtil.createType(scope, uri, null, false);
+ }
+
+ // Determine if property already exists
+ Property newProperty = documentRoot.getProperty(name);
+ if (newProperty == null)
+ {
+ // Create the new property 'under' the document root.....
+ newProperty = SDOUtil.createProperty(documentRoot, name, type);
+ }
+ else
+ {
+ // if property already exists, validate the expected type
+ if (!newProperty.getType().equals(type))
+ throw new IllegalArgumentException();
+ }
+ return newProperty;
+ }
+
+ public static void addAliasName(Property property, String aliasName)
+ {
+ throw new UnsupportedOperationException(); // TODO: implement this method properly
+ //property.getAliasNames().add(aliasName);
+ }
+
+ public static void setMany(Property property, boolean isMany)
+ {
+ ((EStructuralFeature)property).setUpperBound(isMany ? EStructuralFeature.UNBOUNDED_MULTIPLICITY : 1);
+ }
+
+ public static void setContainment(Property property, boolean isContainment)
+ {
+ ((EReference)property).setContainment(isContainment);
+ }
+
+ public static void setDefault(Property property, String defaultValue)
+ {
+ ((EStructuralFeature)property).setDefaultValueLiteral(defaultValue);
+ }
+
+ public static void setReadOnly(Property property, boolean isReadOnly)
+ {
+ ((EStructuralFeature)property).setChangeable(!isReadOnly);
+ }
+
+ public static void setOpposite(Property property, Property opposite)
+ {
+ ((EReference)property).setEOpposite((EReference)opposite);
+ }
+
+ public static void addTypeInstanceProperties(Type definedType, DataObject modeledType)
+ {
+ addInstanceProperties((EModelElement)definedType, modeledType);
+ }
+
+ public static void addPropertyInstanceProperties(Property definedProperty, DataObject modeledProperty)
+ {
+ addInstanceProperties((EModelElement)definedProperty, modeledProperty);
+ }
+
+ protected static void addInstanceProperties(EModelElement metaObject, DataObject dataObject)
+ {
+ List instanceProperties = getOpenContentProperties(dataObject);
+ for (Iterator iter = instanceProperties.iterator(); iter.hasNext(); )
+ {
+ Property property = (Property)iter.next();
+ String uri = property.getContainingType().getURI();
+ EAnnotation eAnnotation = metaObject.getEAnnotation(uri);
+ if (eAnnotation == null)
+ {
+ eAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
+ eAnnotation.setSource(uri);
+ metaObject.getEAnnotations().add(eAnnotation);
+ }
+ Object value = dataObject.get(property);
+ //TODO if (property.isMany()) ... // convert list of values
+ String stringValue = SDOUtil.convertToString(property.getType(), value);
+ eAnnotation.getDetails().put(property.getName(), stringValue);
+ }
+ }
+
+ /**
+ * Register and initialize the SDO types supported by the specified generated factory class.
+ * This function must be called before instances of the generated types can be created/used.
+ * The registered types will be visible in all TypeHelper's created in the same classLoader
+ * scope as the call to this function.
+ * @param factoryClass the generated factory class.
+ * @deprecated see the register(HelperContext) metods on generated Factory classes
+ */
+ public static void registerStaticTypes(Class factoryClass)
+ {
+ //TODO this implementation is temporary, until the SDO generated factory pattern is decided
+ //TODO might want to clean this implementation in the light of the requirement to regenerate all classes
+ //after noEMF became the default, so we have no compatibility requirements (unless we
+ //cater for the simple hand edit that would make M2 generated classes work) -- as this is
+ //deprecated I'm going to do nothing for now
+ //
+ String temp = factoryClass.getName().replaceFirst("Factory$", "PackageImpl");
+ int lastDot = temp.lastIndexOf('.');
+ String packageName = temp.substring(0, lastDot) + ".impl" + temp.substring(lastDot);
+
+ try // this case handles the old style EMF pattern
+ {
+ Class javaClass = getPackageClass(factoryClass, packageName);
+ Field field = javaClass.getField("eINSTANCE");
+ EPackageImpl pkg = (EPackageImpl)field.get(null);
+ EPackage.Registry.INSTANCE.put(pkg.getNsURI(), pkg);
+ }
+ catch (Exception e1)
+ {
+ packageName = factoryClass.getName().replaceFirst("Factory$", "Package");
+ try // this case handles the EMF -noInterfaces generator pattern
+ {
+ Class javaClass = getPackageClass(factoryClass, packageName);
+ Field field = javaClass.getField("eINSTANCE");
+ EPackageImpl pkg = (EPackageImpl)field.get(null);
+ EPackage.Registry.INSTANCE.put(pkg.getNsURI(), pkg);
+ }
+ catch (Exception e2)
+ {
+ try // this case handles the default (was -noEMF) generator pattern
+ {
+ Field field = factoryClass.getField("INSTANCE");
+ EPackageImpl pkg = (EPackageImpl)field.get(null);
+ EPackage.Registry.INSTANCE.put(pkg.getNsURI(), pkg);
+ // TODO -- decide if we should block global initialization of Factories with the new register method.
+ }
+ catch (Exception e3)
+ {
+ e3.printStackTrace();
+ }
+ }
+ }
+ }
+
+
+ private static Class getPackageClass(Class factoryClass, String packageName) throws Exception
+ {
+ final Class factoryClassTemp = factoryClass;
+ final String packageNameTemp = packageName;
+ return (Class)AccessController.doPrivileged(new PrivilegedExceptionAction() {
+ public Object run() throws Exception {
+ return factoryClassTemp.getClassLoader().loadClass(packageNameTemp);
+ }
+ });
+ }
+
+ //Java instance class to SDO mappings (p.69 - p.71 of the SDO spec)
+ private static Map javaToSdoMappings = new HashMap();
+ static {
+ javaToSdoMappings.put(boolean.class, "Boolean");
+ javaToSdoMappings.put(byte.class, "Byte");
+ javaToSdoMappings.put(char.class, "Character");
+ javaToSdoMappings.put(Date.class, "Date");
+ javaToSdoMappings.put(BigDecimal.class, "Decimal");
+ javaToSdoMappings.put(double.class, "Double");
+ javaToSdoMappings.put(float.class, "Float");
+ javaToSdoMappings.put(int.class, "Int");
+ javaToSdoMappings.put(BigInteger.class, "Integer");
+ javaToSdoMappings.put(long.class, "Long");
+ javaToSdoMappings.put(Object.class, "Object");
+ javaToSdoMappings.put(short.class, "Short");
+ javaToSdoMappings.put(String.class, "String");
+ javaToSdoMappings.put(Boolean.class, "BooleanObject");
+ javaToSdoMappings.put(Byte.class, "ByteObject");
+ javaToSdoMappings.put(Character.class, "CharacterObject");
+ javaToSdoMappings.put(Double.class, "DoubleObject");
+ javaToSdoMappings.put(Float.class, "FloatObject");
+ javaToSdoMappings.put(Integer.class, "IntObject");
+ javaToSdoMappings.put(Long.class, "LongObject");
+ javaToSdoMappings.put(Short.class, "ShortObject");
+ }
+
+ //XSD to SDO mappings (p.95 of the SDO spec)
+ private static Map xsdToSdoMappings = new HashMap();
+ static {
+ xsdToSdoMappings.put("anySimpleType", "Object");
+ xsdToSdoMappings.put("anyType", "DataObject");
+ xsdToSdoMappings.put("anyURI", "URI");
+ xsdToSdoMappings.put("base64Binary", "Base64Bytes");
+ xsdToSdoMappings.put("boolean", "Boolean");
+ xsdToSdoMappings.put("byte", "Byte");
+ xsdToSdoMappings.put("date", "YearMonthDay");
+ xsdToSdoMappings.put("dateTime", "DateTime");
+ xsdToSdoMappings.put("decimal", "Decimal");
+ xsdToSdoMappings.put("double", "Double");
+ xsdToSdoMappings.put("duration", "Duration");
+ xsdToSdoMappings.put("ENTITIES", "Strings");
+ xsdToSdoMappings.put("ENTITY", "String");
+ xsdToSdoMappings.put("float", "Float");
+ xsdToSdoMappings.put("gDay", "Day");
+ xsdToSdoMappings.put("gMonth", "Month");
+ xsdToSdoMappings.put("gMonthDay", "MonthDay");
+ xsdToSdoMappings.put("gYear", "Year");
+ xsdToSdoMappings.put("gYearMonth", "YearMonth");
+ xsdToSdoMappings.put("hexBinary", "Bytes");
+ xsdToSdoMappings.put("ID","String");
+ xsdToSdoMappings.put("IDREF","String");
+ xsdToSdoMappings.put("IDREFS","Strings");
+ xsdToSdoMappings.put("int","Int");
+ xsdToSdoMappings.put("integer","Integer");
+ xsdToSdoMappings.put("language","String");
+ xsdToSdoMappings.put("long","Long");
+ xsdToSdoMappings.put("Name","String");
+ xsdToSdoMappings.put("NCName","String");
+ xsdToSdoMappings.put("negativeInteger","Integer");
+ xsdToSdoMappings.put("NMTOKEN","String");
+ xsdToSdoMappings.put("NMTOKENS","Strings");
+ xsdToSdoMappings.put("nonNegativeInteger","Integer");
+ xsdToSdoMappings.put("nonPositiveInteger","Integer");
+ xsdToSdoMappings.put("normalizedString","String");
+ xsdToSdoMappings.put("NOTATION","String");
+ xsdToSdoMappings.put("positiveInteger","Integer");
+ xsdToSdoMappings.put("QName","URI");
+ xsdToSdoMappings.put("short","Short");
+ xsdToSdoMappings.put("string","String");
+ xsdToSdoMappings.put("time","Time");
+ xsdToSdoMappings.put("token","String");
+ xsdToSdoMappings.put("unsignedByte","Short");
+ xsdToSdoMappings.put("unsignedInt","Long");
+ xsdToSdoMappings.put("unsignedLong","Integer");
+ xsdToSdoMappings.put("unsignedShort","Int");
+ }
+
+ /**
+ * Initialize SDO runtime.
+ */
+ static
+ {
+ DataObjectUtil.initRuntime();
+ }
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/StAX2SAXAdapter.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/StAX2SAXAdapter.java
new file mode 100644
index 0000000000..69dc53cefb
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/StAX2SAXAdapter.java
@@ -0,0 +1,250 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.util;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.Location;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.AttributesImpl;
+
+/**
+ * Adapter that converts from StAX to SAX event streams. Currently the following SAX events are not generated:
+ * <ul>
+ * <li>ignorableWhitespace</li>
+ * <li>skippedEntity</li>
+ * <ul>
+ * Also the following StAX events are not mapped:
+ * <ul>
+ * <li>CDATA</li>
+ * <li>COMMENT</li>
+ * <li>DTD</li>
+ * <li>ENTITY_DECLARATION</li>
+ * <li>ENTITY_REFERENCE</li>
+ * <li>NOTATION_DECLARATION</li>
+ * <li>SPACE</li>
+ * </ul>
+ * StAX ATTRIBUTE events are ignored but the equivalent attributes (derived from the START_ELEMENT event) are supplied in the SAX startElement event's
+ * Attributes parameter. If the adaptor is configured to pass namespace prefixes then namespace information will also be included in the Attributes;
+ * StAX NAMESPACE events are ignored.
+ * <p/>
+ * Another issue is namespace processing. If the reader is positioned at a sub-node, we cannot capture all the in-scope namespace bindings. Therefore
+ * we cannot re-create a proper SAX event stream from a StAX parser.
+ * <p/>
+ * For example
+ * <p/>
+ * &lt;a:root xmlns:a="foo" xmlns:b="bar"&gt;&lt;b:sub&gt;a:foo&lt;/b:sub&gt;&lt;/a:root&gt;
+ * <p/>
+ * And if you are handed a parser at &lt;b:sub&gt;, then your SAX events should look like:
+ * <p/>
+ * &lt;b:sub xmlns:a="foo" xmlns:b="bar"&gt;a:foo&lt;/b:sub&gt;
+ * <p/>
+ * not:
+ * <p/>
+ * &lt;b:sub&gt;a:foo&lt;/b:sub&gt;
+ * <p/>
+ * <p/>
+ * Proposal: we change the receiver of SAX events (SDOXMLResourceImpl) so that it uses NamespaceContext to resolve prefix (as opposed to record
+ * start/endPrefixMappings and use it for resolution.)
+ *
+ * @version $Rev$ $Date$
+ */
+public class StAX2SAXAdapter {
+ private final boolean namespacePrefixes;
+
+ /**
+ * Construct a new StAX to SAX adapter that will convert a StAX event stream into a SAX event stream.
+ *
+ * @param namespacePrefixes whether xmlns attributes should be included in startElement events;
+ */
+ public StAX2SAXAdapter(boolean namespacePrefixes) {
+ this.namespacePrefixes = namespacePrefixes;
+ }
+
+ /**
+ * Pull events from the StAX stream and dispatch to the SAX ContentHandler. The StAX stream would typically be located on a START_DOCUMENT or
+ * START_ELEMENT event and when this method returns it will be located on the associated END_DOCUMENT or END_ELEMENT event. Behaviour with other
+ * start events is undefined.
+ *
+ * @param reader StAX event source to read
+ * @param handler SAX ContentHandler for processing events
+ * @throws XMLStreamException if there was a problem reading the stream
+ * @throws SAXException passed through from the ContentHandler
+ */
+ public void parse(XMLStreamReader reader, ContentHandler handler) throws XMLStreamException, SAXException {
+ handler.setDocumentLocator(new LocatorAdaptor(reader.getLocation()));
+
+ // remembers the nest level of elements to know when we are done
+ int level = 0;
+ int event = reader.getEventType();
+ while (true) {
+ switch (event) {
+ case XMLStreamConstants.START_DOCUMENT:
+ level++;
+ handler.startDocument();
+ break;
+ case XMLStreamConstants.START_ELEMENT:
+ level++;
+ handleStartElement(reader, handler);
+ break;
+ case XMLStreamConstants.PROCESSING_INSTRUCTION:
+ handler.processingInstruction(reader.getPITarget(), reader.getPIData());
+ break;
+ case XMLStreamConstants.CHARACTERS:
+ handler.characters(reader.getTextCharacters(), reader.getTextStart(), reader.getTextLength());
+ break;
+ case XMLStreamConstants.END_ELEMENT:
+ handleEndElement(reader, handler);
+ level--;
+ if (level == 1) {
+ return;
+ }
+ break;
+ case XMLStreamConstants.END_DOCUMENT:
+ handler.endDocument();
+ return;
+ /*
+ * uncomment to handle all events rather than just mapped ones // StAX events that are not mapped to SAX case XMLStreamConstants.COMMENT:
+ * case XMLStreamConstants.SPACE: case XMLStreamConstants.ENTITY_REFERENCE: case XMLStreamConstants.DTD: case XMLStreamConstants.CDATA:
+ * case XMLStreamConstants.NOTATION_DECLARATION: case XMLStreamConstants.ENTITY_DECLARATION: break; // StAX events handled in
+ * START_ELEMENT case XMLStreamConstants.ATTRIBUTE: case XMLStreamConstants.NAMESPACE: break; default: throw new AssertionError("Unknown
+ * StAX event: " + event);
+ */
+ }
+ event = reader.next();
+ }
+ }
+
+ private void handleStartElement(XMLStreamReader reader, ContentHandler handler) throws SAXException {
+ // send startPrefixMapping events immediately before startElement event
+ int nsCount = reader.getNamespaceCount();
+ for (int i = 0; i < nsCount; i++) {
+ String prefix = reader.getNamespacePrefix(i);
+ if (prefix == null) { // true for default namespace
+ prefix = "";
+ }
+ handler.startPrefixMapping(prefix, reader.getNamespaceURI(i));
+ }
+
+ // fire startElement
+ QName qname = reader.getName();
+ String prefix = qname.getPrefix();
+ String rawname;
+ if (prefix == null || prefix.length() == 0) {
+ rawname = qname.getLocalPart();
+ } else {
+ rawname = prefix + ':' + qname.getLocalPart();
+ }
+ Attributes attrs = getAttributes(reader);
+ handler.startElement(qname.getNamespaceURI(), qname.getLocalPart(), rawname, attrs);
+ }
+
+ private static void handleEndElement(XMLStreamReader reader, ContentHandler handler) throws SAXException {
+ // fire endElement
+ QName qname = reader.getName();
+ handler.endElement(qname.getNamespaceURI(), qname.getLocalPart(), qname.toString());
+
+ // send endPrefixMapping events immediately after endElement event
+ // we send them in the opposite order to that returned but this is not actually required by SAX
+ int nsCount = reader.getNamespaceCount();
+ for (int i = nsCount - 1; i >= 0; i--) {
+ String prefix = reader.getNamespacePrefix(i);
+ if (prefix == null) { // true for default namespace
+ prefix = "";
+ }
+ handler.endPrefixMapping(prefix);
+ }
+ }
+
+ /**
+ * Get the attributes associated with the current START_ELEMENT event.
+ *
+ * @return the StAX attributes converted to org.xml.sax.Attributes
+ */
+ private Attributes getAttributes(XMLStreamReader reader) {
+ assert reader.getEventType() == XMLStreamConstants.START_ELEMENT;
+
+ AttributesImpl attrs = new AttributesImpl();
+
+ // add namespace declarations if required
+ if (namespacePrefixes) {
+ for (int i = 0; i < reader.getNamespaceCount(); i++) {
+ String prefix = reader.getNamespacePrefix(i);
+ String uri = reader.getNamespaceURI(i);
+ attrs.addAttribute(null, prefix, "xmlns:" + prefix, "CDATA", uri);
+ }
+ }
+
+ // Regular attributes
+ for (int i = 0; i < reader.getAttributeCount(); i++) {
+ String uri = reader.getAttributeNamespace(i);
+ if (uri == null) {
+ uri = "";
+ }
+ String localName = reader.getAttributeLocalName(i);
+ String prefix = reader.getAttributePrefix(i);
+ String qname;
+ if (prefix == null || prefix.length() == 0) {
+ qname = localName;
+ } else {
+ qname = prefix + ':' + localName;
+ }
+ String type = reader.getAttributeType(i);
+ String value = reader.getAttributeValue(i);
+
+ attrs.addAttribute(uri, localName, qname, type, value);
+ }
+
+ return attrs;
+ }
+
+ /**
+ * Adaptor for mapping Locator information.
+ */
+ private static class LocatorAdaptor implements Locator {
+ private final Location location;
+
+ private LocatorAdaptor(Location location) {
+ this.location = location;
+ }
+
+ public int getColumnNumber() {
+ return location == null ? 0 : location.getColumnNumber();
+ }
+
+ public int getLineNumber() {
+ return location == null ? 0 : location.getLineNumber();
+ }
+
+ public String getPublicId() {
+ return location == null ? "" : location.getPublicId();
+ }
+
+ public String getSystemId() {
+ return location == null ? "" : location.getSystemId();
+ }
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/StreamDeserializer.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/StreamDeserializer.java
new file mode 100644
index 0000000000..5d7bee9c3f
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/StreamDeserializer.java
@@ -0,0 +1,92 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.util;
+
+import java.util.Comparator;
+
+import javax.xml.XMLConstants;
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamReader;
+
+import org.apache.tuscany.sdo.util.resource.RecordedEventXMLStreamReader;
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.ecore.util.ExtendedMetaData;
+import org.eclipse.emf.ecore.xmi.XMLResource;
+import org.eclipse.emf.ecore.xml.type.internal.QName;
+
+/**
+ * StAX Deserializer. The instance isn't thread-safe, however it's safe to use the instance any times on the same thread.
+ */
+public class StreamDeserializer implements XMLStreamConstants {
+ protected XMLStreamReader reader;
+
+ protected final XMLStreamReader play(RecordedEventXMLStreamReader.Tag tag) {
+ return tag.play(reader);
+ }
+
+ protected String nameSpace, name;
+
+ protected final boolean typedXSI() {
+ name = reader.getAttributeValue(ExtendedMetaData.XSI_URI, XMLResource.TYPE);
+ if (name == null)
+ return false;
+ int index = name.indexOf(':');
+ if (index == -1)
+ nameSpace = reader.getNamespaceURI(XMLConstants.DEFAULT_NS_PREFIX); // may be XMLConstants.NULL_NS_URI
+ else {
+ nameSpace = reader.getNamespaceURI(name.substring(0, index));
+ name = name.substring(++index);
+ }
+ return true;
+ }
+
+ static protected Object value(Object type, String literal, NamespaceContext nameSpaces) {
+ Object value = EcoreUtil.createFromString((EDataType) type, literal);
+ if (!(value instanceof QName))
+ return value;
+ QName qName = (QName) value;
+ qName.setNamespaceURI(nameSpaces.getNamespaceURI(qName.getPrefix()));
+ return value;
+ }
+
+ static public class Attribute {
+ public String name, value;
+ }
+
+ static public final class QualifiedAttribute extends Attribute {
+ public String nameSpace;
+ }
+
+ static protected final Comparator EQUAL_NULL = new Comparator() {
+ public int compare(Object v, Object NULL) {
+ return v == null || v.equals(null) ? 0 : 1;
+ }
+ }, EQUAL = new Comparator() {
+ public int compare(Object v, Object value) {
+ return value.equals(v) ? 0 : -1;
+ }
+ }, SAME = new Comparator() {
+ public int compare(Object v, Object value) {
+ return value == v ? 0 : -1;
+ }
+ };
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/JavaMetaData.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/JavaMetaData.java
new file mode 100644
index 0000000000..f24b166f77
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/JavaMetaData.java
@@ -0,0 +1,90 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.util.metadata;
+
+import java.io.Serializable;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Java Meta Data</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.apache.tuscany.sdo.util.metadata.JavaMetaData#getFactoryInterface <em>Factory Interface</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.util.metadata.JavaMetaData#getTypeInterface <em>Type Interface</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @extends Serializable
+ * @generated
+ */
+public interface JavaMetaData extends Serializable
+{
+ /**
+ * Returns the value of the '<em><b>Factory Interface</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Factory Interface</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Factory Interface</em>' attribute.
+ * @see #setFactoryInterface(String)
+ * @generated
+ */
+ String getFactoryInterface();
+
+ /**
+ * Sets the value of the '{@link org.apache.tuscany.sdo.util.metadata.JavaMetaData#getFactoryInterface <em>Factory Interface</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Factory Interface</em>' attribute.
+ * @see #getFactoryInterface()
+ * @generated
+ */
+ void setFactoryInterface(String value);
+
+ /**
+ * Returns the value of the '<em><b>Type Interface</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Type Interface</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Type Interface</em>' attribute.
+ * @see #setTypeInterface(String)
+ * @generated
+ */
+ String getTypeInterface();
+
+ /**
+ * Sets the value of the '{@link org.apache.tuscany.sdo.util.metadata.JavaMetaData#getTypeInterface <em>Type Interface</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Type Interface</em>' attribute.
+ * @see #getTypeInterface()
+ * @generated
+ */
+ void setTypeInterface(String value);
+
+} // JavaMetaData
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/MetadataFactory.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/MetadataFactory.java
new file mode 100644
index 0000000000..1f540afa2c
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/MetadataFactory.java
@@ -0,0 +1,77 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.util.metadata;
+
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Factory</b> for the model.
+ * It provides a create method for each non-abstract class of the model.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public interface MetadataFactory
+{
+
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ MetadataFactory INSTANCE = org.apache.tuscany.sdo.util.metadata.impl.MetadataFactoryImpl.init();
+
+ /**
+ * Returns a new object of class '<em>Java Meta Data</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Java Meta Data</em>'.
+ * @generated
+ */
+ JavaMetaData createJavaMetaData();
+
+ /**
+ * Returns a new object of class '<em>SDO Meta Data Group</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>SDO Meta Data Group</em>'.
+ * @generated
+ */
+ SDOMetaDataGroup createSDOMetaDataGroup();
+
+ /**
+ * Returns a new object of class '<em>Type Meta Data</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Type Meta Data</em>'.
+ * @generated
+ */
+ TypeMetaData createTypeMetaData();
+
+ /**
+ * Returns a new object of class '<em>XSD Meta Data</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>XSD Meta Data</em>'.
+ * @generated
+ */
+ XSDMetaData createXSDMetaData();
+
+} //MetadataFactory
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/SDOMetaDataGroup.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/SDOMetaDataGroup.java
new file mode 100644
index 0000000000..5657f26ca5
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/SDOMetaDataGroup.java
@@ -0,0 +1,87 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.util.metadata;
+
+import java.io.Serializable;
+
+import java.util.List;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>SDO Meta Data Group</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.apache.tuscany.sdo.util.metadata.SDOMetaDataGroup#getJavaMetaData <em>Java Meta Data</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.util.metadata.SDOMetaDataGroup#getXsdMetaData <em>Xsd Meta Data</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.util.metadata.SDOMetaDataGroup#getTypeMetaData <em>Type Meta Data</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @extends Serializable
+ * @generated
+ */
+public interface SDOMetaDataGroup extends Serializable
+{
+ /**
+ * Returns the value of the '<em><b>Java Meta Data</b></em>' containment reference list.
+ * The list contents are of type {@link org.apache.tuscany.sdo.util.metadata.JavaMetaData}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Java Meta Data</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Java Meta Data</em>' containment reference list.
+ * @generated
+ */
+ List getJavaMetaData();
+
+ /**
+ * Returns the value of the '<em><b>Xsd Meta Data</b></em>' containment reference list.
+ * The list contents are of type {@link org.apache.tuscany.sdo.util.metadata.XSDMetaData}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Xsd Meta Data</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Xsd Meta Data</em>' containment reference list.
+ * @generated
+ */
+ List getXsdMetaData();
+
+ /**
+ * Returns the value of the '<em><b>Type Meta Data</b></em>' containment reference list.
+ * The list contents are of type {@link org.apache.tuscany.sdo.util.metadata.TypeMetaData}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Type Meta Data</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Type Meta Data</em>' containment reference list.
+ * @generated
+ */
+ List getTypeMetaData();
+
+} // SDOMetaDataGroup
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/TypeMetaData.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/TypeMetaData.java
new file mode 100644
index 0000000000..c3d67a8318
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/TypeMetaData.java
@@ -0,0 +1,65 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.util.metadata;
+
+import java.io.Serializable;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Type Meta Data</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.apache.tuscany.sdo.util.metadata.TypeMetaData#getLocation <em>Location</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @extends Serializable
+ * @generated
+ */
+public interface TypeMetaData extends Serializable
+{
+ /**
+ * Returns the value of the '<em><b>Location</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Location</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Location</em>' attribute.
+ * @see #setLocation(String)
+ * @generated
+ */
+ String getLocation();
+
+ /**
+ * Sets the value of the '{@link org.apache.tuscany.sdo.util.metadata.TypeMetaData#getLocation <em>Location</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Location</em>' attribute.
+ * @see #getLocation()
+ * @generated
+ */
+ void setLocation(String value);
+
+} // TypeMetaData
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/XSDMetaData.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/XSDMetaData.java
new file mode 100644
index 0000000000..09bffece71
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/XSDMetaData.java
@@ -0,0 +1,66 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sdo.util.metadata;
+
+import java.io.Serializable;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>XSD Meta Data</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.apache.tuscany.sdo.util.metadata.XSDMetaData#getLocation <em>Location</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @extends Serializable
+ * @generated
+ */
+public interface XSDMetaData extends Serializable
+{
+ /**
+ * Returns the value of the '<em><b>Location</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Location</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Location</em>' attribute.
+ * @see #setLocation(String)
+ * @generated
+ */
+ String getLocation();
+
+ /**
+ * Sets the value of the '{@link org.apache.tuscany.sdo.util.metadata.XSDMetaData#getLocation <em>Location</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Location</em>' attribute.
+ * @see #getLocation()
+ * @generated
+ */
+ void setLocation(String value);
+
+} // XSDMetaData
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/JavaMetaDataImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/JavaMetaDataImpl.java
new file mode 100644
index 0000000000..ea55034299
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/JavaMetaDataImpl.java
@@ -0,0 +1,267 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.util.metadata.impl;
+
+import commonj.sdo.Type;
+
+import org.apache.tuscany.sdo.impl.DataObjectBase;
+
+import org.apache.tuscany.sdo.util.metadata.JavaMetaData;
+import org.apache.tuscany.sdo.util.metadata.MetadataFactory;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Java Meta Data</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.apache.tuscany.sdo.util.metadata.impl.JavaMetaDataImpl#getFactoryInterface <em>Factory Interface</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.util.metadata.impl.JavaMetaDataImpl#getTypeInterface <em>Type Interface</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class JavaMetaDataImpl extends DataObjectBase implements JavaMetaData
+{
+ /**
+ * The feature id for the '<em><b>Factory Interface</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int FACTORY_INTERFACE = 0;
+
+ /**
+ * The feature id for the '<em><b>Type Interface</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int TYPE_INTERFACE = 1;
+
+ /**
+ * This represents the number of properties for this type.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+
+ public final static int SDO_PROPERTY_COUNT = 2;
+
+ /**
+ * The default value of the '{@link #getFactoryInterface() <em>Factory Interface</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getFactoryInterface()
+ * @generated
+ * @ordered
+ */
+ protected static final String FACTORY_INTERFACE_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getFactoryInterface() <em>Factory Interface</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getFactoryInterface()
+ * @generated
+ * @ordered
+ */
+ protected String factoryInterface = FACTORY_INTERFACE_DEFAULT_;
+
+ /**
+ * The default value of the '{@link #getTypeInterface() <em>Type Interface</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getTypeInterface()
+ * @generated
+ * @ordered
+ */
+ protected static final String TYPE_INTERFACE_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getTypeInterface() <em>Type Interface</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getTypeInterface()
+ * @generated
+ * @ordered
+ */
+ protected String typeInterface = TYPE_INTERFACE_DEFAULT_;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected JavaMetaDataImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Type getType()
+ {
+ return ((MetadataFactoryImpl)MetadataFactory.INSTANCE).getJavaMetaData();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getFactoryInterface()
+ {
+ return factoryInterface;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setFactoryInterface(String newFactoryInterface)
+ {
+ String oldFactoryInterface = factoryInterface;
+ factoryInterface = newFactoryInterface;
+ if (isNotifying())
+ notify(ChangeKind.SET, FACTORY_INTERFACE, oldFactoryInterface, factoryInterface);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getTypeInterface()
+ {
+ return typeInterface;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setTypeInterface(String newTypeInterface)
+ {
+ String oldTypeInterface = typeInterface;
+ typeInterface = newTypeInterface;
+ if (isNotifying())
+ notify(ChangeKind.SET, TYPE_INTERFACE, oldTypeInterface, typeInterface);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object get(int propertyIndex, boolean resolve)
+ {
+ switch (propertyIndex)
+ {
+ case FACTORY_INTERFACE:
+ return getFactoryInterface();
+ case TYPE_INTERFACE:
+ return getTypeInterface();
+ }
+ return super.get(propertyIndex, resolve);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void set(int propertyIndex, Object newValue)
+ {
+ switch (propertyIndex)
+ {
+ case FACTORY_INTERFACE:
+ setFactoryInterface((String)newValue);
+ return;
+ case TYPE_INTERFACE:
+ setTypeInterface((String)newValue);
+ return;
+ }
+ super.set(propertyIndex, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unset(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case FACTORY_INTERFACE:
+ setFactoryInterface(FACTORY_INTERFACE_DEFAULT_);
+ return;
+ case TYPE_INTERFACE:
+ setTypeInterface(TYPE_INTERFACE_DEFAULT_);
+ return;
+ }
+ super.unset(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSet(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case FACTORY_INTERFACE:
+ return FACTORY_INTERFACE_DEFAULT_ == null ? factoryInterface != null : !FACTORY_INTERFACE_DEFAULT_.equals(factoryInterface);
+ case TYPE_INTERFACE:
+ return TYPE_INTERFACE_DEFAULT_ == null ? typeInterface != null : !TYPE_INTERFACE_DEFAULT_.equals(typeInterface);
+ }
+ return super.isSet(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString()
+ {
+ if (isProxy(this)) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (factoryInterface: ");
+ result.append(factoryInterface);
+ result.append(", typeInterface: ");
+ result.append(typeInterface);
+ result.append(')');
+ return result.toString();
+ }
+
+} //JavaMetaDataImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/MetadataFactoryImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/MetadataFactoryImpl.java
new file mode 100644
index 0000000000..a4ea322549
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/MetadataFactoryImpl.java
@@ -0,0 +1,367 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.util.metadata.impl;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+
+import org.apache.tuscany.sdo.SDOFactory;
+
+import org.apache.tuscany.sdo.impl.FactoryBase;
+
+import org.apache.tuscany.sdo.model.ModelFactory;
+
+import org.apache.tuscany.sdo.model.impl.ModelFactoryImpl;
+
+import org.apache.tuscany.sdo.util.SDOUtil;
+
+import org.apache.tuscany.sdo.util.metadata.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Factory</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class MetadataFactoryImpl extends FactoryBase implements MetadataFactory
+{
+
+ /**
+ * The package namespace URI.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String NAMESPACE_URI = "org.apache.tuscany.sdo/metadata";
+
+ /**
+ * The package namespace name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String NAMESPACE_PREFIX = "metadata";
+ public static final int JAVA_META_DATA = 1;
+ public static final int SDO_META_DATA_GROUP = 2;
+ public static final int TYPE_META_DATA = 3;
+ public static final int XSD_META_DATA = 4;
+
+ /**
+ * Creates an instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public MetadataFactoryImpl()
+ {
+ super(NAMESPACE_URI, NAMESPACE_PREFIX);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public DataObject create(int typeNumber)
+ {
+ switch (typeNumber)
+ {
+ case JAVA_META_DATA: return (DataObject)createJavaMetaData();
+ case SDO_META_DATA_GROUP: return (DataObject)createSDOMetaDataGroup();
+ case TYPE_META_DATA: return (DataObject)createTypeMetaData();
+ case XSD_META_DATA: return (DataObject)createXSDMetaData();
+ default:
+ return super.create(typeNumber);
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public JavaMetaData createJavaMetaData()
+ {
+ JavaMetaDataImpl javaMetaData = new JavaMetaDataImpl();
+ return javaMetaData;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public SDOMetaDataGroup createSDOMetaDataGroup()
+ {
+ SDOMetaDataGroupImpl sdoMetaDataGroup = new SDOMetaDataGroupImpl();
+ return sdoMetaDataGroup;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public TypeMetaData createTypeMetaData()
+ {
+ TypeMetaDataImpl typeMetaData = new TypeMetaDataImpl();
+ return typeMetaData;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public XSDMetaData createXSDMetaData()
+ {
+ XSDMetaDataImpl xsdMetaData = new XSDMetaDataImpl();
+ return xsdMetaData;
+ }
+
+ // Following creates and initializes SDO metadata for the supported types.
+ protected Type javaMetaDataType = null;
+
+ public Type getJavaMetaData()
+ {
+ return javaMetaDataType;
+ }
+
+ protected Type sdoMetaDataGroupType = null;
+
+ public Type getSDOMetaDataGroup()
+ {
+ return sdoMetaDataGroupType;
+ }
+
+ protected Type typeMetaDataType = null;
+
+ public Type getTypeMetaData()
+ {
+ return typeMetaDataType;
+ }
+
+ protected Type xsdMetaDataType = null;
+
+ public Type getXSDMetaData()
+ {
+ return xsdMetaDataType;
+ }
+
+
+ private static boolean isInited = false;
+
+ public static MetadataFactoryImpl init()
+ {
+ if (isInited) return (MetadataFactoryImpl)FactoryBase.getStaticFactory(MetadataFactoryImpl.NAMESPACE_URI);
+ MetadataFactoryImpl theMetadataFactoryImpl = new MetadataFactoryImpl();
+ isInited = true;
+
+ // Initialize simple dependencies
+ SDOUtil.registerStaticTypes(SDOFactory.class);
+ SDOUtil.registerStaticTypes(ModelFactory.class);
+
+ // Create package meta-data objects
+ theMetadataFactoryImpl.createMetaData();
+
+ // Initialize created meta-data
+ theMetadataFactoryImpl.initializeMetaData();
+
+ // Mark meta-data to indicate it can't be changed
+ //theMetadataFactoryImpl.freeze(); //FB do we need to freeze / should we freeze ????
+
+ return theMetadataFactoryImpl;
+ }
+
+ private boolean isCreated = false;
+
+ public void createMetaData()
+ {
+ if (isCreated) return;
+ isCreated = true;
+
+
+ javaMetaDataType = createType(false, JAVA_META_DATA);
+ createProperty(true, javaMetaDataType, JavaMetaDataImpl.FACTORY_INTERFACE);
+ createProperty(true, javaMetaDataType, JavaMetaDataImpl.TYPE_INTERFACE);
+
+ sdoMetaDataGroupType = createType(false, SDO_META_DATA_GROUP);
+ createProperty(false, sdoMetaDataGroupType, SDOMetaDataGroupImpl.JAVA_META_DATA);
+ createProperty(false, sdoMetaDataGroupType, SDOMetaDataGroupImpl.XSD_META_DATA);
+ createProperty(false, sdoMetaDataGroupType, SDOMetaDataGroupImpl.TYPE_META_DATA);
+
+ typeMetaDataType = createType(false, TYPE_META_DATA);
+ createProperty(true, typeMetaDataType, TypeMetaDataImpl.LOCATION);
+
+ xsdMetaDataType = createType(false, XSD_META_DATA);
+ createProperty(true, xsdMetaDataType, XSDMetaDataImpl.LOCATION);
+ }
+
+ private boolean isInitialized = false;
+
+ public void initializeMetaData()
+ {
+ if (isInitialized) return;
+ isInitialized = true;
+
+ // Obtain other dependent packages
+ ModelFactoryImpl theModelPackageImpl = (ModelFactoryImpl)FactoryBase.getStaticFactory(ModelFactoryImpl.NAMESPACE_URI);
+ Property property = null;
+
+ // Add supertypes to classes
+
+ // Initialize classes and features; add operations and parameters
+ initializeType(javaMetaDataType, JavaMetaData.class, "JavaMetaData");
+
+ property = (Property)javaMetaDataType.getProperties().get(JavaMetaDataImpl.FACTORY_INTERFACE);
+ initializeProperty(property, theModelPackageImpl.getString(), "factoryInterface", null, 0, 1, JavaMetaData.class, false, false, false);
+
+ property = (Property)javaMetaDataType.getProperties().get(JavaMetaDataImpl.TYPE_INTERFACE);
+ initializeProperty(property, theModelPackageImpl.getString(), "typeInterface", null, 0, 1, JavaMetaData.class, false, false, false);
+
+ initializeType(sdoMetaDataGroupType, SDOMetaDataGroup.class, "SDOMetaDataGroup");
+
+ property = (Property)sdoMetaDataGroupType.getProperties().get(SDOMetaDataGroupImpl.JAVA_META_DATA);
+ initializeProperty(property, this.getJavaMetaData(), "javaMetaData", null, 0, -1, SDOMetaDataGroup.class, false, false, false, true , null);
+
+ property = (Property)sdoMetaDataGroupType.getProperties().get(SDOMetaDataGroupImpl.XSD_META_DATA);
+ initializeProperty(property, this.getXSDMetaData(), "xsdMetaData", null, 0, -1, SDOMetaDataGroup.class, false, false, false, true , null);
+
+ property = (Property)sdoMetaDataGroupType.getProperties().get(SDOMetaDataGroupImpl.TYPE_META_DATA);
+ initializeProperty(property, this.getTypeMetaData(), "typeMetaData", null, 0, -1, SDOMetaDataGroup.class, false, false, false, true , null);
+
+ initializeType(typeMetaDataType, TypeMetaData.class, "TypeMetaData");
+
+ property = (Property)typeMetaDataType.getProperties().get(TypeMetaDataImpl.LOCATION);
+ initializeProperty(property, theModelPackageImpl.getString(), "location", null, 1, 1, TypeMetaData.class, false, false, false);
+
+ initializeType(xsdMetaDataType, XSDMetaData.class, "XSDMetaData");
+
+ property = (Property)xsdMetaDataType.getProperties().get(XSDMetaDataImpl.LOCATION);
+ initializeProperty(property, theModelPackageImpl.getString(), "location", null, 1, 1, XSDMetaData.class, false, false, false);
+
+ createXSDMetaData(theModelPackageImpl);
+ }
+
+ protected void createXSDMetaData(ModelFactoryImpl theModelPackageImpl)
+ {
+ super.initXSD();
+
+ Property property = null;
+
+ property = createGlobalProperty
+ ("sdoMetaDataGroup",
+ this.getSDOMetaDataGroup(),
+ new String[]
+ {
+ "kind", "element",
+ "name", "sdoMetaDataGroup",
+ "namespace", "##targetNamespace"
+ });
+
+ addXSDMapping
+ (javaMetaDataType,
+ new String[]
+ {
+ "name", "JavaMetaData",
+ "kind", "empty"
+ });
+
+ addXSDMapping
+ ((Property)javaMetaDataType.getProperties().get(JavaMetaDataImpl.FACTORY_INTERFACE),
+ new String[]
+ {
+ "kind", "attribute",
+ "name", "factoryInterface"
+ });
+
+ addXSDMapping
+ ((Property)javaMetaDataType.getProperties().get(JavaMetaDataImpl.TYPE_INTERFACE),
+ new String[]
+ {
+ "kind", "attribute",
+ "name", "typeInterface"
+ });
+
+ addXSDMapping
+ (sdoMetaDataGroupType,
+ new String[]
+ {
+ "name", "SDOMetaDataGroup",
+ "kind", "elementOnly"
+ });
+
+ addXSDMapping
+ ((Property)sdoMetaDataGroupType.getProperties().get(SDOMetaDataGroupImpl.JAVA_META_DATA),
+ new String[]
+ {
+ "kind", "element",
+ "name", "javaMetaData"
+ });
+
+ addXSDMapping
+ ((Property)sdoMetaDataGroupType.getProperties().get(SDOMetaDataGroupImpl.XSD_META_DATA),
+ new String[]
+ {
+ "kind", "element",
+ "name", "xsdMetaData"
+ });
+
+ addXSDMapping
+ ((Property)sdoMetaDataGroupType.getProperties().get(SDOMetaDataGroupImpl.TYPE_META_DATA),
+ new String[]
+ {
+ "kind", "element",
+ "name", "typeMetaData"
+ });
+
+ addXSDMapping
+ (typeMetaDataType,
+ new String[]
+ {
+ "name", "TypeMetaData",
+ "kind", "empty"
+ });
+
+ addXSDMapping
+ ((Property)typeMetaDataType.getProperties().get(TypeMetaDataImpl.LOCATION),
+ new String[]
+ {
+ "kind", "attribute",
+ "name", "location"
+ });
+
+ addXSDMapping
+ (xsdMetaDataType,
+ new String[]
+ {
+ "name", "XSDMetaData",
+ "kind", "empty"
+ });
+
+ addXSDMapping
+ ((Property)xsdMetaDataType.getProperties().get(XSDMetaDataImpl.LOCATION),
+ new String[]
+ {
+ "kind", "attribute",
+ "name", "location"
+ });
+
+ }
+
+} //MetadataFactoryImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/SDOMetaDataGroupImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/SDOMetaDataGroupImpl.java
new file mode 100644
index 0000000000..3714eb7124
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/SDOMetaDataGroupImpl.java
@@ -0,0 +1,285 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.util.metadata.impl;
+
+import commonj.sdo.Type;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.tuscany.sdo.impl.DataObjectBase;
+
+import org.apache.tuscany.sdo.util.metadata.JavaMetaData;
+import org.apache.tuscany.sdo.util.metadata.MetadataFactory;
+import org.apache.tuscany.sdo.util.metadata.SDOMetaDataGroup;
+import org.apache.tuscany.sdo.util.metadata.TypeMetaData;
+import org.apache.tuscany.sdo.util.metadata.XSDMetaData;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>SDO Meta Data Group</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.apache.tuscany.sdo.util.metadata.impl.SDOMetaDataGroupImpl#getJavaMetaData <em>Java Meta Data</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.util.metadata.impl.SDOMetaDataGroupImpl#getXsdMetaData <em>Xsd Meta Data</em>}</li>
+ * <li>{@link org.apache.tuscany.sdo.util.metadata.impl.SDOMetaDataGroupImpl#getTypeMetaData <em>Type Meta Data</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class SDOMetaDataGroupImpl extends DataObjectBase implements SDOMetaDataGroup
+{
+ /**
+ * The feature id for the '<em><b>Java Meta Data</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int JAVA_META_DATA = 0;
+
+ /**
+ * The feature id for the '<em><b>Xsd Meta Data</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int XSD_META_DATA = 1;
+
+ /**
+ * The feature id for the '<em><b>Type Meta Data</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int TYPE_META_DATA = 2;
+
+ /**
+ * This represents the number of properties for this type.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+
+ public final static int SDO_PROPERTY_COUNT = 3;
+
+ /**
+ * The cached value of the '{@link #getJavaMetaData() <em>Java Meta Data</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getJavaMetaData()
+ * @generated
+ * @ordered
+ */
+
+ protected List javaMetaData = null;
+
+ /**
+ * The cached value of the '{@link #getXsdMetaData() <em>Xsd Meta Data</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getXsdMetaData()
+ * @generated
+ * @ordered
+ */
+
+ protected List xsdMetaData = null;
+
+ /**
+ * The cached value of the '{@link #getTypeMetaData() <em>Type Meta Data</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getTypeMetaData()
+ * @generated
+ * @ordered
+ */
+
+ protected List typeMetaData = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected SDOMetaDataGroupImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Type getType()
+ {
+ return ((MetadataFactoryImpl)MetadataFactory.INSTANCE).getSDOMetaDataGroup();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public List getJavaMetaData()
+ {
+ if (javaMetaData == null)
+ {
+ javaMetaData = createPropertyList(ListKind.CONTAINMENT, JavaMetaData.class, JAVA_META_DATA);
+ }
+ return javaMetaData;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public List getXsdMetaData()
+ {
+ if (xsdMetaData == null)
+ {
+ xsdMetaData = createPropertyList(ListKind.CONTAINMENT, XSDMetaData.class, XSD_META_DATA);
+ }
+ return xsdMetaData;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public List getTypeMetaData()
+ {
+ if (typeMetaData == null)
+ {
+ typeMetaData = createPropertyList(ListKind.CONTAINMENT, TypeMetaData.class, TYPE_META_DATA);
+ }
+ return typeMetaData;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeContext inverseRemove(Object otherEnd, int propertyIndex, ChangeContext changeContext)
+ {
+ switch (propertyIndex)
+ {
+ case JAVA_META_DATA:
+ return removeFromList(getJavaMetaData(), otherEnd, changeContext);
+ case XSD_META_DATA:
+ return removeFromList(getXsdMetaData(), otherEnd, changeContext);
+ case TYPE_META_DATA:
+ return removeFromList(getTypeMetaData(), otherEnd, changeContext);
+ }
+ return super.inverseRemove(otherEnd, propertyIndex, changeContext);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object get(int propertyIndex, boolean resolve)
+ {
+ switch (propertyIndex)
+ {
+ case JAVA_META_DATA:
+ return getJavaMetaData();
+ case XSD_META_DATA:
+ return getXsdMetaData();
+ case TYPE_META_DATA:
+ return getTypeMetaData();
+ }
+ return super.get(propertyIndex, resolve);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void set(int propertyIndex, Object newValue)
+ {
+ switch (propertyIndex)
+ {
+ case JAVA_META_DATA:
+ getJavaMetaData().clear();
+ getJavaMetaData().addAll((Collection)newValue);
+ return;
+ case XSD_META_DATA:
+ getXsdMetaData().clear();
+ getXsdMetaData().addAll((Collection)newValue);
+ return;
+ case TYPE_META_DATA:
+ getTypeMetaData().clear();
+ getTypeMetaData().addAll((Collection)newValue);
+ return;
+ }
+ super.set(propertyIndex, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unset(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case JAVA_META_DATA:
+ getJavaMetaData().clear();
+ return;
+ case XSD_META_DATA:
+ getXsdMetaData().clear();
+ return;
+ case TYPE_META_DATA:
+ getTypeMetaData().clear();
+ return;
+ }
+ super.unset(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSet(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case JAVA_META_DATA:
+ return javaMetaData != null && !javaMetaData.isEmpty();
+ case XSD_META_DATA:
+ return xsdMetaData != null && !xsdMetaData.isEmpty();
+ case TYPE_META_DATA:
+ return typeMetaData != null && !typeMetaData.isEmpty();
+ }
+ return super.isSet(propertyIndex);
+ }
+
+} //SDOMetaDataGroupImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/TypeMetaDataImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/TypeMetaDataImpl.java
new file mode 100644
index 0000000000..a1fddf6f95
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/TypeMetaDataImpl.java
@@ -0,0 +1,203 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.util.metadata.impl;
+
+import commonj.sdo.Type;
+
+import org.apache.tuscany.sdo.impl.DataObjectBase;
+
+import org.apache.tuscany.sdo.util.metadata.MetadataFactory;
+import org.apache.tuscany.sdo.util.metadata.TypeMetaData;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Type Meta Data</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.apache.tuscany.sdo.util.metadata.impl.TypeMetaDataImpl#getLocation <em>Location</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class TypeMetaDataImpl extends DataObjectBase implements TypeMetaData
+{
+ /**
+ * The feature id for the '<em><b>Location</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int LOCATION = 0;
+
+ /**
+ * This represents the number of properties for this type.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+
+ public final static int SDO_PROPERTY_COUNT = 1;
+
+ /**
+ * The default value of the '{@link #getLocation() <em>Location</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getLocation()
+ * @generated
+ * @ordered
+ */
+ protected static final String LOCATION_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getLocation() <em>Location</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getLocation()
+ * @generated
+ * @ordered
+ */
+ protected String location = LOCATION_DEFAULT_;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TypeMetaDataImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Type getType()
+ {
+ return ((MetadataFactoryImpl)MetadataFactory.INSTANCE).getTypeMetaData();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getLocation()
+ {
+ return location;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setLocation(String newLocation)
+ {
+ String oldLocation = location;
+ location = newLocation;
+ if (isNotifying())
+ notify(ChangeKind.SET, LOCATION, oldLocation, location);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object get(int propertyIndex, boolean resolve)
+ {
+ switch (propertyIndex)
+ {
+ case LOCATION:
+ return getLocation();
+ }
+ return super.get(propertyIndex, resolve);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void set(int propertyIndex, Object newValue)
+ {
+ switch (propertyIndex)
+ {
+ case LOCATION:
+ setLocation((String)newValue);
+ return;
+ }
+ super.set(propertyIndex, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unset(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case LOCATION:
+ setLocation(LOCATION_DEFAULT_);
+ return;
+ }
+ super.unset(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSet(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case LOCATION:
+ return LOCATION_DEFAULT_ == null ? location != null : !LOCATION_DEFAULT_.equals(location);
+ }
+ return super.isSet(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString()
+ {
+ if (isProxy(this)) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (location: ");
+ result.append(location);
+ result.append(')');
+ return result.toString();
+ }
+
+} //TypeMetaDataImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/XSDMetaDataImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/XSDMetaDataImpl.java
new file mode 100644
index 0000000000..68b68fbaac
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/XSDMetaDataImpl.java
@@ -0,0 +1,203 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.util.metadata.impl;
+
+import commonj.sdo.Type;
+
+import org.apache.tuscany.sdo.impl.DataObjectBase;
+
+import org.apache.tuscany.sdo.util.metadata.MetadataFactory;
+import org.apache.tuscany.sdo.util.metadata.XSDMetaData;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>XSD Meta Data</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.apache.tuscany.sdo.util.metadata.impl.XSDMetaDataImpl#getLocation <em>Location</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class XSDMetaDataImpl extends DataObjectBase implements XSDMetaData
+{
+ /**
+ * The feature id for the '<em><b>Location</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int LOCATION = 0;
+
+ /**
+ * This represents the number of properties for this type.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+
+ public final static int SDO_PROPERTY_COUNT = 1;
+
+ /**
+ * The default value of the '{@link #getLocation() <em>Location</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getLocation()
+ * @generated
+ * @ordered
+ */
+ protected static final String LOCATION_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getLocation() <em>Location</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getLocation()
+ * @generated
+ * @ordered
+ */
+ protected String location = LOCATION_DEFAULT_;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected XSDMetaDataImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Type getType()
+ {
+ return ((MetadataFactoryImpl)MetadataFactory.INSTANCE).getXSDMetaData();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getLocation()
+ {
+ return location;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setLocation(String newLocation)
+ {
+ String oldLocation = location;
+ location = newLocation;
+ if (isNotifying())
+ notify(ChangeKind.SET, LOCATION, oldLocation, location);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object get(int propertyIndex, boolean resolve)
+ {
+ switch (propertyIndex)
+ {
+ case LOCATION:
+ return getLocation();
+ }
+ return super.get(propertyIndex, resolve);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void set(int propertyIndex, Object newValue)
+ {
+ switch (propertyIndex)
+ {
+ case LOCATION:
+ setLocation((String)newValue);
+ return;
+ }
+ super.set(propertyIndex, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unset(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case LOCATION:
+ setLocation(LOCATION_DEFAULT_);
+ return;
+ }
+ super.unset(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSet(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case LOCATION:
+ return LOCATION_DEFAULT_ == null ? location != null : !LOCATION_DEFAULT_.equals(location);
+ }
+ return super.isSet(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString()
+ {
+ if (isProxy(this)) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (location: ");
+ result.append(location);
+ result.append(')');
+ return result.toString();
+ }
+
+} //XSDMetaDataImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/ChangeSummaryStreamDeserializer.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/ChangeSummaryStreamDeserializer.java
new file mode 100644
index 0000000000..6dc461a2fe
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/ChangeSummaryStreamDeserializer.java
@@ -0,0 +1,663 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.util.resource;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import org.apache.tuscany.sdo.SDOFactory;
+import org.apache.tuscany.sdo.helper.SDOAnnotations;
+import org.apache.tuscany.sdo.impl.ChangeSummaryImpl;
+import org.apache.tuscany.sdo.impl.ClassImpl;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.ETypedElement;
+import org.eclipse.emf.ecore.change.ChangeDescription;
+import org.eclipse.emf.ecore.change.ChangeFactory;
+import org.eclipse.emf.ecore.change.ChangeKind;
+import org.eclipse.emf.ecore.change.FeatureChange;
+import org.eclipse.emf.ecore.change.FeatureMapEntry;
+import org.eclipse.emf.ecore.change.ListChange;
+import org.eclipse.emf.ecore.util.FeatureMap;
+import org.eclipse.emf.ecore.util.FeatureMapUtil;
+
+import commonj.sdo.ChangeSummary;
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+import commonj.sdo.helper.HelperContext;
+
+/**
+ * ChangeSummary StAX Deserializer whose input conforms to the SDO Java/C++/PHP specifications. The instance isn't thread-safe, however it's safe to
+ * use the instance any times on the same thread.
+ */
+public class ChangeSummaryStreamDeserializer extends SDODeserializer {
+ static final class ForwardReference extends Ref {
+ final String unset;
+
+ ForwardReference(String ref, NamespaceContext nameSpaces, String u) {
+ super(ref, nameSpaces);
+ unset = u;
+ }
+
+ Collection attributes/* = null */, qualifiedAttributes/* = null */, tags/* = null */; // may be null, never empty
+ }
+
+ protected Collection forwardReferences/* = null */;
+
+ static private final class ElementChange extends Ref {
+ private final Object containing, containment;
+ private ElementChange(String ref, NamespaceContext nameSpaces, Object property, Object propertyInSequence) {
+ super(ref, nameSpaces);
+ containing = property;
+ containment = propertyInSequence;
+ }
+ }
+
+ static private class PropertyMapChanges {
+ Map/* Property,List */lists/* = null */;// may be null
+
+ Collection put(Object property) {
+ Collection list = new ArrayList();
+ lists.put(property, list);
+ return list;
+ }
+
+ protected final Collection get(Object property) {
+ Object list = lists.get(property);
+ return list == null ? put(property) : (Collection) list;
+ }
+
+ protected final Collection newList(Object property) {
+ lists = new HashMap();
+ return put(property);
+ }
+ }
+
+ static final class ObjectChanges extends PropertyMapChanges {
+ Collection elementChanges/* = null */,// may be null, never empty
+ featureChanges;
+
+ protected final void newElementChanges() {
+ elementChanges = new ArrayList();
+ }
+ }
+
+ Collection objectChangesCollection/* = null */, objectMapChanges, deletedDataObjects;
+
+ protected final ObjectChanges newObjectChanges(Collection featureChanges) {
+ ObjectChanges objectChanges = new ObjectChanges();
+ objectChanges.featureChanges = featureChanges;
+ if (objectChangesCollection == null)
+ objectChangesCollection = new ArrayList();
+ objectChangesCollection.add(objectChanges);
+ return objectChanges;
+ }
+
+ private ChangeFactory changeFactory;
+
+ private SDOFactory changeSettingFactory;
+
+ private void logPropertyChange(Collection featureChanges, EStructuralFeature feature, Object value, boolean set) {
+ if (changeSettingFactory == null)
+ featureChanges.add(changeFactory.createFeatureChange(feature, value, set));
+ else
+ featureChanges.add(changeSettingFactory.createChangeSummarySetting(feature, value, set));
+ }
+
+ void unsetProperty(Collection featureChanges, String unset, int begin, int index, Type type) {
+ logPropertyChange(featureChanges, (EStructuralFeature) type.getProperty(unset.substring(begin, index)), null, false);
+ }
+
+ static boolean isWhitespace(String unset, int index) {
+ return Character.isWhitespace(unset.charAt(index));
+ }
+
+ protected final Collection unsetProperties(EObject referent, String unset, Type type) {
+ Map.Entry entry = changeFactory.createEObjectToChangesMapEntry(referent);
+ objectMapChanges.add(entry);
+ Collection featureChanges = (Collection) entry.getValue();
+ if (unset == null)
+ return featureChanges;
+ int end = unset.length();
+ if (end != 0)
+ for (int begin = 0, index = 1;/* true */; ++index) {
+ if (index == end) {
+ unsetProperty(featureChanges, unset, begin, index, type);
+ break;
+ }
+ if (isWhitespace(unset, index)) {
+ unsetProperty(featureChanges, unset, begin, index, type);
+ while (true) {
+ if (++index != end)
+ return featureChanges;
+ if (!isWhitespace(unset, index)) {
+ begin = index;
+ break;
+ }
+ }
+ }
+ }
+ return featureChanges;
+ }
+
+ private Object value(EStructuralFeature containing, Object containment, Object value) {
+ return FeatureMapUtil.isFeatureMap(containing) ? changeFactory.createFeatureMapEntry((EStructuralFeature) containment, value) : value;
+ }
+
+ private void logPropertyChange(Collection featureChanges, Object containing, Object containment, Object value) {
+ EStructuralFeature feature = (EStructuralFeature) containing;
+ logPropertyChange(featureChanges, feature, value(feature, containment, value), true);
+ }
+
+ private void logPropertyChange(Collection featureChanges, Object property, Object value) {
+ logPropertyChange(featureChanges, property, propertyInSequence, value);
+ }
+
+ void logAttributeChange(Collection featureChanges, Property property, String literal, NamespaceContext nameSpaces) {
+ logPropertyChange(featureChanges, property, value(property.getType(), literal, nameSpaces));
+ }
+
+ protected final void logAttributeChange(Collection featureChanges, String property, Type type, String value, NamespaceContext nameSpaces) {
+ logAttributeChange(featureChanges, getProperty(type, property), value, nameSpaces);
+ }
+
+ protected final void logAttributeChange(Collection featureChanges, String nameSpace, String name, Type type, String value,
+ NamespaceContext nameSpaces) {
+ logAttributeChange(featureChanges, getProperty(type, nameSpace, name, false), value, nameSpaces);
+ }
+
+ protected final String ref() {
+ return reader.getAttributeValue(SDOAnnotations.COMMONJ_SDO_NS, ChangeSummaryStreamSerializer.REF_ATTRIBUTE);
+ }
+
+ ChangeSummaryImpl changeSummary;
+
+ protected Object load(XMLStreamReader reader, Map options) throws XMLStreamException {
+ Object value = super.load(reader, options);
+ deletedDataObjects.add(value);
+ return value;
+ }
+
+ protected final void getChangeSummary(DataObject rootObject) {
+ changeSummary = (ChangeSummaryImpl) rootObject.getChangeSummary(); // DynamicDataObjectImpl(EClass)
+ }
+
+ static protected final class Tag extends RecordedEventXMLStreamReader.Tag {
+ protected String ref;
+
+ protected Object value;
+
+ protected Tag(XMLStreamReader reader) {
+ super(reader);
+ }
+ }
+
+ protected final void addPropertyChange(Collection list, Object value, Object containing) {
+ list.add(value((EStructuralFeature) containing, propertyInSequence, value));
+ }
+
+ protected boolean logging;
+
+ /**
+ * Imports ChangeSummary 2-1. Forward references will be resolved by {@link #end()}.
+ *
+ * @param reader
+ * Never null
+ * @throws XMLStreamException
+ */
+ public final void begin(DataObject rootObject, HelperContext scope, XMLStreamReader reader) throws XMLStreamException {
+ /*
+ * 3-1. Instantiate ChangeSummary input: reader (xsi:type), factory, rootObject output: changeSummary, changeDescription
+ */
+ initialize(reader, scope, rootObject);
+ if (typedXSI()) {
+ changeSummary = (ChangeSummaryImpl) scope.getDataFactory().create(nameSpace, name);
+ if (changeSummary == null)
+ getChangeSummary(rootObject);
+ else {
+ Property csp = ((ClassImpl) rootObject.getType()).getChangeSummaryProperty();
+ rootObject.set(csp, changeSummary);
+ changeSummary.setDataObject(rootObject);
+ }
+ } else
+ getChangeSummary(rootObject);
+ ChangeDescription changeDescription = (ChangeDescription) changeSummary;
+
+ /*
+ * 3-2. "logging" attribute input: reader output: logging
+ */
+ logging = Boolean.valueOf(reader.getAttributeValue(null, "logging")).booleanValue();
+
+ /*
+ * 3-3. Modified DataObjects input: changeDescription
+ */
+ if (forwardReferences != null)
+ forwardReferences.clear();
+ if (objectChangesCollection != null)
+ objectChangesCollection.clear();
+ if (START_ELEMENT == reader.nextTag()) {
+ objectMapChanges = changeDescription.getObjectChanges();
+ deletedDataObjects = changeDescription.getObjectsToAttach();
+ Object factory = changeDescription.eClass().getEPackage().getEFactoryInstance();
+ changeFactory = factory instanceof ChangeFactory ? (ChangeFactory) factory : ChangeFactory.eINSTANCE;
+ changeSettingFactory = factory instanceof SDOFactory ? (SDOFactory) factory : null;
+ do {
+ /*
+ * Modified DataObject
+ */
+ String ref = ref(), unset = reader.getAttributeValue(SDOAnnotations.COMMONJ_SDO_NS, ChangeSummaryStreamSerializer.UNSET);
+ int attributes = reader.getAttributeCount();
+ NamespaceContext nameSpaces = reader.getNamespaceContext();
+ EObject referent = referent(ref, nameSpaces);
+ if (referent == null) {
+ /*
+ * Forward-referenced(unresolved) modified DataObject
+ */
+ ForwardReference forwardReference = new ForwardReference(ref, nameSpaces, unset);
+ if (forwardReferences == null)
+ forwardReferences = new ArrayList();
+ forwardReferences.add(forwardReference);
+ do // what about xmlns="NS1" a1="qName" xmlns="NS2" a2="qName" ?
+ {
+ /*
+ * Record property old value as attribute for end()
+ */
+ String nameSpace = reader.getAttributeNamespace(--attributes), name = reader.getAttributeLocalName(attributes), value = reader
+ .getAttributeValue(attributes);
+ if (nameSpace == null) {
+ /*
+ * Local attribute
+ */
+ Attribute attribute = new Attribute();
+ attribute.name = name;
+ attribute.value = value;
+ if (forwardReference.attributes == null)
+ forwardReference.attributes = new ArrayList();
+ forwardReference.attributes.add(attribute);
+ } else if (!SDOAnnotations.COMMONJ_SDO_NS.equals(nameSpace) || !ChangeSummaryStreamSerializer.REF_ATTRIBUTE.equals(name)
+ && !ChangeSummaryStreamSerializer.UNSET.equals(name)) {
+ /*
+ * Qualified(global) attribute
+ */
+ QualifiedAttribute attribute = new QualifiedAttribute();
+ attribute.name = name;
+ attribute.value = value;
+ attribute.nameSpace = nameSpace;
+ if (forwardReference.qualifiedAttributes == null)
+ forwardReference.qualifiedAttributes = new ArrayList();
+ forwardReference.qualifiedAttributes.add(attribute);
+ }
+ } while (attributes != 0);
+ while (START_ELEMENT == reader.nextTag()) {
+ /*
+ * Record property old value as element for end()
+ */
+ Tag tag = new Tag(reader);
+ if (forwardReference.tags == null)
+ forwardReference.tags = new ArrayList();
+ forwardReference.tags.add(tag);
+ tag.ref = ref();
+ if (tag.ref != null)
+ continue;
+ Type xsi = typeXSI();
+ if (xsi == null) {
+ if (tag.nameSpace != null)
+ tag.value = value(globalElementType(tag.nameSpace, tag.name.getLocalPart())); // TODO substitutionGroup type if null
+ else if (tag.record(reader))
+ break;
+ } else
+ tag.value = value(xsi);
+ }
+ } else {
+ /*
+ * Resolved(back-referenced) modified DataObject
+ */
+ Type type = ((DataObject) referent).getType();
+ Collection featureChanges = unsetProperties(referent, unset, type);
+ do // what about xmlns="NS1" a1="qName" xmlns="NS2" a2="qName" ?
+ {
+ /*
+ * Log property old value as attribute
+ */
+ String nameSpace = reader.getAttributeNamespace(--attributes), name = reader.getAttributeLocalName(attributes), value = reader
+ .getAttributeValue(attributes);
+ if (nameSpace == null)
+ logAttributeChange(featureChanges, name, type, value, nameSpaces);
+ else if (!SDOAnnotations.COMMONJ_SDO_NS.equals(nameSpace) || !ChangeSummaryStreamSerializer.REF_ATTRIBUTE.equals(name)
+ && !ChangeSummaryStreamSerializer.UNSET.equals(name))
+ logAttributeChange(featureChanges, nameSpace, name, type, value, nameSpaces);
+ } while (attributes != 0);
+ if (START_ELEMENT == reader.nextTag()) {
+ ObjectChanges objectChanges = null;
+ do {
+ /*
+ * Log property old value as element
+ */
+ String nameSpace = reader.getNamespaceURI(), name = reader.getLocalName();
+ Property property = getProperty(nameSpace, name, type);
+ boolean many = property.isMany();
+ Object value;
+ ref = ref();
+ if (ref == null) {
+ /*
+ * Contained property old value
+ */
+ Type xsi = typeXSI();
+ if (xsi != null)
+ value = value(xsi);
+ else if (nameSpace == null)
+ value = value(reader);
+ else {
+ xsi = globalElementType(nameSpace, name);
+ value = value(xsi == null ? propertyInSequence.getType() : xsi);
+ }
+ } else {
+ /*
+ * Referenced child DataObject
+ */
+ nameSpaces = reader.getNamespaceContext();
+ reader.nextTag()/* END_ELEMENT */;
+ value = referent(ref, nameSpaces);
+ if (value == null) {
+ /*
+ * Forward-referenced(unresolved) child DataObject
+ */
+ if (!many) {
+ ElementChange elementChange = new ElementChange(ref, nameSpaces, property, propertyInSequence);
+ if (objectChanges == null) {
+ objectChanges = newObjectChanges(featureChanges);
+ objectChanges.newElementChanges();
+ } else if (objectChanges.elementChanges == null)
+ objectChanges.newElementChanges();
+ objectChanges.elementChanges.add(elementChange);
+ continue;
+ }
+ value = new Ref(ref, nameSpaces);
+ }
+ }
+ if (many) {
+ Collection list;
+ if (objectChanges == null) {
+ objectChanges = newObjectChanges(featureChanges);
+ list = objectChanges.newList(property);
+ } else if (objectChanges.lists == null)
+ list = objectChanges.newList(property);
+ else
+ list = objectChanges.get(property);
+ addPropertyChange(list, value, property);
+ } else
+ logPropertyChange(featureChanges, property, value);
+ } while (START_ELEMENT == reader.nextTag());
+ }
+ }
+ } while (START_ELEMENT == reader.nextTag());
+ }
+ }
+
+ static private boolean sequence(Object listChanges) {
+ return FeatureMapUtil.isFeatureMap(((FeatureChange) ((EStructuralFeature.Setting) listChanges).getEObject()).getFeature());
+ }
+
+ private ListChange createListChange(ChangeKind changeKind, int index, Collection listChanges) {
+ ListChange listChange = changeFactory.createListChange();
+ listChange.setKind(changeKind);
+ listChange.setIndex(index);
+ listChanges.add(listChange);
+ return listChange;
+ }
+
+ Collection add(Collection adds, int change, Collection listChanges, Object value) {
+ if (adds == null) {
+ ListChange listChange = createListChange(ChangeKind.ADD_LITERAL, change, listChanges);
+ adds = sequence(listChanges) ? listChange.getFeatureMapEntryValues() : listChange.getValues();
+ }
+ adds.add(value);
+ return adds;
+ }
+
+ private int remove(int change, Collection listChanges, List list, int begin, int end) {
+ ListChange listChange = createListChange(ChangeKind.REMOVE_LITERAL, change, listChanges);
+ if (sequence(listChanges)) {
+ Collection removes = listChange.getFeatureMapEntryValues();
+ do {
+ FeatureMap.Entry fme = (FeatureMap.Entry) list.get(begin);
+ removes.add(changeFactory.createFeatureMapEntry(fme.getEStructuralFeature(), fme.getValue()));
+ } while (++begin != end);
+ return begin;
+ }
+ Collection removes = listChange.getValues();
+ do
+ removes.add(list.get(begin));
+ while (++begin != end);
+ return begin;
+ }
+
+ int remove(int begin, int end, int change, Collection listChanges, List list) {
+ return begin == end ? begin : remove(change, listChanges, list, begin, end);
+ }
+
+ protected final void logManyChanges(PropertyMapChanges propertyMapChanges, EObject referent, Collection featureChanges) {
+ for (Iterator lists = propertyMapChanges.lists.entrySet().iterator(); lists.hasNext();) {
+ /*
+ * Compute ListChanges out of comparision of old and new list
+ */
+ Map.Entry entry = (Map.Entry) lists.next();
+ EStructuralFeature property = (EStructuralFeature) entry.getKey();
+ Iterator values = ((Collection) entry.getValue()).iterator(); // old list
+ Object value = referent.eGet(property);
+ List list = value instanceof FeatureMap.Internal.Wrapper ? ((FeatureMap.Internal.Wrapper) value).featureMap() : (List) value; // new
+ int change = 0;
+ FeatureChange featureChange = changeSettingFactory == null ? changeFactory.createFeatureChange() : (FeatureChange) changeSettingFactory
+ .createChangeSummarySetting();
+ featureChange.setFeature(property);
+ Collection listChanges = featureChange.getListChanges(), adds = null;
+ featureChanges.add(featureChange);
+ if (property.getEType() instanceof EClass) {
+ /*
+ * Log child DataObject changes
+ */
+ int begin = 0, end = list.size();
+ while (values.hasNext()) {
+ value = values.next();
+ if (value.getClass() == Ref.class) {
+ value = referent((Ref) value);
+ if (value == null)
+ continue;// report error?
+ }
+ // values.remove();
+ for (int index = begin;/* true */; ++index)
+ if (index == end) {
+ adds = add(adds, change, listChanges, value);
+ break;
+ } else if (list.get(index) == value) // List#indexOf uses equals
+ {
+ begin = remove(begin, index, change, listChanges, list);
+ ++begin;
+ adds = null;
+ break;
+ }
+ ++change;
+ }
+ remove(begin, end, change, listChanges, list);
+ } else if (FeatureMapUtil.isFeatureMap(property)) {
+ /*
+ * Log Sequence changes
+ */
+ int begin = 0, end = list.size();
+ while (values.hasNext()) {
+ FeatureMapEntry featureMapEntry = (FeatureMapEntry) values.next();
+ value = featureMapEntry.getValue();
+ if (value.getClass() == Ref.class) {
+ value = referent((Ref) value);
+ if (value == null)
+ continue;// report error?
+ }
+ // values.remove();
+ Comparator equality;
+ ETypedElement feature = featureMapEntry.getFeature();
+ if (((Type) feature.getEType()).isDataType())
+ if (value == null)
+ equality = EQUAL_NULL;
+ else
+ equality = EQUAL;
+ else
+ equality = SAME;
+ for (int index = begin;/* true */; ++index)
+ if (index == end) {
+ adds = add(adds, change, listChanges, featureMapEntry);
+ break;
+ } else {
+ FeatureMap.Entry fme = (FeatureMap.Entry) list.get(index);
+ if (feature == fme.getEStructuralFeature() && equality.compare(fme.getValue(), value) == 0) {
+ begin = remove(begin, index, change, listChanges, list);
+ ++begin;
+ adds = null;
+ break;
+ }
+ }
+ ++change;
+ }
+ remove(begin, end, change, listChanges, list);
+ } else {
+ /*
+ * Log simple value changes
+ */
+ while (values.hasNext()) {
+ value = values.next();
+ // values.remove();
+ int index = list.indexOf(value);
+ switch (index) {
+ case -1:
+ adds = add(adds, change, listChanges, value);
+ break;
+ default:
+ remove(change, listChanges, list, 0, index);
+ case 0:
+ list = list.subList(++index, list.size());
+ adds = null;
+ }
+ ++change;
+ }
+ remove(0, list.size(), change, listChanges, list);
+ }
+ }
+ }
+
+ protected PropertyMapChanges propertyMapChanges/* = null */;
+
+ /**
+ * Imports ChangeSummary 2-2. Resolves forward references from {@link #begin} and resumes logging if necessary. If it's invoked from
+ * patching/resolving, try to make it last since logging may be turned on.
+ *
+ * @see #begin
+ */
+ public final ChangeSummary end() throws XMLStreamException {
+ if (forwardReferences != null)
+ for (Iterator iterator = forwardReferences.iterator(); iterator.hasNext();) {
+ /*
+ * Forward-referenced(unresolved) modified DataObject from begin(...)
+ */
+ ForwardReference forwardReference = (ForwardReference) iterator.next();
+ EObject referent = referent(forwardReference);
+ if (referent == null)
+ continue; // report error?
+ // iterator.remove();
+ Type type = ((DataObject) referent).getType();
+ Collection featureChanges = unsetProperties(referent, forwardReference.unset, type);
+ if (forwardReference.attributes != null)
+ for (Iterator attributes = forwardReference.attributes.iterator(); attributes.hasNext();) {
+ /*
+ * Log property old value as local attribute from begin(...)
+ */
+ Attribute attribute = (Attribute) attributes.next();
+ logAttributeChange(featureChanges, attribute.name, type, attribute.value, forwardReference.nameSpaces);
+ }
+ if (forwardReference.qualifiedAttributes != null)
+ for (Iterator attributes = forwardReference.qualifiedAttributes.iterator(); attributes.hasNext();) {
+ /*
+ * Log property old value as qualified/global attribute from begin(...)
+ */
+ QualifiedAttribute attribute = (QualifiedAttribute) attributes.next();
+ logAttributeChange(featureChanges, attribute.nameSpace, attribute.name, type, attribute.value, forwardReference.nameSpaces);
+ }
+ if (forwardReference.tags != null) {
+ if (propertyMapChanges != null)
+ propertyMapChanges.lists.clear();
+ for (Iterator tags = forwardReference.tags.iterator(); tags.hasNext();) {
+ /*
+ * Log property old value as element from begin(...)
+ */
+ Tag tag = (Tag) tags.next();
+ Property property = getProperty(tag.nameSpace, tag.name.getLocalPart(), type);
+ if (tag.ref != null)
+ tag.value = referent(tag.ref, tag.nameSpaceContext);
+ // if (tag.value == null) report error?
+ else if (tag.events != null)
+ tag.value = value(play(tag));
+ if (property.isMany()) {
+ Collection list;
+ if (propertyMapChanges == null) {
+ propertyMapChanges = new PropertyMapChanges();
+ list = propertyMapChanges.newList(property);
+ } else
+ list = propertyMapChanges.get(property);
+ addPropertyChange( list, tag.value, property);
+ } else
+ logPropertyChange(featureChanges, property, tag.value);
+ }
+ if (propertyMapChanges != null)
+ logManyChanges(propertyMapChanges, referent, featureChanges);
+ }
+ }
+ if (objectChangesCollection != null)
+ for (Iterator iterator = objectChangesCollection.iterator(); iterator.hasNext();) {
+ /*
+ * Forward-referenced(unresolved) child DataObject from begin(...)
+ */
+ ObjectChanges objectChanges = (ObjectChanges) iterator.next();
+ if (objectChanges.elementChanges != null)
+ for (Iterator elementChanges = objectChanges.elementChanges.iterator(); elementChanges.hasNext();) {
+ ElementChange elementChange = (ElementChange) elementChanges.next();
+ Object value = referent(elementChange);
+ if (value == null)
+ continue; // report error?
+ // iterator.remove();
+ logPropertyChange(objectChanges.featureChanges, elementChange.containing, elementChange.containment, value);
+ }
+ if (objectChanges.lists != null)
+ logManyChanges(objectChanges, (EObject) ((Map.Entry) ((EStructuralFeature.Setting) objectChanges.featureChanges).getEObject())
+ .getKey(), objectChanges.featureChanges);
+ }
+ if (logging)
+ changeSummary.resumeLogging();
+ return changeSummary;
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/ChangeSummaryStreamSerializer.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/ChangeSummaryStreamSerializer.java
new file mode 100644
index 0000000000..c41e55655a
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/ChangeSummaryStreamSerializer.java
@@ -0,0 +1,688 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.util.resource;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.tuscany.sdo.SDOPackage;
+import org.apache.tuscany.sdo.helper.SDOAnnotations;
+import org.apache.tuscany.sdo.helper.XSDHelperImpl;
+import org.apache.tuscany.sdo.impl.ChangeSummaryImpl;
+import org.apache.tuscany.sdo.model.ModelFactory;
+import org.apache.tuscany.sdo.model.impl.ModelFactoryImpl;
+import org.apache.tuscany.sdo.util.SDOUtil;
+import org.eclipse.emf.common.util.EMap;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.change.ChangeDescription;
+import org.eclipse.emf.ecore.change.ChangeKind;
+import org.eclipse.emf.ecore.change.FeatureChange;
+import org.eclipse.emf.ecore.change.ListChange;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.ecore.util.ExtendedMetaData;
+import org.eclipse.emf.ecore.util.FeatureMap;
+import org.eclipse.emf.ecore.util.FeatureMapUtil;
+import org.eclipse.emf.ecore.xmi.XMLResource;
+
+import commonj.sdo.ChangeSummary;
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
+import commonj.sdo.helper.XSDHelper;
+
+/**
+ * ChangeSummary StAX Serializer whose output conforms to the SDO Java/C++/PHP specifications. The instance isn't thread-safe, however it's safe to
+ * use the instance any times on the same thread.
+ */
+public class ChangeSummaryStreamSerializer {
+ private XMLStreamWriter writer;
+
+ private String writeNamespace(String prefix, String nameSpace) throws XMLStreamException {
+ writer.writeNamespace(prefix, nameSpace);
+ writer.setPrefix(prefix, nameSpace);
+ return prefix;
+ }
+
+ private int nsPrefixSuffix;
+
+ private String prefix(String nameSpace, String preference) throws XMLStreamException {
+ if (preference != null) {
+ String bound = writer.getNamespaceContext().getNamespaceURI(preference);
+ if (bound == null) {
+ String prefix = writer.getPrefix(nameSpace);
+ return prefix == null ? writeNamespace(preference, nameSpace) : prefix/* or null */;
+ }
+ if (bound.equals(nameSpace))
+ return preference;
+ }
+ Object automaticNsPrefix = writer.getProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES);
+ if (automaticNsPrefix != null && automaticNsPrefix.getClass() == Boolean.class // faster than instanceof since Boolean is final
+ && ((Boolean) automaticNsPrefix).booleanValue())
+ return null;
+ String prefix = writer.getPrefix(nameSpace);
+ if (prefix != null)
+ return prefix; // or null
+ NamespaceContext nameSpaces = writer.getNamespaceContext();
+ do
+ prefix = "CS" + nsPrefixSuffix++;
+ while (nameSpaces.getNamespaceURI(prefix) != null);
+ return writeNamespace(prefix, nameSpace);
+ }
+
+ void writeGlobalAttribute(String prefix, String nameSpace, String name, String value) throws XMLStreamException {
+ prefix = prefix(nameSpace, prefix);
+ if (prefix == null)
+ writer.writeAttribute(nameSpace, name, value);
+ else
+ writer.writeAttribute(prefix, nameSpace, name, value);
+ }
+
+ XSDHelper xsdHelper;
+
+ protected final void writeAttribute(Property property, String value) throws XMLStreamException {
+ String name = xsdHelper.getLocalName(property), nameSpace = xsdHelper.getNamespaceURI(property);
+ // TODO "" for no-NameSpace global attribute
+ if (nameSpace == null)
+ writer.writeAttribute(name, value);
+ else
+ writeGlobalAttribute(null, nameSpace, name, value);
+ }
+
+ private String lineBreak, indent, margin;
+
+ private int nest;
+
+ private void breakLine() throws XMLStreamException {
+ writer.writeCharacters(lineBreak);
+
+ if (margin != null)
+ writer.writeCharacters(margin);
+
+ if (indent != null)
+ for (int count = nest; count != 0; --count)
+ writer.writeCharacters(indent);
+ }
+
+ private Map options;
+
+ static private final String STRING_OPTION = "String option";
+
+ void startElement() throws XMLStreamException {
+ if (options == null)
+ return;
+ if (lineBreak == STRING_OPTION)
+ lineBreak = (String) options.get(SDOUtil.XML_SAVE_LineBreak);
+ if (lineBreak == null)
+ return;
+ if (margin == STRING_OPTION)
+ margin = (String) options.get(SDOUtil.XML_SAVE_MARGIN);
+ if (indent == STRING_OPTION)
+ indent = (String) options.get(SDOUtil.XML_SAVE_INDENT);
+ breakLine();
+ }
+
+ void writeStartElement(String prefix, String nameSpace, String name) throws XMLStreamException {
+ startElement();
+ if (nameSpace == null)
+ writer.writeStartElement(name);
+ else {
+ prefix = prefix(nameSpace, prefix);
+ if (prefix == null)
+ writer.writeStartElement(nameSpace, name);
+ else
+ writer.writeStartElement(prefix, name, nameSpace);
+ }
+ }
+
+ void writeStartElement(Property property) throws XMLStreamException {
+ ++nest;
+ writeStartElement(null, xsdHelper.getNamespaceURI(property),// TODO "" for no-NameSpace global element
+ xsdHelper.getLocalName(property));
+ }
+
+ static protected final String CREATE_ATTRIBUTE = "create", DELETE_ATTRIBUTE = "delete", LOGGING_ATTRIBUTE = "logging", REF_ATTRIBUTE = "ref", UNSET = "unset";
+
+ private StringBuffer step(String nameSpace, String name, StringBuffer path) throws XMLStreamException {
+ if (nameSpace != null) {
+ nameSpace = writer.getPrefix(nameSpace);
+ if (nameSpace != null && nameSpace.length() != 0)
+ return path.append(nameSpace).append(':').append(name); // *:name[namespace-uri()='nameSpace']
+ }
+ return path.append(name);
+ }
+
+ private StringBuffer step(Property containmentProperty, StringBuffer path) throws XMLStreamException {
+ return step(xsdHelper.getNamespaceURI(containmentProperty),// TODO "" for no-NameSpace global element
+ xsdHelper.getLocalName(containmentProperty), path);
+ }
+
+ private StringBuffer step(Property containmentProperty) throws XMLStreamException {
+ return step(containmentProperty, new StringBuffer());
+ }
+
+ private DataObject dataObject;
+
+ private StringBuffer step(Object container) throws XMLStreamException {
+ Property containmentProperty = dataObject.getContainmentProperty();
+ StringBuffer step = step(containmentProperty);
+ if (containmentProperty.isMany() || ((EObject) dataObject).eContainingFeature() != containmentProperty)
+ step.append('[').append(((DataObject) container).getList(containmentProperty).indexOf(dataObject) + 1).append(']');
+ return step;
+ }
+
+ private String pathRootObject;
+ private DataObject rootObject;
+
+ private EObject container(EObject object) {
+ final EObject container = object.eContainer();
+ if (!(container instanceof DataObject))
+ return null;
+ String name = extendedMetaData.getName(container.eClass());
+ return name != null && name.length() == 0 // DocumentRoot
+ ? null : container;
+ }
+
+ private String path() throws XMLStreamException {
+ if (pathRootObject == STRING_OPTION)
+ pathRootObject = options == null ? null : (String) options.get(OPTION_RootObject_PATH);
+ if (pathRootObject != null && dataObject == rootObject)
+ return null;
+ EObject container = container((EObject) dataObject);
+ if (container == null)
+ return null;
+ StringBuffer step = step(container);
+ while (true) {
+ String path = step.toString();
+ dataObject = (DataObject) container;
+ if (pathRootObject != null && container == rootObject)
+ return path;
+ container = container(container);
+ if (container == null)
+ return path;
+ step = step(container).append('/').append(path);
+ }
+ }
+
+ /*
+ * not to support DataGraph 3-1 private org.eclipse.emf.ecore.resource.Resource rootResource;
+ */
+
+ protected String rootElementNS;
+
+ String rootElementName;
+
+ ExtendedMetaData extendedMetaData;
+
+ protected final String rootElementName() {
+ if (rootElementNS != null)
+ return rootElementName;
+ QName rootElement = (QName) options.get(OPTION_ROOT_ELEMENT);
+ if (rootElement != null) {
+ rootElementNS = rootElement.getNamespaceURI();
+ return rootElementName = rootElement.getLocalPart();
+ }
+ EStructuralFeature element = ((EObject) rootObject).eContainingFeature();
+ if (element == null) {
+ rootElementNS = "";
+ return rootElementName = "descendant-or-self::node()";
+ }
+ rootElementNS = extendedMetaData.getNamespace(element);
+ if (rootElementNS == null)
+ rootElementNS = "";
+ return rootElementName = extendedMetaData.getName(element);
+ }
+
+ String ref() throws XMLStreamException {
+ /*
+ * not to support DataGraph 3-2 if (rootResource != null) return rootResource.getURIFragment((EObject) dataObject);
+ */
+ String id = EcoreUtil.getID((EObject) dataObject);
+ if (id != null)
+ return id;
+ id = path();
+ if (pathRootObject == null)
+ return id == null ? "#/" + rootElementName() // descendant-or-self::node()
+ : "#//" + id;
+ return id == null ? pathRootObject/* + "."*/ : pathRootObject + id;
+ }
+
+ void writeRef(String ref) throws XMLStreamException {
+ writer.writeAttribute(SDOAnnotations.COMMONJ_SDO_NS, REF_ATTRIBUTE, ref);
+ }
+
+ void writeRef() throws XMLStreamException {
+ writeRef(ref());
+ }
+
+ void writeEndElement(String lineBreak) throws XMLStreamException {
+ if (lineBreak != null)
+ breakLine();
+ writer.writeEndElement();
+ --nest;
+ }
+
+ private StringBuffer pathDeleted/* = null */;
+
+ private Collection modifiedDataObjects;
+
+ private int lengthDeleted;
+
+ private String changeSummaryElementNS, changeSummaryElementName;
+
+ private ChangeSummary changeSummary;
+
+ protected boolean skipDeletedModification(DataObject modifiedDataObject) {
+ return changeSummary.isDeleted(modifiedDataObject);
+ }
+
+ String refDeleted() throws XMLStreamException {
+ String id = EcoreUtil.getID((EObject) dataObject);
+ if (id != null)
+ return id;
+ id = path(); // "dataObject" is updated too!!
+ DataObject deletedDataObject = dataObject;
+
+ /*
+ * construct "#//...changeSummary/"
+ * output: pathDeleted
+ */
+ if (lengthDeleted == -1) {
+ String path = pathRootObject == null ? "#//" : pathRootObject;
+ if (pathDeleted == null)
+ pathDeleted = new StringBuffer(path);
+ else
+ pathDeleted.replace(0, pathDeleted.length(), path);
+ dataObject = rootObject;
+ path = path();
+ if (path != null)
+ pathDeleted.append(path).append('/');
+ step(changeSummaryElementNS, changeSummaryElementName, pathDeleted).append('/');
+ lengthDeleted = pathDeleted.length();
+ } else
+ pathDeleted.delete(lengthDeleted, pathDeleted.length());
+
+ dataObject = changeSummary.getOldContainer(deletedDataObject);
+ Property containmentProperty = dataObject.getContainmentProperty();
+ String name = containmentProperty == null ? rootElementName() : xsdHelper.getLocalName(containmentProperty);
+ int index = 1;
+ for (Iterator iterator = modifiedDataObjects.iterator(); iterator.hasNext();) {
+ DataObject modifiedDataObject = (DataObject) iterator.next();
+ if (skipDeletedModification(modifiedDataObject))
+ continue;
+ if (modifiedDataObject == dataObject)
+ break;
+ Property property = modifiedDataObject.getContainmentProperty();
+ if (property == containmentProperty || name.equals(property == null ? rootElementName() : xsdHelper.getLocalName(property)))
+ ++index;
+ }
+ pathDeleted/*.append("*:")*/.append(name).append('[').append(index).append("]/");
+ containmentProperty = changeSummary.getOldContainmentProperty(deletedDataObject);
+ // assert containmentProperty != null;
+ step(containmentProperty, pathDeleted);
+ Object f;
+ if (containmentProperty.isMany()
+ || (f = extendedMetaData.getAffiliation(((EObject) dataObject).eClass(), (EStructuralFeature) containmentProperty)) != null
+ && f != containmentProperty)
+ pathDeleted.append('[').append(
+ ((List) changeSummary.getOldValue(dataObject, containmentProperty).getValue()).indexOf(deletedDataObject) + 1).append(']');
+ if (id != null)
+ pathDeleted.append('/').append(id);
+ return pathDeleted.toString();
+ }
+
+ static String convertToString(Property property, Object value) {
+ return EcoreUtil.convertToString((EDataType) property.getType(), value);
+ }
+
+ void writeRefDeleted() throws XMLStreamException {
+ writeRef(refDeleted());
+ }
+
+ protected final void writeDeletedObject(Property property) throws XMLStreamException {
+ ++nest;
+ startElement();
+ --nest;
+ DataObject oldDataObject = ((ChangeSummaryImpl)changeSummary).getOldDataObject(dataObject);
+ XMLStreamReader reader = new DataObjectXMLStreamReader(property, oldDataObject, null, xsdHelper);
+ new XMLStreamSerializer().serialize(new XMLDocumentStreamReader(reader), writer);
+ }
+
+ static public final Object ChangeSummary_TYPE = ((ModelFactoryImpl) ModelFactory.INSTANCE).getChangeSummaryType();
+
+ Collection deletedDataObjects;
+
+ protected final void writeElement(Object value, Property property) throws XMLStreamException {
+ if (value == null) {
+ writeStartElement(property);
+ writeGlobalAttribute(ExtendedMetaData.XSI_PREFIX, ExtendedMetaData.XSI_URI, XMLResource.NIL, "true");
+ writeEndElement(null);
+ } else if (value instanceof DataObject) {
+ dataObject = (DataObject) value;
+ if (!changeSummary.isDeleted(dataObject)) {
+ writeStartElement(property);
+ writeRef();
+ writeEndElement(null);
+ } else if (property.isContainment() && deletedDataObjects.contains(dataObject)) {
+ writeDeletedObject(property);
+ } else {
+ writeStartElement(property);
+ writeRefDeleted();
+ writeEndElement(null);
+ }
+ } else {
+ Object type = property.getType();
+ if (type == ChangeSummary_TYPE)
+ return;
+ writeStartElement(property);
+ writer.writeCharacters(EcoreUtil.convertToString((EDataType) type, value));
+ writeEndElement(null);
+ }
+ }
+
+ protected final void writeElement(Object value) throws XMLStreamException {
+ FeatureMap.Entry entry = (FeatureMap.Entry) value;
+ writeElement(entry.getValue(), (Property)entry.getEStructuralFeature());
+ }
+
+ static protected List optimize(List values, Object featureChange, int size) {
+ int fromIndex = size, toIndex = 0;
+ for (Iterator changes = ((FeatureChange) featureChange).getListChanges().iterator(); changes.hasNext();) {
+ ListChange change = (ListChange) changes.next();
+ Object kind = change.getKind();
+ if (kind == ChangeKind.MOVE_LITERAL)
+ return values;
+ int index = change.getIndex();
+ if (kind == ChangeKind.ADD_LITERAL) {
+ if (index == 0) {
+ fromIndex = 0;
+ if (toIndex == 0)
+ toIndex = 1;
+ } else {
+ int to = index;
+ if (--index < fromIndex)
+ fromIndex = index;
+ if (++to > toIndex)
+ toIndex = to;
+ else if (to < toIndex)
+ ++toIndex;
+ }
+ ++size;
+ } else {
+ --size;
+ if (index < fromIndex)
+ fromIndex = index;
+ if (index < toIndex)
+ --toIndex;
+ else if (index > toIndex && index != size)
+ toIndex = index;
+ }
+ }
+ return values.subList(fromIndex, toIndex);
+ }
+
+ static protected final Object CHANGE_SUMMARY = SDOPackage.eINSTANCE.getChangeSummary();
+
+ /**
+ * Root Object path String such as "#", etc. Absent/null is the default (automatic computation)
+ */
+ static public final String OPTION_RootObject_PATH = "RootObject path",
+ /**
+ * Boolean to optimize sequence/list/array. Absent/null/Boolean.FALSE is the default (no optimization)
+ */
+ OPTION_OPTIMIZE_LIST = "optimize sequence/list/array",
+ /**
+ * Element QName if the changeSummary Root Object is a XML root; the NameSpace can be empty, never null; the prefix is ignored.
+ * Absent/null is the default (automatic computation from DocumentRoot if any)
+ */
+ OPTION_ROOT_ELEMENT = "Root Element";
+
+ /**
+ * Exports ChangeSummary
+ *
+ * @param changeSummary
+ * Never null
+ * @param changeSummaryElement
+ * changeSummary element; the NameSpace can be empty if no NameSpace, or null if local element; the prefix can be null(no preference)
+ * @param writer
+ * Never null
+ * @param options
+ * {@link SDOUtil#XML_SAVE_LineBreak} (absence/null is the default i.e. no Line Breaking), {@link SDOUtil#XML_SAVE_INDENT} (absence/null is the default i.e. no indentation), {@link SDOUtil#XML_SAVE_MARGIN}, {@link #OPTION_RootObject_PATH}, {@link #OPTION_OPTIMIZE_LIST} and XMLResource.OPTION_EXTENDED_META_DATA; can be null or empty
+ */
+ public final void saveChangeSummary(ChangeSummary changeSummary, QName changeSummaryElement, XMLStreamWriter writer, Map options)
+ throws XMLStreamException {
+ /*
+ * 6-1. Group created, deleted and modified DataObjects
+ * input: changeSummary output: createdDataObjects, deletedDataObjects & modifiedDataObjects
+ * implement: careful if compute from changeSummary.getChangedDataObjects() since it also includes children of deleted objects (thank Frank)
+ */
+ if (changeSummary.isLogging())
+ ((ChangeSummaryImpl) changeSummary).summarize();
+ ChangeDescription changeDescription = (ChangeDescription) changeSummary;
+ Iterator createdDataObjects = changeDescription.getObjectsToDetach().iterator();
+ deletedDataObjects = changeDescription.getObjectsToAttach();
+ EMap objectChanges = changeDescription.getObjectChanges();
+ modifiedDataObjects = objectChanges.keySet(); // may contain DO(s) from createdDataObjects and/or deletedDataObjects
+
+ /*
+ * 6-2. Prepare to compute (X)Path
+ * input: changeSummary
+ * output: rootResource
+ */
+ /*not to support DataGraph 3-3
+ Object dataGraph = changeSummary.getDataGraph();
+ if (dataGraph == null) {
+ DataObject rootObject = changeSummary.getRootObject();
+ // assert rootObject != null;
+ rootResource = rootObject.getContainer() == null ? ((EObject) rootObject).eResource() // Can be null since this *StAX* writer does NOT
+ // require rootObject contained by an *EMF* Resource
+ : null; // eResource() direct content may not necessarily always be the XML document
+ } else
+ // assert dataGraph instanceof DataGraphImpl;
+ rootResource = ((org.apache.tuscany.sdo.impl.DataGraphImpl) dataGraph).getRootResource(); */
+
+ /*
+ * 6-2. Start ChangeSummary element
+ * input: writer, options, elementCS, changeSummary & changeDescription (6-1)
+ */
+ nsPrefixSuffix = 0;
+ this.writer = writer;
+ this.options = options;
+ lineBreak = "";
+ indent = margin = pathRootObject = STRING_OPTION;
+ nest = 0;
+ changeSummaryElementNS = changeSummaryElement.getNamespaceURI();
+ changeSummaryElementName = changeSummaryElement.getLocalPart();
+ writeStartElement(changeSummaryElement.getPrefix(), changeSummaryElementNS, changeSummaryElementName);
+ lineBreak = STRING_OPTION;
+ rootObject = changeSummary.getRootObject();
+ extendedMetaData = (ExtendedMetaData) options.get(XMLResource.OPTION_EXTENDED_META_DATA);
+ if (extendedMetaData == null)
+ {
+ extendedMetaData = ExtendedMetaData.INSTANCE;
+ xsdHelper = XSDHelper.INSTANCE;
+ }
+ else
+ xsdHelper = new XSDHelperImpl(extendedMetaData, null);
+ Property declaration = changeSummaryElementNS == null
+ ? rootObject.getType().getProperty(changeSummaryElementName)
+ : xsdHelper.getGlobalProperty(changeSummaryElementNS, changeSummaryElementName, true);
+ if (declaration != null)
+ {
+ EClassifier type = changeDescription.eClass();
+ if (type != declaration.getType() && type != CHANGE_SUMMARY)
+ writeGlobalAttribute(ExtendedMetaData.XSI_PREFIX, ExtendedMetaData.XSI_URI, XMLResource.TYPE, new StringBuffer(prefix(extendedMetaData.getNamespace(type), null))
+ .append(':').append(extendedMetaData.getName(type)).toString());
+ }
+
+ /*
+ * 6-3. "create" attribute
+ * input: createdDataObjects (6-1), rootResource (6-2), changeSummary & writer
+ */
+ rootElementNS = null;
+ this.changeSummary = changeSummary;
+ if (createdDataObjects.hasNext()) {
+ StringBuffer buffer = new StringBuffer();
+ while (true) {
+ dataObject = (DataObject) createdDataObjects.next();
+ buffer.append(ref());
+ if (!createdDataObjects.hasNext())
+ break;
+ buffer.append(' ');
+ }
+ writer.writeAttribute(CREATE_ATTRIBUTE, buffer.toString());
+ }
+
+ /*
+ * 6-4. "delete" attribute
+ * input: deletedDataObjects (6-1), modifiedDataObjects (6-1) & writer
+ */
+ Iterator iterator = deletedDataObjects.iterator();
+ if (iterator.hasNext()) {
+ lengthDeleted = -1;
+ StringBuffer buffer = null;
+ do {
+ dataObject = (DataObject) iterator.next();
+ if (skipDeletedModification(changeSummary.getOldContainer(dataObject)))
+ continue;
+ if (buffer == null)
+ buffer = new StringBuffer();
+ else
+ buffer.append(' ');
+ buffer.append(refDeleted());
+ } while (iterator.hasNext());
+ writer.writeAttribute(DELETE_ATTRIBUTE, buffer.toString());
+ }
+
+ /*
+ * 6-5. "logging" attribute
+ * input: changeSummary & writer
+ */
+ writer.writeAttribute(LOGGING_ATTRIBUTE, changeSummary.isLogging() ? "true" : "false");
+
+ /*
+ * 6-6. Modified DataObjects
+ * input: modifiedDataObjects (6-1), rootResource (6-2), changeSummary & writer
+ */
+ iterator = modifiedDataObjects.iterator();
+ if (iterator.hasNext()) {
+ boolean optimizeList;
+ if (options == null)
+ optimizeList = false;
+ else
+ {
+ Object option = options.get(OPTION_OPTIMIZE_LIST);
+ optimizeList = option == null ? false : ((Boolean)option).booleanValue();
+ }
+ prefix(SDOAnnotations.COMMONJ_SDO_NS, SDOPackage.eNS_PREFIX);
+ do {
+ DataObject dataObject = (DataObject) iterator.next();
+ if (skipDeletedModification(dataObject))
+ continue;
+ Property containmentProperty = dataObject.getContainmentProperty();
+ if (containmentProperty == null) {
+ ++nest;
+ startElement();
+ rootElementName();
+ writer.writeStartElement(rootElementNS, rootElementName);
+ } else
+ writeStartElement(containmentProperty);
+ this.dataObject = dataObject;
+ writeRef();
+
+ String lineBreak = null;
+ Collection oldValues = (Collection) objectChanges.get(dataObject); // changeSummary.getOldValues repeats Sequence changes
+ Iterator settings = oldValues.iterator();
+ if (settings.hasNext()) {
+ do {
+ ChangeSummary.Setting oldValue = (ChangeSummary.Setting) settings.next();
+ if (oldValue.isSet())
+ continue;
+ StringBuffer unset = step(oldValue.getProperty());
+ while (settings.hasNext()) {
+ oldValue = (ChangeSummary.Setting) settings.next();
+ if (!oldValue.isSet())
+ step(oldValue.getProperty(), unset.append(' '));
+ }
+ writer.writeAttribute(SDOAnnotations.COMMONJ_SDO_NS, UNSET, unset.toString());
+ break;
+ } while (settings.hasNext());
+ for (settings = oldValues.iterator(); settings.hasNext();) {
+ ChangeSummary.Setting oldValue = (ChangeSummary.Setting) settings.next();
+ Property property = oldValue.getProperty();
+ if (oldValue.isSet() && xsdHelper.isAttribute(property))
+ // assert ! property.isMany();
+ writeAttribute(property, convertToString(property, oldValue.getValue()));
+ }
+ for (settings = oldValues.iterator(); settings.hasNext();) {
+ ChangeSummary.Setting oldValue = (ChangeSummary.Setting) settings.next();
+ Property property = oldValue.getProperty();
+ if (!xsdHelper.isAttribute(property))
+ if (property.isMany()) {
+ Object value = oldValue.getValue();
+ List list = (List) value;
+ if (FeatureMapUtil.isFeatureMap((EStructuralFeature) property)) {
+ if (optimizeList)
+ list = optimize(list, oldValue, dataObject.getSequence(property).size());
+ Iterator values = list.iterator();
+ if (!values.hasNext())
+ continue;
+ do
+ writeElement(values.next());
+ while (values.hasNext());
+ } else {
+ if (optimizeList)
+ list = optimize(list, oldValue, dataObject.getList(property).size());
+ Iterator values = list.iterator();
+ if (!values.hasNext())
+ continue;
+ do
+ writeElement(values.next(), property);
+ while (values.hasNext());
+ }
+ lineBreak = this.lineBreak;
+ } else if (oldValue.isSet()) {
+ Object value = oldValue.getValue();
+ if (value instanceof FeatureMap.Entry)
+ writeElement(value);
+ else
+ writeElement(value, property);
+ lineBreak = this.lineBreak;
+ }
+ }
+ }
+ writeEndElement(lineBreak);
+ } while (iterator.hasNext());
+ writeEndElement(lineBreak);
+ } else
+ writeEndElement(null);
+ writer.flush();
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/DataObjectXMLStreamReader.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/DataObjectXMLStreamReader.java
new file mode 100644
index 0000000000..0277650059
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/DataObjectXMLStreamReader.java
@@ -0,0 +1,1531 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.util.resource;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.namespace.QName;
+import javax.xml.stream.Location;
+import javax.xml.stream.XMLStreamException;
+
+import org.apache.tuscany.sdo.impl.AttributeImpl;
+import org.apache.tuscany.sdo.impl.ReferenceImpl;
+import org.apache.tuscany.sdo.util.SDOUtil;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.util.ExtendedMetaData;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
+import commonj.sdo.Sequence;
+import commonj.sdo.Type;
+import commonj.sdo.helper.TypeHelper;
+import commonj.sdo.helper.XMLDocument;
+import commonj.sdo.helper.XSDHelper;
+
+public class DataObjectXMLStreamReader implements XMLFragmentStreamReader {
+ private static final QName XSI_TYPE_QNAME = new QName("http://www.w3.org/2001/XMLSchema-instance", "type", "xsi");
+ private Property rootElement = null;
+ private DataObject dataObject;
+
+ private String rootElementURI;
+
+ private String rootElementName;
+
+ private TypeHelper typeHelper;
+
+ private XSDHelper xsdHelper;
+
+ private Map.Entry[] properties;
+
+ private Map.Entry[] attributes;
+
+ private QName elementQName;
+
+ // we always create a new namespace context
+ private NameSpaceContext namespaceContext;
+
+ private Map declaredNamespaceMap = new HashMap();
+
+ // states for this pullparser - it can only have three states
+ private static final int START_ELEMENT_STATE = 0;
+
+ private static final int END_ELEMENT_STATE = 1;
+
+ private static final int DELEGATED_STATE = 2;
+
+ private static final int TEXT_STATE = 3;
+
+ // integer field that keeps the state of this
+ // parser.
+ private int state = START_ELEMENT_STATE;
+
+ // reference to the child reader
+ private XMLFragmentStreamReader childReader;
+
+ // current property index
+ // initialized at zero
+ private int currentPropertyIndex = 0;
+
+ public DataObjectXMLStreamReader(DataObject dataObject, String rootElmentURI, String rootElementName) {
+ this(dataObject, rootElmentURI, rootElementName, null, null);
+ }
+
+ public DataObjectXMLStreamReader(DataObject dataObject, String rootElmentURI, String rootElementName, TypeHelper typeHelper) {
+ this(dataObject, rootElmentURI, rootElementName, typeHelper, null);
+ }
+
+ public DataObjectXMLStreamReader(DataObject dataObject, String rootElmentURI, String rootElementName, TypeHelper typeHelper, XSDHelper xsdHelper) {
+ this.dataObject = dataObject;
+ this.rootElementURI = rootElmentURI;
+ this.rootElementName = rootElementName;
+ this.typeHelper = typeHelper == null ? TypeHelper.INSTANCE : typeHelper;
+ this.xsdHelper = (xsdHelper != null) ? xsdHelper : ((typeHelper == null) ? XSDHelper.INSTANCE : SDOUtil.createXSDHelper(typeHelper));
+ rootElement = this.xsdHelper.getGlobalProperty(rootElmentURI, rootElementName, true);
+ namespaceContext = new NameSpaceContext();
+ populateProperties();
+ }
+
+ protected DataObjectXMLStreamReader(TypeHelper typeHelper, XSDHelper xsdHelper, Property rootElement, DataObject dataObject) {
+ this.typeHelper = typeHelper == null ? TypeHelper.INSTANCE : typeHelper;
+ this.xsdHelper = (xsdHelper != null) ? xsdHelper : ((typeHelper == null) ? XSDHelper.INSTANCE : SDOUtil.createXSDHelper(typeHelper));
+ this.rootElement = rootElement;
+ this.dataObject = dataObject;
+ this.rootElementURI = xsdHelper.getNamespaceURI(rootElement);
+ this.rootElementName = xsdHelper.getLocalName(rootElement);
+ }
+
+ public DataObjectXMLStreamReader(Property rootElement, DataObject dataObject, TypeHelper typeHelper, XSDHelper xsdHelper) {
+ this(typeHelper, xsdHelper, rootElement, dataObject);
+ namespaceContext = new NameSpaceContext();
+ populateProperties();
+ }
+
+ public DataObjectXMLStreamReader(XMLDocument document, TypeHelper typeHelper) {
+ this.dataObject = document.getRootObject();
+ this.rootElementName = document.getRootElementName();
+ this.rootElementURI = document.getRootElementURI();
+ this.typeHelper = typeHelper;
+ this.xsdHelper = typeHelper == null ? XSDHelper.INSTANCE : SDOUtil.createXSDHelper(typeHelper);
+ namespaceContext = new NameSpaceContext();
+ populateProperties();
+ }
+
+ /*
+ * we need to pass in a namespace context since when delegated, we've no idea of the current namespace context. So it needs to be passed on here!
+ */
+ protected DataObjectXMLStreamReader(QName elementQName, Map.Entry[] properties, Map.Entry[] attributes) {
+ // validate the lengths, since both the arrays are supposed
+ // to have
+ this.properties = properties;
+ this.elementQName = elementQName;
+ this.attributes = attributes;
+ namespaceContext = new NameSpaceContext();
+ }
+
+ private void addProperty(Property property, Object value, List propertyList) {
+ if (property.isMany() && property.getContainingType().isOpen() && value instanceof Sequence) {
+ addSequenceValue(propertyList, (Sequence) value);
+ } else if (SDOUtil.isMany(property, dataObject) && value instanceof List) {
+ addListValue(propertyList, property, (List) value);
+ } else {
+ // Complex Type
+ addSingleValue(propertyList, property, value);
+ }
+ }
+
+ void addProperty(List propertyList, Property property, Object value, Object type) {
+ if (!isTransient(property, type))
+ addProperty(property, value, propertyList);
+ }
+
+ private void addSequenceValue(List elements, Sequence seq) {
+ if (seq != null && seq.size() > 0) {
+ for (int j = 0; j < seq.size(); j++) {
+ Object o = seq.getValue(j);
+ Property p = seq.getProperty(j);
+ addSingleValue(elements, p, o);
+ }
+ }
+ }
+
+ static private boolean isTransient(Property property, Object type) {
+ // HACK: We need some SDOUtil extension to understand a property is derived
+ EStructuralFeature feature = (EStructuralFeature) property;
+ if (ExtendedMetaData.INSTANCE.getGroup(feature) != null)
+ return false;
+ feature = ExtendedMetaData.INSTANCE.getAffiliation((EClass) type, feature);
+ if (feature != null && feature != property)
+ return false;
+ if (property instanceof ReferenceImpl) {
+ ReferenceImpl r = (ReferenceImpl) property;
+ if (r.isTransient())
+ return true;
+ EReference opposite = r.getEOpposite();
+ if (opposite != null && opposite.isContainment()) {
+ return true;
+ }
+ } else if (property instanceof AttributeImpl) {
+ AttributeImpl a = (AttributeImpl) property;
+ if (a.isTransient())
+ return true;
+ EDataType d = (EDataType) a.getEType();
+ if (!d.isSerializable()) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private void addListValue(List propertyList, Property property, List objList) {
+ if (objList != null) {
+ for (int j = 0; j < objList.size(); j++) {
+ Object object = objList.get(j);
+ addSingleValue(propertyList, property, object);
+ }
+ }
+ }
+
+ private void addSingleValue(List propertyList, Property property, Object value) {
+ String uri = xsdHelper.getNamespaceURI(property);
+ String name = xsdHelper.getLocalName(property);
+ QName qname = namespaceContext.createQName(uri, name);
+ Type propertyType = property.getType();
+
+ if (property.getName().equals("value") && uri == null && name.equals(":0")) {
+ // "value" is special property containing the value of simpleContent
+ Map.Entry entry = new NameValuePair(ELEMENT_TEXT, value);
+ propertyList.add(entry);
+ } else
+
+ // FIXME: We need to deal with non-containment properties
+ if (value == null) {
+ // Creating xsi:nil="true" for elements
+ Map.Entry entry = new NameValuePair(qname, null);
+ propertyList.add(entry);
+ } else if (propertyType.isDataType()) {
+ Map.Entry entry = new NameValuePair(qname, SDOUtil.convertToString(propertyType, value));
+ propertyList.add(entry);
+ } else {
+ DataObjectXMLStreamReader childReader = new DataObjectXMLStreamReader(typeHelper, xsdHelper, property, (DataObject) value);
+ childReader.namespaceContext = namespaceContext;
+ childReader.populateProperties();
+ childReader.rootElement = property;
+ Map.Entry entry = new NameValuePair(qname, childReader);
+ propertyList.add(entry);
+ }
+ }
+
+ public void populateProperties() {
+ /*declaredNamespaceMap.put("xml", "http://www.w3.org/XML/1998/namespace");
+ declaredNamespaceMap.put("xmlns", "http://www.w3.org/2000/xmlns/");
+ declaredNamespaceMap.put("xsi", "http://www.w3.org/2001/XMLSchema-instance");
+ */
+
+ if (properties != null)
+ return;
+ if (elementQName == null)
+ elementQName = namespaceContext.createQName(this.rootElementURI, this.rootElementName);
+ else
+ elementQName = namespaceContext.createQName(elementQName.getNamespaceURI(), elementQName.getLocalPart());
+
+ List elementList = new ArrayList();
+ List attributeList = new ArrayList();
+ Type type = dataObject.getType();
+ if (rootElement != null) {
+ Type modelType = rootElement.getType();
+ if (type != modelType) {
+ // FIXME: XSDHelper.getLocalName() for annoymous type returns null?
+ String typeName = xsdHelper.getLocalName(type);
+ if (typeName != null) {
+ QName realTypeName = namespaceContext.createQName(type.getURI(), typeName);
+ String typeQName = realTypeName.getPrefix() + ":" + realTypeName.getLocalPart();
+ declaredNamespaceMap.put(realTypeName.getPrefix(), realTypeName.getNamespaceURI());
+ attributeList.add(new NameValuePair(XSI_TYPE_QNAME, typeQName));
+ }
+ }
+ }
+
+ if (type.isSequenced()) {
+ Sequence sequence = dataObject.getSequence();
+ for (int i = 0; i < sequence.size(); i++) {
+ Property property = sequence.getProperty(i);
+ Object value = sequence.getValue(i);
+ if (property == null) {
+ // property == null for text in mixed content
+ elementList.add(new NameValuePair(ELEMENT_TEXT, value));
+ } else {
+ addProperty(property, value, elementList);
+ }
+ }
+ // Attributes are not in the sequence
+ List properties = dataObject.getInstanceProperties();
+ for (Iterator i = properties.iterator(); i.hasNext();) {
+ Property property = (Property) i.next();
+ if (xsdHelper.isAttribute(property)) {
+ // FIXME: How to handle nilable=true?
+ if (!dataObject.isSet(property))
+ continue;
+ Object value = dataObject.get(property);
+ addProperty(attributeList, property, value, type);
+ }
+ }
+ } else {
+ List properties = dataObject.getInstanceProperties();
+ for (Iterator i = properties.iterator(); i.hasNext();) {
+ Property property = (Property) i.next();
+ // FIXME: How to handle nilable=true?
+ if (!dataObject.isSet(property))
+ continue;
+ Object value = dataObject.get(property);
+ if (xsdHelper.isAttribute(property))
+ addProperty(attributeList, property, value, type);
+ else
+ addProperty(elementList, property, value, type);
+ }
+ }
+ properties = (Map.Entry[]) elementList.toArray(new Map.Entry[0]);
+ attributes = (Map.Entry[]) attributeList.toArray(new Map.Entry[0]);
+ }
+
+ public DataObject getDataObject() {
+ return dataObject;
+ }
+
+ /**
+ * we need to split out the calling to the populate namespaces seperately since this needs to be done *after* setting the parent namespace
+ * context. We cannot assume it will happen at construction!
+ */
+ public void init() {
+ // here we have an extra issue to attend to. we need to look at the
+ // prefixes and uris (the combination) and populate a hashmap of
+ // namespaces. The hashmap of namespaces will be used to serve the
+ // namespace context
+
+ populateNamespaceContext();
+ }
+
+ /**
+ *
+ * @param key
+ * @return
+ * @throws IllegalArgumentException
+ */
+ public Object getProperty(String key) throws IllegalArgumentException {
+ if (state == START_ELEMENT_STATE || state == END_ELEMENT_STATE) {
+ return null;
+ } else if (state == TEXT_STATE) {
+ return null;
+ } else if (state == DELEGATED_STATE) {
+ return childReader.getProperty(key);
+ } else {
+ return null;
+ }
+
+ }
+
+ public int next() throws XMLStreamException {
+ return updateStatus();
+ }
+
+ public void require(int i, String string, String string1) throws XMLStreamException {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * todo implement the right contract for this
+ *
+ * @return
+ * @throws XMLStreamException
+ */
+ public String getElementText() throws XMLStreamException {
+ if (state == DELEGATED_STATE) {
+ return childReader.getElementText();
+ } else {
+ return null;
+ }
+
+ }
+
+ /**
+ * todo implement this
+ *
+ * @return
+ * @throws XMLStreamException
+ */
+ public int nextTag() throws XMLStreamException {
+ return 0;
+ }
+
+ /**
+ * @return
+ * @throws XMLStreamException
+ */
+ public boolean hasNext() throws XMLStreamException {
+ if (state == DELEGATED_STATE) {
+ if (childReader.isEndOfFragment()) {
+ // the child reader is done. We shouldn't be getting the
+ // hasnext result from the child pullparser then
+ return true;
+ } else {
+ return childReader.hasNext();
+ }
+ } else {
+ return (state == START_ELEMENT_STATE || state == TEXT_STATE);
+
+ }
+ }
+
+ public void close() throws XMLStreamException {
+ // do nothing here - we have no resources to free
+ }
+
+ public String getNamespaceURI(String prefix) {
+ return namespaceContext.getNamespaceURI(prefix);
+ }
+
+ public boolean isStartElement() {
+ if (state == START_ELEMENT_STATE) {
+ return true;
+ } else if (state == END_ELEMENT_STATE) {
+ return false;
+ }
+ return childReader.isStartElement();
+ }
+
+ public boolean isEndElement() {
+ if (state == START_ELEMENT_STATE) {
+ return false;
+ } else if (state == END_ELEMENT_STATE) {
+ return true;
+ }
+ return childReader.isEndElement();
+ }
+
+ public boolean isCharacters() {
+ if (state == START_ELEMENT_STATE || state == END_ELEMENT_STATE) {
+ return false;
+ }
+ return childReader.isCharacters();
+ }
+
+ public boolean isWhiteSpace() {
+ if (state == START_ELEMENT_STATE || state == END_ELEMENT_STATE) {
+ return false;
+ }
+ return childReader.isWhiteSpace();
+ }
+
+ // /////////////////////////////////////////////////////////////////////////
+ // / attribute handling
+ // /////////////////////////////////////////////////////////////////////////
+
+ public String getAttributeValue(String nsUri, String localName) {
+
+ int attribCount = getAttributeCount();
+ String returnValue = null;
+ QName attribQualifiedName;
+ for (int i = 0; i < attribCount; i++) {
+ attribQualifiedName = getAttributeName(i);
+ if (nsUri == null) {
+ if (localName.equals(attribQualifiedName.getLocalPart())) {
+ returnValue = getAttributeValue(i);
+ break;
+ }
+ } else {
+ if (localName.equals(attribQualifiedName.getLocalPart()) && nsUri.equals(attribQualifiedName.getNamespaceURI())) {
+ returnValue = getAttributeValue(i);
+ break;
+ }
+ }
+
+ }
+
+ return returnValue;
+ }
+
+ public int getAttributeCount() {
+ return (state == DELEGATED_STATE) ? childReader.getAttributeCount()
+ : ((attributes != null) && (state == START_ELEMENT_STATE) ? attributes.length : 0);
+ }
+
+ /**
+ * @param i
+ * @return
+ */
+ public QName getAttributeName(int i) {
+ if (state == DELEGATED_STATE) {
+ return childReader.getAttributeName(i);
+ } else if (state == START_ELEMENT_STATE) {
+ if (attributes == null) {
+ return null;
+ } else {
+ if ((i >= (attributes.length)) || i < 0) { // out of range
+ return null;
+ } else {
+ // get the attribute pointer
+ Object attribPointer = attributes[i].getKey();
+ // case one - attrib name is null
+ // this should be the pointer to the OMAttribute then
+ if (attribPointer instanceof String) {
+ return new QName((String) attribPointer);
+ } else if (attribPointer instanceof QName) {
+ return (QName) attribPointer;
+ } else {
+ return null;
+ }
+ }
+ }
+ } else {
+ throw new IllegalStateException();// as per the api contract
+ }
+
+ }
+
+ public String getAttributeNamespace(int i) {
+ if (state == DELEGATED_STATE) {
+ return childReader.getAttributeNamespace(i);
+ } else if (state == START_ELEMENT_STATE) {
+ QName name = getAttributeName(i);
+ if (name == null) {
+ return null;
+ } else {
+ return name.getNamespaceURI();
+ }
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+
+ public String getAttributeLocalName(int i) {
+ if (state == DELEGATED_STATE) {
+ return childReader.getAttributeLocalName(i);
+ } else if (state == START_ELEMENT_STATE) {
+ QName name = getAttributeName(i);
+ if (name == null) {
+ return null;
+ } else {
+ return name.getLocalPart();
+ }
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+
+ public String getAttributePrefix(int i) {
+ if (state == DELEGATED_STATE) {
+ return childReader.getAttributePrefix(i);
+ } else if (state == START_ELEMENT_STATE) {
+ QName name = getAttributeName(i);
+ if (name == null) {
+ return null;
+ } else {
+ return name.getPrefix();
+ }
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+
+ public String getAttributeType(int i) {
+ return null; // not supported
+ }
+
+ public String getAttributeValue(int i) {
+ if (state == DELEGATED_STATE) {
+ return childReader.getAttributeValue(i);
+ } else if (state == START_ELEMENT_STATE) {
+ if (attributes == null) {
+ return null;
+ } else {
+ if ((i >= (attributes.length)) || i < 0) { // out of range
+ return null;
+ } else {
+ // get the attribute pointer
+ Object attribPointer = attributes[i].getKey();
+ Object omAttribObj = attributes[i].getValue();
+ // case one - attrib name is null
+ // this should be the pointer to the OMAttribute then
+ if (attribPointer instanceof String) {
+ return (String) omAttribObj;
+ } else if (attribPointer instanceof QName) {
+ return (String) omAttribObj;
+ } else {
+ return null;
+ }
+ }
+ }
+ } else {
+ throw new IllegalStateException();
+ }
+
+ }
+
+ public boolean isAttributeSpecified(int i) {
+ return false; // not supported
+ }
+
+ // /////////////////////////////////////////////////////////////////////////
+ // //////////// end of attribute handling
+ // /////////////////////////////////////////////////////////////////////////
+
+ // //////////////////////////////////////////////////////////////////////////
+ // //////////// namespace handling
+ // //////////////////////////////////////////////////////////////////////////
+
+ public int getNamespaceCount() {
+ if (state == DELEGATED_STATE) {
+ return childReader.getNamespaceCount();
+ } else {
+ return declaredNamespaceMap.size();
+ }
+ }
+
+ /**
+ * @param i
+ * @return
+ */
+ public String getNamespacePrefix(int i) {
+ if (state == DELEGATED_STATE) {
+ return childReader.getNamespacePrefix(i);
+ } else if (state != TEXT_STATE) {
+ // order the prefixes
+ String[] prefixes = makePrefixArray();
+ if ((i >= prefixes.length) || (i < 0)) {
+ return null;
+ } else {
+ return prefixes[i];
+ }
+
+ } else {
+ throw new IllegalStateException();
+ }
+
+ }
+
+ /**
+ * Get the prefix list from the hastable and take that into an array
+ *
+ * @return
+ */
+ private String[] makePrefixArray() {
+ String[] prefixes = (String[]) declaredNamespaceMap.keySet().toArray(new String[declaredNamespaceMap.size()]);
+ Arrays.sort(prefixes);
+ return prefixes;
+ }
+
+ public String getNamespaceURI(int i) {
+ if (state == DELEGATED_STATE) {
+ return childReader.getNamespaceURI(i);
+ } else if (state != TEXT_STATE) {
+ String namespacePrefix = getNamespacePrefix(i);
+ return namespacePrefix == null ? null : (String) declaredNamespaceMap.get(namespacePrefix);
+ } else {
+ throw new IllegalStateException();
+ }
+
+ }
+
+ public NamespaceContext getNamespaceContext() {
+ if (state == DELEGATED_STATE) {
+ return childReader.getNamespaceContext();
+ } else {
+ return namespaceContext;
+ }
+
+ }
+
+ // /////////////////////////////////////////////////////////////////////////
+ // /////// end of namespace handling
+ // /////////////////////////////////////////////////////////////////////////
+
+ public int getEventType() {
+ if (state == START_ELEMENT_STATE) {
+ return START_ELEMENT;
+ } else if (state == END_ELEMENT_STATE) {
+ return END_ELEMENT;
+ } else { // this is the delegated state
+ return childReader.getEventType();
+ }
+
+ }
+
+ public String getText() {
+ if (state == DELEGATED_STATE) {
+ return childReader.getText();
+ } else if (state == TEXT_STATE) {
+ return (String) properties[currentPropertyIndex - 1].getValue();
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+
+ public char[] getTextCharacters() {
+ if (state == DELEGATED_STATE) {
+ return childReader.getTextCharacters();
+ } else if (state == TEXT_STATE) {
+ return getTextData();
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+
+ private char[] getTextData() {
+ return properties[currentPropertyIndex - 1].getValue() == null ? new char[0] : ((String) properties[currentPropertyIndex - 1].getValue())
+ .toCharArray();
+ }
+
+ private int copy(int sourceStart, char[] target, int targetStart, int length) {
+ char[] source = getTextData();
+ if (sourceStart > source.length)
+ throw new IndexOutOfBoundsException("source start > source length");
+ int sourceLen = source.length - sourceStart;
+ if (length > sourceLen)
+ length = sourceLen;
+ System.arraycopy(source, sourceStart, target, targetStart, length);
+ return sourceLen;
+ }
+
+ public int getTextCharacters(int i, char[] chars, int i1, int i2) throws XMLStreamException {
+ if (state == DELEGATED_STATE) {
+ return childReader.getTextCharacters(i, chars, i1, i2);
+ } else if (state == TEXT_STATE) {
+ return copy(i, chars, i1, i2);
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+
+ public int getTextStart() {
+ if (state == DELEGATED_STATE) {
+ return childReader.getTextStart();
+ } else if (state == TEXT_STATE) {
+ return 0;// assume text always starts at 0
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+
+ public int getTextLength() {
+ if (state == DELEGATED_STATE) {
+ return childReader.getTextLength();
+ } else if (state == TEXT_STATE) {
+ return getTextData().length;
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+
+ public String getEncoding() {
+ if (state == DELEGATED_STATE) {
+ return childReader.getEncoding();
+ } else {
+ // we've no idea what the encoding is going to be in this case
+ // perhaps we ought to return some constant here, which the user might
+ // have access to change!
+ return null;
+ }
+ }
+
+ /**
+ * check the validity of this implementation
+ *
+ * @return
+ */
+ public boolean hasText() {
+ if (state == DELEGATED_STATE) {
+ return childReader.hasText();
+ } else if (state == TEXT_STATE) {
+ return true;
+ } else {
+ return false;
+ }
+
+ }
+
+ /**
+ * @return
+ */
+ public Location getLocation() {
+ // return a default location
+ return new Location() {
+ public int getLineNumber() {
+ return 0;
+ }
+
+ public int getColumnNumber() {
+ return 0;
+ }
+
+ public int getCharacterOffset() {
+ return 0;
+ }
+
+ public String getPublicId() {
+ return null;
+ }
+
+ public String getSystemId() {
+ return null;
+ }
+ };
+ }
+
+ public QName getName() {
+ if (state == DELEGATED_STATE) {
+ return childReader.getName();
+ } else if (state != TEXT_STATE) {
+ return elementQName;
+ } else {
+ throw new IllegalStateException();
+ }
+
+ }
+
+ public String getLocalName() {
+ if (state == DELEGATED_STATE) {
+ return childReader.getLocalName();
+ } else if (state != TEXT_STATE) {
+ return elementQName.getLocalPart();
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+
+ public boolean hasName() {
+ // since this parser always has a name, the hasname
+ // has to return true if we are still navigating this element
+ // if not we should ask the child reader for it.
+ if (state == DELEGATED_STATE) {
+ return childReader.hasName();
+ } else if (state != TEXT_STATE) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ public String getNamespaceURI() {
+ if (state == DELEGATED_STATE) {
+ return childReader.getNamespaceURI();
+ } else if (state == TEXT_STATE) {
+ return null;
+ } else {
+ return elementQName.getNamespaceURI();
+ }
+ }
+
+ public String getPrefix() {
+ if (state == DELEGATED_STATE) {
+ return childReader.getPrefix();
+ } else if (state == TEXT_STATE) {
+ return null;
+ } else {
+ return elementQName.getPrefix();
+ }
+ }
+
+ public String getVersion() {
+ return null;
+ }
+
+ public boolean isStandalone() {
+ return true;
+ }
+
+ public boolean standaloneSet() {
+ return true;
+ }
+
+ public String getCharacterEncodingScheme() {
+ return null; // todo - should we return something for this ?
+ }
+
+ public String getPITarget() {
+ throw new UnsupportedOperationException("Yet to be implemented !!");
+ }
+
+ public String getPIData() {
+ throw new UnsupportedOperationException("Yet to be implemented !!");
+ }
+
+ // /////////////////////////////////////////////////////////////////////////
+ // / Other utility methods
+ // ////////////////////////////////////////////////////////////////////////
+
+ /**
+ * Populates a namespace context
+ */
+ private void populateNamespaceContext() {
+
+ // first add the current element namespace to the namespace context
+ // declare it if not found
+ registerNamespace(elementQName.getPrefix(), elementQName.getNamespaceURI());
+
+ // traverse through the attributes and populate the namespace context
+ // the attrib list can be of many combinations
+ // the valid combinations are
+ // String - String
+ // QName - QName
+ // null - OMAttribute
+
+ if (attributes != null) {
+ for (int i = 0; i < attributes.length; i++) { // jump in two
+ Object attribName = attributes[i].getKey();
+ if (attribName instanceof String) {
+ // ignore this case - Nothing to do
+ } else if (attribName instanceof QName) {
+ QName attribQName = ((QName) attribName);
+ registerNamespace(attribQName.getPrefix(), attribQName.getNamespaceURI());
+
+ }
+ }
+ }
+
+ }
+
+ /**
+ * @param prefix
+ * @param uri
+ */
+ private void registerNamespace(String prefix, String uri) {
+ if (!uri.equals(namespaceContext.getNamespaceURI(prefix))) {
+ namespaceContext.registerMapping(prefix, uri);
+ declaredNamespaceMap.put(prefix, uri);
+ }
+ }
+
+ /**
+ * By far this should be the most important method in this class this method changes the state of the parser according to the change in the
+ */
+ private int updateStatus() throws XMLStreamException {
+ int returnEvent = -1; // invalid state is the default state
+ switch (state) {
+ case START_ELEMENT_STATE:
+ // current element is start element. We should be looking at the
+ // property list and making a pullparser for the property value
+ if (properties == null || properties.length == 0) {
+ // no properties - move to the end element state straightaway
+ state = END_ELEMENT_STATE;
+ returnEvent = END_ELEMENT;
+ } else {
+ // there are properties. now we should delegate this task to a
+ // child reader depending on the property type
+ returnEvent = processProperties();
+
+ }
+ break;
+ case END_ELEMENT_STATE:
+ // we've reached the end element already. If the user tries to push
+ // further ahead then it is an exception
+ throw new XMLStreamException("Trying to go beyond the end of the pullparser");
+
+ case DELEGATED_STATE:
+ if (childReader.isEndOfFragment()) {
+ // we've reached the end!
+ if (currentPropertyIndex > (properties.length - 1)) {
+ state = END_ELEMENT_STATE;
+ returnEvent = END_ELEMENT;
+ } else {
+ returnEvent = processProperties();
+ }
+ } else {
+ returnEvent = childReader.next();
+ }
+ break;
+
+ case TEXT_STATE:
+ // if there are any more event we should be delegating to
+ // processProperties. if not we just return an end element
+ if (currentPropertyIndex > (properties.length - 1)) {
+ state = END_ELEMENT_STATE;
+ returnEvent = END_ELEMENT;
+ } else {
+ returnEvent = processProperties();
+ }
+ break;
+ }
+ return returnEvent;
+ }
+
+ /**
+ * A convenient method to reuse the properties
+ *
+ * @return event to be thrown
+ * @throws XMLStreamException
+ */
+ private int processProperties() throws XMLStreamException {
+ // move to the next property depending on the current property
+ // index
+ Object propPointer = properties[currentPropertyIndex].getKey();
+ QName propertyQName = null;
+ boolean textFound = false;
+ if (propPointer == null) {
+ throw new XMLStreamException("property key cannot be null!");
+ } else if (propPointer instanceof String) {
+ // propPointer being a String has a special case
+ // that is it can be a the special constant ELEMENT_TEXT that
+ // says this text event
+ if (ELEMENT_TEXT.equals(propPointer)) {
+ textFound = true;
+ } else {
+ propertyQName = new QName((String) propPointer);
+ }
+ } else if (propPointer instanceof QName) {
+ propertyQName = (QName) propPointer;
+ } else {
+ // oops - we've no idea what kind of key this is
+ throw new XMLStreamException("unidentified property key!!!" + propPointer);
+ }
+
+ // ok! we got the key. Now look at the value
+ Object propertyValue = properties[currentPropertyIndex].getValue();
+ // cater for the special case now
+ if (textFound) {
+ // no delegation here - make the parser null and immediately
+ // return with the event characters
+ childReader = null;
+ state = TEXT_STATE;
+ currentPropertyIndex++;
+ return CHARACTERS;
+ } else if (propertyValue == null || propertyValue instanceof String) {
+ // strings are handled by the NameValuePairStreamReader
+ childReader = new SimpleElementStreamReader(propertyQName, (String) propertyValue, namespaceContext);
+ childReader.init();
+ } else if (propertyValue instanceof DataObjectXMLStreamReader) {
+ // ADBbean has it's own method to get a reader
+ XMLFragmentStreamReader reader = (DataObjectXMLStreamReader) propertyValue;
+ // we know for sure that this is an ADB XMLStreamreader.
+ // However we need to make sure that it is compatible
+ childReader = reader;
+ childReader.init();
+ } else {
+ // all special possiblilities has been tried! Let's treat
+ // the thing as a bean and try generating events from it
+ throw new UnsupportedOperationException("Not supported");
+ // childReader = new WrappingXMLStreamReader(BeanUtil.getPullParser(propertyValue, propertyQName));
+ // we cannot register the namespace context here
+ }
+
+ // set the state here
+ state = DELEGATED_STATE;
+ // we are done with the delegation
+ // increment the property index
+ currentPropertyIndex++;
+ return childReader.getEventType();
+ }
+
+ /**
+ * are we done ?
+ *
+ * @return
+ */
+ public boolean isEndOfFragment() {
+ return (state == END_ELEMENT_STATE);
+ }
+
+ protected static class NameValuePair implements Map.Entry {
+ private Object key;
+
+ private Object value;
+
+ public NameValuePair(Object key, Object value) {
+ this.key = key;
+ this.value = value;
+ }
+
+ public Object getKey() {
+ return key;
+ }
+
+ public Object getValue() {
+ return value;
+ }
+
+ public Object setValue(Object value) {
+ Object v = this.value;
+ this.value = value;
+ return v;
+ }
+
+ }
+
+ protected static class SimpleElementStreamReader implements XMLFragmentStreamReader {
+
+ private static final int START_ELEMENT_STATE = 0;
+
+ private static final int TEXT_STATE = 1;
+
+ private static final int END_ELEMENT_STATE = 2;
+
+ private static final int START_ELEMENT_STATE_WITH_NULL = 3;
+
+ private static final QName XSI_NIL_QNAME = new QName("http://www.w3.org/2001/XMLSchema-instance", "nil", "xsi");
+
+ private final NameSpaceContext namespaceContext;
+
+ private QName name;
+
+ private String value;
+
+ private int state = START_ELEMENT_STATE;
+
+ public SimpleElementStreamReader(QName name, String value, NameSpaceContext nameSpaces) {
+ this.name = name;
+ this.value = value;
+ if (value == null)
+ state = START_ELEMENT_STATE_WITH_NULL;
+ namespaceContext = nameSpaces;
+ }
+
+ public Object getProperty(String key) throws IllegalArgumentException {
+ return null;
+ }
+
+ public int next() throws XMLStreamException {
+ switch (state) {
+ case START_ELEMENT_STATE:
+ state = TEXT_STATE;
+ return CHARACTERS;
+ case START_ELEMENT_STATE_WITH_NULL:
+ state = END_ELEMENT_STATE;
+ return END_ELEMENT;
+ case END_ELEMENT_STATE:
+ // oops, not supposed to happen!
+ throw new XMLStreamException("end already reached!");
+ case TEXT_STATE:
+ state = END_ELEMENT_STATE;
+ return END_ELEMENT;
+ default:
+ throw new XMLStreamException("unknown event type!");
+ }
+ }
+
+ public void require(int i, String string, String string1) throws XMLStreamException {
+ // not implemented
+ }
+
+ public String getElementText() throws XMLStreamException {
+ if (state == START_ELEMENT) {
+ // move to the end state and return the value
+ state = END_ELEMENT_STATE;
+ return value;
+ } else {
+ throw new XMLStreamException();
+ }
+
+ }
+
+ public int nextTag() throws XMLStreamException {
+ return 0;// todo
+ }
+
+ public boolean hasNext() throws XMLStreamException {
+ return (state != END_ELEMENT_STATE);
+ }
+
+ public void close() throws XMLStreamException {
+ // Do nothing - we've nothing to free here
+ }
+
+ public String getNamespaceURI(String prefix) {
+ return namespaceContext.getNamespaceURI(prefix);
+ }
+
+ public boolean isStartElement() {
+ return (state == START_ELEMENT_STATE || state == START_ELEMENT_STATE_WITH_NULL);
+ }
+
+ public boolean isEndElement() {
+ return (state == END_ELEMENT_STATE);
+ }
+
+ public boolean isCharacters() {
+ return (state == TEXT_STATE);
+ }
+
+ public boolean isWhiteSpace() {
+ return false; // no whitespaces here
+ }
+
+ public boolean isAttributeSpecified(int i) {
+ return false; // no attribs here
+ }
+
+ public NamespaceContext getNamespaceContext() {
+ return this.namespaceContext;
+ }
+
+ public int getEventType() {
+ switch (state) {
+ case START_ELEMENT_STATE:
+ case START_ELEMENT_STATE_WITH_NULL:
+ return START_ELEMENT;
+ case END_ELEMENT_STATE:
+ return END_ELEMENT;
+ case TEXT_STATE:
+ return CHARACTERS;
+ default:
+ throw new UnsupportedOperationException();
+ // we've no idea what this is!!!!!
+ }
+
+ }
+
+ public String getText() {
+ if (state == TEXT_STATE) {
+ return value;
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+
+ public char[] getTextCharacters() {
+ if (state == TEXT_STATE) {
+ return value.toCharArray();
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+
+ public int getTextCharacters(int i, char[] chars, int i1, int i2) throws XMLStreamException {
+ // not implemented
+ throw new UnsupportedOperationException();
+ }
+
+ public int getTextStart() {
+ if (state == TEXT_STATE) {
+ return 0;
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+
+ public int getTextLength() {
+ if (state == TEXT_STATE) {
+ return value.length();
+ } else {
+ throw new IllegalStateException();
+ }
+
+ }
+
+ public String getEncoding() {
+ return "UTF-8";
+ }
+
+ public boolean hasText() {
+ return (state == TEXT_STATE);
+ }
+
+ public Location getLocation() {
+ return new Location() {
+ public int getLineNumber() {
+ return 0;
+ }
+
+ public int getColumnNumber() {
+ return 0;
+ }
+
+ public int getCharacterOffset() {
+ return 0;
+ }
+
+ public String getPublicId() {
+ return null;
+ }
+
+ public String getSystemId() {
+ return null;
+ }
+ };
+ }
+
+ public QName getName() {
+ if (state != TEXT_STATE) {
+ return name;
+ } else {
+ return null;
+ }
+ }
+
+ public String getLocalName() {
+ if (state != TEXT_STATE) {
+ return name.getLocalPart();
+ } else {
+ return null;
+ }
+ }
+
+ public boolean hasName() {
+ return (state != TEXT_STATE);
+
+ }
+
+ public String getNamespaceURI() {
+ if (state != TEXT_STATE) {
+ return name.getNamespaceURI();
+ } else {
+ return null;
+ }
+
+ }
+
+ public String getPrefix() {
+ if (state != TEXT_STATE) {
+ return name.getPrefix();
+ } else {
+ return null;
+ }
+ }
+
+ public String getVersion() {
+ return null; // todo 1.0 ?
+ }
+
+ public boolean isStandalone() {
+ return false;
+ }
+
+ public boolean standaloneSet() {
+ return false;
+ }
+
+ public String getCharacterEncodingScheme() {
+ return null;
+ }
+
+ public String getPITarget() {
+ return null;
+ }
+
+ public String getPIData() {
+ return null;
+ }
+
+ public boolean isEndOfFragment() {
+ return (state == END_ELEMENT_STATE);
+ }
+
+ public void init() {
+ // just add the current elements namespace and prefix to the this
+ // elements nscontext
+ registerNamespace(name.getPrefix(), name.getNamespaceURI());
+
+ }
+
+ /**
+ * @param prefix
+ * @param uri
+ */
+ private void registerNamespace(String prefix, String uri) {
+ // todo - need to fix this up to cater for cases where
+ // namespaces are having no prefixes
+ if (!uri.equals(namespaceContext.getNamespaceURI(prefix))) {
+ // this namespace is not there. Need to declare it
+ namespaceContext.registerMapping(prefix, uri);
+ }
+ }
+
+ public int getAttributeCount() {
+ if (state == START_ELEMENT_STATE_WITH_NULL)
+ return 1;
+ if (state == START_ELEMENT_STATE) {
+ return 0;
+ } else {
+ throw new IllegalStateException();
+ }
+
+ }
+
+ public String getAttributeLocalName(int i) {
+ if (state == START_ELEMENT_STATE_WITH_NULL && i == 0)
+ return XSI_NIL_QNAME.getLocalPart();
+ if (state == START_ELEMENT_STATE) {
+ return null;
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+
+ public QName getAttributeName(int i) {
+ if (state == START_ELEMENT_STATE_WITH_NULL && i == 0)
+ return XSI_NIL_QNAME;
+ if (state == START_ELEMENT_STATE) {
+ return null;
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+
+ public String getAttributeNamespace(int i) {
+ if (state == START_ELEMENT_STATE_WITH_NULL && i == 0)
+ return XSI_NIL_QNAME.getNamespaceURI();
+ if (state == START_ELEMENT_STATE) {
+ return null;
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+
+ public String getAttributePrefix(int i) {
+ if (state == START_ELEMENT_STATE_WITH_NULL && i == 0)
+ return XSI_NIL_QNAME.getPrefix();
+ if (state == START_ELEMENT_STATE) {
+ return null;
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+
+ public String getAttributeType(int i) {
+ return null; // not implemented
+ }
+
+ public String getAttributeValue(int i) {
+ if (state == START_ELEMENT_STATE_WITH_NULL && i == 0)
+ return "true";
+ if (state == START_ELEMENT_STATE) {
+ return null;
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+
+ public String getAttributeValue(String string, String string1) {
+ if (state == TEXT_STATE) {
+ // todo something
+ return null;
+ } else {
+ return null;
+ }
+
+ }
+
+ public int getNamespaceCount() {
+ if (state == START_ELEMENT_STATE_WITH_NULL && isXsiNamespacePresent())
+ return 1;
+ else
+ return 0;
+
+ }
+
+ public String getNamespacePrefix(int i) {
+ if (state == START_ELEMENT_STATE_WITH_NULL && isXsiNamespacePresent() && i == 0)
+ return XSI_NIL_QNAME.getPrefix();
+ else
+ return null;
+ }
+
+ public String getNamespaceURI(int i) {
+ if (state == START_ELEMENT_STATE_WITH_NULL && isXsiNamespacePresent() && i == 0)
+ return XSI_NIL_QNAME.getNamespaceURI();
+ else
+ return null;
+ }
+
+ /**
+ * Test whether the xsi namespace is present
+ *
+ * @return
+ */
+ private boolean isXsiNamespacePresent() {
+ return (namespaceContext.getNamespaceURI(XSI_NIL_QNAME.getPrefix()) != null);
+ }
+
+ }
+
+ protected class NameSpaceContext implements NamespaceContext {
+ private Map prefixToNamespaceMapping = new HashMap();
+
+ public NameSpaceContext() {
+ prefixToNamespaceMapping.put("xml", "http://www.w3.org/XML/1998/namespace");
+ prefixToNamespaceMapping.put("xmlns", "http://www.w3.org/2000/xmlns/");
+ prefixToNamespaceMapping.put("xsi", "http://www.w3.org/2001/XMLSchema-instance");
+ }
+
+ public String getNamespaceURI(String prefix) {
+ if (prefix == null)
+ throw new IllegalArgumentException("Prefix is null");
+
+ String ns = (String) prefixToNamespaceMapping.get(prefix);
+ if (ns != null)
+ return ns;
+ else
+ return null;
+ }
+
+ public String getPrefix(String nsURI) {
+ if (nsURI == null)
+ throw new IllegalArgumentException("Namespace is null");
+ for (Iterator i = prefixToNamespaceMapping.entrySet().iterator(); i.hasNext();) {
+ Map.Entry entry = (Map.Entry) i.next();
+ if (entry.getValue().equals(nsURI)) {
+ return (String) entry.getKey();
+ }
+ }
+ return null;
+ }
+
+ public Iterator getPrefixes(String nsURI) {
+ List prefixList = new ArrayList();
+ for (Iterator i = prefixToNamespaceMapping.entrySet().iterator(); i.hasNext();) {
+ Map.Entry entry = (Map.Entry) i.next();
+ if (entry.getValue().equals(nsURI)) {
+ prefixList.add(entry.getKey());
+ }
+ }
+ return prefixList.iterator();
+ }
+
+ public void registerMapping(String prefix, String nsURI) {
+ prefixToNamespaceMapping.put(prefix, nsURI);
+ }
+
+ private int counter = 0;
+
+ public synchronized QName createQName(String nsURI, String name) {
+ String prefix = nsURI != null ? (String) getPrefix(nsURI) : null;
+ if (prefix == null && nsURI != null && !nsURI.equals(""))
+ prefix = "p" + (counter++);
+ if (prefix == null)
+ prefix = "";
+ if (nsURI != null) {
+ prefixToNamespaceMapping.put(prefix, nsURI);
+ declaredNamespaceMap.put(prefix, nsURI);
+ }
+ return new QName(nsURI, name, prefix);
+ }
+
+ public void removeMapping(String prefix) {
+ prefixToNamespaceMapping.remove(prefix);
+ }
+ }
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/RecordedEventXMLStreamReader.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/RecordedEventXMLStreamReader.java
new file mode 100644
index 0000000000..b2b3036692
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/RecordedEventXMLStreamReader.java
@@ -0,0 +1,868 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.util.resource;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.NoSuchElementException;
+
+import javax.xml.XMLConstants;
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.namespace.QName;
+import javax.xml.stream.Location;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import org.eclipse.emf.ecore.xmi.XMLResource;
+import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
+
+/**
+ * This special purpose XMLStreamReader is used to produce a StAX event stream corresponding to a list of events
+ * recorded earlier. The recorded events are generated by the inner class RecordedEventXMLStreamReader.Tag,
+ * which records the events in either of 2 ways:
+ *
+ * 1) in conjunction with class SDOXMLLoadImpl, it records events corresponding to the SAX events being
+ * handled by the SDOXMLLoadImpl when loading XML using SDOXMLResourceImpl.
+ * 2) when Tag.record() is called (see class ChangeSummaryStreamDeserializer), it walks through and records
+ * the StAX events produced by another XMLStreamReader.
+ *
+ * This class is used by the SDO StAX-based ChangeSummaryType-property loader, class
+ * ChangeSummaryStreamDeserializer, which is inoked by and uses (for loading deleted object XML fragments)
+ * the SAX-based loader class XMLResourceImpl.
+ */
+public abstract class RecordedEventXMLStreamReader implements XMLStreamReader {
+
+ static private class Event {
+ int type;
+
+ public NamespaceContext nameSpaceContext;
+
+ Location location;
+
+ protected final void initialize(XMLStreamReader reader) {
+ nameSpaceContext = reader.getNamespaceContext();
+ location = reader.getLocation();
+ }
+
+ protected final void location(final Locator locator) {
+ location = new Location() {
+ public int getCharacterOffset() {
+ return -1;
+ }
+
+ public int getColumnNumber() {
+ return locator.getColumnNumber();
+ }
+
+ public int getLineNumber() {
+ return locator.getLineNumber();
+ }
+
+ public String getPublicId() {
+ return locator.getPublicId();
+ }
+
+ public String getSystemId() {
+ return locator.getSystemId();
+ }
+ };
+ }
+ }
+
+ static class ValueEvent extends Event {
+ final String value;
+
+ protected ValueEvent(String v) {
+ value = v;
+ }
+ }
+
+ static protected class Reference extends ValueEvent {
+ final String target;
+
+ protected Reference(String name, String data) {
+ super(data);
+ target = name;
+ }
+ }
+
+ static protected final class AttributeEvent extends Reference {
+ final QName name;
+
+ final String nameSpace, prefix;
+
+ int attributes;
+
+ final boolean specified;
+
+ protected AttributeEvent(XMLStreamReader reader) {
+ super(reader.getAttributeType(0), reader.getAttributeValue(0));
+ attributes = reader.getAttributeCount();
+ name = reader.getAttributeName(0);
+ nameSpace = reader.getAttributeNamespace(0);
+ prefix = reader.getAttributePrefix(0);
+ specified = reader.isAttributeSpecified(0);
+ }
+ }
+
+ static protected final class NameSpaceEvent extends Reference {
+ int nameSpaces;
+
+ protected NameSpaceEvent(XMLStreamReader reader) {
+ super(reader.getNamespacePrefix(0), reader.getNamespaceURI(0));
+ nameSpaces = reader.getNamespaceCount();
+ }
+ }
+
+ static protected String prefix(String qName, String nameSpace) {
+ int delimiter = qName.indexOf(':');
+ if (delimiter != -1)
+ return qName.substring(0, delimiter);
+ if (nameSpace.length() != 0)
+ return XMLConstants.DEFAULT_NS_PREFIX;
+ // if (nameSpaceContext.getNamespaceURI(XMLConstants.DEFAULT_NS_PREFIX) != null || xsdHelper.getGlobalProperty(null, name, element) == null)
+ return null;
+ }
+
+ static class EndElement extends Event {
+ List nameSpaces/* = null */;
+
+ public final QName name;
+
+ public final String nameSpace;
+
+ final String prefix;
+
+ protected EndElement(XMLStreamReader reader) {
+ name = reader.getName();
+ nameSpace = reader.getNamespaceURI();
+ prefix = reader.getPrefix();
+ int count = reader.getNamespaceCount();
+ if (count == 0)
+ return;
+ nameSpaces = new ArrayList(count);
+ int index = 0;
+ do
+ Tag.bind(reader.getNamespacePrefix(index), reader.getNamespaceURI(index), nameSpaces);
+ while (++index != count);
+ }
+
+ protected EndElement(String uri, String local, String p, Locator locator) {
+ if (p == null) {
+ name = new QName(uri, local, XMLConstants.DEFAULT_NS_PREFIX);
+ nameSpace = null;
+ } else {
+ name = new QName(uri, local, p);
+ nameSpace = uri;
+ }
+ prefix = p;
+ location(locator);
+ }
+ }
+
+ static class NameSpace {
+ final String prefix, uri;
+
+ protected NameSpace(String p, String nameSpace) {
+ prefix = p;
+ uri = nameSpace;
+ }
+ }
+
+ static final class Attribute extends NameSpace {
+ final String type, value;
+
+ final QName qName;
+
+ boolean specified/* = false */;
+
+ protected Attribute(String t, String v, QName name, String prefix, String nameSpace) {
+ super(prefix, nameSpace);
+ type = t;
+ value = v;
+ qName = name;
+ }
+ }
+
+ static final class AttributeList /* implements Attributes */{// TODO exclude XMLConstants.XMLNS_ATTRIBUTE
+ final List attributes;
+
+ protected AttributeList(int size) {
+ attributes = new ArrayList(size);
+ }
+
+ /*
+ * @param uri Never null
+ */
+ public final int getIndex(String uri, String localName) {
+ for (int index = getLength(); index != 0;)
+ if (getLocalName(--index).equals(localName) && uri.equals(getURI(index)))
+ return index;
+ return -1;
+ }
+
+ public final int getLength() {
+ return attributes.size();
+ }
+
+ protected final Attribute attribute(int index) {
+ return (Attribute) attributes.get(index);
+ }
+
+ public final String getLocalName(int index) {
+ return attribute(index).qName.getLocalPart();
+ }
+
+ public final String getType(int index) {
+ return attribute(index).type;
+ }
+
+ /*public String getType(String uri, String localName) {
+ int index = getIndex(uri, localName);
+ return index == -1 ? null: getType(index);
+ } */
+
+ public final String getURI(int index) {
+ return attribute(index).uri;
+ }
+
+ public final String getValue(int index) {
+ return attribute(index).value;
+ }
+
+ /*
+ * @param uri Never null
+ */
+ public final String getValue(String uri, String localName) {
+ int index = getIndex(uri, localName);
+ return index == -1 ? null : getValue(index);
+ }
+ }
+
+ static protected class StartElement extends EndElement {
+ final AttributeList attributes;
+
+ protected StartElement(XMLStreamReader reader) {
+ super(reader);
+ int count = reader.getAttributeCount();
+ if (count == 0)
+ attributes = null;
+ else {
+ attributes = new AttributeList(count);
+ int index = 0;
+ do {
+ Attribute attribute = new Attribute(reader.getAttributeType(index), reader.getAttributeValue(index), reader
+ .getAttributeName(index), reader.getAttributePrefix(index), reader.getAttributeNamespace(index));
+ attribute.specified = reader.isAttributeSpecified(index);
+ attributes.attributes.add(attribute);
+ } while (++index != count);
+ }
+ }
+
+ protected StartElement(String nameSpace, String local, String prefix, Attributes attributeArray, Locator locator, List bindings,
+ final NamespaceContext context) {
+ super(nameSpace, local, prefix, locator);
+ nameSpaces = bindings;
+ nameSpaceContext = bindings == null || bindings.isEmpty() ? context : new NamespaceContext() {
+ public String getNamespaceURI(String prefix) {
+ for (int index = nameSpaces.size(); index != 0;) {
+ NameSpace binding = (NameSpace) nameSpaces.get(--index);
+ if (binding.prefix.equals(prefix))
+ return binding.uri;
+ }
+ return context.getNamespaceURI(prefix);
+ }
+
+ public String getPrefix(String namespaceURI) {
+ for (int index = nameSpaces.size(); index != 0;) {
+ NameSpace binding = (NameSpace) nameSpaces.get(--index);
+ if (binding.uri.equals(namespaceURI))
+ return binding.prefix;
+ }
+ return context.getPrefix(namespaceURI);
+ }
+
+ public Iterator getPrefixes(final String namespaceURI) {
+ final Iterator iterator = context.getPrefixes(namespaceURI);
+ return new Iterator() {
+ Iterator bindings = nameSpaces.iterator();
+
+ NameSpace binding/* = null */;
+
+ protected final boolean prefix() {
+ while (bindings.hasNext()) {
+ binding = (NameSpace) bindings.next();
+ if (binding.uri.equals(namespaceURI))
+ return true;
+ }
+ bindings = null;
+ return false;
+ }
+
+ public boolean hasNext() {
+ return bindings != null && prefix() || iterator.hasNext();
+ }
+
+ protected NameSpace nameSpace;
+
+ public Object next() {
+ if (bindings == null || binding == null && !prefix())
+ return iterator.next();
+ nameSpace = binding;
+ binding = null;
+ return nameSpace.prefix;
+ }
+
+ public void remove() {
+ if (bindings == null)
+ iterator.remove();
+ else
+ nameSpaces.remove(nameSpace);
+ }
+ };
+ }
+ };
+ int count = attributeArray.getLength();
+ if (count == 0)
+ attributes = null;
+ else {
+ attributes = new AttributeList(count);
+ int index = 0;
+ do {
+ QName name;
+ nameSpace = attributeArray.getURI(index);
+ local = attributeArray.getLocalName(index);
+ prefix = prefix(attributeArray.getQName(index), nameSpace);
+ if (prefix == null) {
+ name = new QName(nameSpace, local, XMLConstants.DEFAULT_NS_PREFIX);
+ nameSpace = null;
+ } else
+ name = new QName(nameSpace, local, prefix);
+ attributes.attributes.add(new Attribute(attributeArray.getType(index), attributeArray.getValue(index), name, prefix, nameSpace));
+ } while (++index != count);
+ }
+ }
+ }
+
+ static public class Tag extends StartElement {
+ public Tag(XMLStreamReader reader) {
+ super(reader);
+ initialize(reader);
+ }
+
+ public List events/* = null */; // may be empty
+
+ protected final void events() {
+ events = new ArrayList();
+ }
+
+ public Tag(String nameSpace, String local, String prefix, Attributes attributes, Locator locator, NamespaceContext context, List bindings) {
+ super(nameSpace, local, prefix, attributes, locator, bindings, context);
+ events();
+ }
+
+ static public void bind(String prefix, String nameSpace, Collection nameSpaces) {
+ nameSpaces.add(new NameSpace(prefix, nameSpace));
+ }
+
+ protected int nest/* = 0 */;
+
+ public final void start(String nameSpace, String local, String qName, Attributes attributes, Locator locator, List bindings) {
+ Event event;
+ for (int index = events.size();/* true */;) {
+ if (index == 0) {
+ event = this;
+ break;
+ }
+ event = (Event) events.get(--index);
+ if (event.type != END_ELEMENT)
+ break;
+ siblings: for (int nest = 0;/* true */;)
+ switch (((Event) events.get(--index)).type) {
+ case START_ELEMENT:
+ if (nest == 0)
+ break siblings;
+ --nest;
+ break;
+ case END_ELEMENT:
+ ++nest;
+ }
+ }
+ Event start = new StartElement(nameSpace, local, prefix(qName, nameSpace), attributes, locator, bindings, event.nameSpaceContext);
+ start.type = START_ELEMENT;
+ events.add(start);
+ ++nest;
+ }
+
+ protected final void add (Event event)
+ {
+ int index = events.size();
+ event.nameSpaceContext = index == 0 ? nameSpaceContext : ((Event) events.get(--index)).nameSpaceContext;
+ events.add(event);
+ }
+
+ public final void text(int type, String value, Locator locator) {
+ Event event = new ValueEvent(value);
+ event.type = type;
+ event.location(locator);
+ //int index = events.size();
+ add(event);
+ }
+
+ public final boolean end(String nameSpace, String local, String qName, Locator locator) {
+ Event end = new EndElement(nameSpace, local, prefix(qName, nameSpace), locator);
+ end.type = END_ELEMENT;
+ add(end);
+ if (nest == 0)
+ return true;
+ --nest;
+ return false;
+ }
+
+ public final XMLStreamReader play(final XMLResource resource) {
+ return new RecordedEventXMLStreamReader(this) {
+ public void close() {
+ }
+
+ public String getCharacterEncodingScheme() {
+ return null; // TODO
+ }
+
+ public String getEncoding() {
+ return resource.getEncoding();
+ }
+
+ public Object getProperty(String property) {
+ return null; // TODO javax.xml.stream.notations & javax.xml.stream.entities for DTD
+ }
+
+ public String getVersion() {
+ return resource.getXMLVersion();
+ }
+
+ public boolean isStandalone() {
+ return false; // TODO
+ }
+
+ public boolean standaloneSet() {
+ return false; // TODO
+ }
+ };
+ }
+
+ protected final void add(Event event, int type, XMLStreamReader reader) {
+ event.type = type;
+ event.initialize(reader);
+ events.add(event);
+ }
+
+ public final boolean record(XMLStreamReader reader) throws XMLStreamException {
+ events();
+ for (int nest = 0; reader.hasNext();) {
+ Event event;
+ int type = reader.next();
+ switch (type) {
+ case CHARACTERS:
+ case CDATA:
+ case COMMENT:
+ case SPACE:
+ case DTD:
+ event = new ValueEvent(reader.getText());
+ break;
+ case ENTITY_REFERENCE:
+ event = new Reference(reader.getLocalName(), reader.getText());
+ break;
+ case PROCESSING_INSTRUCTION:
+ event = new Reference(reader.getPITarget(), reader.getPIData());
+ break;
+ case ATTRIBUTE:
+ event = new AttributeEvent(reader);
+ break;
+ case NAMESPACE:
+ event = new NameSpaceEvent(reader);
+ break;
+ case START_ELEMENT:
+ ++nest;
+ event = new StartElement(reader);
+ break;
+ case END_ELEMENT:
+ add(new EndElement(reader), type, reader);
+ if (nest == 0)
+ return false;
+ --nest;
+ continue;
+ case END_DOCUMENT:
+ return true; // report error?
+ default: // new type
+ event = new Event();
+ }
+ add(event, type, reader);
+ }
+ return true; // report error?
+ }
+
+ public final XMLStreamReader play(final XMLStreamReader reader) {
+ return new RecordedEventXMLStreamReader(this) {
+ public void close() throws XMLStreamException {
+ reader.close();
+ }
+
+ public String getCharacterEncodingScheme() {
+ return reader.getCharacterEncodingScheme();
+ }
+
+ public String getEncoding() {
+ return reader.getEncoding();
+ }
+
+ public Object getProperty(String property) {
+ return reader.getProperty(property); // TODO javax.xml.stream.notations & javax.xml.stream.entities for DTD
+ }
+
+ public String getVersion() {
+ return reader.getVersion();
+ }
+
+ public boolean isStandalone() {
+ return reader.isStandalone();
+ }
+
+ public boolean standaloneSet() {
+ return reader.standaloneSet();
+ }
+ };
+ }
+ }
+
+ Event event;
+
+ final List events;
+
+ final int size;
+
+ protected RecordedEventXMLStreamReader(Tag tag) {
+ event = tag;
+ tag.type = START_ELEMENT;
+ events = tag.events;
+ size = events.size();
+ }
+
+ public int getAttributeCount() {
+ switch (getEventType()) {
+ case START_ELEMENT:
+ AttributeList attributes = ((StartElement) event).attributes;
+ return attributes == null ? 0 : attributes.getLength();
+ case ATTRIBUTE:
+ return ((AttributeEvent) event).attributes;
+ }
+ throw new IllegalStateException("Neither START_ELEMENT nor ATTRIBUTE");
+ }
+
+ protected final AttributeList attributes() {
+ if (getEventType() == START_ELEMENT)
+ return ((StartElement) event).attributes;
+ throw new IllegalStateException("Neither START_ELEMENT nor ATTRIBUTE");
+ }
+
+ public String getAttributeLocalName(int index) {
+ return attributes().getLocalName(index);
+ }
+
+ static Attribute attribute(AttributeList attributes, int index) {
+ return (Attribute) attributes.attributes.get(index);
+ }
+
+ public QName getAttributeName(int index) {
+ return getEventType() == ATTRIBUTE ? ((AttributeEvent) event).name : attribute(attributes(), index).qName;
+ }
+
+ public String getAttributeNamespace(int index) {
+ return getEventType() == ATTRIBUTE ? ((AttributeEvent) event).nameSpace : attributes().getURI(index);
+ }
+
+ public String getAttributePrefix(int index) {
+ return getEventType() == ATTRIBUTE ? ((AttributeEvent) event).prefix : attribute(attributes(), index).prefix;
+ }
+
+ public String getAttributeType(int index) {
+ return getEventType() == ATTRIBUTE ? ((Reference) event).target : attributes().getType(index);
+ }
+
+ public String getAttributeValue(int index) {
+ return getEventType() == ATTRIBUTE ? ((ValueEvent) event).value : attributes().getValue(index);
+ }
+
+ public boolean isAttributeSpecified(int index) {
+ if (getEventType() == ATTRIBUTE)
+ return ((AttributeEvent) event).specified;
+ AttributeList attributes = attributes();
+ return attribute(attributes, index).specified;
+ }
+
+ public String getAttributeValue(String nameSpace, String name) {
+ if (getEventType() == ATTRIBUTE) {
+ AttributeEvent attribute = (AttributeEvent) event;
+ return !attribute.name.getLocalPart().equals(name) ? null : nameSpace == null ? (attribute.nameSpace == null ? attribute.value : null)
+ : nameSpace.equals(attribute.nameSpace) ? attribute.value : null;
+ }
+ AttributeList attributes = attributes();
+ return attributes == null ? null : attributes.getValue(nameSpace == null ? "" : nameSpace, name);
+ }
+
+ protected StringBuffer buffer/* = null */;
+
+ public String getElementText() {
+ if (buffer != null)
+ buffer.delete(0, buffer.length());
+ for (;;)
+ switch (next()) {
+ case END_ELEMENT:
+ return buffer == null ? null : buffer.toString();
+ default:
+ if (buffer == null)
+ buffer = new StringBuffer();
+ buffer.append(getText());
+ case PROCESSING_INSTRUCTION:
+ case COMMENT:
+ }
+ }
+
+ public final int getEventType() {
+ return event.type;
+ }
+
+ public String getLocalName() {
+ if (getEventType() == ENTITY_REFERENCE)
+ return ((Reference) event).target;
+ if (event instanceof EndElement)
+ return ((EndElement) event).name.getLocalPart();
+ throw new IllegalStateException("Neither START_ELEMENT, END_ELEMENT nor ENTITY_REFERENCE");
+ }
+
+ public final Location getLocation() {
+ return event.location;
+ }
+
+ public QName getName() {
+ if (hasName())
+ return ((EndElement) event).name;
+ throw new IllegalStateException("Neither START_ELEMENT nor END_ELEMENT");
+ }
+
+ public final NamespaceContext getNamespaceContext() {
+ return event.nameSpaceContext;
+ }
+
+ public int getNamespaceCount() {
+ if (getEventType() == NAMESPACE)
+ return ((NameSpaceEvent) event).nameSpaces;
+ if (!(event instanceof EndElement))
+ throw new IllegalStateException("Neither START_ELEMENT, END_ELEMENT nor NAMESPACE");
+ Collection nameSpaces = ((EndElement) event).nameSpaces;
+ return nameSpaces == null ? 0 : nameSpaces.size();
+ }
+
+ protected final NameSpace getNameSpace(int index) {
+ if (event instanceof EndElement)
+ return (NameSpace) ((EndElement) event).nameSpaces.get(index);
+ throw new IllegalStateException("Neither START_ELEMENT, END_ELEMENT nor NAMESPACE");
+ }
+
+ public String getNamespacePrefix(int index) {
+ return getEventType() == NAMESPACE ? ((Reference) event).target : getNameSpace(index).prefix;
+ }
+
+ public final String getNamespaceURI() {
+ switch (getEventType()) {
+ case ATTRIBUTE:
+ return ((AttributeEvent) event).nameSpace;
+ case NAMESPACE:
+ return ((ValueEvent) event).value;
+ }
+ return event instanceof EndElement ? ((EndElement) event).nameSpace : null;
+ }
+
+ public String getNamespaceURI(String prefix) {
+ return getNamespaceContext().getNamespaceURI(prefix);
+ }
+
+ public String getNamespaceURI(int index) {
+ return getEventType() == NAMESPACE ? ((ValueEvent) event).value : getNameSpace(index).uri;
+ }
+
+ public String getPIData() {
+ return getEventType() == PROCESSING_INSTRUCTION ? ((ValueEvent) event).value : null;
+ }
+
+ public String getPITarget() {
+ return getEventType() == PROCESSING_INSTRUCTION ? ((Reference) event).target : null;
+ }
+
+ public String getPrefix() {
+ switch (getEventType()) {
+ case ATTRIBUTE:
+ return ((AttributeEvent) event).prefix;
+ case NAMESPACE:
+ return ((Reference) event).target;
+ }
+ return event instanceof EndElement ? ((EndElement) event).prefix : null;
+ }
+
+ public final String getText() {
+ if (hasText())
+ return ((ValueEvent) event).value;
+ throw new IllegalStateException("Neither CHARACTERS, CDATA, COMMENT, SPACE, ENTITY_REFERENCE nor DTD");
+ }
+
+ public final char[] getTextCharacters() {
+ switch (getEventType()) {
+ case CHARACTERS:
+ case CDATA:
+ case COMMENT:
+ case SPACE:
+ return ((ValueEvent) event).value.toCharArray();
+ }
+ throw new IllegalStateException("Neither CHARACTERS, CDATA, COMMENT nor SPACE");
+ }
+
+ public int getTextCharacters(int sourceStart, char[] target, int targetStart, int length) {
+ char[] source = getTextCharacters();
+ if (sourceStart > source.length)
+ throw new IndexOutOfBoundsException("source start > source length");
+ int sourceLen = source.length - sourceStart;
+ if (length > sourceLen)
+ length = sourceLen;
+ System.arraycopy(source, sourceStart, target, targetStart, length);
+ return sourceLen;
+ }
+
+ public int getTextLength() {
+ return getTextCharacters().length;
+ }
+
+ public int getTextStart() {
+ return 0;
+ }
+
+ public final boolean hasName() {
+ return event instanceof EndElement;
+ }
+
+ protected int next/* = 0 */;
+
+ public final boolean hasNext() {
+ return next != size;
+ }
+
+ public final boolean hasText() {
+ switch (getEventType()) {
+ case CHARACTERS:
+ case CDATA:
+ case COMMENT:
+ case SPACE:
+ case ENTITY_REFERENCE:
+ case DTD:
+ return true;
+ }
+ return false;
+ }
+
+ public boolean isCharacters() {
+ switch (getEventType()) {
+ case CHARACTERS:
+ case CDATA:
+ case SPACE:
+ return true;
+ }
+ return false;
+ }
+
+ public boolean isEndElement() {
+ return getEventType() == END_ELEMENT;
+ }
+
+ public boolean isStartElement() {
+ return getEventType() == START_ELEMENT;
+ }
+
+ protected final boolean areWhiteSpace() {
+ String text = getText();
+ for (int index = text.length(); index != 0;)
+ if (!Character.isWhitespace(text.charAt(--index)))
+ return false;
+ return true;
+ }
+
+ public boolean isWhiteSpace() {
+ switch (getEventType()) {
+ case CHARACTERS:
+ case CDATA:
+ return areWhiteSpace();
+ case SPACE:
+ return true;
+ }
+ return false;
+ }
+
+ public final int next() {
+ if (!hasNext())
+ throw new NoSuchElementException();
+ event = (Event) events.get(next++);
+ return event.type;
+ }
+
+ protected final void throwXMLStreamException(String message) throws XMLStreamException {
+ throw new XMLStreamException(message, getLocation());
+ }
+
+ public int nextTag() throws XMLStreamException {
+ for (;;) {
+ int type = next();
+ switch (type) {
+ case CHARACTERS:
+ case CDATA:
+ if (!areWhiteSpace())
+ break;
+ case SPACE:
+ case PROCESSING_INSTRUCTION:
+ case COMMENT:
+ continue;
+ case START_ELEMENT:
+ case END_ELEMENT:
+ return type;
+ }
+ throwXMLStreamException("expected start or end tag");
+ }
+ }
+
+ public void require(int type, String nameSpace, String name) throws XMLStreamException {
+ if (getEventType() != type)
+ throwXMLStreamException("type not matched");
+ if (nameSpace != null && !nameSpace.equals(getNamespaceURI()))
+ throwXMLStreamException("Name Space not matched");
+ if (name != null
+ && !(getEventType() == ATTRIBUTE ? name.equals(((AttributeEvent) event).name.getLocalPart()) : event instanceof EndElement
+ && name.equals(((EndElement) event).name.getLocalPart())))
+ throwXMLStreamException("name not matched");
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/SDODeserializer.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/SDODeserializer.java
new file mode 100644
index 0000000000..a4ee4eaf96
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/SDODeserializer.java
@@ -0,0 +1,339 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.util.resource;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import org.apache.tuscany.sdo.helper.TypeHelperImpl;
+import org.apache.tuscany.sdo.helper.XMLStreamHelper;
+import org.apache.tuscany.sdo.helper.XMLStreamHelperImpl;
+import org.apache.tuscany.sdo.util.StreamDeserializer;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.common.util.TreeIterator;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.ecore.util.ExtendedMetaData;
+import org.eclipse.emf.ecore.xmi.XMLResource;
+
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+import commonj.sdo.helper.HelperContext;
+import commonj.sdo.helper.TypeHelper;
+import commonj.sdo.helper.XSDHelper;
+
+/**
+ * SDO StAX Deserializer. The instance isn't thread-safe, however it's safe to use the instance any times on the same thread.
+ */
+public class SDODeserializer extends StreamDeserializer {
+ protected final void initialize(XMLStreamReader stream, HelperContext scope, Object rootObject) {
+ reader = stream;
+ xsdHelper = scope.getXSDHelper();
+ typeHelper = scope.getTypeHelper();
+ extendedMetaData = ((TypeHelperImpl) typeHelper).getExtendedMetaData();
+ deserializer = null;
+ root = (EObject) rootObject;
+ }
+
+ XSDHelper xsdHelper;
+
+ protected Property propertyInSequence;
+
+ Property getProperty(Object type) {
+ EClass c = (EClass) type;
+ EStructuralFeature containment = (EStructuralFeature) propertyInSequence;
+ Object containing = extendedMetaData.getAffiliation(c, containment);
+ // if (containing == null) report error?
+ if (containment == containing && containment.isDerived()) {
+ containing = extendedMetaData.getMixedFeature(c);
+ if (containing == null) {
+ containing = extendedMetaData.getGroup(containment);
+ if (containing == null)
+ return propertyInSequence;
+ }
+ }
+ return (Property) containing;
+ }
+
+ protected final Property getProperty(Type type, String nameSpace, String name, boolean element) {
+ for (Iterator iterator = type.getProperties().iterator(); iterator.hasNext();) {
+ propertyInSequence = (Property) iterator.next();
+ if (name.equals(xsdHelper.getLocalName(propertyInSequence))
+ && nameSpace.equals(xsdHelper.getNamespaceURI(propertyInSequence)))
+ return getProperty(type);
+ }
+ propertyInSequence = xsdHelper.getGlobalProperty(nameSpace, name, element);
+ // if (propertyInSequence == null) report error?
+ return getProperty(type);
+ }
+
+ protected final Property getProperty(Type type, String name) {
+ propertyInSequence = type.getProperty(name);
+ // if (propertyInSequence == null) report error?
+ return getProperty(type);
+ }
+
+ protected final Property getProperty(String nameSpace, String name, Type type) {
+ return null == nameSpace ? getProperty(type, name) : getProperty(type, nameSpace, name, true);
+ }
+
+ XMLStreamHelperImpl deserializer;
+
+ TypeHelper typeHelper;
+
+ protected Object load(XMLStreamReader reader, Map options) throws XMLStreamException {
+ if (deserializer == null)
+ deserializer = new XMLStreamHelperImpl(typeHelper);
+ return deserializer.loadObject(reader, options);
+ }
+
+ static Object value(Type type, XMLStreamReader reader) throws XMLStreamException {
+ return value(type, reader.getElementText(), reader.getNamespaceContext());
+ }
+
+ protected final Object value(Type type) throws XMLStreamException {
+ return "true".equals(reader.getAttributeValue(ExtendedMetaData.XSI_URI, XMLResource.NIL)) ? null : type.isDataType() ? value(type, reader)
+ : load(reader, null);
+ }
+
+ Map options/* = null */;
+
+ protected final Object value(XMLStreamReader reader) throws XMLStreamException {
+ Type propertyType = propertyInSequence.getType();
+ if (propertyType.isDataType())
+ return value(propertyType, reader);
+ if (options == null)
+ options = new HashMap();
+ options.put(XMLStreamHelper.OPTION_DEFAULT_ROOT_TYPE, propertyType);
+ return load(reader, options);
+ }
+
+ private boolean match(String name, String space, EStructuralFeature feature) {
+ return name.equals(extendedMetaData.getName(feature)) && space.equals(extendedMetaData.getNamespace(feature));
+ }
+
+ EObject step(String ref, int step, int index, EObject container, String prefix, NamespaceContext nameSpaces) {
+ String name = ref.substring(step, index);
+ Iterator iterator = container.eContents().iterator();
+ if (iterator.hasNext())
+ if (prefix == null)
+ do {
+ container = (EObject) iterator.next();
+ // if( container == null )continue;
+ if (name.equals(extendedMetaData.getName(container.eContainmentFeature())))
+ return container;
+ } while (iterator.hasNext());
+ else {
+ prefix = nameSpaces.getNamespaceURI(prefix);
+ do {
+ container = (EObject) iterator.next();
+ // if( container == null )continue;
+ if (match(name, prefix, container.eContainmentFeature()))
+ return container;
+ } while (iterator.hasNext());
+ }
+ return null;
+ }
+
+ EObject root;
+
+ ExtendedMetaData extendedMetaData;
+
+ protected final EObject referent(String ref, NamespaceContext nameSpaces) {
+ int length = ref.length();
+ switch (length) {
+ case 0:
+ return null;
+ case 1: // #
+ return root;
+ }
+ EObject container;
+ int step;
+ if (ref.charAt(1) == '/') {
+ container = EcoreUtil.getRootContainer(root);
+ if (length == 2)
+ return container;
+ if (ref.charAt(2) == '/') {
+ for (Iterator iterator = container.eContents().iterator();/* true */;) {
+ if (!iterator.hasNext())
+ return null;
+ container = (EObject) iterator.next();
+ // if( container != null )
+ break;
+ }
+ /*#// is invalid
+ if (length == 3)
+ return container; */
+ step = 3;
+ } else
+ step = 2;
+ } else {
+ container = root;
+ step = 1;
+ }
+ String prefix = null;
+ for (int index = step; ++index != length;) {
+ switch (ref.charAt(index)) {
+ case '/':
+ container = step(ref, step, index, container, prefix, nameSpaces);
+ if (container == null)
+ return null;
+ break;
+ case ':':
+ prefix = ref.substring(step, index);
+ if (++index == length)
+ return container; // report error?
+ step = index;
+ default:
+ continue;
+ case '[':
+ name = ref.substring(step, index);
+ step = ref.indexOf(']', index + 2);
+ if (step == -1)
+ return container; // report error?
+ index = Integer.parseInt(ref.substring(++index, step));
+ EStructuralFeature feature;
+ Iterator iterator = container.eContents().iterator();
+ if (prefix == null)
+ do {
+ if (!iterator.hasNext())
+ return null;
+ EObject content = (EObject) iterator.next();
+ // if( content == null )continue;
+ feature = content.eContainmentFeature();
+ } while (!name.equals(extendedMetaData.getName(feature)));
+ else {
+ prefix = nameSpaces.getNamespaceURI(prefix);
+ do {
+ if (!iterator.hasNext())
+ return null;
+ EObject content = (EObject) iterator.next();
+ // if( content == null )continue;
+ feature = content.eContainmentFeature();
+ } while (!match(name, prefix, feature));
+ }
+ Object value = container.eGet(feature);
+ if (value instanceof List) {
+ List values = (List) value;
+ if (index > values.size())
+ return null;
+ container = (EObject) values.get(--index);
+ } else if (index == 1)
+ container = (EObject) value;
+ else
+ return null;
+ index = ref.indexOf('/', ++step);
+ if (index == -1)
+ return container;
+ }
+ if (++index == length)
+ return container;
+ step = index;
+ prefix = null;
+ }
+ return step(ref, step, length, container, prefix, nameSpaces);
+ }
+
+ static protected class Ref implements EObject // FeatureMapEntry value
+ {
+ protected Ref(String path, NamespaceContext context) {
+ ref = path;
+ nameSpaces = context;
+ }
+
+ final String ref;
+
+ final NamespaceContext nameSpaces;
+
+ public TreeIterator eAllContents() {
+ return null;
+ }
+ public EClass eClass() {
+ return null;
+ }
+ public EObject eContainer() {
+ return null;
+ }
+ public EStructuralFeature eContainingFeature() {
+ return null;
+ }
+ public EReference eContainmentFeature() {
+ return null;
+ }
+ public EList eContents() {
+ return null;
+ }
+ public EList eCrossReferences() {
+ return null;
+ }
+ public Object eGet(EStructuralFeature feature) {
+ return null;
+ }
+ public Object eGet(EStructuralFeature feature, boolean resolve) {
+ return null;
+ }
+ public boolean eIsProxy() {
+ return false;
+ }
+ public boolean eIsSet(EStructuralFeature feature) {
+ return false;
+ }
+ public Resource eResource() {
+ return null;
+ }
+ public void eSet(EStructuralFeature feature, Object newValue) {
+ }
+ public void eUnset(EStructuralFeature feature) {
+ }
+ public EList eAdapters() {
+ return null;
+ }
+ public boolean eDeliver() {
+ return false;
+ }
+ public void eNotify(Notification notification) {
+ }
+ public void eSetDeliver(boolean deliver) {
+ }
+ }
+
+ protected final EObject referent(Ref path) {
+ return referent(path.ref, path.nameSpaces);
+ }
+
+ protected final Type typeXSI() {
+ return typedXSI() ? typeHelper.getType(nameSpace, name) : null;
+ }
+
+ protected final Type globalElementType(String nameSpace, String name) {
+ return xsdHelper.getGlobalProperty(nameSpace, name, true).getType();
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/SDOObjectInputStream.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/SDOObjectInputStream.java
new file mode 100644
index 0000000000..ddb0803a19
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/SDOObjectInputStream.java
@@ -0,0 +1,51 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.util.resource;
+
+/**
+ * This class inherites off of ObjectInputStream providing a way to store the scope under which
+ * this inputStream has been created.
+ *
+ */
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+
+import commonj.sdo.helper.HelperContext;
+
+public class SDOObjectInputStream extends ObjectInputStream {
+
+ private HelperContext helperContext;
+
+ public SDOObjectInputStream(InputStream in, HelperContext helperContext) throws IOException{
+ super(in);
+ this.helperContext = helperContext;
+ }
+
+ public HelperContext getHelperContext() {
+ return helperContext;
+ }
+
+ public void setHelperContext(HelperContext helperContext) {
+ this.helperContext = helperContext;
+ }
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/SDOObjectOutputStream.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/SDOObjectOutputStream.java
new file mode 100644
index 0000000000..2250ee24d8
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/SDOObjectOutputStream.java
@@ -0,0 +1,51 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.util.resource;
+
+/**
+ * This class inherites off of ObjectInputStream providing a way to store the scope under which
+ * this inputStream has been created.
+ *
+ */
+
+import java.io.IOException;
+import java.io.ObjectOutputStream;
+import java.io.OutputStream;
+
+import commonj.sdo.helper.HelperContext;
+
+public class SDOObjectOutputStream extends ObjectOutputStream {
+
+ private HelperContext helperContext;
+
+ public SDOObjectOutputStream(OutputStream os, HelperContext helperContext) throws IOException{
+ super(os);
+ this.helperContext = helperContext;
+ }
+
+ public HelperContext getHelperContext() {
+ return helperContext;
+ }
+
+ public void setHelperContext(HelperContext helperContext) {
+ this.helperContext = helperContext;
+ }
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/SDOURIConverterImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/SDOURIConverterImpl.java
new file mode 100644
index 0000000000..639c556c83
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/SDOURIConverterImpl.java
@@ -0,0 +1,55 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.util.resource;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.impl.URIConverterImpl;
+
+public class SDOURIConverterImpl extends URIConverterImpl
+{
+ /**
+ * Disable going out to the wire.
+ */
+ protected InputStream createURLInputStream(URI uri) throws IOException {
+ String scheme = uri.scheme();
+ if ("http".equalsIgnoreCase(scheme) || "https".equalsIgnoreCase(scheme)) {
+ throw new Resource.IOWrappedException(
+ new RuntimeException("Reading remote URL not supported."));
+ }
+ return super.createURLInputStream(uri);
+ }
+
+ /**
+ * Disable going out to the wire.
+ */
+ protected OutputStream createURLOutputStream(URI uri) throws IOException {
+ String scheme = uri.scheme();
+ if ("http".equalsIgnoreCase(scheme) || "https".equalsIgnoreCase(scheme)) {
+ throw new Resource.IOWrappedException(
+ new RuntimeException("Writing remote URL not supported."));
+ }
+ return super.createURLOutputStream(uri);
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/SDOXMLResourceFactoryImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/SDOXMLResourceFactoryImpl.java
new file mode 100644
index 0000000000..c8189f9766
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/SDOXMLResourceFactoryImpl.java
@@ -0,0 +1,47 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.util.resource;
+
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl;
+
+/**
+ * This class creates SDOXMLResourceImpl objects.
+ */
+public class SDOXMLResourceFactoryImpl extends ResourceFactoryImpl
+{
+ /**
+ * Constructor for SDOXMLResourceFactoryImpl.
+ */
+ public SDOXMLResourceFactoryImpl()
+ {
+ super();
+ }
+
+ /**
+ * Creates an XMLResourceImpl and returns it.
+ */
+ public Resource createResource(URI uri)
+ {
+ return new SDOXMLResourceImpl(uri);
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/SDOXMLResourceImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/SDOXMLResourceImpl.java
new file mode 100644
index 0000000000..eeb88ca5b5
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/SDOXMLResourceImpl.java
@@ -0,0 +1,885 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.util.resource;
+
+import java.io.IOException;
+import java.io.Writer;
+import java.net.URL;
+import java.security.AccessController;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.XMLConstants;
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.tuscany.sdo.SDOExtendedMetaData;
+import org.apache.tuscany.sdo.helper.HelperContextImpl;
+import org.apache.tuscany.sdo.helper.SDOExtendedMetaDataImpl;
+import org.apache.tuscany.sdo.helper.XMLStreamHelper;
+import org.apache.tuscany.sdo.helper.XSDHelperImpl;
+import org.apache.tuscany.sdo.util.SDOUtil;
+import org.apache.tuscany.sdo.util.StAX2SAXAdapter;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.InternalEObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.util.ExtendedMetaData;
+import org.eclipse.emf.ecore.util.FeatureMap;
+import org.eclipse.emf.ecore.xmi.XMIException;
+import org.eclipse.emf.ecore.xmi.XMLHelper;
+import org.eclipse.emf.ecore.xmi.XMLLoad;
+import org.eclipse.emf.ecore.xmi.XMLOptions;
+import org.eclipse.emf.ecore.xmi.XMLResource;
+import org.eclipse.emf.ecore.xmi.XMLSave;
+import org.eclipse.emf.ecore.xmi.impl.SAXXMLHandler;
+import org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl;
+import org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl;
+import org.eclipse.emf.ecore.xmi.impl.XMLOptionsImpl;
+import org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl;
+import org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl;
+import org.eclipse.emf.ecore.xmi.impl.XMLString;
+import org.eclipse.emf.ecore.xmi.util.DefaultEcoreBuilder;
+import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.xml.sax.Attributes;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+import commonj.sdo.ChangeSummary;
+import commonj.sdo.DataObject;
+import commonj.sdo.helper.XSDHelper;
+
+public class SDOXMLResourceImpl extends XMLResourceImpl {
+ private XMLStreamReader reader;
+
+ /**
+ * [rfeng] Override the XMLHelperImpl to replace the NamespaceSupport so that it's aware of the NamespaceContext from the XMLStreamReader
+ */
+ public static class SDOXMLHelperImpl extends XMLHelperImpl {
+
+ /**
+ * EMF XMLResource (SAX) may be used to load from only a *portion* of a StAX stream
+ * which may reference (global) namespaces bound outside the (local) portion.
+ * This class extends EMF's NamespaceSupport to make {@link #getPrefix} and {@link #getURI}
+ * query these global binding(s) after first checking the local context(s).
+ */
+ private static class StreamNamespaceSupport extends XMLHelperImpl.NamespaceSupport {
+ protected NamespaceContext nameSpaceContext;
+
+ public String getPrefix(String uri) {
+ String prefix = super.getPrefix(uri);
+ if (prefix == null)
+ try {
+ prefix = nameSpaceContext.getPrefix(uri);
+ } catch (Exception e) {
+ // HACK:
+ // java.lang.UnsupportedOperationException
+ // at org.apache.axiom.om.impl.llom.OMStAXWrapper.getNamespaceContext(OMStAXWrapper.java:984)
+ }
+ return prefix;
+ }
+
+ public String getURI(String prefix) {
+ String uri = super.getURI(prefix);
+ if (uri == null)
+ try {
+ uri = nameSpaceContext.getNamespaceURI(prefix);
+ } catch (Exception e) {
+ // HACK:
+ // java.lang.UnsupportedOperationException
+ // at org.apache.axiom.om.impl.llom.OMStAXWrapper.getNamespaceContext(OMStAXWrapper.java:984)
+ }
+ return uri;
+ }
+
+ public StreamNamespaceSupport(XMLStreamReader reader) {
+ super();
+ nameSpaceContext = reader.getNamespaceContext();
+ }
+
+ }
+
+ public SDOXMLHelperImpl(XMLResource resource, XMLStreamReader reader) {
+ this(reader);
+ setResource(resource);
+ }
+
+ public SDOXMLHelperImpl(XMLStreamReader reader) {
+ super();
+ if (reader instanceof XMLDocumentStreamReader) // Only use StreamNamespaceSupport when loading from a *portion* of a StAX stream
+ namespaceSupport = new StreamNamespaceSupport(reader);
+ }
+
+ private class NameSpaceContext implements NamespaceContext { // TODO Helper# pushContext() & popContext
+ public String getNamespaceURI(String prefix) {
+ return SDOXMLHelperImpl.this.getNamespaceURI(prefix);
+ }
+
+ public String getPrefix(String namespaceURI) {
+ return SDOXMLHelperImpl.this.getPrefix(namespaceURI);
+ }
+
+ public Iterator getPrefixes(String namespaceURI) {
+ return ((Collection) urisToPrefixes.get(namespaceURI)).iterator();
+ }
+ }
+
+ NameSpaceContext nameSpaceContext/* = null */;
+
+ protected final NameSpaceContext nameSpaceContext() {
+ if (nameSpaceContext == null)
+ nameSpaceContext = new NameSpaceContext();
+ return nameSpaceContext;
+ }
+ }
+
+ public EObject root;
+
+ /**
+ * An EMF XMLLoad that loads a model from a StAX stream
+ */
+ public class SDOXMLLoadImpl extends XMLLoadImpl {
+ public SDOXMLLoadImpl(XMLHelper helper) {
+ super(helper);
+ }
+
+ final class XmlHandler extends SAXXMLHandler {
+ XmlHandler() {
+ super(resource, SDOXMLLoadImpl.this.helper, options);
+ }
+
+ protected void handleTopLocations(String prefix, String name) {
+ processSchemaLocations(prefix, name);
+ if (!processAnyXML)
+ return;
+ String nameSpace = helper.getURI(prefix);
+ if (extendedMetaData.getPackage(nameSpace) == null)
+ if (options.get(XMLStreamHelper.OPTION_DEFAULT_ROOT_TYPE) == null)
+ extendedMetaData.demandFeature(nameSpace, name, true);
+ else
+ extendedMetaData.demandPackage(nameSpace);
+ }
+
+ EClassifier defaultRootType(String prefix, String name, boolean isElement, EObject peekObject, String value) {
+ Object type = options.get(XMLStreamHelper.OPTION_DEFAULT_ROOT_TYPE);
+ if (type != null)
+ return (EClassifier) type;
+ super.handleUnknownFeature(prefix, name, isElement, peekObject, value);
+ return null;
+ }
+
+ protected void handleUnknownFeature(String prefix, String name, boolean isElement, EObject peekObject, String value) {
+ if (objects.size() == 1) {
+ EFactory eFactory;
+ EClassifier type;
+ String typeQName = getXSIType();
+ if (typeQName == null) {
+ type = defaultRootType(prefix, name, isElement, peekObject, value);
+ if (type == null)
+ return;
+ eFactory = type.getEPackage().getEFactoryInstance();
+ } else {// createObjectFromTypeName
+ String typeName = null;
+ String xsiPrefix = XMLConstants.DEFAULT_NS_PREFIX;
+ int index = typeQName.indexOf(":");
+ if (index > 0) {
+ xsiPrefix = typeQName.substring(0, index);
+ typeName = typeQName.substring(index + 1);
+ } else
+ typeName = typeQName;
+ eFactory = getFactoryForPrefix(xsiPrefix);
+ if (eFactory != null)
+ type = helper.getType(eFactory, typeName);
+ else if (XMLConstants.DEFAULT_NS_PREFIX.equals(xsiPrefix) && helper.getURI(xsiPrefix) == null) {
+ EPackage ePackage = handleMissingPackage(null);
+ if (ePackage == null) {
+ type = defaultRootType(prefix, name, isElement, peekObject, value);
+ if (type == null)
+ return;
+ eFactory = type.getEPackage().getEFactoryInstance();
+ } else
+ type = helper.getType(eFactory = ePackage.getEFactoryInstance(), typeName);
+ } else {
+ type = defaultRootType(prefix, name, isElement, peekObject, value);
+ if (type == null)
+ return;
+ eFactory = type.getEPackage().getEFactoryInstance();
+ }
+ }
+ root = helper.createObject(eFactory, type);
+ if (root != null) {
+ if (disableNotify)
+ root.eSetDeliver(false);
+ handleObjectAttribs(root);
+ processObject(root);
+ return;
+ }
+ }
+ super.handleUnknownFeature(prefix, name, isElement, peekObject, value);
+ }
+
+ protected RecordedEventXMLStreamReader.Tag tag/* =null */;
+
+ protected List nameSpaces/* = null */;
+
+ public void startPrefixMapping(String prefix, String uri) {
+ if (nameSpaces == null)
+ nameSpaces = new ArrayList();
+ RecordedEventXMLStreamReader.Tag.bind(prefix, uri, nameSpaces);
+ if (tag == null)
+ super.startPrefixMapping(prefix, uri);
+ }
+
+ public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
+ if (tag != null) {
+ tag.start(uri, localName, qName, attributes, locator, nameSpaces);
+ nameSpaces = null;
+ return;
+ }
+ EObject peekObject = objects.peekEObject();
+ if (peekObject != null) {
+ String prefix = helper.getPrefix(uri.length() == 0 ? null : uri);
+ EStructuralFeature feature = getFeature(peekObject, prefix == null ? XMLConstants.DEFAULT_NS_PREFIX : prefix, localName, true);
+ if (feature != null && feature.getEType() == ChangeSummaryStreamSerializer.ChangeSummary_TYPE) {
+ tag = new RecordedEventXMLStreamReader.Tag(uri, localName, prefix, attributes, locator, ((SDOXMLHelperImpl) helper).nameSpaceContext(),
+ nameSpaces);
+ nameSpaces = null;
+ return;
+ }
+ }
+ if (nameSpaces != null)
+ nameSpaces.clear();
+ super.startElement(uri, localName, qName, attributes);
+ }
+
+ public void characters(char[] ch, int start, int length) {
+ if (tag == null)
+ super.characters(ch, start, length);
+ else
+ tag.text(XMLStreamConstants.CHARACTERS, new String(ch, start, length), locator);
+ }
+
+ protected Collection changeSummaryDeserializers/* = null */;
+
+ public void endElement(String uri, String localName, String qName) {
+ if (tag == null)
+ super.endElement(uri, localName, qName);
+ else if (tag.end(uri, localName, qName, locator)) {
+ if (changeSummaryDeserializers == null)
+ changeSummaryDeserializers = new ArrayList();
+ ChangeSummaryStreamDeserializer changeSummaryDeserializer = new ChangeSummaryStreamDeserializer();
+ try {
+ changeSummaryDeserializer.begin(
+ (DataObject) objects.peekEObject(),
+ new HelperContextImpl(extendedMetaData, false),
+ tag.play(xmlResource));
+ changeSummaryDeserializers.add(changeSummaryDeserializer);
+ } catch (XMLStreamException e) {
+ xmlResource.getErrors().add(new XMIException(e));
+ }
+ tag = null;
+ }
+ }
+
+ public void endDocument() {
+ super.endDocument();
+ if (changeSummaryDeserializers != null)
+ for (Iterator iterator = changeSummaryDeserializers.iterator(); iterator.hasNext();)
+ try {
+ ((ChangeSummaryStreamDeserializer) iterator.next()).end();
+ // iterator.remove();
+ } catch (XMLStreamException e) {
+ xmlResource.getErrors().add(new XMIException(e));
+ }
+ }
+ }
+
+ protected DefaultHandler makeDefaultHandler() {
+ return new XmlHandler();
+ }
+
+ /**
+ * Start parsing an XMLReader with the default handler.
+ */
+ public void load(XMLResource resource, final XMLStreamReader reader, Map options) throws IOException {
+ this.resource = resource;
+ Map mergedOptions = new HashMap(defaultLoadOptions);
+ if (options != null)
+ mergedOptions.putAll(options);
+
+ this.options = mergedOptions;
+
+ final ContentHandler handler = makeDefaultHandler();
+
+ if (errors != null) {
+ errors.clear();
+ }
+
+ final StAX2SAXAdapter adapter = new StAX2SAXAdapter(true);
+ // Parse the XMLReader and generate SAX events
+ try {
+ AccessController.doPrivileged(new PrivilegedExceptionAction() {
+ public Object run() throws XMLStreamException, SAXException {
+ adapter.parse(reader, handler);
+ return null;
+ }
+ });
+ } catch (PrivilegedActionException e) {
+ throw new Resource.IOWrappedException(e.getException());
+ }
+
+ helper = null;
+ if (!resource.getErrors().isEmpty()) {
+ Exception error = (Exception) resource.getErrors().get(0);
+ if (error instanceof XMIException) {
+ XMIException exception = (XMIException) error;
+ if (exception.getWrappedException() != null) {
+ throw new Resource.IOWrappedException(exception.getWrappedException());
+ }
+ }
+ throw new Resource.IOWrappedException(error);
+ }
+ }
+ }
+
+ public SDOXMLResourceImpl(URI uri) {
+ super(uri);
+ }
+
+ protected XMLHelper createXMLHelper() {
+ return new SDOXMLHelperImpl(this, reader);
+ }
+
+ /**
+ * @see org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl#createXMLLoad()
+ */
+ protected XMLLoad createXMLLoad() {
+ return new SDOXMLLoadImpl(createXMLHelper());
+ }
+
+ static protected int loadLaxForm;
+ static {
+ int defaultLaxForm = 0x4242;
+ String property = System.getProperty("XML.load.form.lax");
+ if (property == null)
+ loadLaxForm = defaultLaxForm;
+ else
+ try {
+ loadLaxForm = Integer.decode(property).intValue();
+ } catch (NumberFormatException eNumberFormat) {
+ loadLaxForm = defaultLaxForm;
+ }
+ }
+
+ public void doLoad(InputSource inputSource, Map options) throws IOException {
+ if (options != null) {
+ /*
+ * Tolerates element/attribute malform unless indicated not to
+ */
+ Object option = options.get(SDOUtil.XML_LOAD_LaxForm);
+ int tolerance = option == null ? loadLaxForm : ((Number) option).intValue();
+ option = options.get(OPTION_EXTENDED_META_DATA);
+ if (tolerance == 0) {
+ if (option instanceof SDOExtendedMetaData)
+ ((SDOExtendedMetaData) option).setFeatureNamespaceMatchingLax(false);
+ } else if (option instanceof SDOExtendedMetaData)
+ ((SDOExtendedMetaData) option).setFeatureNamespaceMatchingLax(true);
+ else
+ options.put(OPTION_EXTENDED_META_DATA, option = new SDOExtendedMetaDataImpl()); // TODO copy (BasicExtendedMetaData)option
+ /*
+ * Loads schema if necessary
+ */
+ if (Boolean.TRUE.equals(options.get(SDOUtil.XML_LOAD_SCHEMA))) {
+ XMLOptions xmlOptions = (XMLOptions) options.get(OPTION_XML_OPTIONS);
+ if (xmlOptions == null) {
+ xmlOptions = new XMLOptionsImpl();
+ options.put(OPTION_XML_OPTIONS, xmlOptions);
+ }
+ xmlOptions.setProcessSchemaLocations(true);
+ if (option == null)
+ option = getDefaultLoadOptions().get(OPTION_EXTENDED_META_DATA);
+ ExtendedMetaData extendedMetaData;
+ final XSDHelper xsdHelper;
+ if (option == null) {
+ extendedMetaData = ExtendedMetaData.INSTANCE;
+ xsdHelper = XSDHelper.INSTANCE;
+ } else {
+ extendedMetaData = (ExtendedMetaData) option;
+ xsdHelper = new XSDHelperImpl(extendedMetaData, null);
+ }
+ xmlOptions.setEcoreBuilder(new DefaultEcoreBuilder(extendedMetaData) {
+ public Collection generate(Map targetNamespaceToURI) throws IOException {
+ for (Iterator iterator = targetNamespaceToURI.values().iterator(); iterator.hasNext();) {
+ String uri = iterator.next().toString();
+ xsdHelper.define(uri.indexOf(":/") == -1 ? Thread.currentThread().getContextClassLoader().getResourceAsStream(uri)
+ : new URL(uri).openStream(), uri);
+ }
+ return null; // XMLHandler#processSchemaLocations doesn't take the result
+ }
+ });
+ }
+ } else if (loadLaxForm != 0) {
+ /*
+ * Tolerates element/attribute malform
+ */
+ options = new HashMap();
+ options.put(OPTION_EXTENDED_META_DATA, new SDOExtendedMetaDataImpl());
+ }
+ super.doLoad(inputSource, options);
+ // TODO there is some thinking to be done about the restoration of options
+ }
+
+ /**
+ * Loads the resource from a StAX XMLStreamReader.
+ */
+ public void load(XMLStreamReader reader, Map options) throws IOException {
+ this.reader = reader;
+ SDOXMLLoadImpl xmlLoad = (SDOXMLLoadImpl) createXMLLoad();
+ Map mergedOptions = new HashMap(defaultLoadOptions);
+ if (options != null)
+ mergedOptions.putAll(options);
+ xmlLoad.load(this, reader, mergedOptions);
+ }
+
+ ChangeSummaryStreamSerializer changeSummarySerializer/* = null*/;
+
+ static private final class LocalName extends QName {
+ private LocalName(String name) {
+ super(name);
+ }
+
+ public String getNamespaceURI() {
+ return null;
+ }
+ }
+
+ static final String INDENT = " ", LINE_SEPARATOR = System.getProperty("line.separator");
+
+ static final class XmlString extends XMLString {
+ XmlString(int lineWidth, String temporaryFileName) {
+ super(lineWidth, temporaryFileName); // setLineWidth & setTemporaryFileName
+ }
+
+ XmlString(int lineWidth, String publicId, String systemId, String temporaryFileName) {
+ super(lineWidth, publicId, systemId, temporaryFileName);
+ }
+
+ void setLineBreak(String lineBreak) {
+ lineSeparator = lineBreak;
+ }
+
+ void margin(String margin) {
+ indents.set(0, margin);
+ }
+
+ String indent = INDENT;
+
+ protected String getElementIndent(int extra) {
+ int nesting = depth + extra - 1;
+ for (int i = indents.size() - 1; i < nesting; ++i) {
+ indents.add(indents.get(i) + indent);
+ }
+ return (String) indents.get(nesting);
+ }
+
+ protected String getAttributeIndent() {
+ return getElementIndent();
+ }
+
+ public final boolean mixed() {
+ return isMixed;
+ }
+
+ public void reset(String publicId, String systemId, int lineWidth, String temporaryFileName) {
+ super.reset(publicId, systemId, lineWidth, temporaryFileName);
+ setLineBreak(LINE_SEPARATOR);
+ indent = INDENT;
+ }
+ }
+
+ static final char MARK = '\n';
+
+ static final String LINE_BREAK = new String(new char[] { MARK });
+
+ final class SDOXMLSaveImpl extends XMLSaveImpl {
+ SDOXMLSaveImpl(XMLHelper helper) {
+ super(helper);
+ }
+
+ XmlString doc(XMLResource resource, Map options) {
+ if (doc instanceof XmlString)
+ return (XmlString) doc;
+ Object lineWidth = options.get(OPTION_LINE_WIDTH);
+ int width = lineWidth == null ? Integer.MAX_VALUE : ((Number) lineWidth).intValue();
+ XmlString d = resource != null && Boolean.TRUE.equals(options.get(OPTION_SAVE_DOCTYPE)) ? new XmlString(width, resource.getPublicId(),
+ resource.getSystemId(), doc.getTemporaryFileName()) : new XmlString(width, doc.getTemporaryFileName());
+ doc = d;
+ return d;
+ }
+
+ Map changeSummaryOptions = new HashMap();
+ String indent = INDENT, margin;
+
+ protected void init(XMLResource resource, Map options) {
+ super.init(resource, options);
+ int unformat = 0;
+ String lineBreak = (String) options.get(SDOUtil.XML_SAVE_LineBreak);
+ if (lineBreak == null)
+ changeSummaryOptions.put(SDOUtil.XML_SAVE_LineBreak, LINE_BREAK);
+ else if (lineBreak.length() == 0)
+ ++unformat;
+ else {
+ changeSummaryOptions.put(SDOUtil.XML_SAVE_LineBreak, LINE_BREAK);
+ if (lineBreak.equals(LINE_SEPARATOR))
+ lineBreak = null;
+ }
+ String indent = (String) options.get(SDOUtil.XML_SAVE_INDENT);
+ if (indent == null)
+ changeSummaryOptions.put(SDOUtil.XML_SAVE_INDENT, INDENT);
+ else if (indent.length() == 0)
+ ++unformat;
+ else {
+ changeSummaryOptions.put(SDOUtil.XML_SAVE_INDENT, this.indent = indent);
+ if (indent.equals(INDENT))
+ indent = null;
+ }
+ String margin = (String) options.get(SDOUtil.XML_SAVE_MARGIN);
+ if (margin == null || margin.length() == 0) {
+ if (unformat == 2)
+ doc.setUnformatted(true);
+ else if (lineBreak != null) {
+ XmlString d = doc(resource, options);
+ d.setLineBreak(lineBreak);
+ if (indent != null)
+ d.indent = indent;
+ } else if (indent != null)
+ doc(resource, options).indent = indent;
+ this.margin = this.indent;
+ } else {
+ XmlString d = doc(resource, options);
+ d.margin(margin);
+ if (lineBreak != null)
+ d.setLineBreak(lineBreak);
+ if (indent != null)
+ d.indent = indent;
+ this.margin = margin + this.indent;
+ if (!toDOM && declareXML)
+ d.add(margin);
+ }
+ // changeSummaryOptions.put(ChangeSummaryStreamSerializer.OPTION_RootObject_PATH, "#");
+ // changeSummaryOptions.put(ChangeSummaryStreamSerializer.OPTION_OPTIMIZE_LIST, Boolean.TRUE);
+ changeSummaryOptions.put(OPTION_EXTENDED_META_DATA, extendedMetaData);
+ }
+
+ QName qName(EStructuralFeature f) {
+ if (extendedMetaData == null)
+ return new LocalName(f.getName());
+ String nameSpace = extendedMetaData.getNamespace(f), name = extendedMetaData.getName(f);
+ return nameSpace == null ? new LocalName(name) : new QName(nameSpace, name);
+ }
+
+ XMLStreamWriter xmlStreamWriter/* = null*/;
+
+ void saveChangeSummary(EObject o, EStructuralFeature f, Object changeSummary) {
+ boolean notMixed;
+ if (doc instanceof XmlString)
+ notMixed = !((XmlString) doc).mixed();
+ else if (extendedMetaData == null)
+ notMixed = true;
+ else
+ switch (extendedMetaData.getContentKind(o.eClass())) {
+ case ExtendedMetaData.MIXED_CONTENT:
+ case ExtendedMetaData.SIMPLE_CONTENT:
+ notMixed = false;
+ break;
+ default:
+ notMixed = true;
+ }
+ if (notMixed) {
+ StringBuffer margin = new StringBuffer(this.margin);
+ for (EObject container = o.eContainer(), grandContainer; (grandContainer = container.eContainer()) != null; container = grandContainer)
+ margin.append(indent);
+ changeSummaryOptions.put(SDOUtil.XML_SAVE_MARGIN, margin.toString());
+ }
+ try {
+ if (xmlStreamWriter == null) {
+ xmlStreamWriter = XMLOutputFactory.newInstance().createXMLStreamWriter(new Writer() {
+ public void close() {
+ }
+
+ public void flush() {
+ }
+
+ protected final void add(char[] cbuf, int index, int off) {
+ doc.addText(new String(cbuf, index, off - index));
+ }
+
+ public void write(char[] cbuf, int off, int len) {
+ if (len != 0)
+ for (;;) {
+ while (cbuf[off] == MARK) {
+ doc.addLine();
+ if (--len == 0)
+ return;
+ ++off;
+ }
+ for (int index = off;/* true */;) {
+ ++off;
+ if (--len == 0)
+ add(cbuf, index, off);
+ else {
+ if (cbuf[off] != MARK)
+ continue;
+ add(cbuf, index, off);
+ doc.addLine();
+ if (--len != 0)
+ break;
+ }
+ return;
+ }
+ ++off;
+ }
+ }
+ });
+ xmlStreamWriter.setNamespaceContext(((SDOXMLHelperImpl) helper).new NameSpaceContext() {
+ public String getNamespaceURI(String prefix) {
+ return declareXSI && ExtendedMetaData.XSI_PREFIX.equals(prefix) ? ExtendedMetaData.XSI_URI : super
+ .getNamespaceURI(prefix);
+ }
+
+ public String getPrefix(String namespaceURI) {
+ return declareXSI && ExtendedMetaData.XSI_URI.equals(namespaceURI) ? ExtendedMetaData.XSI_PREFIX : super
+ .getPrefix(namespaceURI);
+ }
+
+ public Iterator getPrefixes(String namespaceURI) {
+ final Iterator iterator = super.getPrefixes(namespaceURI);
+ return ExtendedMetaData.XSI_URI.equals(namespaceURI) ? new Iterator() {
+ boolean first = true;
+
+ public boolean hasNext() {
+ if (first)
+ if (declareXSI) // never from true to false
+ return true;
+ else
+ first = false;
+ return iterator.hasNext();
+ }
+
+ public Object next() {
+ if (first) {
+ first = false;
+ if (declareXSI)
+ return ExtendedMetaData.XSI_PREFIX;
+ }
+ return iterator.next();
+ }
+
+ public void remove() {
+ if (first)
+ declareXSI = false;
+ else
+ iterator.remove();
+ }
+ } : iterator;
+ }
+ });
+ for (Iterator iterator = helper.getPrefixToNamespaceMap().iterator(); iterator.hasNext();) {
+ Map.Entry entry = (Map.Entry) iterator.next();
+ xmlStreamWriter.setPrefix((String) entry.getKey(), (String) entry.getValue());
+ }
+ if (declareXSI)
+ xmlStreamWriter.setPrefix(ExtendedMetaData.XSI_PREFIX, ExtendedMetaData.XSI_URI);
+ if (changeSummarySerializer == null)
+ changeSummarySerializer = new ChangeSummaryStreamSerializer();
+ }
+ changeSummarySerializer.saveChangeSummary((ChangeSummary) changeSummary, qName(f), xmlStreamWriter, changeSummaryOptions);
+ if (notMixed)
+ doc.addLine();
+ } catch (XMLStreamException e) {
+ xmlResource.getErrors().add(new XMIException(e));
+ }
+ }
+
+ protected void saveDataTypeElementSingle(EObject o, EStructuralFeature f) {
+ if (f.getEType() == ChangeSummaryStreamSerializer.ChangeSummary_TYPE)
+ saveChangeSummary(o, f, helper.getValue(o, f));
+ else
+ super.saveDataTypeElementSingle(o, f);
+ }
+
+ /*
+ * TEMPORARILY COPIED FROM BASE CLASS - DO NOT EDIT - WILL BE REMOVED WHEN WE MOVE TO EMF 2.3
+ */
+ protected boolean saveElementFeatureMap(EObject o, EStructuralFeature f)
+ {
+ List values = (List)helper.getValue(o, f);
+ int size = values.size();
+ for (int i = 0; i < size; i++)
+ {
+ FeatureMap.Entry entry = (FeatureMap.Entry)values.get(i);
+ EStructuralFeature entryFeature = entry.getEStructuralFeature();
+ Object value = entry.getValue();
+ if (entryFeature instanceof EReference)
+ {
+ if (value == null)
+ {
+ saveNil(o, entryFeature);
+ }
+ else
+ {
+ EReference referenceEntryFeature = (EReference)entryFeature;
+ if (referenceEntryFeature.isContainment())
+ {
+ saveElement((InternalEObject)value, entryFeature);
+ }
+ else if (referenceEntryFeature.isResolveProxies())
+ {
+ saveFeatureMapElementReference((EObject)value, referenceEntryFeature);
+ }
+ else
+ {
+ saveElementIDRef(o, (EObject)value, entryFeature);
+ }
+ }
+ }
+ else
+ {
+ if (entryFeature == XMLTypePackage.eINSTANCE.getXMLTypeDocumentRoot_Text())
+ {
+ String svalue = value.toString();
+ if (escape != null)
+ {
+ svalue = escape.convertText(svalue);
+ }
+ if (!toDOM)
+ {
+ doc.addText(svalue);
+ }
+ else
+ {
+ Node text = document.createTextNode(svalue);
+ currentNode.appendChild(text);
+ handler.recordValues(text, o, f, entry);
+ }
+ }
+ else if (entryFeature == XMLTypePackage.eINSTANCE.getXMLTypeDocumentRoot_CDATA())
+ {
+ String stringValue = value.toString();
+ if (escape != null)
+ {
+ stringValue = escape.convertLines(stringValue);
+ }
+ if (!toDOM)
+ {
+ doc.addCDATA(stringValue);
+ }
+ else
+ {
+ Node cdata = document.createCDATASection(stringValue);
+ currentNode.appendChild(cdata);
+ handler.recordValues(cdata, o, f, entry);
+ }
+ }
+ else if (entryFeature == XMLTypePackage.eINSTANCE.getXMLTypeDocumentRoot_Comment())
+ {
+ String stringValue = value.toString();
+ if (escape != null)
+ {
+ stringValue = escape.convertLines(stringValue);
+ }
+ if (!toDOM)
+ {
+ doc.addComment(stringValue);
+ }
+ else
+ {
+ // TODO comments are not sent to recordValues
+ currentNode.appendChild(document.createComment(stringValue));
+ }
+ }
+ else
+ {
+ saveElement(o, value, entryFeature);
+ }
+ }
+ }
+ return size > 0;
+ }
+
+ protected final void saveElement(EObject o, Object value, EStructuralFeature f)
+ {
+ if (f.getEType() == ChangeSummaryStreamSerializer.ChangeSummary_TYPE)
+ {
+ saveChangeSummary(o, f, value);
+ return;
+ }
+ /* super.saveElement(o, value, f);
+ * TEMPORARILY COPIED FROM BASE CLASS - DO NOT EDIT - WILL BE REMOVED WHEN WE MOVE TO EMF 2.3
+ */
+ if (value == null)
+ {
+ saveNil(o, f);
+ }
+ else
+ {
+ String svalue = getDatatypeValue(value, f, false);
+ if (!toDOM)
+ {
+ doc.saveDataValueElement(helper.getQName(f), svalue);
+ }
+ else
+ {
+ helper.populateNameInfo(nameInfo, f);
+ Element elem = document.createElementNS(nameInfo.getNamespaceURI(), nameInfo.getQualifiedName());
+ Node text = document.createTextNode(svalue);
+ elem.appendChild(text);
+ currentNode.appendChild(elem);
+ handler.recordValues(elem, o, f, value);
+ handler.recordValues(text, o, f, value);
+ }
+ }
+ }
+ }
+
+ protected XMLSave createXMLSave() {
+ return new SDOXMLSaveImpl(createXMLHelper());
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/XMLDocumentStreamReader.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/XMLDocumentStreamReader.java
new file mode 100644
index 0000000000..64088a0366
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/XMLDocumentStreamReader.java
@@ -0,0 +1,438 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.util.resource;
+
+import java.util.NoSuchElementException;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.namespace.QName;
+import javax.xml.stream.Location;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+/**
+ * This class is derived from Apache Axis2 class <a
+ * href="http://svn.apache.org/repos/asf/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/StreamWrapper.java">
+ * org.apache.axis2.util.StreamWrapper</a>. It's used wrap a XMLStreamReader to create a XMLStreamReader representing a document and it will produce
+ * START_DOCUMENT, END_DOCUMENT events.
+ *
+ */
+public class XMLDocumentStreamReader implements XMLStreamReader {
+ private static final int STATE_INIT = 0; // The wrapper will produce START_DOCUMENT
+
+ private static final int STATE_SWITCHED = 1; // The real reader will produce events
+
+ private static final int STATE_COMPLETE_AT_NEXT = 2; // The wrapper will produce END_DOCUMENT
+
+ private static final int STATE_COMPLETED = 3; // Done
+
+ private XMLStreamReader realReader = null;
+
+ private int state = STATE_INIT;
+
+ public XMLDocumentStreamReader(XMLStreamReader realReader) {
+ if (realReader == null) {
+ throw new UnsupportedOperationException("Reader cannot be null");
+ }
+
+ this.realReader = realReader;
+
+ // If the real reader is positioned at START_DOCUMENT, always use the real reader
+ if (realReader.getEventType() == START_DOCUMENT)
+ state = STATE_SWITCHED;
+ }
+
+ public void close() throws XMLStreamException {
+ realReader.close();
+ }
+
+ public int next() throws XMLStreamException {
+ int returnEvent = -1;
+
+ switch (state) {
+ case STATE_SWITCHED:
+ returnEvent = realReader.next();
+ if (returnEvent == END_DOCUMENT) {
+ state = STATE_COMPLETED;
+ } else if (!realReader.hasNext()) {
+ state = STATE_COMPLETE_AT_NEXT;
+ }
+ break;
+ case STATE_INIT:
+ state = STATE_SWITCHED;
+ returnEvent = realReader.getEventType();
+ break;
+ case STATE_COMPLETE_AT_NEXT:
+ state = STATE_COMPLETED;
+ returnEvent = END_DOCUMENT;
+ break;
+ case STATE_COMPLETED:
+ // oops - no way we can go beyond this
+ throw new NoSuchElementException("End of stream has reached.");
+ default:
+ throw new UnsupportedOperationException();
+ }
+
+ return returnEvent;
+ }
+
+ private boolean isDelegating() {
+ return state == STATE_SWITCHED || state == STATE_COMPLETE_AT_NEXT;
+ }
+
+ public int nextTag() throws XMLStreamException {
+ if (isDelegating()) {
+ return realReader.nextTag();
+ } else {
+ throw new XMLStreamException();
+ }
+ }
+
+ public void require(int i, String s, String s1) throws XMLStreamException {
+ if (isDelegating()) {
+ realReader.require(i, s, s1);
+ }
+ }
+
+ public boolean standaloneSet() {
+ if (isDelegating()) {
+ return realReader.standaloneSet();
+ } else {
+ return false;
+ }
+ }
+
+ public int getAttributeCount() {
+ if (isDelegating()) {
+ return realReader.getAttributeCount();
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+
+ public String getAttributeLocalName(int i) {
+ if (isDelegating()) {
+ return realReader.getAttributeLocalName(i);
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+
+ public QName getAttributeName(int i) {
+ if (isDelegating()) {
+ return realReader.getAttributeName(i);
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+
+ public String getAttributeNamespace(int i) {
+ if (isDelegating()) {
+ return realReader.getAttributeNamespace(i);
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+
+ public String getAttributePrefix(int i) {
+ if (isDelegating()) {
+ return realReader.getAttributePrefix(i);
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+
+ public String getAttributeType(int i) {
+ if (isDelegating()) {
+ return realReader.getAttributeType(i);
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+
+ public String getAttributeValue(int i) {
+ if (isDelegating()) {
+ return realReader.getAttributeValue(i);
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+
+ public String getAttributeValue(String s, String s1) {
+ if (isDelegating()) {
+ return realReader.getAttributeValue(s, s1);
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+
+ public String getCharacterEncodingScheme() {
+ return realReader.getCharacterEncodingScheme();
+ }
+
+ public String getElementText() throws XMLStreamException {
+ if (isDelegating()) {
+ return realReader.getElementText();
+ } else {
+ throw new XMLStreamException();
+ }
+ }
+
+ public String getEncoding() {
+ return realReader.getEncoding();
+ }
+
+ public int getEventType() {
+ int event = -1;
+ switch (state) {
+ case STATE_SWITCHED:
+ case STATE_COMPLETE_AT_NEXT:
+ event = realReader.getEventType();
+ break;
+ case STATE_INIT:
+ event = START_DOCUMENT;
+ break;
+ case STATE_COMPLETED:
+ event = END_DOCUMENT;
+ break;
+ }
+ return event;
+ }
+
+ public Location getLocation() {
+ if (isDelegating()) {
+ return realReader.getLocation();
+ } else {
+ return null;
+ }
+ }
+
+ public QName getName() {
+ if (isDelegating()) {
+ return realReader.getName();
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+
+ public String getLocalName() {
+ if (isDelegating()) {
+ return realReader.getLocalName();
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+
+ public NamespaceContext getNamespaceContext() {
+ return realReader.getNamespaceContext();
+ }
+
+ public int getNamespaceCount() {
+ if (isDelegating()) {
+ return realReader.getNamespaceCount();
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+
+ public String getNamespacePrefix(int i) {
+ if (isDelegating()) {
+ return realReader.getNamespacePrefix(i);
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+
+ public String getNamespaceURI() {
+ if (isDelegating()) {
+ return realReader.getNamespaceURI();
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+
+ public String getNamespaceURI(int i) {
+ if (isDelegating()) {
+ return realReader.getNamespaceURI(i);
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+
+ public String getNamespaceURI(String s) {
+ if (isDelegating()) {
+ return realReader.getNamespaceURI(s);
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+
+ public String getPIData() {
+ if (isDelegating()) {
+ return realReader.getPIData();
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+
+ public String getPITarget() {
+ if (isDelegating()) {
+ return realReader.getPITarget();
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+
+ public String getPrefix() {
+ if (isDelegating()) {
+ return realReader.getPrefix();
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+
+ public Object getProperty(String s) throws IllegalArgumentException {
+ return realReader.getProperty(s);
+ }
+
+ public String getText() {
+ if (isDelegating()) {
+ return realReader.getText();
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+
+ public char[] getTextCharacters() {
+ if (isDelegating()) {
+ return realReader.getTextCharacters();
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+
+ public int getTextCharacters(int i, char[] chars, int i1, int i2) throws XMLStreamException {
+ if (isDelegating()) {
+ return realReader.getTextCharacters(i, chars, i1, i2);
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+
+ public int getTextLength() {
+ if (isDelegating()) {
+ return realReader.getTextLength();
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+
+ public int getTextStart() {
+ if (isDelegating()) {
+ return realReader.getTextStart();
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+
+ public String getVersion() {
+ if (isDelegating()) {
+ return realReader.getVersion();
+ } else {
+ return null;
+ }
+ }
+
+ public boolean hasName() {
+ if (isDelegating()) {
+ return realReader.hasName();
+ } else {
+ return false;
+ }
+ }
+
+ public boolean hasNext() throws XMLStreamException {
+ if (state == STATE_COMPLETE_AT_NEXT) {
+ return true;
+ } else if (state == STATE_COMPLETED) {
+ return false;
+ } else if (state == STATE_SWITCHED) {
+ return realReader.hasNext();
+ } else {
+ return true;
+ }
+ }
+
+ public boolean hasText() {
+ if (isDelegating()) {
+ return realReader.hasText();
+ } else {
+ return false;
+ }
+ }
+
+ public boolean isAttributeSpecified(int i) {
+ if (isDelegating()) {
+ return realReader.isAttributeSpecified(i);
+ } else {
+ return false;
+ }
+ }
+
+ public boolean isCharacters() {
+ if (isDelegating()) {
+ return realReader.isCharacters();
+ } else {
+ return false;
+ }
+ }
+
+ public boolean isEndElement() {
+ if (isDelegating()) {
+ return realReader.isEndElement();
+ } else {
+ return false;
+ }
+ }
+
+ public boolean isStandalone() {
+ if (isDelegating()) {
+ return realReader.isStandalone();
+ } else {
+ return false;
+ }
+ }
+
+ public boolean isStartElement() {
+ if (isDelegating()) {
+ return realReader.isStartElement();
+ } else {
+ return false;
+ }
+ }
+
+ public boolean isWhiteSpace() {
+ if (isDelegating()) {
+ return realReader.isWhiteSpace();
+ } else {
+ return false;
+ }
+ }
+} \ No newline at end of file
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/XMLFragmentStreamReader.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/XMLFragmentStreamReader.java
new file mode 100644
index 0000000000..66d8fbdc6a
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/XMLFragmentStreamReader.java
@@ -0,0 +1,44 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.util.resource;
+
+import javax.xml.stream.XMLStreamReader;
+
+interface XMLFragmentStreamReader extends XMLStreamReader {
+
+ // this will help to handle Text within the current element.
+ // user should pass the element text to the property list as this
+ // ELEMENT_TEXT as the key. This key deliberately has a space in it
+ // so that it is not a valid XML name
+ static final String ELEMENT_TEXT = "Element Text";
+
+ /**
+ * Extra method to query the state of the pullparser
+ * @return
+ */
+ boolean isEndOfFragment();
+
+ /**
+ * Initiate the parser - this will do whatever the needed
+ * tasks to initiate the parser and must be called before
+ * attempting any specific parsing using this parser
+ */
+ void init();
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/XMLStreamSerializer.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/XMLStreamSerializer.java
new file mode 100644
index 0000000000..a0242905f6
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/XMLStreamSerializer.java
@@ -0,0 +1,272 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.tuscany.sdo.util.resource;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+/**
+ * The XMLStreamSerializer pulls events from the XMLStreamReader and dumps into the XMLStreamWriter
+ */
+public class XMLStreamSerializer implements XMLStreamConstants {
+
+ private static int namespaceSuffix = 0;
+
+ public static final String NAMESPACE_PREFIX = "ns";
+
+ /*
+ * The behavior of the serializer is such that it returns when it encounters the starting element for the second time. The depth variable tracks
+ * the depth of the serilizer and tells it when to return. Note that it is assumed that this serialization starts on an Element.
+ */
+
+ /**
+ * Field depth
+ */
+ private int depth = 0;
+
+ /**
+ * Method serialize.
+ *
+ * @param node
+ * @param writer
+ * @throws XMLStreamException
+ */
+ public void serialize(XMLStreamReader node, XMLStreamWriter writer) throws XMLStreamException {
+ serializeNode(node, writer);
+ }
+
+ /**
+ * Method serializeNode.
+ *
+ * @param reader
+ * @param writer
+ * @throws XMLStreamException
+ */
+ protected void serializeNode(XMLStreamReader reader, XMLStreamWriter writer) throws XMLStreamException {
+ // TODO We get the StAXWriter at this point and uses it hereafter assuming that this is the only entry point to this class.
+ // If there can be other classes calling methodes of this we might need to change methode signatures to OMOutputer
+ while (reader.hasNext()) {
+ int event = reader.next();
+ if (event == START_ELEMENT) {
+ serializeElement(reader, writer);
+ depth++;
+ } else if (event == ATTRIBUTE) {
+ serializeAttributes(reader, writer);
+ } else if (event == CHARACTERS) {
+ serializeText(reader, writer);
+ } else if (event == COMMENT) {
+ serializeComment(reader, writer);
+ } else if (event == CDATA) {
+ serializeCData(reader, writer);
+ } else if (event == END_ELEMENT) {
+ serializeEndElement(writer);
+ depth--;
+ } else if (event == START_DOCUMENT) {
+ depth++; // if a start document is found then increment the depth
+ } else if (event == END_DOCUMENT) {
+ if (depth != 0)
+ depth--; // for the end document - reduce the depth
+ try {
+ serializeEndElement(writer);
+ } catch (Exception e) {
+ // TODO: log exceptions
+ }
+ }
+ if (depth == 0) {
+ break;
+ }
+ }
+ }
+
+ /**
+ * @param reader
+ * @param writer
+ * @throws XMLStreamException
+ */
+ protected void serializeElement(XMLStreamReader reader, XMLStreamWriter writer) throws XMLStreamException {
+ String prefix = reader.getPrefix();
+ String nameSpaceName = reader.getNamespaceURI();
+ if (nameSpaceName != null) {
+ String writer_prefix = writer.getPrefix(nameSpaceName);
+ if (writer_prefix != null) {
+ writer.writeStartElement(nameSpaceName, reader.getLocalName());
+ } else {
+ if (prefix != null) {
+ writer.writeStartElement(prefix, reader.getLocalName(), nameSpaceName);
+ writer.writeNamespace(prefix, nameSpaceName);
+ writer.setPrefix(prefix, nameSpaceName);
+ } else {
+ writer.writeStartElement(nameSpaceName, reader.getLocalName());
+ writer.writeDefaultNamespace(nameSpaceName);
+ writer.setDefaultNamespace(nameSpaceName);
+ }
+ }
+ } else {
+ writer.writeStartElement(reader.getLocalName());
+ }
+
+ // add the namespaces
+ int count = reader.getNamespaceCount();
+ String namespacePrefix;
+ for (int i = 0; i < count; i++) {
+ namespacePrefix = reader.getNamespacePrefix(i);
+ if (namespacePrefix != null && namespacePrefix.length() == 0)
+ continue;
+
+ serializeNamespace(namespacePrefix, reader.getNamespaceURI(i), writer);
+ }
+
+ // add attributes
+ serializeAttributes(reader, writer);
+
+ }
+
+ /**
+ * Method serializeEndElement.
+ *
+ * @param writer
+ * @throws XMLStreamException
+ */
+ protected void serializeEndElement(XMLStreamWriter writer) throws XMLStreamException {
+ writer.writeEndElement();
+ }
+
+ /**
+ * @param reader
+ * @param writer
+ * @throws XMLStreamException
+ */
+ protected void serializeText(XMLStreamReader reader, XMLStreamWriter writer) throws XMLStreamException {
+ writer.writeCharacters(reader.getText());
+ }
+
+ /**
+ * Method serializeCData.
+ *
+ * @param reader
+ * @param writer
+ * @throws XMLStreamException
+ */
+ protected void serializeCData(XMLStreamReader reader, XMLStreamWriter writer) throws XMLStreamException {
+ writer.writeCData(reader.getText());
+ }
+
+ /**
+ * Method serializeComment.
+ *
+ * @param reader
+ * @param writer
+ * @throws XMLStreamException
+ */
+ protected void serializeComment(XMLStreamReader reader, XMLStreamWriter writer) throws XMLStreamException {
+ writer.writeComment(reader.getText());
+ }
+
+ /**
+ * @param reader
+ * @param writer
+ * @throws XMLStreamException
+ */
+ protected void serializeAttributes(XMLStreamReader reader, XMLStreamWriter writer)
+ throws XMLStreamException {
+ int count = reader.getAttributeCount();
+ String prefix = null;
+ String namespaceName = null;
+ String writerPrefix = null;
+ for (int i = 0; i < count; i++) {
+ prefix = reader.getAttributePrefix(i);
+ namespaceName = reader.getAttributeNamespace(i);
+ if (namespaceName != null) {
+ writerPrefix = writer.getNamespaceContext().getPrefix(namespaceName);
+ }
+
+ if (!"".equals(namespaceName)) {
+ // prefix has already being declared but this particular attrib
+ // has a
+ // no prefix attached. So use the prefix provided by the writer
+ if (writerPrefix != null && (prefix == null || prefix.equals(""))) {
+ writer.writeAttribute(writerPrefix,
+ namespaceName,
+ reader.getAttributeLocalName(i),
+ reader.getAttributeValue(i));
+
+ // writer prefix is available but different from the current
+ // prefix of the attrib. We should be decalring the new
+ // prefix
+ // as a namespace declaration
+ } else if (prefix != null && !"".equals(prefix) && !prefix.equals(writerPrefix)) {
+ writer.writeNamespace(prefix, namespaceName);
+ writer.writeAttribute(prefix, namespaceName, reader.getAttributeLocalName(i), reader
+ .getAttributeValue(i));
+
+ // prefix is null (or empty), but the namespace name is
+ // valid! it has not
+ // being written previously also. So we need to generate a
+ // prefix
+ // here
+ } else if (prefix == null || prefix.equals("")) {
+ prefix = generateUniquePrefix(writer.getNamespaceContext());
+ writer.writeNamespace(prefix, namespaceName);
+ writer.writeAttribute(prefix, namespaceName, reader.getAttributeLocalName(i), reader
+ .getAttributeValue(i));
+ } else {
+ writer.writeAttribute(prefix, namespaceName, reader.getAttributeLocalName(i), reader
+ .getAttributeValue(i));
+ }
+ } else {
+ // empty namespace is equal to no namespace!
+ writer.writeAttribute(reader.getAttributeLocalName(i), reader.getAttributeValue(i));
+ }
+
+ }
+ }
+
+ /**
+ * Generates a unique namespace prefix that is not in the scope of the NamespaceContext
+ *
+ * @param nsCtxt
+ * @return string
+ */
+ private String generateUniquePrefix(NamespaceContext nsCtxt) {
+ String prefix = NAMESPACE_PREFIX + namespaceSuffix++;
+ // null should be returned if the prefix is not bound!
+ while (nsCtxt.getNamespaceURI(prefix) != null) {
+ prefix = NAMESPACE_PREFIX + namespaceSuffix++;
+ }
+
+ return prefix;
+ }
+
+ /**
+ * Method serializeNamespace.
+ *
+ * @param prefix
+ * @param URI
+ * @param writer
+ * @throws XMLStreamException
+ */
+ private void serializeNamespace(String prefix, String URI, XMLStreamWriter writer) throws XMLStreamException {
+ String prefix1 = writer.getPrefix(URI);
+ if (prefix1 == null) {
+ writer.writeNamespace(prefix, URI);
+ writer.setPrefix(prefix, URI);
+ }
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/resources/META-INF/LICENSE.txt b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/resources/META-INF/LICENSE.txt
new file mode 100644
index 0000000000..4c0d5a0eb6
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/resources/META-INF/LICENSE.txt
@@ -0,0 +1,454 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+
+APACHE TUSCANY SUBCOMPONENTS:
+
+The Apache Tuscany distribution includes a number of subcomponents with
+separate copyright notices and license terms. Your use of the source
+code for the these subcomponents is subject to the terms and
+conditions of the following licenses.
+
+===============================================================================
+
+For the Eclipse Modeling Framework component:
+
+applicable to the jar files
+
+ common-2.2.2.jar
+ ecore-2.2.2.jar
+ ecore-change-2.2.2.jar
+ ecore-xmi-2.2.2.jar
+ xsd-2.2.2.jar
+
+Eclipse Public License - v 1.0
+
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
+PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF
+THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+
+1. DEFINITIONS
+
+"Contribution" means:
+
+a) in the case of the initial Contributor, the initial code and
+documentation distributed under this Agreement, and
+b) in the case of each subsequent Contributor:
+
+i) changes to the Program, and
+
+ii) additions to the Program;
+
+where such changes and/or additions to the Program originate from and
+are distributed by that particular Contributor. A Contribution
+'originates' from a Contributor if it was added to the Program by such
+Contributor itself or anyone acting on such Contributor's behalf.
+Contributions do not include additions to the Program which: (i) are
+separate modules of software distributed in conjunction with the
+Program under their own license agreement, and (ii) are not derivative
+works of the Program.
+
+"Contributor" means any person or entity that distributes the Program.
+
+"Licensed Patents " mean patent claims licensable by a Contributor
+which are necessarily infringed by the use or sale of its Contribution
+alone or when combined with the Program.
+
+"Program" means the Contributions distributed in accordance with this
+Agreement.
+
+"Recipient" means anyone who receives the Program under this
+Agreement, including all Contributors.
+
+2. GRANT OF RIGHTS
+
+a) Subject to the terms of this Agreement, each Contributor hereby
+grants Recipient a non-exclusive, worldwide, royalty-free copyright
+license to reproduce, prepare derivative works of, publicly display,
+publicly perform, distribute and sublicense the Contribution of such
+Contributor, if any, and such derivative works, in source code and
+object code form.
+
+b) Subject to the terms of this Agreement, each Contributor hereby
+grants Recipient a non-exclusive, worldwide, royalty-free patent
+license under Licensed Patents to make, use, sell, offer to sell,
+import and otherwise transfer the Contribution of such Contributor, if
+any, in source code and object code form. This patent license shall
+apply to the combination of the Contribution and the Program if, at
+the time the Contribution is added by the Contributor, such addition
+of the Contribution causes such combination to be covered by the
+Licensed Patents. The patent license shall not apply to any other
+combinations which include the Contribution. No hardware per se is
+licensed hereunder.
+
+c) Recipient understands that although each Contributor grants the
+licenses to its Contributions set forth herein, no assurances are
+provided by any Contributor that the Program does not infringe the
+patent or other intellectual property rights of any other entity. Each
+Contributor disclaims any liability to Recipient for claims brought by
+any other entity based on infringement of intellectual property rights
+or otherwise. As a condition to exercising the rights and licenses
+granted hereunder, each Recipient hereby assumes sole responsibility
+to secure any other intellectual property rights needed, if any. For
+example, if a third party patent license is required to allow
+Recipient to distribute the Program, it is Recipient's responsibility
+to acquire that license before distributing the Program.
+
+d) Each Contributor represents that to its knowledge it has sufficient
+copyright rights in its Contribution, if any, to grant the copyright
+license set forth in this Agreement.
+
+3. REQUIREMENTS
+
+A Contributor may choose to distribute the Program in object code form
+under its own license agreement, provided that:
+
+a) it complies with the terms and conditions of this Agreement; and
+
+b) its license agreement:
+
+i) effectively disclaims on behalf of all Contributors all warranties
+and conditions, express and implied, including warranties or
+conditions of title and non-infringement, and implied warranties or
+conditions of merchantability and fitness for a particular purpose;
+
+ii) effectively excludes on behalf of all Contributors all liability
+for damages, including direct, indirect, special, incidental and
+consequential damages, such as lost profits;
+
+iii) states that any provisions which differ from this Agreement are
+offered by that Contributor alone and not by any other party; and
+
+iv) states that source code for the Program is available from such
+Contributor, and informs licensees how to obtain it in a reasonable
+manner on or through a medium customarily used for software exchange.
+
+When the Program is made available in source code form:
+
+a) it must be made available under this Agreement; and
+
+b) a copy of this Agreement must be included with each copy of the
+Program.
+
+Contributors may not remove or alter any copyright notices contained
+within the Program.
+
+Each Contributor must identify itself as the originator of its
+Contribution, if any, in a manner that reasonably allows subsequent
+Recipients to identify the originator of the Contribution.
+
+4. COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain
+responsibilities with respect to end users, business partners and the
+like. While this license is intended to facilitate the commercial use
+of the Program, the Contributor who includes the Program in a
+commercial product offering should do so in a manner which does not
+create potential liability for other Contributors. Therefore, if a
+Contributor includes the Program in a commercial product offering,
+such Contributor ("Commercial Contributor") hereby agrees to defend
+and indemnify every other Contributor ("Indemnified Contributor")
+against any losses, damages and costs (collectively "Losses") arising
+from claims, lawsuits and other legal actions brought by a third party
+against the Indemnified Contributor to the extent caused by the acts
+or omissions of such Commercial Contributor in connection with its
+distribution of the Program in a commercial product offering. The
+obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement.
+In order to qualify, an Indemnified Contributor must: a) promptly
+notify the Commercial Contributor in writing of such claim, and b)
+allow the Commercial Contributor to control, and cooperate with the
+Commercial Contributor in, the defense and any related settlement
+negotiations. The Indemnified Contributor may participate in any such
+claim at its own expense.
+
+For example, a Contributor might include the Program in a commercial
+product offering, Product X. That Contributor is then a Commercial
+Contributor. If that Commercial Contributor then makes performance
+claims, or offers warranties related to Product X, those performance
+claims and warranties are such Commercial Contributor's responsibility
+alone. Under this section, the Commercial Contributor would have to
+defend claims against the other Contributors related to those
+performance claims and warranties, and if a court requires any other
+Contributor to pay any damages as a result, the Commercial Contributor
+must pay those damages.
+
+5. NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS
+PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY
+WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY
+OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
+responsible for determining the appropriateness of using and
+distributing the Program and assumes all risks associated with its
+exercise of rights under this Agreement , including but not limited to
+the risks and costs of program errors, compliance with applicable
+laws, damage to or loss of data, programs or equipment, and
+unavailability or interruption of operations.
+
+6. DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR
+ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING
+WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR
+DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
+HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under
+applicable law, it shall not affect the validity or enforceability of
+the remainder of the terms of this Agreement, and without further
+action by the parties hereto, such provision shall be reformed to the
+minimum extent necessary to make such provision valid and enforceable.
+
+If Recipient institutes patent litigation against any entity
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+the Program itself (excluding combinations of the Program with other
+software or hardware) infringes such Recipient's patent(s), then such
+Recipient's rights granted under Section 2(b) shall terminate as of
+the date such litigation is filed.
+
+All Recipient's rights under this Agreement shall terminate if it
+fails to comply with any of the material terms or conditions of this
+Agreement and does not cure such failure in a reasonable period of
+time after becoming aware of such noncompliance. If all Recipient's
+rights under this Agreement terminate, Recipient agrees to cease use
+and distribution of the Program as soon as reasonably practicable.
+However, Recipient's obligations under this Agreement and any licenses
+granted by Recipient relating to the Program shall continue and
+survive.
+
+Everyone is permitted to copy and distribute copies of this Agreement,
+but in order to avoid inconsistency the Agreement is copyrighted and
+may only be modified in the following manner. The Agreement Steward
+reserves the right to publish new versions (including revisions) of
+this Agreement from time to time. No one other than the Agreement
+Steward has the right to modify this Agreement. The Eclipse Foundation
+is the initial Agreement Steward. The Eclipse Foundation may assign
+the responsibility to serve as the Agreement Steward to a suitable
+separate entity. Each new version of the Agreement will be given a
+distinguishing version number. The Program (including Contributions)
+may always be distributed subject to the version of the Agreement
+under which it was received. In addition, after a new version of the
+Agreement is published, Contributor may elect to distribute the
+Program (including its Contributions) under the new version. Except as
+expressly stated in Sections 2(a) and 2(b) above, Recipient receives
+no rights or licenses to the intellectual property of any Contributor
+under this Agreement, whether expressly, by implication, estoppel or
+otherwise. All rights in the Program not expressly granted under this
+Agreement are reserved.
+
+This Agreement is governed by the laws of the State of New York and
+the intellectual property laws of the United States of America. No
+party to this Agreement will bring a legal action under this Agreement
+more than one year after the cause of action arose. Each party waives
+its rights to a jury trial in any resulting litigation.
+
+===============================================================================
+
+
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/resources/META-INF/MANIFEST.MF b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/resources/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..e81250d5e3
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/resources/META-INF/MANIFEST.MF
@@ -0,0 +1,25 @@
+Manifest-Version: 1.0
+Extension-Name: tuscany-sdo-impl
+Specification-Title: Tuscany SDO Implementation
+Specification-Vendor: Apache Software Foundation
+Implementation-Vendor: Apache Software Foundation
+Implementation-Vendor-Id: org.apache
+Implementation-Title: tuscany-sdo-impl
+Implementation-Version: incubating-M3
+Bundle-ManifestVersion: 2
+Bundle-Name: Tuscany SDO Implementation
+Bundle-SymbolicName: org.apache.tuscany.sdo.impl
+Bundle-Version: 1.0.0
+Bundle-Vendor: Apache Software Foundation
+Require-Bundle: org.eclipse.emf.common,
+ org.eclipse.emf.ecore,
+ org.eclipse.emf.ecore.change,
+ org.eclipse.emf.ecore.xmi,
+ org.eclipse.xsd,
+ org.apache.tuscany.sdo.spec;visibility:=reexport
+Export-Package: commonj.sdo.impl,
+ org.apache.tuscany.sdo,
+ org.apache.tuscany.sdo.helper,
+ org.apache.tuscany.sdo.impl,
+ org.apache.tuscany.sdo.test,
+ org.apache.tuscany.sdo.util
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/resources/META-INF/NOTICE b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/resources/META-INF/NOTICE
new file mode 100644
index 0000000000..03e8dedd32
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/resources/META-INF/NOTICE
@@ -0,0 +1,28 @@
+Apache Tuscany SDO for Java
+Copyright 2006 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+Apache Tuscany is an effort undergoing incubation at The Apache Software Foundation (ASF),
+sponsored by the Apache Web Services PMC. Incubation is required of all newly accepted
+projects until a further review indicates that the infrastructure, communications,
+and decision making process have stabilized in a manner consistent with other successful
+ASF projects. While incubation status is not necessarily a reflection of the completeness
+or stability of the code, it does indicate that the project has yet to be fully endorsed
+by the ASF.
+
+Unless otherwise indicated, all distribution made available by the Apache Software Foundation
+is provided to you under the terms and conditions of the Apache License Version 2.0 ("AL").
+A copy of the AL is provided with this distribution as the LICENSE.txt file present in the
+root directory, and is also available at http://www.apache.org/licenses/.
+
+The terms and conditions governing the distribution may refer to the AL or other license
+agreements, notices or terms and conditions. Some of these other license agreements may
+include (but are not limited to):
+
+ . Eclipse Public License Version 1.0 (available at http://www.eclipse.org/legal/epl-v10.html)
+
+It is your obligation to read and accept all such terms and conditions prior to use of the
+distribution. If term or condition is provided, please contact the Apache Software Foundation
+to determine what terms and conditions govern that particular distribution.
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/resources/META-INF/README.txt b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/resources/META-INF/README.txt
new file mode 100644
index 0000000000..b53994461b
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/resources/META-INF/README.txt
@@ -0,0 +1,35 @@
+Apache Tuscany M3 build (March 2007)
+===================================
+
+http://incubator.apache.org/tuscany/
+
+Tuscany is an effort undergoing incubation at the Apache Software Foundation
+(ASF), sponsored by the Web Services PMC.
+
+Incubation is required of all newly accepted projects until a further review
+indicates that the infrastructure, communications, and decision making process
+have stabilized in a manner consistent with other successful ASF projects.
+
+While incubation status is not necessarily a reflection of the completeness or
+stability of the code, it does indicate that the project has yet to be fully
+endorsed by the ASF.
+
+
+Support
+-------
+
+Any problem with this release can be reported to the Tuscany mailing list
+or in the JIRA issue tracker.
+
+Mailing list subscription:
+ tuscany-dev-subscribe@ws.apache.org
+
+Jira:
+ http://issues.apache.org/jira/browse/Tuscany
+
+
+Thank you for using Tuscany!
+
+
+The Tuscany Team.
+
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/resources/META-INF/services/commonj.sdo.impl.HelperProvider b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/resources/META-INF/services/commonj.sdo.impl.HelperProvider
new file mode 100644
index 0000000000..73693d6556
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/resources/META-INF/services/commonj.sdo.impl.HelperProvider
@@ -0,0 +1 @@
+org.apache.tuscany.sdo.helper.HelperProviderImpl \ No newline at end of file
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/resources/sdo-metadata.xsd b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/resources/sdo-metadata.xsd
new file mode 100644
index 0000000000..6a5132ed56
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/resources/sdo-metadata.xsd
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ -->
+<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="org.apache.tuscany.sdo/metadata" xmlns:metadata="org.apache.tuscany.sdo/metadata">
+
+ <element name="sdoMetaDataGroup" type="metadata:SDOMetaDataGroup"/>
+
+ <complexType name="SDOMetaDataGroup">
+ <sequence>
+ <element name="javaMetaData" type="metadata:JavaMetaData" maxOccurs="unbounded" minOccurs="0"/>
+ <element name="xsdMetaData" type="metadata:XSDMetaData" maxOccurs="unbounded" minOccurs="0"/>
+ <element name="typeMetaData" type="metadata:TypeMetaData" maxOccurs="unbounded" minOccurs="0"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="JavaMetaData">
+ <attribute name="factoryInterface" type="string" use="optional"/>
+ <attribute name="typeInterface" type="string" use="optional"/>
+ </complexType>
+
+ <complexType name="XSDMetaData">
+ <attribute name="location" type="string" use="required"/>
+ </complexType>
+
+ <complexType name="TypeMetaData">
+ <attribute name="location" type="string" use="required"/>
+ </complexType>
+
+</schema>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/resources/xml/sdoModelChangeSummary.xsd b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/resources/xml/sdoModelChangeSummary.xsd
new file mode 100644
index 0000000000..645b7b700a
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/resources/xml/sdoModelChangeSummary.xsd
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ -->
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sdo="commonj.sdo" xmlns:sdoJava="commonj.sdo/java" targetNamespace="commonj.sdo">
+
+ <!-- Dummy XSD definition of special SDO ChangeSummaryType -->
+ <xsd:simpleType name="ChangeSummaryType" sdoJava:instanceClass="commonj.sdo.ChangeSummary">
+ <xsd:restriction base="xsd:string"/>
+ </xsd:simpleType>
+
+
+</xsd:schema>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/resources/xml/sdoModelExtended.xsd b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/resources/xml/sdoModelExtended.xsd
new file mode 100644
index 0000000000..7536fd84dc
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/main/resources/xml/sdoModelExtended.xsd
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ -->
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sdo="commonj.sdo" xmlns:sdoJava="commonj.sdo/java" xmlns:sdoXML="commonj.sdo/xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" elementFormDefault="qualified" targetNamespace="commonj.sdo" xsi:schemaLocation="commonj.sdo/xml sdoXML.xsd commonj.sdo/java sdoJava.xsd">
+
+<xsd:include schemaLocation="c:/sdosrc/tuscany/java/spec/sdo-api/src/main/resources/xml/sdoModel.xsd"/>
+
+<!-- Data Types -->
+<xsd:simpleType name="Base64Bytes" sdoJava:instanceClass="byte[]">
+ <xsd:restriction base="xsd:base64Binary"/>
+</xsd:simpleType>
+
+</xsd:schema>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/com/example/simple/Quote.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/com/example/simple/Quote.java
new file mode 100644
index 0000000000..48dcf96d64
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/com/example/simple/Quote.java
@@ -0,0 +1,475 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.simple;
+
+import java.io.Serializable;
+
+import java.math.BigDecimal;
+
+import java.util.List;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Quote</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link com.example.simple.Quote#getSymbol <em>Symbol</em>}</li>
+ * <li>{@link com.example.simple.Quote#getCompanyName <em>Company Name</em>}</li>
+ * <li>{@link com.example.simple.Quote#getPrice <em>Price</em>}</li>
+ * <li>{@link com.example.simple.Quote#getOpen1 <em>Open1</em>}</li>
+ * <li>{@link com.example.simple.Quote#getHigh <em>High</em>}</li>
+ * <li>{@link com.example.simple.Quote#getLow <em>Low</em>}</li>
+ * <li>{@link com.example.simple.Quote#getVolume <em>Volume</em>}</li>
+ * <li>{@link com.example.simple.Quote#getChange1 <em>Change1</em>}</li>
+ * <li>{@link com.example.simple.Quote#getQuotes <em>Quotes</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @extends Serializable
+ * @generated
+ */
+public interface Quote extends Serializable
+{
+ /**
+ * Returns the value of the '<em><b>Symbol</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Symbol</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Symbol</em>' attribute.
+ * @see #isSetSymbol()
+ * @see #unsetSymbol()
+ * @see #setSymbol(String)
+ * @generated
+ */
+ String getSymbol();
+
+ /**
+ * Sets the value of the '{@link com.example.simple.Quote#getSymbol <em>Symbol</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Symbol</em>' attribute.
+ * @see #isSetSymbol()
+ * @see #unsetSymbol()
+ * @see #getSymbol()
+ * @generated
+ */
+ void setSymbol(String value);
+
+ /**
+ * Unsets the value of the '{@link com.example.simple.Quote#getSymbol <em>Symbol</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetSymbol()
+ * @see #getSymbol()
+ * @see #setSymbol(String)
+ * @generated
+ */
+ void unsetSymbol();
+
+ /**
+ * Returns whether the value of the '{@link com.example.simple.Quote#getSymbol <em>Symbol</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Symbol</em>' attribute is set.
+ * @see #unsetSymbol()
+ * @see #getSymbol()
+ * @see #setSymbol(String)
+ * @generated
+ */
+ boolean isSetSymbol();
+
+ /**
+ * Returns the value of the '<em><b>Company Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Company Name</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Company Name</em>' attribute.
+ * @see #isSetCompanyName()
+ * @see #unsetCompanyName()
+ * @see #setCompanyName(String)
+ * @generated
+ */
+ String getCompanyName();
+
+ /**
+ * Sets the value of the '{@link com.example.simple.Quote#getCompanyName <em>Company Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Company Name</em>' attribute.
+ * @see #isSetCompanyName()
+ * @see #unsetCompanyName()
+ * @see #getCompanyName()
+ * @generated
+ */
+ void setCompanyName(String value);
+
+ /**
+ * Unsets the value of the '{@link com.example.simple.Quote#getCompanyName <em>Company Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetCompanyName()
+ * @see #getCompanyName()
+ * @see #setCompanyName(String)
+ * @generated
+ */
+ void unsetCompanyName();
+
+ /**
+ * Returns whether the value of the '{@link com.example.simple.Quote#getCompanyName <em>Company Name</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Company Name</em>' attribute is set.
+ * @see #unsetCompanyName()
+ * @see #getCompanyName()
+ * @see #setCompanyName(String)
+ * @generated
+ */
+ boolean isSetCompanyName();
+
+ /**
+ * Returns the value of the '<em><b>Price</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Price</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Price</em>' attribute.
+ * @see #isSetPrice()
+ * @see #unsetPrice()
+ * @see #setPrice(BigDecimal)
+ * @generated
+ */
+ BigDecimal getPrice();
+
+ /**
+ * Sets the value of the '{@link com.example.simple.Quote#getPrice <em>Price</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Price</em>' attribute.
+ * @see #isSetPrice()
+ * @see #unsetPrice()
+ * @see #getPrice()
+ * @generated
+ */
+ void setPrice(BigDecimal value);
+
+ /**
+ * Unsets the value of the '{@link com.example.simple.Quote#getPrice <em>Price</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetPrice()
+ * @see #getPrice()
+ * @see #setPrice(BigDecimal)
+ * @generated
+ */
+ void unsetPrice();
+
+ /**
+ * Returns whether the value of the '{@link com.example.simple.Quote#getPrice <em>Price</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Price</em>' attribute is set.
+ * @see #unsetPrice()
+ * @see #getPrice()
+ * @see #setPrice(BigDecimal)
+ * @generated
+ */
+ boolean isSetPrice();
+
+ /**
+ * Returns the value of the '<em><b>Open1</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Open1</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Open1</em>' attribute.
+ * @see #isSetOpen1()
+ * @see #unsetOpen1()
+ * @see #setOpen1(BigDecimal)
+ * @generated
+ */
+ BigDecimal getOpen1();
+
+ /**
+ * Sets the value of the '{@link com.example.simple.Quote#getOpen1 <em>Open1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Open1</em>' attribute.
+ * @see #isSetOpen1()
+ * @see #unsetOpen1()
+ * @see #getOpen1()
+ * @generated
+ */
+ void setOpen1(BigDecimal value);
+
+ /**
+ * Unsets the value of the '{@link com.example.simple.Quote#getOpen1 <em>Open1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetOpen1()
+ * @see #getOpen1()
+ * @see #setOpen1(BigDecimal)
+ * @generated
+ */
+ void unsetOpen1();
+
+ /**
+ * Returns whether the value of the '{@link com.example.simple.Quote#getOpen1 <em>Open1</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Open1</em>' attribute is set.
+ * @see #unsetOpen1()
+ * @see #getOpen1()
+ * @see #setOpen1(BigDecimal)
+ * @generated
+ */
+ boolean isSetOpen1();
+
+ /**
+ * Returns the value of the '<em><b>High</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>High</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>High</em>' attribute.
+ * @see #isSetHigh()
+ * @see #unsetHigh()
+ * @see #setHigh(BigDecimal)
+ * @generated
+ */
+ BigDecimal getHigh();
+
+ /**
+ * Sets the value of the '{@link com.example.simple.Quote#getHigh <em>High</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>High</em>' attribute.
+ * @see #isSetHigh()
+ * @see #unsetHigh()
+ * @see #getHigh()
+ * @generated
+ */
+ void setHigh(BigDecimal value);
+
+ /**
+ * Unsets the value of the '{@link com.example.simple.Quote#getHigh <em>High</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetHigh()
+ * @see #getHigh()
+ * @see #setHigh(BigDecimal)
+ * @generated
+ */
+ void unsetHigh();
+
+ /**
+ * Returns whether the value of the '{@link com.example.simple.Quote#getHigh <em>High</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>High</em>' attribute is set.
+ * @see #unsetHigh()
+ * @see #getHigh()
+ * @see #setHigh(BigDecimal)
+ * @generated
+ */
+ boolean isSetHigh();
+
+ /**
+ * Returns the value of the '<em><b>Low</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Low</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Low</em>' attribute.
+ * @see #isSetLow()
+ * @see #unsetLow()
+ * @see #setLow(BigDecimal)
+ * @generated
+ */
+ BigDecimal getLow();
+
+ /**
+ * Sets the value of the '{@link com.example.simple.Quote#getLow <em>Low</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Low</em>' attribute.
+ * @see #isSetLow()
+ * @see #unsetLow()
+ * @see #getLow()
+ * @generated
+ */
+ void setLow(BigDecimal value);
+
+ /**
+ * Unsets the value of the '{@link com.example.simple.Quote#getLow <em>Low</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetLow()
+ * @see #getLow()
+ * @see #setLow(BigDecimal)
+ * @generated
+ */
+ void unsetLow();
+
+ /**
+ * Returns whether the value of the '{@link com.example.simple.Quote#getLow <em>Low</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Low</em>' attribute is set.
+ * @see #unsetLow()
+ * @see #getLow()
+ * @see #setLow(BigDecimal)
+ * @generated
+ */
+ boolean isSetLow();
+
+ /**
+ * Returns the value of the '<em><b>Volume</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Volume</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Volume</em>' attribute.
+ * @see #isSetVolume()
+ * @see #unsetVolume()
+ * @see #setVolume(double)
+ * @generated
+ */
+ double getVolume();
+
+ /**
+ * Sets the value of the '{@link com.example.simple.Quote#getVolume <em>Volume</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Volume</em>' attribute.
+ * @see #isSetVolume()
+ * @see #unsetVolume()
+ * @see #getVolume()
+ * @generated
+ */
+ void setVolume(double value);
+
+ /**
+ * Unsets the value of the '{@link com.example.simple.Quote#getVolume <em>Volume</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetVolume()
+ * @see #getVolume()
+ * @see #setVolume(double)
+ * @generated
+ */
+ void unsetVolume();
+
+ /**
+ * Returns whether the value of the '{@link com.example.simple.Quote#getVolume <em>Volume</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Volume</em>' attribute is set.
+ * @see #unsetVolume()
+ * @see #getVolume()
+ * @see #setVolume(double)
+ * @generated
+ */
+ boolean isSetVolume();
+
+ /**
+ * Returns the value of the '<em><b>Change1</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Change1</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Change1</em>' attribute.
+ * @see #isSetChange1()
+ * @see #unsetChange1()
+ * @see #setChange1(double)
+ * @generated
+ */
+ double getChange1();
+
+ /**
+ * Sets the value of the '{@link com.example.simple.Quote#getChange1 <em>Change1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Change1</em>' attribute.
+ * @see #isSetChange1()
+ * @see #unsetChange1()
+ * @see #getChange1()
+ * @generated
+ */
+ void setChange1(double value);
+
+ /**
+ * Unsets the value of the '{@link com.example.simple.Quote#getChange1 <em>Change1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetChange1()
+ * @see #getChange1()
+ * @see #setChange1(double)
+ * @generated
+ */
+ void unsetChange1();
+
+ /**
+ * Returns whether the value of the '{@link com.example.simple.Quote#getChange1 <em>Change1</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Change1</em>' attribute is set.
+ * @see #unsetChange1()
+ * @see #getChange1()
+ * @see #setChange1(double)
+ * @generated
+ */
+ boolean isSetChange1();
+
+ /**
+ * Returns the value of the '<em><b>Quotes</b></em>' containment reference list.
+ * The list contents are of type {@link com.example.simple.Quote}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Quotes</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Quotes</em>' containment reference list.
+ * @generated
+ */
+ List getQuotes();
+
+} // Quote
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/com/example/simple/SimpleFactory.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/com/example/simple/SimpleFactory.java
new file mode 100644
index 0000000000..98dc01d69a
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/com/example/simple/SimpleFactory.java
@@ -0,0 +1,61 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.simple;
+
+import commonj.sdo.helper.HelperContext;
+
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Factory</b> for the model.
+ * It provides a create method for each non-abstract class of the model.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public interface SimpleFactory
+{
+
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ SimpleFactory INSTANCE = com.example.simple.impl.SimpleFactoryImpl.init();
+
+ /**
+ * Returns a new object of class '<em>Quote</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Quote</em>'.
+ * @generated
+ */
+ Quote createQuote();
+
+ /**
+ * Registers the types supported by this Factory within the supplied scope.argument
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param scope an instance of HelperContext used to manage the scoping of types.
+ * @generated
+ */
+ public void register(HelperContext scope);
+
+} //SimpleFactory
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/com/example/simple/impl/QuoteImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/com/example/simple/impl/QuoteImpl.java
new file mode 100644
index 0000000000..121f989538
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/com/example/simple/impl/QuoteImpl.java
@@ -0,0 +1,1045 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.simple.impl;
+
+import com.example.simple.Quote;
+import com.example.simple.SimpleFactory;
+
+import commonj.sdo.Type;
+
+import java.math.BigDecimal;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.tuscany.sdo.impl.DataObjectBase;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Quote</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link com.example.simple.impl.QuoteImpl#getSymbol <em>Symbol</em>}</li>
+ * <li>{@link com.example.simple.impl.QuoteImpl#getCompanyName <em>Company Name</em>}</li>
+ * <li>{@link com.example.simple.impl.QuoteImpl#getPrice <em>Price</em>}</li>
+ * <li>{@link com.example.simple.impl.QuoteImpl#getOpen1 <em>Open1</em>}</li>
+ * <li>{@link com.example.simple.impl.QuoteImpl#getHigh <em>High</em>}</li>
+ * <li>{@link com.example.simple.impl.QuoteImpl#getLow <em>Low</em>}</li>
+ * <li>{@link com.example.simple.impl.QuoteImpl#getVolume <em>Volume</em>}</li>
+ * <li>{@link com.example.simple.impl.QuoteImpl#getChange1 <em>Change1</em>}</li>
+ * <li>{@link com.example.simple.impl.QuoteImpl#getQuotes <em>Quotes</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class QuoteImpl extends DataObjectBase implements Quote
+{
+
+ public final static int SYMBOL = 0;
+
+ public final static int COMPANY_NAME = 1;
+
+ public final static int PRICE = 2;
+
+ public final static int OPEN1 = 3;
+
+ public final static int HIGH = 4;
+
+ public final static int LOW = 5;
+
+ public final static int VOLUME = 6;
+
+ public final static int CHANGE1 = 7;
+
+ public final static int QUOTES = 8;
+
+ public final static int SDO_PROPERTY_COUNT = 9;
+
+ public final static int EXTENDED_PROPERTY_COUNT = 0;
+
+
+ /**
+ * The internal feature id for the '<em><b>Symbol</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_SYMBOL = 0;
+
+ /**
+ * The internal feature id for the '<em><b>Company Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_COMPANY_NAME = 1;
+
+ /**
+ * The internal feature id for the '<em><b>Price</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_PRICE = 2;
+
+ /**
+ * The internal feature id for the '<em><b>Open1</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_OPEN1 = 3;
+
+ /**
+ * The internal feature id for the '<em><b>High</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_HIGH = 4;
+
+ /**
+ * The internal feature id for the '<em><b>Low</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_LOW = 5;
+
+ /**
+ * The internal feature id for the '<em><b>Volume</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_VOLUME = 6;
+
+ /**
+ * The internal feature id for the '<em><b>Change1</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_CHANGE1 = 7;
+
+ /**
+ * The internal feature id for the '<em><b>Quotes</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_QUOTES = 8;
+
+ /**
+ * The number of properties for this type.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_PROPERTY_COUNT = 9;
+
+ protected int internalConvertIndex(int internalIndex)
+ {
+ switch (internalIndex)
+ {
+ case INTERNAL_SYMBOL: return SYMBOL;
+ case INTERNAL_COMPANY_NAME: return COMPANY_NAME;
+ case INTERNAL_PRICE: return PRICE;
+ case INTERNAL_OPEN1: return OPEN1;
+ case INTERNAL_HIGH: return HIGH;
+ case INTERNAL_LOW: return LOW;
+ case INTERNAL_VOLUME: return VOLUME;
+ case INTERNAL_CHANGE1: return CHANGE1;
+ case INTERNAL_QUOTES: return QUOTES;
+ }
+ return super.internalConvertIndex(internalIndex);
+ }
+
+
+ /**
+ * The default value of the '{@link #getSymbol() <em>Symbol</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getSymbol()
+ * @generated
+ * @ordered
+ */
+ protected static final String SYMBOL_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getSymbol() <em>Symbol</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getSymbol()
+ * @generated
+ * @ordered
+ */
+ protected String symbol = SYMBOL_DEFAULT_;
+
+ /**
+ * This is true if the Symbol attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean symbol_set_ = false;
+
+ /**
+ * The default value of the '{@link #getCompanyName() <em>Company Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getCompanyName()
+ * @generated
+ * @ordered
+ */
+ protected static final String COMPANY_NAME_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getCompanyName() <em>Company Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getCompanyName()
+ * @generated
+ * @ordered
+ */
+ protected String companyName = COMPANY_NAME_DEFAULT_;
+
+ /**
+ * This is true if the Company Name attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean companyName_set_ = false;
+
+ /**
+ * The default value of the '{@link #getPrice() <em>Price</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getPrice()
+ * @generated
+ * @ordered
+ */
+ protected static final BigDecimal PRICE_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getPrice() <em>Price</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getPrice()
+ * @generated
+ * @ordered
+ */
+ protected BigDecimal price = PRICE_DEFAULT_;
+
+ /**
+ * This is true if the Price attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean price_set_ = false;
+
+ /**
+ * The default value of the '{@link #getOpen1() <em>Open1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getOpen1()
+ * @generated
+ * @ordered
+ */
+ protected static final BigDecimal OPEN1_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getOpen1() <em>Open1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getOpen1()
+ * @generated
+ * @ordered
+ */
+ protected BigDecimal open1 = OPEN1_DEFAULT_;
+
+ /**
+ * This is true if the Open1 attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean open1_set_ = false;
+
+ /**
+ * The default value of the '{@link #getHigh() <em>High</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getHigh()
+ * @generated
+ * @ordered
+ */
+ protected static final BigDecimal HIGH_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getHigh() <em>High</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getHigh()
+ * @generated
+ * @ordered
+ */
+ protected BigDecimal high = HIGH_DEFAULT_;
+
+ /**
+ * This is true if the High attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean high_set_ = false;
+
+ /**
+ * The default value of the '{@link #getLow() <em>Low</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getLow()
+ * @generated
+ * @ordered
+ */
+ protected static final BigDecimal LOW_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getLow() <em>Low</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getLow()
+ * @generated
+ * @ordered
+ */
+ protected BigDecimal low = LOW_DEFAULT_;
+
+ /**
+ * This is true if the Low attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean low_set_ = false;
+
+ /**
+ * The default value of the '{@link #getVolume() <em>Volume</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getVolume()
+ * @generated
+ * @ordered
+ */
+ protected static final double VOLUME_DEFAULT_ = 0.0;
+
+ /**
+ * The cached value of the '{@link #getVolume() <em>Volume</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getVolume()
+ * @generated
+ * @ordered
+ */
+ protected double volume = VOLUME_DEFAULT_;
+
+ /**
+ * This is true if the Volume attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean volume_set_ = false;
+
+ /**
+ * The default value of the '{@link #getChange1() <em>Change1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getChange1()
+ * @generated
+ * @ordered
+ */
+ protected static final double CHANGE1_DEFAULT_ = 0.0;
+
+ /**
+ * The cached value of the '{@link #getChange1() <em>Change1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getChange1()
+ * @generated
+ * @ordered
+ */
+ protected double change1 = CHANGE1_DEFAULT_;
+
+ /**
+ * This is true if the Change1 attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean change1_set_ = false;
+
+ /**
+ * The cached value of the '{@link #getQuotes() <em>Quotes</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getQuotes()
+ * @generated
+ * @ordered
+ */
+
+ protected List quotes = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public QuoteImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Type getType()
+ {
+ return ((SimpleFactoryImpl)SimpleFactory.INSTANCE).getQuote();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getSymbol()
+ {
+ return symbol;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setSymbol(String newSymbol)
+ {
+ String oldSymbol = symbol;
+ symbol = newSymbol;
+ boolean oldSymbol_set_ = symbol_set_;
+ symbol_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, SYMBOL, oldSymbol, symbol, !oldSymbol_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetSymbol()
+ {
+ String oldSymbol = symbol;
+ boolean oldSymbol_set_ = symbol_set_;
+ symbol = SYMBOL_DEFAULT_;
+ symbol_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, SYMBOL, oldSymbol, SYMBOL_DEFAULT_, oldSymbol_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetSymbol()
+ {
+ return symbol_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getCompanyName()
+ {
+ return companyName;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setCompanyName(String newCompanyName)
+ {
+ String oldCompanyName = companyName;
+ companyName = newCompanyName;
+ boolean oldCompanyName_set_ = companyName_set_;
+ companyName_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, COMPANY_NAME, oldCompanyName, companyName, !oldCompanyName_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetCompanyName()
+ {
+ String oldCompanyName = companyName;
+ boolean oldCompanyName_set_ = companyName_set_;
+ companyName = COMPANY_NAME_DEFAULT_;
+ companyName_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, COMPANY_NAME, oldCompanyName, COMPANY_NAME_DEFAULT_, oldCompanyName_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetCompanyName()
+ {
+ return companyName_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public BigDecimal getPrice()
+ {
+ return price;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setPrice(BigDecimal newPrice)
+ {
+ BigDecimal oldPrice = price;
+ price = newPrice;
+ boolean oldPrice_set_ = price_set_;
+ price_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, PRICE, oldPrice, price, !oldPrice_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetPrice()
+ {
+ BigDecimal oldPrice = price;
+ boolean oldPrice_set_ = price_set_;
+ price = PRICE_DEFAULT_;
+ price_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, PRICE, oldPrice, PRICE_DEFAULT_, oldPrice_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetPrice()
+ {
+ return price_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public BigDecimal getOpen1()
+ {
+ return open1;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setOpen1(BigDecimal newOpen1)
+ {
+ BigDecimal oldOpen1 = open1;
+ open1 = newOpen1;
+ boolean oldOpen1_set_ = open1_set_;
+ open1_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, OPEN1, oldOpen1, open1, !oldOpen1_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetOpen1()
+ {
+ BigDecimal oldOpen1 = open1;
+ boolean oldOpen1_set_ = open1_set_;
+ open1 = OPEN1_DEFAULT_;
+ open1_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, OPEN1, oldOpen1, OPEN1_DEFAULT_, oldOpen1_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetOpen1()
+ {
+ return open1_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public BigDecimal getHigh()
+ {
+ return high;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setHigh(BigDecimal newHigh)
+ {
+ BigDecimal oldHigh = high;
+ high = newHigh;
+ boolean oldHigh_set_ = high_set_;
+ high_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, HIGH, oldHigh, high, !oldHigh_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetHigh()
+ {
+ BigDecimal oldHigh = high;
+ boolean oldHigh_set_ = high_set_;
+ high = HIGH_DEFAULT_;
+ high_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, HIGH, oldHigh, HIGH_DEFAULT_, oldHigh_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetHigh()
+ {
+ return high_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public BigDecimal getLow()
+ {
+ return low;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setLow(BigDecimal newLow)
+ {
+ BigDecimal oldLow = low;
+ low = newLow;
+ boolean oldLow_set_ = low_set_;
+ low_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, LOW, oldLow, low, !oldLow_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetLow()
+ {
+ BigDecimal oldLow = low;
+ boolean oldLow_set_ = low_set_;
+ low = LOW_DEFAULT_;
+ low_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, LOW, oldLow, LOW_DEFAULT_, oldLow_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetLow()
+ {
+ return low_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public double getVolume()
+ {
+ return volume;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setVolume(double newVolume)
+ {
+ double oldVolume = volume;
+ volume = newVolume;
+ boolean oldVolume_set_ = volume_set_;
+ volume_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, VOLUME, oldVolume, volume, !oldVolume_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetVolume()
+ {
+ double oldVolume = volume;
+ boolean oldVolume_set_ = volume_set_;
+ volume = VOLUME_DEFAULT_;
+ volume_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, VOLUME, oldVolume, VOLUME_DEFAULT_, oldVolume_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetVolume()
+ {
+ return volume_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public double getChange1()
+ {
+ return change1;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setChange1(double newChange1)
+ {
+ double oldChange1 = change1;
+ change1 = newChange1;
+ boolean oldChange1_set_ = change1_set_;
+ change1_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, CHANGE1, oldChange1, change1, !oldChange1_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetChange1()
+ {
+ double oldChange1 = change1;
+ boolean oldChange1_set_ = change1_set_;
+ change1 = CHANGE1_DEFAULT_;
+ change1_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, CHANGE1, oldChange1, CHANGE1_DEFAULT_, oldChange1_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetChange1()
+ {
+ return change1_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public List getQuotes()
+ {
+ if (quotes == null)
+ {
+ quotes = createPropertyList(ListKind.CONTAINMENT, Quote.class, QUOTES);
+ }
+ return quotes;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeContext inverseRemove(Object otherEnd, int propertyIndex, ChangeContext changeContext)
+ {
+ switch (propertyIndex)
+ {
+ case QUOTES:
+ return removeFromList(getQuotes(), otherEnd, changeContext);
+ }
+ return super.inverseRemove(otherEnd, propertyIndex, changeContext);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object get(int propertyIndex, boolean resolve)
+ {
+ switch (propertyIndex)
+ {
+ case SYMBOL:
+ return getSymbol();
+ case COMPANY_NAME:
+ return getCompanyName();
+ case PRICE:
+ return getPrice();
+ case OPEN1:
+ return getOpen1();
+ case HIGH:
+ return getHigh();
+ case LOW:
+ return getLow();
+ case VOLUME:
+ return new Double(getVolume());
+ case CHANGE1:
+ return new Double(getChange1());
+ case QUOTES:
+ return getQuotes();
+ }
+ return super.get(propertyIndex, resolve);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void set(int propertyIndex, Object newValue)
+ {
+ switch (propertyIndex)
+ {
+ case SYMBOL:
+ setSymbol((String)newValue);
+ return;
+ case COMPANY_NAME:
+ setCompanyName((String)newValue);
+ return;
+ case PRICE:
+ setPrice((BigDecimal)newValue);
+ return;
+ case OPEN1:
+ setOpen1((BigDecimal)newValue);
+ return;
+ case HIGH:
+ setHigh((BigDecimal)newValue);
+ return;
+ case LOW:
+ setLow((BigDecimal)newValue);
+ return;
+ case VOLUME:
+ setVolume(((Double)newValue).doubleValue());
+ return;
+ case CHANGE1:
+ setChange1(((Double)newValue).doubleValue());
+ return;
+ case QUOTES:
+ getQuotes().clear();
+ getQuotes().addAll((Collection)newValue);
+ return;
+ }
+ super.set(propertyIndex, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unset(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case SYMBOL:
+ unsetSymbol();
+ return;
+ case COMPANY_NAME:
+ unsetCompanyName();
+ return;
+ case PRICE:
+ unsetPrice();
+ return;
+ case OPEN1:
+ unsetOpen1();
+ return;
+ case HIGH:
+ unsetHigh();
+ return;
+ case LOW:
+ unsetLow();
+ return;
+ case VOLUME:
+ unsetVolume();
+ return;
+ case CHANGE1:
+ unsetChange1();
+ return;
+ case QUOTES:
+ getQuotes().clear();
+ return;
+ }
+ super.unset(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSet(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case SYMBOL:
+ return isSetSymbol();
+ case COMPANY_NAME:
+ return isSetCompanyName();
+ case PRICE:
+ return isSetPrice();
+ case OPEN1:
+ return isSetOpen1();
+ case HIGH:
+ return isSetHigh();
+ case LOW:
+ return isSetLow();
+ case VOLUME:
+ return isSetVolume();
+ case CHANGE1:
+ return isSetChange1();
+ case QUOTES:
+ return quotes != null && !quotes.isEmpty();
+ }
+ return super.isSet(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString()
+ {
+ if (isProxy(this)) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (symbol: ");
+ if (symbol_set_) result.append(symbol); else result.append("<unset>");
+ result.append(", companyName: ");
+ if (companyName_set_) result.append(companyName); else result.append("<unset>");
+ result.append(", price: ");
+ if (price_set_) result.append(price); else result.append("<unset>");
+ result.append(", open1: ");
+ if (open1_set_) result.append(open1); else result.append("<unset>");
+ result.append(", high: ");
+ if (high_set_) result.append(high); else result.append("<unset>");
+ result.append(", low: ");
+ if (low_set_) result.append(low); else result.append("<unset>");
+ result.append(", volume: ");
+ if (volume_set_) result.append(volume); else result.append("<unset>");
+ result.append(", change1: ");
+ if (change1_set_) result.append(change1); else result.append("<unset>");
+ result.append(')');
+ return result.toString();
+ }
+
+} //QuoteImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/com/example/simple/impl/SimpleFactoryImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/com/example/simple/impl/SimpleFactoryImpl.java
new file mode 100644
index 0000000000..972babf6ab
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/com/example/simple/impl/SimpleFactoryImpl.java
@@ -0,0 +1,327 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.simple.impl;
+
+import commonj.sdo.helper.HelperContext;
+import org.apache.tuscany.sdo.helper.TypeHelperImpl;
+
+import com.example.simple.*;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+
+import org.apache.tuscany.sdo.SDOFactory;
+
+import org.apache.tuscany.sdo.impl.FactoryBase;
+
+import org.apache.tuscany.sdo.model.ModelFactory;
+
+import org.apache.tuscany.sdo.model.impl.ModelFactoryImpl;
+
+import org.apache.tuscany.sdo.util.SDOUtil;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Factory</b>.
+ * Generator information:
+ * patternVersion=1.1;
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class SimpleFactoryImpl extends FactoryBase implements SimpleFactory
+{
+
+ /**
+ * The package namespace URI.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String NAMESPACE_URI = "http://www.example.com/simple";
+
+ /**
+ * The package namespace name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String NAMESPACE_PREFIX = "simple";
+
+ /**
+ * The version of the generator pattern used to generate this class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String PATTERN_VERSION = "1.1";
+
+ public static final int QUOTE = 1;
+
+ /**
+ * Creates an instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public SimpleFactoryImpl()
+ {
+ super(NAMESPACE_URI, NAMESPACE_PREFIX, "com.example.simple");
+ }
+
+ /**
+ * Registers the Factory instance so that it is available within the supplied scope.
+ * @argument scope a HelperContext instance that will make the types supported by this Factory available.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void register(HelperContext scope) {
+ if(scope == null) {
+ throw new IllegalArgumentException("Scope can not be null");
+ }
+ TypeHelperImpl th = (TypeHelperImpl)scope.getTypeHelper();
+ th.getExtendedMetaData().putPackage(NAMESPACE_URI, this);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public DataObject create(int typeNumber)
+ {
+ switch (typeNumber)
+ {
+ case QUOTE: return (DataObject)createQuote();
+ default:
+ return super.create(typeNumber);
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Quote createQuote()
+ {
+ QuoteImpl quote = new QuoteImpl();
+ return quote;
+ }
+
+ // Following creates and initializes SDO metadata for the supported types.
+ protected Type quoteType = null;
+
+ public Type getQuote()
+ {
+ return quoteType;
+ }
+
+
+ private static boolean isInited = false;
+
+ public static SimpleFactoryImpl init()
+ {
+ if (isInited) return (SimpleFactoryImpl)FactoryBase.getStaticFactory(SimpleFactoryImpl.NAMESPACE_URI);
+ SimpleFactoryImpl theSimpleFactoryImpl = new SimpleFactoryImpl();
+ isInited = true;
+
+ // Initialize simple dependencies
+ SDOUtil.registerStaticTypes(SDOFactory.class);
+ SDOUtil.registerStaticTypes(ModelFactory.class);
+
+ // Create package meta-data objects
+ theSimpleFactoryImpl.createMetaData();
+
+ // Initialize created meta-data
+ theSimpleFactoryImpl.initializeMetaData();
+
+ // Mark meta-data to indicate it can't be changed
+ //theSimpleFactoryImpl.freeze(); //FB do we need to freeze / should we freeze ????
+
+ return theSimpleFactoryImpl;
+ }
+
+ private boolean isCreated = false;
+
+ public void createMetaData()
+ {
+ if (isCreated) return;
+ isCreated = true;
+
+ // Create types and their properties
+ quoteType = createType(false, QUOTE);
+ createProperty(true, quoteType,QuoteImpl.INTERNAL_SYMBOL);
+ createProperty(true, quoteType,QuoteImpl.INTERNAL_COMPANY_NAME);
+ createProperty(true, quoteType,QuoteImpl.INTERNAL_PRICE);
+ createProperty(true, quoteType,QuoteImpl.INTERNAL_OPEN1);
+ createProperty(true, quoteType,QuoteImpl.INTERNAL_HIGH);
+ createProperty(true, quoteType,QuoteImpl.INTERNAL_LOW);
+ createProperty(true, quoteType,QuoteImpl.INTERNAL_VOLUME);
+ createProperty(true, quoteType,QuoteImpl.INTERNAL_CHANGE1);
+ createProperty(false, quoteType,QuoteImpl.INTERNAL_QUOTES);
+ }
+
+ private boolean isInitialized = false;
+
+ public void initializeMetaData()
+ {
+ if (isInitialized) return;
+ isInitialized = true;
+
+ // Obtain other dependent packages
+ ModelFactoryImpl theModelPackageImpl = (ModelFactoryImpl)FactoryBase.getStaticFactory(ModelFactoryImpl.NAMESPACE_URI);
+ Property property = null;
+
+ // Add supertypes to types
+
+ // Initialize types and properties
+ initializeType(quoteType, Quote.class, "Quote", false);
+ property = getProperty(quoteType, QuoteImpl.INTERNAL_SYMBOL);
+ initializeProperty(property, theModelPackageImpl.getString(), "symbol", null, 1, 1, Quote.class, false, true, false);
+
+ property = getProperty(quoteType, QuoteImpl.INTERNAL_COMPANY_NAME);
+ initializeProperty(property, theModelPackageImpl.getString(), "companyName", null, 1, 1, Quote.class, false, true, false);
+
+ property = getProperty(quoteType, QuoteImpl.INTERNAL_PRICE);
+ initializeProperty(property, theModelPackageImpl.getDecimal(), "price", null, 1, 1, Quote.class, false, true, false);
+
+ property = getProperty(quoteType, QuoteImpl.INTERNAL_OPEN1);
+ initializeProperty(property, theModelPackageImpl.getDecimal(), "open1", null, 1, 1, Quote.class, false, true, false);
+
+ property = getProperty(quoteType, QuoteImpl.INTERNAL_HIGH);
+ initializeProperty(property, theModelPackageImpl.getDecimal(), "high", null, 1, 1, Quote.class, false, true, false);
+
+ property = getProperty(quoteType, QuoteImpl.INTERNAL_LOW);
+ initializeProperty(property, theModelPackageImpl.getDecimal(), "low", null, 1, 1, Quote.class, false, true, false);
+
+ property = getProperty(quoteType, QuoteImpl.INTERNAL_VOLUME);
+ initializeProperty(property, theModelPackageImpl.getDouble(), "volume", null, 1, 1, Quote.class, false, true, false);
+
+ property = getProperty(quoteType, QuoteImpl.INTERNAL_CHANGE1);
+ initializeProperty(property, theModelPackageImpl.getDouble(), "change1", null, 1, 1, Quote.class, false, true, false);
+
+ property = getProperty(quoteType, QuoteImpl.INTERNAL_QUOTES);
+ initializeProperty(property, this.getQuote(), "quotes", null, 0, -1, Quote.class, false, false, false, true , null);
+
+ createXSDMetaData(theModelPackageImpl);
+ }
+
+ protected void createXSDMetaData(ModelFactoryImpl theModelPackageImpl)
+ {
+ super.initXSD();
+
+ Property property = null;
+
+
+ property = createGlobalProperty
+ ("stockQuote",
+ this.getQuote(),
+ new String[]
+ {
+ "kind", "element",
+ "name", "stockQuote",
+ "namespace", "##targetNamespace"
+ });
+
+ addXSDMapping
+ (quoteType,
+ new String[]
+ {
+ "name", "Quote",
+ "kind", "elementOnly"
+ });
+
+ addXSDMapping
+ (getProperty(quoteType, QuoteImpl.INTERNAL_SYMBOL),
+ new String[]
+ {
+ "kind", "element",
+ "name", "symbol"
+ });
+
+ addXSDMapping
+ (getProperty(quoteType, QuoteImpl.INTERNAL_COMPANY_NAME),
+ new String[]
+ {
+ "kind", "element",
+ "name", "companyName"
+ });
+
+ addXSDMapping
+ (getProperty(quoteType, QuoteImpl.INTERNAL_PRICE),
+ new String[]
+ {
+ "kind", "element",
+ "name", "price"
+ });
+
+ addXSDMapping
+ (getProperty(quoteType, QuoteImpl.INTERNAL_OPEN1),
+ new String[]
+ {
+ "kind", "element",
+ "name", "open1"
+ });
+
+ addXSDMapping
+ (getProperty(quoteType, QuoteImpl.INTERNAL_HIGH),
+ new String[]
+ {
+ "kind", "element",
+ "name", "high"
+ });
+
+ addXSDMapping
+ (getProperty(quoteType, QuoteImpl.INTERNAL_LOW),
+ new String[]
+ {
+ "kind", "element",
+ "name", "low"
+ });
+
+ addXSDMapping
+ (getProperty(quoteType, QuoteImpl.INTERNAL_VOLUME),
+ new String[]
+ {
+ "kind", "element",
+ "name", "volume"
+ });
+
+ addXSDMapping
+ (getProperty(quoteType, QuoteImpl.INTERNAL_CHANGE1),
+ new String[]
+ {
+ "kind", "element",
+ "name", "change1"
+ });
+
+ addXSDMapping
+ (getProperty(quoteType, QuoteImpl.INTERNAL_QUOTES),
+ new String[]
+ {
+ "kind", "element",
+ "name", "quotes"
+ });
+
+ }
+
+} //SimpleFactoryImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/AllTests.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/AllTests.java
new file mode 100644
index 0000000000..7d91456137
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/AllTests.java
@@ -0,0 +1,41 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class AllTests {
+
+ public static Test suite() {
+
+ TestSuite suite = new TestSuite();
+
+ suite.addTest(org.apache.tuscany.sdo.codegen.AllTests.suite());
+ suite.addTest(org.apache.tuscany.sdo.test.AllTests.suite());
+
+ return suite;
+ }
+
+
+ public static void main(String[] args) {
+ junit.textui.TestRunner.run(suite());
+ }
+}
+
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/AllTests.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/AllTests.java
new file mode 100644
index 0000000000..d67b53fb7c
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/AllTests.java
@@ -0,0 +1,47 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sdo.codegen;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class AllTests {
+
+
+ public static TestSuite suite() {
+
+ TestSuite suite = new TestSuite();
+
+ suite.addTestSuite(BytecodeInterfaceGeneratorTestCase.class);
+ suite.addTestSuite(JavaInterfaceGeneratorTestCase.class);
+
+
+ return suite;
+ }
+
+
+ /**
+ * Runs the test suite using the textual runner.
+ */
+ public static void main(String[] args) {
+ junit.textui.TestRunner.run(suite());
+ }
+}
+
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/Bar1.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/Bar1.java
new file mode 100644
index 0000000000..4a51310cd0
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/Bar1.java
@@ -0,0 +1,26 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.codegen;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface Bar1 {
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/Bar2.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/Bar2.java
new file mode 100644
index 0000000000..e9151b9d46
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/Bar2.java
@@ -0,0 +1,26 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.codegen;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface Bar2 {
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/BytecodeInterfaceGeneratorTestCase.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/BytecodeInterfaceGeneratorTestCase.java
new file mode 100644
index 0000000000..218a725226
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/BytecodeInterfaceGeneratorTestCase.java
@@ -0,0 +1,167 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.codegen;
+
+import java.lang.reflect.Method;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class BytecodeInterfaceGeneratorTestCase extends TestCase {
+ private MockType foo;
+ private BytecodeInterfaceGenerator gen;
+ private TestClassLoader cl;
+
+ public void testHeaderNoBaseClass() {
+ gen.visitType(foo);
+ gen.visitEnd();
+ Class c = cl.addClass(gen.getClassData());
+ assertEquals("Foo", c.getName());
+ assertTrue(c.isInterface());
+ assertEquals(0, c.getInterfaces().length);
+ assertEquals(0, c.getMethods().length);
+ }
+
+ public void testHeaderWithPackage() {
+ gen.visitType(new MockType("org.apache.Foo", null));
+ gen.visitEnd();
+ Class c = cl.addClass(gen.getClassData());
+ assertEquals("org.apache.Foo", c.getName());
+ assertEquals(0, c.getInterfaces().length);
+ assertEquals(0, c.getMethods().length);
+ }
+
+ public void testHeaderOneBaseClass() throws NoJavaImplementationException {
+ foo.addBaseType(new MockType("bar1", Bar1.class));
+ gen.visitType(foo);
+ gen.visitEnd();
+ Class c = cl.addClass(gen.getClassData());
+ assertEquals("Foo", c.getName());
+ assertEquals(1, c.getInterfaces().length);
+ assertEquals(Bar1.class, c.getInterfaces()[0]);
+ assertEquals(0, c.getMethods().length);
+ }
+
+ public void testHeaderMultipleBaseClass() throws NoJavaImplementationException {
+ foo.addBaseType(new MockType("bar1", Bar1.class));
+ foo.addBaseType(new MockType("bar2", Bar2.class));
+ gen.visitType(foo);
+ gen.visitEnd();
+ Class c = cl.addClass(gen.getClassData());
+ assertEquals("Foo", c.getName());
+ assertEquals(2, c.getInterfaces().length);
+ assertEquals(Bar1.class, c.getInterfaces()[0]);
+ assertEquals(Bar2.class, c.getInterfaces()[1]);
+ assertEquals(0, c.getMethods().length);
+ }
+
+ public void testBooleanProperty() throws NoJavaImplementationException, NoSuchMethodException {
+ gen.visitType(foo);
+ gen.visitProperty(new MockProperty("true", Boolean.TYPE, false, false));
+ gen.visitEnd();
+ Class c = cl.addClass(gen.getClassData());
+ assertEquals(2, c.getMethods().length);
+ Method getter = c.getMethod("isTrue", new Class[0]);
+ assertEquals(boolean.class, getter.getReturnType());
+ Method setter = c.getMethod("setTrue", new Class[] {boolean.class});
+ assertEquals(void.class, setter.getReturnType());
+ }
+
+ public void testByteArrayProperty() throws NoJavaImplementationException, NoSuchMethodException {
+ gen.visitType(foo);
+ gen.visitProperty(new MockProperty("bytes", byte[].class, false, false));
+ gen.visitEnd();
+ Class c = cl.addClass(gen.getClassData());
+ assertEquals(2, c.getMethods().length);
+ Method getter = c.getMethod("getBytes", new Class[0]);
+ assertEquals(byte[].class, getter.getReturnType());
+ Method setter = c.getMethod("setBytes", new Class[] {byte[].class});
+ assertEquals(void.class, setter.getReturnType());
+ }
+
+ public void testObjectProperty() throws NoJavaImplementationException, NoSuchMethodException {
+ gen.visitType(foo);
+ gen.visitProperty(new MockProperty("bar", Bar1.class, false, false));
+ gen.visitEnd();
+ Class c = cl.addClass(gen.getClassData());
+ assertEquals(2, c.getMethods().length);
+ Method getter = c.getMethod("getBar", new Class[0]);
+ assertEquals(Bar1.class, getter.getReturnType());
+ Method setter = c.getMethod("setBar", new Class[] {Bar1.class});
+ assertEquals(void.class, setter.getReturnType());
+ }
+
+ public void testReadOnlyProperty() throws NoJavaImplementationException, NoSuchMethodException {
+ gen.visitType(foo);
+ gen.visitProperty(new MockProperty("int", Integer.TYPE, false, true));
+ gen.visitEnd();
+ Class c = cl.addClass(gen.getClassData());
+ assertEquals(1, c.getMethods().length);
+ Method getter = c.getMethod("getInt", new Class[0]);
+ assertEquals(int.class, getter.getReturnType());
+ }
+
+ public void testManyProperty() throws NoJavaImplementationException, NoSuchMethodException {
+ gen.visitType(foo);
+ gen.visitProperty(new MockProperty("list", Integer.TYPE, true, false));
+ gen.visitEnd();
+ Class c = cl.addClass(gen.getClassData());
+ assertEquals(1, c.getMethods().length);
+ Method getter = c.getMethod("getList", new Class[0]);
+ assertEquals(List.class, getter.getReturnType());
+ }
+
+ public void testTwoProperties() throws NoJavaImplementationException, NoSuchMethodException {
+ gen.visitType(foo);
+ gen.visitProperty(new MockProperty("true", Boolean.TYPE, false, false));
+ gen.visitProperty(new MockProperty("int", Integer.TYPE, false, false));
+ gen.visitEnd();
+ Class c = cl.addClass(gen.getClassData());
+ assertEquals(4, c.getMethods().length);
+ Method getter = c.getMethod("isTrue", new Class[0]);
+ assertEquals(boolean.class, getter.getReturnType());
+ Method setter = c.getMethod("setTrue", new Class[] {boolean.class});
+ assertEquals(void.class, setter.getReturnType());
+ getter = c.getMethod("getInt", new Class[0]);
+ assertEquals(int.class, getter.getReturnType());
+ setter = c.getMethod("setInt", new Class[] {int.class});
+ assertEquals(void.class, setter.getReturnType());
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ foo = new MockType("foo", null);
+ gen = new BytecodeInterfaceGenerator();
+ cl = new TestClassLoader();
+ }
+
+ private class TestClassLoader extends ClassLoader {
+ public TestClassLoader() {
+ super(TestClassLoader.class.getClassLoader());
+ }
+
+ Class addClass(byte[] bytes) {
+ return defineClass(null, bytes, 0, bytes.length);
+ }
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/Foo.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/Foo.java
new file mode 100644
index 0000000000..56bf6af9b4
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/Foo.java
@@ -0,0 +1,26 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.codegen;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface Foo {
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/JavaInterfaceGeneratorTestCase.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/JavaInterfaceGeneratorTestCase.java
new file mode 100644
index 0000000000..6cc0529c5f
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/JavaInterfaceGeneratorTestCase.java
@@ -0,0 +1,129 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.codegen;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
+import junit.framework.TestCase;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class JavaInterfaceGeneratorTestCase extends TestCase {
+ private static final String SEP = System.getProperty("line.separator");
+
+ private JavaInterfaceGenerator gen;
+ private StringWriter writer;
+ private MockType foo;
+
+ public void testHeaderNoBaseClass() {
+ gen.visitType(foo);
+ gen.visitEnd();
+ assertEquals(localize("public interface Foo {\n}\n"), writer.toString());
+ }
+
+ public void testHeaderWithPackage() {
+ gen.visitType(new MockType("org.apache.Foo", null));
+ gen.visitEnd();
+ assertEquals(localize("package org.apache;\n\npublic interface Foo {\n}\n"), writer.toString());
+ }
+
+ public void testHeaderOneBaseClass() throws NoJavaImplementationException {
+ foo.addBaseType(new MockType("bar1", Bar1.class));
+ gen.visitType(foo);
+ gen.visitEnd();
+ assertEquals(localize("public interface Foo extends org.apache.tuscany.sdo.codegen.Bar1 {\n}\n"), writer.toString());
+ }
+
+ public void testHeaderMultipleBaseClass() throws NoJavaImplementationException {
+ foo.addBaseType(new MockType("bar1", Bar1.class));
+ foo.addBaseType(new MockType("bar2", Bar2.class));
+ gen.visitType(foo);
+ gen.visitEnd();
+ assertEquals(localize("public interface Foo extends org.apache.tuscany.sdo.codegen.Bar1, org.apache.tuscany.sdo.codegen.Bar2 {\n}\n"), writer.toString());
+ }
+
+ public void testBooleanProperty() throws NoJavaImplementationException {
+ gen.visitType(foo);
+ gen.visitProperty(new MockProperty("true", Boolean.TYPE, false, false));
+ gen.visitEnd();
+ assertEquals(localize("public interface Foo {\n\tboolean isTrue();\n\tvoid setTrue(boolean value);\n}\n"), writer.toString());
+ }
+
+ public void testByteArrayProperty() throws NoJavaImplementationException {
+ gen.visitType(foo);
+ gen.visitProperty(new MockProperty("bytes", byte[].class, false, false));
+ gen.visitEnd();
+ assertEquals(localize("public interface Foo {\n\tbyte[] getBytes();\n\tvoid setBytes(byte[] value);\n}\n"), writer.toString());
+ }
+
+ public void testObjectProperty() throws NoJavaImplementationException {
+ gen.visitType(foo);
+ gen.visitProperty(new MockProperty("bar", Bar1.class, false, false));
+ gen.visitEnd();
+ assertEquals(localize("public interface Foo {\n\torg.apache.tuscany.sdo.codegen.Bar1 getBar();\n\tvoid setBar(org.apache.tuscany.sdo.codegen.Bar1 value);\n}\n"), writer.toString());
+ }
+
+ public void testReadOnlyProperty() throws NoJavaImplementationException {
+ gen.visitType(foo);
+ gen.visitProperty(new MockProperty("int", Integer.TYPE, false, true));
+ gen.visitEnd();
+ assertEquals(localize("public interface Foo {\n\tint getInt();\n}\n"), writer.toString());
+ }
+
+ public void testManyProperty() throws NoJavaImplementationException {
+ gen.visitType(foo);
+ gen.visitProperty(new MockProperty("list", Integer.TYPE, true, false));
+ gen.visitEnd();
+ assertEquals(localize("public interface Foo {\n\tjava.util.List getList();\n}\n"), writer.toString());
+ }
+
+ public void testTwoProperties() throws NoJavaImplementationException {
+ gen.visitType(foo);
+ gen.visitProperty(new MockProperty("true", Boolean.TYPE, false, false));
+ gen.visitProperty(new MockProperty("int", Integer.TYPE, false, false));
+ gen.visitEnd();
+ assertEquals(localize("public interface Foo {\n\tboolean isTrue();\n\tvoid setTrue(boolean value);\n\tint getInt();\n\tvoid setInt(int value);\n}\n"), writer.toString());
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ writer = new StringWriter();
+ gen = new JavaInterfaceGenerator(new PrintWriter(writer));
+ foo = new MockType("foo", null);
+ }
+
+ private String localize(String s) {
+ StringBuffer b = new StringBuffer(s.length() + s.length()/10);
+ for (int i = 0; i < s.length(); i++) {
+ char ch = s.charAt(i);
+ if (ch == '\t') {
+ b.append(" ");
+ } else if (ch == '\n') {
+ b.append(SEP);
+ } else {
+ b.append(ch);
+ }
+ }
+ return b.toString();
+ }
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/MockProperty.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/MockProperty.java
new file mode 100644
index 0000000000..3e3e87e47b
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/MockProperty.java
@@ -0,0 +1,94 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.codegen;
+
+import java.util.List;
+
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+
+/**
+ * @version $Rev$ $Date$
+ */
+class MockProperty implements Property {
+ private final String name;
+ private final Type type;
+ private final boolean many;
+ private final boolean readOnly;
+
+ public MockProperty(String name, Class type, boolean many, boolean readOnly) {
+ this.name = name;
+ this.type = new MockType(null, type);
+ this.many = many;
+ this.readOnly = readOnly;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public Type getType() {
+ return type;
+ }
+
+ public boolean isMany() {
+ return many;
+ }
+
+ public boolean isContainment() {
+ throw new UnsupportedOperationException();
+ }
+
+ public Type getContainingType() {
+ throw new UnsupportedOperationException();
+ }
+
+ public Object getDefault() {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean isReadOnly() {
+ return readOnly;
+ }
+
+ public Property getOpposite() {
+ throw new UnsupportedOperationException();
+ }
+
+ public List /*String*/ getAliasNames() {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean isNullable() {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean isOpenContent() {
+ throw new UnsupportedOperationException();
+ }
+
+ public List getInstanceProperties() {
+ throw new UnsupportedOperationException();
+ }
+
+ public Object get(Property property) {
+ throw new UnsupportedOperationException();
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/MockType.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/MockType.java
new file mode 100644
index 0000000000..ec848de4fa
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/codegen/MockType.java
@@ -0,0 +1,104 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.codegen;
+
+import java.util.List;
+import java.util.ArrayList;
+
+import commonj.sdo.Type;
+import commonj.sdo.Property;
+
+/**
+ * @version $Rev$ $Date$
+ */
+class MockType implements Type {
+ private final String name;
+ private final Class javaClass;
+ private final List baseTypes = new ArrayList();
+
+ public MockType(String name, Class javaClass) {
+ this.javaClass = javaClass;
+ this.name = name;
+ }
+
+ public void addBaseType(Type baseType) {
+ baseTypes.add(baseType);
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getURI() {
+ throw new UnsupportedOperationException();
+ }
+
+ public Class getInstanceClass() {
+ return javaClass;
+ }
+
+ public boolean isInstance(Object object) {
+ throw new UnsupportedOperationException();
+ }
+
+ public List /*Property*/ getProperties() {
+ throw new UnsupportedOperationException();
+ }
+
+ public Property getProperty(String propertyName) {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean isDataType() {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean isOpen() {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean isSequenced() {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean isAbstract() {
+ throw new UnsupportedOperationException();
+ }
+
+ public List /*Type*/ getBaseTypes() {
+ return baseTypes;
+ }
+
+ public List /*Property*/ getDeclaredProperties() {
+ throw new UnsupportedOperationException();
+ }
+
+ public List /*String*/ getAliasNames() {
+ throw new UnsupportedOperationException();
+ }
+
+ public List getInstanceProperties() {
+ throw new UnsupportedOperationException();
+ }
+
+ public Object get(Property property) {
+ throw new UnsupportedOperationException();
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/AllTests.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/AllTests.java
new file mode 100644
index 0000000000..963fc59e2a
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/AllTests.java
@@ -0,0 +1,75 @@
+
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sdo.test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+public class AllTests extends TestCase {
+
+
+ public static TestSuite suite() {
+
+ TestSuite suite = new TestSuite();
+
+ suite.addTestSuite(ChangeSummaryOnDataObjectTestCase.class);
+ suite.addTestSuite(ChangeSummaryPropertyTestCase.class);
+ suite.addTestSuite(ChangeSummaryTestCase.class);
+ suite.addTestSuite(CrossScopeCopyTestCase.class);
+ suite.addTestSuite(DataGraphTestCase.class);
+ suite.addTestSuite(DataTypeBaseTypeTestCase.class);
+ suite.addTestSuite(DateConversionTestCase.class);
+ suite.addTestSuite(DefineOpenContentPropertyTestCase.class);
+ suite.addTestSuite(DefineTypeTestCase.class);
+ suite.addTestSuite(FormTestCase.class);
+ suite.addTestSuite(HelperContextTestCase.class);
+ suite.addTestSuite(IsManyTestCase.class);
+ suite.addTestSuite(JavaSerializeDeserializeTestCase.class);
+ suite.addTestSuite(MixedTypeTestCase.class);
+ suite.addTestSuite(NeverStaleChangeSummaryTestCase.class);
+ suite.addTestSuite(OpenTypeTestCase.class);
+ suite.addTestSuite(SchemaLocationTestCase.class);
+ suite.addTestSuite(SerializeTypesTestCase.class);
+ suite.addTestSuite(SimpleCopyTestCase.class);
+ suite.addTestSuite(SimpleDynamicTestCase.class);
+ suite.addTestSuite(SimpleEqualityTestCase.class);
+ suite.addTestSuite(SubstitutionValuesTestCase.class);
+ suite.addTestSuite(TypeConversionTestCase.class);
+ suite.addTestSuite(TypeRoundTripTestCase.class);
+ suite.addTestSuite(XMLDocumentTestCase.class);
+ suite.addTestSuite(XMLHelperTestCase.class);
+ suite.addTestSuite(XMLStreamHelperTestCase.class);
+ suite.addTestSuite(XPathTestCase.class);
+ suite.addTestSuite(XSDHelperTestCase.class);
+
+ return suite;
+ }
+
+
+
+ /**
+ * Runs the test suite using the textual runner.
+ */
+ public static void main(String[] args) {
+ junit.textui.TestRunner.run(suite());
+ }
+}
+
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/AnyTypeTest.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/AnyTypeTest.java
new file mode 100644
index 0000000000..46cd2202b3
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/AnyTypeTest.java
@@ -0,0 +1,112 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.test;
+
+import java.io.InputStream;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.net.URL;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sdo.helper.XMLStreamHelper;
+import org.apache.tuscany.sdo.util.SDOUtil;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+import commonj.sdo.helper.DataFactory;
+import commonj.sdo.helper.HelperContext;
+import commonj.sdo.helper.TypeHelper;
+import commonj.sdo.helper.XMLDocument;
+import commonj.sdo.helper.XSDHelper;
+
+public class AnyTypeTest extends TestCase {
+ private static TypeHelper typeHelper;
+ private static DataFactory dataFactory;
+ private static XMLStreamHelper streamHelper;
+ private static XSDHelper xsdHelper;
+
+ private static final String TEST_MODEL = "/anytype.xsd";
+ private static final String TEST_NAMESPACE = "http://www.example.com/anytype";
+
+ public void testAnySimpleType() throws Exception {
+ Property property = typeHelper.getOpenContentProperty(TEST_NAMESPACE, "globalElement");
+ Type propertyType = property.getType();
+
+ DataObject dataObject = dataFactory.create(TEST_NAMESPACE, "Person");
+ dataObject.set("firstName", "Fuhwei");
+
+ DataObject rootObject = dataFactory.create(propertyType);
+ rootObject.set("anyTypeElement", dataObject);
+
+ dataObject = dataFactory.create(TEST_NAMESPACE, "Person");
+ dataObject.set("firstName", "Mindy");
+ rootObject.set("personElement", dataObject);
+
+ // XMLStreamHelper.saveObject has a problem to serialize the any type
+ XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
+ StringWriter writer = new StringWriter();
+ XMLStreamWriter streamWriter = outputFactory.createXMLStreamWriter(writer);
+ streamHelper.saveObject(rootObject, streamWriter);
+ streamWriter.flush();
+ // System.out.println(writer.toString());
+
+ XMLInputFactory inputFactory = XMLInputFactory.newInstance();
+ StringReader reader = new StringReader(writer.toString());
+ XMLStreamReader streamReader = inputFactory.createXMLStreamReader(reader);
+ XMLDocument doc = streamHelper.load(streamReader);
+ rootObject = doc.getRootObject();
+ DataObject testObject = rootObject.getDataObject("anyTypeElement");
+ // System.out.println("anyTypeElement dataobject: " + testObject);
+ testObject = rootObject.getDataObject("personElement");
+ // System.out.println("personElement dataobject: " + testObject);
+ }
+
+ public void testAbstractTypeFails() {
+ try {
+ DataObject abstractObj = dataFactory.create("commonj.sdo","DataObject");
+ assertTrue("Should not succeed", false);
+ }
+ catch ( IllegalArgumentException e) {
+ // expected result
+ }
+ }
+
+ protected void setUp() throws Exception {
+ HelperContext hc = SDOUtil.createHelperContext();
+ typeHelper = hc.getTypeHelper();
+ dataFactory = hc.getDataFactory();
+ xsdHelper = hc.getXSDHelper();
+ streamHelper = SDOUtil.createXMLStreamHelper(typeHelper);
+
+ // Populate the meta data for the test (Stock Quote) model
+ URL url = getClass().getResource(TEST_MODEL);
+ InputStream inputStream = url.openStream();
+ xsdHelper.define(inputStream, url.toString());
+ inputStream.close();
+ }
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/ChangeSummaryOnDataObjectTestCase.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/ChangeSummaryOnDataObjectTestCase.java
new file mode 100644
index 0000000000..384244eb18
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/ChangeSummaryOnDataObjectTestCase.java
@@ -0,0 +1,216 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.test;
+
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.math.BigDecimal;
+import java.net.URL;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sdo.util.SDOUtil;
+
+import commonj.sdo.ChangeSummary;
+import commonj.sdo.DataGraph;
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+import commonj.sdo.helper.HelperContext;
+import commonj.sdo.helper.TypeHelper;
+import commonj.sdo.helper.XSDHelper;
+
+
+public class ChangeSummaryOnDataObjectTestCase extends TestCase {
+
+
+ private final String TEST_DATA = "/simplechangesummary.xml";
+ HelperContext hc;
+ XSDHelper xh;
+ TypeHelper th;
+
+ public void testBasicsDO() {
+ Type cst = th.getType("commonj.sdo","ChangeSummaryType");
+ Type strt = th.getType("commonj.sdo", "String");
+
+ Type newt = SDOUtil.createType(th, "testcases.changesummary", "simpleCS", false);
+ Property strProp = SDOUtil.createProperty(newt, "strElem", strt);
+ SDOUtil.createProperty(newt, "changeSummary", cst);
+
+ DataObject iNewt = hc.getDataFactory().create(newt);
+
+ testBasicsBody(strProp, iNewt);
+}
+
+ public void testBasicsDG() {
+
+ Type strt = th.getType("commonj.sdo", "String");
+
+
+ Type newt = SDOUtil.createType(th, "testcases.changesummary", "simpleNOCS", false);
+ Property strProp = SDOUtil.createProperty(newt, "strElem", strt);
+
+ DataGraph graph = SDOUtil.createDataGraph();
+ DataObject iNewt = graph.createRootObject(newt);
+
+ testBasicsBody(strProp, iNewt);
+}
+
+
+ /**
+ * @param strProp
+ * @param iNewt
+ */
+ private void testBasicsBody(Property strProp, DataObject iNewt) {
+ ChangeSummary cs = iNewt.getChangeSummary();
+ cs.beginLogging();
+
+ List co = cs.getChangedDataObjects();
+ assertEquals(0, co.size());
+ iNewt.set(strProp, "some text");
+ assertEquals(0, co.size());
+ co = cs.getChangedDataObjects();
+ assertEquals(1, co.size());
+
+ List oldValues = cs.getOldValues((DataObject)co.get(0));
+
+ ChangeSummary.Setting ov1 = (ChangeSummary.Setting)oldValues.get(0);
+ Property p = ov1.getProperty();
+ assertEquals("strElem", p.getName());
+ Object v = ov1.getValue();
+ assertEquals(null, v);
+
+ assertTrue(cs.isLogging());
+ cs.endLogging();
+ assertFalse(cs.isLogging());
+
+ }
+
+
+
+ public void testDynamicNestedDataObjectsDG() throws Exception {
+ DataGraph dataGraph = SDOUtil.createDataGraph();
+ DataObject quote = dataGraph.createRootObject(th.getType("http://www.example.com/simple", "Quote"));
+
+ testDynamicNestedDOBody(quote);
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ SDOUtil.saveDataGraph(dataGraph, baos, null);
+ // SDOUtil.saveDataGraph(dataGraph, System.out, null);
+
+ assertTrue(TestUtil.equalXmlFiles(new ByteArrayInputStream(baos.toByteArray()), getClass().getResource(TEST_DATA)));
+
+
+ assertEquals(1, quote.getList("quotes").size());
+ assertEquals("fbnt", quote.getString("symbol"));
+ dataGraph.getChangeSummary().undoChanges();
+ // SDOUtil.saveDataGraph(dataGraph, System.out, null);
+ assertEquals(0, quote.getList("quotes").size());
+ assertNull(quote.getString("symbol"));
+
+
+ }
+
+ public void testDynamicNestedDataObjectsDO() throws Exception {
+ Type quoteType = th.getType("http://www.example.com/simpleCS", "RootQuote");
+ DataObject quote = hc.getDataFactory().create(quoteType);
+
+ testDynamicNestedDOBody(quote);
+ //hc.getXMLHelper().save(quote, "http://www.example.com/simpleCS", "stockQuote", System.out);
+ assertEquals(1, quote.getList("quotes").size());
+ assertEquals("fbnt", quote.getString("symbol"));
+
+ quote.getChangeSummary().undoChanges();
+
+ assertEquals(0, quote.getList("quotes").size());
+ assertNull(quote.getString("symbol"));
+
+
+
+ }
+
+ /**
+ * @param quote
+ */
+ private void testDynamicNestedDOBody(DataObject quote) {
+ // Begin logging changes
+ //
+ ChangeSummary changeSummary = quote.getChangeSummary();
+ assertNotNull(changeSummary);
+ assertFalse(changeSummary.isLogging());
+ changeSummary.beginLogging();
+
+
+ // Modify the data graph in various fun and interesting ways
+ //
+ quote.setString("symbol", "fbnt");
+ quote.setString("companyName", "FlyByNightTechnology");
+ quote.setBigDecimal("price", new BigDecimal("1000.0"));
+ quote.setBigDecimal("open1", new BigDecimal("1000.0"));
+ quote.setBigDecimal("high", new BigDecimal("1000.0"));
+ quote.setBigDecimal("low", new BigDecimal("1000.0"));
+ quote.setDouble("volume", 1000);
+ quote.setDouble("change1", 1000);
+
+ DataObject child = quote.createDataObject("quotes");
+ child.setBigDecimal("price", new BigDecimal("2000.0"));
+
+ changeSummary.endLogging();
+ assertEquals(2, changeSummary.getChangedDataObjects().size()); // 2 DataObjects
+ assertTrue(changeSummary.getChangedDataObjects().contains(quote));
+ assertTrue(changeSummary.getChangedDataObjects().contains(child));
+ assertFalse(changeSummary.isCreated(quote));
+ assertTrue(changeSummary.isCreated(child));
+
+ ChangeSummary.Setting ov = changeSummary.getOldValue(quote, quote.getType().getProperty("symbol"));
+ assertNull(ov.getValue());
+
+
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+// uncomment these lines for sending aspect trace to a file
+// tracing.lib.TraceMyClasses tmc = (TraceMyClasses)Aspects.aspectOf(TraceMyClasses.class);
+// tmc.initStream(new PrintStream("c:\\temp\\trace.log"));
+
+ // Populate the meta data for the test (Stock Quote) model
+ URL url = getClass().getResource("/simple.xsd");
+ InputStream inputStream = url.openStream();
+ hc = SDOUtil.createHelperContext();
+ th = hc.getTypeHelper();
+ xh = hc.getXSDHelper();
+ xh.define(inputStream, url.toString());
+ inputStream.close();
+
+ URL url2 = getClass().getResource("/simpleWithChangeSummary.xsd");
+ InputStream inputStream2 = url2.openStream();
+ xh.define(inputStream2, url2.toString());
+ inputStream.close();
+
+
+
+}
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/ChangeSummaryPropertyTestCase.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/ChangeSummaryPropertyTestCase.java
new file mode 100644
index 0000000000..4a62ec6135
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/ChangeSummaryPropertyTestCase.java
@@ -0,0 +1,219 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.test;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.math.BigDecimal;
+import java.net.URL;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sdo.util.SDOUtil;
+
+import commonj.sdo.ChangeSummary;
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
+import commonj.sdo.Sequence;
+import commonj.sdo.Type;
+import commonj.sdo.helper.DataFactory;
+import commonj.sdo.helper.HelperContext;
+import commonj.sdo.helper.XMLHelper;
+import commonj.sdo.helper.XSDHelper;
+
+public class ChangeSummaryPropertyTestCase extends TestCase {
+ private final String TEST_MODEL = "/simpleWithChangeSummary.xsd";
+ private final String TEST_NAMESPACE = "http://www.example.com/simpleCS";
+
+ private final String TEST_DATA_BEFORE_UNDO = "/simpleWithChangeSummary.xml";
+ private final String TEST_DATA_AFTER_UNDO = "/simpleWithChangeSummaryUndone.xml";
+
+ HelperContext hc;
+ DataFactory dataFactory;
+ XMLHelper xmlHelper;
+
+ void verify(ChangeSummary cs, DataObject quote, String nameSpace, String element, String beforeUndo, String afterUndo) throws IOException {
+ // Stop logging changes and serialize the resulting data graph
+ //
+ cs.endLogging();
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ xmlHelper.save(quote, nameSpace, element, baos);
+ //xmlHelper.save(quote, nameSpace, element, System.out);
+
+ byte[] bytes = baos.toByteArray();
+ URL url = getClass().getResource(beforeUndo);
+ assertTrue(TestUtil.equalXmlFiles(new ByteArrayInputStream(bytes), url));
+
+ DataObject loaded = xmlHelper.load(new ByteArrayInputStream(bytes)).getRootObject();
+ baos.reset();
+ xmlHelper.save(loaded, nameSpace, element, baos);
+ //xmlHelper.save(loaded, nameSpace, element, System.out);
+ assertTrue(TestUtil.equalXmlFiles(new ByteArrayInputStream(baos.toByteArray()), url));
+
+ // Undo all changes and then serialize the resulting data graph again
+ //
+ cs.undoChanges();
+
+ baos.reset();
+ xmlHelper.save(quote, nameSpace, element, baos);
+ //xmlHelper.save(quote, nameSpace, element, System.out);
+
+ assertTrue(TestUtil.equalXmlFiles(new ByteArrayInputStream(baos.toByteArray()), getClass().getResource(afterUndo)));
+ }
+
+ /**
+ * ChangeSummary property test.
+ */
+ protected final void change(String nameSpace, String beforeUndo, String afterUndo) throws Exception {
+ Type quoteType = hc.getTypeHelper().getType(nameSpace, "RootQuote");
+ DataObject quote = dataFactory.create(quoteType);
+
+ ChangeSummary cs = quote.getChangeSummary();
+ ChangeSummary csp = (ChangeSummary)quote.get("changes");
+
+ assertSame(cs, csp);
+
+ quote.setString("symbol", "fbnt");
+ quote.setString("companyName", "FlyByNightTechnology");
+ quote.setBigDecimal("price", new BigDecimal("1000.0"));
+ DataObject child = quote.createDataObject("quotes");
+ child.setBigDecimal("price", new BigDecimal("1500.0"));
+ child = quote.createDataObject("quotes");
+ child.setBigDecimal("price", new BigDecimal("2000.0"));
+ child = child.createDataObject("quotes");
+ child.setBigDecimal("price", new BigDecimal("2000.99"));
+ child = quote.createDataObject("quotes");
+ child.setBigDecimal("price", new BigDecimal("2500.0"));
+
+ // Begin logging changes
+ //
+ cs.beginLogging();
+
+ // Modify the data graph in various ways
+ //
+ quote.setString("symbol", "FBNT");
+ quote.setBigDecimal("price", new BigDecimal("999.0"));
+ quote.setDouble("volume", 1000);
+
+ child = quote.createDataObject("quotes");
+ child.setBigDecimal("price", new BigDecimal("3000.0"));
+ child = quote.createDataObject("quotes");
+ child.setBigDecimal("price", new BigDecimal("4000.0"));
+
+ quote.getDataObject("quotes[2]").delete();
+
+ verify(cs, quote, nameSpace, "stockQuote", beforeUndo, afterUndo);
+ }
+
+ /**
+ * Simple ChangeSummary property test.
+ */
+ public void testChangeSummary() throws Exception {
+ change(TEST_NAMESPACE, TEST_DATA_BEFORE_UNDO, TEST_DATA_AFTER_UNDO);
+ }
+
+ static final String SequenceTest_NameSpace = "http://www.example.com/sequenceCS";
+
+ /**
+ * Mixed ChangeSummary property test.
+ */
+ public void testMixedChangeSummary() throws Exception {
+ change(SequenceTest_NameSpace, "/mixedChangeSummary.xml", "/mixedChangeSummaryUndone.xml");
+ }
+
+ protected final DataObject createDataObject(Type quoteType, Object value, Sequence sequence, Property property) {
+ DataObject child = dataFactory.create(quoteType);
+ child.set("symbol", value);
+ sequence.add(property, child);
+ return child;
+ }
+
+ static final String SequenceTest_ELEMENT = "openQuote";
+
+ private XSDHelper xsdHelper;
+
+ /**
+ * Open/any ChangeSummary property test.
+ */
+ public void testOpenChangeSummary() throws Exception {
+ DataObject quote = dataFactory.create(xsdHelper.getGlobalProperty(SequenceTest_NameSpace, SequenceTest_ELEMENT, true).getType());
+
+ ChangeSummary cs = quote.getChangeSummary();
+ ChangeSummary csp = (ChangeSummary)quote.get("changes");
+
+ assertSame(cs, csp);
+
+ quote.set("symbol", "fbnt");
+ Property property = xsdHelper.getGlobalProperty("http://www.example.com/open", "openStockQuote", true);
+ Type quoteType = property.getType();
+ List openStockQuotes = ((DataObject)quote).getList(property);
+
+ addQuote(openStockQuotes, quoteType, "1500.0");
+ DataObject osq2 = addQuote(openStockQuotes, quoteType, "2000.0");
+ addQuote(osq2.getList(property), quoteType, "2000.99");
+ addQuote(openStockQuotes, quoteType, "2500.0");
+
+ // Begin logging changes
+ //
+ cs.beginLogging();
+
+ // Modify the data graph in various ways
+ //
+ quote.set("symbol", "FBNT");
+
+ addQuote(openStockQuotes, quoteType, "3000.0");
+ addQuote(openStockQuotes, quoteType, "4000.0");
+
+ openStockQuotes.remove(osq2);
+
+
+ verify(cs, quote, SequenceTest_NameSpace, SequenceTest_ELEMENT, "/openChangeSummary.xml", "/openChangeSummaryUndone.xml");
+ }
+
+ private DataObject addQuote(List openStockQuotes, Type quoteType,
+ Object value) {
+ DataObject osq = dataFactory.create(quoteType);
+ osq.set("symbol", value);
+ openStockQuotes.add(osq);
+ return osq;
+ }
+
+ void define(String model) throws Exception {
+ // Populate the meta data for the test model
+ URL url = getClass().getResource(model);
+ xsdHelper.define(url.openStream(), url.toString());
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ hc = SDOUtil.createHelperContext();
+ xsdHelper = hc.getXSDHelper();
+ dataFactory = hc.getDataFactory();
+ xmlHelper = hc.getXMLHelper();
+
+ // Populate the meta data for the test (Stock Quote) model
+ define(TEST_MODEL);
+
+ define("/SequenceChangeSummary.xsd");
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/ChangeSummaryTestCase.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/ChangeSummaryTestCase.java
new file mode 100644
index 0000000000..e956720117
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/ChangeSummaryTestCase.java
@@ -0,0 +1,92 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.test;
+
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.math.BigDecimal;
+import java.net.URL;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sdo.util.SDOUtil;
+
+import commonj.sdo.ChangeSummary;
+import commonj.sdo.DataGraph;
+import commonj.sdo.DataObject;
+import commonj.sdo.helper.XSDHelper;
+
+
+public class ChangeSummaryTestCase extends TestCase {
+ private final String TEST_MODEL = "/simple.xsd";
+ private final String TEST_DATA = "/simplechangesummary.xml";
+
+ /**
+ * Simple ChangeSummary test.
+ */
+ public void testChangeSummary() throws IOException {
+ // Create an empty data graph and add a root object, an instance of type Quote
+ //
+
+ DataGraph dataGraph = SDOUtil.createDataGraph();
+ DataObject quote = dataGraph.createRootObject("http://www.example.com/simple", "Quote");
+
+ // Begin logging changes
+ //
+ ChangeSummary changeSummary = dataGraph.getChangeSummary();
+ changeSummary.beginLogging();
+
+ // Modify the data graph in various fun and interesting ways
+ //
+ quote.setString("symbol", "fbnt");
+ quote.setString("companyName", "FlyByNightTechnology");
+ quote.setBigDecimal("price", new BigDecimal("1000.0"));
+ quote.setBigDecimal("open1", new BigDecimal("1000.0"));
+ quote.setBigDecimal("high", new BigDecimal("1000.0"));
+ quote.setBigDecimal("low", new BigDecimal("1000.0"));
+ quote.setDouble("volume", 1000);
+ quote.setDouble("change1", 1000);
+
+ DataObject child = quote.createDataObject("quotes");
+ child.setBigDecimal("price", new BigDecimal("2000.0"));
+
+ // Stop logging changes and print the resulting data graph to stdout
+ //
+ changeSummary.endLogging();
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ SDOUtil.saveDataGraph(dataGraph, baos, null);
+
+ assertTrue(TestUtil.equalXmlFiles(new ByteArrayInputStream(baos.toByteArray()), getClass().getResource(TEST_DATA)));
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ // Populate the meta data for the test (Stock Quote) model
+ URL url = getClass().getResource(TEST_MODEL);
+ InputStream inputStream = url.openStream();
+ XSDHelper.INSTANCE.define(inputStream, url.toString());
+ inputStream.close();
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/CrossScopeCopyTestCase.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/CrossScopeCopyTestCase.java
new file mode 100644
index 0000000000..2ec7e1b389
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/CrossScopeCopyTestCase.java
@@ -0,0 +1,474 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.test;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.math.BigDecimal;
+import java.net.URL;
+import java.util.Iterator;
+import java.util.Vector;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sdo.util.SDOUtil;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+import commonj.sdo.helper.CopyHelper;
+import commonj.sdo.helper.DataFactory;
+import commonj.sdo.helper.HelperContext;
+import commonj.sdo.helper.TypeHelper;
+
+public class CrossScopeCopyTestCase extends TestCase
+{
+ // Literals
+ private static final String TEST_NAMESPACE = "http://www.example.com/bank";
+ private static final String BANK_MODEL = "/bank.xsd";
+ private static final String BANK_TYPE = "bankType";
+ private static final String BRANCH_TYPE = "branchType";
+ private static final String SERVICE_TYPE = "serviceType";
+ private static final String ACCOUNT_TYPE = "accountType";
+ private static final String CUSTOMER_TYPE = "customerType";
+ private static final String ADDRESS_TYPE = "addressType";
+ private static final String DYNAMIC_TYPE = "dynamicType";
+
+ // SDO model objects
+ private HelperContext hca;
+ private HelperContext hcb;
+ private TypeHelper scopeA;
+ private TypeHelper scopeB;
+
+ // SDO instance objects
+ private DataObject bankSDO;
+ private DataObject branchSDO1;
+ private DataObject branchSDO2;
+ private DataObject serviceSDO1;
+ private DataObject serviceSDO2;
+ private DataObject serviceSDO3;
+ private DataObject customerSDO1;
+ private DataObject customerSDO2;
+ private DataObject customerSDO3;
+ private DataObject customerSDO4;
+
+ private int indent = 0;
+
+ public void testCrossScopeCopy() throws IOException
+ {
+ CopyHelper copyHelperB = SDOUtil.createCrossScopeCopyHelper(scopeB);
+
+ // Perform Shallow Copy Test
+ DataObject copiedSDO = copyHelperB.copyShallow(bankSDO);
+ shallowCopyAssertions(bankSDO, copiedSDO);
+
+ // Perform Deep Copy Test
+ copiedSDO = copyHelperB.copy(bankSDO);
+ deepCopyAssertions(bankSDO, copiedSDO);
+
+ // Inter-Reference Copy
+ copiedSDO = copyHelperB.copy(customerSDO1);
+ DataObject prop = (DataObject)copiedSDO.get("HomeBranch");
+ assertTrue(prop==null);
+
+ // Perform invalid namespace test
+ DataObject sdo = hca.getDataFactory().create(TEST_NAMESPACE, DYNAMIC_TYPE );
+ sdo.set("custNum", "099" );
+ sdo.set("firstName", "John");
+ sdo.set("lastName", "Doe");
+ boolean failed = false;
+ try
+ {
+ // In this case, we are copying an object to a scope
+ // where the object's type has not been defined. That
+ // will generate a null pointer exception what we will
+ // catch.
+ copyHelperB.copy(sdo);
+ }
+ catch(java.lang.NullPointerException ex)
+ {
+ failed = true;
+ }
+ assertTrue(failed);
+ }
+
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+
+ // Create Two Scopes
+ hca = SDOUtil.createHelperContext();
+ hcb = SDOUtil.createHelperContext();
+ scopeA = hca.getTypeHelper();
+ scopeB = hcb.getTypeHelper();
+
+ // Populate scopes with bank model now
+ URL url = getClass().getResource(BANK_MODEL);
+ InputStream inputStream = url.openStream();
+ hca.getXSDHelper().define(inputStream, url.toString());
+ inputStream.close();
+ inputStream = url.openStream();
+ hcb.getXSDHelper().define(inputStream, url.toString());
+ inputStream.close();
+
+ // Now Populate scopeA with some dynamic models
+ populateScopeWithDynamicTypes(scopeA);
+
+ // Construct Source Tree
+ constructSourceTree(hca.getDataFactory());
+ }
+
+ private void shallowCopyAssertions(DataObject sdo, DataObject copiedSdo)
+ {
+ assertEquals(sdo.getType().getName(), copiedSdo.getType().getName());
+ assertEquals(sdo.getType().getURI(), copiedSdo.getType().getURI());
+ assertNotSame(sdo.getType(), copiedSdo.getType());
+ assertEquals(sdo.getInstanceProperties().size(), copiedSdo
+ .getInstanceProperties().size());
+
+ for(Iterator it = sdo.getInstanceProperties().iterator(), it2 = copiedSdo
+ .getInstanceProperties().iterator(); it.hasNext();)
+ {
+ Property p1 = (Property) it.next(), p2 = (Property) it2.next();
+ assertEquals(p1.getName(), p2.getName());
+ Object o1 = sdo.get(p1), o2 = copiedSdo.get(p2);
+ if(p1.getType().isDataType())
+ {
+ assertEquals(o1, o2);
+ // TODO is there a way I can distinguish between mutable and
+ // immutable types
+ // so that I can do some "same object" tests
+ }
+ else
+ {
+ assertNotSame(p1, p2);
+ if(p2.isMany())
+ {
+ assertEquals(copiedSdo.getList(p2).size(), 0);
+ }
+ else
+ {
+ assertNull(copiedSdo.get(p2));
+ }
+ }
+ try
+ {
+ sdo.get(p2);
+ assertTrue(false);
+ }
+ catch(Exception e)
+ {
+ // expected route
+ }
+ try
+ {
+ copiedSdo.get(p1);
+ assertTrue(false);
+ }
+ catch(Exception e2)
+ {
+ // expected route
+ }
+ }
+ }
+
+ private void deepCopyAssertions(DataObject sdo, DataObject copiedSdo)
+ {
+ //indent();
+
+ //System.out.println("checking objects of types: "
+ // + sdo.getType().getName() + ", "
+ // + copiedSdo.getType().getName());
+ indent++;
+
+ assertEquals(sdo.getType().getName(), copiedSdo.getType().getName());
+ assertEquals(sdo.getType().getURI(), copiedSdo.getType().getURI());
+ assertNotSame(sdo.getType(), copiedSdo.getType());
+ assertEquals(sdo.getInstanceProperties().size(), copiedSdo
+ .getInstanceProperties().size());
+
+ for(Iterator it = sdo.getInstanceProperties().iterator(), it2 = copiedSdo
+ .getInstanceProperties().iterator(); it.hasNext();)
+ {
+ Property p1 = (Property) it.next(), p2 = (Property) it2.next();
+ assertEquals(p1.getName(), p2.getName());
+ Object o1 = sdo.get(p1), o2 = copiedSdo.get(p2);
+ if(p1.getType().isDataType())
+ {
+ assertEquals(o1, o2);
+ // TODO is there a way I can distinguish between mutable and
+ // immutable types
+ // so that I can do some "same object" tests
+ }
+ else
+ {
+ assertNotSame(p1, p2);
+ if(p2.isMany())
+ {
+ assertEquals(sdo.getList(p1).size(), copiedSdo.getList(p2)
+ .size());
+ for(Iterator it3 = sdo.getList(p1).iterator(), it4 = copiedSdo
+ .getList(p2).iterator(); it3.hasNext();)
+ {
+ deepCopyAssertions((DataObject) it3.next(),
+ (DataObject) it4.next());
+ }
+ }
+ else
+ {
+ deepCopyAssertions(sdo.getDataObject(p1), copiedSdo
+ .getDataObject(p2));
+ }
+ }
+ try
+ {
+ sdo.get(p2);
+ assertTrue(false);
+ }
+ catch(Exception e)
+ {
+ // expected route
+ }
+ try
+ {
+ copiedSdo.get(p1);
+ assertTrue(false);
+ }
+ catch(Exception e2)
+ {
+ // expected route
+ }
+ }
+
+ indent--;
+ }
+
+ /*
+ private void indent()
+ {
+ for(int i=0; i <indent; i++) System.out.print(" ");
+ }
+ */
+
+ protected void constructSourceTree(DataFactory df)
+ {
+ // Create Instances
+ bankSDO = df.create(TEST_NAMESPACE, BANK_TYPE );
+ branchSDO1 = df.create(TEST_NAMESPACE, BRANCH_TYPE );
+ branchSDO2 = df.create(TEST_NAMESPACE, BRANCH_TYPE );
+ serviceSDO1 = df.create(TEST_NAMESPACE, SERVICE_TYPE );
+ serviceSDO2 = df.create(TEST_NAMESPACE, SERVICE_TYPE );
+ serviceSDO3 = df.create(TEST_NAMESPACE, SERVICE_TYPE );
+ customerSDO1 = df.create(TEST_NAMESPACE, CUSTOMER_TYPE );
+ customerSDO2 = df.create(TEST_NAMESPACE, CUSTOMER_TYPE );
+ customerSDO3 = df.create(TEST_NAMESPACE, CUSTOMER_TYPE );
+ customerSDO4 = df.create(TEST_NAMESPACE, CUSTOMER_TYPE );
+
+ // Populate the Bank Instance
+ bankSDO.set("name", "Fourth National");
+ Vector v = new Vector();
+ v.add(branchSDO1);
+ v.add(branchSDO2);
+ bankSDO.set("Branch",v);
+ v.removeAllElements();
+ v.add(serviceSDO1);
+ v.add(serviceSDO2);
+ v.add(serviceSDO3);
+ bankSDO.set("Service",v);
+ v.removeAllElements();
+ v.add(customerSDO1);
+ v.add(customerSDO2);
+ v.add(customerSDO3);
+ v.add(customerSDO4);
+ bankSDO.set("Customer",v);
+ v.removeAllElements();
+
+ // Populate Branch Instances
+ // Branch 1
+ branchSDO1.set("ID", "BR100");
+ DataObject addr = df.create(TEST_NAMESPACE, ADDRESS_TYPE );
+ addr.set("Street", "1302 Money Street");
+ addr.set("City", "Apex");
+ addr.set("State", "NC");
+ addr.set("Zip", "27502");
+ branchSDO1.set("Address", addr);
+ v.add("If you are north, head south");
+ v.add("If you are south, head north");
+ branchSDO1.set("Directions", v);
+ v.removeAllElements();
+ DataObject account1 = df.create(TEST_NAMESPACE, ACCOUNT_TYPE );
+ account1.set("ID", "0000 1200 0001");
+ account1.set("Service", serviceSDO1 );
+ account1.setBigDecimal("Balance", new BigDecimal("3124.12"));
+ v.add(account1);
+ DataObject account2 = df.create(TEST_NAMESPACE, ACCOUNT_TYPE );
+ account2.set("ID", "0000 8899 0001");
+ account2.set("Service", serviceSDO1 );
+ account2.setBigDecimal("Balance", new BigDecimal("20.00"));
+ v.add(account2);
+ DataObject account3 = df.create(TEST_NAMESPACE, ACCOUNT_TYPE );
+ account3.set("ID", "0000 3110 0020");
+ account3.set("Service", serviceSDO3 );
+ account3.setBigDecimal("Balance", new BigDecimal("5000.00"));
+ v.add(account3);
+ branchSDO1.set("Account", v);
+ v.removeAllElements();
+ // Branch 2
+ branchSDO2.set("ID", "BR200");
+ addr = df.create(TEST_NAMESPACE, ADDRESS_TYPE );
+ addr.set("Street", "1207 Cash Court");
+ addr.set("City", "Raleigh");
+ addr.set("State", "NC");
+ addr.set("Zip", "27701");
+ branchSDO2.set("Address", addr);
+ v.add("If you are east, head west");
+ v.add("If you are west, head east");
+ branchSDO2.set("Directions", v);
+ v.removeAllElements();
+ DataObject account4 = df.create(TEST_NAMESPACE, ACCOUNT_TYPE );
+ account4.set("ID", "0000 0011 0001");
+ account4.set("Service", serviceSDO1 );
+ account4.setBigDecimal("Balance", new BigDecimal("99.12"));
+ v.add(account4);
+ DataObject account5 = df.create(TEST_NAMESPACE, ACCOUNT_TYPE );
+ account5.set("ID", "0000 9911 0001");
+ account5.set("Service", serviceSDO2 );
+ account5.setBigDecimal("Balance", new BigDecimal("820.00"));
+ v.add(account5);
+ DataObject account6 = df.create(TEST_NAMESPACE, ACCOUNT_TYPE );
+ account6.set("ID", "0000 0001 0020");
+ account6.set("Service", serviceSDO3 );
+ account6.setBigDecimal("Balance", new BigDecimal("9000.00"));
+ v.add(account6);
+ branchSDO2.set("Account", v);
+ v.removeAllElements();
+
+ // Populate Service Instances
+ serviceSDO1.set("ID", "SRV01");
+ serviceSDO1.set("Name", "Checking");
+ serviceSDO1.setBigDecimal("Fee", new BigDecimal("0.00"));
+ serviceSDO2.set("ID", "SRV02");
+ serviceSDO2.set("Name", "Savings");
+ serviceSDO2.setBigDecimal("Fee", new BigDecimal("0.00"));
+ serviceSDO3.set("ID", "SRV03");
+ serviceSDO3.set("Name", "Loan");
+ serviceSDO3.setBigDecimal("Fee", new BigDecimal("0.00"));
+
+ // Populate Customer Instances
+ // Customer 1
+ customerSDO1.set("ID", "CUST01");
+ customerSDO1.set("First", "James");
+ customerSDO1.set("Last", "Madison");
+ addr = df.create(TEST_NAMESPACE, ADDRESS_TYPE );
+ addr.set("Street", "1234 Easy Street");
+ addr.set("City", "New York");
+ addr.set("State", "NY");
+ addr.set("Zip", "27511");
+ customerSDO1.set("Address", addr);
+ customerSDO1.set("HomeBranch", branchSDO1);
+ v.add(account1);
+ customerSDO1.set("Account", v);
+ v.removeAllElements();
+ v.add(customerSDO2);
+ v.add(customerSDO3);
+ customerSDO1.set("Related", v);
+ v.removeAllElements();
+ // Customer 2
+ customerSDO2.set("ID", "CUST02");
+ customerSDO2.set("First", "George");
+ customerSDO2.set("Last", "Washington");
+ addr = df.create(TEST_NAMESPACE, ADDRESS_TYPE );
+ addr.set("Street", "1776 Potomac Avenue");
+ addr.set("City", "Washington");
+ addr.set("State", "DC");
+ addr.set("Zip", "50555");
+ customerSDO2.set("Address", addr);
+ customerSDO2.set("HomeBranch", branchSDO1);
+ v.add(account2);
+ v.add(account3);
+ customerSDO2.set("Account", v);
+ v.removeAllElements();
+ // Customer 3
+ customerSDO3.set("ID", "CUST03");
+ customerSDO3.set("First", "Thomas");
+ customerSDO3.set("Last", "Jefferson");
+ addr = df.create(TEST_NAMESPACE, ADDRESS_TYPE );
+ addr.set("Street", "1492 Columbus Avenue");
+ addr.set("City", "Charlottesville");
+ addr.set("State", "VA");
+ addr.set("Zip", "20121");
+ customerSDO3.set("Address", addr);
+ customerSDO3.set("HomeBranch", branchSDO2);
+ v.add(account4);
+ customerSDO3.set("Account", v);
+ v.removeAllElements();
+ // Customer 4
+ customerSDO4.set("ID", "CUST04");
+ customerSDO4.set("First", "Benjamin");
+ customerSDO4.set("Last", "Franklin");
+ addr = df.create(TEST_NAMESPACE, ADDRESS_TYPE );
+ addr.set("Street", "99 Light Street");
+ addr.set("City", "Philadelphia");
+ addr.set("State", "PA");
+ addr.set("Zip", "19251");
+ customerSDO4.set("Address", addr);
+ customerSDO4.set("HomeBranch", branchSDO2);
+ v.add(account5);
+ v.add(account6);
+ customerSDO4.set("Account", v);
+ v.removeAllElements();
+
+ }
+
+ private void populateScopeWithDynamicTypes(TypeHelper scope)
+ {
+ Type stringType = scope.getType("commonj.sdo", "String");
+ DataObject customerType = DataFactory.INSTANCE.create("commonj.sdo", "Type");
+ customerType.set("uri", TEST_NAMESPACE);
+ customerType.set("name", DYNAMIC_TYPE );
+ DataObject custNumProperty = customerType.createDataObject("property");
+ custNumProperty.set("name", "custNum");
+ custNumProperty.set("type", stringType);
+ DataObject firstNameProperty = customerType.createDataObject("property");
+ firstNameProperty.set("name", "firstName");
+ firstNameProperty.set("type", stringType);
+ DataObject lastNameProperty = customerType.createDataObject("property");
+ lastNameProperty.set("name", "lastName");
+ lastNameProperty.set("type", stringType);
+ scope.define(customerType);
+ }
+
+ /*
+ private void dumpObject(DataObject sdo, String node )
+ {
+ try
+ {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ SDOUtil.createXMLHelper(scopeA).save(sdo, TEST_NAMESPACE,
+ node, baos);
+ System.out.println(baos.toString());
+ }
+ catch (IOException e)
+ {
+ e.printStackTrace();
+ }
+ }
+ */
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/DataGraphTestCase.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/DataGraphTestCase.java
new file mode 100644
index 0000000000..5fcc567908
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/DataGraphTestCase.java
@@ -0,0 +1,270 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.test;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sdo.util.SDOUtil;
+
+import commonj.sdo.DataGraph;
+import commonj.sdo.DataObject;
+import commonj.sdo.Type;
+import commonj.sdo.helper.XSDHelper;
+
+/**
+ * Tests methods of DataGraph except for change summary which is tested elsewhere.
+ */
+public class DataGraphTestCase extends TestCase {
+ private final String SIMPLE_MODEL = "/simple.xsd";
+ private final String ANYTYPE_MODEL = "/anytype.xsd";
+
+ /**
+ * createRootObject(type) test with good parms.
+ */
+ public void testCreateRootObjectType() throws IOException {
+ // Create an empty data graph and add a root object, an instance of type Quote
+
+ DataGraph dataGraph = SDOUtil.createDataGraph();
+ Type quoteType = dataGraph.getType("http://www.example.com/simple", "Quote");
+ DataObject quote = dataGraph.createRootObject(quoteType);
+
+ assertNotNull(quote);
+ }
+
+ /**
+ * createRootObject(type) test with bad parm.
+ */
+ public void testCreateRootObjectTypeBad() throws IOException {
+ // Create an empty data graph and pass bad parms to createRootObject
+
+ DataGraph dataGraph = SDOUtil.createDataGraph();
+ boolean success = false;
+ try {
+ dataGraph.createRootObject(null);
+ } catch(NullPointerException npe) {
+ fail("createRootObject with null type threw NullPointerException");
+ } catch(Exception e) {
+ success = true;
+ }
+ if (!success) {
+ fail("createRootObject with null type parameter did not throw an exception");
+ }
+ }
+
+ /**
+ * createRootObject(type) test with good parms but too often to ensure
+ * that IllegalStateException is thrown
+ */
+ public void testCreateRootObjectTypeIllegalState() throws IOException {
+ // Create an empty data graph and add a root object, then add another root object
+
+ DataGraph dataGraph = SDOUtil.createDataGraph();
+ DataObject quote = dataGraph.createRootObject("http://www.example.com/anytype", "Person");
+
+ assertNotNull(quote);
+
+ Type quoteType = dataGraph.getType("http://www.example.com/simple", "Quote");
+ assertNotNull(quoteType);
+ boolean success = false;
+ try {
+ dataGraph.createRootObject(quoteType);
+ } catch(IllegalStateException ise) {
+ success = true;
+ } catch(Exception e) {
+ fail("createRootObject called when a root was already created and an exception other than IllegalStateException was thrown: "+e.getMessage());
+ }
+ if (!success) {
+ fail("createRootObject called when a root was already created but no IllegalStateException was thrown");
+ }
+ }
+
+ /**
+ * createRootObject(type) test with good parms but too often to ensure
+ * that IllegalStateException is thrown
+ */
+ public void testCreateRootObjectUriTypenameIllegalState() throws IOException {
+ // Create an empty data graph and add a root object, then add another root object
+
+ DataGraph dataGraph = SDOUtil.createDataGraph();
+ DataObject quote = dataGraph.createRootObject("http://www.example.com/anytype", "Person");
+
+ assertNotNull(quote);
+
+ boolean success = false;
+ try {
+ dataGraph.createRootObject("http://www.example.com/simple", "Quote");
+ } catch(IllegalStateException ise) {
+ success = true;
+ } catch(Exception e) {
+ fail("createRootObject called when a root was already created and an exception other than IllegalStateException was thrown: "+e.getMessage());
+ }
+ if (!success) {
+ fail("createRootObject called when a root was already created but no IllegalStateException was thrown");
+ }
+ }
+
+ /**
+ * createRootObject(uri_string, typeName_string) test with good parms.
+ */
+ public void testCreateRootObjectUriTypename() throws IOException {
+ // Create an empty data graph and add a root object, an instance of type Quote
+
+ DataGraph dataGraph = SDOUtil.createDataGraph();
+ DataObject quote = dataGraph.createRootObject("http://www.example.com/simple", "Quote");
+
+ assertNotNull(quote);
+ }
+
+ /**
+ * createRootObject(uri_string, typeName_string) test with bad parms.
+ */
+ public void testCreateRootObjectUriTypenameBad1() throws IOException {
+ // Create an empty data graph and pass bad parms to createRootObject
+
+ DataGraph dataGraph = SDOUtil.createDataGraph();
+ boolean success = false;
+ try {
+ dataGraph.createRootObject("http://www.example.com/mangled", "Quote");
+ } catch(NullPointerException npe) {
+ fail("createRootObject with mangled URI threw NullPointerException");
+ } catch(Exception e) {
+ success = true;
+ }
+ if (!success) {
+ fail("createRootObject with mangled URI did not throw an exception");
+ }
+ }
+
+ /**
+ * createRootObject(uri_string, typeName_string) test with bad parms.
+ */
+ public void testCreateRootObjectUriTypenameBad2() throws IOException {
+ // Create an empty data graph and pass bad parms to createRootObject
+
+ DataGraph dataGraph = SDOUtil.createDataGraph();
+ boolean success = false;
+ try {
+ dataGraph.createRootObject("http://www.example.com/simple", "Mangled");
+ } catch(NullPointerException npe) {
+ fail("createRootObject with mangled type name threw NullPointerException");
+ } catch(Exception e) {
+ success = true;
+ }
+ if (!success) {
+ fail("createRootObject with mangled type name did not throw an exception");
+ }
+ }
+
+ /**
+ * getType(uri_string, typeName_string) test with good parms.
+ */
+ public void testGetType() throws IOException {
+ // Create an empty data graph and get a type, a Quote type
+
+ DataGraph dataGraph = SDOUtil.createDataGraph();
+ Type quoteType = dataGraph.getType("http://www.example.com/simple", "Quote");
+
+ assertNotNull(quoteType);
+ }
+
+ /**
+ * getType(uri_string, typeName_string) test with bad URI parm.
+ */
+ public void testGetTypeBad1() throws IOException {
+ // Create an empty data graph and pass bad parms to getType
+
+ DataGraph dataGraph = SDOUtil.createDataGraph();
+ Type quoteType = null;
+ try {
+ quoteType = dataGraph.getType("http://www.example.com/mangled", "Quote");
+ } catch(Exception e) {
+ fail("getType with mangled URI threw an exception: "+e.getMessage());
+ }
+ assertNull(quoteType);
+ }
+
+ /**
+ * getType(uri_string, typeName_string) test with bad type name parm.
+ */
+ public void testGetTypeBad2() throws IOException {
+ // Create an empty data graph and pass bad parms to getType
+
+ DataGraph dataGraph = SDOUtil.createDataGraph();
+ Type quoteType = null;
+ try {
+ quoteType = dataGraph.getType("http://www.example.com/simple", "Mangled");
+ } catch(Exception e) {
+ fail("getType with mangled type name threw an exception: "+e.getMessage());
+ }
+ assertNull(quoteType);
+ }
+
+ /**
+ * getType(uri_string, typeName_string) test with null URI parm.
+ */
+ public void testGetTypeBad3() throws IOException {
+ // Create an empty data graph and pass bad parms to getType
+
+ DataGraph dataGraph = SDOUtil.createDataGraph();
+ Type quoteType = null;
+ try {
+ quoteType = dataGraph.getType(null, "Quote");
+ } catch(Exception e) {
+ fail("getType with null URI threw an exception: "+e.getMessage());
+ }
+ assertNull(quoteType);
+ }
+
+ /**
+ * getType(uri_string, typeName_string) test with null type name parm.
+ */
+ public void testGetTypeBad4() throws IOException {
+ // Create an empty data graph and pass bad parms to getType
+
+ DataGraph dataGraph = SDOUtil.createDataGraph();
+ Type quoteType = null;
+ try {
+ quoteType = dataGraph.getType("http://www.example.com/simple", null);
+ } catch(Exception e) {
+ fail("getType with null type name threw an exception: "+e.getMessage());
+ }
+ assertNull(quoteType);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ // Populate the meta data for the Quote type
+ URL url = getClass().getResource(SIMPLE_MODEL);
+ InputStream inputStream = url.openStream();
+ XSDHelper.INSTANCE.define(inputStream, url.toString());
+ inputStream.close();
+
+ // Populate the meta data for the Person type
+ URL url2 = getClass().getResource(ANYTYPE_MODEL);
+ InputStream inputStream2 = url2.openStream();
+ XSDHelper.INSTANCE.define(inputStream2, url2.toString());
+ inputStream2.close();
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/DataTypeBaseTypeTestCase.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/DataTypeBaseTypeTestCase.java
new file mode 100644
index 0000000000..a49b165386
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/DataTypeBaseTypeTestCase.java
@@ -0,0 +1,68 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.test;
+
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import commonj.sdo.Type;
+import commonj.sdo.helper.TypeHelper;
+import commonj.sdo.helper.XSDHelper;
+
+
+public class DataTypeBaseTypeTestCase extends TestCase {
+ private final String TEST_MODEL = "/datatype.xsd";
+ private final String TEST_NAMESPACE = "http://www.example.com/datatype";
+
+ public void testSimpleSDOType() throws IOException
+ {
+ Type type = TypeHelper.INSTANCE.getType(TEST_NAMESPACE, "SimpleSDOType");
+ List baseTypes = type.getBaseTypes();
+ assertTrue(baseTypes.size() == 1);
+ }
+
+ public void testSimpleSDOTypeInstanceClass() throws IOException
+ {
+ Type type = TypeHelper.INSTANCE.getType(TEST_NAMESPACE, "SimpleSDOTypeInstanceClass");
+ List baseTypes = type.getBaseTypes();
+ assertTrue(baseTypes.size() == 0);
+ }
+
+ public void testSimpleSDOTypeExtendedInstanceClass() throws IOException
+ {
+ Type type = TypeHelper.INSTANCE.getType(TEST_NAMESPACE, "SimpleSDOTypeExtendedInstanceClass");
+ List baseTypes = type.getBaseTypes();
+ assertTrue(baseTypes.size() == 1);
+ }
+
+ public void setUp() throws Exception
+ {
+ URL url = getClass().getResource(TEST_MODEL);
+ InputStream inputStream = url.openStream();
+ XSDHelper.INSTANCE.define(inputStream, url.toString());
+ inputStream.close();
+ }
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/DateConversionTestCase.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/DateConversionTestCase.java
new file mode 100644
index 0000000000..291842e1aa
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/DateConversionTestCase.java
@@ -0,0 +1,374 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.test;
+
+import java.lang.reflect.Method;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
+
+import junit.framework.TestCase;
+
+import commonj.sdo.helper.DataHelper;
+
+// DateConversionTestCase insures that the DataHelper conversions accurately
+// retain the information in the specified fields (e.g. month, day or year).
+// It also provides coverage for the DataHelper API.
+// Note that toDate is called each time Test.initialize() is called.
+
+public class DateConversionTestCase extends TestCase
+{
+ private static Calendar test_calendar;
+ private static Date test_date;
+ private static DataHelper data_helper;
+
+ private static final TestType TO_DATE_TIME = new TestType("toDateTime", new int [] {Calendar.YEAR, Calendar.MONTH,
+ Calendar.DAY_OF_MONTH, Calendar.HOUR_OF_DAY, Calendar.MINUTE, Calendar.SECOND, Calendar.MILLISECOND});
+ private static final TestType TO_DURATION = new TestType("toDuration", new int [] {Calendar.YEAR, Calendar.MONTH,
+ Calendar.DAY_OF_MONTH, Calendar.HOUR_OF_DAY, Calendar.MINUTE, Calendar.SECOND, Calendar.MILLISECOND});
+ private static final TestType TO_TIME = new TestType("toTime", new int [] {Calendar.HOUR_OF_DAY, Calendar.MINUTE,
+ Calendar.SECOND, Calendar.MILLISECOND});
+ private static final TestType TO_DAY = new TestType("toDay", new int[] {Calendar.DAY_OF_MONTH});
+ private static final TestType TO_MONTH = new TestType("toMonth", new int[] {Calendar.MONTH});
+ private static final TestType TO_MONTH_DAY = new TestType("toMonthDay", new int[] {Calendar.MONTH, Calendar.DAY_OF_MONTH});
+ private static final TestType TO_YEAR = new TestType("toYear", new int[] {Calendar.YEAR});
+ private static final TestType TO_YEAR_MONTH= new TestType("toYearMonth", new int[] {Calendar.YEAR, Calendar.MONTH});
+ private static final TestType TO_YEAR_MONTH_DAY = new TestType("toYearMonthDay", new int[] {Calendar.YEAR,
+ Calendar.MONTH, Calendar.DAY_OF_MONTH});
+
+ public DateConversionTestCase() throws Exception
+ {
+ data_helper = DataHelper.INSTANCE;
+ test_calendar = new GregorianCalendar();
+ test_calendar.setTime(new Date(System.currentTimeMillis()));
+ test_date = test_calendar.getTime();
+ }
+
+ private static class TestType
+ {
+ private static final Class[] DATE_CLASS_ARRAY = {Date.class};
+ private static final Class[] CALENDAR_CLASS_ARRAY = {Calendar.class};
+
+ Method date_method;
+ Method calendar_method;
+ int [] compare_fields;
+
+ public TestType (String method_name, int [] compare_fields)
+ {
+ try
+ {
+ this.date_method = DataHelper.class.getMethod(method_name, DATE_CLASS_ARRAY);
+ }
+ catch (NoSuchMethodException e)
+ {
+ this.date_method = null;
+ }
+
+ this.compare_fields = compare_fields;
+ try
+ {
+ this.calendar_method = DataHelper.class.getMethod(method_name, CALENDAR_CLASS_ARRAY);
+ }
+ catch (NoSuchMethodException e)
+ {
+ this.calendar_method = null;
+ }
+
+ }
+
+ public Method getDateMethod()
+ {
+ return this.date_method;
+ }
+
+ public Method getCalendarMethod()
+ {
+ return this.calendar_method;
+ }
+ }
+
+ private static class Test
+ {
+ String from_type;
+ Date from_date;
+ Calendar from_calendar;
+ Class expected_exception;
+
+ public Test ()
+ {
+ this.from_date = null;
+ this.from_calendar = null;
+ expected_exception = null;
+ }
+
+ public void initialize (TestType from_type)
+ {
+ this.from_type = from_type.getDateMethod().getName();
+
+ try
+ {
+ String date_string = (String) from_type.getDateMethod().invoke(data_helper, new Object[] {test_date});
+
+ this.from_date = data_helper.toDate(date_string);
+ date_string = (String) from_type.getCalendarMethod().invoke(data_helper, new Object[] {test_calendar});
+ this.from_calendar = data_helper.toCalendar(date_string);
+ }
+ catch (Exception e)
+ {
+ this.from_date = null;
+ this.from_calendar = null;
+ }
+
+ }
+
+ // This method is needed because there is not a toDate(Date) method in DataHelper.
+
+ public void initializeToDate()
+ {
+ this.from_calendar = test_calendar;
+ this.from_date = test_date;
+ this.from_type = "toDate";
+ }
+
+ public void attemptConversion (TestType to_type) throws Exception
+ {
+ executeConversion(to_type.getDateMethod(), new Object[] {this.from_date}, to_type.compare_fields);
+ executeConversion(to_type.getCalendarMethod(), new Object[] {this.from_calendar}, to_type.compare_fields);
+ }
+
+ private void executeConversion (Method conversion, Object[] parm, int [] compare_fields) throws Exception
+ {
+ String result;
+
+ try
+ {
+ result = (String) conversion.invoke(data_helper, parm);
+ }
+ catch (Exception e)
+ {
+ System.err.println("An unexpected exception was thrown while calling " + conversion.getName() +
+ " after initializing with " + this.from_type + ".");
+ throw e;
+ }
+
+ assertTrue("The expected value did not result when calling " + conversion.getName() +
+ " after initializing with " + this.from_type + ".", compareFields(parm[0], result, compare_fields));
+ }
+
+ private boolean compareFields(Object compare_to, String output, int [] compare_fields)
+ {
+ Calendar result = data_helper.toCalendar(output);
+ Calendar expected;
+
+ if (compare_to instanceof Calendar)
+ expected = (GregorianCalendar) test_calendar;
+ else
+ {
+ expected = new GregorianCalendar();
+ expected.setTime((Date) test_date);
+ }
+
+ for (int i = 0; i < compare_fields.length; i++)
+ {
+ if (expected.get(compare_fields[i]) != result.get(compare_fields[i]))
+ {
+ System.err.println("Failed: - expected '" + expected.get(compare_fields[i]) + "' got '" + result.get(compare_fields[i]) + "' for output: " + output);
+ return false;
+ }
+ }
+ return true;
+ }
+
+ }
+
+ public void testConversionsFromDay() throws Exception
+ {
+ Test FromDay = new Test();
+
+ FromDay.initialize(TO_DAY);
+
+ FromDay.attemptConversion(TO_DAY);
+ }
+
+ public void testConversionsFromDate() throws Exception
+ {
+ Test FromDate = new Test();
+
+ FromDate.initializeToDate();
+
+ FromDate.attemptConversion(TO_DATE_TIME);
+ FromDate.attemptConversion(TO_DURATION);
+ FromDate.attemptConversion(TO_TIME);
+ FromDate.attemptConversion(TO_DAY);
+ FromDate.attemptConversion(TO_MONTH);
+ FromDate.attemptConversion(TO_MONTH_DAY);
+ FromDate.attemptConversion(TO_YEAR);
+ FromDate.attemptConversion(TO_YEAR_MONTH);
+ FromDate.attemptConversion(TO_YEAR_MONTH_DAY);
+ }
+
+ public void testConversionsFromDateTime() throws Exception
+ {
+ Test FromDateTime = new Test();
+
+ FromDateTime.initialize(TO_DATE_TIME);
+
+ FromDateTime.attemptConversion(TO_DATE_TIME);
+ FromDateTime.attemptConversion(TO_DURATION);
+ FromDateTime.attemptConversion(TO_TIME);
+ FromDateTime.attemptConversion(TO_DAY);
+ FromDateTime.attemptConversion(TO_MONTH);
+ FromDateTime.attemptConversion(TO_MONTH_DAY);
+ FromDateTime.attemptConversion(TO_YEAR);
+ FromDateTime.attemptConversion(TO_YEAR_MONTH);
+ FromDateTime.attemptConversion(TO_YEAR_MONTH_DAY);
+ }
+
+ public void testConversionsFromDuration() throws Exception
+ {
+ Test FromDuration = new Test();
+
+ FromDuration.initialize(TO_DURATION);
+
+ FromDuration.attemptConversion(TO_DURATION);
+ FromDuration.attemptConversion(TO_DATE_TIME);
+ FromDuration.attemptConversion(TO_TIME);
+ FromDuration.attemptConversion(TO_DAY);
+ FromDuration.attemptConversion(TO_MONTH);
+ FromDuration.attemptConversion(TO_MONTH_DAY);
+ FromDuration.attemptConversion(TO_YEAR);
+ FromDuration.attemptConversion(TO_YEAR_MONTH);
+ FromDuration.attemptConversion(TO_YEAR_MONTH_DAY);
+ }
+
+ public void testConversionsFromMonth() throws Exception
+ {
+ Test FromMonth = new Test();
+
+ FromMonth.initialize(TO_MONTH);
+
+ FromMonth.attemptConversion(TO_MONTH);
+ }
+
+ public void testConversionsFromMonthDay() throws Exception
+ {
+ Test FromMonthDay = new Test();
+
+ FromMonthDay.initialize(TO_MONTH_DAY);
+ FromMonthDay.attemptConversion(TO_MONTH_DAY);
+ FromMonthDay.attemptConversion(TO_MONTH);
+ FromMonthDay.attemptConversion(TO_DAY);
+ }
+
+ public void testConversionsFromTime() throws Exception
+ {
+ Test FromTime = new Test();
+
+ FromTime.initialize(TO_TIME);
+
+ FromTime.attemptConversion(TO_TIME);
+ }
+
+ public void testConversionsFromYear() throws Exception
+ {
+ Test FromYear = new Test();
+
+ FromYear.initialize(TO_YEAR);
+
+ FromYear.attemptConversion(TO_YEAR);
+ }
+
+ public void testConversionsFromYearMonth() throws Exception
+ {
+ Test FromYearMonth = new Test();
+
+ FromYearMonth.initialize(TO_YEAR_MONTH);
+
+ FromYearMonth.attemptConversion(TO_YEAR_MONTH);
+ FromYearMonth.attemptConversion(TO_MONTH);
+ FromYearMonth.attemptConversion(TO_YEAR);
+ }
+
+ public void testConversionsFromYearMonthDay() throws Exception
+ {
+ Test FromYearMonthDay = new Test();
+
+ FromYearMonthDay.initialize(TO_YEAR_MONTH_DAY);
+
+ FromYearMonthDay.attemptConversion(TO_YEAR_MONTH_DAY);
+ FromYearMonthDay.attemptConversion(TO_YEAR_MONTH);
+ FromYearMonthDay.attemptConversion(TO_MONTH_DAY);
+ FromYearMonthDay.attemptConversion(TO_YEAR);
+ FromYearMonthDay.attemptConversion(TO_MONTH);
+ FromYearMonthDay.attemptConversion(TO_DAY);
+ }
+
+ // Ensure that strings that should be recognized by toDate do not
+ // result in a null Date value.
+
+ public void testToDateFormats() throws Exception
+ {
+ String[] validStrings =
+ {
+ "2006-03-31T03:30:45.123Z",
+ "-2006-03-31T03:30:45.1Z",
+ "2006-03-31T03:30:45Z",
+ "2006-03-31T03:30:45.123",
+ "2006-03-31T03:30:45.1",
+ "-2006-03-31T03:30:45",
+ "2006-03-31T03:30:45.123 EDT",
+ "2006-03-31T03:30:45.1 EDT",
+ "2006-03-31T03:30:45 EDT",
+ "---05 PST",
+ "---04",
+ "--12 GMT",
+ "--12",
+ "--08-08 EST",
+ "--08-08",
+ "1976-08-08 PDT",
+ "1976-08-08",
+ "88-12 CST",
+ "1988-12",
+ "2005 CDT",
+ "1999",
+ "P2006Y 08M 10D T 12H 24M 07S",
+ "P2006Y 10D T 12H",
+ "-P2006Y 08M 10D T 07S.2",
+ "P08M 10D T 07H",
+ "-P 04M 10DT12H 24S.88",
+ "PT12H"
+ };
+
+ for (int i = 0; i < validStrings.length; i++)
+ {
+ assertNotNull("DataHelper.toData() should not return null for '" + validStrings[i] + "'.",
+ data_helper.toDate(validStrings[i]));
+ }
+
+ }
+
+ public void testDateTime(){
+ // a small bolt on test case resulting from a fix for JIRA TUSCANY-1044
+ String date = DataHelper.INSTANCE.toDateTime(DataHelper.INSTANCE.toCalendar("2007-02-04T00:00:00.200Z"));
+ assertEquals("2007-02-04T00:00:00.200Z", date);
+ }
+
+}
+
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/DefineOpenContentPropertyTestCase.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/DefineOpenContentPropertyTestCase.java
new file mode 100644
index 0000000000..7f5fea2c96
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/DefineOpenContentPropertyTestCase.java
@@ -0,0 +1,124 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.test;
+
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.math.BigDecimal;
+import java.net.URL;
+
+import org.apache.tuscany.sdo.util.SDOUtil;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+import commonj.sdo.helper.DataFactory;
+import commonj.sdo.helper.HelperContext;
+import commonj.sdo.helper.TypeHelper;
+import commonj.sdo.helper.XMLHelper;
+import commonj.sdo.helper.XSDHelper;
+import junit.framework.TestCase;
+
+
+public class DefineOpenContentPropertyTestCase extends TestCase {
+ private final String TEST_MODEL = "/open.xsd";
+ private final String TEST_NAMESPACE = "http://www.example.com/open";
+ private final String TEST_DATA = "/openContentProperty.xml";
+
+ private TypeHelper typeHelper;
+ private XSDHelper xsdHelper;
+ private XMLHelper xmlHelper;
+ private DataFactory dataFactory;
+
+ public void testDefineOpenContentProperty() throws IOException {
+ Type quoteType = typeHelper.getType(TEST_NAMESPACE, "OpenQuote");
+ DataObject quote = dataFactory.create(quoteType);
+
+ quote.setString("symbol", "s1");
+
+ Property companyProperty = typeHelper.getOpenContentProperty(TEST_NAMESPACE, "company");
+ DataObject company = quote.createDataObject(companyProperty);
+ company.setString("name", "FlyByNightTechnology");
+
+ Property priceProperty = typeHelper.getOpenContentProperty(TEST_NAMESPACE, "price");
+ quote.getList(priceProperty).add(new BigDecimal("1000.0"));
+
+ // Define a new SDO open content property with simple type
+ DataObject p = dataFactory.create("commonj.sdo", "Property");
+ p.set("type", typeHelper.getType("commonj.sdo", "Decimal"));
+ p.set("name", "highPrice");
+ Property highPrice = typeHelper.defineOpenContentProperty(TEST_NAMESPACE, p);
+
+ quote.setBigDecimal(highPrice, new BigDecimal("1100.0"));
+
+ // Define a new SDO open content property with complex type
+ DataObject mutualFundQuotePropertyDef = dataFactory.create("commonj.sdo", "Property");
+ mutualFundQuotePropertyDef.set("type", quoteType);
+ mutualFundQuotePropertyDef.set("name", "mutualFundQuote");
+ mutualFundQuotePropertyDef.setBoolean("containment", true);
+ Property mutualFundQuoteProperty = typeHelper.defineOpenContentProperty(TEST_NAMESPACE, mutualFundQuotePropertyDef);
+
+ DataObject mutualFundQuote = quote.createDataObject(mutualFundQuoteProperty);
+ mutualFundQuote.setString("symbol", "mutual-1");
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ xmlHelper.save(quote, TEST_NAMESPACE, "openStockQuote", baos);
+
+ assertTrue(TestUtil.equalXmlFiles(new ByteArrayInputStream(baos.toByteArray()), getClass().getResource(TEST_DATA)));
+
+ // validate existing property condition
+ Property duplicateProp = typeHelper.defineOpenContentProperty(TEST_NAMESPACE, p);
+ assertTrue(highPrice.equals(duplicateProp));
+
+ // validate error condition, where new property exists with different type
+ boolean errorCondition = false;
+ try
+ {
+ p = dataFactory.create("commonj.sdo", "Property");
+ p.set("type", typeHelper.getType("commonj.sdo", "String"));
+ p.set("name", "highPrice");
+ highPrice = typeHelper.defineOpenContentProperty(TEST_NAMESPACE, p);
+ }
+ catch( IllegalArgumentException ex )
+ {
+ errorCondition = true;
+ }
+ assertTrue(errorCondition);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ HelperContext hc = SDOUtil.createHelperContext();
+ typeHelper = hc.getTypeHelper();
+ dataFactory = hc.getDataFactory();
+ xsdHelper = hc.getXSDHelper();
+ xmlHelper = hc.getXMLHelper();
+
+ // Populate the meta data for the test (Stock Quote) model
+ URL url = getClass().getResource(TEST_MODEL);
+ InputStream inputStream = url.openStream();
+ xsdHelper.define(inputStream, url.toString());
+ inputStream.close();
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/DefineTypeTestCase.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/DefineTypeTestCase.java
new file mode 100644
index 0000000000..8c786821cb
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/DefineTypeTestCase.java
@@ -0,0 +1,684 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.test;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sdo.util.SDOUtil;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
+import commonj.sdo.Sequence;
+import commonj.sdo.Type;
+import commonj.sdo.helper.DataFactory;
+import commonj.sdo.helper.HelperContext;
+import commonj.sdo.helper.TypeHelper;
+import commonj.sdo.helper.XMLDocument;
+import commonj.sdo.helper.XMLHelper;
+import commonj.sdo.helper.XSDHelper;
+
+public class DefineTypeTestCase extends TestCase
+{
+ private static final String CUSTOMER1_XML = "/customer1.xml";
+ private static final String CUSTOMER2_XML = "/customer2.xml";
+ private static final String OPEN_XML = "/open2.xml";
+ private static final String MIXED_XML = "/mixed2.xml";
+ private static final String MIXEDOPEN_XML = "/mixedopen.xml";
+
+ HelperContext hc;
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ hc = SDOUtil.createHelperContext();
+ }
+
+ public void testDefineTypeRoundTrip() throws Exception {
+ TypeHelper types = hc.getTypeHelper();
+ DataFactory factory = hc.getDataFactory();
+ XMLHelper xmlHelper = hc.getXMLHelper();
+
+ Type intType = types.getType("commonj.sdo", "Int");
+ Type stringType = types.getType("commonj.sdo", "String");
+
+ // create a new Type for Customers
+ DataObject customerType = factory.create("commonj.sdo",
+ "Type");
+ customerType.set("uri", "http://example.com/customer");
+ customerType.set("name", "Customer");
+
+ // create a customer number property
+ DataObject custNumProperty = customerType.createDataObject("property");
+ custNumProperty.set("name", "custNum");
+ custNumProperty.set("type", intType);
+
+ // create a first name property
+ DataObject firstNameProperty =
+ customerType.createDataObject("property");
+ firstNameProperty.set("name", "firstName");
+ firstNameProperty.set("type", stringType);
+
+ // create a last name property
+ DataObject lastNameProperty = customerType.createDataObject("property");
+ lastNameProperty.set("name", "lastName");
+ lastNameProperty.set("type", stringType);
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ xmlHelper.save(customerType, "commonj.sdo", "type", baos);
+
+ ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
+ XMLDocument xdoc = xmlHelper.load(bais);
+
+ customerType = xdoc.getRootObject();
+
+ // now define the Customer type so that customers can be made
+ types.define(customerType);
+
+ DataObject customer1 = factory.create("http://example.com/customer",
+ "Customer");
+
+ customer1.setInt("custNum", 1);
+ customer1.set("firstName", "John");
+ customer1.set("lastName", "Adams");
+ DataObject customer2 = factory.create("http://example.com/customer",
+ "Customer");
+ customer2.setInt("custNum", 2);
+ customer2.set("firstName", "Jeremy");
+ customer2.set("lastName", "Pavick");
+
+ assertNotNull(customer1);
+ Type type = customer1.getType();
+ assertNotNull(type.getProperty("custNum"));
+ assertNotNull(type.getProperty("firstName"));
+ assertNotNull(type.getProperty("lastName"));
+ assertEquals(type.getProperty("custNum").getType(), intType);
+ assertEquals(type.getProperty("firstName").getType(), stringType);
+ assertEquals(type.getProperty("lastName").getType(), stringType);
+
+ assertNotNull(customer2);
+ type = customer2.getType();
+ assertNotNull(type.getProperty("custNum"));
+ assertNotNull(type.getProperty("firstName"));
+ assertNotNull(type.getProperty("lastName"));
+ assertEquals(type.getProperty("custNum").getType(), intType);
+ assertEquals(type.getProperty("firstName").getType(), stringType);
+ assertEquals(type.getProperty("lastName").getType(), stringType);
+
+ baos = new ByteArrayOutputStream();
+ xmlHelper.save(
+ customer1,
+ "http://example.com/customer",
+ "Customer", baos);
+ assertTrue(
+ TestUtil.equalXmlFiles(
+ new ByteArrayInputStream(baos.toByteArray()),
+ getClass().getResource(CUSTOMER1_XML)));
+
+ baos = new ByteArrayOutputStream();
+ xmlHelper.save(
+ customer2,
+ "http://example.com/customer",
+ "Customer", baos);
+ assertTrue(
+ TestUtil.equalXmlFiles(
+ new ByteArrayInputStream(baos.toByteArray()),
+ getClass().getResource(CUSTOMER2_XML)));
+ }
+
+ public void testDefineType() throws Exception
+ {
+ TypeHelper types = hc.getTypeHelper();
+ DataFactory factory = hc.getDataFactory();
+ XMLHelper xmlHelper = hc.getXMLHelper();
+
+ Type intType = types.getType("commonj.sdo", "Int");
+ Type stringType = types.getType("commonj.sdo", "String");
+
+ // create a new Type for Customers
+ DataObject customerType = factory.create("commonj.sdo",
+ "Type");
+ customerType.set("uri", "http://example.com/customer");
+ customerType.set("name", "Customer");
+
+ // create a customer number property
+ DataObject custNumProperty = customerType.createDataObject("property");
+ custNumProperty.set("name", "custNum");
+ custNumProperty.set("type", intType);
+
+ // create a first name property
+ DataObject firstNameProperty =
+ customerType.createDataObject("property");
+ firstNameProperty.set("name", "firstName");
+ firstNameProperty.set("type", stringType);
+
+ // create a last name property
+ DataObject lastNameProperty = customerType.createDataObject("property");
+ lastNameProperty.set("name", "lastName");
+ lastNameProperty.set("type", stringType);
+
+ // now define the Customer type so that customers can be made
+ types.define(customerType);
+
+ DataObject customer1 = factory.create("http://example.com/customer",
+ "Customer");
+
+ customer1.setInt("custNum", 0);
+ assertTrue(customer1.isSet("custNum"));
+
+ customer1.setInt("custNum", 1);
+ customer1.set("firstName", "John");
+ customer1.set("lastName", "Adams");
+ DataObject customer2 = factory.create("http://example.com/customer",
+ "Customer");
+ customer2.setInt("custNum", 2);
+ customer2.set("firstName", "Jeremy");
+ customer2.set("lastName", "Pavick");
+
+ assertNotNull(customer1);
+ Type type = customer1.getType();
+ assertNotNull(type.getProperty("custNum"));
+ assertNotNull(type.getProperty("firstName"));
+ assertNotNull(type.getProperty("lastName"));
+ assertEquals(type.getProperty("custNum").getType(), intType);
+ assertEquals(type.getProperty("firstName").getType(), stringType);
+ assertEquals(type.getProperty("lastName").getType(), stringType);
+
+ assertNotNull(customer2);
+ assertNotNull(types.getOpenContentProperty("http://example.com/customer", "customer"));
+
+ type = customer2.getType();
+ assertNotNull(type.getProperty("custNum"));
+ assertNotNull(type.getProperty("firstName"));
+ assertNotNull(type.getProperty("lastName"));
+ assertEquals(type.getProperty("custNum").getType(), intType);
+ assertEquals(type.getProperty("firstName").getType(), stringType);
+ assertEquals(type.getProperty("lastName").getType(), stringType);
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ xmlHelper.save(
+ customer1,
+ "http://example.com/customer",
+ "Customer", baos);
+ assertTrue(
+ TestUtil.equalXmlFiles(
+ new ByteArrayInputStream(baos.toByteArray()),
+ getClass().getResource(CUSTOMER1_XML)));
+
+ baos = new ByteArrayOutputStream();
+ xmlHelper.save(
+ customer2,
+ "http://example.com/customer",
+ "Customer", baos);
+ assertTrue(
+ TestUtil.equalXmlFiles(
+ new ByteArrayInputStream(baos.toByteArray()),
+ getClass().getResource(CUSTOMER2_XML)));
+ }
+
+ public void testDefineDataType() throws Exception
+ {
+ TypeHelper types = hc.getTypeHelper();
+ DataFactory factory = hc.getDataFactory();
+ XMLHelper xmlHelper = hc.getXMLHelper();
+ XSDHelper xsdHelper = hc.getXSDHelper();
+
+ Property javaClassProperty = xsdHelper.getGlobalProperty("commonj.sdo/java", "javaClass", false);
+
+ // create a data types
+ DataObject intType = factory.create("commonj.sdo", "Type");
+ intType.set("uri", "http://example.com/customer");
+ intType.set("name", "MyIntType");
+ intType.setBoolean("dataType", true);
+ intType.set(javaClassProperty, "int");
+
+ DataObject stringType = factory.create("commonj.sdo", "Type");
+ stringType.set("uri", "http://example.com/customer");
+ stringType.set("name", "MyStringType");
+ stringType.setBoolean("dataType", true);
+ stringType.set(javaClassProperty, "java.lang.String");
+
+ // create a new Type for Customers
+ DataObject customerType = factory.create("commonj.sdo",
+ "Type");
+ customerType.set("uri", "http://example.com/customer");
+ customerType.set("name", "Customer");
+
+ // create a customer number property
+ DataObject custNumProperty = customerType.createDataObject("property");
+ custNumProperty.set("name", "custNum");
+ custNumProperty.set("type", intType);
+
+ // create a first name property
+ DataObject firstNameProperty =
+ customerType.createDataObject("property");
+ firstNameProperty.set("name", "firstName");
+ firstNameProperty.set("type", stringType);
+
+ // create a last name property
+ DataObject lastNameProperty = customerType.createDataObject("property");
+ lastNameProperty.set("name", "lastName");
+ lastNameProperty.set("type", stringType);
+
+ // now define the Customer type so that customers can be made
+ types.define(customerType);
+
+ DataObject customer1 = factory.create("http://example.com/customer",
+ "Customer");
+
+ customer1.setInt("custNum", 1);
+ customer1.set("firstName", "John");
+ customer1.set("lastName", "Adams");
+ DataObject customer2 = factory.create("http://example.com/customer",
+ "Customer");
+ customer2.setInt("custNum", 2);
+ customer2.set("firstName", "Jeremy");
+ customer2.set("lastName", "Pavick");
+
+ assertNotNull(customer1);
+ Type type = customer1.getType();
+ assertNotNull(type.getProperty("custNum"));
+ assertNotNull(type.getProperty("firstName"));
+ assertNotNull(type.getProperty("lastName"));
+ assertNotNull(type.getProperty("custNum"));
+ assertNotNull(type.getProperty("firstName"));
+ assertNotNull(type.getProperty("lastName"));
+
+ type = type.getProperty("custNum").getType();
+ assertEquals(type.getURI(), "http://example.com/customer");
+ assertEquals(type.getName(), "MyIntType");
+ assertTrue(type.isDataType());
+
+ assertNotNull(customer2);
+ assertNotNull(types.getOpenContentProperty("http://example.com/customer", "customer"));
+
+ type = customer2.getType();
+ assertNotNull(type.getProperty("custNum"));
+ assertNotNull(type.getProperty("firstName"));
+ assertNotNull(type.getProperty("lastName"));
+ assertNotNull(type.getProperty("custNum"));
+ assertNotNull(type.getProperty("firstName"));
+ assertNotNull(type.getProperty("lastName"));
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ xmlHelper.save(
+ customer1,
+ "http://example.com/customer",
+ "Customer", baos);
+ assertTrue(
+ TestUtil.equalXmlFiles(
+ new ByteArrayInputStream(baos.toByteArray()),
+ getClass().getResource(CUSTOMER1_XML)));
+
+ baos = new ByteArrayOutputStream();
+ xmlHelper.save(
+ customer2,
+ "http://example.com/customer",
+ "Customer", baos);
+ assertTrue(
+ TestUtil.equalXmlFiles(
+ new ByteArrayInputStream(baos.toByteArray()),
+ getClass().getResource(CUSTOMER2_XML)));
+ }
+
+ public void testFastDefineType() throws Exception
+ {
+ TypeHelper types = hc.getTypeHelper();
+ DataFactory factory = hc.getDataFactory();
+ XMLHelper xmlHelper = hc.getXMLHelper();
+
+ Type intType = types.getType("commonj.sdo", "Int");
+ Type stringType = types.getType("commonj.sdo", "String");
+
+ // create a new Type for Customers
+ Type customerType = SDOUtil.createType(types, "http://example.com/customer", "Customer", false);
+
+ // create a customer number property
+ SDOUtil.createProperty(customerType, "custNum", intType);
+
+ // create a first name property
+ SDOUtil.createProperty(customerType, "firstName", stringType);
+
+ // create a last name property
+ SDOUtil.createProperty(customerType, "lastName", stringType);
+
+ DataObject customer1 = factory.create("http://example.com/customer",
+ "Customer");
+ customer1.setInt("custNum", 1);
+ customer1.set("firstName", "John");
+ customer1.set("lastName", "Adams");
+ DataObject customer2 = factory.create("http://example.com/customer",
+ "Customer");
+ customer2.setInt("custNum", 2);
+ customer2.set("firstName", "Jeremy");
+ customer2.set("lastName", "Pavick");
+
+ assertNotNull(customer1);
+ Type type = customer1.getType();
+ assertNotNull(type.getProperty("custNum"));
+ assertNotNull(type.getProperty("firstName"));
+ assertNotNull(type.getProperty("lastName"));
+ assertEquals(type.getProperty("custNum").getType(), intType);
+ assertEquals(type.getProperty("firstName").getType(), stringType);
+ assertEquals(type.getProperty("lastName").getType(), stringType);
+
+ assertNotNull(customer2);
+ type = customer2.getType();
+ assertNotNull(type.getProperty("custNum"));
+ assertNotNull(type.getProperty("firstName"));
+ assertNotNull(type.getProperty("lastName"));
+ assertEquals(type.getProperty("custNum").getType(), intType);
+ assertEquals(type.getProperty("firstName").getType(), stringType);
+ assertEquals(type.getProperty("lastName").getType(), stringType);
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ xmlHelper.save(
+ customer1,
+ "http://example.com/customer",
+ "Customer", baos);
+ assertTrue(
+ TestUtil.equalXmlFiles(
+ new ByteArrayInputStream(baos.toByteArray()),
+ getClass().getResource(CUSTOMER1_XML)));
+
+ baos = new ByteArrayOutputStream();
+ xmlHelper.save(
+ customer2,
+ "http://example.com/customer",
+ "Customer", baos);
+ assertTrue(
+ TestUtil.equalXmlFiles(
+ new ByteArrayInputStream(baos.toByteArray()),
+ getClass().getResource(CUSTOMER2_XML)));
+ }
+
+ public void testDefineSequencedType() throws Exception
+ {
+
+ TypeHelper types = hc.getTypeHelper();
+ DataFactory factory = hc.getDataFactory();
+ XMLHelper xmlHelper = hc.getXMLHelper();
+
+ Type stringType = types.getType("commonj.sdo", "String");
+ Type decimalType = types.getType("commonj.sdo", "Decimal");
+
+ // Define a new mixed type - MixedQuote
+ DataObject mixedQuoteType = factory.create("commonj.sdo", "Type");
+ mixedQuoteType.set("uri", "http://www.example.com/mixed");
+ mixedQuoteType.set("name", "MixedQuote");
+ mixedQuoteType.set("sequenced", Boolean.TRUE);
+
+ DataObject symbolProperty = mixedQuoteType.createDataObject("property");
+ symbolProperty.set("name", "symbol");
+ symbolProperty.set("type", stringType);
+
+ DataObject companyNameProperty = mixedQuoteType.createDataObject("property");
+ companyNameProperty.set("name", "companyName");
+ companyNameProperty.set("type", stringType);
+
+ DataObject priceProperty = mixedQuoteType.createDataObject("property");
+ priceProperty.set("name", "price");
+ priceProperty.set("type", decimalType);
+
+ DataObject quotesProperty = mixedQuoteType.createDataObject("property");
+ quotesProperty.set("name", "quotes");
+ quotesProperty.set("type", mixedQuoteType);
+ quotesProperty.set("many", Boolean.TRUE);
+ quotesProperty.set("containment", Boolean.TRUE);
+
+ types.define(mixedQuoteType);
+
+ DataObject quote = factory.create("http://www.example.com/mixed", "MixedQuote");
+
+ assertTrue(quote.getType().isSequenced());
+
+ Sequence sequence = quote.getSequence();
+
+ sequence.addText("\n ");
+
+ quote.setString("symbol", "fbnt");
+
+ sequence.addText("\n ");
+
+ quote.setString("companyName", "FlyByNightTechnology");
+
+ sequence.addText("\n some text\n ");
+
+ DataObject child = quote.createDataObject("quotes");
+ child.setBigDecimal("price", new BigDecimal("2000.0"));
+
+ sequence.addText("\n more text\n ");
+
+ // quote.setBigDecimal("price", new BigDecimal("1000.0"));
+ sequence.add("price", new BigDecimal("1000.0"));
+
+ sequence.addText("\n");
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ xmlHelper.save(quote, "http://www.example.com/mixed", "mixedStockQuote", baos);
+ assertTrue(TestUtil.equalXmlFiles(new ByteArrayInputStream(baos.toByteArray()), getClass().getResource(MIXED_XML)));
+ }
+
+ public void testDefineSequencedOpenType() throws Exception
+ {
+ TypeHelper types = hc.getTypeHelper();
+ DataFactory factory = hc.getDataFactory();
+ XMLHelper xmlHelper = hc.getXMLHelper();
+
+ Type stringType = types.getType("commonj.sdo", "String");
+ Type decimalType = types.getType("commonj.sdo", "Decimal");
+
+ // Define a new mixed type - MixedQuote
+ DataObject mixedQuoteType = factory.create("commonj.sdo", "Type");
+ mixedQuoteType.set("uri", "http://www.example.com/mixed");
+ mixedQuoteType.set("name", "MixedOpenQuote");
+ mixedQuoteType.set("sequenced", Boolean.TRUE);
+ mixedQuoteType.set("open", Boolean.TRUE);
+
+// DataObject symbolProperty = mixedQuoteType.createDataObject("property");
+// symbolProperty.set("name", "symbol");
+// symbolProperty.set("type", stringType);
+
+ DataObject companyNameProperty = mixedQuoteType.createDataObject("property");
+ companyNameProperty.set("name", "companyName");
+ companyNameProperty.set("type", stringType);
+
+ DataObject priceProperty = mixedQuoteType.createDataObject("property");
+ priceProperty.set("name", "price");
+ priceProperty.set("type", decimalType);
+
+ DataObject quotesProperty = mixedQuoteType.createDataObject("property");
+ quotesProperty.set("name", "quotes");
+ quotesProperty.set("type", mixedQuoteType);
+ quotesProperty.set("many", Boolean.TRUE);
+ quotesProperty.set("containment", Boolean.TRUE);
+
+ types.define(mixedQuoteType);
+
+ // Define a global type
+ DataObject globalType = factory.create("commonj.sdo", "Type");
+ globalType.set("uri", "http://www.example.com/open");
+ // Don't set the type's name - null is used for types containing global properties.
+
+ DataObject symbolProperty = globalType.createDataObject("property");
+ symbolProperty.set("name", "symbol");
+ symbolProperty.set("type", stringType);
+ symbolProperty.set("containment", Boolean.TRUE);
+
+ types.define(globalType);
+
+ DataObject quote = factory.create("http://www.example.com/mixed", "MixedOpenQuote");
+
+ assertTrue(quote.getType().isSequenced());
+
+ Sequence sequence = quote.getSequence();
+
+ sequence.addText("\n ");
+
+ Type definedGlobalType = types.getType("http://www.example.com/open", "DocumentRoot");
+
+ Property definedSymbolProperty = definedGlobalType.getProperty("symbol");
+ quote.setString(definedSymbolProperty, "fbnt");
+
+ sequence.addText("\n ");
+
+ quote.setString("companyName", "FlyByNightTechnology");
+
+ sequence.addText("\n some text\n ");
+
+ DataObject child = quote.createDataObject("quotes");
+ child.setBigDecimal("price", new BigDecimal("2000.0"));
+
+ sequence.addText("\n more text\n ");
+
+ // quote.setBigDecimal("price", new BigDecimal("1000.0"));
+ sequence.add("price", new BigDecimal("1000.0"));
+
+ sequence.addText("\n");
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ xmlHelper.save(quote, "http://www.example.com/mixed", "mixedOpenStockQuote", baos);
+ assertTrue(TestUtil.equalXmlFiles(new ByteArrayInputStream(baos.toByteArray()), getClass().getResource(MIXEDOPEN_XML)));
+ }
+
+
+ public void testDefineOpenType() throws Exception
+ {
+ TypeHelper types = hc.getTypeHelper();
+ DataFactory factory = hc.getDataFactory();
+ XMLHelper xmlHelper = hc.getXMLHelper();
+
+ Type stringType = types.getType("commonj.sdo", "String");
+ Type decimalType = types.getType("commonj.sdo", "Decimal");
+
+ // Define a new open type - OpenQuote
+ DataObject openQuoteType = factory.create("commonj.sdo", "Type");
+ openQuoteType.set("uri", "http://www.example.com/open");
+ openQuoteType.set("name", "OpenQuote");
+ openQuoteType.set("open", Boolean.TRUE);
+ openQuoteType.setBoolean("open", true);
+
+ types.define(openQuoteType);
+
+ // Define new type - CompanyType
+ DataObject companyType = factory.create("commonj.sdo", "Type");
+ companyType.set("uri", "http://www.example.com/open");
+ companyType.set("name", "CompanyType");
+
+ // Create CompanyType property - "name"
+ DataObject nameProperty = companyType.createDataObject("property");
+ nameProperty.set("name", "name");
+ nameProperty.set("type", stringType);
+ nameProperty.set("containment", Boolean.TRUE);
+
+ types.define(companyType);
+
+ // Define open content property - company
+ DataObject symbolProperty = factory.create("commonj.sdo", "Property");
+ symbolProperty.set("name", "symbol");
+ symbolProperty.set("type", stringType);
+ types.defineOpenContentProperty("http://www.example.com/open", symbolProperty);
+
+ // Define open content property - company
+ DataObject companyProperty = factory.create("commonj.sdo", "Property");
+ companyProperty.set("name", "company");
+ companyProperty.set("type", companyType);
+ companyProperty.set("containment", Boolean.TRUE);
+ types.defineOpenContentProperty("http://www.example.com/open", companyProperty);
+
+ // Define open content property - price
+ DataObject priceProperty = factory.create("commonj.sdo", "Property");
+ priceProperty.set("name", "price");
+ priceProperty.set("type", decimalType);
+ types.defineOpenContentProperty("http://www.example.com/open", priceProperty);
+
+ // Create DataObject instances
+ DataObject openQuote = factory.create("http://www.example.com/open", "OpenQuote");
+ assertTrue(openQuote.getType().isOpen());
+
+ Property definedSymbolProperty = types.getOpenContentProperty("http://www.example.com/open", "symbol");
+ openQuote.set(definedSymbolProperty, "s1");
+
+ Property definedCompanyProperty = types.getOpenContentProperty("http://www.example.com/open", "company");
+ DataObject company = openQuote.createDataObject(definedCompanyProperty);
+ company.setString("name", "FlyByNightTechnology");
+
+ Property definedPriceProperty = types.getOpenContentProperty("http://www.example.com/open", "price");
+ openQuote.setBigDecimal(definedPriceProperty, new BigDecimal("1000.0"));
+
+ assertEquals(definedPriceProperty.getType(), decimalType);
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ xmlHelper.save(
+ openQuote,
+ "http://www.example.com/open",
+ "openStockQuote", baos);
+ assertTrue(
+ TestUtil.equalXmlFiles(
+ new ByteArrayInputStream(baos.toByteArray()),
+ getClass().getResource(OPEN_XML)));
+ }
+
+/**
+ * Type T1 has property t1p of type T2, type T2 has property t2p of type T1.
+ * Ensure that the typehelper can handle this circularity
+ */
+public void testInterdependentTypes()
+ {
+ DataObject t1 = DataFactory.INSTANCE.create("commonj.sdo", "Type");
+ DataObject t1p = DataFactory.INSTANCE.create("commonj.sdo", "Property");
+ DataObject t2 = DataFactory.INSTANCE.create("commonj.sdo", "Type");
+ DataObject t2p = DataFactory.INSTANCE.create("commonj.sdo", "Property");
+
+ t1.set("name", "T1");
+ t1.set("uri", "foo");
+ t2.set("name", "T2");
+ t2.set("uri", "foo");
+
+ t1.getList("property").add(t1p);
+ t2.getList("property").add(t2p);
+ t1p.set("name", "t1p");
+ t1p.set("type", t2);
+ t2p.set("name", "t2p");
+ t2p.set("type", t1);
+
+ List ts = new ArrayList();
+ ts.add(t1);
+ ts.add(t2);
+ List types = hc.getTypeHelper().define(ts);
+
+ Type first = (Type)types.get(0);
+ Type second = (Type)types.get(1);
+
+ Type firstsPropsType = ((Property)first.getProperties().get(0)).getType();
+ Type secondPropsType = ((Property)second.getProperties().get(0)).getType();
+
+ assertNotNull(first);
+ assertNotNull(second);
+ assertEquals(first, secondPropsType);
+ assertEquals(second, firstsPropsType);
+
+ }
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/DeserializationNoSchemaTestCase.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/DeserializationNoSchemaTestCase.java
new file mode 100644
index 0000000000..91fb8152ba
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/DeserializationNoSchemaTestCase.java
@@ -0,0 +1,108 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.test;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.net.URL;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sdo.util.SDOUtil;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.helper.HelperContext;
+import commonj.sdo.helper.TypeHelper;
+import commonj.sdo.helper.XMLDocument;
+import commonj.sdo.helper.XMLHelper;
+
+
+public class DeserializationNoSchemaTestCase extends TestCase
+{
+ HelperContext hc;
+
+ TypeHelper th;
+
+ public void testLoadQuoteXMLDoc() throws IOException
+ {
+ XMLHelper xmlHelper = hc.getXMLHelper();
+ URL url = getClass().getResource("/quote.xml");
+ InputStream inputStream = url.openStream();
+ XMLDocument doc = xmlHelper.load(inputStream);
+ DataObject root = doc.getRootObject();
+
+ List symbols = root.getList("symbol");
+ DataObject symbol = (DataObject)symbols.get(0);
+
+ String seqValue = (String)symbol.getSequence().getValue(0);
+ assertEquals(seqValue, "fbnt");
+
+ //String symbol = root.getString("symbol");
+ //System.out.println("symbol: " + symbol);
+ }
+
+ public void testAnyTypeContainer() throws Exception
+ {
+ HelperContext hc = SDOUtil.createHelperContext();
+
+ URL url = getClass().getResource("/simple.xsd");
+ InputStream inputStream = url.openStream();
+ hc.getXSDHelper().define(inputStream, url.toString());
+
+ XMLHelper xmlHelper = hc.getXMLHelper();
+ url = getClass().getResource("/quoteInSOAP.xml");
+ inputStream = url.openStream();
+ XMLDocument doc = xmlHelper.load(inputStream);
+ DataObject root = doc.getRootObject();
+ DataObject body = (DataObject)root.getList("Body").get(0);
+ DataObject stockQuote = (DataObject)body.getList("stockQuote").get(0);
+
+ //xmlHelper.save(stockQuote, stockQuote.getType().getURI(), "stockQuote", System.out);
+
+ ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ ObjectOutputStream oos = SDOUtil.createObjectOutputStream(bos, hc);
+ oos.writeObject(stockQuote);
+ oos.close();
+ bos.close();
+
+ ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
+ ObjectInputStream ois = SDOUtil.createObjectInputStream(bis, hc);
+ DataObject objectCopy = (DataObject)ois.readObject();
+ ois.close();
+ bis.close();
+
+ assertEquals(objectCopy.getString("symbol"), "fbnt");
+
+ //xmlHelper.save(objectCopy, stockQuote.getType().getURI(), "stockQuote", System.out);
+ }
+
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+
+ hc = SDOUtil.createHelperContext();
+ th = hc.getTypeHelper();
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/DotNameTest.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/DotNameTest.java
new file mode 100644
index 0000000000..476f34c328
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/DotNameTest.java
@@ -0,0 +1,78 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.test;
+
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sdo.util.SDOUtil;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Type;
+import commonj.sdo.helper.DataFactory;
+import commonj.sdo.helper.HelperContext;
+import commonj.sdo.helper.TypeHelper;
+
+
+public class DotNameTest extends TestCase {
+ private final String TEST_MODEL = "/dotNames.xsd";
+ private final String TEST_NAMESPACE = "http://www.example.com/dotNames";
+ private HelperContext hc;
+ private TypeHelper th;
+ private DataFactory df;
+
+ /**
+ * Simple Dynamic SDO 2 test.
+ */
+ public void testDynamic() throws IOException {
+ Type quoteType = th.getType(TEST_NAMESPACE, "DotNameType");
+ DataObject quote = df.create(quoteType);
+
+
+ quote.getList("property.2.1").add(TEST_NAMESPACE);
+ assertTrue(quote.isSet("property.2.1"));
+ assertSame(quote.get("property.2.1.0"), TEST_NAMESPACE);
+ quote.getList("foo.bar").add(TEST_NAMESPACE);
+ assertTrue(quote.isSet("foo.bar"));
+ assertSame(quote.get("foo.bar.0"), TEST_NAMESPACE);
+ }
+
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ // Populate the meta data for the test (Stock Quote) model
+ URL url = getClass().getResource(TEST_MODEL);
+ hc = SDOUtil.createHelperContext();
+ th = hc.getTypeHelper();
+ df = hc.getDataFactory();
+
+ InputStream inputStream = url.openStream();
+ hc.getXSDHelper().define(inputStream, url.toString());
+ inputStream.close();
+
+
+ }
+
+} \ No newline at end of file
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/DynamicTypesComparisonTestCase.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/DynamicTypesComparisonTestCase.java
new file mode 100644
index 0000000000..4c347867e0
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/DynamicTypesComparisonTestCase.java
@@ -0,0 +1,256 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.test;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sdo.util.SDOUtil;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Sequence;
+import commonj.sdo.Type;
+import commonj.sdo.helper.DataFactory;
+import commonj.sdo.helper.HelperContext;
+import commonj.sdo.helper.TypeHelper;
+import commonj.sdo.helper.XMLDocument;
+import commonj.sdo.helper.XMLHelper;
+import commonj.sdo.helper.XSDHelper;
+
+/**
+ * Test to compare data objects created with SDO API with one created from XML
+ */
+public class DynamicTypesComparisonTestCase extends TestCase {
+ private final String COMMONJ_SDO = "commonj.sdo";
+
+ private final String DYNAMIC_ROOT_TYPE_0 = "TestType0";
+
+ private final String DYNAMIC_TYPES_SCHEMA_STRING = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<xsd:schema\n"
+ + " targetNamespace=\"http://www.example.com/dynamicTypesFromSchemaSimple\"\n"
+ + " xmlns:dtfs=\"http://www.example.com/dynamicTypesFromSchemaSimple\"\n"
+ + " xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">\n" + " \n"
+ + " <xsd:complexType name=\"TestType0\" mixed=\"true\">\n" + " <xsd:sequence>\n"
+ + " <xsd:element name=\"aString\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"xsd:string\"/>\n"
+ + " <xsd:element name=\"aBoolean\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"xsd:boolean\"/>\n"
+ + " <xsd:element name=\"aFloat\" minOccurs=\"0\" maxOccurs=\"unbounded\" type=\"xsd:float\"/>\n"
+ + " </xsd:sequence>\n" + " </xsd:complexType>\n" + " \n"
+ + " <xsd:element name=\"testElement0\" type=\"dtfs:TestType0\"/>\n" + " \n" + "</xsd:schema>\n";
+
+ private final String DYNAMIC_TYPES_URI = "http://www.example.com/dynamicTypesFromSchemaSimple";
+
+ private final String SDO_FROM_API_AND_DYN = "object created with API with dynamic type ";
+
+ private final String SDO_FROM_API_AND_REF = "object created with API with type from XSD";
+
+ private final String SDO_FROM_XML_AND_REF = "object created with XML with type from XSD";
+
+ private final String TEST_XML_DOC_0_STRING = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+ + "<dtfs:testElement0 xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
+ + " xmlns:dtfs=\"http://www.example.com/dynamicTypesFromSchemaSimple\">\n"
+ + " <aString>This is a repeated string.</aString>\n" + " <aString>This is a repeated string.</aString>\n"
+ + " <aBoolean>true</aBoolean>\n" + " <aBoolean>false</aBoolean>\n" + " <aBoolean>true</aBoolean>\n"
+ + " <aBoolean>1</aBoolean>\n" + " <aBoolean>0</aBoolean>\n" + " <aFloat>0</aFloat>\n"
+ + " <aFloat>12.5</aFloat>\n" + " <aFloat>0</aFloat>\n" + "</dtfs:testElement0>\n";
+
+ private void comparePropertyObjects(String propName, String name1, String name2, Object propObj1, Object propObj2) {
+ if (propObj1 == null) {
+ if (propObj2 != null) {
+ localFail("property " + propName + " for " + name1 + " was null but " + name2 + " was '" + propObj2
+ + "'");
+ }
+ } else if (propObj2 == null) {
+ localFail("property " + propName + " for " + name2 + " was null but " + name1 + " was '" + propObj1 + "'");
+ } else {
+ if (!propObj1.equals(propObj2)) {
+ localFail("property " + propName + " for " + name1 + " was '" + propObj1 + "' but " + name2 + " was '"
+ + propObj2 + "'");
+ }
+ }
+ }
+
+ private void compareSequencesIgnoringWhitespace(String name1, String name2, Sequence sequence1, Sequence sequence2) {
+ if (sequence1 == null) {
+ if (sequence2 != null) {
+ localFail("sequence for " + name1 + " was null but " + name2 + " was not null");
+ }
+ } else if (sequence2 == null) {
+ localFail("sequence for " + name2 + " was null but " + name1 + " was not null");
+ } else {
+ List trimmedSeq1 = new ArrayList();
+ List trimmedSeq2 = new ArrayList();
+ trimWhitespaceFromSequence(trimmedSeq1, sequence1);
+ trimWhitespaceFromSequence(trimmedSeq2, sequence2);
+ int size1 = trimmedSeq1.size();
+ int size2 = trimmedSeq2.size();
+ if (size1 != size2) {
+ localFail("lengths of trimmed sequences differ: " + name1 + " was " + size1 + ", " + name2 + " was "
+ + size2);
+ } else {
+ Object[] objArr1 = trimmedSeq1.toArray();
+ Object[] objArr2 = trimmedSeq2.toArray();
+ for (int i = 0; i < size1; i++) {
+ Object obj1 = objArr1[i];
+ Object obj2 = objArr2[i];
+ if (obj1 == null) {
+ if (obj2 != null) {
+ localFail("sequence for " + name1 + " had null element for which " + name2 + " had '" + obj2
+ + "'");
+ }
+ } else if (obj2 == null) {
+ localFail("sequence for " + name2 + " had null element for which " + name1 + " had '" + obj1 + "'");
+ } else {
+ if (!obj1.equals(obj2)) {
+ localFail("sequences did not match: " + name1 + " had '" + obj1 + "' but " + name2 + " had '"
+ + obj2 + "'");
+ }
+ }
+ }
+ }
+ }
+ }
+
+ private void getAndCompareProperties(String propName, DataObject xmlAndRefTypDO, DataObject apiAndDynTypDO,
+ DataObject apiAndRefTypDO) {
+ Object xmlRefProperty = xmlAndRefTypDO.get(propName);
+ Object apiDynProperty = apiAndDynTypDO.get(propName);
+ Object apiRefProperty = apiAndRefTypDO.get(propName);
+ comparePropertyObjects(propName, SDO_FROM_XML_AND_REF, SDO_FROM_API_AND_DYN, xmlRefProperty, apiDynProperty);
+ comparePropertyObjects(propName, SDO_FROM_XML_AND_REF, SDO_FROM_API_AND_REF, xmlRefProperty, apiRefProperty);
+ }
+
+ private void localFail(String message) {
+ // System.err.println(message);
+ fail(message);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ private void specifyProperty(DataObject containingTypeDO, String nameString, Type typ, boolean isMany) {
+ DataObject subordinateProperty = containingTypeDO.createDataObject("property");
+ subordinateProperty.set("name", nameString);
+ subordinateProperty.set("type", typ);
+ subordinateProperty.setBoolean("many", isMany);
+ }
+
+ /**
+ * test #0 of Data Object primitive datatypes
+ */
+ public void testDynamicTypesGroup0DO() throws IOException {
+ HelperContext hcDO = SDOUtil.createHelperContext();
+
+ TypeHelper thDO = hcDO.getTypeHelper();
+ DataFactory dfDO = hcDO.getDataFactory();
+
+ // create a container object type
+ DataObject containerTypeDO = dfDO.create("commonj.sdo", "Type");
+ containerTypeDO.set("uri", DYNAMIC_TYPES_URI);
+ containerTypeDO.set("name", DYNAMIC_ROOT_TYPE_0);
+ containerTypeDO.set("sequenced", Boolean.TRUE);
+
+ specifyProperty(containerTypeDO, "aString", thDO.getType(COMMONJ_SDO, "String"), true);
+ specifyProperty(containerTypeDO, "aBoolean", thDO.getType(COMMONJ_SDO, "Boolean"), true);
+ specifyProperty(containerTypeDO, "aFloat", thDO.getType(COMMONJ_SDO, "Float"), true);
+
+ Type containerType = thDO.define(containerTypeDO);
+ assertNotNull(containerType);
+
+ DataObject doFromApiAndDynTyp = dfDO.create(containerType);
+ assertNotNull(doFromApiAndDynTyp);
+ doFromApiAndDynTyp.getList("aString").add("This is a repeated string.");
+ doFromApiAndDynTyp.getList("aString").add("This is a repeated string.");
+ doFromApiAndDynTyp.getList("aBoolean").add(new Boolean(true));
+ doFromApiAndDynTyp.getList("aBoolean").add(new Boolean(false));
+ doFromApiAndDynTyp.getList("aBoolean").add(new Boolean(true));
+ doFromApiAndDynTyp.getList("aBoolean").add(new Boolean(true));
+ doFromApiAndDynTyp.getList("aBoolean").add(new Boolean(false));
+ doFromApiAndDynTyp.getList("aFloat").add(new Float(0));
+ doFromApiAndDynTyp.getList("aFloat").add(new Float(12.5));
+ doFromApiAndDynTyp.getList("aFloat").add(new Float(0));
+
+ Type rootType = thDO.getType(DYNAMIC_TYPES_URI, DYNAMIC_ROOT_TYPE_0);
+ assertNotNull(rootType);
+ assertSame(containerType, rootType);
+
+ // now load xml to get a reference data object using schema
+ HelperContext hcRef = SDOUtil.createHelperContext();
+ XSDHelper xsdHelper = hcRef.getXSDHelper();
+ List typeList = xsdHelper.define(DYNAMIC_TYPES_SCHEMA_STRING);
+ assertNotNull(typeList);
+ TypeHelper thRef = hcRef.getTypeHelper();
+ Type rootTypeRef = thRef.getType(DYNAMIC_TYPES_URI, DYNAMIC_ROOT_TYPE_0);
+
+ assertNotNull(rootTypeRef);
+
+ XMLHelper xhRef = hcRef.getXMLHelper();
+ // XMLDocument docRef =
+ // xhRef.load(getClass().getResourceAsStream(TEST_XML_DOC_0));
+ XMLDocument docRef = xhRef.load(TEST_XML_DOC_0_STRING);
+ DataObject doFromXmlAndRefTyp = docRef.getRootObject();
+
+ assertNotNull(doFromXmlAndRefTyp);
+
+ // create a data object using dynamic API from reference type
+ DataFactory dfRef = hcRef.getDataFactory();
+ DataObject doFromApiAndRefTyp = dfRef.create(rootTypeRef);
+ assertNotNull(doFromApiAndRefTyp);
+ doFromApiAndRefTyp.getList("aString").add("This is a repeated string.");
+ doFromApiAndRefTyp.getList("aString").add("This is a repeated string.");
+ doFromApiAndRefTyp.getList("aBoolean").add(new Boolean(true));
+ doFromApiAndRefTyp.getList("aBoolean").add(new Boolean(false));
+ doFromApiAndRefTyp.getList("aBoolean").add(new Boolean(true));
+ doFromApiAndRefTyp.getList("aBoolean").add(new Boolean(true));
+ doFromApiAndRefTyp.getList("aBoolean").add(new Boolean(false));
+ doFromApiAndRefTyp.getList("aFloat").add(new Float(0));
+ doFromApiAndRefTyp.getList("aFloat").add(new Float(12.5));
+ doFromApiAndRefTyp.getList("aFloat").add(new Float(0));
+
+ getAndCompareProperties("aString", doFromXmlAndRefTyp, doFromApiAndDynTyp, doFromApiAndRefTyp);
+ getAndCompareProperties("aBoolean", doFromXmlAndRefTyp, doFromApiAndDynTyp, doFromApiAndRefTyp);
+ getAndCompareProperties("aFloat", doFromXmlAndRefTyp, doFromApiAndDynTyp, doFromApiAndRefTyp);
+ Sequence seqFromXmlAndRefTyp = doFromXmlAndRefTyp.getSequence();
+ Sequence seqFromApiAndDynTyp = doFromApiAndDynTyp.getSequence();
+ Sequence seqFromApiAndRefTyp = doFromApiAndRefTyp.getSequence();
+ compareSequencesIgnoringWhitespace(SDO_FROM_XML_AND_REF, SDO_FROM_API_AND_DYN, seqFromXmlAndRefTyp,
+ seqFromApiAndDynTyp);
+ compareSequencesIgnoringWhitespace(SDO_FROM_XML_AND_REF, SDO_FROM_API_AND_REF, seqFromXmlAndRefTyp,
+ seqFromApiAndRefTyp);
+ }
+
+ private void trimWhitespaceFromSequence(List trimmedSeq, Sequence sequence) {
+ if (sequence != null) {
+ for (int i = 0; i < sequence.size(); i++) {
+ Object obj = sequence.getValue(i);
+ if (obj instanceof String) {
+ String str = ((String) obj).trim();
+ if (str.length() > 0) {
+ trimmedSeq.add(str);
+ }
+ } else {
+ trimmedSeq.add(obj);
+ }
+ }
+ }
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/FormTestCase.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/FormTestCase.java
new file mode 100644
index 0000000000..e630a8f903
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/FormTestCase.java
@@ -0,0 +1,112 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.test;
+
+import java.io.IOException;
+import java.io.StringReader;
+import java.util.HashMap;
+import java.util.Map;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sdo.util.SDOUtil;
+import org.eclipse.emf.ecore.resource.Resource;
+
+import commonj.sdo.helper.HelperContext;
+import commonj.sdo.helper.XMLHelper;
+
+public class FormTestCase extends TestCase {
+ XMLHelper xmlHelper;
+ Map options;
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ HelperContext hc = SDOUtil.createHelperContext();
+ hc.getXSDHelper().define(
+"<schema xmlns=\"http://www.w3.org/2001/XMLSchema\" targetNamespace=\"testNS\">"+
+ "<element name=\"root\">"+
+ "<complexType>"+
+ "<sequence>"+
+ "<element name=\"unqualifiedElement\" type=\"string\"/>"+
+ "<element name=\"qualifiedElement\" form=\"qualified\" type=\"string\"/>"+
+ "</sequence>"+
+ "<attribute name=\"unqualifiedAttribute\" type=\"string\"/>"+
+ "<attribute name=\"qualifiedAttribute\" form=\"qualified\" type=\"string\"/>"+
+ "</complexType>"+
+ "</element>"+
+"</schema>");
+ xmlHelper = hc.getXMLHelper();
+ options = new HashMap();
+ /*
+ * turn off default behaviour of tolerating malformed xml
+ * tests using this option and bad xml should demonstrate failure to load
+ */
+ options.put(SDOUtil.XML_LOAD_LaxForm, new Integer(0));
+ }
+
+ void load(String xml, Object options) throws IOException {
+ assertNotNull(xmlHelper.load(new StringReader(xml), null, options).getRootObject());
+ }
+
+ /*
+ * this malformed xml will load, as it uses the default lax approach
+ */
+ public void testLaxForm() throws IOException {
+ load(
+"<p:root xmlns:p=\"testNS\" p:unqualifiedAttribute=\"u\" qualifiedAttribute=\"q\">"+
+ "<p:unqualifiedElement/>"+
+ "<qualifiedElement/>"+
+"</p:root>", null);
+ }
+
+ /*
+ * any malformed xml through this method will fail to load
+ * since the options instance member disables lax processing
+ */
+ protected final void load(String xml) throws IOException {
+ try {
+ load(xml, options);
+ fail();
+ } catch (Resource.IOWrappedException featureNotFound) {
+ }
+ }
+
+ public void testUnqualifiedAttribute() throws IOException {
+ load("<p:root xmlns:p=\"testNS\" p:unqualifiedAttribute=\"u\"/>");
+ }
+
+ public void testQualifiedAttribute() throws IOException {
+ load("<p:root xmlns:p=\"testNS\" qualifiedAttribute=\"q\"/>");
+ }
+
+ public void testUnqualifiedElement() throws IOException {
+ load(
+"<p:root xmlns:p=\"testNS\">"+
+ "<p:unqualifiedElement/>"+
+"</p:root>");
+ }
+
+ public void testQualifiedElement() throws IOException {
+ load(
+"<p:root xmlns:p=\"testNS\">"+
+ "<qualifiedElement/>"+
+"</p:root>");
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/HelperContextTestCase.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/HelperContextTestCase.java
new file mode 100644
index 0000000000..14e81b6a32
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/HelperContextTestCase.java
@@ -0,0 +1,75 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.test;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sdo.util.SDOUtil;
+
+import commonj.sdo.helper.CopyHelper;
+import commonj.sdo.helper.DataFactory;
+import commonj.sdo.helper.DataHelper;
+import commonj.sdo.helper.EqualityHelper;
+import commonj.sdo.helper.HelperContext;
+import commonj.sdo.helper.TypeHelper;
+import commonj.sdo.helper.XMLHelper;
+import commonj.sdo.helper.XSDHelper;
+import commonj.sdo.impl.HelperProvider;
+
+public class HelperContextTestCase extends TestCase {
+
+ public void testDefaultHelperContext() {
+ HelperContext defaultHelperContext = HelperProvider.getDefaultContext();
+
+ assertNotNull(defaultHelperContext.getCopyHelper());
+ assertEquals(defaultHelperContext.getCopyHelper(), CopyHelper.INSTANCE);
+ assertNotNull(defaultHelperContext.getDataFactory());
+ assertEquals(defaultHelperContext.getDataFactory(), DataFactory.INSTANCE);
+ assertNotNull(defaultHelperContext.getDataHelper());
+ assertEquals(defaultHelperContext.getDataHelper(), DataHelper.INSTANCE);
+ assertNotNull(defaultHelperContext.getEqualityHelper());
+ assertEquals(defaultHelperContext.getEqualityHelper(), EqualityHelper.INSTANCE);
+ assertNotNull(defaultHelperContext.getTypeHelper());
+ assertEquals(defaultHelperContext.getTypeHelper(), TypeHelper.INSTANCE);
+ assertNotNull(defaultHelperContext.getXMLHelper());
+ assertEquals(defaultHelperContext.getXMLHelper(), XMLHelper.INSTANCE);
+ assertNotNull(defaultHelperContext.getXSDHelper());
+ assertEquals(defaultHelperContext.getXSDHelper(), XSDHelper.INSTANCE);
+
+ }
+
+ public void testCreateHelperContext() {
+ HelperContext hc = SDOUtil.createHelperContext();
+ assertNotNull(hc.getCopyHelper());
+ assertNotNull(hc.getDataFactory());
+ assertNotNull(hc.getDataHelper());
+ assertNotNull(hc.getEqualityHelper());
+ assertNotNull(hc.getTypeHelper());
+ assertNotNull(hc.getXMLHelper());
+ assertNotNull(hc.getXSDHelper());
+
+ assertNotSame(hc.getDataFactory(), DataFactory.INSTANCE);
+ assertNotSame(hc.getTypeHelper(), TypeHelper.INSTANCE);
+ assertNotSame(hc.getXMLHelper(), XMLHelper.INSTANCE);
+ assertNotSame(hc.getXSDHelper(), XSDHelper.INSTANCE);
+ // the other "stateless" helpers may be the same as the singletons
+ }
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/IsManyTestCase.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/IsManyTestCase.java
new file mode 100644
index 0000000000..1eef4ea657
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/IsManyTestCase.java
@@ -0,0 +1,65 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.test;
+
+import java.io.InputStream;
+import java.net.URL;
+
+import org.apache.tuscany.sdo.util.SDOUtil;
+
+import junit.framework.TestCase;
+
+import commonj.sdo.*;
+import commonj.sdo.helper.*;
+
+public class IsManyTestCase extends TestCase {
+ private final String TEST_MODEL = "/open.xsd";
+ private final String TEST_MODEL1ANY = "/open1any.xsd";
+ private final String TEST_NAMESPACE = "http://www.example.com/open";
+ private final String TEST_NAMESPACE1ANY = "http://www.example.com/open1any";
+
+ public void testIsMany() {
+ Property priceProperty = XSDHelper.INSTANCE.getGlobalProperty(TEST_NAMESPACE, "price", true);
+
+ Type quoteType = TypeHelper.INSTANCE.getType(TEST_NAMESPACE, "OpenQuote");
+ DataObject quote = DataFactory.INSTANCE.create(quoteType);
+ assertTrue( SDOUtil.isMany(priceProperty, quote));
+
+ quoteType = TypeHelper.INSTANCE.getType(TEST_NAMESPACE1ANY, "OpenQuote");
+ quote = DataFactory.INSTANCE.create(quoteType);
+ assertFalse( SDOUtil.isMany(priceProperty, quote));
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ // Populate the meta data for the test (Stock Quote) model
+ URL url = getClass().getResource(TEST_MODEL);
+ InputStream inputStream = url.openStream();
+ XSDHelper.INSTANCE.define(inputStream, url.toString());
+ inputStream.close();
+
+ // Populate the meta data for the test (Stock Quote) model with maxOccurs=1 <any>
+ url = getClass().getResource(TEST_MODEL1ANY);
+ inputStream = url.openStream();
+ XSDHelper.INSTANCE.define(inputStream, url.toString());
+ inputStream.close();
+ }
+} \ No newline at end of file
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/JavaSerializeDeserializeTestCase.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/JavaSerializeDeserializeTestCase.java
new file mode 100644
index 0000000000..56a293cde0
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/JavaSerializeDeserializeTestCase.java
@@ -0,0 +1,297 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.test;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sdo.util.SDOUtil;
+
+import commonj.sdo.DataGraph;
+import commonj.sdo.DataObject;
+import commonj.sdo.Type;
+import commonj.sdo.helper.DataFactory;
+import commonj.sdo.helper.HelperContext;
+import commonj.sdo.helper.TypeHelper;
+
+public class JavaSerializeDeserializeTestCase extends TestCase
+{
+
+ public void testScopeDefinedSerializeDeserializeOfDataObject()
+ {
+ HelperContext hc = SDOUtil.createHelperContext();
+ Object originalDataObject = createDynamically(hc,true);
+
+ runSerializeDeserialize((DataObject)originalDataObject, hc);
+ }
+
+ public void testScopeDefinedSerializeDeserializeOfDataGraph()
+ {
+ HelperContext hc = SDOUtil.createHelperContext();
+ DataGraph testDO = (DataGraph)createDynamically(hc,false);
+
+ runSerializeDeserializeWithDataGraph(testDO, hc);
+ }
+
+ private String xsdString = "<xsd:schema targetNamespace=\"http://www.example.com/simple\" " +
+ "xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" " +
+ "xmlns:simple=\"http://www.example.com/simple\">" +
+ "<xsd:element name=\"company\" type=\"simple:Company\"/>" +
+ "<xsd:complexType name=\"Company\">" +
+ "<xsd:sequence>" +
+ "<xsd:element name=\"symbol\" type=\"xsd:string\"/>" +
+ "<xsd:element name=\"companyName\" type=\"xsd:string\"/>" +
+ "<xsd:element name=\"employees\" type=\"simple:Employee\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>" +
+ "</xsd:sequence>" +
+ "</xsd:complexType>" +
+
+ "<xsd:complexType name=\"Employee\">" +
+ "<xsd:sequence>" +
+ "<xsd:element name=\"employeeID\" type=\"xsd:string\"/>" +
+ "<xsd:element name=\"employeeName\" type=\"xsd:string\"/>" +
+ "</xsd:sequence>" +
+ "</xsd:complexType>" +
+ "</xsd:schema>";
+
+ public void testLargePayload()
+ {
+ HelperContext hc = SDOUtil.createHelperContext();
+ hc.getXSDHelper().define(xsdString);
+ DataObject company = hc.getDataFactory().create("http://www.example.com/simple", "Company");
+ company.setString("symbol", "EXAMPLE");
+ company.setString("companyName", "Example Inc.");
+ List employees = company.getList("employees");
+ DataObject employee;
+ for (int i=0; i<1000; i++) {
+ employee = hc.getDataFactory().create("http://www.example.com/simple", "Employee");
+ employee.setString("employeeID", "ID #" + i);
+ employee.setString("employeeName", "Empoyee #" + i);
+ employees.add(employee);
+ }
+ try {
+ ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ ObjectOutputStream oos = SDOUtil.createObjectOutputStream(bos, hc);
+ oos.writeObject(company);
+ oos.flush();
+ byte[] bytes = bos.toByteArray();
+ oos.close();
+ bos.close();
+
+ ByteArrayInputStream bis = new ByteArrayInputStream(bytes);
+ ObjectInputStream ois = SDOUtil.createObjectInputStream(bis, hc);
+ ois.readObject();
+ ois.close();
+ bis.close();
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ fail("An Exception occurred while deserializing the output of the serialization: " + e.toString());
+ }
+ }
+
+
+ /**
+ * Serialize the DataObject then Deserialize the output.
+ * to testDO.
+ * @param testDO
+ * @param scope
+ */
+
+ public void runSerializeDeserialize(DataObject originalDataObject, HelperContext hc)
+ {
+
+ populateFields(originalDataObject);
+ DataObject tempDO = null;
+ ByteArrayOutputStream baos = null;
+
+ try
+ {
+ baos = serialize(originalDataObject, hc);
+
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ fail("An Exception occurred while serializing the DataObject: " + e.toString());
+ }
+
+ try
+ {
+ tempDO = deserialize(baos, hc);
+
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ fail("An Exception occurred while deserializing the output of the serialization: " + e.toString());
+ }
+
+ assertNotNull("Deserialization returned a null value.", tempDO);
+
+ assertSame(tempDO.getType(), originalDataObject.getType());
+
+
+ }
+
+ /**
+ * Serialize the DataGraph
+ * @param dataGraph
+ * @param scope
+ */
+ public void runSerializeDeserializeWithDataGraph(DataGraph dataGraph, HelperContext hc)
+ {
+ DataObject originalDataObject = dataGraph.getRootObject();
+ populateFields(originalDataObject);
+ DataObject tempDO = null;
+ ByteArrayOutputStream baos = null;
+
+ try
+ {
+ baos = serialize(dataGraph, hc);
+
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ fail("An Exception occurred while serializing the DataObject: " + e.toString());
+ }
+
+ try
+ {
+ tempDO = deserialize(baos, hc);
+
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ fail("An Exception occurred while deserializing the output of the serialization: " + e.toString());
+ }
+
+ assertNotNull("Deserialization returned a null value.", tempDO);
+
+ assertSame(tempDO.getType(), originalDataObject.getType());
+
+
+
+ }
+
+ /**
+ * serializeDataObject is a private method to be called by the other methods
+ * in the ScrenarioLibrary
+ *
+ * @param dataObject
+ * @param fileName
+ * @throws IOException
+ */
+ public ByteArrayOutputStream serialize(Object object, HelperContext hc) throws IOException
+ {
+ //FileOutputStream fos = new FileOutputStream("temp");
+ ByteArrayOutputStream byteArrayOutput = new ByteArrayOutputStream();
+ ObjectOutputStream out = SDOUtil.createObjectOutputStream(byteArrayOutput, hc);
+ out.writeObject(object);
+ out.close();
+ return byteArrayOutput;
+ }
+
+ /**
+ * deserializeDataObject is a private method to be called by the other
+ * methods in the ScrenarioLibrary
+ *
+ * @param fileName
+ * @return
+ * @throws IOException
+ * @throws ClassNotFoundException
+ */
+ public DataObject deserialize(ByteArrayOutputStream baos, HelperContext hc) throws IOException, ClassNotFoundException
+ {
+ //FileInputStream fis = new FileInputStream("temp");
+ ObjectInputStream input = null;
+ ByteArrayInputStream byteArrayInput = new ByteArrayInputStream(baos.toByteArray());
+
+ input = SDOUtil.createObjectInputStream(byteArrayInput, hc);
+
+ Object object = input.readObject();
+ input.close();
+ if(object instanceof DataGraph)
+ return ((DataGraph)object).getRootObject();
+ else
+ return (DataObject)object;
+ }
+
+ /**
+ * populateFields uses set<Type> to set each of the fields in the
+ * DataObject. It is used to ensure a known set of expected values that are
+ * not other than the default values for the various fields.
+ *
+ * @param testDO
+ * @throws ExpectedConditionError
+ */
+ public static void populateFields(DataObject testDO)
+ {
+
+ testDO.setString("stringVal", "Testing");
+
+ }
+ /**
+ * createDynamically() creates the SDO Types using the TypeHelper. This method should be kept in
+ * synch with the XSD used for createDynamicallyWithStaticResources. The same XSD is used for
+ * the static generation of SDO Types using XSD2JavaGenerator.
+ */
+ public Object createDynamically(HelperContext hc, boolean createDataObject)
+ {
+
+ TypeHelper types = hc.getTypeHelper();
+ DataFactory dataFactory = hc.getDataFactory();
+
+ Type stringType = types.getType("commonj.sdo", "String");
+
+ DataObject testType = dataFactory.create("commonj.sdo", "Type");
+ testType.set("uri", "http://www.example.com/api_test");
+ testType.set("name", "APITest");
+
+ DataObject stringProperty = testType.createDataObject("property");
+ stringProperty.set("name", "stringVal");
+ stringProperty.set("type", stringType);
+
+
+ List types2Define = new ArrayList();
+ types2Define.add(testType);
+ List apiXSD = types.define(types2Define);
+ Type apiXSDType = (Type) apiXSD.get(0);
+
+ if(createDataObject)
+ return dataFactory.create(apiXSDType);;
+
+ // Create an empty DataGraph and attach the document root to it. Otherwise, where is the documentRoot ?
+ DataGraph dataGraph = SDOUtil.createDataGraph();
+ /*DataObject testDO =*/ dataGraph.createRootObject(apiXSDType);
+
+
+ return dataGraph;
+
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/JiraTestCases.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/JiraTestCases.java
new file mode 100644
index 0000000000..66138495ce
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/JiraTestCases.java
@@ -0,0 +1,184 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.tuscany.sdo.test;
+
+import java.util.List;
+
+import junit.framework.TestCase;
+import commonj.sdo.*;
+import commonj.sdo.helper.*;
+
+import org.apache.tuscany.sdo.util.SDOUtil;
+import java.util.HashMap;
+
+/**
+ * The follow test cases are based upon code snipets in the SDO specification.
+ * They are also implemented as working samples in the sample-sdo artifact
+ *
+ * @author Robbie Minshall
+ *
+ */
+public class JiraTestCases extends TestCase {
+
+ /**
+ * Bogus company namespace
+ */
+ public static final String COMPANY_NAMESPACE = "company.xsd";
+
+ /**
+ * previously defined XSD file used
+ */
+ public static final String COMPANY_XSD = "/company.xsd";
+
+ /**
+ * XML file containing DataGraph representing a company. This xml file
+ * conforms to the company model defined in 'Complete DataGraph for Company
+ * Example' section of the SDO specification
+ */
+ public static final String COMPANY_DATAGRAPH_XML = "/companyDataGraphGenerated.xml";
+
+ /**
+ * Generated DataGraph
+ * {@link org.apache.tuscany.samples.sdo.company.CreateCompany}
+ */
+ public static final String COMPANY_DATAOBJECT_XML = "/companyGenerated.xml";
+
+ /**
+ * Defines xsd resource contained within jar file for PurchaseOrder
+ * DataObject
+ */
+ public static final String PO_XSD_RESOURCE = "/po.xsd";
+
+ /**
+ * Defines xml resource contained within jar file that is used to populate
+ * PurchaseOrder DataObjects
+ */
+ public static final String PO_XML_RESOURCE = "/po.xml";
+
+ /**
+ * previously created XSD file used
+ */
+ public static final String LETTER_XSD = "/letter.xsd";
+
+ /**
+ * JIRA Details : Add a method to SDOUtil to return all Types associated
+ * with a specific URI
+ */
+ public void test_TUSCANY583() {
+
+ // define some types
+ try {
+ XSDHelper.INSTANCE.define(getClass().getResourceAsStream(
+ PO_XSD_RESOURCE), null);
+
+ XSDHelper.INSTANCE.define(getClass().getResourceAsStream(
+ COMPANY_XSD), null);
+
+ createDynamicType();
+
+ String[] expectedPoTypeNames = {"item", "Items",
+ "PurchaseOrderType", "quantity", "SKU", "USAddress"};
+
+ String[] expectedCompanyTypeNames = {"EmployeeType", "DepartmentType", "CompanyType"};
+
+ String[] expectedCustomerTypeNames = {"Customer"};
+
+ confirmTypes("http://www.example.com/PO", expectedPoTypeNames);
+ confirmTypes("company.xsd", expectedCompanyTypeNames);
+ confirmTypes("http://example.com/customer",
+ expectedCustomerTypeNames);
+
+ } catch (Exception e) {
+ fail("Unexpected error " + e.toString());
+ e.printStackTrace();
+ }
+
+ }
+
+ /**
+ * Dynamically define customer Type
+ */
+ public static void createDynamicType() {
+ // get an instance of the type helper
+ TypeHelper typeH = TypeHelper.INSTANCE;
+ Type intType = typeH.getType("commonj.sdo", "Int");
+ Type stringType = typeH.getType("commonj.sdo", "String");
+
+ // create a new Type for Customers
+ DataObject customerType = DataFactory.INSTANCE.create("commonj.sdo",
+ "Type");
+
+ customerType.set("uri", "http://example.com/customer");
+ customerType.set("name", "Customer");
+
+ // create a customer number property
+ DataObject custNumProperty = customerType.createDataObject("property");
+ custNumProperty.set("name", "custNum");
+ custNumProperty.set("type", intType);
+
+ // create a last name property
+ DataObject lastNameProperty = customerType.createDataObject("property");
+ lastNameProperty.set("name", "lastName");
+ lastNameProperty.set("type", stringType);
+
+ // create a first name property
+ DataObject firstNameProperty = customerType
+ .createDataObject("property");
+ firstNameProperty.set("name", "firstName");
+ firstNameProperty.set("type", stringType);
+
+ // now define the Customer type so that customers can be made
+ typeH.define(customerType);
+ }
+
+ private void confirmTypes(String uri, String[] expectedTypeNames) {
+
+ try {
+
+ List actualTypes = SDOUtil.getTypes(TypeHelper.INSTANCE, uri);
+ assertNotNull("Testing that list of types for " + uri
+ + " is not null", actualTypes);
+
+ // test the number of Types
+ assertEquals("Testing number of types for " + uri,
+ expectedTypeNames.length, actualTypes.size());
+
+ // put into a HashMap for easy lookup
+ HashMap typeLookup = new HashMap();
+ for (int i = 0; i < actualTypes.size(); i++) {
+ Type type = (Type) actualTypes.get(i);
+ typeLookup.put(type.getName(), type);
+ }
+
+ // check that we have the same types
+ for (int i = 0; i < expectedTypeNames.length; i++) {
+ assertTrue("testing that type " + expectedTypeNames[i]
+ + "was returned for " + uri, typeLookup
+ .containsKey(expectedTypeNames[i]));
+ }
+
+ } catch (Exception e) {
+ fail("Exception caught comparing expected types to actual types for uri "
+ + uri + ":" + e.toString());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/MetadataInstancePropertiesTestCase.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/MetadataInstancePropertiesTestCase.java
new file mode 100644
index 0000000000..fa3e62946b
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/MetadataInstancePropertiesTestCase.java
@@ -0,0 +1,219 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.test;
+
+import java.io.InputStream;
+import java.net.URL;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sdo.util.SDOUtil;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+import commonj.sdo.helper.DataFactory;
+import commonj.sdo.helper.HelperContext;
+import commonj.sdo.helper.TypeHelper;
+import commonj.sdo.helper.XSDHelper;
+
+
+public class MetadataInstancePropertiesTestCase extends TestCase
+{
+ private final String TEST_MODEL = "/TypePropertyMetadataInfo.xsd";
+ private final String TEST_NAMESPACE = "http://www.example.com/metadata/retrievaltest";
+ private final String DYNAMIC_TEST_NAMESPACE = "http://www.example.com/metadata/dynamicmetadata";
+
+ private TypeHelper typeHelper;
+ private XSDHelper xsdHelper;
+ private DataFactory dataFactory;
+
+ public void testXSDTypeProperties()
+ {
+ // Note: We won't check the actual value of XSD instance properties yet since they're not defined
+ // in the SDO spec yet.
+
+ //displayInstanceProperties(TEST_NAMESPACE);
+
+ Type type = typeHelper.getType(TEST_NAMESPACE, "Example");
+ assertTrue(getInstanceProperty(type, "appinfo") != null);
+ assertTrue(getInstanceProperty(type, "foo") == null);
+
+ Property property = type.getProperty("number");
+ assertTrue(getInstanceProperty(property, "appinfo") != null);
+ assertTrue(getInstanceProperty(property, "foo") == null);
+
+ property = type.getProperty("Exampletype");
+ assertTrue(getInstanceProperty(property, "appinfo") != null);
+ assertTrue(getInstanceProperty(property, "foo") == null);
+
+ type = typeHelper.getType(TEST_NAMESPACE, "ExampleNumber");
+ assertTrue(getInstanceProperty(type, "appinfo") != null);
+ assertTrue(getInstanceProperty(type, "minInclusive") != null);
+ assertTrue(getInstanceProperty(type, "maxInclusive") != null);
+ assertTrue(getInstanceProperty(type, "foo") == null);
+
+ type = typeHelper.getType(TEST_NAMESPACE, "ExampleRating");
+ assertTrue(getInstanceProperty(type, "enumeration") != null);
+ assertTrue(getInstanceProperty(type, "foo") == null);
+
+ type = typeHelper.getType(TEST_NAMESPACE, "PhoneNumber");
+ assertTrue(getInstanceProperty(type, "appinfo") != null);
+ assertTrue(getInstanceProperty(type, "length") != null);
+ assertTrue(getInstanceProperty(type, "pattern") != null);
+ assertTrue(getInstanceProperty(type, "foo") == null);
+ }
+
+ public void testDynamicTypeProperties()
+ {
+ // Create dynamic model
+ Type intType = typeHelper.getType("commonj.sdo", "Int");
+ Type stringType = typeHelper.getType("commonj.sdo", "String");
+
+ Property openContentProperty = typeHelper.getOpenContentProperty("commonj.sdo/xml", "xmlElement");
+
+ // create a new Type for Customers
+ DataObject customerType = dataFactory.create("commonj.sdo", "Type");
+ customerType.set("uri", DYNAMIC_TEST_NAMESPACE);
+ customerType.set("name", "Customer");
+ customerType.set(openContentProperty, Boolean.TRUE);
+
+ // create a customer number property
+ DataObject custNumProperty = customerType.createDataObject("property");
+ custNumProperty.set("name", "custNum");
+ custNumProperty.set("type", intType);
+
+ // create a first name property
+ DataObject firstNameProperty =
+ customerType.createDataObject("property");
+ firstNameProperty.set("name", "firstName");
+ firstNameProperty.set("type", stringType);
+ firstNameProperty.set(openContentProperty, Boolean.FALSE);
+
+ // create a last name property
+ DataObject lastNameProperty = customerType.createDataObject("property");
+ lastNameProperty.set("name", "lastName");
+ lastNameProperty.set("type", stringType);
+
+ // now define the Customer type so that customers can be made
+ typeHelper.define(customerType);
+
+ //displayInstanceProperties(DYNAMIC_TEST_NAMESPACE);
+
+ Type type = typeHelper.getType(DYNAMIC_TEST_NAMESPACE, "Customer");
+ assertTrue(getInstanceProperty(type, "xmlElement") == openContentProperty);
+ assertTrue(type.get(openContentProperty) == Boolean.TRUE);
+ assertTrue(getInstanceProperty(type, "foo") == null);
+
+ Property property = type.getProperty("custNum");
+ assertTrue(getInstanceProperty(property, "xmlElement") == null);
+ assertTrue(getInstanceProperty(property, "foo") == null);
+
+ property = type.getProperty("firstName");
+ assertTrue(getInstanceProperty(property, "xmlElement") == openContentProperty);
+ assertTrue(property.get(openContentProperty) == Boolean.FALSE);
+ assertTrue(getInstanceProperty(property, "foo") == null);
+
+ property = type.getProperty("lastName");
+ assertTrue(getInstanceProperty(property, "xmlElement") == null);
+ assertTrue(getInstanceProperty(property, "foo") == null);
+ }
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+
+ HelperContext helperContext = SDOUtil.createHelperContext();
+
+ typeHelper = helperContext.getTypeHelper();
+ xsdHelper = helperContext.getXSDHelper();
+ dataFactory = helperContext.getDataFactory();
+
+ URL url = getClass().getResource(TEST_MODEL);
+ InputStream inputStream = url.openStream();
+
+ xsdHelper.define(inputStream, url.toString());
+ inputStream.close();
+ }
+
+ public Property getInstanceProperty(Type type, String propertyName)
+ {
+ return getInstanceProperty(type.getInstanceProperties(), propertyName);
+ }
+
+ public Property getInstanceProperty(Property property, String propertyName)
+ {
+ return getInstanceProperty(property.getInstanceProperties(), propertyName);
+ }
+
+ private Property getInstanceProperty(List instProps, String propertyName)
+ {
+ for (int i = 0; i < instProps.size(); i++)
+ {
+ Property prop = (Property)instProps.get(i);
+ if (propertyName.equals(prop.getName()))
+ return prop;
+ }
+ return null;
+ }
+
+ private void displayInstanceProperties(Type type)
+ {
+ System.out.println("Type's name: " + type.getName());
+ List instProps = type.getInstanceProperties();
+ for (int i = 0; i < instProps.size(); i++)
+ {
+ Property prop = (Property)instProps.get(i);
+ System.out.println("\tType's instance property name: " + prop.getName());
+ System.out.println("\tType's instance property value: \"" + type.get(prop) + "\"");
+ }
+ }
+
+ private void displayInstanceProperties(Property prop)
+ {
+ System.out.println("\tProperty's name: " + prop.getName());
+ List propsInstProps = prop.getInstanceProperties();
+ for (int j = 0; j < propsInstProps.size(); j++)
+ {
+ Property propsInstProp = (Property)propsInstProps.get(j);
+ System.out.println("\t\tProperty's instance property name: " + propsInstProp.getName());
+ System.out.println("\t\tProperty's instance property value: \"" + prop.get(propsInstProp) + "\"");
+ }
+ }
+
+ public void displayInstanceProperties(String namespace)
+ {
+ List types = SDOUtil.getTypes(typeHelper, namespace);
+ for (int i = 0; i < types.size(); i++)
+ {
+ Type type = (Type)types.get(i);
+ displayInstanceProperties(type);
+ List properties = type.getProperties();
+ for (int j = 0; j < properties.size(); j++)
+ {
+ Property property = (Property)properties.get(j);
+ displayInstanceProperties(property);
+ }
+ System.out.println("**************************************");
+ }
+ }
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/MixedTypeTestCase.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/MixedTypeTestCase.java
new file mode 100644
index 0000000000..806662a83c
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/MixedTypeTestCase.java
@@ -0,0 +1,89 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.test;
+
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.math.BigDecimal;
+import java.net.URL;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Sequence;
+import commonj.sdo.Type;
+import commonj.sdo.helper.DataFactory;
+import commonj.sdo.helper.TypeHelper;
+import commonj.sdo.helper.XMLHelper;
+import commonj.sdo.helper.XSDHelper;
+import junit.framework.TestCase;
+
+
+public class MixedTypeTestCase extends TestCase {
+ private final String TEST_MODEL = "/mixed.xsd";
+ private final String TEST_NAMESPACE = "http://www.example.com/mixed";
+ private final String TEST_DATA = "/mixed.xml";
+
+ /**
+ * Sequenced type SDO 2 test.
+ */
+ public void testSequencedType() throws IOException {
+ Type quoteType = TypeHelper.INSTANCE.getType(TEST_NAMESPACE, "MixedQuote");
+ DataObject quote = DataFactory.INSTANCE.create(quoteType);
+
+ Sequence sequence = quote.getSequence();
+
+ sequence.add("\n ");
+
+ quote.setString("symbol", "fbnt");
+
+ sequence.add("\n ");
+
+ quote.setString("companyName", "FlyByNightTechnology");
+
+ sequence.add("\n some text\n ");
+
+ DataObject child = quote.createDataObject("quotes");
+ child.setBigDecimal("price", new BigDecimal("2000.0"));
+
+ sequence.add("\n more text\n ");
+
+ // quote.setBigDecimal("price", new BigDecimal("1000.0"));
+ sequence.add("price", new BigDecimal("1000.0"));
+
+ sequence.add("\n");
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ XMLHelper.INSTANCE.save(quote, TEST_NAMESPACE, "mixedStockQuote", baos);
+
+ assertTrue(TestUtil.equalXmlFiles(new ByteArrayInputStream(baos.toByteArray()), getClass().getResource(TEST_DATA)));
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ // Populate the meta data for the test (Stock Quote) model
+ URL url = getClass().getResource(TEST_MODEL);
+ InputStream inputStream = url.openStream();
+ XSDHelper.INSTANCE.define(inputStream, url.toString());
+ inputStream.close();
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/NeverStaleChangeSummaryTestCase.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/NeverStaleChangeSummaryTestCase.java
new file mode 100644
index 0000000000..69c8e447df
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/NeverStaleChangeSummaryTestCase.java
@@ -0,0 +1,76 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.test;
+
+import java.io.InputStream;
+import java.net.URL;
+
+import junit.framework.TestCase;
+
+import commonj.sdo.ChangeSummary;
+import commonj.sdo.DataObject;
+import commonj.sdo.Type;
+import commonj.sdo.helper.DataFactory;
+import commonj.sdo.helper.TypeHelper;
+import commonj.sdo.helper.XSDHelper;
+
+public class NeverStaleChangeSummaryTestCase extends TestCase {
+ private final String TEST_MODEL = "/simpleWithChangeSummary.xsd";
+ private final String TEST_NAMESPACE = "http://www.example.com/simpleCS";
+
+ /**
+ * Simple ChangeSummary test.
+ */
+ public void testChangeSummary() throws Exception {
+ Type quoteType = TypeHelper.INSTANCE.getType(TEST_NAMESPACE, "RootQuote");
+ DataObject quote = DataFactory.INSTANCE.create(quoteType);
+
+ ChangeSummary cs = quote.getChangeSummary();
+
+ // Begin logging changes
+ //
+ cs.beginLogging();
+
+ DataObject child = quote.createDataObject("quotes");
+ cs.isCreated(child);
+ child = quote.createDataObject("quotes");
+ assertTrue(cs.isCreated(child));
+
+ // Stop logging changes and print the resulting data graph to stdout
+ //
+ cs.endLogging();
+
+ cs.isCreated(child);
+
+ cs.undoChanges();
+
+ assertFalse(cs.isCreated(child));
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ // Populate the meta data for the test (Stock Quote) model
+ URL url = getClass().getResource(TEST_MODEL);
+ InputStream inputStream = url.openStream();
+ XSDHelper.INSTANCE.define(inputStream, url.toString());
+ inputStream.close();
+ }
+} \ No newline at end of file
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/OpenTypeTestCase.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/OpenTypeTestCase.java
new file mode 100644
index 0000000000..74570d3b43
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/OpenTypeTestCase.java
@@ -0,0 +1,110 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.test;
+
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.math.BigDecimal;
+import java.net.URL;
+import java.util.Iterator;
+
+import org.apache.tuscany.sdo.util.SDOUtil;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+import commonj.sdo.helper.DataFactory;
+import commonj.sdo.helper.HelperContext;
+import commonj.sdo.helper.TypeHelper;
+import commonj.sdo.helper.XMLHelper;
+import commonj.sdo.helper.XSDHelper;
+import junit.framework.TestCase;
+
+
+public class OpenTypeTestCase extends TestCase {
+ private HelperContext hc;
+ private TypeHelper th;
+ private XSDHelper xsdh;
+ private XMLHelper xmlh;
+ private DataFactory df;
+ private final String TEST_MODEL = "/open.xsd";
+ private final String TEST_NAMESPACE = "http://www.example.com/open";
+ private final String TEST_DATA = "/open.xml";
+
+ /**
+ * Open content SDO 2 test.
+ */
+ public void testOpenType() throws IOException {
+ Type quoteType = th.getType(TEST_NAMESPACE, "OpenQuote");
+ DataObject quote = df.create(quoteType);
+
+ quote.setString("symbol", "s1");
+
+ for (Iterator iter = quote.getInstanceProperties().iterator(); iter.hasNext();) {
+ Property property = (Property) iter.next();
+ }
+
+ Property companyProperty = xsdh.getGlobalProperty(TEST_NAMESPACE, "company", true);
+ DataObject company = quote.createDataObject(companyProperty);
+ company.setString("name", "FlyByNightTechnology");
+
+ Property priceProperty = xsdh.getGlobalProperty(TEST_NAMESPACE, "price", true);
+ quote.getList(priceProperty).add(new BigDecimal("1000.0"));
+
+ for (Iterator iter = quote.getInstanceProperties().iterator(); iter.hasNext();) {
+ Property property = (Property) iter.next();
+ }
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ xmlh.save(quote, TEST_NAMESPACE, "openStockQuote", baos);
+
+ assertTrue(TestUtil.equalXmlFiles(new ByteArrayInputStream(baos.toByteArray()), getClass().getResource(TEST_DATA)));
+ }
+
+
+ public void testOpenType_Tuscany_396() throws IOException {
+ Type quoteType = th.getType(TEST_NAMESPACE, "OpenQuote2");
+ DataObject quote = df.create(quoteType);
+
+ Property priceProperty = xsdh.getGlobalProperty(TEST_NAMESPACE, "price", true);
+ // the importance of this is that the maxOccurs=1 attribute on the xsd:any
+ // allows is to use the !isMany getters and setters for open content
+ quote.set(priceProperty, new BigDecimal("1000.0"));
+
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ // Populate the meta data for the test (Stock Quote) model
+ URL url = getClass().getResource(TEST_MODEL);
+ InputStream inputStream = url.openStream();
+ hc = SDOUtil.createHelperContext();
+ th = hc.getTypeHelper();
+ xsdh = hc.getXSDHelper();
+ df = hc.getDataFactory();
+ xmlh = hc.getXMLHelper();
+ hc.getXSDHelper().define(inputStream, url.toString());
+ inputStream.close();
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/SchemaLocationTestCase.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/SchemaLocationTestCase.java
new file mode 100644
index 0000000000..eaec327007
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/SchemaLocationTestCase.java
@@ -0,0 +1,48 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.test;
+
+import java.io.IOException;
+import java.util.*;
+
+import org.apache.tuscany.sdo.SDOPackage;
+import org.apache.tuscany.sdo.util.SDOUtil;
+
+import junit.framework.TestCase;
+
+import commonj.sdo.helper.*;
+
+public class SchemaLocationTestCase extends TestCase {
+ private final String TEST_XML_DOCUMENT = "/SchemaLocationTestCase.xml";
+
+ /**
+ * This method will load an xml document consisting of a xsi:schemaLocation and xsi:noNamespaceSchemaLocation defined. It will then use the
+ * XMLDocument API to get and set the schemaLocation property.
+ *
+ * @throws IOException
+ */
+ public void testSchemaLocation() throws IOException {
+ // load the xml document which has xsi:noNamespaceSchemaLocation and xsi:schemaLocation defined
+ Map options = new HashMap();
+ options.put(SDOUtil.XML_LOAD_SCHEMA, Boolean.TRUE);
+ XMLDocument doc = XMLHelper.INSTANCE.load(getClass().getResourceAsStream(TEST_XML_DOCUMENT), "whatever", options);
+ assertNotSame(doc.getRootObject().getType(), SDOPackage.eINSTANCE.getAnyTypeDataObject());
+ }
+} \ No newline at end of file
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/SerializeTypesTestCase.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/SerializeTypesTestCase.java
new file mode 100644
index 0000000000..592745e04e
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/SerializeTypesTestCase.java
@@ -0,0 +1,129 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.test;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sdo.util.SDOUtil;
+
+import commonj.sdo.DataGraph;
+import commonj.sdo.DataObject;
+import commonj.sdo.Type;
+import commonj.sdo.helper.DataFactory;
+import commonj.sdo.helper.HelperContext;
+import commonj.sdo.helper.TypeHelper;
+
+public class SerializeTypesTestCase extends TestCase {
+
+ HelperContext hc;
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ hc = SDOUtil.createHelperContext();
+ }
+
+ public void testSerializeTypesRoundTrip() throws Exception {
+ TypeHelper types = hc.getTypeHelper();
+ DataFactory factory = hc.getDataFactory();
+
+ Type intType = types.getType("commonj.sdo", "Int");
+ Type stringType = types.getType("commonj.sdo", "String");
+
+ // create a new Type for Addresses
+ DataObject addressType = factory.create("commonj.sdo", "Type");
+ addressType.set("uri", "http://example.com/address");
+ addressType.set("name", "Address");
+
+ // create a address street property
+ DataObject addrStProperty = addressType.createDataObject("property");
+ addrStProperty.set("name", "addrSt");
+ addrStProperty.set("type", stringType);
+
+ // create a new Type for Customers
+ DataObject customerType = factory.create("commonj.sdo", "Type");
+ customerType.set("uri", "http://example.com/customer");
+ customerType.set("name", "Customer");
+
+ // create a customer number property
+ DataObject custNumProperty = customerType.createDataObject("property");
+ custNumProperty.set("name", "custNum");
+ custNumProperty.set("type", intType);
+
+ // create a first name property
+ DataObject firstNameProperty = customerType.createDataObject("property");
+ firstNameProperty.set("name", "firstName");
+ firstNameProperty.set("type", stringType);
+
+ // create a last name property
+ DataObject lastNameProperty = customerType.createDataObject("property");
+ lastNameProperty.set("name", "lastName");
+ lastNameProperty.set("type", stringType);
+
+ // create an address property
+ DataObject addressProperty = customerType.createDataObject("property");
+ addressProperty.set("name", "address");
+ addressProperty.set("type", addressType);
+ addressProperty.setBoolean("containment", true);
+
+ // now define the Address and Customer type so that addresses and customers can be made
+ List types2define = new ArrayList();
+ types2define.add(addressType);
+ types2define.add(customerType);
+ List typesDefined = types.define(types2define);
+
+ // Create an empty data graph and add a root object, an instance of customerType
+ //
+
+ DataGraph dataGraph = SDOUtil.createDataGraph();
+ Type customerTypeDefined = (Type) typesDefined.get(1);
+ DataObject customer1 = dataGraph.createRootObject(customerTypeDefined);
+
+ customer1.setInt("custNum", 1);
+ customer1.set("firstName", "John");
+ customer1.set("lastName", "Adams");
+ DataObject address = customer1.createDataObject("address");
+ address.set("addrSt", "577 Airport Blvd");
+
+ SDOUtil.registerDataGraphTypes(dataGraph, typesDefined);
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ SDOUtil.saveDataGraph(dataGraph, baos, null);
+ //SDOUtil.saveDataGraph(dataGraph, System.out, null);
+
+ byte[] serialized = baos.toByteArray();
+ ByteArrayInputStream bais = new ByteArrayInputStream(serialized);
+ DataGraph loadedDataGraph = SDOUtil.loadDataGraph(bais, null, SDOUtil.createTypeHelper());
+
+ DataObject loadedRootObject = loadedDataGraph.getRootObject();
+ assertNotSame(loadedRootObject.getType(), customer1.getType());
+
+ // EqualityHelper requires same Type
+ assertEquals(loadedRootObject.getInt("custNum"), customer1.getInt("custNum"));
+ assertEquals(loadedRootObject.get("firstName"), customer1.get("firstName"));
+ assertEquals(loadedRootObject.get("lastName"), customer1.get("lastName"));
+ DataObject loadedAddress = loadedRootObject.getDataObject("address");
+ assertEquals(loadedAddress.get("addrSt"), address.get("addrSt"));
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/SimpleCopyTestCase.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/SimpleCopyTestCase.java
new file mode 100644
index 0000000000..36f038d779
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/SimpleCopyTestCase.java
@@ -0,0 +1,71 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.test;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.helper.CopyHelper;
+import commonj.sdo.helper.XMLDocument;
+import commonj.sdo.helper.XMLHelper;
+import commonj.sdo.helper.XSDHelper;
+import junit.framework.TestCase;
+
+public class SimpleCopyTestCase extends TestCase {
+
+ private final String TEST_MODEL = "/simple.xsd";
+ private final String TEST_NAMESPACE = "http://www.example.com/simple";
+ private final String QUOTE_XML = "/quote.xml";
+ private final String SHALLOW_QUOTE_XML = "/shallowquote.xml";
+
+ public void testSimpleCopy() throws IOException {
+ XMLDocument doc = XMLHelper.INSTANCE.load(getClass().getResourceAsStream(QUOTE_XML));
+ DataObject sdo = doc.getRootObject();
+
+ DataObject copiedSdo = CopyHelper.INSTANCE.copyShallow(sdo);
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ XMLHelper.INSTANCE.save(copiedSdo, TEST_NAMESPACE, "stockQuote", baos);
+ assertTrue(TestUtil.equalXmlFiles(new ByteArrayInputStream(baos.toByteArray()), getClass().getResource(SHALLOW_QUOTE_XML)));
+ assertFalse(TestUtil.equalXmlFiles(new ByteArrayInputStream(baos.toByteArray()), getClass().getResource(QUOTE_XML)));
+
+ copiedSdo = CopyHelper.INSTANCE.copy(sdo);
+
+ baos.reset();
+ XMLHelper.INSTANCE.save(copiedSdo, TEST_NAMESPACE, "stockQuote", baos);
+ assertFalse(TestUtil.equalXmlFiles(new ByteArrayInputStream(baos.toByteArray()), getClass().getResource(SHALLOW_QUOTE_XML)));
+ assertTrue(TestUtil.equalXmlFiles(new ByteArrayInputStream(baos.toByteArray()), getClass().getResource(QUOTE_XML)));
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ // Populate the meta data for the test (Stock Quote) model
+ URL url = getClass().getResource(TEST_MODEL);
+ InputStream inputStream = url.openStream();
+ XSDHelper.INSTANCE.define(inputStream, url.toString());
+ inputStream.close();
+ }
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/SimpleDynamicTestCase.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/SimpleDynamicTestCase.java
new file mode 100644
index 0000000000..55aae9d396
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/SimpleDynamicTestCase.java
@@ -0,0 +1,123 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.test;
+
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.math.BigDecimal;
+import java.net.URL;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sdo.util.SDOUtil;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Type;
+import commonj.sdo.helper.HelperContext;
+import commonj.sdo.helper.TypeHelper;
+
+
+public class SimpleDynamicTestCase extends TestCase {
+ private final String TEST_MODEL = "/simple.xsd";
+ private final String TEST_NAMESPACE = "http://www.example.com/simple";
+ private final String QUOTE_XML = "/quote.xml";
+
+ //private final String TEST_MODEL2 = "/simple2.xsd";
+ //private final String TEST_NAMESPACE2 = "http://www.example.com/simple2";
+ //private final String QUOTE_XML2 = "/quote2.xml";
+
+ HelperContext hc;
+ TypeHelper th;
+
+ /**
+ * Simple Dynamic SDO 2 test.
+ */
+ public void testDynamic() throws IOException {
+ Type quoteType = th.getType(TEST_NAMESPACE, "Quote");
+ DataObject quote = hc.getDataFactory().create(quoteType);
+
+ quote.setString("symbol", "fbnt");
+ quote.setString("companyName", "FlyByNightTechnology");
+ quote.setBigDecimal("price", new BigDecimal("1000.0"));
+ quote.setBigDecimal("open1", new BigDecimal("1000.0"));
+ quote.setBigDecimal("high", new BigDecimal("1000.0"));
+ quote.setBigDecimal("low", new BigDecimal("1000.0"));
+ quote.setDouble("volume", 1000);
+ quote.setDouble("change1", 1000);
+
+ DataObject child = quote.createDataObject("quotes");
+ child.setBigDecimal("price", new BigDecimal("2000.0"));
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ hc.getXMLHelper().save(quote, TEST_NAMESPACE, "stockQuote", baos);
+
+ assertFalse(quote.isSet("undefined"));
+ assertSame(quote.get("undefined"), null);
+
+ assertTrue(TestUtil.equalXmlFiles(new ByteArrayInputStream(baos.toByteArray()), getClass().getResource(QUOTE_XML)));
+ }
+
+ /*
+ public void dontTestResolveXSDWithoutSchemaLocation() throws IOException {
+
+ URL url = getClass().getResource(TEST_MODEL2);
+ InputStream inputStream = url.openStream();
+ hc.getXSDHelper().define(inputStream, null);
+ inputStream.close();
+
+ Type quote2Type = th.getType(TEST_NAMESPACE2, "Quote2");
+ DataObject quote2 = hc.getDataFactory().create(quote2Type);
+
+ quote2.setString("symbol", "fbnt");
+ quote2.setString("companyName", "FlyByNightTechnology");
+ quote2.setBigDecimal("price", new BigDecimal("1000.0"));
+ quote2.setBigDecimal("open1", new BigDecimal("1000.0"));
+ quote2.setBigDecimal("high", new BigDecimal("1000.0"));
+ quote2.setBigDecimal("low", new BigDecimal("1000.0"));
+ quote2.setDouble("volume", 1000);
+ quote2.setDouble("change1", 1000);
+
+ DataObject child = quote2.createDataObject("quotes");
+ child.setBigDecimal("price", new BigDecimal("2000.0"));
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ hc.getXMLHelper().save(quote2, TEST_NAMESPACE2, "stockQuote", System.out);
+ }
+ */
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ hc = SDOUtil.createHelperContext();
+ th = hc.getTypeHelper();
+
+ // Populate the meta data for the test (Stock Quote) model
+ URL url = getClass().getResource(TEST_MODEL);
+ InputStream inputStream = url.openStream();
+ hc.getXSDHelper().define(inputStream, url.toString());
+ inputStream.close();
+
+
+ }
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/SimpleEqualityTestCase.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/SimpleEqualityTestCase.java
new file mode 100644
index 0000000000..c3fffa4f10
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/SimpleEqualityTestCase.java
@@ -0,0 +1,63 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.test;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.helper.EqualityHelper;
+import commonj.sdo.helper.XMLDocument;
+import commonj.sdo.helper.XMLHelper;
+import commonj.sdo.helper.XSDHelper;
+import junit.framework.TestCase;
+
+public class SimpleEqualityTestCase extends TestCase {
+ private static final String TEST_MODEL = "/simple.xsd";
+ private static final String QUOTE_XML = "/quote.xml";
+ private static final String SHALLOW_QUOTE_XML = "/shallowquote.xml";
+
+ public void testEquality() throws IOException {
+
+ XMLDocument doc = XMLHelper.INSTANCE.load(getClass().getResourceAsStream(QUOTE_XML));
+ DataObject sdo = doc.getRootObject();
+
+ doc = XMLHelper.INSTANCE.load(getClass().getResourceAsStream(SHALLOW_QUOTE_XML));
+ DataObject shallowSdo = doc.getRootObject();
+
+ boolean result = EqualityHelper.INSTANCE.equalShallow(sdo, shallowSdo);
+ assertTrue(result);
+
+ result = EqualityHelper.INSTANCE.equal(sdo, shallowSdo);
+ assertFalse(result);
+ }
+
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ // Populate the meta data for the test (Stock Quote) model
+ URL url = getClass().getResource(TEST_MODEL);
+ InputStream inputStream = url.openStream();
+ XSDHelper.INSTANCE.define(inputStream, url.toString());
+ inputStream.close();
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/SubstitutionValuesTestCase.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/SubstitutionValuesTestCase.java
new file mode 100644
index 0000000000..b473503122
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/SubstitutionValuesTestCase.java
@@ -0,0 +1,47 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.test;
+
+import java.io.IOException;
+import java.net.URL;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sdo.util.SDOUtil;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Type;
+import commonj.sdo.helper.DataFactory;
+import commonj.sdo.helper.XSDHelper;
+
+public final class SubstitutionValuesTestCase extends TestCase
+{
+ public void test() throws IOException
+ {
+ URL url = getClass().getResource("/SubstitutionValues.xsd");
+ XSDHelper.INSTANCE.define(url.openStream(), url.toString());
+
+ final DataObject object = DataFactory.INSTANCE.create("http://www.apache.org/tuscany/SubstitutionValues", "TestObject");
+ final Type type = object.getType();
+
+ assertNotNull( SDOUtil.getSubstitutionValues(object, type.getProperty("groupHead")));
+ assertNull( SDOUtil.getSubstitutionValues(object, type.getProperty("nonGroupHead")));
+ }
+} \ No newline at end of file
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/TestUtil.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/TestUtil.java
new file mode 100644
index 0000000000..a7ab3f954a
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/TestUtil.java
@@ -0,0 +1,285 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.test;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.FactoryConfigurationError;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.DocumentType;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+public class TestUtil
+{
+ private static void getAllNodes(NodeList nodeList, List nodes)
+ {
+ int length = nodeList.getLength();
+ if (length == 0)
+ {
+ return;
+ }
+
+ for (int i=0; i<length; i++)
+ {
+ Node node = nodeList.item(i);
+ nodes.add(node);
+ getAllNodes(node.getChildNodes(), nodes);
+ } // for
+ }
+
+ private static boolean equalNamedNodeMap(NamedNodeMap mapA, NamedNodeMap mapB) {
+ if (mapA == null) {
+ if (mapB == null) {
+ return true;
+ }
+ return false;
+ }
+ if (mapA.getLength() != mapB.getLength()) {
+ return false;
+ }
+ for (int i = 0; i < mapA.getLength(); i++) {
+ Node trialNode = mapA.item(i);
+ if (trialNode == null) {
+ return false;
+ }
+ Node checkNode = mapB.getNamedItem(trialNode.getNodeName());
+ if (checkNode == null) {
+ return false;
+ }
+ if (!equalNode(trialNode, checkNode)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ private static boolean equalNode(Node nodeA, Node nodeB) {
+ if (nodeA == null) {
+ if (nodeB == null) {
+ return true;
+ }
+ return false;
+ }
+ // following is intended to provide same function as 1.5 isEqualNode()
+ if (nodeA.getNodeType() != nodeB.getNodeType()) {
+ return false;
+ }
+ if (!equalString(nodeA.getNodeName(), nodeB.getNodeName())) {
+ return false;
+ }
+ if (!equalString(nodeA.getLocalName(), nodeB.getLocalName())) {
+ return false;
+ }
+ if (!equalString(nodeA.getNamespaceURI(), nodeB.getNamespaceURI())) {
+ return false;
+ }
+ if (!equalString(nodeA.getNamespaceURI(), nodeB.getNamespaceURI())) {
+ return false;
+ }
+ if (!equalString(nodeA.getPrefix(), nodeB.getPrefix())) {
+ return false;
+ }
+ if (!equalString(nodeA.getNodeValue(), nodeB.getNodeValue())) {
+ return false;
+ }
+ if (!equalNamedNodeMap(nodeA.getAttributes(), nodeB.getAttributes())) {
+ return false;
+ }
+ if (!equalNodeList(nodeA.getChildNodes(), nodeB.getChildNodes())) {
+ return false;
+ }
+ if (nodeA.getNodeType() == Node.DOCUMENT_TYPE_NODE) {
+ DocumentType documentTypeA = (DocumentType) nodeA;
+ DocumentType documentTypeB = (DocumentType) nodeB;
+ if (!equalString(documentTypeA.getPublicId(), documentTypeB.getPublicId())) {
+ return false;
+ }
+ if (!equalString(documentTypeA.getSystemId(), documentTypeB.getSystemId())) {
+ return false;
+ }
+ if (!equalString(documentTypeA.getInternalSubset(), documentTypeB.getInternalSubset())) {
+ return false;
+ }
+ if (!equalNamedNodeMap(documentTypeA.getEntities(), documentTypeB.getEntities())) {
+ return false;
+ }
+ if (!equalNamedNodeMap(documentTypeA.getNotations(), documentTypeB.getNotations())) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ private static boolean equalNodeList(NodeList nodeListA, NodeList nodeListB) {
+ if (nodeListA == null) {
+ if (nodeListB == null) {
+ return true;
+ }
+ return false;
+ }
+ return equalNodes(nodeListA, nodeListB);
+ }
+
+ private static boolean equalString(String stringA, String stringB) {
+ if (stringA == null) {
+ if (stringB == null) {
+ return true;
+ }
+ return false;
+ }
+ return stringA.equals(stringB);
+ }
+
+ private static boolean equalNodes(NodeList sourceNodeList, NodeList targetNodeList)
+ {
+ ArrayList sourceNodes = new ArrayList();
+ ArrayList targetNodes = new ArrayList();
+
+ getAllNodes(sourceNodeList, sourceNodes);
+ getAllNodes(targetNodeList, targetNodes);
+
+ int sourceLength = sourceNodes.size();
+ int targetLength = targetNodes.size();
+
+ if (sourceLength != targetLength)
+ {
+ return false;
+ }
+
+ for (int i=0; i<sourceLength; i++)
+ {
+ Node sourceNode = (Node)sourceNodes.get(i);
+ Node targetNode = (Node)targetNodes.get(i);
+
+ /* remove comment when migrated to Java 1.5
+ if (!sourceNode.isEqualNode(targetNode))
+ {
+ return false;
+ }
+ */
+ // following is intended as 1.4 equivalent of isEqualNode()
+ if (!equalNode(sourceNode, targetNode))
+ {
+ return false;
+ }
+ } // for
+
+ return true;
+ }
+
+ public static boolean equalXmlFiles(URL source, URL target)
+ {
+ try {
+ return equalXmlFiles(source.openStream(), target.openStream());
+ }
+ catch (IOException e)
+ {
+ return false;
+ }
+ }
+
+ public static boolean equalXmlFiles(InputStream sourceStream, URL target)
+ {
+ try {
+ return equalXmlFiles(sourceStream, target.openStream());
+ }
+ catch (IOException e)
+ {
+ return false;
+ }
+ }
+
+ public static boolean equalXmlFiles(URL source, InputStream targetStream)
+ {
+ try {
+ return equalXmlFiles(source.openStream(), targetStream);
+ }
+ catch (IOException e)
+ {
+ return false;
+ }
+ }
+
+ public static boolean equalXmlFiles(InputStream sourceStream, InputStream targetStream)
+ {
+ DocumentBuilder builder;
+ Document sourceDocument;
+ Document targetDocument;
+
+ try {
+ builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ sourceDocument = builder.parse(sourceStream);
+ targetDocument = builder.parse(targetStream);
+ }
+ catch (FactoryConfigurationError fce) {
+ return false;
+ }
+ catch (ParserConfigurationException ce) {
+ return false;
+ }
+ catch (SAXException se)
+ {
+ return false;
+ }
+ catch (IOException ie)
+ {
+ return false;
+ }
+
+ sourceDocument.normalize();
+ targetDocument.normalize();
+
+ /* remove comment when migrated to Java 1.5
+ if (!sourceDocument.getXmlVersion().equals(targetDocument.getXmlVersion()))
+ {
+ return false;
+ }
+
+ String sourceXmlEncoding = sourceDocument.getXmlEncoding();
+ String targetXmlEncoding = targetDocument.getXmlEncoding();
+
+ if (sourceXmlEncoding != null && targetXmlEncoding != null &&
+ sourceXmlEncoding.equalsIgnoreCase(targetXmlEncoding))
+ {
+ // continue
+ }
+ else
+ {
+ return false;
+ }
+ */
+
+ NodeList sourceNodes = sourceDocument.getChildNodes();
+ NodeList targetNodes = targetDocument.getChildNodes();
+
+ return equalNodes(sourceNodes, targetNodes);
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/TypeConversionTestCase.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/TypeConversionTestCase.java
new file mode 100644
index 0000000000..dffde3ccff
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/TypeConversionTestCase.java
@@ -0,0 +1,889 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sdo.test;
+
+import junit.framework.TestCase;
+
+
+import java.io.InputStream;
+import java.lang.reflect.Method;
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.net.URL;
+import java.text.SimpleDateFormat;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.TimeZone;
+
+import org.apache.tuscany.sdo.util.DataObjectUtil;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+import commonj.sdo.helper.DataFactory;
+import commonj.sdo.helper.TypeHelper;
+import commonj.sdo.helper.XSDHelper;
+
+public class TypeConversionTestCase extends TestCase
+{
+ // The following constants are used to get Types from XSDs
+
+ private static final String TEST_MODEL = "/api_test.xsd";
+ private static final String TEST_NAMESPACE = "http://www.example.com/api_test";
+
+ // The following constants describe the index for the fields in api_test.xsd.
+
+ private static final int STRING_VAL_INDEX = 0;
+ private static final int BOOLEAN_VAL_INDEX = 1;
+ private static final int BYTE_VAL_INDEX = 3;
+ private static final int DECIMAL_VAL_INDEX = 5;
+ private static final int INT_VAL_INDEX = 7;
+ private static final int FLOAT_VAL_INDEX = 8;
+ private static final int DOUBLE_VAL_INDEX = 9;
+ private static final int DATE_VAL_INDEX = 10;
+ private static final int SHORT_VAL_INDEX = 11;
+ private static final int LONG_VAL_INDEX = 12;
+ private static final int BYTES_VAL_INDEX = 14;
+ private static final int INTEGER_VAL_INDEX = 15;
+ private static final int CHAR_VAL_INDEX = 16;
+
+ // The following variables are Method arrays. Each array refers to a specific get<Type>, but within
+ // the array exist the get<Type>(index), get<Type>(property), and get<Type>(path). Rather than
+ // referring to each of the three in every circumstance, the more compact array appears.
+
+ private static ConversionType TO_BOOLEAN = new ConversionType("getBoolean");
+ private static ConversionType TO_BYTE = new ConversionType("getByte");
+ private static ConversionType TO_CHAR = new ConversionType("getChar");
+ private static ConversionType TO_DOUBLE = new ConversionType("getDouble");
+ private static ConversionType TO_FLOAT = new ConversionType("getFloat");
+ private static ConversionType TO_INT = new ConversionType("getInt");
+ private static ConversionType TO_LONG = new ConversionType("getLong");
+ private static ConversionType TO_SHORT = new ConversionType("getShort");
+ private static ConversionType TO_BYTES = new ConversionType("getBytes");
+ private static ConversionType TO_BIGDECIMAL = new ConversionType("getBigDecimal");
+ private static ConversionType TO_BIGINTEGER = new ConversionType("getBigInteger");
+ private static ConversionType TO_DATAOBJECT = new ConversionType("getDataObject");
+ private static ConversionType TO_DATE = new ConversionType("getDate");
+ private static ConversionType TO_STRING = new ConversionType("getString");
+ private static ConversionType TO_LIST = new ConversionType("getList");
+ private static ConversionType TO_SEQUENCE = new ConversionType("getSequence");
+
+ private static GeneralComparator COMPARE_ANY;
+
+ // There will be several instances where a Property must be passed as a parameter. Have available the Type
+ // to call getProperty() as needed.
+
+ private static Type API_TEST_TYPE;
+
+ // The default constructor establishes each of the Method and Method[] variables.
+
+ public TypeConversionTestCase() throws Exception
+ {
+ COMPARE_ANY = new GeneralComparator();
+
+ // Populate the meta data for the test model
+ URL url = getClass().getResource(TEST_MODEL);
+ InputStream inputStream = url.openStream();
+ XSDHelper.INSTANCE.define(inputStream, url.toString());
+ inputStream.close();
+
+ API_TEST_TYPE = TypeHelper.INSTANCE.getType(TEST_NAMESPACE, "APITest");
+ }
+
+ private static class ConversionType
+ {
+ // The following constants are used because the getMethod function requires an Class
+ // array describing the parameters to the functions.
+
+ private static final Class[] INT_CLASS_ARRAY = {int.class};
+ private static final Class[] PROPERTY_CLASS_ARRAY = {Property.class};
+ private static final Class[] STRING_CLASS_ARRAY = {String.class};
+
+ Method index_method;
+ Method property_method;
+ Method path_method;
+
+ public ConversionType (String method_name)
+ {
+ try
+ {
+ this.index_method = DataObject.class.getMethod(method_name, INT_CLASS_ARRAY);
+ this.property_method = DataObject.class.getMethod(method_name, PROPERTY_CLASS_ARRAY);
+ this.path_method = DataObject.class.getMethod(method_name, STRING_CLASS_ARRAY);
+ }
+ catch (NoSuchMethodException e)
+ {
+ this.index_method = null;
+ this.property_method = null;
+ this.path_method = null;
+ }
+ }
+
+ public Method getIndexMethod()
+ {
+ return this.index_method;
+ }
+
+ public Method getPropertyMethod()
+ {
+ return this.property_method;
+ }
+
+ public Method getPathMethod()
+ {
+ return this.path_method;
+ }
+ }
+
+ // Each instance of Test describes a convert-from type. The index, property and path parms
+ // will refer to the same field, which is a field of the convert-from type.
+
+ private static class Test
+ {
+ DataObject test_obj;
+ Object[] index_parm;
+ Object[] property_parm;
+ Object[] path_parm;
+ Object expected_value;
+ String from_type;
+
+ // The constructor prepares a test DataObject and determines how to access the field
+ // in three different ways - index, property, and path.
+
+ Test(String path, int index)
+ {
+ this.test_obj = DataFactory.INSTANCE.create(API_TEST_TYPE);
+ this.index_parm = new Object[] {new Integer(index)};
+ this.property_parm = new Object[] {API_TEST_TYPE.getProperty(path)};
+ this.path_parm = new Object[] {path};
+ this.expected_value = null;
+ }
+
+ // The initialize() function establishes the initial value of the test field.
+
+ public void initialize(Class type, String type_name, Object initial_value) throws Exception
+ {
+ Class[] classArray = {int.class, type};
+ Object[] initValueArray = new Object[] {this.index_parm[0], initial_value};
+
+ Method setter = DataObject.class.getMethod("set" + type_name, classArray);
+ setter.invoke(test_obj, initValueArray);
+ this.expected_value = initial_value;
+ this.from_type = type_name;
+ }
+
+ // Attempts the conversion to the specified type, using DataObject.get____().
+ // The get___() function can be called with an index, path, and property. attemptConversion()
+ // calls each of those three.
+
+ public void attemptConversion(ConversionType to_type) throws Exception
+ {
+ performConversion(to_type.getIndexMethod(), this.index_parm);
+ performConversion(to_type.getPathMethod(), this.path_parm);
+ performConversion(to_type.getPropertyMethod(), this.property_parm);
+ }
+
+ public void checkConversionException(ConversionType to_type, Class expected_exception) throws Exception
+ {
+ boolean index_err, path_err, property_err, consistency_err = false;
+
+ index_err = executeExceptionCase(to_type.getIndexMethod(), this.index_parm, expected_exception);
+ path_err = executeExceptionCase(to_type.getPathMethod(), this.path_parm, expected_exception);
+ property_err = executeExceptionCase(to_type.getPropertyMethod(), this.property_parm, expected_exception);
+
+ if (index_err != path_err || path_err != property_err)
+ consistency_err = true;
+ else if (index_err == false)
+ attemptConversion(to_type);
+
+ assertFalse("An exception inconsistency exists for " + to_type.getPathMethod().getName() + " when called "
+ + "for a " + this.from_type + " property.", consistency_err);
+ }
+
+ private void performConversion (Method convert, Object[] parm) throws Exception
+ {
+ try
+ {
+ assertTrue("Conversion did not yield expected value for " + convert.getName() + " on a " + this.from_type + " property.",
+ COMPARE_ANY.compare(convert.invoke(test_obj, parm), this.expected_value) == 0);
+ }
+ catch (Exception e)
+ {
+ Throwable cause = e.getCause();
+ if (cause == null)
+ {
+ System.err.println("An exception of type " + e.getClass() + " occurred while performing " + convert.getName()
+ + " on a " + this.from_type + " property.");
+ }
+ else
+ {
+ System.err.println("An exception of type " + cause.getClass() + " occurred while performing " + convert.getName()
+ + " on a " + this.from_type + " property.");
+ }
+
+ throw e;
+ }
+
+ }
+
+ private boolean executeExceptionCase (Method convert, Object[] parm, Class expected_exception) throws Exception
+ {
+ boolean exception_thrown = false;
+ try
+ {
+ convert.invoke(test_obj, parm);
+ }
+ catch (Exception e)
+ {
+ exception_thrown = true;
+ Throwable cause = e.getCause();
+ if (cause == null)
+ {
+ assertEquals("An unexpected exception occurred while performing " + convert.getName()
+ + " on a " + this.from_type + " property.", expected_exception, e.getClass());
+ }
+ else
+ {
+ assertEquals("An unexpected exception occurred while performing " + convert.getName()
+ + " on a " + this.from_type + " property.", expected_exception, cause.getClass());
+ }
+ }
+
+ return exception_thrown;
+ }
+ }
+
+ private static class GeneralComparator implements Comparator
+ {
+ public int compare(Object obj1, Object obj2)
+ {
+ if (obj1.getClass() == obj2.getClass())
+ {
+ if (obj1.equals(obj2))
+ return 0;
+ else
+ return 1;
+ }
+
+ else if (obj1.getClass() == Date.class)
+ {
+ if (obj2.getClass() == String.class)
+ {
+ try
+ {
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy'-'MM'-'dd'T'H':'mm':'ss.S");
+
+ sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
+ obj2 = sdf.parse((String) obj2);
+
+ if (obj1.equals(obj2))
+ return 0;
+ }
+ catch (Exception e)
+ {
+ System.out.println(e.getMessage());
+ }
+
+ return 1;
+ }
+
+ else
+ {
+ Date temp = (Date) obj1;
+
+ return compare(new Long(temp.getTime()), obj2);
+ }
+
+ }
+
+ else if (obj2.getClass() == Date.class)
+ {
+ return compare(obj2, obj1);
+ }
+
+ else if (obj1.getClass() == Boolean.class)
+ {
+ Boolean temp = (Boolean) obj1;
+
+ if (temp.booleanValue())
+ {
+ if (obj2.toString().equalsIgnoreCase("true"))
+ return 0;
+ else
+ return 1;
+ }
+
+ else
+ {
+ if (obj2.toString().equalsIgnoreCase("true"))
+ return 1;
+ else
+ return 0;
+ }
+ }
+
+ else if (obj2.getClass() == Boolean.class)
+ return compare(obj2, obj1);
+
+ else if (obj1.getClass() == Byte.class || obj2.getClass() == Byte.class)
+ {
+ byte b1 = (Double.valueOf(obj1.toString())).byteValue();
+ byte b2 = (Double.valueOf(obj2.toString())).byteValue();
+
+ if (b1 == b2)
+ return 0;
+ else if (b1 < b2)
+ return -1;
+ else
+ return 1;
+ }
+
+ else if (obj1.getClass().toString().charAt(6) == '[')
+ {
+ long result = 0;
+ long multiplier = 1;
+
+ byte[] array = (byte[]) obj1;
+ for (int i = 0; i < array.length; i++)
+ {
+ result += array[array.length - i - 1] * multiplier;
+ multiplier *= 256;
+ }
+
+ return compare(obj2, new Long(result));
+ }
+
+ else if (obj2.getClass().toString().charAt(6) == '[')
+ {
+ return compare(obj2, obj1);
+ }
+
+ else if (obj1.getClass() == Short.class || obj2.getClass() == Short.class)
+ {
+ short s1 = (Double.valueOf(obj1.toString())).shortValue();
+ short s2 = (Double.valueOf(obj2.toString())).shortValue();
+
+ if (s1 == s2)
+ return 0;
+ else if (s1 < s2)
+ return -1;
+ else
+ return 1;
+ }
+
+ else if (obj1.getClass() == Integer.class || obj2.getClass() == Integer.class)
+ {
+ int i1 = (Double.valueOf(obj1.toString())).intValue();
+ int i2 = (Double.valueOf(obj2.toString())).intValue();
+
+ if (i1 == i2)
+ return 0;
+ else if (i1 < i2)
+ return -1;
+ else
+ return 1;
+ }
+
+ else if ( obj1.getClass() == Long.class || obj2.getClass() == Long.class
+ || obj1.getClass() == BigInteger.class || obj2.getClass() == BigInteger.class)
+ {
+ long l1 = (Double.valueOf(obj1.toString())).longValue();
+ long l2 = (Double.valueOf(obj2.toString())).longValue();
+
+ if (l1 == l2)
+ return 0;
+ else if (l1 < l2)
+ return -1;
+ else
+ return 1;
+ }
+
+ else if (obj1.getClass() == Float.class || obj2.getClass() == Float.class)
+ {
+ float f1 = (Double.valueOf(obj1.toString())).floatValue();
+ float f2 = (Double.valueOf(obj2.toString())).floatValue();
+
+ if (f1 == f2)
+ return 0;
+ else if (f1 < f2)
+ return -1;
+ else
+ return 1;
+ }
+
+ else if (obj1.getClass() == Double.class || obj2.getClass() == Double.class)
+ {
+ Double b1 = Double.valueOf(obj1.toString());
+ Double b2 = Double.valueOf(obj2.toString());
+
+ return b1.compareTo(b2);
+ }
+
+ else if (obj1.getClass() == BigDecimal.class || obj2.getClass() == BigDecimal.class)
+ {
+ BigDecimal b1 = new BigDecimal(obj1.toString());
+ BigDecimal b2 = new BigDecimal(obj2.toString());
+
+ return b1.compareTo(b2);
+ }
+
+ else
+ {
+ if (obj1.toString().equals(obj2.toString()))
+ return 0;
+ else
+ return 1;
+ }
+ }
+
+ }
+
+ /**********************************************************
+ * In the following test cases, several instances are commented out.
+ * For these cases, the test case currently fails. A JIRA issue (TUSCANY-581) has
+ * been opened to either correct the behavior (then uncomment the lines) or to
+ * alter the specification against which the test cases were designed (and then
+ * remove the lines - assuming the alteration is to remove stating the
+ * nature of the exception).
+ */
+
+ public void testBooleanConversion() throws Exception
+ {
+ Test FromBoolean = new Test("booleanVal", BOOLEAN_VAL_INDEX);
+
+ FromBoolean.initialize(boolean.class, "Boolean", Boolean.valueOf(true));
+
+ FromBoolean.attemptConversion(TO_BOOLEAN);
+ FromBoolean.attemptConversion(TO_STRING);
+ }
+
+ public void testBooleanExceptions() throws Exception
+ {
+ Test FromBoolean = new Test("booleanVal", BOOLEAN_VAL_INDEX);
+
+ FromBoolean.initialize(boolean.class, "Boolean", Boolean.valueOf(true));
+
+// FromBoolean.checkConversionException(TO_BYTE, ClassCastException.class);
+// FromBoolean.checkConversionException(TO_CHAR, ClassCastException.class);
+// FromBoolean.checkConversionException(TO_DOUBLE, ClassCastException.class);
+// FromBoolean.checkConversionException(TO_FLOAT, ClassCastException.class);
+// FromBoolean.checkConversionException(TO_INT, ClassCastException.class);
+// FromBoolean.checkConversionException(TO_LONG, ClassCastException.class);
+// FromBoolean.checkConversionException(TO_SHORT, ClassCastException.class);
+// FromBoolean.checkConversionException(TO_BYTES, ClassCastException.class);
+// FromBoolean.checkConversionException(TO_BIGDECIMAL, ClassCastException.class);
+// FromBoolean.checkConversionException(TO_BIGINTEGER, ClassCastException.class);
+ FromBoolean.checkConversionException(TO_DATAOBJECT, ClassCastException.class);
+// FromBoolean.checkConversionException(TO_DATE, ClassCastException.class);
+ FromBoolean.checkConversionException(TO_LIST, ClassCastException.class);
+ FromBoolean.checkConversionException(TO_SEQUENCE, ClassCastException.class);
+ }
+
+ public void testByteConversion() throws Exception
+ {
+ Test FromByte = new Test("byteVal", BYTE_VAL_INDEX);
+
+ FromByte.initialize(byte.class, "Byte", Byte.valueOf("-127"));
+
+ FromByte.attemptConversion(TO_BYTE);
+ FromByte.attemptConversion(TO_DOUBLE);
+ FromByte.attemptConversion(TO_FLOAT);
+ FromByte.attemptConversion(TO_INT);
+ FromByte.attemptConversion(TO_LONG);
+ FromByte.attemptConversion(TO_SHORT);
+ FromByte.attemptConversion(TO_STRING);
+ }
+
+ public void testByteExceptions() throws Exception
+ {
+ Test FromByte = new Test("byteVal", BYTE_VAL_INDEX);
+
+ FromByte.initialize(byte.class, "Byte", Byte.valueOf("-127"));
+
+// FromByte.checkConversionException(TO_BOOLEAN, ClassCastException.class);
+// FromByte.checkConversionException(TO_CHAR, ClassCastException.class);
+// FromByte.checkConversionException(TO_BYTES, ClassCastException.class);
+ FromByte.checkConversionException(TO_BIGDECIMAL, ClassCastException.class);
+ FromByte.checkConversionException(TO_BIGINTEGER, ClassCastException.class);
+ FromByte.checkConversionException(TO_DATAOBJECT, ClassCastException.class);
+// FromByte.checkConversionException(TO_DATE, ClassCastException.class);
+ FromByte.checkConversionException(TO_LIST, ClassCastException.class);
+ FromByte.checkConversionException(TO_SEQUENCE, ClassCastException.class);
+ }
+
+ public void testCharConversion() throws Exception
+ {
+ Test FromChar = new Test("charVal", CHAR_VAL_INDEX);
+
+ FromChar.initialize(char.class, "Char", new Character('?'));
+
+ FromChar.attemptConversion(TO_CHAR);
+ FromChar.attemptConversion(TO_STRING);
+ }
+
+ public void testCharExceptions() throws Exception
+ {
+ Test FromChar = new Test("charVal", CHAR_VAL_INDEX);
+
+ FromChar.initialize(char.class, "Char", new Character('?'));
+
+// FromChar.checkConversionException(TO_BOOLEAN, ClassCastException.class);
+// FromChar.checkConversionException(TO_BYTE, ClassCastException.class);
+// FromChar.checkConversionException(TO_DOUBLE, ClassCastException.class);
+// FromChar.checkConversionException(TO_FLOAT, ClassCastException.class);
+// FromChar.checkConversionException(TO_INT, ClassCastException.class);
+// FromChar.checkConversionException(TO_LONG, ClassCastException.class);
+// FromChar.checkConversionException(TO_SHORT, ClassCastException.class);
+// FromChar.checkConversionException(TO_BYTES, ClassCastException.class);
+// FromChar.checkConversionException(TO_BIGDECIMAL, ClassCastException.class);
+// FromChar.checkConversionException(TO_BIGINTEGER, ClassCastException.class);
+ FromChar.checkConversionException(TO_DATAOBJECT, ClassCastException.class);
+// FromChar.checkConversionException(TO_DATE, ClassCastException.class);
+ FromChar.checkConversionException(TO_LIST, ClassCastException.class);
+ FromChar.checkConversionException(TO_SEQUENCE, ClassCastException.class);
+ }
+
+ public void testDoubleConversion() throws Exception
+ {
+ Test FromDouble = new Test("doubleVal", DOUBLE_VAL_INDEX);
+
+ FromDouble.initialize(double.class, "Double", new Double(Double.MAX_VALUE));
+
+ FromDouble.attemptConversion(TO_BYTE);
+ FromDouble.attemptConversion(TO_DOUBLE);
+ FromDouble.attemptConversion(TO_FLOAT);
+ FromDouble.attemptConversion(TO_INT);
+ FromDouble.attemptConversion(TO_LONG);
+ FromDouble.attemptConversion(TO_SHORT);
+ FromDouble.attemptConversion(TO_BIGDECIMAL);
+ FromDouble.attemptConversion(TO_BIGINTEGER);
+ FromDouble.attemptConversion(TO_STRING);
+ }
+
+ public void testDoubleExceptions() throws Exception
+ {
+ Test FromDouble = new Test("doubleVal", DOUBLE_VAL_INDEX);
+
+ FromDouble.initialize(double.class, "Double", new Double(Double.MAX_VALUE));
+
+// FromDouble.checkConversionException(TO_BOOLEAN, ClassCastException.class);
+// FromDouble.checkConversionException(TO_CHAR, ClassCastException.class);
+// FromDouble.checkConversionException(TO_BYTES, ClassCastException.class);
+ FromDouble.checkConversionException(TO_DATAOBJECT, ClassCastException.class);
+// FromDouble.checkConversionException(TO_DATE, ClassCastException.class);
+ FromDouble.checkConversionException(TO_LIST, ClassCastException.class);
+ FromDouble.checkConversionException(TO_SEQUENCE, ClassCastException.class);
+ }
+
+ public void testFloatConversion() throws Exception
+ {
+ Test FromFloat = new Test("floatVal", FLOAT_VAL_INDEX);
+
+ FromFloat.initialize(float.class, "Float", new Float(Float.MIN_VALUE));
+
+ FromFloat.attemptConversion(TO_BYTE);
+ FromFloat.attemptConversion(TO_DOUBLE);
+ FromFloat.attemptConversion(TO_FLOAT);
+ FromFloat.attemptConversion(TO_INT);
+ FromFloat.attemptConversion(TO_LONG);
+ FromFloat.attemptConversion(TO_SHORT);
+ FromFloat.attemptConversion(TO_BIGDECIMAL);
+ FromFloat.attemptConversion(TO_BIGINTEGER);
+ FromFloat.attemptConversion(TO_STRING);
+ }
+
+ public void testFloatExceptions() throws Exception
+ {
+ Test FromFloat = new Test("floatVal", FLOAT_VAL_INDEX);
+
+ FromFloat.initialize(float.class, "Float", new Float(Float.MIN_VALUE));
+
+// FromFloat.checkConversionException(TO_BOOLEAN, ClassCastException.class);
+// FromFloat.checkConversionException(TO_CHAR, ClassCastException.class);
+// FromFloat.checkConversionException(TO_BYTES, ClassCastException.class);
+ FromFloat.checkConversionException(TO_DATAOBJECT, ClassCastException.class);
+// FromFloat.checkConversionException(TO_DATE, ClassCastException.class);
+ FromFloat.checkConversionException(TO_LIST, ClassCastException.class);
+ FromFloat.checkConversionException(TO_SEQUENCE, ClassCastException.class);
+ }
+
+ public void testIntConversion() throws Exception
+ {
+ Test FromInt = new Test("intVal", INT_VAL_INDEX);
+
+ FromInt.initialize(int.class, "Int", new Integer(5));
+
+ FromInt.attemptConversion(TO_BYTE);
+ FromInt.attemptConversion(TO_DOUBLE);
+ FromInt.attemptConversion(TO_FLOAT);
+ FromInt.attemptConversion(TO_INT);
+ FromInt.attemptConversion(TO_LONG);
+ FromInt.attemptConversion(TO_SHORT);
+ FromInt.attemptConversion(TO_BIGDECIMAL);
+ FromInt.attemptConversion(TO_BIGINTEGER);
+ FromInt.attemptConversion(TO_STRING);
+ }
+
+ public void testIntExceptions() throws Exception
+ {
+ Test FromInt = new Test("intVal", INT_VAL_INDEX);
+
+ FromInt.initialize(int.class, "Int", new Integer(5));
+
+// FromInt.checkConversionException(TO_BOOLEAN, ClassCastException.class);
+// FromInt.checkConversionException(TO_CHAR, ClassCastException.class);
+// FromInt.checkConversionException(TO_BYTES, ClassCastException.class);
+ FromInt.checkConversionException(TO_DATAOBJECT, ClassCastException.class);
+// FromInt.checkConversionException(TO_DATE, ClassCastException.class);
+ FromInt.checkConversionException(TO_LIST, ClassCastException.class);
+ FromInt.checkConversionException(TO_SEQUENCE, ClassCastException.class);
+ }
+
+ public void testLongConversion() throws Exception
+ {
+ Test FromLong = new Test("longVal", LONG_VAL_INDEX);
+
+ FromLong.initialize(long.class, "Long", new Long(7000L));
+
+ FromLong.attemptConversion(TO_BYTE);
+ FromLong.attemptConversion(TO_DOUBLE);
+ FromLong.attemptConversion(TO_FLOAT);
+ FromLong.attemptConversion(TO_INT);
+ FromLong.attemptConversion(TO_LONG);
+ FromLong.attemptConversion(TO_SHORT);
+ FromLong.attemptConversion(TO_BIGDECIMAL);
+ FromLong.attemptConversion(TO_BIGINTEGER);
+ FromLong.attemptConversion(TO_DATE);
+ FromLong.attemptConversion(TO_STRING);
+ }
+
+ public void testLongExceptions() throws Exception
+ {
+ Test FromLong = new Test("longVal", LONG_VAL_INDEX);
+
+ FromLong.initialize(long.class, "Long", new Long(7000L));
+
+// FromLong.checkConversionException(TO_BOOLEAN, ClassCastException.class);
+// FromLong.checkConversionException(TO_CHAR, ClassCastException.class);
+// FromLong.checkConversionException(TO_BYTES, ClassCastException.class);
+ FromLong.checkConversionException(TO_DATAOBJECT, ClassCastException.class);
+ FromLong.checkConversionException(TO_LIST, ClassCastException.class);
+ FromLong.checkConversionException(TO_SEQUENCE, ClassCastException.class);
+ }
+
+ public void testShortConversion() throws Exception
+ {
+ Test FromShort = new Test("shortVal", SHORT_VAL_INDEX);
+
+ FromShort.initialize(short.class, "Short", new Short("-8000"));
+
+ FromShort.attemptConversion(TO_BYTE);
+ FromShort.attemptConversion(TO_DOUBLE);
+ FromShort.attemptConversion(TO_FLOAT);
+ FromShort.attemptConversion(TO_INT);
+ FromShort.attemptConversion(TO_LONG);
+ FromShort.attemptConversion(TO_SHORT);
+ FromShort.attemptConversion(TO_STRING);
+ }
+
+ public void testShortExceptions() throws Exception
+ {
+ Test FromShort = new Test("shortVal", SHORT_VAL_INDEX);
+
+ FromShort.initialize(short.class, "Short", new Short("-8000"));
+
+// FromShort.checkConversionException(TO_BOOLEAN, ClassCastException.class);
+// FromShort.checkConversionException(TO_CHAR, ClassCastException.class);
+// FromShort.checkConversionException(TO_BYTES, ClassCastException.class);
+ FromShort.checkConversionException(TO_BIGDECIMAL, ClassCastException.class);
+ FromShort.checkConversionException(TO_BIGINTEGER, ClassCastException.class);
+ FromShort.checkConversionException(TO_DATAOBJECT, ClassCastException.class);
+// FromShort.checkConversionException(TO_DATE, ClassCastException.class);
+ FromShort.checkConversionException(TO_LIST, ClassCastException.class);
+ FromShort.checkConversionException(TO_SEQUENCE, ClassCastException.class);
+ }
+
+ public void testStringConversion() throws Exception
+ {
+ Test FromString = new Test("stringVal", STRING_VAL_INDEX);
+
+ FromString.initialize(String.class, "String", "5");
+
+ FromString.attemptConversion(TO_BOOLEAN);
+ FromString.attemptConversion(TO_BYTE);
+ FromString.attemptConversion(TO_CHAR);
+ FromString.attemptConversion(TO_DOUBLE);
+ FromString.attemptConversion(TO_FLOAT);
+ FromString.attemptConversion(TO_INT);
+ FromString.attemptConversion(TO_LONG);
+ FromString.attemptConversion(TO_SHORT);
+ FromString.attemptConversion(TO_BIGDECIMAL);
+ FromString.attemptConversion(TO_BIGINTEGER);
+ FromString.attemptConversion(TO_STRING);
+
+ FromString.initialize(String.class, "String", "1999-07-25T8:50:14.33Z");
+ FromString.attemptConversion(TO_DATE);
+ }
+
+ public void testStringExceptions() throws Exception
+ {
+ Test FromString = new Test("stringVal", STRING_VAL_INDEX);
+
+ FromString.initialize(String.class, "String", "5");
+
+// FromString.checkConversionException(TO_BYTES, ClassCastException.class);
+ FromString.checkConversionException(TO_DATAOBJECT, ClassCastException.class);
+ FromString.checkConversionException(TO_LIST, ClassCastException.class);
+ FromString.checkConversionException(TO_SEQUENCE, ClassCastException.class);
+ }
+
+ public void testBytesConversion() throws Exception
+ {
+ Test FromBytes = new Test("bytesVal", BYTES_VAL_INDEX);
+
+ FromBytes.initialize(byte[].class, "Bytes", new byte[] {10,100});
+
+ FromBytes.attemptConversion(TO_BYTES);
+ FromBytes.attemptConversion(TO_BIGINTEGER);
+ }
+
+ public void testBytesExceptions() throws Exception
+ {
+ Test FromBytes = new Test("bytesVal", BYTES_VAL_INDEX);
+
+ FromBytes.initialize(byte[].class, "Bytes", new byte[] {10,100});
+
+// FromBytes.checkConversionException(TO_BOOLEAN, ClassCastException.class);
+// FromBytes.checkConversionException(TO_BYTE, ClassCastException.class);
+// FromBytes.checkConversionException(TO_CHAR, ClassCastException.class);
+// FromBytes.checkConversionException(TO_DOUBLE, ClassCastException.class);
+// FromBytes.checkConversionException(TO_FLOAT, ClassCastException.class);
+// FromBytes.checkConversionException(TO_INT, ClassCastException.class);
+// FromBytes.checkConversionException(TO_LONG, ClassCastException.class);
+// FromBytes.checkConversionException(TO_SHORT, ClassCastException.class);
+// FromBytes.checkConversionException(TO_BIGDECIMAL, ClassCastException.class);
+ FromBytes.checkConversionException(TO_DATAOBJECT, ClassCastException.class);
+// FromBytes.checkConversionException(TO_DATE, ClassCastException.class);
+// FromBytes.checkConversionException(TO_STRING, ClassCastException.class);
+ FromBytes.checkConversionException(TO_LIST, ClassCastException.class);
+ FromBytes.checkConversionException(TO_SEQUENCE, ClassCastException.class);
+ }
+
+ public void testBigDecimalConversion() throws Exception
+ {
+ Test FromBigDecimal = new Test("decimalVal", DECIMAL_VAL_INDEX);
+
+ FromBigDecimal.initialize(BigDecimal.class, "BigDecimal", new BigDecimal("-3"));
+
+ FromBigDecimal.attemptConversion(TO_DOUBLE);
+ FromBigDecimal.attemptConversion(TO_FLOAT);
+ FromBigDecimal.attemptConversion(TO_INT);
+ FromBigDecimal.attemptConversion(TO_LONG);
+ FromBigDecimal.attemptConversion(TO_BIGDECIMAL);
+ FromBigDecimal.attemptConversion(TO_BIGINTEGER);
+ FromBigDecimal.attemptConversion(TO_STRING);
+ }
+
+ public void testBigDecimalExceptions() throws Exception
+ {
+ Test FromBigDecimal = new Test("decimalVal", DECIMAL_VAL_INDEX);
+
+ FromBigDecimal.initialize(BigDecimal.class, "BigDecimal", new BigDecimal("-3"));
+
+// FromBigDecimal.checkConversionException(TO_BOOLEAN, ClassCastException.class);
+// FromBigDecimal.checkConversionException(TO_BYTE, ClassCastException.class);
+// FromBigDecimal.checkConversionException(TO_CHAR, ClassCastException.class);
+// FromBigDecimal.checkConversionException(TO_SHORT, ClassCastException.class);
+// FromBigDecimal.checkConversionException(TO_BYTES, ClassCastException.class);
+ FromBigDecimal.checkConversionException(TO_DATAOBJECT, ClassCastException.class);
+// FromBigDecimal.checkConversionException(TO_DATE, ClassCastException.class);
+ FromBigDecimal.checkConversionException(TO_LIST, ClassCastException.class);
+ FromBigDecimal.checkConversionException(TO_SEQUENCE, ClassCastException.class);
+ }
+
+ public void testBigIntegerConversion() throws Exception
+ {
+ Test FromBigInteger = new Test("integerVal", INTEGER_VAL_INDEX);
+
+ FromBigInteger.initialize(BigInteger.class, "BigInteger", new BigInteger("31500"));
+
+ FromBigInteger.attemptConversion(TO_DOUBLE);
+ FromBigInteger.attemptConversion(TO_FLOAT);
+ FromBigInteger.attemptConversion(TO_INT);
+ FromBigInteger.attemptConversion(TO_LONG);
+ FromBigInteger.attemptConversion(TO_SHORT);
+ FromBigInteger.attemptConversion(TO_BYTES);
+ FromBigInteger.attemptConversion(TO_BIGDECIMAL);
+ FromBigInteger.attemptConversion(TO_BIGINTEGER);
+ FromBigInteger.attemptConversion(TO_STRING);
+ }
+
+ public void testBigIntegerExceptions() throws Exception
+ {
+ Test FromBigInteger = new Test("integerVal", INTEGER_VAL_INDEX);
+
+ FromBigInteger.initialize(BigInteger.class, "BigInteger", new BigInteger("31500"));
+
+// FromBigInteger.checkConversionException(TO_BOOLEAN, ClassCastException.class);
+// FromBigInteger.checkConversionException(TO_BYTE, ClassCastException.class);
+// FromBigInteger.checkConversionException(TO_CHAR, ClassCastException.class);
+ FromBigInteger.checkConversionException(TO_DATAOBJECT, ClassCastException.class);
+// FromBigInteger.checkConversionException(TO_DATE, ClassCastException.class);
+ FromBigInteger.checkConversionException(TO_LIST, ClassCastException.class);
+ FromBigInteger.checkConversionException(TO_SEQUENCE, ClassCastException.class);
+ }
+
+ public void testDateConversion() throws Exception
+ {
+ Test FromDate = new Test("dateVal", DATE_VAL_INDEX);
+
+ FromDate.initialize(Date.class, "Date", new Date(System.currentTimeMillis()));
+
+ FromDate.attemptConversion(TO_LONG);
+ FromDate.attemptConversion(TO_DATE);
+ FromDate.attemptConversion(TO_STRING);
+ }
+
+ public void testDateExceptions() throws Exception
+ {
+ Test FromDate = new Test("dateVal", DATE_VAL_INDEX);
+
+ FromDate.initialize(Date.class, "Date", new Date(System.currentTimeMillis()));
+
+// FromDate.checkConversionException(TO_BOOLEAN, ClassCastException.class);
+// FromDate.checkConversionException(TO_BYTE, ClassCastException.class);
+// FromDate.checkConversionException(TO_CHAR, ClassCastException.class);
+// FromDate.checkConversionException(TO_DOUBLE, ClassCastException.class);
+// FromDate.checkConversionException(TO_FLOAT, ClassCastException.class);
+// FromDate.checkConversionException(TO_INT, ClassCastException.class);
+// FromDate.checkConversionException(TO_SHORT, ClassCastException.class);
+// FromDate.checkConversionException(TO_BYTES, ClassCastException.class);
+// FromDate.checkConversionException(TO_BIGDECIMAL, ClassCastException.class);
+// FromDate.checkConversionException(TO_BIGINTEGER, ClassCastException.class);
+ FromDate.checkConversionException(TO_DATAOBJECT, ClassCastException.class);
+ FromDate.checkConversionException(TO_LIST, ClassCastException.class);
+ FromDate.checkConversionException(TO_SEQUENCE, ClassCastException.class);
+ }
+
+ public void testTuscany_836() {
+ assertEquals(DataObjectUtil.getBigDecimal(new Long(Long.MAX_VALUE)).longValue(), Long.MAX_VALUE);
+ }
+} \ No newline at end of file
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/TypeRoundTripTestCase.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/TypeRoundTripTestCase.java
new file mode 100644
index 0000000000..52bc78345b
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/TypeRoundTripTestCase.java
@@ -0,0 +1,148 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.test;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sdo.util.SDOUtil;
+
+import commonj.sdo.Type;
+import commonj.sdo.helper.DataHelper;
+import commonj.sdo.helper.TypeHelper;
+
+public class TypeRoundTripTestCase extends TestCase {
+
+ private static class Test {
+ Type type;
+ String value;
+ Object obj;
+ Comparator comp;
+
+ Test(Type type, String value, Object obj) {
+ this.type = type;
+ this.value = value;
+ this.obj = obj;
+ }
+
+ Test(Type type, String value, Object obj, Comparator comp) {
+ this.type = type;
+ this.value = value;
+ this.obj = obj;
+ this.comp = comp;
+ }
+ }
+
+ private static class ListComparator implements Comparator {
+ public int compare(Object list1, Object list2) {
+ int answer = 1;
+ if (list1 instanceof List && list2 instanceof List) {
+ List l1 = (List) list1;
+ List l2 = (List) list2;
+ if (l1.size() == l2.size()) {
+ for (int n = 0; n < l1.size(); n++) {
+ if (!l1.get(n).equals(l2.get(n))) {
+ answer = 0;
+ break;
+ }
+ }
+ } else {
+ answer = 0;
+ }
+ } else {
+ answer = 0;
+ }
+ return answer;
+ }
+ }
+
+ private static class BytesComparator implements Comparator {
+ public int compare(Object o1, Object o2) {
+ o2 = new String((byte[])o2);
+ if (o1.equals(o2)) return 1;
+ else return 0;
+ }
+ }
+
+ public void testTypeRoundTrips() throws Exception {
+ String URI = "commonj.sdo";
+ TypeHelper types = TypeHelper.INSTANCE;
+
+ List list = new ArrayList();
+ list.add("foo");
+ list.add("bar");
+ list.add("test");
+ Test[] tests = {
+ new Test(types.getType(URI, "Base64Bytes"), "SGVsbG8gV29ybGQ=", "Hello World", new BytesComparator()),
+ new Test(types.getType(URI, "Boolean"), "true", new Boolean(true)),
+ new Test(types.getType(URI, "Byte"), "49", new Byte((byte)49)),
+ new Test(types.getType(URI, "Bytes"), "666F6F", "foo", new BytesComparator()),
+ new Test(types.getType(URI, "Character"), "a", new Character('a')),
+ new Test(types.getType(URI, "Date"), "2005-12-12T12:12:12.012Z", DataHelper.INSTANCE.toDate("2005-12-12T12:12:12.012Z")),
+ new Test(types.getType(URI, "DateTime"), "2005-12-12T12:12:12zz", "2005-12-12T12:12:12zz"),
+ new Test(types.getType(URI, "Day"), "---12", "---12"),
+ new Test(types.getType(URI, "Decimal"), "12.12", new BigDecimal("12.12")),
+ new Test(types.getType(URI, "Double"), "12.12", new Double(12.12)),
+ new Test(types.getType(URI, "Duration"), "P5Y2M10D", "P5Y2M10D"),
+ new Test(types.getType(URI, "Float"), "12.12", new Float(12.12f)),
+ new Test(types.getType(URI, "Int"), "12", new Integer(12)),
+ new Test(types.getType(URI, "Integer"), "12", new BigInteger("12")),
+ new Test(types.getType(URI, "Long"), "12", new Long(12l)),
+ new Test(types.getType(URI, "Month"), "--12", "--12"),
+ new Test(types.getType(URI, "MonthDay"), "--12-12", "--12-12"),
+ new Test(types.getType(URI, "Object"), "test", "test"),
+ new Test(types.getType(URI, "Short"), "12", new Short((short)12)),
+ new Test(types.getType(URI, "String"), "test", "test"),
+ new Test(types.getType(URI, "Strings"), "foo bar test", list, new ListComparator()),
+ new Test(types.getType(URI, "Time"), "12:12:12.12", "12:12:12.12"),
+ new Test(types.getType(URI, "URI"), "http://example.org", "http://example.org"),
+ new Test(types.getType(URI, "Year"), "2005", "2005"),
+ new Test(types.getType(URI, "YearMonth"), "2005-12", "2005-12"),
+ new Test(types.getType(URI, "YearMonthDay"), "2005-12-12", "2005-12-12")
+ };
+
+ for (int n = 0; n < tests.length; n++) {
+ assertEquals(
+ SDOUtil.convertToString(tests[n].type, SDOUtil.createFromString(tests[n].type, tests[n].value)),
+ tests[n].value
+ );
+
+ //System.out.print(".");
+
+ if (tests[n].comp == null) {
+ assertEquals(
+ SDOUtil.createFromString(tests[n].type, SDOUtil.convertToString(tests[n].type, tests[n].obj)),
+ tests[n].obj
+ );
+ } else {
+ String o1 = SDOUtil.convertToString(tests[n].type, tests[n].obj);
+ Object o2 = SDOUtil.createFromString(tests[n].type, o1);
+ assertEquals(tests[n].comp.compare(tests[n].obj, o2), 1);
+ }
+ }
+
+ }
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/XMLDocumentTestCase.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/XMLDocumentTestCase.java
new file mode 100644
index 0000000000..1cf59757ef
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/XMLDocumentTestCase.java
@@ -0,0 +1,110 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.test;
+
+
+import java.io.IOException;
+
+import junit.framework.TestCase;
+
+import commonj.sdo.helper.XMLDocument;
+import commonj.sdo.helper.XMLHelper;
+
+
+public class XMLDocumentTestCase extends TestCase
+{
+ private final String TEST_XML_DOCUMENT = "/XMLDocumentTestCase.xml";
+
+ // remember that NS1... and NS2... items are expected in sorted order by name
+ private final String NS1_SCHEMA_NAME = "http://www.example.com/open";
+
+ private final String NS1_SCHEMA_LOCATION = "/open.xsd";
+
+ private final String NS2_SCHEMA_NAME = "http://www.example.com/xmlDocumentSchemaLocation";
+
+ private final String NS2_SCHEMA_LOCATION = "/XMLDocumentSchemaLocation.xsd";
+
+ private final String NS_SET_NAME_LOCATION = "namespace schemaLocation";
+
+ //private final String NNS_SCHEMA_LOCATION = "http://www.example.com/XMLDocumentNoNamespaceSchemaLocation.xsd";
+ private final String NNS_SCHEMA_LOCATION = "/XMLDocumentNoNamespaceSchemaLocation.xsd";
+
+ private final String NNS_SET_LOCATION = "noNamespaceSchemaLocation";
+
+ /**
+ * This method will load an xml document consisting of a xsi:schemaLocation and
+ * xsi:noNamespaceSchemaLocation defined. It will then use the XMLDocument API to get and
+ * set the schemaLocation property.
+ *
+ * @throws IOException
+ */
+ public void testSchemaLocation() throws IOException
+ {
+ // load the xml document which has xsi:noNamespaceSchemaLocation and xsi:schemaLocation defined
+ XMLDocument doc = XMLHelper.INSTANCE.load(getClass().getResourceAsStream(TEST_XML_DOCUMENT));
+
+ // get the schemaLocation
+ assertEquals(NS1_SCHEMA_NAME + " " + NS1_SCHEMA_LOCATION + " " + NS2_SCHEMA_NAME + " " + NS2_SCHEMA_LOCATION, doc.getSchemaLocation());
+
+ // set the schemaLocation to another value and test to see if the value was set
+ doc.setSchemaLocation(NS_SET_NAME_LOCATION);
+ assertEquals(NS_SET_NAME_LOCATION, doc.getSchemaLocation());
+
+ // remove the schemaLocation and ensure it returns null
+ doc.setSchemaLocation(null);
+ assertNull(doc.getSchemaLocation());
+
+ // ensure changes to schemaLocation have not changed noNamespaceSchemaLocation
+ assertEquals(NNS_SCHEMA_LOCATION, doc.getNoNamespaceSchemaLocation());
+ }
+
+ /**
+ * This method will load an xml document consisting of a xsi:schemaLocation and
+ * xsi:noNamespaceSchemaLocation defined. It will then use the XMLDocument API to get and
+ * set the noNamespaceSchemaLocation property.
+ *
+ * @throws IOException
+ */
+ public void testNoNamespaceSchemaLocation() throws IOException
+ {
+ // load the xml document which has xsi:noNamespaceSchemaLocation and xsi:schemaLocation defined
+ XMLDocument doc = XMLHelper.INSTANCE.load(getClass().getResourceAsStream(TEST_XML_DOCUMENT));
+
+ // get the noNamespaceSchemaLocation
+ assertEquals(NNS_SCHEMA_LOCATION, doc.getNoNamespaceSchemaLocation());
+
+ // set the noNameSpaceSchemaLocation to another value and test to see if the value was set
+ doc.setNoNamespaceSchemaLocation(NNS_SET_LOCATION);
+ assertEquals(NNS_SET_LOCATION, doc.getNoNamespaceSchemaLocation());
+
+ // remove the noNameSpaceSchemaLocation and ensure it returns null
+ doc.setNoNamespaceSchemaLocation(null);
+ assertNull(doc.getNoNamespaceSchemaLocation());
+
+ // ensure changes to noNameSpaceSchemaLocation have not changed schemaLocation
+ assertEquals(NS1_SCHEMA_NAME + " " + NS1_SCHEMA_LOCATION + " " + NS2_SCHEMA_NAME + " " + NS2_SCHEMA_LOCATION, doc.getSchemaLocation());
+ }
+
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ }
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/XMLHelperTestCase.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/XMLHelperTestCase.java
new file mode 100644
index 0000000000..ffa9b5ed94
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/XMLHelperTestCase.java
@@ -0,0 +1,161 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.test;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sdo.util.SDOUtil;
+
+import commonj.sdo.helper.HelperContext;
+import commonj.sdo.helper.XMLDocument;
+import commonj.sdo.helper.XMLHelper;
+import commonj.sdo.helper.XSDHelper;
+
+public class XMLHelperTestCase extends TestCase {
+
+ HelperContext hc;
+ private XSDHelper xsdHelper;
+ XMLHelper xmlh;
+ static final String INDENT = " ", MARGIN = " ", LINE_BREAK = "\n\n";
+
+ void define(String model) throws Exception {
+ // Populate the meta data for the test model
+ URL url = getClass().getResource(model);
+ xsdHelper.define(url.openStream(), url.toString());
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ hc = SDOUtil.createHelperContext();
+ xsdHelper = hc.getXSDHelper();
+ xmlh = hc.getXMLHelper();
+
+ // Populate the meta data for the test (Stock Quote) model
+ define("/simpleWithChangeSummary.xsd");
+
+ define("/SequenceChangeSummary.xsd");
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ public void testLoadInputStreamStringObject() throws IOException {
+
+ }
+
+ protected final void format(String xml,String formatted) throws IOException {
+ XMLDocument doc = xmlh.load(getClass().getResource(xml).openStream());
+ Map options = new HashMap();
+
+ options.put(SDOUtil.XML_SAVE_INDENT, INDENT);
+ options.put(SDOUtil.XML_SAVE_MARGIN, MARGIN);
+ options.put(SDOUtil.XML_SAVE_LineBreak, LINE_BREAK);
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+
+ // doc declares NameSpaces at root
+ xmlh.save(xmlh.createDocument(doc.getRootObject(), doc.getRootElementURI(), doc.getRootElementName()), baos, options);
+ //xmlh.save(xmlh.createDocument(doc.getRootObject(), doc.getRootElementURI(), doc.getRootElementName()), System.out, options);
+
+ assertEquals(formatted, baos.toString());
+ }
+
+ public void testSaveXMLDocumentOutputStreamObject() throws IOException {
+ format("/simpleWithChangeSummary.xml",
+MARGIN+ "<?xml version=\"1.0\" encoding=\"ASCII\"?>" +LINE_BREAK+
+MARGIN+ "<cs:stockQuote xmlns:cs=\"http://www.example.com/simpleCS\">" +LINE_BREAK+
+MARGIN+INDENT+ "<symbol>FBNT</symbol>" +LINE_BREAK+
+MARGIN+INDENT+ "<companyName>FlyByNightTechnology</companyName>" +LINE_BREAK+
+MARGIN+INDENT+ "<price>999.0</price>" +LINE_BREAK+
+MARGIN+INDENT+ "<volume>1000.0</volume>" +LINE_BREAK+
+MARGIN+INDENT+ "<quotes>" +LINE_BREAK+
+MARGIN+INDENT+INDENT+ "<price>1500.0</price>" +LINE_BREAK+
+MARGIN+INDENT+ "</quotes>" +LINE_BREAK+
+MARGIN+INDENT+ "<quotes>" +LINE_BREAK+
+MARGIN+INDENT+INDENT+ "<price>2500.0</price>" +LINE_BREAK+
+MARGIN+INDENT+ "</quotes>" +LINE_BREAK+
+MARGIN+INDENT+ "<quotes>" +LINE_BREAK+
+MARGIN+INDENT+INDENT+ "<price>3000.0</price>" +LINE_BREAK+
+MARGIN+INDENT+ "</quotes>" +LINE_BREAK+
+MARGIN+INDENT+ "<quotes>" +LINE_BREAK+
+MARGIN+INDENT+INDENT+ "<price>4000.0</price>" +LINE_BREAK+
+MARGIN+INDENT+ "</quotes>" +LINE_BREAK+
+MARGIN+INDENT+ "<changes create=\"#//quotes[3] #//quotes[4]\" delete=\"#//changes/stockQuote[1]/quotes[2]\" logging=\"false\" xmlns:sdo=\"commonj.sdo\">" +LINE_BREAK+
+MARGIN+INDENT+INDENT+ "<cs:stockQuote sdo:ref=\"#/stockQuote\" sdo:unset=\"volume\">" +LINE_BREAK+
+MARGIN+INDENT+INDENT+INDENT+ "<symbol>fbnt</symbol>" +LINE_BREAK+
+MARGIN+INDENT+INDENT+INDENT+ "<price>1000.0</price>" +LINE_BREAK+
+MARGIN+INDENT+INDENT+INDENT+ "<quotes sdo:ref=\"#//quotes[1]\" />" +LINE_BREAK+
+MARGIN+INDENT+INDENT+INDENT+ "<quotes><price>2000.0</price><quotes><price>2000.99</price></quotes></quotes>" +LINE_BREAK+
+MARGIN+INDENT+INDENT+INDENT+ "<quotes sdo:ref=\"#//quotes[2]\" />" +LINE_BREAK+
+MARGIN+INDENT+INDENT+ "</cs:stockQuote>" +LINE_BREAK+
+MARGIN+INDENT+ "</changes>" +LINE_BREAK+
+MARGIN+ "</cs:stockQuote>");
+ }
+
+ public void testSaveMixedOutputStreamObject() throws IOException {
+ format("/mixedChangeSummary.xml",
+MARGIN+ "<?xml version=\"1.0\" encoding=\"ASCII\"?>" +LINE_BREAK+
+MARGIN+ "<cs:stockQuote xmlns:cs=\"http://www.example.com/sequenceCS\"><changes create=\"#//quotes[3] #//quotes[4]\" delete=\"#//changes/stockQuote[1]/quotes[2]\" logging=\"false\" xmlns:sdo=\"commonj.sdo\">" +LINE_BREAK+
+INDENT+ "<cs:stockQuote sdo:ref=\"#/stockQuote\">" +LINE_BREAK+
+INDENT+INDENT+ "<symbol>fbnt</symbol>" +LINE_BREAK+
+INDENT+INDENT+ "<companyName>FlyByNightTechnology</companyName>" +LINE_BREAK+
+INDENT+INDENT+ "<price>1000.0</price>" +LINE_BREAK+
+INDENT+INDENT+ "<quotes sdo:ref=\"#//quotes[1]\" />" +LINE_BREAK+
+INDENT+INDENT+ "<quotes><price>2000.0</price><quotes><price>2000.99</price></quotes></quotes>" +LINE_BREAK+
+INDENT+INDENT+ "<quotes sdo:ref=\"#//quotes[2]\" />" +LINE_BREAK+
+INDENT+ "</cs:stockQuote>" +LINE_BREAK+
+"</changes><symbol>FBNT</symbol><companyName>FlyByNightTechnology</companyName><price>999.0</price><quotes><price>1500.0</price></quotes><quotes><price>2500.0</price></quotes><volume>1000.0</volume><quotes><price>3000.0</price></quotes><quotes><price>4000.0</price></quotes></cs:stockQuote>");
+ }
+
+ public void testOpenMixedOutputStreamObject() throws IOException {
+ format("/openChangeSummary.xml",
+MARGIN+ "<?xml version=\"1.0\" encoding=\"ASCII\"?>" +LINE_BREAK+
+MARGIN+ "<cs:openQuote xmlns:cs=\"http://www.example.com/sequenceCS\" xmlns:open=\"http://www.example.com/open\">" +LINE_BREAK+
+MARGIN+INDENT+ "<symbol>FBNT</symbol>" +LINE_BREAK+
+MARGIN+INDENT+ "<open:openStockQuote>" +LINE_BREAK+
+MARGIN+INDENT+INDENT+ "<symbol>1500.0</symbol>" +LINE_BREAK+
+MARGIN+INDENT+ "</open:openStockQuote>" +LINE_BREAK+
+MARGIN+INDENT+ "<open:openStockQuote>" +LINE_BREAK+
+MARGIN+INDENT+INDENT+ "<symbol>2500.0</symbol>" +LINE_BREAK+
+MARGIN+INDENT+ "</open:openStockQuote>" +LINE_BREAK+
+MARGIN+INDENT+ "<open:openStockQuote>" +LINE_BREAK+
+MARGIN+INDENT+INDENT+ "<symbol>3000.0</symbol>" +LINE_BREAK+
+MARGIN+INDENT+ "</open:openStockQuote>" +LINE_BREAK+
+MARGIN+INDENT+ "<open:openStockQuote>" +LINE_BREAK+
+MARGIN+INDENT+INDENT+ "<symbol>4000.0</symbol>" +LINE_BREAK+
+MARGIN+INDENT+ "</open:openStockQuote>" +LINE_BREAK+
+MARGIN+INDENT+ "<changes create=\"#//open:openStockQuote[3] #//open:openStockQuote[4]\" delete=\"#//changes/openQuote[1]/open:openStockQuote[2]\" logging=\"false\" xmlns:sdo=\"commonj.sdo\">" +LINE_BREAK+
+MARGIN+INDENT+INDENT+ "<cs:openQuote sdo:ref=\"#/openQuote\">" +LINE_BREAK+
+MARGIN+INDENT+INDENT+INDENT+ "<symbol>fbnt</symbol>" +LINE_BREAK+
+MARGIN+INDENT+INDENT+INDENT+ "<open:openStockQuote sdo:ref=\"#//open:openStockQuote[1]\" />" +LINE_BREAK+
+MARGIN+INDENT+INDENT+INDENT+ "<open:openStockQuote><symbol>2000.0</symbol><open:openStockQuote><symbol>2000.99</symbol></open:openStockQuote></open:openStockQuote>" +LINE_BREAK+
+MARGIN+INDENT+INDENT+INDENT+ "<open:openStockQuote sdo:ref=\"#//open:openStockQuote[2]\" />" +LINE_BREAK+
+MARGIN+INDENT+INDENT+ "</cs:openQuote>" +LINE_BREAK+
+MARGIN+INDENT+ "</changes>" +LINE_BREAK+
+MARGIN+ "</cs:openQuote>");
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/XMLStreamHelperPerformanceTestCase.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/XMLStreamHelperPerformanceTestCase.java
new file mode 100644
index 0000000000..5ebdee2f3e
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/XMLStreamHelperPerformanceTestCase.java
@@ -0,0 +1,91 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.test;
+
+
+import java.io.*;
+import java.math.BigDecimal;
+import java.net.URL;
+
+import javax.xml.stream.*;
+
+import org.apache.tuscany.sdo.helper.XMLStreamHelper;
+import org.apache.tuscany.sdo.util.SDOUtil;
+
+import junit.framework.TestCase;
+
+import commonj.sdo.*;
+import commonj.sdo.helper.*;
+
+
+public class XMLStreamHelperPerformanceTestCase extends TestCase {
+ private final String TEST_MODEL = "/XMLStreamHelper.xsd";
+ private final String TEST_NAMESPACE = "http://www.example.com/simple";
+
+ HelperContext hc;
+
+ /**
+ * Simple Dynamic SDO 2 test.
+ */
+ public void testDynamic() throws Exception {
+ TypeHelper typeHelper = hc.getTypeHelper();
+ Type quoteType = typeHelper.getType(TEST_NAMESPACE, "Quote");
+ DataObject quote = hc.getDataFactory().create(quoteType);
+
+ quote.setString("symbol", "fbnt");
+ quote.setString("companyName", "FlyByNightTechnology");
+ quote.setBigDecimal("price", new BigDecimal("1000.0"));
+ quote.setBigDecimal("open1", new BigDecimal("1000.0"));
+ quote.setBigDecimal("high", new BigDecimal("1000.0"));
+ quote.setBigDecimal("low", new BigDecimal("1000.0"));
+ quote.setDouble("volume", 1000);
+ quote.setDouble("change1", 1000);
+
+ DataObject child = quote.createDataObject("quotes");
+ child.setBigDecimal("price", new BigDecimal("2000.0"));
+
+ DataObject quote3 = quote.createDataObject("quotes3");
+ quote3.setString("symbol3", "IBM");
+ quote3.setString("company3", "IBM Corp.");
+
+ XMLStreamHelper streamHelper = SDOUtil.createXMLStreamHelper(typeHelper);
+ XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
+ StringWriter writer = new StringWriter();
+ XMLStreamWriter streamWriter = outputFactory.createXMLStreamWriter(writer);
+
+ XMLDocument doc = hc.getXMLHelper().createDocument(quote, TEST_NAMESPACE, "stockQuote");
+ streamHelper.save(doc, streamWriter);
+ streamWriter.flush();
+ assertEquals("<p0:stockQuote xmlns:p0=\"http://www.example.com/simple\" xmlns:p1=\"http://www.example.com/simple3\"><p0:symbol>fbnt</p0:symbol><p0:companyName>FlyByNightTechnology</p0:companyName><p0:price>1000.0</p0:price><p0:open1>1000.0</p0:open1><p0:high>1000.0</p0:high><p0:low>1000.0</p0:low><p0:volume>1000.0</p0:volume><p0:change1>1000.0</p0:change1><p0:quotes><p0:price>2000.0</p0:price></p0:quotes><p0:quotes3><p1:symbol3>IBM</p1:symbol3><p1:company3>IBM Corp.</p1:company3></p0:quotes3></p0:stockQuote>",writer.toString());
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ hc = SDOUtil.createHelperContext();
+
+ // Populate the meta data for the test (Stock Quote) model
+ URL url = getClass().getResource(TEST_MODEL);
+ InputStream inputStream = url.openStream();
+ hc.getXSDHelper().define(inputStream, url.toString());
+ inputStream.close();
+
+ }
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/XMLStreamHelperTestCase.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/XMLStreamHelperTestCase.java
new file mode 100644
index 0000000000..921aedea9e
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/XMLStreamHelperTestCase.java
@@ -0,0 +1,169 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.test;
+
+import java.io.*;
+import java.net.URL;
+import java.util.*;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import junit.framework.Assert;
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sdo.helper.XMLStreamHelper;
+import org.apache.tuscany.sdo.util.SDOUtil;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.helper.*;
+
+public class XMLStreamHelperTestCase extends TestCase {
+
+ private HelperContext hc;
+
+ private XMLStreamHelper streamHelper;
+
+ private XMLInputFactory inputFactory;
+
+ private XMLOutputFactory outputFactory;
+
+ private QName module = new QName("http://foo", "module");
+
+ private QName name = new QName("http://bar", "implementation.mock");
+
+ private String testName = "foo-ext";
+ // private String testName = "complex";
+
+ private String xml;
+
+ // = "<module name=\"m\" xmlns=\"http://foo\" xmlns:bar=\"http://bar\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
+ // xsi:schemaLocation=\"http://bar foo-ext.xsd http://foo foo.xsd \"><component name=\"c\"><bar:implementation.mock
+ // myAttr=\"helloworld.HelloWorldImpl\" listAttr=\"1 2\">1<bar:myElement>Dummy</bar:myElement>2</bar:implementation.mock></component></module>";
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ hc = SDOUtil.createHelperContext();
+ streamHelper = SDOUtil.createXMLStreamHelper(hc.getTypeHelper());
+
+ URL url = getClass().getClassLoader().getResource(testName + ".xsd");
+ hc.getXSDHelper().define(url.openStream(), url.toExternalForm());
+ url = getClass().getResource("/mixed.xsd");
+ hc.getXSDHelper().define(url.openStream(), url.toString());
+
+ inputFactory = XMLInputFactory.newInstance();
+ outputFactory = XMLOutputFactory.newInstance();
+
+ url = getClass().getClassLoader().getResource(testName + ".xml");
+ InputStreamReader reader = new InputStreamReader(url.openStream());
+ StringBuffer stringBuffer = new StringBuffer();
+ char buf[] = new char[1024];
+ int size;
+ while ((size = reader.read(buf)) != -1)
+ stringBuffer.append(buf, 0, size);
+ xml = stringBuffer.toString();
+ reader.close();
+ }
+
+ public void testLoadObject() throws Exception {
+ XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(xml));
+ int event = reader.getEventType();
+ while (!(event == XMLStreamConstants.START_ELEMENT && reader.getName().equals(name)) && reader.hasNext()) {
+ event = reader.next();
+ }
+ DataObject dataObject = streamHelper.loadObject(reader);
+ Assert.assertNotNull(dataObject);
+ Assert.assertTrue(dataObject.getString("myAttr").equals("helloworld.HelloWorldImpl"));
+ }
+
+ public void testLoadUnqualifiedObject() throws Exception {
+ XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(xml.replaceAll("bar:", "")));
+ int event = reader.getEventType();
+ while (!(event == XMLStreamConstants.START_ELEMENT && reader.getName().getLocalPart().equals(name.getLocalPart())) && reader.hasNext()) {
+ event = reader.next();
+ }
+ Map options = new HashMap();
+ options.put(XMLStreamHelper.OPTION_DEFAULT_ROOT_TYPE, hc.getTypeHelper().getType(name.getNamespaceURI(), "MockImplementation"));
+ DataObject dataObject = streamHelper.loadObject(reader, options);
+ Assert.assertNotNull(dataObject);
+ Assert.assertTrue(dataObject.getString("myAttr").equals("helloworld.HelloWorldImpl"));
+ }
+
+ public void testLoad() throws Exception {
+ XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(xml));
+ XMLDocument document = streamHelper.load(reader);
+ Assert.assertNotNull(document);
+ Assert.assertEquals(document.getRootElementURI(), module.getNamespaceURI());
+ Assert.assertEquals(document.getRootElementName(), module.getLocalPart());
+ DataObject moduleObject = document.getRootObject();
+ List components = moduleObject.getList("component");
+ DataObject componentObject = (DataObject) components.get(0);
+ DataObject implObject = componentObject.getDataObject("implementation.mock");
+ Assert.assertTrue(implObject.getString("myAttr").equals("helloworld.HelloWorldImpl"));
+ }
+
+ public void testSave() throws XMLStreamException {
+ XMLDocument document = hc.getXMLHelper().load(xml);
+ StringWriter writer = new StringWriter();
+ XMLStreamWriter streamWriter = outputFactory.createXMLStreamWriter(writer);
+ streamHelper.save(document, streamWriter);
+ streamWriter.flush();
+ String xmlStr = writer.toString();
+ //System.out.println(xmlStr);
+ Assert.assertTrue(xmlStr.indexOf("myAttr=\"helloworld.HelloWorldImpl\"")!=-1);
+ }
+
+ public void testSaveObject() throws XMLStreamException {
+ XMLDocument document = hc.getXMLHelper().load(xml);
+ DataObject moduleObject = document.getRootObject();
+ List components = moduleObject.getList("component");
+ DataObject componentObject = (DataObject) components.get(0);
+ StringWriter writer = new StringWriter();
+ XMLStreamWriter streamWriter = outputFactory.createXMLStreamWriter(writer);
+ streamHelper.saveObject(componentObject, streamWriter);
+ streamWriter.flush();
+ Assert.assertTrue(writer.toString().indexOf("myAttr=\"helloworld.HelloWorldImpl\"")!=-1);
+ }
+
+ public void testSaveSequence() throws IOException, XMLStreamException {
+ DataObject quote = hc.getDataFactory().create("http://www.example.com/mixed", "MixedQuote");
+ quote.setString("symbol", "fbnt");
+ quote.getSequence().addText(0, "testing");
+ quote.getSequence().addText("more testing");
+
+ StringWriter writer = new StringWriter();
+ XMLStreamWriter streamWriter = outputFactory.createXMLStreamWriter(writer);
+ streamHelper.saveObject(quote, streamWriter);
+ streamWriter.flush();
+ //System.out.println(writer);
+ assertTrue(writer.toString().indexOf("<symbol>fbnt</symbol>") != -1);
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/XPathTestCase.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/XPathTestCase.java
new file mode 100644
index 0000000000..45f92a73b2
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/XPathTestCase.java
@@ -0,0 +1,125 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.test;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sdo.util.SDOUtil;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.helper.HelperContext;
+import commonj.sdo.helper.XMLDocument;
+import commonj.sdo.helper.XMLHelper;
+import commonj.sdo.helper.XSDHelper;
+
+public class XPathTestCase extends TestCase {
+
+ HelperContext hc;
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ hc = SDOUtil.createHelperContext();
+ }
+
+ private final String TEST_MODEL = "/xpath.xsd";
+ private final String XPATH_XML = "/xpath.xml";
+
+ /**
+ * The presence or absence of the @ sign in a path has no meaning.
+ * Properties are always matched by name independent of their XML representation.
+ * @throws IOException
+ */
+ public void testAtSignProperty() throws IOException {
+ XSDHelper xsdHelper = hc.getXSDHelper();
+ XMLHelper xmlHelper = hc.getXMLHelper();
+
+ URL url = getClass().getResource(TEST_MODEL);
+ InputStream inputStream = url.openStream();
+ xsdHelper.define(inputStream, url.toString());
+
+ inputStream.close();
+
+ XMLDocument doc = xmlHelper.load(getClass().getResourceAsStream(XPATH_XML));
+
+ DataObject drive = doc.getRootObject();
+ DataObject folder1 = (DataObject) drive.get("Folder.1");
+ String value = folder1.getString("@creation_date");
+
+ assertEquals(value, "2000-03-23");
+ }
+
+ public void testListIndexing() throws Exception {
+ XSDHelper xsdHelper = hc.getXSDHelper();
+ XMLHelper xmlHelper = hc.getXMLHelper();
+
+ URL url = getClass().getResource(TEST_MODEL);
+ InputStream inputStream = url.openStream();
+ xsdHelper.define(inputStream, url.toString());
+
+ inputStream.close();
+
+ XMLDocument doc = xmlHelper.load(getClass().getResourceAsStream(XPATH_XML));
+
+ DataObject root = doc.getRootObject();
+ DataObject folder1 = root.getDataObject("Folder[1]");
+ assertNotNull(folder1);
+ DataObject folder1a = root.getDataObject("Folder.0");
+ assertEquals(folder1, folder1a);
+ folder1a = root.getDataObject("Folder[FolderName=Folder00000000000]");
+ assertEquals(folder1, folder1a);
+
+ DataObject noFolder = null;
+
+ try {
+ noFolder = root.getDataObject("Folder[3]");
+ assertNull(noFolder);
+ } catch (Exception e) {
+ assertFalse("bad indexing generated exception" + e, true);
+ }
+
+ try {
+ noFolder = root.getDataObject("Folder[0]");
+ assertNull(noFolder);
+ } catch (Exception e) {
+ assertFalse("bad indexing generated exception" + e, true);
+ }
+
+ try {
+ noFolder = root.getDataObject("Folder.2");
+ assertNull(noFolder);
+ } catch (Exception e) {
+ assertFalse("bad indexing generated exception" + e, true);
+ }
+
+ try {
+ noFolder = root.getDataObject("Folder.-1");
+ assertNull(noFolder);
+ } catch (Exception e) {
+ assertFalse("bad indexing generated exception" + e, true);
+ }
+
+ noFolder = root.getDataObject("Folder[FolderName=foo]");
+ assertNull(noFolder);
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/XSDHelperTestCase.java b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/XSDHelperTestCase.java
new file mode 100644
index 0000000000..b8d3402172
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/XSDHelperTestCase.java
@@ -0,0 +1,224 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.test;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Vector;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sdo.util.SDOUtil;
+
+import com.example.simple.SimpleFactory;
+import commonj.sdo.DataObject;
+import commonj.sdo.Type;
+import commonj.sdo.helper.DataFactory;
+import commonj.sdo.helper.HelperContext;
+import commonj.sdo.helper.TypeHelper;
+import commonj.sdo.helper.XSDHelper;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class XSDHelperTestCase extends TestCase {
+ private static final String TEST_MODEL = "/simple.xsd";
+ private static final String TEST_MODEL2 = "/xsdCorners.xsd";
+ private URL modelURL;
+ private URL xsdCornersURL;
+
+ HelperContext hc;
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ hc = SDOUtil.createHelperContext();
+ modelURL = getClass().getResource(TEST_MODEL);
+ xsdCornersURL = getClass().getResource(TEST_MODEL2);
+ }
+
+ public void testDefineWithLocation() throws IOException {
+ XSDHelper xsdHelper = hc.getXSDHelper();
+ List types = xsdHelper.define(modelURL.openStream(), modelURL.toString());
+ assertEquals(2, types.size());
+ }
+
+ public void testDefineWithNoLocation() {
+ XSDHelper xsdHelper = hc.getXSDHelper();
+ List types = xsdHelper.define(getClass().getResourceAsStream(TEST_MODEL), null);
+ assertEquals(2, types.size());
+ }
+
+ public void testDuplicateDefineWithLocation() throws IOException {
+ XSDHelper xsdHelper = hc.getXSDHelper();
+ List types = xsdHelper.define(modelURL.openStream(), modelURL.toString());
+ assertEquals(2, types.size());
+
+ List types2 = xsdHelper.define(modelURL.openStream(), modelURL.toString());
+ assertEquals(0, types2.size());
+ }
+
+ public void testXSDGeneration_staticSDOType() throws IOException
+ {
+ //test for static sdo type. The test succeeds if the IllegalArgumentException is thrown
+ //by XSDHelper.generate method in which case the string xsd must be null;
+
+ SimpleFactory.INSTANCE.register(hc);
+ XSDHelper xsdHelper = hc.getXSDHelper();
+ DataObject quoteSDO = (DataObject)SimpleFactory.INSTANCE.createQuote();
+ List typeList = new Vector();
+ typeList.add(quoteSDO.getType());
+ String xsd = null;
+
+ try
+ {
+ xsd = xsdHelper.generate(typeList);
+ xsd = "";
+ }
+ catch ( IllegalArgumentException e )
+ {
+ }
+ assertNull(xsd);
+ }
+
+ public void testXSDGeneration_DynamicSDOType() throws IOException
+ {
+ //test for dynamic SDOs that have no XSD model. Here the testcase succeeds only if the
+ //xsd is generated by XSDHelper in which case xsd must not be null
+ XSDHelper xsdHelper = hc.getXSDHelper();
+ DataObject quoteType = DataFactory.INSTANCE.create("commonj.sdo", "Type");
+ quoteType.set("uri", "http://www.example.com/dynamic");
+ quoteType.set("name", "DynamicQuote");
+
+ DataObject aProperty = quoteType.createDataObject("property");
+ aProperty.set("name", "symbol");
+ aProperty.set("type", TypeHelper.INSTANCE.getType("commonj.sdo", "String"));
+
+ aProperty = quoteType.createDataObject("property");
+ aProperty.set("name", "price");
+ aProperty.set("type", TypeHelper.INSTANCE.getType("commonj.sdo", "Decimal"));
+
+ aProperty = quoteType.createDataObject("property");
+ aProperty.set("name", "volume");
+ aProperty.set("type", TypeHelper.INSTANCE.getType("commonj.sdo", "Double"));
+
+ TypeHelper.INSTANCE.define(quoteType);
+
+ Type dynamicQuoteType =
+ TypeHelper.INSTANCE.getType("http://www.example.com/dynamic", "DynamicQuote");
+
+ Vector types = new Vector();
+ types.add(dynamicQuoteType);
+ String xsd = null;
+
+ try
+ {
+ xsd = xsdHelper.generate(types);
+ //System.out.println(xsd);
+ }
+ catch ( IllegalArgumentException e )
+ {
+ }
+ assertNotNull(xsd);
+
+ }
+
+ public void testXSDGeneration_DynamicWithNestedStaticSDOType() throws IOException
+ {
+ //testing static SDO with XSD Model being contained in a Dynamic SDO not having an XSD Model.
+ //the schema must be generated with imports / includes for the XSD corresponding to the static
+ //sdo types.
+ TypeHelper typeHelper = hc.getTypeHelper();
+ XSDHelper xsdHelper = hc.getXSDHelper();
+
+ SimpleFactory.INSTANCE.register(hc);
+ DataObject quoteSDO = (DataObject)SimpleFactory.INSTANCE.createQuote();
+
+
+ DataObject quoteType = DataFactory.INSTANCE.create("commonj.sdo", "Type");
+ quoteType.set("uri", "http://www.example.com/dynamic");
+ quoteType.set("name", "DynamicQuote");
+
+ DataObject aProperty = quoteType.createDataObject("property");
+ aProperty.set("name", "symbol");
+ aProperty.set("type", typeHelper.getType("commonj.sdo", "String"));
+
+ aProperty = quoteType.createDataObject("property");
+ aProperty.set("name", "price");
+ aProperty.set("type", typeHelper.getType("commonj.sdo", "Decimal"));
+
+ aProperty = quoteType.createDataObject("property");
+ aProperty.set("name", "volume");
+ aProperty.set("type", typeHelper.getType("commonj.sdo", "Double"));
+
+ aProperty = quoteType.createDataObject("property");
+ aProperty.set("name", "containedQuotes");
+ aProperty.set("type", typeHelper.getType(quoteSDO.getType().getURI(), quoteSDO.getType().getName()));
+ aProperty.set("containment", new Boolean(true));
+
+ aProperty = quoteType.createDataObject("property");
+ aProperty.set("name", "referredQuotes");
+ aProperty.set("type", typeHelper.getType(quoteSDO.getType().getURI(), quoteSDO.getType().getName()));
+
+ typeHelper.define(quoteType);
+
+ Type dynamicQuoteType =
+ typeHelper.getType("http://www.example.com/dynamic", "DynamicQuote");
+ Vector types = new Vector();
+ types.add(dynamicQuoteType);
+ String xsd = null;
+
+ try
+ {
+ Hashtable schemaLocationMap = new Hashtable();
+ schemaLocationMap.put("http://www.example.com/simple", "http://www.example.com/simple/xsd");
+ xsd = xsdHelper.generate(types, schemaLocationMap);
+ //System.out.println(xsd);
+ }
+ catch ( IllegalArgumentException e )
+ {
+ }
+ assertNotNull(xsd);
+
+ }
+
+ public void testPrefixFromNSWithHyphenNumber() throws IOException {
+ XSDHelper xsdHelper = hc.getXSDHelper();
+ xsdHelper.define(xsdCornersURL.openStream(), xsdCornersURL.toString());
+ DataFactory df = hc.getDataFactory();
+ DataObject root = df.create("http://www.example.com/simple-1", "A");
+ root.setString("a1", "a1s");
+ root.setString("a2", "a2s");
+
+ String doc = hc.getXMLHelper().save(root, "http://www.example.com/simple-1", "a");
+ assertTrue(doc.indexOf("xmlns:s1=\"http://www.example.com/simple-1\"") != -1);
+ }
+
+ public void testShortPrefix() throws IOException {
+ XSDHelper xsdHelper = hc.getXSDHelper();
+ URL url = getClass().getResource("/prefix.xsd");
+ xsdHelper.define(url.openStream(), url.toString());
+ DataObject cmd = hc.getDataFactory().create("http://soaassureservice.soabench.ibm.com", "CreateClaim");
+ cmd.setString("requestInfo", "cost");
+ String doc = hc.getXMLHelper().save(cmd, "http://soaassureservice.soabench.ibm.com", "createClaim");
+ assertTrue(doc.indexOf("xmlns:as=\"http://soaassureservice.soabench.ibm.com\"") != -1);
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/SchemaLocationTestCase.xml b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/SchemaLocationTestCase.xml
new file mode 100644
index 0000000000..e13f45a877
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/SchemaLocationTestCase.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<sl:purchaseReport
+ xmlns:sl="http://www.example.com/xmlDocumentSchemaLocation"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.example.com/xmlDocumentSchemaLocation
+ XMLDocumentSchemaLocation.xsd
+ http://www.example.com/open
+ open.xsd"
+ xsi:noNamespaceSchemaLocation="XMLDocumentNoNamespaceSchemaLocation.xsd"
+ periodEnding="2007-12-31">
+ <sl:schemaLocationElement>some string</sl:schemaLocationElement>
+ <aNoNamespaceSchemaLocationElement date="2006-04-01">
+ <anElement>another string</anElement>
+ </aNoNamespaceSchemaLocationElement>
+</sl:purchaseReport>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/SequenceChangeSummary.xsd b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/SequenceChangeSummary.xsd
new file mode 100644
index 0000000000..dd3c2bc2dc
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/SequenceChangeSummary.xsd
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Copyright (c) 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ -->
+<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:sdo="commonj.sdo" xmlns:mixed="http://www.example.com/mixed" xmlns:open="http://www.example.com/open" targetNamespace="http://www.example.com/sequenceCS" xmlns:cs="http://www.example.com/sequenceCS">
+
+ <import namespace="commonj.sdo" schemaLocation="sdoModel.xsd"/>
+
+ <import namespace="http://www.example.com/mixed" schemaLocation="mixed.xsd"/>
+ <import namespace="http://www.example.com/open" schemaLocation="open.xsd"/>
+
+ <complexType name="RootQuote">
+ <complexContent>
+ <extension base="mixed:MixedQuote">
+ <sequence>
+ <element name="changes" type="sdo:ChangeSummaryType"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <element name="stockQuote" type="cs:RootQuote"/>
+
+ <element name="openQuote">
+ <complexType>
+ <complexContent>
+ <extension base="open:OpenQuote">
+ <sequence>
+ <element name="changes" type="sdo:ChangeSummaryType"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ </element>
+
+</schema> \ No newline at end of file
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/SubstitutionValues.xsd b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/SubstitutionValues.xsd
new file mode 100644
index 0000000000..7aee02c032
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/SubstitutionValues.xsd
@@ -0,0 +1,30 @@
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://www.apache.org/tuscany/SubstitutionValues"
+ xmlns:sv="http://www.apache.org/tuscany/SubstitutionValues">
+ <!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+ <element name="groupHead" type="string"/>
+ <complexType name="TestObject">
+ <sequence>
+ <element ref="sv:groupHead"/>
+ <element name="nonGroupHead" type="string"/>
+ </sequence>
+ </complexType>
+ <element name="groupMember" type="string" substitutionGroup="sv:groupHead"/>
+</schema> \ No newline at end of file
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/TypePropertyMetadataInfo.xsd b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/TypePropertyMetadataInfo.xsd
new file mode 100644
index 0000000000..b6d7841ec4
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/TypePropertyMetadataInfo.xsd
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://www.example.com/metadata/retrievaltest"
+ xmlns:metadata="http://www.example.com/metadata/retrievaltest">
+
+<annotation>
+ <appinfo source="http://www.example.com/metadata/annotation">
+ <p1:annotationSet xmlns:p1="http://www.example.com/metadata/annotation" name="test"/>
+ </appinfo>
+</annotation>
+
+<complexType name="Example">
+ <annotation>
+ <appinfo source="http://www.example.com/metadata/annotation">
+ <p1:example xmlns:p1="http://www.example.com/metadata/annotation">
+ <p1:picture>forest.jpg</p1:picture>
+ </p1:example>
+ </appinfo>
+ </annotation>
+
+ <sequence>
+ <element name="number" type="integer" minOccurs="0" maxOccurs="1">
+ <annotation>
+ <appinfo source="http://www.example.com/metadata/annotation">
+ <p1:AttributeTypeMetadata xmlns:p1="http://www.example.com/metadata/annotation">
+ <p1:getter>getNumber</p1:getter>
+ <p1:setter>setNumber</p1:setter>
+ </p1:AttributeTypeMetadata>
+ </appinfo>
+ </annotation>
+ </element>
+
+ <element name="Exampletype" type="string">
+ <annotation>
+ <appinfo source="http://www.example.com/metadata/annotation">
+ <p1:AttributeTypeMetadata xmlns:p1="http://www.example.com/metadata/annotation">
+ <p1:getter>getPhonetype</p1:getter>
+ <p1:setter>setPhonetype</p1:setter>
+ </p1:AttributeTypeMetadata>
+ </appinfo>
+ </annotation>
+ </element>
+ </sequence>
+</complexType>
+
+<simpleType name="ExampleNumber">
+ <annotation>
+ <appinfo source="http://www.example.com/metadata/annotation">
+ This is the metadata for defining the ExampleNumber type.
+ </appinfo>
+ </annotation>
+ <restriction base="integer">
+ <minInclusive value="1"/>
+ <maxInclusive value="29035"/>
+ </restriction>
+</simpleType>
+
+<simpleType name="PhoneNumber">
+ <annotation>
+ <appinfo source="http://www.example.com/metadata/annotation">
+ This is the metadata for defining the PhoneNumber type.
+ </appinfo>
+ </annotation>
+ <restriction base="string">
+ <length value="8"/>
+ <pattern value="\d{3}-\d{4}"/>
+ </restriction>
+</simpleType>
+
+<simpleType name="ExampleRating">
+ <restriction base="string">
+ <enumeration value=""/>
+ <enumeration value="Good"/>
+ <enumeration value="Bad"/>
+ </restriction>
+</simpleType>
+
+</schema> \ No newline at end of file
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/XMLDocumentNoNamespaceSchemaLocation.xsd b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/XMLDocumentNoNamespaceSchemaLocation.xsd
new file mode 100644
index 0000000000..c2beb7708d
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/XMLDocumentNoNamespaceSchemaLocation.xsd
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+ <xsd:element name="aNoNamespaceSchemaLocationElement">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="anElement" type="xsd:string" minOccurs="1" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ <xsd:attribute name="date" type="xsd:date"/>
+ </xsd:complexType>
+ </xsd:element>
+
+</xsd:schema>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/XMLDocumentSchemaLocation.xsd b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/XMLDocumentSchemaLocation.xsd
new file mode 100644
index 0000000000..0561eb555b
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/XMLDocumentSchemaLocation.xsd
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://www.example.com/xmlDocumentSchemaLocation"
+ xmlns:sl="http://www.example.com/xmlDocumentSchemaLocation">
+
+ <xsd:element name="schemaLocationElement" type="xsd:string" />
+
+ <xsd:element name="purchaseReport">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:any minOccurs="1" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ <xsd:attribute name="periodEnding" type="xsd:date"/>
+ </xsd:complexType>
+ </xsd:element>
+
+</xsd:schema>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/XMLDocumentTestCase.xml b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/XMLDocumentTestCase.xml
new file mode 100644
index 0000000000..88160e0b2f
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/XMLDocumentTestCase.xml
@@ -0,0 +1,14 @@
+<sl:purchaseReport
+ xmlns:sl="http://www.example.com/xmlDocumentSchemaLocation"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.example.com/xmlDocumentSchemaLocation
+ /XMLDocumentSchemaLocation.xsd
+ http://www.example.com/open
+ /open.xsd"
+ xsi:noNamespaceSchemaLocation="/XMLDocumentNoNamespaceSchemaLocation.xsd"
+ periodEnding="2007-12-31">
+ <sl:schemaLocationElement>some string</sl:schemaLocationElement>
+ <aNoNamespaceSchemaLocationElement date="2006-04-01">
+ <anElement>another string</anElement>
+ </aNoNamespaceSchemaLocationElement>
+</sl:purchaseReport>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/XMLStreamHelper.xsd b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/XMLStreamHelper.xsd
new file mode 100644
index 0000000000..492f61b1d2
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/XMLStreamHelper.xsd
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License
+ -->
+<xsd:schema xmlns:simple3="http://www.example.com/simple3" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xshtd="http://www.example.com/simple" elementFormDefault="qualified" targetNamespace="http://www.example.com/simple">
+
+ <xsd:import namespace="http://www.example.com/simple3" schemaLocation="simple3.xsd"/>
+
+ <xsd:element name="stockQuote" type="xshtd:Quote"/>
+
+ <xsd:complexType name="Quote">
+ <xsd:sequence>
+ <xsd:element name="symbol" type="xsd:string"/>
+ <xsd:element name="companyName" type="xsd:string"/>
+ <xsd:element name="price" type="xsd:decimal"/>
+ <xsd:element name="open1" type="xsd:decimal"/>
+ <xsd:element name="high" type="xsd:decimal"/>
+ <xsd:element name="low" type="xsd:decimal"/>
+ <xsd:element name="volume" type="xsd:double"/>
+ <xsd:element name="change1" type="xsd:double"/>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" name="quotes" type="xshtd:Quote"/>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" name="quotes3" type="simple3:Quote3"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+</xsd:schema>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/anytype.xsd b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/anytype.xsd
new file mode 100644
index 0000000000..db10376360
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/anytype.xsd
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ -->
+<xsd:schema xmlns:sdot="http://www.example.com/anytype" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.com/anytype">
+
+ <xsd:element name="globalElement">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="anyTypeElement" type="xsd:anyType"/>
+ <xsd:element name="personElement" type="sdot:Person"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:complexType name="Person">
+ <xsd:sequence>
+ <xsd:element name="firstName" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+</xsd:schema>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/api_test.xsd b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/api_test.xsd
new file mode 100644
index 0000000000..5238c72605
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/api_test.xsd
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sdo="commonj.sdo" xmlns:simple="http://www.example.com/api_test" targetNamespace="http://www.example.com/api_test">
+ <xsd:import namespace="commonj.sdo" schemaLocation="sdoModel.xsd"/>
+ <xsd:element name="apiTestElem" type="simple:APITest"/>
+
+ <xsd:complexType mixed="true" name="APITest">
+ <xsd:sequence>
+ <xsd:element name="stringVal" type="sdo:String"/>
+ <xsd:element name="booleanVal" type="sdo:Boolean"/>
+ <xsd:element name="booleanVal2" type="sdo:Boolean"/>
+ <xsd:element name="byteVal" type="sdo:Byte"/>
+ <xsd:element name="stringVal2" type="sdo:String"/>
+ <xsd:element name="decimalVal" type="sdo:Decimal"/>
+ <xsd:element name="decimalVal2" type="sdo:Decimal"/>
+ <xsd:element name="intVal" type="sdo:Int"/>
+ <xsd:element name="floatVal" type="sdo:Float"/>
+ <xsd:element name="doubleVal" type="sdo:Double"/>
+ <xsd:element name="dateVal" type="sdo:Date"/>
+ <xsd:element name="shortVal" type="sdo:Short"/>
+ <xsd:element name="longVal" type="sdo:Long"/>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" name="children" type="simple:APITest"/>
+ <xsd:element name="bytesVal" type="sdo:Bytes"/>
+ <xsd:element name="integerVal" type="sdo:Integer"/>
+ <xsd:element name="charVal" type="sdo:Character"/>
+ <xsd:element name="xsdDate" type="xsd:date"/>
+ </xsd:sequence>
+ </xsd:complexType>
+</xsd:schema>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/bank.xsd b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/bank.xsd
new file mode 100644
index 0000000000..a0cb7970b0
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/bank.xsd
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+<xsd:schema targetNamespace="http://www.example.com/bank"
+ xmlns:bank="http://www.example.com/bank"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:sdoXML="commonj.sdo/xml">
+
+ <xsd:element name="bank" type="bank:bankType"/>
+
+ <xsd:complexType name="bankType">
+ <xsd:sequence>
+ <xsd:element name="Branch" type="bank:branchType" maxOccurs="unbounded" />
+ <xsd:element name="Service" type="bank:serviceType" maxOccurs="unbounded" />
+ <xsd:element name="Customer" type="bank:customerType" maxOccurs="unbounded" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="branchType">
+ <xsd:sequence>
+ <xsd:element name="Address" type="bank:addressType"/>
+ <xsd:element name="Directions" type="xsd:string" maxOccurs="unbounded" />
+ <xsd:element name="Account" type="bank:accountType" maxOccurs="unbounded" />
+ </xsd:sequence>
+ <xsd:attribute name="ID" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="serviceType">
+ <xsd:attribute name="ID" type="xsd:ID"/>
+ <xsd:attribute name="Name" type="xsd:string"/>
+ <xsd:attribute name="Fee" type="xsd:decimal"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="accountType">
+ <xsd:attribute name="ID" type="xsd:ID"/>
+ <xsd:attribute name="Service" type="xsd:IDREF" sdoXML:propertyType="bank:serviceType" />
+ <xsd:attribute name="Balance" type="xsd:decimal" />
+ </xsd:complexType>
+
+ <xsd:complexType name="customerType">
+ <xsd:sequence>
+ <xsd:element name="First" type="xsd:string" />
+ <xsd:element name="Last" type="xsd:string" />
+ <xsd:element name="Address" type="bank:addressType"/>
+ <xsd:element name="HomeBranch" type="xsd:IDREF" sdoXML:propertyType="bank:branchType" />
+ <xsd:element name="Account" type="xsd:IDREF" sdoXML:propertyType="bank:accountType" maxOccurs="unbounded" />
+ </xsd:sequence>
+ <xsd:attribute name="ID" type="xsd:ID"/>
+ <xsd:attribute name="Related" type="xsd:IDREFS" sdoXML:propertyType="bank:customerType" />
+ </xsd:complexType>
+
+ <xsd:complexType name="addressType">
+ <xsd:sequence>
+ <xsd:element name="Street" type="xsd:string"/>
+ <xsd:element name="City" type="xsd:string"/>
+ <xsd:element name="State" type="xsd:string"/>
+ <xsd:element name="Zip" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ </xsd:schema>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/company.xsd b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/company.xsd
new file mode 100644
index 0000000000..18e99352be
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/company.xsd
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+ <!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+ <xsd:schema xmlns:company="company.xsd"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="company.xsd">
+ <xsd:element name="company" type="company:CompanyType"/>
+ <xsd:complexType name="CompanyType">
+ <xsd:sequence>
+ <xsd:element name="departments" type="company:DepartmentType" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string"/>
+ <xsd:attribute name="employeeOfTheMonth" type="xsd:string"/>
+ </xsd:complexType>
+ <xsd:complexType name="DepartmentType">
+ <xsd:sequence>
+ <xsd:element name="employees" type="company:EmployeeType" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string"/>
+ <xsd:attribute name="location" type="xsd:string"/>
+ <xsd:attribute name="number" type="xsd:int"/>
+ </xsd:complexType>
+ <xsd:complexType name="EmployeeType">
+ <xsd:attribute name="name" type="xsd:string"/>
+ <xsd:attribute name="SN" type="xsd:ID"/>
+ <xsd:attribute name="manager" type="xsd:boolean"/>
+ </xsd:complexType>
+ </xsd:schema>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/customer1.xml b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/customer1.xml
new file mode 100644
index 0000000000..5a29e30a3c
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/customer1.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="ASCII"?>
+<customer:Customer
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:customer="http://example.com/customer"
+ xsi:type="customer:Customer"
+ custNum="1"
+ firstName="John"
+ lastName="Adams"/> \ No newline at end of file
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/customer2.xml b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/customer2.xml
new file mode 100644
index 0000000000..e9ebb92677
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/customer2.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="ASCII"?>
+<customer:Customer
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:customer="http://example.com/customer"
+ xsi:type="customer:Customer"
+ custNum="2"
+ firstName="Jeremy"
+ lastName="Pavick"/> \ No newline at end of file
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/datatype.xsd b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/datatype.xsd
new file mode 100644
index 0000000000..05f55e0502
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/datatype.xsd
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:datatype="http://www.example.com/datatype" xmlns:sdoJava="commonj.sdo/java" targetNamespace="http://www.example.com/datatype">
+
+ <xsd:simpleType name="SimpleSDOType">
+ <xsd:restriction base="xsd:string"/>
+ </xsd:simpleType>
+
+ <xsd:simpleType name="SimpleSDOTypeInstanceClass" sdoJava:instanceClass="java.lang.Integer">
+ <xsd:restriction base="xsd:string"/>
+ </xsd:simpleType>
+
+ <xsd:simpleType name="SimpleSDOTypeExtendedInstanceClass" sdoJava:extendedInstanceClass="java.lang.String">
+ <xsd:restriction base="xsd:string"/>
+ </xsd:simpleType>
+
+</xsd:schema>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/dotNames.xsd b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/dotNames.xsd
new file mode 100644
index 0000000000..a788b7b4f4
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/dotNames.xsd
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ -->
+<xsd:schema xmlns:dn="http://www.example.com/dotNames" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.com/dotNames">
+
+ <xsd:element name="dotNameElement" type="dn:DotNameType"/>
+
+ <xsd:complexType name="DotNameType">
+ <xsd:sequence>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" name="property.2.1" type="xsd:string"/>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" name="foo.bar" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+</xsd:schema>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/foo-ext.xml b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/foo-ext.xml
new file mode 100644
index 0000000000..000909a52e
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/foo-ext.xml
@@ -0,0 +1,9 @@
+<module name="m" xmlns="http://foo" xmlns:bar="http://bar"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://bar foo-ext.xsd http://foo foo.xsd ">
+ <component name="c">
+ <bar:implementation.mock myAttr="helloworld.HelloWorldImpl"
+ listAttr="1 2">1<bar:myElement>Dummy</bar:myElement>2
+ </bar:implementation.mock>
+ </component>
+</module> \ No newline at end of file
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/foo-ext.xsd b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/foo-ext.xsd
new file mode 100644
index 0000000000..4cdfd1bcd6
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/foo-ext.xsd
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://bar"
+ elementFormDefault="qualified"
+ xmlns:foo="http://foo" xmlns:bar="http://bar">
+
+ <import namespace="http://foo"
+ schemaLocation="foo.xsd" />
+
+ <element name="implementation.mock" type="bar:MockImplementation"
+ substitutionGroup="foo:implementation" />
+ <complexType name="MockImplementation" mixed="true">
+ <complexContent>
+ <extension base="foo:Implementation">
+ <sequence>
+ <element name="myElement" type="string"/>
+ <any namespace="##other" processContents="lax"
+ minOccurs="0" maxOccurs="unbounded" />
+ </sequence>
+ <attribute name="myAttr" type="NCName" use="required" />
+ <attribute name="listAttr" type="NMTOKENS" use="optional" />
+ <anyAttribute namespace="##any" processContents="lax" />
+ </extension>
+ </complexContent>
+ </complexType>
+</schema>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/foo.xsd b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/foo.xsd
new file mode 100644
index 0000000000..f50002ec3d
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/foo.xsd
@@ -0,0 +1,232 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://foo"
+ elementFormDefault="qualified" xmlns:foo="http://foo">
+
+ <element name="componentType" type="foo:ComponentType"/>
+ <complexType name="ComponentType">
+ <sequence>
+ <element minOccurs="0" maxOccurs="unbounded" name="service" type="foo:Service"/>
+ <element minOccurs="0" maxOccurs="unbounded" name="reference" type="foo:Reference"/>
+ <element minOccurs="0" maxOccurs="unbounded" name="property" type="foo:Property"/>
+ <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <anyAttribute namespace="##any" processContents="lax"/>
+ </complexType>
+
+ <complexType name="Service">
+ <sequence>
+ <element minOccurs="1" maxOccurs="1" ref="foo:interface"/>
+ <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="name" type="NCName" use="required"/>
+ <anyAttribute namespace="##any" processContents="lax"/>
+ </complexType>
+
+ <element name="interface" type="foo:Interface"/>
+ <complexType name="Interface"/>
+
+ <complexType name="Reference">
+ <sequence>
+ <element minOccurs="1" maxOccurs="1" ref="foo:interface"/>
+ <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="name" type="NCName" use="required"/>
+ <attribute name="multiplicity" type="foo:Multiplicity" use="optional" default="1..1"/>
+ <anyAttribute namespace="##any" processContents="lax"/>
+ </complexType>
+
+ <complexType name="Property">
+ <sequence>
+ <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="name" type="NCName" use="required"/>
+ <attribute name="type" type="QName" use="required"/>
+ <attribute name="many" type="boolean" default="false" use="optional"/>
+ <attribute name="required" type="boolean" default="false" use="optional"/>
+ <attribute name="default" type="string" use="optional"/>
+ <anyAttribute namespace="##any" processContents="lax"/>
+ </complexType>
+
+
+ <element name="moduleFragment" type="foo:ModuleFragment"/>
+ <complexType name="ModuleFragment">
+ <sequence>
+ <element minOccurs="0" maxOccurs="unbounded" name="entryPoint" type="foo:EntryPoint"/>
+ <element minOccurs="0" maxOccurs="unbounded" name="component" type="foo:Component"/>
+ <element minOccurs="0" maxOccurs="unbounded" name="externalService" type="foo:ExternalService"/>
+ <element minOccurs="0" maxOccurs="unbounded" name="wire" type="foo:ModuleWire"/>
+ <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="name" type="NCName" use="required"/>
+ <anyAttribute namespace="##any" processContents="lax"/>
+ </complexType>
+
+ <element name="module" type="foo:Module"/>
+ <complexType name="Module">
+ <complexContent>
+ <extension base="foo:ModuleFragment"/>
+ </complexContent>
+ </complexType>
+
+ <complexType name="EntryPoint">
+ <sequence>
+ <element minOccurs="0" maxOccurs="1" ref="foo:interface"/>
+ <element minOccurs="1" maxOccurs="unbounded" ref="foo:binding"/>
+ <element minOccurs="1" maxOccurs="unbounded" name="reference" type="anyURI"/>
+ <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="name" type="NCName" use="required"/>
+ <attribute name="multiplicity" type="foo:Multiplicity" use="optional" default="1..1"/>
+ <anyAttribute namespace="##any" processContents="lax"/>
+ </complexType>
+ <!-- a multiplicity 1..1 or 0..n sample
+ <reference>StockQuoteComponent</reference> - type must be URI
+ a multiplicity 1..n or 0..n sample
+ <reference>StockQuoteComponent1</reference> - type must be URI
+ <reference>StockQuoteComponent2</reference>
+ -->
+
+ <element name="binding" type="foo:Binding"/>
+ <complexType name="Binding">
+ <attribute name="uri" type="anyURI" use="optional"/>
+ </complexType>
+
+ <complexType name="Component">
+ <sequence>
+ <element minOccurs="1" maxOccurs="1" ref="foo:implementation"/>
+ <element minOccurs="0" maxOccurs="1" name="properties" type="foo:PropertyValues"/>
+ <element minOccurs="0" maxOccurs="1" name="references" type="foo:ReferenceValues"/>
+ <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="name" type="NCName" use="required"/>
+ <anyAttribute namespace="##any" processContents="lax"/>
+ </complexType>
+ <!-- a multiplicity 1..1 or 0..1 sample
+ <references>
+ <v:stockQuote>StockQuoteComponent</v:stockquote> - type must be URI
+ </references>
+ a multiplicity 1..n or 0..n sample
+ <references>
+ <v:stockQuote>StockQuoteComponent1</v:stockQuote> - type must be URI
+ <v:stockQuote>StockQuoteComponent2</v:stockQuote>
+ </references>
+ -->
+
+ <element name="implementation" type="foo:Implementation"/>
+ <complexType name="Implementation"/>
+
+ <complexType name="PropertyValues">
+ <sequence>
+ <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <anyAttribute namespace="##any" processContents="lax"/>
+ </complexType>
+
+ <complexType name="ReferenceValues">
+ <sequence>
+ <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <anyAttribute namespace="##any" processContents="lax"/>
+ </complexType>
+
+
+ <complexType name="ExternalService">
+ <sequence>
+ <element minOccurs="1" maxOccurs="1" ref="foo:interface"/>
+ <element minOccurs="0" maxOccurs="unbounded" ref="foo:binding"/>
+ </sequence>
+ <attribute name="name" type="NCName" use="required"/>
+ <attribute name="overridable" type="foo:OverrideOptions" default="may" use="optional"/>
+ <anyAttribute namespace="##any" processContents="lax"/>
+ </complexType>
+
+
+ <complexType name="ModuleWire">
+ <sequence>
+ <element minOccurs="1" maxOccurs="1" ref="foo:source.uri"/>
+ <element minOccurs="1" maxOccurs="1" ref="foo:target.uri"/>
+ <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <anyAttribute namespace="##any" processContents="lax"/>
+ </complexType>
+
+ <element name="source"/>
+ <element name="target"/>
+
+ <element name="source.uri" type="anyURI" substitutionGroup="foo:source"/>
+ <element name="target.uri" type="anyURI" substitutionGroup="foo:target"/>
+
+ <element name="subsystem" type="foo:Subsystem"/>
+ <complexType name="Subsystem">
+ <sequence>
+ <element minOccurs="0" maxOccurs="unbounded" name="entryPoint" type="foo:EntryPoint"/>
+ <element minOccurs="0" maxOccurs="unbounded" name="moduleComponent" type="foo:ModuleComponent"/>
+ <element minOccurs="0" maxOccurs="unbounded" name="externalService" type="foo:ExternalService"/>
+ <element minOccurs="0" maxOccurs="unbounded" name="wire" type="foo:SystemWire"/>
+ <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="name" type="NCName" use="required"/>
+ <attribute name="uri" type="anyURI" use="optional"/>
+ <anyAttribute namespace="##any" processContents="lax"/>
+ </complexType>
+
+ <complexType name="ModuleComponent">
+ <sequence>
+ <element minOccurs="0" maxOccurs="1" name="properties" type="foo:PropertyValues"/>
+ <element minOccurs="0" maxOccurs="1" name="references" type="foo:ReferenceValues"/>
+ <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="name" type="NCName" use="required"/>
+ <attribute name="module" type="NCName" use="required"/>
+ <attribute name="uri" type="anyURI" use="optional"/>
+ <anyAttribute namespace="##any" processContents="lax"/>
+ </complexType>
+
+ <complexType name="SystemWire">
+ <sequence>
+ <element minOccurs="1" maxOccurs="1" ref="foo:source"/>
+ <element minOccurs="1" maxOccurs="1" ref="foo:target"/>
+ <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+
+ <element name="source.epr" substitutionGroup="foo:source"/>
+ <element name="target.epr" substitutionGroup="foo:target"/>
+
+ <simpleType name="Multiplicity">
+ <restriction base="string">
+ <enumeration value="0..1"/>
+ <enumeration value="1..1"/>
+ <enumeration value="0..n"/>
+ <enumeration value="1..n"/>
+ </restriction>
+ </simpleType>
+
+ <simpleType name="OverrideOptions">
+ <restriction base="string">
+ <enumeration value="no"/>
+ <enumeration value="may"/>
+ <enumeration value="must"/>
+ </restriction>
+ </simpleType>
+
+</schema>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/mixed.xml b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/mixed.xml
new file mode 100644
index 0000000000..42ff3a3a5b
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/mixed.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="ASCII"?>
+<mixed:mixedStockQuote xmlns:mixed="http://www.example.com/mixed">
+ <symbol>fbnt</symbol>
+ <companyName>FlyByNightTechnology</companyName>
+ some text
+ <quotes><price>2000.0</price></quotes>
+ more text
+ <price>1000.0</price>
+</mixed:mixedStockQuote> \ No newline at end of file
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/mixed.xsd b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/mixed.xsd
new file mode 100644
index 0000000000..deee92e9c1
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/mixed.xsd
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+<xsd:schema
+ targetNamespace="http://www.example.com/mixed"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:mixed="http://www.example.com/mixed">
+
+ <xsd:element name="mixedStockQuote" type="mixed:MixedQuote"/>
+
+ <xsd:complexType name="MixedQuote" mixed="true">
+ <xsd:sequence>
+ <xsd:element name="symbol" type="xsd:string"/>
+ <xsd:element name="companyName" type="xsd:string"/>
+ <xsd:element name="price" type="xsd:decimal"/>
+ <xsd:element name="open1" type="xsd:decimal"/>
+ <xsd:element name="high" type="xsd:decimal"/>
+ <xsd:element name="low" type="xsd:decimal"/>
+ <xsd:element name="volume" type="xsd:double"/>
+ <xsd:element name="change1" type="xsd:double"/>
+ <xsd:element name="quotes" type="mixed:MixedQuote" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+</xsd:schema>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/mixed2.xml b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/mixed2.xml
new file mode 100644
index 0000000000..d95d179478
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/mixed2.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="ASCII"?>
+<mixed:mixedStockQuote
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:mixed="http://www.example.com/mixed"
+ xsi:type="mixed:MixedQuote">
+ <symbol>fbnt</symbol>
+ <companyName>FlyByNightTechnology</companyName>
+ some text
+ <quotes><price>2000.0</price></quotes>
+ more text
+ <price>1000.0</price>
+</mixed:mixedStockQuote> \ No newline at end of file
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/mixedChangeSummary.xml b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/mixedChangeSummary.xml
new file mode 100644
index 0000000000..49dbb89f38
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/mixedChangeSummary.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="ASCII"?>
+<cs:stockQuote xmlns:cs="http://www.example.com/sequenceCS"><changes create="#//quotes[3] #//quotes[4]" delete="#//changes/stockQuote[1]/quotes[2]" logging="false" xmlns:sdo="commonj.sdo">
+ <cs:stockQuote sdo:ref="#/stockQuote">
+ <symbol>fbnt</symbol>
+ <companyName>FlyByNightTechnology</companyName>
+ <price>1000.0</price>
+ <quotes sdo:ref="#//quotes[1]" />
+ <quotes><price>2000.0</price><quotes><price>2000.99</price></quotes></quotes>
+ <quotes sdo:ref="#//quotes[2]" />
+ </cs:stockQuote>
+</changes><symbol>FBNT</symbol><companyName>FlyByNightTechnology</companyName><price>999.0</price><quotes><price>1500.0</price></quotes><quotes><price>2500.0</price></quotes><volume>1000.0</volume><quotes><price>3000.0</price></quotes><quotes><price>4000.0</price></quotes></cs:stockQuote> \ No newline at end of file
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/mixedChangeSummaryUndone.xml b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/mixedChangeSummaryUndone.xml
new file mode 100644
index 0000000000..d8097ace8b
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/mixedChangeSummaryUndone.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="ASCII"?>
+<cs:stockQuote xmlns:cs="http://www.example.com/sequenceCS"><changes logging="false" /><symbol>fbnt</symbol><companyName>FlyByNightTechnology</companyName><price>1000.0</price><quotes><price>1500.0</price></quotes><quotes><price>2000.0</price><quotes><price>2000.99</price></quotes></quotes><quotes><price>2500.0</price></quotes></cs:stockQuote> \ No newline at end of file
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/mixedopen.xml b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/mixedopen.xml
new file mode 100644
index 0000000000..21a62ef2d0
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/mixedopen.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="ASCII"?>
+<mixed:mixedOpenStockQuote
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:mixed="http://www.example.com/mixed"
+ xmlns:open="http://www.example.com/open"
+ xsi:type="mixed:MixedOpenQuote">
+ <open:symbol>fbnt</open:symbol>
+ <companyName>FlyByNightTechnology</companyName>
+ some text
+ <quotes><price>2000.0</price></quotes>
+ more text
+ <price>1000.0</price>
+</mixed:mixedOpenStockQuote>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/names.xsd b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/names.xsd
new file mode 100644
index 0000000000..9096b2d62f
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/names.xsd
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+<xsd:schema
+ targetNamespace="http://www.example.com/names"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:names="http://www.example.com/names">
+
+ <xsd:element name="class" type="names:class"/>
+ <xsd:element name="test.element" type="names:test.element" />
+ <xsd:element name="void" type="names:void" />
+
+ <xsd:complexType name="class" />
+ <xsd:complexType name="test.element" />
+ <xsd:complexType name="void" />
+
+</xsd:schema>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/open.xml b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/open.xml
new file mode 100644
index 0000000000..d4a5b92e0c
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/open.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="ASCII"?>
+<open:openStockQuote xmlns:open="http://www.example.com/open">
+ <symbol>s1</symbol>
+ <open:company>
+ <name>FlyByNightTechnology</name>
+ </open:company>
+ <open:price>1000.0</open:price>
+</open:openStockQuote> \ No newline at end of file
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/open.xsd b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/open.xsd
new file mode 100644
index 0000000000..803c0a9cee
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/open.xsd
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+<xsd:schema
+ xmlns:open="http://www.example.com/open"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://www.example.com/open">
+
+ <xsd:element name="openStockQuote" type="open:OpenQuote"/>
+
+ <xsd:element name="price" type="xsd:decimal"/>
+
+ <xsd:element name="company">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="name" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:complexType name="OpenQuote">
+ <xsd:sequence>
+ <xsd:element name="symbol" type="xsd:string"/>
+ <xsd:any maxOccurs="unbounded" namespace="##any"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="OpenQuote2">
+ <xsd:sequence>
+ <xsd:element name="symbol" type="xsd:string"/>
+ <xsd:any maxOccurs="1" namespace="##any"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+</xsd:schema>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/open1any.xsd b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/open1any.xsd
new file mode 100644
index 0000000000..00efaef5e0
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/open1any.xsd
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+<xsd:schema
+ xmlns:simple="http://www.example.com/open1any"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://www.example.com/open1any">
+
+ <xsd:element name="openStockQuote" type="simple:OpenQuote"/>
+
+ <xsd:element name="price" type="xsd:decimal"/>
+
+ <xsd:element name="company">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="name" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:complexType name="OpenQuote">
+ <xsd:sequence>
+ <xsd:element name="symbol" type="xsd:string"/>
+ <xsd:any namespace="##any"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+</xsd:schema>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/open2.xml b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/open2.xml
new file mode 100644
index 0000000000..ab992ccf74
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/open2.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="ASCII"?>
+<open:openStockQuote
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:open="http://www.example.com/open"
+ xsi:type="open:OpenQuote">
+ <open:symbol>s1</open:symbol>
+ <open:company name="FlyByNightTechnology"/>
+ <open:price>1000.0</open:price>
+</open:openStockQuote>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/openChangeSummary.xml b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/openChangeSummary.xml
new file mode 100644
index 0000000000..4ef2dc5948
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/openChangeSummary.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="ASCII"?>
+<cs:openQuote xmlns:cs="http://www.example.com/sequenceCS" xmlns:open="http://www.example.com/open">
+ <symbol>FBNT</symbol>
+ <open:openStockQuote>
+ <symbol>1500.0</symbol>
+ </open:openStockQuote>
+ <open:openStockQuote>
+ <symbol>2500.0</symbol>
+ </open:openStockQuote>
+ <open:openStockQuote>
+ <symbol>3000.0</symbol>
+ </open:openStockQuote>
+ <open:openStockQuote>
+ <symbol>4000.0</symbol>
+ </open:openStockQuote>
+ <changes create="#//open:openStockQuote[3] #//open:openStockQuote[4]" delete="#//changes/openQuote[1]/open:openStockQuote[2]" logging="false" xmlns:sdo="commonj.sdo">
+ <cs:openQuote sdo:ref="#/openQuote">
+ <symbol>fbnt</symbol>
+ <open:openStockQuote sdo:ref="#//open:openStockQuote[1]" />
+ <open:openStockQuote><symbol>2000.0</symbol><open:openStockQuote><symbol>2000.99</symbol></open:openStockQuote></open:openStockQuote>
+ <open:openStockQuote sdo:ref="#//open:openStockQuote[2]" />
+ </cs:openQuote>
+ </changes>
+</cs:openQuote> \ No newline at end of file
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/openChangeSummaryUndone.xml b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/openChangeSummaryUndone.xml
new file mode 100644
index 0000000000..9883a3824a
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/openChangeSummaryUndone.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="ASCII"?>
+<cs:openQuote xmlns:cs="http://www.example.com/sequenceCS" xmlns:open="http://www.example.com/open">
+ <symbol>fbnt</symbol>
+ <open:openStockQuote>
+ <symbol>1500.0</symbol>
+ </open:openStockQuote>
+ <open:openStockQuote>
+ <symbol>2000.0</symbol>
+ <open:openStockQuote>
+ <symbol>2000.99</symbol>
+ </open:openStockQuote>
+ </open:openStockQuote>
+ <open:openStockQuote>
+ <symbol>2500.0</symbol>
+ </open:openStockQuote>
+ <changes logging="false" />
+</cs:openQuote> \ No newline at end of file
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/openContentProperty.xml b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/openContentProperty.xml
new file mode 100644
index 0000000000..03608365c0
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/openContentProperty.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="ASCII"?>
+<open:openStockQuote xmlns:open="http://www.example.com/open">
+ <symbol>s1</symbol>
+ <open:company>
+ <name>FlyByNightTechnology</name>
+ </open:company>
+ <open:price>1000.0</open:price>
+ <open:highPrice>1100.0</open:highPrice>
+ <open:mutualFundQuote>
+ <symbol>mutual-1</symbol>
+ </open:mutualFundQuote>
+</open:openStockQuote> \ No newline at end of file
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/po.xsd b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/po.xsd
new file mode 100644
index 0000000000..5c53ac1905
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/po.xsd
@@ -0,0 +1,62 @@
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns="http://www.example.com/PO" targetNamespace="http://www.example.com/PO">
+
+ <xsd:element name="purchaseOrder" type="PurchaseOrderType"/>
+ <xsd:element name="comment" type="xsd:string"/>
+
+ <xsd:complexType name="PurchaseOrderType">
+ <xsd:sequence>
+ <xsd:element name="shipTo" type="USAddress"/>
+ <xsd:element name="billTo" type="USAddress"/>
+ <xsd:element ref="comment" minOccurs="0"/>
+ <xsd:element name="items" type="Items"/>
+
+ </xsd:sequence>
+ <xsd:attribute name="orderDate" type="xsd:date"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="USAddress">
+ <xsd:sequence>
+ <xsd:element name="name" type="xsd:string"/>
+
+ <xsd:element name="street" type="xsd:string"/>
+ <xsd:element name="city" type="xsd:string"/>
+ <xsd:element name="state" type="xsd:string"/>
+ <xsd:element name="zip" type="xsd:decimal"/>
+ </xsd:sequence>
+ <xsd:attribute name="country" type="xsd:NMTOKEN" fixed="US"/>
+
+ </xsd:complexType>
+
+ <xsd:complexType name="Items">
+ <xsd:sequence>
+ <xsd:element name="item" minOccurs="0" maxOccurs="unbounded">
+ <xsd:complexType>
+ <xsd:sequence>
+
+ <xsd:element name="productName" type="xsd:string"/>
+ <xsd:element name="price" type="xsd:decimal"/>
+ <xsd:element name="quantity">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:positiveInteger">
+ <xsd:maxExclusive value="100"/>
+ </xsd:restriction>
+
+ </xsd:simpleType>
+ </xsd:element>
+ <xsd:element ref="comment" minOccurs="0"/>
+ <xsd:element name="shipDate" type="xsd:date" minOccurs="0"/>
+ </xsd:sequence>
+
+ <xsd:attribute name="partNum" type="SKU" use="required"/>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:simpleType name="SKU">
+
+ <xsd:restriction base="xsd:string">
+ <xsd:pattern value="\d{3}-[A-Z]{2}"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:schema>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/prefix.xsd b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/prefix.xsd
new file mode 100644
index 0000000000..af3d3283f5
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/prefix.xsd
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Copyright (c) 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ -->
+<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:as="http://soaassureservice.soabench.ibm.com" targetNamespace="http://soaassureservice.soabench.ibm.com">
+ <element name="requestInfo" type="string"/>
+ <complexType name="CreateClaim">
+ <sequence>
+ <element ref="as:requestInfo"/>
+ </sequence>
+ </complexType>
+</schema>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/quote.xml b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/quote.xml
new file mode 100644
index 0000000000..d7b5969e23
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/quote.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="ASCII"?>
+<simple:stockQuote xmlns:simple="http://www.example.com/simple">
+ <symbol>fbnt</symbol>
+ <companyName>FlyByNightTechnology</companyName>
+ <price>1000.0</price>
+ <open1>1000.0</open1>
+ <high>1000.0</high>
+ <low>1000.0</low>
+ <volume>1000.0</volume>
+ <change1>1000.0</change1>
+ <quotes>
+ <price>2000.0</price>
+ </quotes>
+</simple:stockQuote> \ No newline at end of file
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/quoteInSOAP.xml b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/quoteInSOAP.xml
new file mode 100644
index 0000000000..4ee083c90c
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/quoteInSOAP.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:simple="http://www.example.com/simple">
+ <soapenv:Header/>
+ <soapenv:Body>
+ <simple:stockQuote>
+ <symbol>fbnt</symbol>
+ <companyName>FlyByNightTechnology</companyName>
+ <price>1000.0</price>
+ <open1>1000.0</open1>
+ <high>1000.0</high>
+ <low>1000.0</low>
+ <volume>1000.0</volume>
+ <change1>1000.0</change1>
+ <quotes>
+ <price>2000.0</price>
+ </quotes>
+ </simple:stockQuote>
+ </soapenv:Body>
+</soapenv:Envelope> \ No newline at end of file
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/sdoModel.xsd b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/sdoModel.xsd
new file mode 100644
index 0000000000..645b7b700a
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/sdoModel.xsd
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ -->
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sdo="commonj.sdo" xmlns:sdoJava="commonj.sdo/java" targetNamespace="commonj.sdo">
+
+ <!-- Dummy XSD definition of special SDO ChangeSummaryType -->
+ <xsd:simpleType name="ChangeSummaryType" sdoJava:instanceClass="commonj.sdo.ChangeSummary">
+ <xsd:restriction base="xsd:string"/>
+ </xsd:simpleType>
+
+
+</xsd:schema>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/sdoannotations.xsd b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/sdoannotations.xsd
new file mode 100644
index 0000000000..acdde2896a
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/sdoannotations.xsd
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+<xsd:schema
+ targetNamespace="http://www.example.com/sdoannotations"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:sdoa="http://www.example.com/sdoannotations"
+ xmlns:sdo="commonj.sdo/xml"
+ xmlns:sdoj="commonj.sdo/java">
+
+ <!-- simple element with no annotations -->
+ <xsd:element name="foo0" type="xsd:string" />
+
+ <!-- simple element with sdo:name -->
+ <xsd:element name="foo1" type="xsd:string" sdo:name="foo2" />
+
+ <!-- simple element with sdo:type -->
+ <xsd:element
+ name="foo3" type="xsd:int"
+ sdo:dataType="xsd:string"
+ sdo:aliasName="foo4"
+ sdo:readOnly="true" />
+
+ <xsd:element
+ name="foo5" type="sdoa:foo6" />
+
+ <!-- complex type with no annotations -->
+ <xsd:complexType name="foo6">
+ <xsd:sequence>
+ <xsd:element name="bar1" type="xsd:int" />
+ </xsd:sequence>
+ <xsd:attribute name="bar2" type="xsd:int" />
+ </xsd:complexType>
+
+ <xsd:element
+ name="foo7" type="sdoa:foo8" />
+
+ <xsd:complexType name="foo8" sdo:name="foo9" sdoj:instanceClass="org.apache.tuscany.sdo.test.XSDHelperTestCase">
+ <xsd:sequence>
+ <xsd:element name="bar3" type="xsd:int" sdo:string="true" />
+ </xsd:sequence>
+ </xsd:complexType>
+
+</xsd:schema>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/sdotypes.xsd b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/sdotypes.xsd
new file mode 100644
index 0000000000..09c05bb671
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/sdotypes.xsd
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+<xsd:schema
+ targetNamespace="http://www.example.com/sdotypes"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:sdot="http://www.example.com/sdotypes">
+
+ <xsd:element name="foo0" type="xsd:anySimpleType"/>
+ <xsd:element name="foo2" type="xsd:anyURI"/>
+ <xsd:element name="foo3" type="xsd:base64Binary"/>
+ <xsd:element name="foo4" type="xsd:boolean"/>
+ <xsd:element name="foo5" type="xsd:byte"/>
+ <xsd:element name="foo6" type="xsd:date"/>
+ <xsd:element name="foo7" type="xsd:dateTime"/>
+ <xsd:element name="foo8" type="xsd:decimal"/>
+ <xsd:element name="foo9" type="xsd:double"/>
+ <xsd:element name="foo10" type="xsd:duration"/>
+ <xsd:element name="foo11" type="xsd:ENTITIES"/>
+ <xsd:element name="foo12" type="xsd:ENTITY"/>
+ <xsd:element name="foo13" type="xsd:float"/>
+ <xsd:element name="foo14" type="xsd:gDay"/>
+ <xsd:element name="foo15" type="xsd:gMonth"/>
+ <xsd:element name="foo16" type="xsd:gMonthDay"/>
+ <xsd:element name="foo17" type="xsd:gYear"/>
+ <xsd:element name="foo18" type="xsd:gYearMonth"/>
+ <xsd:element name="foo19" type="xsd:hexBinary"/>
+ <xsd:element name="foo20" type="xsd:ID"/>
+ <xsd:element name="foo21" type="xsd:IDREF"/>
+ <xsd:element name="foo22" type="xsd:IDREFS"/>
+ <xsd:element name="foo23" type="xsd:int"/>
+ <xsd:element name="foo24" type="xsd:integer"/>
+ <xsd:element name="foo25" type="xsd:language"/>
+ <xsd:element name="foo26" type="xsd:long"/>
+ <xsd:element name="foo27" type="xsd:Name"/>
+ <xsd:element name="foo28" type="xsd:NCName"/>
+ <xsd:element name="foo29" type="xsd:negativeInteger"/>
+ <xsd:element name="foo30" type="xsd:NMTOKEN"/>
+ <xsd:element name="foo31" type="xsd:NMTOKENS"/>
+ <xsd:element name="foo32" type="xsd:nonNegativeInteger"/>
+ <xsd:element name="foo33" type="xsd:nonPositiveInteger"/>
+ <xsd:element name="foo34" type="xsd:normalizedString"/>
+ <xsd:element name="foo35" type="xsd:NOTATION"/>
+ <xsd:element name="foo36" type="xsd:positiveInteger"/>
+ <xsd:element name="foo37" type="xsd:QName"/>
+ <xsd:element name="foo38" type="xsd:short"/>
+ <xsd:element name="foo39" type="xsd:string"/>
+ <xsd:element name="foo40" type="xsd:time"/>
+ <xsd:element name="foo41" type="xsd:token"/>
+ <xsd:element name="foo42" type="xsd:unsignedByte"/>
+ <xsd:element name="foo43" type="xsd:unsignedInt"/>
+ <xsd:element name="foo44" type="xsd:unsignedLong"/>
+ <xsd:element name="foo45" type="xsd:unsignedShort"/>
+
+</xsd:schema>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/shallowquote.xml b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/shallowquote.xml
new file mode 100644
index 0000000000..a56f2fe2b7
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/shallowquote.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="ASCII"?>
+<simple:stockQuote xmlns:simple="http://www.example.com/simple">
+ <symbol>fbnt</symbol>
+ <companyName>FlyByNightTechnology</companyName>
+ <price>1000.0</price>
+ <open1>1000.0</open1>
+ <high>1000.0</high>
+ <low>1000.0</low>
+ <volume>1000.0</volume>
+ <change1>1000.0</change1>
+</simple:stockQuote> \ No newline at end of file
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/simple.xsd b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/simple.xsd
new file mode 100644
index 0000000000..661259e57a
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/simple.xsd
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+<xsd:schema
+ targetNamespace="http://www.example.com/simple"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:simple="http://www.example.com/simple">
+
+ <xsd:element name="stockQuote" type="simple:Quote"/>
+
+ <xsd:complexType name="Quote">
+ <xsd:sequence>
+ <xsd:element name="symbol" type="xsd:string"/>
+ <xsd:element name="companyName" type="xsd:string"/>
+ <xsd:element name="price" type="xsd:decimal"/>
+ <xsd:element name="open1" type="xsd:decimal"/>
+ <xsd:element name="high" type="xsd:decimal"/>
+ <xsd:element name="low" type="xsd:decimal"/>
+ <xsd:element name="volume" type="xsd:double"/>
+ <xsd:element name="change1" type="xsd:double"/>
+ <xsd:element name="quotes" type="simple:Quote" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+</xsd:schema>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/simple2.xsd b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/simple2.xsd
new file mode 100644
index 0000000000..4be4bac95b
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/simple2.xsd
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+<xsd:schema xmlns:simple="http://www.example.com/simple" xmlns:simple2="http://www.example.com/simple2" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.com/simple2">
+
+ <xsd:import namespace="http://www.example.com/simple"/>
+
+ <xsd:element name="stockQuote" type="simple2:Quote2"/>
+
+ <xsd:complexType name="Quote2">
+ <xsd:sequence>
+ <xsd:element name="symbol" type="xsd:string"/>
+ <xsd:element name="companyName" type="xsd:string"/>
+ <xsd:element name="price" type="xsd:decimal"/>
+ <xsd:element name="open1" type="xsd:decimal"/>
+ <xsd:element name="high" type="xsd:decimal"/>
+ <xsd:element name="low" type="xsd:decimal"/>
+ <xsd:element name="volume" type="xsd:double"/>
+ <xsd:element name="change1" type="xsd:double"/>
+ <!-- temporarily removing this until we find a way to do this test without causing eclipse to light up
+ due to missing import -->
+ <!-- <xsd:element maxOccurs="unbounded" minOccurs="0" name="quotes" type="simple:Quote"/> -->
+ </xsd:sequence>
+ </xsd:complexType>
+
+</xsd:schema>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/simple3.xsd b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/simple3.xsd
new file mode 100644
index 0000000000..6ff14a85d2
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/simple3.xsd
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+<xsd:schema
+ targetNamespace="http://www.example.com/simple3"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:simple3="http://www.example.com/simple3"
+elementFormDefault="qualified">
+<!-- <xsd:element name="stockQuote" type="simple3:Quote3"/>-->
+
+ <xsd:complexType name="Quote3">
+ <xsd:sequence>
+ <xsd:element name="symbol3" type="xsd:string"/>
+ <xsd:element name="company3" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+</xsd:schema>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/simpleWithChangeSummary.xml b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/simpleWithChangeSummary.xml
new file mode 100644
index 0000000000..d8ecf8f398
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/simpleWithChangeSummary.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="ASCII"?>
+<cs:stockQuote xmlns:cs="http://www.example.com/simpleCS">
+ <symbol>FBNT</symbol>
+ <companyName>FlyByNightTechnology</companyName>
+ <price>999.0</price>
+ <volume>1000.0</volume>
+ <quotes>
+ <price>1500.0</price>
+ </quotes>
+ <quotes>
+ <price>2500.0</price>
+ </quotes>
+ <quotes>
+ <price>3000.0</price>
+ </quotes>
+ <quotes>
+ <price>4000.0</price>
+ </quotes>
+ <changes create="#//quotes[3] #//quotes[4]" delete="#//changes/stockQuote[1]/quotes[2]" logging="false" xmlns:sdo="commonj.sdo">
+ <cs:stockQuote sdo:ref="#/stockQuote" sdo:unset="volume">
+ <symbol>fbnt</symbol>
+ <price>1000.0</price>
+ <quotes sdo:ref="#//quotes[1]" />
+ <quotes><price>2000.0</price><quotes><price>2000.99</price></quotes></quotes>
+ <quotes sdo:ref="#//quotes[2]" />
+ </cs:stockQuote>
+ </changes>
+</cs:stockQuote> \ No newline at end of file
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/simpleWithChangeSummary.xsd b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/simpleWithChangeSummary.xsd
new file mode 100644
index 0000000000..1df0f69196
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/simpleWithChangeSummary.xsd
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Copyright (c) 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ -->
+<xsd:schema xmlns:sdo="commonj.sdo" xmlns:cs="http://www.example.com/simpleCS" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" targetNamespace="http://www.example.com/simpleCS">
+
+
+ <xsd:import namespace="commonj.sdo" schemaLocation="sdoModel.xsd"/>
+
+ <xsd:complexType name="RootQuote">
+ <xsd:complexContent>
+ <xsd:extension base="cs:Quote">
+ <xsd:sequence>
+ <xsd:element name="changes" type="sdo:ChangeSummaryType"/>
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+
+ </xsd:complexType>
+
+ <xsd:element name="stockQuote" type="cs:RootQuote"/>
+
+ <xsd:complexType name="Quote">
+ <xsd:sequence>
+ <xsd:element name="symbol" type="xsd:string"/>
+ <xsd:element name="companyName" type="xsd:string"/>
+ <xsd:element name="price" type="xsd:decimal"/>
+ <xsd:element name="open1" type="xsd:decimal"/>
+ <xsd:element name="high" type="xsd:decimal"/>
+ <xsd:element name="low" type="xsd:decimal"/>
+ <xsd:element name="volume" type="xsd:double"/>
+ <xsd:element name="change1" type="xsd:double"/>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" name="quotes" type="cs:Quote"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+</xsd:schema>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/simpleWithChangeSummaryUndone.xml b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/simpleWithChangeSummaryUndone.xml
new file mode 100644
index 0000000000..e2bbc56d2d
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/simpleWithChangeSummaryUndone.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="ASCII"?>
+<cs:stockQuote xmlns:cs="http://www.example.com/simpleCS">
+ <symbol>fbnt</symbol>
+ <companyName>FlyByNightTechnology</companyName>
+ <price>1000.0</price>
+ <quotes>
+ <price>1500.0</price>
+ </quotes>
+ <quotes>
+ <price>2000.0</price>
+ <quotes>
+ <price>2000.99</price>
+ </quotes>
+ </quotes>
+ <quotes>
+ <price>2500.0</price>
+ </quotes>
+ <changes logging="false" />
+</cs:stockQuote> \ No newline at end of file
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/simplechangesummary.xml b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/simplechangesummary.xml
new file mode 100644
index 0000000000..134e2f7de5
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/simplechangesummary.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="ASCII"?>
+<sdo:datagraph xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sdo="commonj.sdo"
+ xmlns:sdo_1="http://www.apache.org/tuscany/2005/SDO" xmlns:simple="http://www.example.com/simple">
+ <changeSummary xmlns=""
+ logging="false">
+ <objectChanges key="#//@eRootObject">
+ <value xsi:type="sdo_1:ChangeSummarySetting" featureName="symbol" set="false"/>
+ <value xsi:type="sdo_1:ChangeSummarySetting" featureName="companyName" set="false"/>
+ <value xsi:type="sdo_1:ChangeSummarySetting" featureName="price" set="false"/>
+ <value xsi:type="sdo_1:ChangeSummarySetting" featureName="open1" set="false"/>
+ <value xsi:type="sdo_1:ChangeSummarySetting" featureName="high" set="false"/>
+ <value xsi:type="sdo_1:ChangeSummarySetting" featureName="low" set="false"/>
+ <value xsi:type="sdo_1:ChangeSummarySetting" featureName="volume" dataValue="0.0"
+ set="false"/>
+ <value xsi:type="sdo_1:ChangeSummarySetting" featureName="change1" dataValue="0.0"
+ set="false"/>
+ <value xsi:type="sdo_1:ChangeSummarySetting" featureName="quotes" set="false"/>
+ </objectChanges>
+ </changeSummary>
+ <simple:Quote>
+ <symbol>fbnt</symbol>
+ <companyName>FlyByNightTechnology</companyName>
+ <price>1000.0</price>
+ <open1>1000.0</open1>
+ <high>1000.0</high>
+ <low>1000.0</low>
+ <volume>1000.0</volume>
+ <change1>1000.0</change1>
+ <quotes>
+ <price>2000.0</price>
+ </quotes>
+ </simple:Quote>
+</sdo:datagraph>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/xpath.xml b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/xpath.xml
new file mode 100644
index 0000000000..3b3e2ffbb4
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/xpath.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="ASCII"?>
+<xpath:drive xmlns:xpath="http://www.example.com/xpath" id="0">
+ <Folder creation_date="1999-10-20" creator="Hasan" type="FolderType">
+ <FolderName>Folder00000000000</FolderName>
+ <description>marries inflamed apprehended beseeming bustle</description>
+ <SecurityObject name="secure1">
+ <Allows>
+ <Allow>
+ <User>Brian</User>
+ <Permissions>rw</Permissions>
+ </Allow>
+ <Allow>
+ <User>Fuhwei</User>
+ <Permissions>r</Permissions>
+ </Allow>
+ </Allows>
+ <Denies>
+ <Deny>
+ <User>Hasan</User>
+ </Deny>
+ <Deny>
+ <User>Frank</User>
+ </Deny>
+ </Denies>
+ </SecurityObject>
+ </Folder>
+ <Folder creation_date="2000-03-23" creator="Kapil" type="FileType">
+ <FolderName>Folder00000000011</FolderName>
+ <description>Mumbling Jumblin Pink Panther goofs it up</description>
+ <SecurityObject name="secure2">
+ <Allows>
+ <Allow>
+ <User>Imad</User>
+ <Permissions>x</Permissions>
+ </Allow>
+ <Allow>
+ <User>Robbie</User>
+ <Permissions>rwx</Permissions>
+ </Allow>
+ </Allows>
+ <Denies>
+ <Deny>
+ <User>Yang</User>
+ </Deny>
+ <Deny>
+ <User>Art</User>
+ </Deny>
+ </Denies>
+ </SecurityObject>
+ </Folder>
+</xpath:drive> \ No newline at end of file
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/xpath.xsd b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/xpath.xsd
new file mode 100644
index 0000000000..0b817d425d
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/xpath.xsd
@@ -0,0 +1,75 @@
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns="http://www.example.com/xpath" targetNamespace="http://www.example.com/xpath">
+ <!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+ <xsd:element name="drive" type="DriveType"/>
+
+ <xsd:complexType name="DriveType">
+ <xsd:sequence>
+ <xsd:element name="Folder" type="FolderType" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:int"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="FolderType">
+ <xsd:sequence>
+ <xsd:element name="FolderName" type="xsd:string"/>
+ <xsd:element name="description" type="xsd:string"/>
+ <xsd:element name="SecurityObject" type="SecurityObjectType"/>
+ </xsd:sequence>
+ <xsd:attribute name="creation_date" type="xsd:date" minOccurs="0"/>
+ <xsd:attribute name="creator" type="xsd:string" minOccurs="0"/>
+ <xsd:attribute name="type" type="xsd:string" minOccurs="0"/>
+
+ </xsd:complexType>
+
+ <xsd:complexType name="AllowsObjectType">
+ <xsd:sequence>
+ <xsd:element name="Allow" minOccurs="0" maxOccurs="unbounded">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="User" type="xsd:string"/>
+ <xsd:element name="Permissions" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="DeniesObjectType">
+ <xsd:sequence>
+ <xsd:element name="Deny" minOccurs="0" maxOccurs="unbounded">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="User" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="SecurityObjectType">
+ <xsd:sequence>
+ <xsd:element name="Allows" type="AllowsObjectType"/>
+ <xsd:element name="Denies" type="DeniesObjectType"/>
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string"/>
+ </xsd:complexType>
+
+</xsd:schema>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/xsdCorners.xsd b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/xsdCorners.xsd
new file mode 100644
index 0000000000..b62bfcae56
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/impl/src/test/resources/xsdCorners.xsd
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ -->
+ <!-- a schema for housing examples of tricky corner cases in XSD to SDO conversion
+ 1) namespace prefix creation as in TUSCANY-711
+ .....
+ -->
+<xsd:schema xmlns:s1="http://www.example.com/simple-1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.com/simple-1">
+
+ <xsd:element name="a" type="s1:A"/>
+
+ <xsd:complexType name="A">
+ <xsd:sequence>
+ <xsd:element name="a1" type="xsd:string"/>
+ <xsd:element name="a2" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+</xsd:schema>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/plugin/pom.xml b/sdo-java/tags/1.0-incubator-M3/sdo/plugin/pom.xml
new file mode 100644
index 0000000000..f148a23da3
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/plugin/pom.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <parent>
+ <groupId>org.apache.tuscany.sdo</groupId>
+ <artifactId>tuscany-sdo</artifactId>
+ <version>1.0-incubator-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>tuscany-sdo-plugin</artifactId>
+ <packaging>maven-plugin</packaging>
+ <name>Tuscany SDO Maven Plugin</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-plugin-api</artifactId>
+ <version>2.0.4</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-project</artifactId>
+ <version>2.0.4</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-plugin-descriptor</artifactId>
+ <version>2.0.4</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sdo</groupId>
+ <artifactId>tuscany-sdo-tools</artifactId>
+ <version>${pom.version}</version>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/plugin/src/main/java/org/apache/tuscany/sdo/plugin/GeneratorMojo.java b/sdo-java/tags/1.0-incubator-M3/sdo/plugin/src/main/java/org/apache/tuscany/sdo/plugin/GeneratorMojo.java
new file mode 100644
index 0000000000..c66d058886
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/plugin/src/main/java/org/apache/tuscany/sdo/plugin/GeneratorMojo.java
@@ -0,0 +1,309 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.plugin;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.maven.model.Plugin;
+import org.apache.maven.model.PluginExecution;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.descriptor.MojoDescriptor;
+import org.apache.maven.plugin.descriptor.PluginDescriptor;
+import org.apache.maven.project.MavenProject;
+import org.apache.tuscany.sdo.generate.JavaGenerator;
+import org.apache.tuscany.sdo.generate.XSD2JavaGenerator;
+
+/**
+ * @version $Rev$ $Date$
+ * @goal generate
+ * @phase generate-sources
+ * @description Generate SDO interface classes from an XML Schema
+ */
+public class GeneratorMojo extends AbstractMojo {
+ /**
+ * The directory containing schema files; defaults to
+ * ${basedir}/src/main/xsd
+ *
+ * @parameter expression="${basedir}/src/main/xsd"
+ */
+ private String schemaDir;
+
+ /**
+ * Name of the schema file; if omitted all files in the directory are
+ * processed
+ *
+ * @parameter
+ */
+ private File schemaFile;
+
+ /**
+ * The Java package to generate into. By default the value is derived from
+ * the schema URI.
+ *
+ * @parameter
+ */
+ private String javaPackage;
+
+ /**
+ * The directory to generate into; defaults to
+ * ${project.build.directory}/sdo-source
+ *
+ * @parameter expression="${project.build.directory}/sdo-source"
+ */
+ private String targetDirectory;
+
+ /**
+ * Specifies the prefix string to use for naming the generated factory.
+ *
+ * @parameter
+ */
+ private String prefix;
+
+ /**
+ * This option can be used to eliminate the generated interface and to
+ * generate only an implementation class.
+ *
+ * @parameter
+ */
+ private Boolean noInterfaces;
+
+ /**
+ * Turns off container management for containment properties.
+ *
+ * @parameter
+ */
+ private Boolean noContainment;
+
+ /**
+ * This option eliminates all change notification overhead in the generated
+ * classes.
+ *
+ * @parameter
+ */
+ private Boolean noNotification;
+
+ /**
+ * With this option, all generated properties will not record their unset
+ * state.
+ *
+ * @parameter
+ */
+ private Boolean noUnsettable;
+
+ /**
+ * Generate a fast XML parser/loader for instances of the model.
+ *
+ * @parameter
+ */
+ private Boolean generateLoader;
+
+ /**
+ * Generate a Switch class for the model.
+ *
+ * @parameter
+ */
+ private Boolean generateSwitch;
+
+ /**
+ * @parameter expression="${project}"
+ * @required
+ */
+ private MavenProject project;
+
+ /**
+ * @parameter expression="${plugin.mojos}"
+ */
+ private List mojos;
+
+ /**
+ * With this option, generated interfaces will extend
+ * commonj.sdo.DataObject.
+ *
+ * @parameter
+ */
+ private Boolean interfaceDataObject;
+
+ /**
+ * Support for generating multiple schema files.
+ *
+ * @parameter
+ */
+ private SchemaFileOption[] schemaFiles;
+
+ public void execute() throws MojoExecutionException {
+
+ // check for schemaFiles parameter first, if properties are not set, use
+ // global property
+ if (null != schemaFiles) {
+ for (int i = 0; i < schemaFiles.length; ++i) {
+ SchemaFileOption sf = schemaFiles[i];
+
+ if (null == sf.getTargetDirectory()) {
+ sf.setTargetDirectory(targetDirectory);
+ }
+ if (null == sf.getJavaPackage()) {
+ sf.setJavaPackage(javaPackage);
+ }
+ if (null == sf.isNoInterfaces()) {
+ sf.setNoInterfaces(noInterfaces);
+ }
+ if (null == sf.isNoContainment()) {
+ sf.setNoContainment(noContainment);
+ }
+ if (null == sf.isNoNotification()) {
+ sf.setNoNotification(noNotification);
+ }
+ if (null == sf.isNoUnsettable()) {
+ sf.setNoUnsettable(noUnsettable);
+ }
+ if (null == sf.isGenerateLoader()) {
+ sf.setGenerateLoader(generateLoader);
+ }
+ if (null == sf.isGenerateSwitch()) {
+ sf.setGenerateSwitch(generateSwitch);
+ }
+ // if (null == sf.getCompilerSourceRoots()) {
+ // sf.setCompilerSourceRoots(compileSourceRoots);
+ // }
+ if (null == sf.isInterfaceDataObject()) {
+ sf.setInterfaceDataObject(interfaceDataObject);
+ }
+ if (sf.getFileName() == null || sf.getFileName().length() == 0) {
+ throw new MojoExecutionException("no fileName specfied for schema.");
+ }
+ if (!sf.getFileName().canRead() || !sf.getFileName().isFile()) {
+
+ throw new MojoExecutionException("file can not be read:" + sf.getFileName());
+ }
+ }
+ } else {
+
+ if (schemaFile == null) {
+ File[] files = new File(schemaDir).listFiles(FILTER);
+ schemaFiles = new SchemaFileOption[files.length];
+ for (int i = files.length - 1; i > -1; --i) {
+ schemaFiles[i] = new SchemaFileOption();
+ schemaFiles[i].setFileName(files[i]);
+ schemaFiles[i].setJavaPackage(javaPackage);
+ // schemaFiles[i].setCompilerSourceRoots(compileSourceRoots);
+ schemaFiles[i].setGenerateLoader(generateLoader);
+ schemaFiles[i].setGenerateSwitch(generateSwitch);
+ schemaFiles[i].setNoContainment(noContainment);
+ schemaFiles[i].setInterfaceDataObject(interfaceDataObject);
+ schemaFiles[i].setNoInterfaces(noInterfaces);
+ schemaFiles[i].setNoNotification(noNotification);
+ schemaFiles[i].setNoUnsettable(noUnsettable);
+ schemaFiles[i].setPrefix(prefix);
+ schemaFiles[i].setTargetDirectory(targetDirectory);
+ }
+ } else {
+ schemaFiles = new SchemaFileOption[] {new SchemaFileOption()};
+ schemaFiles[0].setFileName(schemaFile);
+ schemaFiles[0].setJavaPackage(javaPackage);
+ // schemaFiles[0].setCompilerSourceRoots(compileSourceRoots);
+ schemaFiles[0].setGenerateLoader(generateLoader);
+ schemaFiles[0].setGenerateSwitch(generateSwitch);
+ schemaFiles[0].setNoContainment(noContainment);
+ schemaFiles[0].setInterfaceDataObject(interfaceDataObject);
+ schemaFiles[0].setNoInterfaces(noInterfaces);
+ schemaFiles[0].setNoNotification(noNotification);
+ schemaFiles[0].setNoUnsettable(noUnsettable);
+ schemaFiles[0].setPrefix(prefix);
+ schemaFiles[0].setTargetDirectory(targetDirectory);
+ }
+ }
+
+ for (int i = 0; i < schemaFiles.length; i++) {
+ File file = schemaFiles[i].getFileName();
+ File marker = new File(schemaFiles[i].getTargetDirectory(), ".gen#" + file.getName());
+ if (file.lastModified() > marker.lastModified()) {
+ getLog().info("Generating SDO interfaces from " + file);
+
+ int genOptions = 0;
+
+ if (schemaFiles[i].isNoInterfaces() != null && schemaFiles[i].isNoInterfaces().booleanValue()) {
+ genOptions |= JavaGenerator.OPTION_NO_INTERFACES;
+ }
+ if (schemaFiles[i].isNoContainment() != null && schemaFiles[i].isNoContainment().booleanValue()) {
+ genOptions |= JavaGenerator.OPTION_NO_CONTAINMENT;
+ }
+ if (schemaFiles[i].isNoNotification() != null && schemaFiles[i].isNoNotification().booleanValue()) {
+ genOptions |= JavaGenerator.OPTION_NO_NOTIFICATION;
+ }
+ if (schemaFiles[i].isGenerateLoader() != null && schemaFiles[i].isGenerateLoader().booleanValue()) {
+ genOptions |= JavaGenerator.OPTION_GENERATE_LOADER;
+ }
+ if (schemaFiles[i].isNoUnsettable() != null && schemaFiles[i].isNoUnsettable().booleanValue()) {
+ genOptions |= JavaGenerator.OPTION_NO_UNSETTABLE;
+ }
+ if (schemaFiles[i].isGenerateSwitch() != null && schemaFiles[i].isGenerateSwitch().booleanValue()) {
+ genOptions |= JavaGenerator.OPTION_GENERATE_SWITCH;
+ }
+ if (schemaFiles[i].isInterfaceDataObject() != null && schemaFiles[i].isInterfaceDataObject()
+ .booleanValue()) {
+ genOptions |= JavaGenerator.OPTION_INTERFACE_DO;
+ }
+
+ XSD2JavaGenerator.generateFromXMLSchema(file.toString(),
+ null,
+ schemaFiles[i].getTargetDirectory(),
+ schemaFiles[i].getJavaPackage(),
+ schemaFiles[i].getPrefix(),
+ genOptions);
+ }
+ try {
+ marker.createNewFile();
+ } catch (IOException e) {
+ throw new MojoExecutionException(e.getMessage() + "'" + marker.getAbsolutePath() + "'", e);
+ }
+ marker.setLastModified(System.currentTimeMillis());
+ }
+
+ targetDirectory = targetDirectory.replace('/', File.separatorChar);
+
+ // FIXME: [rfeng] Workaround to figure out the current execution phase
+ MojoDescriptor descriptor = (MojoDescriptor)mojos.get(0);
+ PluginDescriptor pluginDescriptor = descriptor.getPluginDescriptor();
+ Map pluginMap = project.getBuild().getPluginsAsMap();
+ Plugin plugin = (Plugin)pluginMap.get(pluginDescriptor.getGroupId() + ":" + pluginDescriptor.getArtifactId());
+ // How to get the current execution id?
+ for (Iterator i = plugin.getExecutions().iterator(); i.hasNext();) {
+ PluginExecution execution = (PluginExecution)i.next();
+ String phase = execution.getPhase();
+ if (phase != null && phase.indexOf("-test-") != -1) {
+ project.addTestCompileSourceRoot(targetDirectory);
+ } else {
+ project.addCompileSourceRoot(targetDirectory);
+ }
+ }
+ }
+
+ private static final FileFilter FILTER = new FileFilter() {
+ public boolean accept(File pathname) {
+ return (pathname.isFile() || !pathname.isHidden());
+ }
+ };
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/plugin/src/main/java/org/apache/tuscany/sdo/plugin/SchemaFileOption.java b/sdo-java/tags/1.0-incubator-M3/sdo/plugin/src/main/java/org/apache/tuscany/sdo/plugin/SchemaFileOption.java
new file mode 100644
index 0000000000..ba2fdf7676
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/plugin/src/main/java/org/apache/tuscany/sdo/plugin/SchemaFileOption.java
@@ -0,0 +1,194 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.plugin;
+
+import java.io.File;
+
+public class SchemaFileOption {
+
+ /**
+ * Name of the schema file
+ *
+ * @parameter
+ */
+ private File fileName;
+
+ /**
+ * The Java package to generate into. By default the value is derived from the schema URI.
+ *
+ * @parameter
+ */
+ private String javaPackage;
+
+ /**
+ * The directory to generate into; defaults to ${project.build.directory}/sdo-source
+ *
+ * @parameter expression="${project.build.directory}/sdo-source"
+ */
+ private String targetDirectory;
+
+ /**
+ * Specifies the prefix string to use for naming the generated factory.
+ *
+ * @parameter
+ */
+ private String prefix;
+
+ /**
+ * This option can be used to eliminate the generated interface and to generate only an implementation class.
+ *
+ * @parameter
+ */
+ private Boolean noInterfaces;
+
+ /**
+ * Turns off container management for containment properties.
+ *
+ * @parameter
+ */
+ private Boolean noContainment;
+
+ /**
+ * This option eliminates all change notification overhead in the generated classes.
+ *
+ * @parameter
+ */
+ private Boolean noNotification;
+
+ /**
+ * With this option, all generated properties will not record their unset state.
+ *
+ * @parameter
+ */
+ private Boolean noUnsettable;
+
+ /**
+ * Generate a fast XML parser/loader for instances of the model.
+ *
+ * @parameter
+ */
+ private Boolean generateLoader;
+
+ /**
+ * Generate a Switch class for the model.
+ *
+ * @parameter
+ */
+ private Boolean generateSwitch;
+
+ /**
+ * With this option, generated interfaces will extend commonj.sdo.DataObject.
+ *
+ * @parameter
+ */
+ private Boolean interfaceDataObject;
+
+ public SchemaFileOption() {
+ }
+
+ public Boolean isGenerateLoader() {
+ return generateLoader;
+ }
+
+ public void setGenerateLoader(Boolean generateLoader) {
+ this.generateLoader = generateLoader;
+ }
+
+ public Boolean isGenerateSwitch() {
+ return generateSwitch;
+ }
+
+ public void setGenerateSwitch(Boolean generateSwitch) {
+ this.generateSwitch = generateSwitch;
+ }
+
+ public String getJavaPackage() {
+ return javaPackage;
+ }
+
+ public void setJavaPackage(String javaPackage) {
+ this.javaPackage = javaPackage;
+ }
+
+ public Boolean isNoContainment() {
+ return noContainment;
+ }
+
+ public void setNoContainment(Boolean noContainment) {
+ this.noContainment = noContainment;
+ }
+
+ public Boolean isNoInterfaces() {
+ return noInterfaces;
+ }
+
+ public void setNoInterfaces(Boolean noInterfaces) {
+ this.noInterfaces = noInterfaces;
+ }
+
+ public Boolean isNoNotification() {
+ return noNotification;
+ }
+
+ public void setNoNotification(Boolean noNotification) {
+ this.noNotification = noNotification;
+ }
+
+ public Boolean isNoUnsettable() {
+ return noUnsettable;
+ }
+
+ public void setNoUnsettable(Boolean noUnsettable) {
+ this.noUnsettable = noUnsettable;
+ }
+
+ public String getPrefix() {
+ return prefix;
+ }
+
+ public void setPrefix(String prefix) {
+ this.prefix = prefix;
+ }
+
+ public String getTargetDirectory() {
+ return targetDirectory;
+ }
+
+ public void setTargetDirectory(String targetDirectory) {
+ this.targetDirectory = targetDirectory;
+ }
+
+ public File getFileName() {
+ return fileName;
+ }
+
+ public void setFileName(File fileName) {
+ this.fileName = fileName;
+ }
+
+ public Boolean isInterfaceDataObject() {
+ return interfaceDataObject;
+ }
+
+ public void setInterfaceDataObject(Boolean interfaceDataObject) {
+ this.interfaceDataObject = interfaceDataObject;
+ }
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/plugin/src/main/resources/META-INF/LICENSE.txt b/sdo-java/tags/1.0-incubator-M3/sdo/plugin/src/main/resources/META-INF/LICENSE.txt
new file mode 100644
index 0000000000..96c6f863f9
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/plugin/src/main/resources/META-INF/LICENSE.txt
@@ -0,0 +1,442 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+
+APACHE TUSCANY SUBCOMPONENTS:
+
+The Apache Tuscany distribution includes a number of subcomponents with
+separate copyright notices and license terms. Your use of the source
+code for the these subcomponents is subject to the terms and
+conditions of the following licenses.
+
+===============================================================================
+
+For the Eclipse Modeling Framework component and the Celtix binding:
+
+Eclipse Public License - v 1.0
+
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
+PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF
+THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+
+1. DEFINITIONS
+
+"Contribution" means:
+
+a) in the case of the initial Contributor, the initial code and
+documentation distributed under this Agreement, and
+b) in the case of each subsequent Contributor:
+
+i) changes to the Program, and
+
+ii) additions to the Program;
+
+where such changes and/or additions to the Program originate from and
+are distributed by that particular Contributor. A Contribution
+'originates' from a Contributor if it was added to the Program by such
+Contributor itself or anyone acting on such Contributor's behalf.
+Contributions do not include additions to the Program which: (i) are
+separate modules of software distributed in conjunction with the
+Program under their own license agreement, and (ii) are not derivative
+works of the Program.
+
+"Contributor" means any person or entity that distributes the Program.
+
+"Licensed Patents " mean patent claims licensable by a Contributor
+which are necessarily infringed by the use or sale of its Contribution
+alone or when combined with the Program.
+
+"Program" means the Contributions distributed in accordance with this
+Agreement.
+
+"Recipient" means anyone who receives the Program under this
+Agreement, including all Contributors.
+
+2. GRANT OF RIGHTS
+
+a) Subject to the terms of this Agreement, each Contributor hereby
+grants Recipient a non-exclusive, worldwide, royalty-free copyright
+license to reproduce, prepare derivative works of, publicly display,
+publicly perform, distribute and sublicense the Contribution of such
+Contributor, if any, and such derivative works, in source code and
+object code form.
+
+b) Subject to the terms of this Agreement, each Contributor hereby
+grants Recipient a non-exclusive, worldwide, royalty-free patent
+license under Licensed Patents to make, use, sell, offer to sell,
+import and otherwise transfer the Contribution of such Contributor, if
+any, in source code and object code form. This patent license shall
+apply to the combination of the Contribution and the Program if, at
+the time the Contribution is added by the Contributor, such addition
+of the Contribution causes such combination to be covered by the
+Licensed Patents. The patent license shall not apply to any other
+combinations which include the Contribution. No hardware per se is
+licensed hereunder.
+
+c) Recipient understands that although each Contributor grants the
+licenses to its Contributions set forth herein, no assurances are
+provided by any Contributor that the Program does not infringe the
+patent or other intellectual property rights of any other entity. Each
+Contributor disclaims any liability to Recipient for claims brought by
+any other entity based on infringement of intellectual property rights
+or otherwise. As a condition to exercising the rights and licenses
+granted hereunder, each Recipient hereby assumes sole responsibility
+to secure any other intellectual property rights needed, if any. For
+example, if a third party patent license is required to allow
+Recipient to distribute the Program, it is Recipient's responsibility
+to acquire that license before distributing the Program.
+
+d) Each Contributor represents that to its knowledge it has sufficient
+copyright rights in its Contribution, if any, to grant the copyright
+license set forth in this Agreement.
+
+3. REQUIREMENTS
+
+A Contributor may choose to distribute the Program in object code form
+under its own license agreement, provided that:
+
+a) it complies with the terms and conditions of this Agreement; and
+
+b) its license agreement:
+
+i) effectively disclaims on behalf of all Contributors all warranties
+and conditions, express and implied, including warranties or
+conditions of title and non-infringement, and implied warranties or
+conditions of merchantability and fitness for a particular purpose;
+
+ii) effectively excludes on behalf of all Contributors all liability
+for damages, including direct, indirect, special, incidental and
+consequential damages, such as lost profits;
+
+iii) states that any provisions which differ from this Agreement are
+offered by that Contributor alone and not by any other party; and
+
+iv) states that source code for the Program is available from such
+Contributor, and informs licensees how to obtain it in a reasonable
+manner on or through a medium customarily used for software exchange.
+
+When the Program is made available in source code form:
+
+a) it must be made available under this Agreement; and
+
+b) a copy of this Agreement must be included with each copy of the
+Program.
+
+Contributors may not remove or alter any copyright notices contained
+within the Program.
+
+Each Contributor must identify itself as the originator of its
+Contribution, if any, in a manner that reasonably allows subsequent
+Recipients to identify the originator of the Contribution.
+
+4. COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain
+responsibilities with respect to end users, business partners and the
+like. While this license is intended to facilitate the commercial use
+of the Program, the Contributor who includes the Program in a
+commercial product offering should do so in a manner which does not
+create potential liability for other Contributors. Therefore, if a
+Contributor includes the Program in a commercial product offering,
+such Contributor ("Commercial Contributor") hereby agrees to defend
+and indemnify every other Contributor ("Indemnified Contributor")
+against any losses, damages and costs (collectively "Losses") arising
+from claims, lawsuits and other legal actions brought by a third party
+against the Indemnified Contributor to the extent caused by the acts
+or omissions of such Commercial Contributor in connection with its
+distribution of the Program in a commercial product offering. The
+obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement.
+In order to qualify, an Indemnified Contributor must: a) promptly
+notify the Commercial Contributor in writing of such claim, and b)
+allow the Commercial Contributor to control, and cooperate with the
+Commercial Contributor in, the defense and any related settlement
+negotiations. The Indemnified Contributor may participate in any such
+claim at its own expense.
+
+For example, a Contributor might include the Program in a commercial
+product offering, Product X. That Contributor is then a Commercial
+Contributor. If that Commercial Contributor then makes performance
+claims, or offers warranties related to Product X, those performance
+claims and warranties are such Commercial Contributor's responsibility
+alone. Under this section, the Commercial Contributor would have to
+defend claims against the other Contributors related to those
+performance claims and warranties, and if a court requires any other
+Contributor to pay any damages as a result, the Commercial Contributor
+must pay those damages.
+
+5. NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS
+PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY
+WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY
+OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
+responsible for determining the appropriateness of using and
+distributing the Program and assumes all risks associated with its
+exercise of rights under this Agreement , including but not limited to
+the risks and costs of program errors, compliance with applicable
+laws, damage to or loss of data, programs or equipment, and
+unavailability or interruption of operations.
+
+6. DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR
+ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING
+WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR
+DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
+HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under
+applicable law, it shall not affect the validity or enforceability of
+the remainder of the terms of this Agreement, and without further
+action by the parties hereto, such provision shall be reformed to the
+minimum extent necessary to make such provision valid and enforceable.
+
+If Recipient institutes patent litigation against any entity
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+the Program itself (excluding combinations of the Program with other
+software or hardware) infringes such Recipient's patent(s), then such
+Recipient's rights granted under Section 2(b) shall terminate as of
+the date such litigation is filed.
+
+All Recipient's rights under this Agreement shall terminate if it
+fails to comply with any of the material terms or conditions of this
+Agreement and does not cure such failure in a reasonable period of
+time after becoming aware of such noncompliance. If all Recipient's
+rights under this Agreement terminate, Recipient agrees to cease use
+and distribution of the Program as soon as reasonably practicable.
+However, Recipient's obligations under this Agreement and any licenses
+granted by Recipient relating to the Program shall continue and
+survive.
+
+Everyone is permitted to copy and distribute copies of this Agreement,
+but in order to avoid inconsistency the Agreement is copyrighted and
+may only be modified in the following manner. The Agreement Steward
+reserves the right to publish new versions (including revisions) of
+this Agreement from time to time. No one other than the Agreement
+Steward has the right to modify this Agreement. The Eclipse Foundation
+is the initial Agreement Steward. The Eclipse Foundation may assign
+the responsibility to serve as the Agreement Steward to a suitable
+separate entity. Each new version of the Agreement will be given a
+distinguishing version number. The Program (including Contributions)
+may always be distributed subject to the version of the Agreement
+under which it was received. In addition, after a new version of the
+Agreement is published, Contributor may elect to distribute the
+Program (including its Contributions) under the new version. Except as
+expressly stated in Sections 2(a) and 2(b) above, Recipient receives
+no rights or licenses to the intellectual property of any Contributor
+under this Agreement, whether expressly, by implication, estoppel or
+otherwise. All rights in the Program not expressly granted under this
+Agreement are reserved.
+
+This Agreement is governed by the laws of the State of New York and
+the intellectual property laws of the United States of America. No
+party to this Agreement will bring a legal action under this Agreement
+more than one year after the cause of action arose. Each party waives
+its rights to a jury trial in any resulting litigation.
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/plugin/src/main/resources/META-INF/NOTICE b/sdo-java/tags/1.0-incubator-M3/sdo/plugin/src/main/resources/META-INF/NOTICE
new file mode 100644
index 0000000000..322cf40f9f
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/plugin/src/main/resources/META-INF/NOTICE
@@ -0,0 +1,29 @@
+Apache Tuscany SDO for Java
+Copyright 2006 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+Apache Tuscany is an effort undergoing incubation at The Apache Software Foundation (ASF),
+sponsored by the Apache Web Services PMC. Incubation is required of all newly accepted
+projects until a further review indicates that the infrastructure, communications,
+and decision making process have stabilized in a manner consistent with other successful
+ASF projects. While incubation status is not necessarily a reflection of the completeness
+or stability of the code, it does indicate that the project has yet to be fully endorsed
+by the ASF.
+
+Unless otherwise indicated, all distribution made available by the Apache Software Foundation
+is provided to you under the terms and conditions of the Apache License Version 2.0 ("AL").
+A copy of the AL is provided with this distribution as the LICENSE.txt file present in the
+root directory, and is also available at http://www.apache.org/licenses/.
+
+The terms and conditions governing the distribution may refer to the AL or other license
+agreements, notices or terms and conditions. Some of these other license agreements may
+include (but are not limited to):
+
+ . Eclipse Public License Version 1.0 (available at http://www.eclipse.org/legal/epl-v10.html)
+ . Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)
+
+It is your obligation to read and accept all such terms and conditions prior to use of the
+distribution. If term or condition is provided, please contact the Apache Software Foundation
+to determine what terms and conditions govern that particular distribution.
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/plugin/src/main/resources/META-INF/README.txt b/sdo-java/tags/1.0-incubator-M3/sdo/plugin/src/main/resources/META-INF/README.txt
new file mode 100644
index 0000000000..9b26d1690a
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/plugin/src/main/resources/META-INF/README.txt
@@ -0,0 +1,35 @@
+Apache Tuscany M1 build (May, 2006)
+===================================
+
+http://incubator.apache.org/tuscany/
+
+Tuscany is an effort undergoing incubation at the Apache Software Foundation
+(ASF), sponsored by the Web Services PMC.
+
+Incubation is required of all newly accepted projects until a further review
+indicates that the infrastructure, communications, and decision making process
+have stabilized in a manner consistent with other successful ASF projects.
+
+While incubation status is not necessarily a reflection of the completeness or
+stability of the code, it does indicate that the project has yet to be fully
+endorsed by the ASF.
+
+
+Support
+-------
+
+Any problem with this release can be reported to the Tuscany mailing list
+or in the JIRA issue tracker.
+
+Mailing list subscription:
+ tuscany-dev-subscribe@ws.apache.org
+
+Jira:
+ http://issues.apache.org/jira/browse/Tuscany
+
+
+Thank you for using Tuscany!
+
+
+The Tuscany Team.
+
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/pom.xml b/sdo-java/tags/1.0-incubator-M3/sdo/pom.xml
new file mode 100644
index 0000000000..dc0ecf40f4
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/pom.xml
@@ -0,0 +1,173 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany</groupId>
+ <artifactId>parent</artifactId>
+ <version>2-incubating</version>
+ </parent>
+ <groupId>org.apache.tuscany.sdo</groupId>
+ <artifactId>tuscany-sdo</artifactId>
+ <packaging>pom</packaging>
+ <name>Tuscany SDO Implementation Project</name>
+ <version>1.0-incubator-M3</version>
+
+ <repositories>
+ <repository>
+ <id>apache.snapshots</id>
+ <name>Apache Snapshot Repository</name>
+ <url>http://people.apache.org/repo/m2-snapshot-repository</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ <repository>
+ <id>apache.incubator</id>
+ <name>Apache Incubator Repository</name>
+ <url>http://people.apache.org/repo/m2-incubating-repository/</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ <repository>
+ <!-- <id>eclipse.emf</id>
+ <url>http://download.eclipse.org/tools/emf/maven2</url> -->
+ <!-- <id>osuosl.org</id>
+ <url>http://ftp.osuosl.org/pub/eclipse/tools/emf/maven2</url> -->
+ <!-- temporarily using indiana state univ as eclipse site diesnt have 2.2.2 at the moment -->
+ <id>indiana</id>
+ <url>http://ftp.ussg.iu.edu/eclipse/modeling/emf/emf/maven2/</url>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+
+ <properties>
+ <specVersion>2.1</specVersion>
+ <emfVersion>2.2.2</emfVersion>
+ <sdo.version>${version}</sdo.version>
+ </properties>
+
+ <modules>
+ <module>impl</module>
+ <module>tools</module>
+ </modules>
+
+ <build>
+ <defaultGoal>install</defaultGoal>
+
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.4</source>
+ <target>1.4</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <version>2.3</version>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <includes>
+ <include>**/*TestCase.java</include>
+ </includes>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <!-- <version>${dependency.plugin.version}</version> -->
+ <executions>
+ <execution>
+ <id>unpack-javadoc</id>
+ <phase>package</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>commonj</groupId>
+ <artifactId>sdo-api-r${specVersion}</artifactId>
+ <classifier>javadoc</classifier>
+ <version>${pom.version}</version>
+ <outputDirectory>${project.build.directory}/javadoc/api</outputDirectory>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <!-- <version>2.2-SNAPSHOT</version> -->
+ <configuration>
+ <descriptors>
+ <descriptor>sdo.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </plugin>
+ </plugins>
+
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <aggregate>true</aggregate>
+ <version>2.0</version>
+ <source>1.4</source>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+
+ </build>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>commonj</groupId>
+ <artifactId>sdo-api-r${specVersion}</artifactId>
+ <version>1.0-incubator-M3</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+</project>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/sample/LICENSE.txt b/sdo-java/tags/1.0-incubator-M3/sdo/sample/LICENSE.txt
new file mode 100644
index 0000000000..ad313d0622
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/sample/LICENSE.txt
@@ -0,0 +1,237 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+
+===============================================================================================================
+
+
+License for the Service Data Objects JavaDoc and Interface Definition files.
+
+Permission to copy, make derivative works of, and distribute the Service Data Objects
+JavaDoc and Interface Definition Files files in any medium without fee or royalty as part
+of a compliant implementation of the Service Data Objects Specification is hereby granted.
+The Service Data Objects Specification may be found at any of the following locations:
+
+http://osoa.org/display/Main/Service+Data+Objects+Specifications
+http://dev2dev.bea.com/technologies/commonj/index.jsp
+http://www.ibm.com/developerworks/library/specification/ws-sdo/
+http://oracle.com/technology/webservices/sca
+https://www.sdn.sap.com/
+http://www.xcalia/xdn/specs/sdo
+
+THE SERVICE DATA OBJECTS SPECIFICATION AND THE JAVADOC AND INTERFACE DEFINITION FILES
+ARE PROVIDED "AS IS," AND THE AUTHORS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS
+SPECIFICATION OR THE JAVADOC AND INTERFACE DEFINITION FILES AND THE IMPLEMENTATION OF THEIR CONTENTS,
+INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
+NON-INFRINGEMENT OR TITLE. THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL,
+INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO ANY USE OR DISTRIBUTION OF THE
+SERVICE DATA OBJECTS SPECIFICATION OR THE JAVADOC OR INTERFACE DEFINTION FILES.
+
+The name and trademarks of the Authors may NOT be used in any manner, including advertising or
+publicity pertaining to the Service Component Architecture Specification or its contents without specific,
+written prior permission. Title to copyright in the Service Data Objects Specification and the
+JavaDoc and Interface Definition Files will at all times remain with the Authors.
+
+No other rights are granted by implication, estoppel or otherwise.
+
+
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/sample/NOTICE.txt b/sdo-java/tags/1.0-incubator-M3/sdo/sample/NOTICE.txt
new file mode 100644
index 0000000000..e79e98b643
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/sample/NOTICE.txt
@@ -0,0 +1,33 @@
+Apache Tuscany SDO for Java
+Copyright 2006 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+Apache Tuscany is an effort undergoing incubation at The Apache Software Foundation (ASF),
+sponsored by the Apache Web Services PMC. Incubation is required of all newly accepted
+projects until a further review indicates that the infrastructure, communications,
+and decision making process have stabilized in a manner consistent with other successful
+ASF projects. While incubation status is not necessarily a reflection of the completeness
+or stability of the code, it does indicate that the project has yet to be fully endorsed
+by the ASF.
+
+Unless otherwise indicated, all distribution made available by the Apache Software Foundation
+is provided to you under the terms and conditions of the Apache License Version 2.0 ("AL").
+A copy of the AL is provided with this distribution as the LICENSE.txt file present in the
+root directory, and is also available at http://www.apache.org/licenses/.
+
+The terms and conditions governing the distribution may refer to the AL or other license
+agreements, notices or terms and conditions. Some of these other license agreements may
+include (but are not limited to):
+
+ . Eclipse Public License Version 1.0 (available at http://www.eclipse.org/legal/epl-v10.html)
+
+It is your obligation to read and accept all such terms and conditions prior to use of the
+distribution. If term or condition is provided, please contact the Apache Software Foundation
+to determine what terms and conditions govern that particular distribution.
+
+This product also includes software developed by the Open Service Oriented Architecture organisation
+(http://osoa.org). The license for this software may be found in the LICENSE.txt file contained in this
+distribution.
+
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/sample/README.txt b/sdo-java/tags/1.0-incubator-M3/sdo/sample/README.txt
new file mode 100644
index 0000000000..c843529bdf
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/sample/README.txt
@@ -0,0 +1,20 @@
+Tuscany SDO Java M3 Sample Program Distribution
+===============================================
+
+This is a distribution of the sample programs for the Tuscany SDO Java implementation.
+
+Building the SDO Java Samples Project from this source distribution
+-------------------------------------------------------------------
+
+Note: If you have already built the SDO for Java Implementation source distribution
+then these sample programs are included in that distribution and are built as part
+of that process. This distribution archive is provided for building against a
+binary distribution of SDO for Java.
+
+Ensure that all the jar files found in the SDO for Java binary distribution's
+lib directory are on your java classpath, and use your java 1.4.2 (or greater) compiler to
+compile the classes in this distribution in your own favourite development environment.
+
+Look at the javadoc/index.html in the sample directory to understand how to run these programs.
+
+
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/sample/STATUS.txt b/sdo-java/tags/1.0-incubator-M3/sdo/sample/STATUS.txt
new file mode 100644
index 0000000000..99ab4398d1
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/sample/STATUS.txt
@@ -0,0 +1,86 @@
+Apache Tuscany Status
+
+Tuscany provides multiple language implementations of the Service Component Architecture (SCA) specifications and related technologies such as SDO.
+
+PROJECT STATUS
+==============
+
+ Tuscany is being incubated at the request of the Apache Web Services PMC.
+ For information on incubation please visit the project page at
+ http://incubator.apache.org/projects/tuscany.html
+
+
+Pending Issues
+==============
+none
+
+RESOLVED ISSUES SINCE LAST STATUS
+=================================
+2005-12-28 CCLA received for IBM's contribution of a C++ implementation
+2005-12-28 CCLA received for BEA and IBM joint contribution of a Java implementation
+
+OTHER NEWS
+==========
+
+2007-01-22 Vote to add Simon Laws as a new committer
+2006-12-24 Java SCA Milestone 2 release
+2006-11-20 Java DAS Milestone 2 release
+2006-11-14 Java SDO Milestone 2 release
+2006-11-10 Vote to add Luciano Resende as a new commiter
+2006-11-07 Vote to add Rajith Attapattu
+2006-11-03 C++ Milestone 2 release
+2006-10-19 Voted to release pom and buildtools for Java M2 release
+2006-09-29 Vote to add Ignacio Silva-Lepe as a new committer
+2006-09-18 Vote to add Venkata Krishnan as a new committer
+2006-08-10 Vote to add Andrew Borley as a new committer
+2006-08-07 Vote to add Meeraj Kunnumpurath as a new committer
+2006-08-07 Vote to add Kelvin Goodson as a new committer
+2006-08-06 Vote to add Brent Daniel as a new committer
+2006-08-04 Vote to add Raymond Feng as a new committer
+2006-08-01 C++ Milestone 1 release
+2006-06-07 Java Milestone 1 release
+2006-05-02 Vote to add Dan Kulp as a new committer
+2006-03-01 Vote to add Ant Elder as a new committer
+
+2006-01-05 Contribution of Java implementation by BEA and IBM committed
+2006-01-05 Contribution of C+ implementation by IBM committed
+
+RELEASE STATUS
+==============
+None
+
+REFERENCES
+==========
+Status file http://svn.apache.org/repos/asf/incubator/tuscany/STATUS
+User List tuscany-user@ws.apache.org
+Developer List tuscany-dev@ws.apache.org
+Commits List tuscany-commits@ws.apache.org
+Source Code http://svn.apache.org/repos/asf/incubator/tuscany/
+Issue Tracking http://issues.apache.org/jira/browse/TUSCANY
+
+Committers
+ ajborley Andrew Borley
+ antelder Ant Elder
+ bdaniel Brent Daniel
+ dkulp Dan Kulp
+ dims Davanum Srinivas
+ edslattery Ed Slattery
+ ekoneil Eddie O'Neil
+ frankb Frank Budinsky
+ geirm Geir Magnusson Jr
+ isilval Ignacio Silva-Lepe
+ jsdelfino Jean-Sebastien Delfino
+ jboynes Jeremy Boynes
+ jmarino Jim Marino
+ kelvingoodson Kelvin Goodson
+ kentam Ken Tam
+ kwilliams Kevin Williams
+ lresende Luciano Resende
+ edwardsmj Mike Edwards
+ meerajk Meeraj Kunnumpurath
+ rajith Rajith Attapattu
+ rfeng Raymond Feng
+ robbinspg Pete Robbins
+ rineholt Rick Rineholt
+ slaws Simon Laws
+ svkrish Venkata Krishnan \ No newline at end of file
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/sample/pom.xml b/sdo-java/tags/1.0-incubator-M3/sdo/sample/pom.xml
new file mode 100644
index 0000000000..f1318a19e8
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/sample/pom.xml
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <parent>
+ <groupId>org.apache.tuscany.sdo</groupId>
+ <artifactId>tuscany-sdo</artifactId>
+ <version>1.0-incubator-M3</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>sample-sdo</artifactId>
+ <packaging>jar</packaging>
+ <name>Tuscany SDO Sample</name>
+ <dependencies>
+ <dependency>
+ <groupId>commonj</groupId>
+ <artifactId>sdo-api-r${specVersion}</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sdo</groupId>
+ <artifactId>tuscany-sdo-impl</artifactId>
+ <version>${pom.version}</version>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <sourceDirectory>src/main/java</sourceDirectory>
+ <resources>
+ <resource>
+ <directory>src/main/java</directory>
+ </resource>
+ <resource>
+ <directory>src/main/resources</directory>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <overview>${basedir}/src/main/java/org/apache/tuscany/samples/sdo/overview.html</overview>
+ <version>2.0</version>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>javadoc</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifest>
+ <mainClass>org.apache.tuscany.samples.sdo.ExecuteSamples</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+<!--
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>assembly</goal>
+ </goals>
+ </execution>
+ </executions>
+
+ <configuration>
+ <descriptors>
+ <descriptor>distribution/assembly/sdoSamples.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </plugin>
+-->
+ </plugins>
+ </build>
+</project>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/ExecuteSamples.java b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/ExecuteSamples.java
new file mode 100644
index 0000000000..feb680cec4
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/ExecuteSamples.java
@@ -0,0 +1,193 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.samples.sdo;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+
+import org.apache.tuscany.samples.sdo.otherSources.*;
+import org.apache.tuscany.samples.sdo.specCodeSnippets.*;
+import org.apache.tuscany.samples.sdo.specExampleSection.*;
+
+/**
+ * Executes all command line samples. <br>
+ * <br>
+ * <b>Usage:</b> <br>
+ * 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.
+ * <br><br>
+ * If executing as a standalone application please do the following:
+ * <br>
+ * <UL>
+ * <LI>Include the following jar files on your classpath :
+ * <UL>
+ * <LI>SDO API and Tuscany Implementation
+ * <UL>
+ * <LI>sdo-api-{version}.jar - SDO API
+ * <LI>tuscany-sdo-impl-{version}.jar - Tuscany SDO implementation
+ * </UL>
+ * </LI>
+ * <LI>EMF dependencies.
+ * <UL>
+ * <LI>emf-common-{version}.jar - some common framework utility and base classes
+ * <LI>emf-ecore-{version}.jar - the EMF core runtime implementation classes (the Ecore metamodel)
+ * <LI>emf-ecore-change-{version}.jar - the EMF change recorder and framework
+ * <LI>emf-ecore-xmi-{version}.jar - EMF's default XML (and XMI) serializer and loader
+ * <LI>xsd-{version}.jar - the XML Schema model
+ * </UL>
+ * </LI>
+ * </UL>
+ * <LI>Execute: <br>
+ * java org.apache.tuscany.samples.sdo.ExecuteSamples </LI>
+ * </UL>
+ */
+public class ExecuteSamples {
+
+ /**
+ * @param args
+ */
+ public static void main(String[] args) {
+ try {
+
+ System.out.println("Welcome to SDO Sample Land");
+ System.out.println("This class will simply execute samples within this jar file");
+
+ BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
+ System.out.println();
+ System.out.println();
+ System.out.println("There are currently three groups of samples");
+ System.out.println("1. Simple code snippets located throughout the specifiction with comparative methods for acheiving the same results");
+ System.out.println("2. Full examples located within Examples section of specification");
+ System.out.println("3. Other sample sources such as white papers and online articles");
+ System.out.println(">>>Press Enter to continue");
+ in.readLine();
+ System.out
+ .println("--------------------------------------------------------------------------------------------------------------------------");
+ System.out
+ .println("Lets start with some basics. These samples are located within the org.apache.tuscany.sdo.samples.specCodeSnipets package."
+ + " They demonstrate many code snippets that are located throughout the SDO specification");
+ System.out
+ .println("--------------------------------------------------------------------------------------------------------------------------");
+
+ System.out.println(">>>Press Enter to continue");
+ in.readLine();
+ CreateDataObjectFromXmlString.main(args);
+ System.out.println(">>>Press Enter for next sample");
+ in.readLine();
+ CreateDataObjectFromXsdAndXmlFiles.main(args);
+ System.out.println(">>>Press Enter for next sample");
+ in.readLine();
+ AccessDataObjectPropertiesByName.main(args);
+ System.out.println(">>>Press Enter to continue");
+ in.readLine();
+
+ //The following samples are still under construction
+
+ //CreateXmlAndXsdFromDataObject.main(args);
+ //System.out.println(">>>Press Enter for next sample");
+ //in.readLine();
+ //DataObjectWithChangeSummary.main(args);
+ //System.out.println(">>>Press Enter for next sample");
+ //in.readLine();
+
+ DynamicCustomerTypeSample.main(args);
+ System.out.println(">>>Press Enter for next sample");
+ in.readLine();
+ PrintPropertiesOfDataObject.main(args);
+ System.out.println(">>>Press Enter for next sample");
+ in.readLine();
+ UsingXPath.main(args);
+ System.out.println(">>>Press Enter for next sample");
+ in.readLine();
+ ObtainingDataGraphFromXml.main(args);
+
+ System.out.println();
+ System.out
+ .println("--------------------------------------------------------------------------------------------------------------------------");
+ System.out
+ .println("The following group of samples implement the examples located within Examples section of specification and are located in "
+ + "the org.apache.tuscany.sdo.samples.specExampleSection package");
+ System.out
+ .println("--------------------------------------------------------------------------------------------------------------------------");
+
+ System.out.println(">>>Press Enter to continue");
+ in.readLine();
+ AccessDataObjectsUsingXPath.main(args);
+ System.out.println(">>>Press Enter for next sample");
+ in.readLine();
+
+ AccessingDataObjectsViaPropertyIndex.main(args);
+ System.out.println(">>>Press Enter for next sample");
+ in.readLine();
+
+ AccessingTheContentsOfASequence.main(args);
+ System.out.println(">>>Press Enter for next sample");
+ in.readLine();
+
+ CreatingDataObjectTreesFromXMLDocuments.main(args);
+ System.out.println(">>>Press Enter for next sample");
+ in.readLine();
+
+ CreatingXmlFromDataObjects.main(args);
+ System.out.println(">>>Press Enter for next sample");
+ in.readLine();
+
+ SerializingDesearializingADataObject.main(args);
+ System.out.println(">>>Press Enter for next sample");
+ in.readLine();
+
+ UsingTypeAndPropertyWithDataObjects.main(args);
+ System.out.println(">>>Press Enter for next sample");
+ in.readLine();
+
+ System.out.println();
+ System.out
+ .println("--------------------------------------------------------------------------------------------------------------------------");
+ System.out.println("The following group of samples come from sources other than the specification");
+ System.out
+ .println("--------------------------------------------------------------------------------------------------------------------------");
+
+ System.out
+ .println("The next two samples are based upon Fuhwei Lwo's paper http://www-128.ibm.com/developerworks/webservices/library/ws-sdoxmlschema/");
+ System.out.println(">>>Press Enter to continue");
+ in.readLine();
+ CreatePurchaseOrder.main(args);
+ System.out.println(">>>Press Enter for next sample");
+ in.readLine();
+ ReadPurchaseOrder.main(args);
+
+ System.out.println();
+ System.out.println();
+ System.out
+ .println("The following sample is slightly more extensive and provides a interactive menu to play with purchase order DataObjects");
+ System.out.println(">>>Press Enter to continue");
+ in.readLine();
+ PurchaseOrderCmdLine.main(args);
+
+ } catch (Exception e) {
+ System.out.println("Sorry an exception was encountered " + e.toString());
+ e.printStackTrace();
+ }
+ System.out.println("All done, goodBye");
+
+ }
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/SdoSampleConstants.java b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/SdoSampleConstants.java
new file mode 100644
index 0000000000..add1d24c0b
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/SdoSampleConstants.java
@@ -0,0 +1,70 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.samples.sdo;
+
+/**
+ * Interface provides some common Constants that are used across the samples.
+ */
+public interface SdoSampleConstants {
+
+ /**
+ * Defines xsd resource contained within jar file for PurchaseOrder DataObject
+ */
+ public static final String PO_XSD_RESOURCE = "po.xsd";
+
+ /**
+ * Defines xml resource contained within jar file that is used to populate PurchaseOrder DataObjects
+ */
+ public static final String PO_XML_RESOURCE = "po.xml";
+
+ /**
+ * Default file name to use when generated xml file for purchase order
+ * @see org.apache.tuscany.samples.sdo.CreatePurchaseOrder
+ */
+ public static final String PO_XML_GENERATED = "temporaryPoGenerated.xml";
+
+ /**
+ * Fake namespace used for PurchaseOrder
+ */
+ public static final String PO_NAMESPACE = "http://www.example.com/PO";
+
+ /**
+ * Bogus company namespace
+ */
+ public static final String COMPANY_NAMESPACE = "company.xsd";
+
+ /**
+ * previously defined XSD file used
+ */
+ public static final String COMPANY_XSD = "company.xsd";
+
+ /**
+ * XML file containing DataGraph representing a company. This xml file conforms to the company model defined in 'Complete DataGraph for Company
+ * Example' section of the SDO specification
+ */
+ public static final String COMPANY_DATAGRAPH_XML = "companyDataGraphGenerated.xml";
+
+ /**
+ * Generated DataGraph {@link org.apache.tuscany.samples.sdo.otherSources.CreateCompany}
+ */
+ public static final String COMPANY_DATAOBJECT_XML = "companyGenerated.xml";
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/otherSources/CreateCompany.java b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/otherSources/CreateCompany.java
new file mode 100644
index 0000000000..3c0aa94450
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/otherSources/CreateCompany.java
@@ -0,0 +1,244 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.samples.sdo.otherSources;
+
+import java.io.BufferedReader;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+
+import java.util.List;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Type;
+import commonj.sdo.DataGraph;
+import commonj.sdo.helper.TypeHelper;
+import commonj.sdo.helper.DataFactory;
+import commonj.sdo.helper.XMLHelper;
+import commonj.sdo.helper.XSDHelper;
+
+import org.apache.tuscany.samples.sdo.SdoSampleConstants;
+import org.apache.tuscany.sdo.util.SDOUtil;
+
+/**
+ * Demonstrates creating a DataObject using the Types defined in a previously generated XML Schema ({@link SdoSampleConstants#COMPANY_XSD}) then persisting to an XML file
+ * This example is useful as a reference for creating valid xml documents that conform to an existing XSD and has been used to create valid XML files for use
+ * with specification code samples.
+ * <p>
+ * <b>Usage:</b> <br>
+ * 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.
+ * <br><br>
+ * If executing as a standalone application please do the following:
+ * <br>
+ * <UL>
+ * <LI>Include the following jar files on your classpath :
+ * <UL>
+ * <LI>SDO API and Tuscany Implementation
+ * <UL>
+ * <LI>sdo-api-{version}.jar - SDO API
+ * <LI>tuscany-sdo-impl-{version}.jar - Tuscany SDO implementation
+ * </UL>
+ * </LI>
+ * <LI>EMF dependencies.
+ * <UL>
+ * <LI>emf-common-{version}.jar - some common framework utility and base classes
+ * <LI>emf-ecore-{version}.jar - the EMF core runtime implementation classes (the Ecore metamodel)
+ * <LI>emf-ecore-change-{version}.jar - the EMF change recorder and framework
+ * <LI>emf-ecore-xmi-{version}.jar - EMF's default XML (and XMI) serializer and loader
+ * <LI>xsd-{version}.jar - the XML Schema model
+ * </UL>
+ * </LI>
+ * </UL>
+ *
+ * These jar files can be obtained by downloading a binary distribution of Tuscany SDO Java</LI>
+ * <LI>Execute: <br>
+ * java org.apache.tuscany.samples.sdo.otherSources.CreateCompany</LI>
+ * </UL>
+ */
+public class CreateCompany {
+
+ /**
+ * XML file generated for the company DataObject
+ */
+ public static final String COMPANY_GENERATED_XML = "companyGenerated.xml";
+
+ /**
+ * XML file generated for the company DataGraph
+ */
+ public static final String COMPANY_DATAGRAPH_GENERATED_XML = "companyDataGraphGenerated.xml";
+
+
+ /**
+ * Main method. Execute this method in order to run sample
+ * @param args
+ * @throws Exception
+ */
+ public static void main(String[] args) throws Exception {
+
+ System.out.println("***************************************");
+ System.out.println("SDO Sample CreateCompany");
+ System.out.println("***************************************");
+ System.out.println("Demonstrates creating a DataObject using the Types defined in a previously generated xsd {@link SdoSampleConstants#COMPANY_XSD} then persisting to a XML file");
+ System.out.println("***************************************");
+ /**
+ * Use xsd to define model
+ */
+ defineCompanyTypes();
+
+ /**
+ * DataObjects can exist on there own or can be associated with a DataGraph. This sample allows you to create and then generate xml for a
+ * company DataObject That is either associated with a DataGraph or independent
+ */
+ boolean useDataGraph = shouldUseDataGraph();
+
+ // define these so that they will be scoped appropriately.
+ DataGraph dataGraph = null;
+ DataObject company = null;
+
+ if (useDataGraph) {
+
+ /**
+ * The SDO specification says the following about creating a DataGraph. A DataGraph is created by a DAS, which returns either an empty
+ * DataGraph, or a DataGraph filled with DataObjects. An empty DataGraph can have a root assigned by the createRootObject() methods.
+ * However, if a previous root DataObject exists then an IllegalStateException is thrown.
+ *
+ * In order to create a simple sample which creates a DataGraph without the use of a DAS this sample will use the
+ * {@link org.apache.tuscany.sdo.util.SDOUtil} class to create a DataObject
+ */
+
+ dataGraph = SDOUtil.createDataGraph();
+ company = dataGraph.createRootObject(SdoSampleConstants.COMPANY_NAMESPACE, "CompanyType");
+
+ } else {
+
+ /*
+ * The following creates a DataObject without a DataGraph
+ */
+ Type companyType = TypeHelper.INSTANCE.getType(SdoSampleConstants.COMPANY_NAMESPACE, "CompanyType");
+ // this is equivilent to
+ // DataObject company = DataFactory.INSTANCE.create(SdoSampleConstants.COMPANY_NAMESPACE, "CompanyType");
+ company = DataFactory.INSTANCE.create(companyType);
+ }
+
+ System.out.println("Populating company DataObject");
+ company.setString("name", "ACME");
+ company.setString("employeeOfTheMonth", "E0001");
+
+ System.out.println("Creating Deptartment");
+ DataObject depts = company.createDataObject("departments",SdoSampleConstants.COMPANY_NAMESPACE,"DepartmentType");
+
+ depts.setString("name", "Advanced Technologies");
+ depts.setString("location", "NY");
+ depts.setString("number", "123");
+
+ System.out.println("Creating employee John Jones");
+ DataObject johnJones = depts.createDataObject("employees",SdoSampleConstants.COMPANY_NAMESPACE, "EmployeeType");
+ johnJones.setString("name", "John Jones");
+
+ johnJones.setString("SN", "E0001");
+
+ System.out.println("Creating employee Jane Doe");
+ DataObject janeDoe = depts.createDataObject("employees",SdoSampleConstants.COMPANY_NAMESPACE, "EmployeeType");
+ janeDoe.setString("name", "Jane Doe");
+ janeDoe.setString("SN", "E0003");
+
+ System.out.println("Creating manager A Varone");
+ DataObject fVarone = depts.createDataObject("employees",SdoSampleConstants.COMPANY_NAMESPACE, "EmployeeType");
+ fVarone.setString("name", "A Varone");
+ fVarone.setString("SN", "E0004");
+ fVarone.setString("manager", "true");
+ System.out.println("DataObject creation completed");
+ System.out.println();
+
+ // print out the generated company DataObject or DataGraph according to user preferences
+ if (useDataGraph) {
+ //write the DataGraph to generated xml file
+ FileOutputStream fos = new FileOutputStream(COMPANY_DATAGRAPH_GENERATED_XML);
+ System.out.println("Writing company DataGraph to " + COMPANY_DATAGRAPH_GENERATED_XML);
+ // print the Company DataObject
+ SDOUtil.saveDataGraph(dataGraph, fos, null);
+
+ // print the company DataGraph to System.out
+ System.out.println("The xml for the created DataGraph would like : ");
+ SDOUtil.saveDataGraph(dataGraph, System.out, null);
+
+ } else {
+
+ //write out to a generated xml file
+ FileOutputStream fos = new FileOutputStream(COMPANY_GENERATED_XML);
+ System.out.println("Writing company DataObject to " + COMPANY_GENERATED_XML);
+ // print the Company DataObject
+ XMLHelper.INSTANCE.save(company, SdoSampleConstants.COMPANY_NAMESPACE, "company", fos);
+
+ // print the company DataObject to System.out
+ String generatedXml = XMLHelper.INSTANCE.save(company, SdoSampleConstants.COMPANY_NAMESPACE, "company");
+ System.out.println("The generated xml for the DataObject would look like : " );
+ System.out.println(generatedXml);
+ }
+
+ }
+
+ /**
+ * Defines company types using XSD.
+ * @throws Exception
+ */
+ private static void defineCompanyTypes() throws Exception {
+
+ System.out.println("Defining Types using XSD");
+ InputStream is = null;
+
+ System.out.println("Opening input stream to " + SdoSampleConstants.COMPANY_XSD);
+ is = ClassLoader.getSystemResourceAsStream(SdoSampleConstants.COMPANY_XSD);
+ List types = XSDHelper.INSTANCE.define(is, null);
+ is.close();
+ System.out.println("Type definition completed");
+
+ }
+
+ /**
+ * Utility method to obtain information from the user about whether or not they would like to use a DataGraph or simply use a DataObject
+ *
+ * @return whether or not a DataGraph should be used
+ * @throws Exception
+ */
+ private static boolean shouldUseDataGraph() throws Exception {
+
+ System.out.print("Create company DataObject associated with a DataGraph {y,n} :");
+ BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
+ String answer = in.readLine();
+ while ((! answer.equalsIgnoreCase("n")) && (! answer.equalsIgnoreCase("y"))) {
+
+ System.out.println();
+ System.out.print("Sorry, please enter 'y' or 'n':");
+ answer = in.readLine();
+ }
+ System.out.println();
+
+ if (answer.equalsIgnoreCase("y")) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/otherSources/CreatePurchaseOrder.java b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/otherSources/CreatePurchaseOrder.java
new file mode 100644
index 0000000000..a592e86623
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/otherSources/CreatePurchaseOrder.java
@@ -0,0 +1,169 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.samples.sdo.otherSources;
+
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.helper.DataFactory;
+import commonj.sdo.helper.XMLHelper;
+import commonj.sdo.helper.XSDHelper;
+
+import org.apache.tuscany.samples.sdo.SdoSampleConstants;
+
+/**
+ * Demonstrates creating a purchaseOrder DataObject from an existing XSD and then
+ * persisting to disk. Uses previously defined model
+ * {@link org.apache.tuscany.samples.sdo.SdoSampleConstants#PO_XSD_RESOURCE} to
+ * define types then generates a purchase order DataObject and persists to
+ * {@link org.apache.tuscany.samples.sdo.SdoSampleConstants#PO_XML_GENERATED}. This
+ * sample was used to generate valid XML for Fuhwei Lwo's paper <A
+ * HREF="http://www-128.ibm.com/developerworks/webservices/library/ws-sdoxmlschema/"
+ * title="Me" onClick="checkLinks(this)">Create and read an XML document based on XML
+ * Schema</A>
+ * <p>
+ * <b>Usage:</b> <br>
+ * 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.
+ * <br><br>
+ * If executing as a standalone application please do the following:
+ * <br>
+ * <UL>
+ * <LI>Include the following jar files on your classpath :
+ * <UL>
+ * <LI>SDO API and Tuscany Implementation
+ * <UL>
+ * <LI>sdo-api-{version}.jar - SDO API
+ * <LI>tuscany-sdo-impl-{version}.jar - Tuscany SDO implementation
+ * </UL>
+ * </LI>
+ * <LI>EMF dependencies.
+ * <UL>
+ * <LI>emf-common-{version}.jar - some common framework utility and base classes
+ * <LI>emf-ecore-{version}.jar - the EMF core runtime implementation classes (the Ecore metamodel)
+ * <LI>emf-ecore-change-{version}.jar - the EMF change recorder and framework
+ * <LI>emf-ecore-xmi-{version}.jar - EMF's default XML (and XMI) serializer and loader
+ * <LI>xsd-{version}.jar - the XML Schema model
+ * </UL>
+ * </LI>
+ * </UL>
+ *
+ * These jar files can be obtained by downloading and unpacking a <a href="http://cwiki.apache.org/TUSCANY/sdo-downloads.html" target="_blank">Tuscany binary distribution</a></LI>
+ * <LI>Execute: <br>
+ * java org.apache.tuscany.samples.sdo.otherSources.CreatePurchaseOrder</LI>
+ * </UL>
+ * @see ReadPurchaseOrder
+ * @see org.apache.tuscany.samples.sdo.specExampleSection.CreatingXmlFromDataObjects
+ */
+
+public class CreatePurchaseOrder {
+
+ /**
+ * Defines purchase order types using
+ * {@link org.apache.tuscany.samples.sdo.SdoSampleConstants#PO_XSD_RESOURCE}
+ *
+ * @throws Exception
+ */
+ private static void definePOTypes() throws Exception {
+
+ InputStream is = ClassLoader.getSystemResourceAsStream(SdoSampleConstants.PO_XSD_RESOURCE);
+ if (is == null) {
+ System.out.println("InputStream is null");
+ } else {
+ System.out.println("Obtained Input Stream from resoruce");
+ }
+ XSDHelper.INSTANCE.define(is, null);
+ is.close();
+ }
+
+ /**
+ * Drives sample
+ *
+ * @param args.
+ * none required.
+ */
+ public static void main(String[] args) {
+ try {
+
+ System.out.println("***************************************");
+ System.out.println("SDO Sample CreatePurchaseOrder");
+ System.out.println("***************************************");
+ System.out.println("This sample is based upon Fuhwei Lwo's paper "
+ + "http://www-128.ibm.com/developerworks/webservices/library/ws-sdoxmlschema/"
+ + " and demonstrates creating a purchaseOrder DataObject from an "
+ + " existing XSD and then persisting to disk. Uses previously defined model");
+
+ System.out.println("***************************************");
+
+ definePOTypes();
+ System.out.println("Defined Types using xsd");
+ DataObject purchaseOrder = DataFactory.INSTANCE.create(SdoSampleConstants.PO_NAMESPACE, "PurchaseOrderType");
+ System.out.println("Created DataObject using DataFactory");
+
+ purchaseOrder.setString("orderDate", "1999-10-20");
+
+ DataObject shipTo = purchaseOrder.createDataObject("shipTo");
+ shipTo.set("country", "US");
+ shipTo.set("name", "Alice Smith");
+ shipTo.set("street", "123 Maple Street");
+ shipTo.set("city", "Mill Valley");
+ shipTo.set("state", "CA");
+ shipTo.setString("zip", "90952");
+ DataObject billTo = purchaseOrder.createDataObject("billTo");
+ billTo.set("country", "US");
+ billTo.set("name", "Robert Smith");
+ billTo.set("street", "8 Oak Avenue");
+ billTo.set("city", "Mill Valley");
+ billTo.set("state", "PA");
+ billTo.setString("zip", "95819");
+ purchaseOrder.set("comment", "Hurry, my lawn is going wild!");
+ System.out.println("Created orderDate, shipTo, billTo and comment properties");
+
+ DataObject items = purchaseOrder.createDataObject("items");
+
+ DataObject item1 = items.createDataObject("item");
+ item1.set("partNum", "872-AA");
+ item1.set("productName", "Lawnmower");
+ item1.setInt("quantity", 1);
+ item1.setString("price", "148.95");
+
+ item1.set("comment", "Confirm this is electric");
+
+ DataObject item2 = items.createDataObject("item");
+ item2.set("partNum", "926-AA");
+ item2.set("productName", "Baby Monitor");
+ item2.setInt("quantity", 1);
+ item2.setString("price", "39.98");
+ item2.setString("shipDate", "1999-05-21");
+ System.out.println("Created 2 items");
+
+ OutputStream stream = new FileOutputStream(SdoSampleConstants.PO_XML_GENERATED);
+ XMLHelper.INSTANCE.save(purchaseOrder, SdoSampleConstants.PO_NAMESPACE, "purchaseOrder", stream);
+ System.out.println("Created file " + SdoSampleConstants.PO_XML_GENERATED);
+ } catch (Exception e) {
+ System.out.println("Sorry an error occured " + e.toString());
+ e.printStackTrace();
+ }
+ System.out.println("GoodBye");
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/otherSources/PurchaseOrderCmdLine.java b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/otherSources/PurchaseOrderCmdLine.java
new file mode 100644
index 0000000000..f65554b113
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/otherSources/PurchaseOrderCmdLine.java
@@ -0,0 +1,395 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.samples.sdo.otherSources;
+
+import java.io.*;
+import org.apache.tuscany.samples.sdo.SdoSampleConstants;
+
+/**
+ * Provides interactive menu based command line interface to modify, save, view purchase order DataObject.
+ * <p>
+ * <b>Usage:</b> <br>
+ * 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.
+ * <br><br>
+ * If executing as a standalone application please do the following:
+ * <br>
+ * <UL>
+ * <LI>Include the following jar files on your classpath :
+ * <UL>
+ * <LI>SDO API and Tuscany Implementation
+ * <UL>
+ * <LI>sdo-api-{version}.jar - SDO API
+ * <LI>tuscany-sdo-impl-{version}.jar - Tuscany SDO implementation
+ * </UL>
+ * </LI>
+ * <LI>EMF dependencies.
+ * <UL>
+ * <LI>emf-common-{version}.jar - some common framework utility and base classes
+ * <LI>emf-ecore-{version}.jar - the EMF core runtime implementation classes (the Ecore metamodel)
+ * <LI>emf-ecore-change-{version}.jar - the EMF change recorder and framework
+ * <LI>emf-ecore-xmi-{version}.jar - EMF's default XML (and XMI) serializer and loader
+ * <LI>xsd-{version}.jar - the XML Schema model
+ * </UL>
+ * </LI>
+ * </UL>
+ *
+ * These jar files can be obtained by downloading and unpacking a <a href="http://cwiki.apache.org/TUSCANY/sdo-downloads.html" target="_blank">Tuscany binary distribution</a></LI>
+ * <LI>Execute: <br>
+ * java org.apache.tuscany.samples.sdo.otherSources.PurchaseOrderCmdLine</LI>
+ * </UL>
+ * @see org.apache.tuscany.samples.sdo.SdoSampleConstants
+ * @see org.apache.tuscany.samples.sdo.otherSources.PurchaseOrderControl
+ */
+
+public class PurchaseOrderCmdLine {
+
+ private static final int MENU = 1;
+
+ private static final int PRINT_SUMMARY = 2;
+
+ private static final int PRINT_ALL_PROPERTIES = 3;
+
+ private static final int PRINT_BILLTO = 4;
+
+ private static final int PRINT_SHIPTO = 5;
+
+ private static final int APPEND_COMMENT = 6;
+
+ private static final int MODIFY_SHIP_TO = 7;
+
+ private static final int MODIFY_BILL_TO = 8;
+
+ private static final int ADD_ITEM = 9;
+
+ private static final int REMOVE_ITEM = 10;
+
+ private static final int SAVE = 11;
+
+ private static final int SAVE_AS = 12;
+
+ private static final int SHOW_CHANGE_SUMMARY = 13;
+
+ private static final int SHOW_XML_DOCUMENT = 14;
+
+ private static final int QUIT = 15;
+
+ /**
+ * Drives sample program
+ *
+ * @param args.
+ * args[0] is optional xsdFilename, args[1] is optional xmlFileName
+ */
+ public static void main(String[] args) {
+
+ System.out.println("***************************************");
+ System.out.println("SDO Purchase Order Sample Command Line Interface");
+ System.out.println("***************************************");
+ System.out.println("Provides an interactive menu to play with purchase order DataObjects");
+ System.out.println("***************************************");
+
+ printUsage();
+
+ PurchaseOrderControl poc = null;
+ String xsdFileName = null;
+ String xmlFileName = null;
+
+ // see if we should load an xsd file or if we should use a resource
+ if ((args.length >= 1)) {
+ xsdFileName = args[0];
+ }
+
+ // see if we should load an xml file or if we should use a resource
+ if ((args.length >= 2)) {
+ xmlFileName = args[1];
+ }
+ try {
+ poc = new PurchaseOrderControl(xsdFileName, xmlFileName);
+ } catch (Exception e) {
+ System.out.println("Sorry could not initialize PurchaseOrderControl. Error: " + e.toString());
+ e.printStackTrace();
+ return;
+ }
+ boolean inOperation = true;
+ try {
+
+ BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
+ int command = QUIT;
+
+ printMenu();
+ while (inOperation) {
+ System.out.print(">>> ");
+ try {
+ command = Integer.valueOf(in.readLine()).intValue();
+ } catch (Exception e) {
+ System.out.println("Invalid option, please try again.");
+ command = MENU;
+
+ }
+ switch (command) {
+ case MENU:
+ printMenu();
+
+ break;
+ case PRINT_SUMMARY:
+ poc.printPurchaseOrderSummary();
+ break;
+ case PRINT_ALL_PROPERTIES:
+ try {
+ poc.printPurchaseOrderProperties();
+ } catch (Exception e) {
+ System.out.println("Sorry the following error was received when printing all properties " + e.toString());
+ e.printStackTrace();
+ }
+ break;
+ case PRINT_BILLTO:
+ poc.printBillTo();
+ break;
+ case PRINT_SHIPTO:
+ poc.printShipTo();
+ break;
+ case APPEND_COMMENT:
+ try {
+
+ System.out.println("Append Comment: ");
+ poc.appendComment(in.readLine());
+ } catch (Exception e) {
+ System.out.println("Sorry unexpected exception occured appending comment" + e.toString());
+ e.printStackTrace();
+ }
+
+ break;
+ case MODIFY_SHIP_TO:
+ try {
+
+ System.out.println("Modify Ship To ( press enter to leave unchanged )");
+ poc.printShipTo();
+ System.out.print("Name: ");
+ String name = in.readLine();
+ System.out.println();
+
+ System.out.print("Street: ");
+ String street = in.readLine();
+ System.out.println();
+
+ System.out.print("City: ");
+ String city = in.readLine();
+ System.out.println();
+
+ System.out.print("State: ");
+ String state = in.readLine();
+ System.out.println();
+
+ System.out.print("Zip: ");
+ String zip = in.readLine();
+ if ((zip != null) && (!zip.equals(""))) {
+ selectSetDecimalOption(in, poc);
+ }
+ System.out.println();
+
+ poc.modifyShipTo(name, street, city, state, zip);
+ } catch (Exception e) {
+ System.out.println("Sorry unexpected exception occured modifying ShipTo address :" + e.toString());
+ e.printStackTrace();
+ }
+
+ break;
+ case MODIFY_BILL_TO:
+ try {
+
+ System.out.println("Modify Bill To ( press enter to leave unchanged )");
+ poc.printBillTo();
+ System.out.print("Name: ");
+ String name = in.readLine();
+ System.out.println();
+
+ System.out.print("Street: ");
+ String street = in.readLine();
+ System.out.println();
+
+ System.out.print("City: ");
+ String city = in.readLine();
+ System.out.println();
+
+ System.out.print("State: ");
+ String state = in.readLine();
+ System.out.println();
+
+ System.out.print("Zip: ");
+ String zip = in.readLine();
+ if ((zip != null) && (!zip.equals(""))) {
+ selectSetDecimalOption(in, poc);
+ }
+ System.out.println();
+
+ poc.modifyBillTo(name, street, city, state, zip);
+ } catch (Exception e) {
+ System.out.println("Sorry unexpected exception occured when modifying address :" + e.toString());
+ e.printStackTrace();
+ }
+
+ break;
+
+ case ADD_ITEM:
+
+ try {
+ System.out.println("Add item to Purchase Order");
+ System.out.print("Product Number: ");
+ String productNumber = in.readLine();
+ System.out.println();
+
+ System.out.print("Product Name: ");
+ String productName = in.readLine();
+ System.out.println();
+
+ System.out.print("Quantity: ");
+ int quantity = Integer.valueOf(in.readLine()).intValue();
+ System.out.println();
+
+ System.out.print("Price: ");
+ double price = Double.valueOf(in.readLine()).doubleValue();
+ System.out.println();
+
+ System.out.print("Comment: ");
+ String comment = in.readLine();
+ System.out.println();
+
+ poc.addItem(productNumber, productName, price, quantity, comment);
+ } catch (Exception e) {
+ System.out.println("Sorry unexpected exception occured when adding item :" + e.toString());
+ e.printStackTrace();
+ }
+
+ break;
+ case REMOVE_ITEM:
+ try {
+ System.out.print("Please enter the index of the item you would like to remove :");
+ String index = in.readLine();
+ poc.removeItem(Integer.valueOf(index).intValue());
+
+ } catch (Exception e) {
+ System.out.println("Sorry there was an error when remove item : " + e.toString());
+ e.printStackTrace();
+
+ }
+ break;
+ case SAVE:
+ try {
+ poc.save();
+ } catch (IOException e) {
+ System.out.println("Sorry an error was received : " + e.toString());
+ e.printStackTrace();
+ }
+ break;
+ case SAVE_AS:
+ System.out.print("FileName:");
+ String fileName = in.readLine();
+ try {
+ poc.saveAs(fileName);
+ System.out.println("File saved to " + fileName);
+ } catch (IOException e) {
+ System.out.println("Sorry an error was received : " + e.toString());
+ e.printStackTrace();
+ }
+ break;
+ case SHOW_CHANGE_SUMMARY:
+ try {
+
+ poc.printChangeSummary();
+ } catch (Exception e) {
+ System.out.println("Sorry exception caught when accessing change summary : " + e.toString());
+ e.printStackTrace();
+ }
+
+ break;
+ case SHOW_XML_DOCUMENT:
+ try {
+ System.out.println("XMLDocument representing purchase order: ");
+ System.out.println(poc.getXMLString());
+ } catch (Exception e) {
+ System.out.println("Sorry there was an erorr when printing the XMLDocument :" + e.toString());
+ e.printStackTrace();
+ }
+ break;
+ case QUIT:
+ inOperation = false;
+ break;
+ default:
+ System.out.println("Sorry I did not understand the command");
+ printMenu();
+ }
+ }
+ System.out.println("Goodbye");
+
+ } catch (Exception e) {
+ System.out.println("Unexpected exception occured during execution: " + e.toString());
+ e.printStackTrace();
+ }
+
+ }
+
+ private static void selectSetDecimalOption(BufferedReader in, PurchaseOrderControl poc) {
+ try {
+
+ System.out.println("SDO provides a number of methods to set properties on a DataObject");
+ System.out.println("Please select the method that you would like to use in order to set decimal values");
+ System.out.println("1. dataObject.set(. . . )");
+ System.out.println("2. dataObject.setString(. . . )");
+ System.out.println("3. dataObject.setDouble(. . . )");
+ System.out.print(">>>");
+
+ poc.setDecimalPropertyMethod(Integer.valueOf(in.readLine()).intValue());
+ } catch (Exception e) {
+ System.out.println("invalid option - oh well");
+ }
+
+ }
+
+ private static void printUsage() {
+ System.out.println("***************************************");
+ System.out.println("java org.apache.tuscany.samples.sdo.otherSources.PurchaseOrderCmdLine <xsdFileName> <xmlFileName>");
+ System.out.println("If xsdFileName and xmlFileName are not specified " + SdoSampleConstants.PO_XSD_RESOURCE + " and "
+ + SdoSampleConstants.PO_XML_RESOURCE + " will be used as resources");
+ System.out.println("Specify null if you wish to use the appropiate resource from the jar rather specifying a fileName");
+ System.out.println("***************************************");
+ }
+
+ private static void printMenu() {
+ System.out.println("***************************************");
+ System.out.println("Purchase Order Control Menu");
+ System.out.println(MENU + ". MENU");
+ System.out.println(PRINT_SUMMARY + ". PRINT_SUMMARY");
+ System.out.println(PRINT_ALL_PROPERTIES + ". PRINT_ALL_PROPERTIES");
+ System.out.println(PRINT_BILLTO + ". PRINT_BILLTO");
+ System.out.println(PRINT_SHIPTO + ". PRINT_SHIPTO");
+ System.out.println(APPEND_COMMENT + ". APPEND_COMMENT");
+ System.out.println(MODIFY_SHIP_TO + ". MODIFY_SHIP_TO");
+ System.out.println(MODIFY_BILL_TO + ". MODIFY_BILL_TO");
+ System.out.println(ADD_ITEM + ". ADD_ITEM");
+ System.out.println(REMOVE_ITEM + ". REMOVE_ITEM");
+ System.out.println(SAVE + ". SAVE");
+ System.out.println(SAVE_AS + ". SAVE_AS");
+ System.out.println(SHOW_CHANGE_SUMMARY + ". SHOW_CHANGE_SUMMARY");
+ System.out.println(SHOW_XML_DOCUMENT + ". SHOW_XML_DOCUMENT");
+ System.out.println(QUIT + ". QUIT");
+ System.out.println("***************************************");
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/otherSources/PurchaseOrderControl.java b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/otherSources/PurchaseOrderControl.java
new file mode 100644
index 0000000000..d58a9307f4
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/otherSources/PurchaseOrderControl.java
@@ -0,0 +1,494 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.samples.sdo.otherSources;
+
+import java.io.*;
+
+import java.util.List;
+import java.math.BigDecimal;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.ChangeSummary;
+import commonj.sdo.helper.XMLDocument;
+import commonj.sdo.helper.XMLHelper;
+import commonj.sdo.helper.XSDHelper;
+import commonj.sdo.helper.CopyHelper;
+
+import org.apache.tuscany.samples.sdo.SdoSampleConstants;
+
+import org.apache.tuscany.samples.sdo.specCodeSnippets.*;
+
+/**
+ * Provides operational API for purchase order sample for SDO. It is used by
+ * {@link PurchaseOrderCmdLine} for an interactive sample. Often relies upon
+ * methods that are located within the {@link org.apache.tuscany.samples.sdo.otherSources} package.
+ * @see org.apache.tuscany.samples.sdo.otherSources.PurchaseOrderCmdLine
+ *
+ */
+public class PurchaseOrderControl {
+
+ // there are a number of ways to set properties
+ // these constants define which mechanism the user
+ // would like to use.
+ public static final int SET_DECIMAL_PROPERTY_VIA_SET = 1;
+
+ public static final int SET_DECIMAL_PROPERTY_VIA_SET_STRING = 2;
+
+ public static final int SET_DECIMAL_PROPERTY_VIA_SET_DOUBLE = 3;
+
+ // local variable to determine which of the above mechanisms to use
+ private int decimalPropertyMethod = SET_DECIMAL_PROPERTY_VIA_SET_STRING;
+
+ // these files can be optionally used to specify where to locate xsd and xml
+ // to define types and populate DataObject
+ // if these are null will use the resources above
+ private String xmlFileName;
+
+ private String xsdFileName;
+
+ // root DataObject
+ private DataObject purchaseOrder;
+
+ /**
+ * Uses resources files included in jar file to define types (using xsd), and
+ * populate DataObjects (xml)
+ *
+ * @throws Exception
+ */
+ public PurchaseOrderControl() throws Exception {
+ this(null, null);
+ }
+
+ /**
+ * Uses files on the file system to define types (using xsd), and populate
+ * DataObjects (xml)
+ *
+ * @param xsdFileName
+ * location of po.xsd
+ * @param xmlFileName
+ * location of xml to populate DataObject (for example po.xml)
+ * @throws Exception
+ */
+ public PurchaseOrderControl(String xsdFileName, String xmlFileName) throws Exception {
+ this.xsdFileName = xsdFileName;
+ this.xmlFileName = xmlFileName;
+
+ // define purchase order types for SDO
+ definePurchaseOrderTypes();
+ // read in existing xml and populate DataObjects
+ readPurchaseOrderXml();
+ }
+
+ /**
+ * Method to take XSD (w3c) to define SDO types. This is static so that it can be
+ * used as a helper method for some simpler examples Uses either fileName used to
+ * construct this class or will use resource ( po.xsd ) included within jar file
+ */
+ private void definePurchaseOrderTypes() throws Exception {
+
+ if ((xsdFileName == null) || (xsdFileName.equals("")) || (xsdFileName.equalsIgnoreCase("null"))) {
+
+ // use simple example to define type from resource
+ CreateDataObjectFromXsdAndXmlFiles.definePurchaseOrderTypeUsingXsdResource();
+
+ } else {
+ System.out.println("Using file to access xsd in order to define types");
+ try {
+ FileInputStream fis = new FileInputStream(xsdFileName);
+ XSDHelper.INSTANCE.define(fis, null);
+ fis.close();
+ System.out.println("Sucessfully used " + xsdFileName + " to define types");
+
+ } catch (Exception e) {
+ System.out.println("Could not access file " + xsdFileName);
+ e.printStackTrace();
+ throw e;
+ }
+
+ }
+ }
+
+ /**
+ * Reads in xml and populates DataGraph.
+ *
+ * Will set the purchaseOrder to the root object Uses either fileName used to
+ * construct this class or will use resource ( po.xml ) included within jar file
+ */
+ public void readPurchaseOrderXml() throws Exception, FileNotFoundException {
+
+ if ((xmlFileName == null) || (xmlFileName.equals("")) || (xmlFileName.equalsIgnoreCase("null"))) {
+
+ purchaseOrder = CreateDataObjectFromXsdAndXmlFiles.createPurchaseOrderDataObjectUsingXmlResource();
+ } else {
+ try {
+
+ System.out.println("Using file to access xml to populate DataObjects");
+ FileInputStream fis = new FileInputStream(xmlFileName);
+ XMLDocument xmlDoc = XMLHelper.INSTANCE.load(fis);
+ purchaseOrder = xmlDoc.getRootObject();
+ System.out.println("Sucessfully used file to populate DataObjects");
+ fis.close();
+ } catch (Exception e) {
+ System.out.println("Could not open and use file " + xmlFileName);
+ e.printStackTrace();
+ throw e;
+ }
+ }
+
+ }
+
+ /**
+ * Appends new comment to comment property of purchase order Accesses comment
+ * property by name
+ *
+ * @param newComment
+ */
+ public void appendComment(String newComment) {
+ String oldComment = (String) purchaseOrder.get("comment");
+ setComment(oldComment + "-" + newComment);
+ }
+
+ /**
+ * Sets comment property on purchase order by accessing property by name
+ *
+ * @param comment
+ */
+ public void setComment(String comment) {
+ // set using path info
+ purchaseOrder.set("comment", comment);
+ }
+
+ /**
+ * Modifies complex address type for billTo. If any parameter is null it will not
+ * be modified
+ *
+ * @param name
+ * @param street
+ * @param city
+ * @param state
+ * @param zip
+ */
+ public void modifyBillTo(String name, String street, String city, String state, String zip) {
+
+ DataObject billTo = purchaseOrder.getDataObject("billTo");
+ modifyAddress(billTo, name, street, city, state, zip);
+ }
+
+ /**
+ * Modifies complex address type for shipTo. If any parameter is null it will not
+ * be modified
+ *
+ * @param name
+ * @param street
+ * @param city
+ * @param state
+ * @param zip
+ */
+ public void modifyShipTo(String name, String street, String city, String state, String zip) {
+
+ DataObject shipTo = purchaseOrder.getDataObject("shipTo");
+ modifyAddress(shipTo, name, street, city, state, zip);
+ }
+
+ /**
+ * Modifies complex address type ( used for either billTo or shipTo ) If any
+ * parameter is null it will not be modified
+ *
+ * @param name
+ * @param street
+ * @param city
+ * @param state
+ * @param zip
+ */
+ private void modifyAddress(DataObject dataObject, String name, String street, String city, String state, String zip) {
+ if ((name != null) && (!name.equals(""))) {
+ dataObject.set("name", name);
+ }
+ if ((street != null) && (!street.equals(""))) {
+ dataObject.set("street", street);
+ }
+ if ((city != null) && (!city.equals(""))) {
+ dataObject.set("city", city);
+ }
+ if ((state != null) && (!state.equals(""))) {
+ dataObject.set("state", state);
+ }
+ if ((zip != null) && (!zip.equals(""))) {
+ // there are a number of ways to set a decimal property
+ // so in order to demonstrate the various output results
+ // the user can determine which manner to do so
+ setDecimalPropertyOnDataObject(dataObject, "zip", zip);
+ }
+ }
+
+ /**
+ * Adds an additional item to the items list of the item property on purchase
+ * order DataObject
+ *
+ * @param partNumber
+ * @param productName
+ * @param price
+ * @param quantity
+ * @param comment
+ */
+ public void addItem(String partNumber, String productName, double price, int quantity, String comment) {
+ // get items dataObject
+ DataObject items = purchaseOrder.getDataObject("items");
+
+ // create a new child data object
+ DataObject newItem = items.createDataObject("item");
+ newItem.setString("partNum", partNumber);
+ newItem.setString("productName", productName);
+ newItem.setInt("quantity", quantity);
+ newItem.setDouble("price", price);
+ newItem.setString("comment", comment);
+
+ }
+
+ /**
+ * Removes a particular item from the items list. Obtains the List associated
+ * with the item property and removes by index
+ *
+ * @param index
+ */
+ public void removeItem(int index) {
+ // TODO: this is not working due to java.lang.ClassCastException:
+ // org.eclipse.emf.ecore.util.EcoreEList$Dynamic incompatible with
+ // commonj.sdo.DataObject
+ // access a DataObject by the index and then remove it
+ DataObject items = purchaseOrder.getDataObject("items");
+ List itemList = items.getList("item");
+ itemList.remove(index);
+ }
+
+ /**
+ * Saves modified purchase order DataObject to original xml used to populate it
+ * If resource packaged within jar is used will create a new file on file system
+ *
+ * @throws IOException
+ */
+ public void save() throws IOException {
+ if (this.xmlFileName != null) {
+ saveAs(xmlFileName);
+ } else {
+ System.out.println("Sorry, can not save to resource within jar, will create file called " + SdoSampleConstants.PO_XML_RESOURCE
+ + " and save");
+ saveAs(SdoSampleConstants.PO_XML_RESOURCE);
+ }
+ }
+
+ /**
+ * Saves modified purchaseOrder DataObject to file
+ *
+ * @param fileName.
+ * Location to save file to save DataObject to
+ * @throws IOException
+ */
+ public void saveAs(String fileName) throws IOException {
+ OutputStream stream = new FileOutputStream(fileName);
+ XMLHelper.INSTANCE.save(purchaseOrder, SdoSampleConstants.PO_NAMESPACE, "purchaseOrder", stream);
+ System.out.println("Saved to " + fileName);
+ }
+
+ // PRINTING METHODS TO SYSTEM.OUT
+
+ /**
+ * Prints purchase order summary to System.out
+ */
+
+ public void printChangeSummary() {
+
+ // TODO: change summary is not currently working
+ ChangeSummary changeSummary = getChangeSummary();
+ boolean logging = changeSummary.isLogging();
+ if (!logging) {
+ System.out.println("Change logging is disabled");
+ } else {
+ System.out.println("Change logging is enabled");
+ }
+ // TODO: complete this method
+
+ }
+
+ /**
+ * Uses simple sample PrintPropertiesOfDataObject
+ */
+ public void printPurchaseOrderProperties() throws Exception {
+ // use previously created method from simple sample
+ PrintPropertiesOfDataObject.printDataObjectProperties(purchaseOrder);
+ }
+
+ /**
+ * Accesses key properties via name and prints to System.out
+ *
+ */
+ public void printPurchaseOrderSummary() {
+ // use previously created method from simple sample
+ // for an example of accessing properties by name see
+ // AccessDataObjectPropertiesByName or
+ // the method below printAddressInfo
+ AccessDataObjectPropertiesByName.printPurchaseOrderSummary(purchaseOrder);
+ }
+
+ /**
+ * Accesses properties of USAddress Type by name and prints to System.out
+ *
+ * @param dataObject.
+ * Either shipTo and billTo property of purchase order
+ */
+ private void printAddressInfo(DataObject dataObject) {
+ System.out.println(" name: " + dataObject.get("name"));
+ System.out.println(" street: " + dataObject.get("street"));
+ System.out.println(" city: " + dataObject.get("city"));
+ System.out.println(" state: " + dataObject.get("state"));
+ System.out.println(" zip: " + dataObject.get("zip"));
+ }
+
+ /**
+ * Prints properties of shipTo
+ *
+ */
+ public void printBillTo() {
+ DataObject billTo = purchaseOrder.getDataObject("billTo");
+ printAddressInfo(billTo);
+ }
+
+ /**
+ * Prints properties of billTo
+ *
+ */
+ public void printShipTo() {
+ DataObject shipTo = purchaseOrder.getDataObject("shipTo");
+ printAddressInfo(shipTo);
+ }
+
+ // GETTERS AND SETTERS
+
+ /**
+ * Sets the mechanism to set decimal property for zip code Decimals can be set in
+ * a number of ways. This scenario controls how this class will set the zip code
+ * when modifying address
+ */
+ public void setDecimalPropertyMethod(int i) {
+ decimalPropertyMethod = i;
+ }
+
+ /**
+ * Gets the mechanism used to zip decimal property for the zip code of an address
+ *
+ * @return
+ */
+ public int getDecimalPropertyMethod() {
+ return decimalPropertyMethod;
+ }
+
+ // METHODS TO GET AND COPY DATAOBJECTS
+ /**
+ * @return purchaseOrder DataObject
+ */
+ public DataObject getPurchaseOrder() {
+ return purchaseOrder;
+ }
+
+ /**
+ *
+ * @return deep copy of the purchase order DataObject
+ */
+ public DataObject getDeepCopyPurchaseOrder() {
+ return CopyHelper.INSTANCE.copy(purchaseOrder);
+
+ }
+
+ /**
+ *
+ * @return shallow copy of the purchase order DataObject
+ */
+ public DataObject getShallowCopyPurchaseOrder() {
+ return CopyHelper.INSTANCE.copyShallow(purchaseOrder);
+ }
+
+ /**
+ * Currently this does not work
+ *
+ * @return Change summary for purchaseOrder
+ *
+ */
+ public ChangeSummary getChangeSummary() {
+ // TODO: why is the data graph null
+ return purchaseOrder.getDataGraph().getChangeSummary();
+ }
+
+ /**
+ *
+ * @return XMLDocument that represents current purchase order DataObject
+ */
+ public XMLDocument getXMLDocuement() {
+ return XMLHelper.INSTANCE.createDocument(purchaseOrder, SdoSampleConstants.PO_NAMESPACE, "purchaseOrder");
+ }
+
+ /**
+ *
+ * @return String xml representation of current purcahse order DataObject
+ */
+ public String getXMLString() {
+ // alternativly could use the following
+ // return XMLHelper.INSTANCE.createDocument(purchaseOrder, PO_NAMESPACE,
+ // "purchaseOrder").toString();
+ return XMLHelper.INSTANCE.save(purchaseOrder, SdoSampleConstants.PO_NAMESPACE, "purchaseOrder");
+ }
+
+ // PRIVATE HELPER METHODS
+
+ /**
+ * Uses a variety of ways to set a decimal property on a DataObject
+ *
+ * @param dataObject
+ * @param propertyName
+ * @param propertyValue
+ */
+ private void setDecimalPropertyOnDataObject(DataObject dataObject, String propertyName, String propertyValue) {
+ // since the type specified in the xsd is of type decimal when we
+ // wish to just use the set method one must construct a BigDecimal or
+ // else a ClassCastException will occur
+ // alternativly one could call dataObject.setString(zip) or
+ // dataObject.setDouble( Double.valueOf(zip))
+ switch (decimalPropertyMethod) {
+
+ case (SET_DECIMAL_PROPERTY_VIA_SET): {
+ dataObject.set(propertyName, new BigDecimal(propertyValue));
+ break;
+ }
+ case (SET_DECIMAL_PROPERTY_VIA_SET_DOUBLE): {
+ dataObject.setDouble(propertyName, Double.valueOf(propertyValue).doubleValue());
+ break;
+ }
+ case (SET_DECIMAL_PROPERTY_VIA_SET_STRING): {
+ dataObject.setString(propertyName, propertyValue);
+ break;
+ }
+ default: {
+ dataObject.setString(propertyName, propertyValue);
+ }
+
+ }// end of switch
+
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/otherSources/ReadPurchaseOrder.java b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/otherSources/ReadPurchaseOrder.java
new file mode 100644
index 0000000000..313294799b
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/otherSources/ReadPurchaseOrder.java
@@ -0,0 +1,139 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.samples.sdo.otherSources;
+
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.util.List;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.helper.XMLDocument;
+import commonj.sdo.helper.XMLHelper;
+import commonj.sdo.helper.XSDHelper;
+
+import org.apache.tuscany.samples.sdo.SdoSampleConstants;
+
+/**
+ * Reads purchase order DataObject from XML, based upon Fuhwei Lwo's paper <A
+ * HREF="http://www-128.ibm.com/developerworks/webservices/library/ws-sdoxmlschema/"
+ * title="Me" onClick="checkLinks(this)">Create and read an XML document based on XML
+ * Schema</A>. Uses file
+ * {@link org.apache.tuscany.samples.sdo.SdoSampleConstants#PO_XML_GENERATED}
+ * previously generated by {@link CreatePurchaseOrder} to populate purchase order
+ * DataObject
+ * <p>
+ * <b>Usage:</b> <br>
+ * 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.
+ * <br><br>
+ * If executing as a standalone application please do the following:
+ * <br>
+ * <UL>
+ * <LI>Include the following jar files on your classpath :
+ * <UL>
+ * <LI>SDO API and Tuscany Implementation
+ * <UL>
+ * <LI>sdo-api-{version}.jar - SDO API
+ * <LI>tuscany-sdo-impl-{version}.jar - Tuscany SDO implementation
+ * </UL>
+ * </LI>
+ * <LI>EMF dependencies.
+ * <UL>
+ * <LI>emf-common-{version}.jar - some common framework utility and base classes
+ * <LI>emf-ecore-{version}.jar - the EMF core runtime implementation classes (the Ecore metamodel)
+ * <LI>emf-ecore-change-{version}.jar - the EMF change recorder and framework
+ * <LI>emf-ecore-xmi-{version}.jar - EMF's default XML (and XMI) serializer and loader
+ * <LI>xsd-{version}.jar - the XML Schema model
+ * </UL>
+ * </LI>
+ * </UL>
+ *
+ * These jar files can be obtained by downloading and unpacking a <a href="http://cwiki.apache.org/TUSCANY/sdo-downloads.html" target="_blank">Tuscany binary distribution</a></LI>
+ * <LI>Execute: <br>
+ * java org.apache.tuscany.samples.sdo.otherSources.ReadPurchaseOrder</LI>
+ * </UL>
+ *
+ */
+public class ReadPurchaseOrder {
+
+ private static void definePOTypes() throws Exception {
+ InputStream is = ClassLoader.getSystemResourceAsStream(SdoSampleConstants.PO_XSD_RESOURCE);
+ if (is == null) {
+ System.out.println("InputStream is null");
+ } else {
+ System.out.println("Obtained Input Stream from resource");
+ }
+ XSDHelper.INSTANCE.define(is, null);
+ is.close();
+ }
+
+ public static void main(String[] args) {
+ System.out.println("***************************************");
+ System.out.println("SDO Sample ReadPurchaseOrder");
+ System.out.println("***************************************");
+ System.out.println("This sample is based upon Fuhwei Lwo's paper http://www-128.ibm.com/developerworks/webservices/library/ws-sdoxmlschema/");
+ System.out.println("previously generated by CreatePurchaseOrder sample to populate purchase order DataObject");
+
+ System.out.println("***************************************");
+
+ try {
+ definePOTypes();
+
+ FileInputStream fis = null;
+ try {
+ fis = new FileInputStream(SdoSampleConstants.PO_XML_GENERATED);
+ } catch (Exception e) {
+ System.out.println("Sorry an error occcured, please run CreatePurchaseOrder sample first");
+ System.out.println("Exception : " + e.toString());
+ e.printStackTrace();
+ return;
+ }
+
+ XMLDocument xmlDoc = XMLHelper.INSTANCE.load(fis);
+
+ DataObject purchaseOrder = xmlDoc.getRootObject();
+
+ System.out.println("Order date: " + purchaseOrder.get("orderDate"));
+ System.out.println("Comment: " + purchaseOrder.get("comment"));
+
+ DataObject shipTo = purchaseOrder.getDataObject("shipTo");
+ System.out.println("Ship to name: " + shipTo.get("name"));
+
+ DataObject billTo = purchaseOrder.getDataObject("billTo");
+ System.out.println("Bill to name: " + billTo.get("name"));
+ System.out.println();
+
+ DataObject items = purchaseOrder.getDataObject("items");
+ List itemList = items.getList("item");
+ for (int i = 0; i < itemList.size(); i++) {
+
+ DataObject item = (DataObject) itemList.get(i);
+
+ System.out.println("Part num: " + item.get("partNum"));
+ System.out.println("Product name: " + item.get("productName"));
+ } // for
+ } catch (Exception e) {
+ System.out.println("Sorry an error was encountered " + e.toString());
+ e.printStackTrace();
+ }
+ System.out.println("GoodBye");
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/otherSources/package.html b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/otherSources/package.html
new file mode 100644
index 0000000000..aaec9671ce
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/otherSources/package.html
@@ -0,0 +1,40 @@
+<html>
+<!--
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * -->
+<head>
+ <title>package information</title>
+</head>
+<body>
+
+Provides examples from sources other than the SDO specification. These examples are from whitepapers,
+ or are custom examples designed to show SDO in a more elegant light than the specification. They
+ also include basic interactive examples, and useful scenarios not outlined in the specification.
+ The user is encouraged to modify and execute these code examples.
+
+<h2>Related Documentation</h2>
+For overviews, tutorials, examples, guides, and tool documentation, please see
+
+<ul>
+ <li><a href="http://cwiki.apache.org/TUSCANY/sdo-overview.html"> SDO Java Overview</a> section of the Tuscany website.</li>
+ <li><a href="http://www-128.ibm.com/developerworks/webservices/library/ws-sdoxmlschema/">Create and read an XML document based on XML Schema</a></li>
+</ul>
+
+</body>
+</html> \ No newline at end of file
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/overview.html b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/overview.html
new file mode 100644
index 0000000000..4cfd70f17f
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/overview.html
@@ -0,0 +1,76 @@
+<html>
+<!--
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * -->
+<head>
+ <title>SDO Sample Overview</title>
+</head>
+<BODY>
+<h1>Tuscany Service Data Object (SDO) Sample Programs</h1>
+<h2>Overview</h2>
+This sample code is from the <a href="http://incubator.apache.org/tuscany"
+ target="_blank"> Apache Tuscany</a> project. The samples were written to help users
+understand and experiment with SDO. They are grouped into three packages according to the source of the example material. Some are based upon example code contained
+within the <a
+ href="http://osoa.org/display/Main/Service+Data+Objects+Specifications"
+ target="_bank">SDO Specification</a>, and are intended to be read alongside the specification. Others are based upon papers and published material
+ (see the documentation for each sample for the reference to the publication),
+ or were simply written specifically for these samples.
+<H2>Experimentation</H2>
+The SDO samples are written to be used in conjunction with the specification and other documents. However,
+the most important function that these samples provide is a place to begin experimenting with the SDO API
+and programming model. Developers are encouraged to extend and experiment with the current set of samples.
+If a sample is unclear, is missing documentation or a tutorial, or does not cover a desired area ,
+please send feedback to the tuscany mailing lists,
+or better still send us a patch or join the Tuscany team and contribute back to the
+<A href="http://incubator.apache.org/tuscany">project</A>.
+
+
+<h3>Getting Ready to run the Samples</h3>
+The samples depend on the following libraries<UL>
+ <LI>The SDO API and the Tuscany SDO Implementation
+ <UL>
+ <LI>sdo-api-{version}.jar - SDO API</LI>
+ <LI>tuscany-sdo-impl-{version}.jar - Tuscany SDO implementation</LI>
+ </UL>
+ </LI>
+ <LI>EMF dependencies.
+ <UL>
+ <LI>common-{version}.jar - some common framework utility and base
+ classes</LI>
+ <LI>ecore-{version}.jar - the EMF core runtime implementation
+ classes (the Ecore metamodel)</LI>
+ <LI>ecore-change-{version}.jar - the EMF change recorder and
+ framework</LI>
+ <LI>ecore-xmi-{version}.jar - EMF's default XML (and XMI)
+ serializer and loader</LI>
+ <LI>xsd-{version}.jar - the XML Schema model</LI></UL></LI></UL>
+<P>If you are running these samples from a Tuscany samples distribution you can resolve these dependencies by ensuring that all the jar files in the lib directory of the extracted distribution are on your classpath.<BR>
+<BR>
+If you are running these samples as a result of building Tuscany SDO for Java from a Tuscany source distribution using maven then these dependencies will be resolved by having followed the build instructions.<BR>
+<BR>To run these samples against the current Tuscany codebase, follow the instructions at <A
+ href="http://cwiki.apache.org/TUSCANY/developing-sdo-java.html">Developing SDO Java</A>, which describes how to build Tuscany SDO for Java in an Eclipse SDK environment.</P>
+<H3>Running the Samples</H3>
+<P>In order to get an overview of the samples the user may wish to run
+{@link org.apache.tuscany.samples.sdo.ExecuteSamples} which will execute
+all the command line examples.<BR>
+<FONT face="Courier">java org.apache.tuscany.samples.sdo.ExecuteSamples</FONT></P><P>Alternatively, browse the JavaDoc for the sample program classes and run an
+individual example of your choice in the same way. Another suggestion is to read the
+SDO specifciaton in conjunction with the examples in {@link
+org.apache.tuscany.samples.sdo.specExampleSection}.</P></BODY></html>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/package.html b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/package.html
new file mode 100644
index 0000000000..c1335e6e5b
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/package.html
@@ -0,0 +1,33 @@
+<html>
+<!--
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * -->
+<head>
+ <title>package information</title>
+</head>
+<body>
+Provides common constants and a command line java interface for executing samples.
+<h2>Related Documentation</h2>
+For overviews, tutorials, examples, guides, and tool documentation, please see the
+<a href="http://cwiki.apache.org/TUSCANY/sdo-overview.html"> SDO Java Overview
+</a>
+section of the Tuscany website.
+
+</body>
+</html> \ No newline at end of file
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specCodeSnippets/AccessDataObjectPropertiesByName.java b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specCodeSnippets/AccessDataObjectPropertiesByName.java
new file mode 100644
index 0000000000..72e50a3b9a
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specCodeSnippets/AccessDataObjectPropertiesByName.java
@@ -0,0 +1,150 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.samples.sdo.specCodeSnippets;
+
+import java.util.List;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.helper.XMLHelper;
+import commonj.sdo.helper.XSDHelper;
+import org.apache.tuscany.samples.sdo.SdoSampleConstants;
+
+/**
+ * Demonstrates accessing a created DataObject's properties by name.
+ *
+ * This sample is from the <a href="http://incubator.apache.org/tuscany"
+ * target="_blank"> Apache Tuscany</a> 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 <a
+ * href="http://osoa.org/download/attachments/36/Java-SDO-Spec-v2.1.0-FINAL.pdf?version=1"
+ * target="_bank">SDO Specification</a>.
+ *
+ * <br>
+ * <br>
+ * <b>Usage:</b> <br>
+ * 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.
+ * <br><br>
+ * If executing as a standalone application please do the following:
+ * <br>
+ * <UL>
+ * <LI>Include the following jar files on your classpath :
+ * <UL>
+ * <LI>SDO API and Tuscany Implementation
+ * <UL>
+ * <LI>sdo-api-{version}.jar - SDO API
+ * <LI>tuscany-sdo-impl-{version}.jar - Tuscany SDO implementation
+ * </UL>
+ * </LI>
+ * <LI>EMF dependencies.
+ * <UL>
+ * <LI>emf-common-{version}.jar - some common framework utility and base classes
+ * <LI>emf-ecore-{version}.jar - the EMF core runtime implementation classes (the Ecore metamodel)
+ * <LI>emf-ecore-change-{version}.jar - the EMF change recorder and framework
+ * <LI>emf-ecore-xmi-{version}.jar - EMF's default XML (and XMI) serializer and loader
+ * <LI>xsd-{version}.jar - the XML Schema model
+ * </UL>
+ * </LI>
+ * </UL>
+ *
+ * These jar files can be obtained by downloading and unpacking a <a href="http://cwiki.apache.org/TUSCANY/sdo-downloads.html" target="_blank">Tuscany binary distribution</a> </LI>
+ * <LI>Execute: <br>
+ * java org.apache.tuscany.samples.sdo.specCodeSnippets.AccessDataObjectPropertiesByName</LI>
+ * </UL>
+ */
+public class AccessDataObjectPropertiesByName {
+
+ /**
+ * Prints a subset of PurchaseOrder properties to System.out
+ *
+ * @param purchaseOrder.
+ * DataObject defined by Types in
+ * {@link org.apache.tuscany.samples.sdo.SdoSampleConstants#PO_XSD_RESOURCE}
+ */
+ public static void printPurchaseOrderSummary(DataObject purchaseOrder) {
+
+ // example accessing properties via property names
+ System.out.println("Purchase Order: ");
+ System.out.println(" Order date: " + purchaseOrder.get("orderDate"));
+ System.out.println(" Comment: " + purchaseOrder.get("comment"));
+
+ DataObject shipTo = purchaseOrder.getDataObject("shipTo");
+ System.out.println(" Ship to name: " + shipTo.get("name"));
+
+ DataObject billTo = purchaseOrder.getDataObject("billTo");
+ System.out.println(" Bill to name: " + billTo.get("name"));
+
+ DataObject items = purchaseOrder.getDataObject("items");
+ List itemList = items.getList("item");
+
+ System.out.println(" Items:");
+ for (int i = 0; i < itemList.size(); i++) {
+ DataObject item = (DataObject) itemList.get(i);
+ System.out.println(" Item " + i);
+ System.out.println(" Part num: " + item.get("partNum"));
+ System.out.println(" Product name: " + item.get("productName"));
+ }
+ }
+
+ /**
+ * Prints properties of a purchase order DataObject( properties are defined in
+ * the xsd
+ * {@link org.apache.tuscany.samples.sdo.SdoSampleConstants#PO_XSD_RESOURCE} and
+ * populated by xml
+ * {@link org.apache.tuscany.samples.sdo.SdoSampleConstants#PO_XML_RESOURCE} )
+ *
+ * @param args.
+ * No parameters required.
+ */
+ public static void main(String[] args) {
+
+ // information
+ System.out.println("***************************************");
+ System.out.println("SDO Sample AccessDataObjectPropertiesByName");
+ System.out.println("***************************************");
+ System.out.println("This sample will access a DataObject properties by name");
+ System.out.println("***************************************");
+
+ // create a DataObejct
+ DataObject purchaseOrder = null;
+ try {
+ XSDHelper.INSTANCE.define(ClassLoader.getSystemResourceAsStream(SdoSampleConstants.PO_XSD_RESOURCE), null);
+ purchaseOrder = XMLHelper.INSTANCE.load(ClassLoader.getSystemResourceAsStream(SdoSampleConstants.PO_XML_RESOURCE)).getRootObject();
+ System.out.println("DataObject created");
+ } catch (Exception e) {
+ System.out.println("Error creating DataObject " + e.toString());
+ e.printStackTrace();
+ return;
+ }
+
+ // start of sample
+ try {
+ System.out.println("Accessing properties by name");
+ printPurchaseOrderSummary(purchaseOrder);
+ } catch (Exception e) {
+ System.out.println("Sorry there was an error accessing properties by name " + e.toString());
+ e.printStackTrace();
+ }
+ System.out.println("GoodBye");
+ // end of sample
+ }
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specCodeSnippets/AccessDataObjectUsingValidXPath.java b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specCodeSnippets/AccessDataObjectUsingValidXPath.java
new file mode 100644
index 0000000000..7b3b7b05c6
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specCodeSnippets/AccessDataObjectUsingValidXPath.java
@@ -0,0 +1,135 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.samples.sdo.specCodeSnippets;
+
+import org.apache.tuscany.samples.sdo.SdoSampleConstants;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.helper.XMLHelper;
+import commonj.sdo.helper.XSDHelper;
+
+/**
+ * Demonstrates accessing a created DataObject's properties using the SDO XPath like syntax.
+ *
+ * This sample is from the <a href="http://incubator.apache.org/tuscany"
+ * target="_blank"> Apache Tuscany</a> project. It was written to help users
+ * understand and experiment with SDO. It is based upon code snipets contained
+ * within, and is meant for use with, and reference to the <a
+ * href="http://osoa.org/download/attachments/36/Java-SDO-Spec-v2.1.0-FINAL.pdf?version=1"
+ * target="_bank">SDO Specification</a>. <br>
+ * <p>
+ * <b>Usage:</b> <br>
+ * 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.
+ * <br><br>
+ * If executing as a standalone application please do the following:
+ * <br>
+ * <UL>
+ * <LI>Include the following jar files on your classpath :
+ * <UL>
+ * <LI>SDO API and Tuscany Implementation
+ * <UL>
+ * <LI>sdo-api-{version}.jar - SDO API
+ * <LI>tuscany-sdo-impl-{version}.jar - Tuscany SDO implementation
+ * </UL>
+ * </LI>
+ * <LI>EMF dependencies.
+ * <UL>
+ * <LI>emf-common-{version}.jar - some common framework utility and base classes
+ * <LI>emf-ecore-{version}.jar - the EMF core runtime implementation classes (the Ecore metamodel)
+ * <LI>emf-ecore-change-{version}.jar - the EMF change recorder and framework
+ * <LI>emf-ecore-xmi-{version}.jar - EMF's default XML (and XMI) serializer and loader
+ * <LI>xsd-{version}.jar - the XML Schema model
+ * </UL>
+ * </LI>
+ * </UL>
+ *
+ * These jar files can be obtained by downloading and unpacking a <a href="http://cwiki.apache.org/TUSCANY/sdo-downloads.html" target="_blank">Tuscany binary distribution</a></LI>
+ * <LI>Execute: java
+ * org.apache.tuscany.samples.sdo.specCodeSnippets.AccessDataObjectUsingValidXPath</LI>
+ */
+public class AccessDataObjectUsingValidXPath {
+
+ /**
+ * Prints a subset of item properties to System.out where the individual item was
+ * accessed using an xPath expression
+ *
+ * @param purchaseOrder.
+ * DataObject defined by Types in
+ * {@link org.apache.tuscany.samples.sdo.SdoSampleConstants#PO_XSD_RESOURCE}
+ */
+ public static void accessDataObjectUsingXPath(DataObject purchaseOrder) {
+
+ System.out.println("Accessing individual item from list using xpath");
+ // TODO: use variety of xpath expressions such as items/item[1]
+ // TODO: add to junit test cases for test cases above
+ DataObject item = purchaseOrder.getDataObject("items/item[1]");
+ System.out.println("Item toString : " + item.toString());
+
+ System.out.println("Item name:" + item.get("productName"));
+ System.out.println("Part num: " + item.get("partNum"));
+
+ }
+
+ /**
+ * Accesses and modifies properties of a purchase order DataObject using xPath(
+ * properties are defined in the xsd
+ * {@link org.apache.tuscany.samples.sdo.SdoSampleConstants#PO_XSD_RESOURCE} and
+ * populated by xml
+ * {@link org.apache.tuscany.samples.sdo.SdoSampleConstants#PO_XML_RESOURCE} )
+ *
+ * @param args.
+ * No parameters required.
+ */
+ public static void main(String[] args) {
+
+ // information
+ System.out.println("***************************************");
+ System.out.println("SDO Sample AccessDataObjectUsingValidXPath");
+ System.out.println("***************************************");
+ System.out.println("Demonstrats accessing a created DataObject's properties using xPath.");
+ System.out.println("***************************************");
+
+ // create a DataObejct
+ DataObject purchaseOrder = null;
+ try {
+ XSDHelper.INSTANCE.define(ClassLoader.getSystemResourceAsStream(SdoSampleConstants.PO_XSD_RESOURCE), null);
+ purchaseOrder = XMLHelper.INSTANCE.load(ClassLoader.getSystemResourceAsStream(SdoSampleConstants.PO_XML_RESOURCE)).getRootObject();
+ System.out.println("DataObject created");
+ } catch (Exception e) {
+ System.out.println("Error creating DataObject " + e.toString());
+ e.printStackTrace();
+ return;
+ }
+
+ // start of sample
+ try {
+
+ accessDataObjectUsingXPath(purchaseOrder);
+ } catch (Exception e) {
+ System.out.println("Sorry there was an error accessing properties by name " + e.toString());
+ e.printStackTrace();
+ }
+ System.out.println("GoodBye");
+ // end of sample
+ }
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specCodeSnippets/CreateDataObjectFromXmlString.java b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specCodeSnippets/CreateDataObjectFromXmlString.java
new file mode 100644
index 0000000000..9067117db5
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specCodeSnippets/CreateDataObjectFromXmlString.java
@@ -0,0 +1,160 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.samples.sdo.specCodeSnippets;
+
+import java.util.List;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Sequence;
+import commonj.sdo.helper.XMLHelper;
+
+/**
+ * Demonstrates creating a DataObject from a String of XML.
+ *
+ * The following sample is from the <a href="http://incubator.apache.org/tuscany"
+ * target="_blank"> Apache Tuscany</a> 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 <a
+ * href="http://osoa.org/download/attachments/36/Java-SDO-Spec-v2.1.0-FINAL.pdf?version=1"
+ * target="_blank">SDO Specification</a>. Specifically this sample is based upon section titled "Creating DataObjects from XML documents" <br>
+ * <br>
+ * <b>Usage:</b> <br>
+ * 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.
+ * <br><br>
+ * If executing as a standalone application please do the following:
+ * <br>
+ * <UL>
+ * <LI>Include the following jar files on your classpath :
+ * <UL>
+ * <LI>SDO API and Tuscany Implementation
+ * <UL>
+ * <LI>sdo-api-{version}.jar - SDO API
+ * <LI>tuscany-sdo-impl-{version}.jar - Tuscany SDO implementation
+ * </UL>
+ * </LI>
+ * <LI>EMF dependencies.
+ * <UL>
+ * <LI>emf-common-{version}.jar - some common framework utility and base classes
+ * <LI>emf-ecore-{version}.jar - the EMF core runtime implementation classes (the Ecore metamodel)
+ * <LI>emf-ecore-change-{version}.jar - the EMF change recorder and framework
+ * <LI>emf-ecore-xmi-{version}.jar - EMF's default XML (and XMI) serializer and loader
+ * <LI>xsd-{version}.jar - the XML Schema model
+ * </UL>
+ * </LI>
+ * </UL>
+ *
+ * These jar files can be obtained by downloading and unpacking a <a href="http://cwiki.apache.org/TUSCANY/sdo-downloads.html" target="_blank">Tuscany binary distribution </a> </LI>
+ * <LI>Execute: <br>
+ * java org.apache.tuscany.samples.sdo.specCodeSnippets.CreateDataObjectFromXmlString</LI>
+ * </UL>
+ */
+public class CreateDataObjectFromXmlString {
+
+ /**
+ * String representing a PurchaseOrder in XML format
+ */
+ public static final String XML_STRING = "<purchaseOrder orderDate='1999-10-20'>" + " <shipTo country='US'>" + " <name>Alice Smith</name>"
+ + " <street>123 Maple Street</street>" + " <city>Mill Valley</city>" + " <state>PA</state>" + " <zip>90952</zip>" + "</shipTo>"
+ + "</purchaseOrder>";
+
+ /**
+ * Creates a DataObject from an Xml String
+ *
+ * @return
+ */
+ public static DataObject createDataObjectFromXmlString() {
+
+ // TODO: do this with and without defining the schema
+ DataObject po = XMLHelper.INSTANCE.load(XML_STRING).getRootObject();
+ System.out.println("DataObject has been created : " + po.toString());
+ return po;
+ }
+
+ /**
+ * @param args
+ * None required
+ */
+ public static void main(String[] args) {
+
+ // information
+ System.out.println("***************************************");
+ System.out.println("SDO Sample CreateDataObjectFromXmlString");
+ System.out.println("***************************************");
+ System.out.println("Demonstrates creating a DataObject from a String of XML, based upon section titled 'Creating DataObjects from XML documents'");
+ System.out.println("***************************************");
+
+ // sample
+ try {
+
+ System.out.println("Use the following XML String: " + XML_STRING);
+ System.out.println("Creating DataObject");
+ DataObject po = createDataObjectFromXmlString();
+ System.out.println("The following DataObject was sucessfully created from the XML String");
+
+ System.out.println(XMLHelper.INSTANCE.save(po, "http://example.com/purchaseOrder", "purchaseOrder"));
+
+ /*
+ * Without a Type definition accessing a DataObject is slightly more
+ * difficult. This is because without a Type definition SDO does not know
+ * the intended multiplicity of properties. Currently the Tuscany
+ * implementation assumes that elements and attributes are lists. There
+ * is some discussion (SDO-3, also mentioned in SDO Specification JIRA SDO-22) about adding
+ * annotations to the XML (sdo:many="false") to control the indended
+ * multiplicity of DataObjects created without a model.
+ *
+ * The following code will not work when a model/schema is not defined
+ * shipTo = purchaseOrder.getDataObject("shipTo"); assertEquals("testing
+ * ship to name", shipTo.getString("name"), "Alice Smith");
+ * assertEquals("testing ship to zip", shipTo.getString("zip"), "90952");
+ */
+
+ System.out.println("Programatically access content of DataObject - getting name of the person this is getting shipped to");
+ // access the shipTo DataObject
+ List shipToList = po.getList("shipTo");
+ DataObject shipTo = (DataObject) shipToList.get(0);
+ // access the name DataObject
+
+ /*
+ * This is currently quite cumbersome. In future specifications accessing
+ * the name element will be simplier and the user could simply execute:
+ * List nameList = shipTo.getList("name"); String actualName = (String)
+ * nameList.get(0);
+ *
+ * Or if name is an attribute ("<shipTo country='US' name='Alice
+ * Smith'>") simply: String actualName = shipTo.getString("name");
+ *
+ * There are currently more elegant means to perform this task using the xPath support
+ */
+ List nameList = shipTo.getList("name");
+ DataObject name = (DataObject) nameList.get(0);
+ // access the contents of the name DataObject
+ Sequence s = name.getSequence();
+ String actualName = (String) s.getValue(0);
+ System.out.println("Name being shipped to: " + actualName);
+
+ } catch (Exception e) {
+ System.out.println("Sorry, exception caught when creating DataObject : " + e.toString());
+ e.printStackTrace();
+ }
+ // end of sample
+ System.out.println("GoodBye");
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specCodeSnippets/CreateDataObjectFromXsdAndXmlFiles.java b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specCodeSnippets/CreateDataObjectFromXsdAndXmlFiles.java
new file mode 100644
index 0000000000..ccbc4f75cd
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specCodeSnippets/CreateDataObjectFromXsdAndXmlFiles.java
@@ -0,0 +1,192 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.samples.sdo.specCodeSnippets;
+
+import java.io.InputStream;
+
+import org.apache.tuscany.samples.sdo.SdoSampleConstants;
+import commonj.sdo.DataObject;
+import commonj.sdo.helper.XMLDocument;
+import commonj.sdo.helper.XMLHelper;
+import commonj.sdo.helper.XSDHelper;
+
+
+/**
+ * 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 <a href="http://incubator.apache.org/tuscany"
+ * target="_blank"> Apache Tuscany</a> 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 <a
+ * href="http://osoa.org/download/attachments/36/Java-SDO-Spec-v2.1.0-FINAL.pdf?version=1"
+ * target="_bank">SDO Specification</a>. <br>
+ * <br>
+ * <br>Uses {@link org.apache.tuscany.samples.sdo.SdoSampleConstants#PO_XSD_RESOURCE} and {@link org.apache.tuscany.samples.sdo.SdoSampleConstants#PO_XML_RESOURCE} in order to define purcahseOrder DataObjects
+ * <br><br>
+ * <b>Usage:</b> <br>
+ * 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.
+ * <br><br>
+ * If executing as a standalone application please do the following:
+ * <br>
+ * <UL>
+ * <LI>Include the following jar files on your classpath :
+ * <UL>
+ * <LI>SDO API and Tuscany Implementation
+ * <UL>
+ * <LI>sdo-api-{version}.jar - SDO API
+ * <LI>tuscany-sdo-impl-{version}.jar - Tuscany SDO implementation
+ * </UL>
+ * </LI>
+ * <LI>EMF dependencies.
+ * <UL>
+ * <LI>emf-common-{version}.jar - some common framework utility and base classes
+ * <LI>emf-ecore-{version}.jar - the EMF core runtime implementation classes (the Ecore metamodel)
+ * <LI>emf-ecore-change-{version}.jar - the EMF change recorder and framework
+ * <LI>emf-ecore-xmi-{version}.jar - EMF's default XML (and XMI) serializer and loader
+ * <LI>xsd-{version}.jar - the XML Schema model
+ * </UL>
+ * </LI>
+ * </UL>
+ *
+ * These jar files can be obtained by downloading and unpacking a <a href="http://cwiki.apache.org/TUSCANY/sdo-downloads.html" target="_blank">Tuscany binary distribution</a> </LI>
+ * <LI>Execute: <br>
+ * java org.apache.tuscany.samples.sdo.specCodeSnippets.CreateDataObjectFromXsdAndXmlFiles</LI>
+ * </UL>
+ */
+public class CreateDataObjectFromXsdAndXmlFiles {
+
+ public static boolean typesDefined = false;
+
+
+ /**
+ * Loads the {@link org.apache.tuscany.samples.sdo.SdoSampleConstants#PO_XSD_RESOURCE} resource in order to define PurchaseOrder
+ * Types
+ */
+ public static void definePurchaseOrderTypeUsingXsdResource()
+ throws Exception {
+
+ InputStream is = null;
+ try {
+ System.out.println("Attempting to define types using resource "
+ + SdoSampleConstants.PO_XSD_RESOURCE);
+ is = ClassLoader.getSystemResourceAsStream(SdoSampleConstants.PO_XSD_RESOURCE);
+ if (is == null) {
+ System.out.println("InputStream is null, you may need to add the resources directory is on the classpath");
+ throw new Exception("InputStream for " + SdoSampleConstants.PO_XSD_RESOURCE + " was null, ensure that it is located on the classpath");
+ } else {
+ System.out.println("Obtained Input Stream from resoruce");
+ }
+ XSDHelper.INSTANCE.define(is, null);
+
+ } catch (Exception e) {
+ System.out
+ .println("Exception caught defining Types from resoruce stream to "
+ + SdoSampleConstants.PO_XSD_RESOURCE);
+ throw e;
+ } finally {
+ // try to close the input stream
+ if (is != null) {
+ try {
+ is.close();
+ System.out.println("Closed input stream");
+ } catch (Exception e) {
+ System.out.println("could not close input stream " + e.toString());
+ }
+ }
+ }
+ }
+
+ /**
+ * Uses resource {@link org.apache.tuscany.samples.sdo.SdoSampleConstants#PO_XML_RESOURCE} to populate DataObject
+ * @return populated purchase order DataObject
+ */
+ public static DataObject createPurchaseOrderDataObjectUsingXmlResource()
+ throws Exception {
+
+ if (! typesDefined){
+ definePurchaseOrderTypeUsingXsdResource();
+ }
+ DataObject purchaseOrder = null;
+ InputStream is = null;
+
+ try {
+
+ System.out
+ .println("Using resource as stream to access xml to populate DataObjects");
+ // FileInputStream fis = new FileInputStream(xmlFileName);
+ is = ClassLoader.getSystemResourceAsStream(SdoSampleConstants.PO_XML_RESOURCE);
+ if (is == null) {
+ System.out.println("InputStream is null");
+ } else {
+ System.out
+ .println("Successfully obtained InputStream from resource");
+ }
+ XMLDocument xmlDoc = XMLHelper.INSTANCE.load(is);
+ purchaseOrder = xmlDoc.getRootObject();
+
+ } catch (Exception e) {
+ System.out.println("Could not use resourceAsStream "
+ + e.toString());
+ e.printStackTrace();
+ throw e;
+ }finally {
+ // try to close the input stream
+ if (is != null) {
+ try {
+ is.close();
+ System.out.println("Closed input stream");
+ } catch (Exception e) {
+ System.out.println("Could not close input stream " + e.toString());
+ }
+ }
+ }
+
+ return purchaseOrder;
+ }
+
+ /**
+ * @param args. No arguments required
+ */
+ public static void main(String[] args) {
+ // information
+ System.out.println("***************************************");
+ System.out.println("SDO Sample CreateDataObjectFromXsdAndXmlFiles");
+ System.out.println("***************************************");
+ System.out.println("Demonstrates defining Types by using a predefined xsd resource, and populating a DataObject by using a previously created xml file");
+ System.out.println("***************************************");
+
+
+ try {
+ // define the types
+ definePurchaseOrderTypeUsingXsdResource();
+
+ // create a dataObject
+ DataObject purchaseOrder = createPurchaseOrderDataObjectUsingXmlResource();
+ System.out.println("DataObject sucessfully created");
+
+ } catch (Exception e) {
+ System.out.println("Sorry there was an error encountered " + e.toString());
+ }
+ System.out.println("GoodBye");
+ }
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specCodeSnippets/DynamicCustomerTypeSample.java b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specCodeSnippets/DynamicCustomerTypeSample.java
new file mode 100644
index 0000000000..4137b78379
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specCodeSnippets/DynamicCustomerTypeSample.java
@@ -0,0 +1,188 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.samples.sdo.specCodeSnippets;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Type;
+import commonj.sdo.helper.DataFactory;
+import commonj.sdo.helper.XMLHelper;
+import commonj.sdo.helper.TypeHelper;
+import java.util.List;
+
+/**
+ * Demonstrates creating and using Types dynamically. This sample is from the <a
+ * href="http://incubator.apache.org/tuscany" target="_blank"> Apache Tuscany</a>
+ * 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 <a
+ * href="http://osoa.org/download/attachments/36/Java-SDO-Spec-v2.1.0-FINAL.pdf?version=1"
+ * target="_bank">SDO Specification</a>. Specifically, this sample is based upon the
+ * section titled "Defining SDO Types Dynamically" <br>
+ * <br> * <b>Usage:</b> <br>
+ * 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.
+ * <br><br>
+ * If executing as a standalone application please do the following:
+ * <br>
+ * <UL>
+ * <LI>Include the following jar files on your classpath :
+ * <UL>
+ * <LI>SDO API and Tuscany Implementation
+ * <UL>
+ * <LI>sdo-api-{version}.jar - SDO API
+ * <LI>tuscany-sdo-impl-{version}.jar - Tuscany SDO implementation
+ * </UL>
+ * </LI>
+ * <LI>EMF dependencies.
+ * <UL>
+ * <LI>emf-common-{version}.jar - some common framework utility and base classes
+ * <LI>emf-ecore-{version}.jar - the EMF core runtime implementation classes (the Ecore metamodel)
+ * <LI>emf-ecore-change-{version}.jar - the EMF change recorder and framework
+ * <LI>emf-ecore-xmi-{version}.jar - EMF's default XML (and XMI) serializer and loader
+ * <LI>xsd-{version}.jar - the XML Schema model
+ * </UL>
+ * </LI>
+ * </UL>
+ *
+ * These jar files can be obtained by downloading and unpacking a <a href="http://cwiki.apache.org/TUSCANY/sdo-downloads.html" target="_blank">Tuscany binary distribution </a> </LI>
+ * <LI>Execute: <br>
+ * java org.apache.tuscany.samples.sdo.specCodeSnippets.DynamicCustomerTypeSample</LI>
+ * </UL>
+ */
+public class DynamicCustomerTypeSample {
+
+ /**
+ * XSD file used to define the model and Types for Customer Dataobject
+ */
+ public static final String CUSTOMER_MODEL = "customer.xsd";
+
+ /**
+ * Default file name to use when generated customer XSD files.
+ *
+ * @see org.apache.tuscany.samples.sdo.specCodeSnippets.CreateXmlAndXsdFromDataObject
+ */
+ public static final String CUSTOMER_MODEL_GENERATED = "generatedCustomer.xsd";
+
+ /**
+ * Fake namespace used for Customer
+ */
+ public static final String CUSTOMER_NAMESPACE = "http://www.example.com/customer";
+
+ /**
+ * XML file used to populate Customer DataObjects
+ */
+ public static final String CUSTOMER_XML = "customer.xml";
+
+ /**
+ * Default file name to use when generated customer XML files.
+ *
+ * @see org.apache.tuscany.samples.sdo.specCodeSnippets.CreateXmlAndXsdFromDataObject
+ */
+ public static final String CUSTOMER_XML_GENERATED = "generatedCustomer.xml";
+
+ /**
+ * Method dynamically defines customer types
+ */
+ public static void defineCustomerTypes() {
+ // get an instance of the type helper
+ TypeHelper types = TypeHelper.INSTANCE;
+ Type intType = types.getType("commonj.sdo", "Int");
+ Type stringType = types.getType("commonj.sdo", "String");
+
+ // create a new Type for Customers
+ DataObject customerType = DataFactory.INSTANCE.create("commonj.sdo", "Type");
+ customerType.set("uri", "http://example.com/customer");
+ customerType.set("name", "Customer");
+
+ // create a customer number property
+ DataObject custNumProperty = customerType.createDataObject("property");
+ custNumProperty.set("name", "custNum");
+ custNumProperty.set("type", intType);
+
+ // create a last name property
+ DataObject lastNameProperty = customerType.createDataObject("property");
+ lastNameProperty.set("name", "lastName");
+ lastNameProperty.set("type", stringType);
+
+ // create a first name property
+ DataObject firstNameProperty = customerType.createDataObject("property");
+ firstNameProperty.set("name", "firstName");
+ firstNameProperty.set("type", stringType);
+
+ // now define the Customer type so that customers can be made
+ types.define(customerType);
+
+ Type testType = TypeHelper.INSTANCE.getType("http://example.com/customer", "Customer");
+ List props = testType.getProperties();
+ for (int i = 0; i < props.size(); i++) {
+ System.out.println(props.get(i));
+ }
+ }
+
+ /**
+ * Creates a new Customer using dynamically defined Customer Type
+ *
+ * @param custNum
+ * @param firstName
+ * @param lastName
+ * @return
+ */
+ private static DataObject createCustomer(int custNum, String firstName, String lastName) {
+ DataFactory factory = DataFactory.INSTANCE;
+ DataObject customer1 = factory.create("http://example.com/customer", "Customer");
+ customer1.setInt("custNum", custNum);
+ customer1.set("firstName", firstName);
+ customer1.set("lastName", lastName);
+ return customer1;
+ }
+
+ /**
+ * Drives sample methods
+ *
+ * @param args
+ * no arguments required
+ */
+ public static void main(String args[]) {
+ System.out.println("***************************************");
+ System.out.println("SDO Sample DynamicCustomerTypeSample");
+ System.out.println("***************************************");
+ System.out.println("Demonstrats creating and using Types dynamically");
+ System.out.println("***************************************");
+ try {
+ System.out.println("Dynamically defining Customer Type");
+ defineCustomerTypes();
+
+ System.out.println("Creating new customer DataObject");
+ DataObject customer1 = createCustomer(1, "John", "Adams");
+ System.out.println("Customer Created");
+
+ System.out.println("converting to xml");
+ String xmlDocString = XMLHelper.INSTANCE.save(customer1, CUSTOMER_NAMESPACE, "customer");
+ System.out.println(xmlDocString);
+
+ } catch (Exception e) {
+ System.out.println("Sorry unexpected exception caught during sample execution : " + e.toString());
+ e.printStackTrace();
+ }
+ System.out.println("GoodBye");
+ }
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specCodeSnippets/ObtainingDataGraphFromXml.java b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specCodeSnippets/ObtainingDataGraphFromXml.java
new file mode 100644
index 0000000000..9236ad1fb2
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specCodeSnippets/ObtainingDataGraphFromXml.java
@@ -0,0 +1,184 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.samples.sdo.specCodeSnippets;
+
+import java.io.InputStream;
+
+import org.apache.tuscany.samples.sdo.SdoSampleConstants;
+
+import org.apache.tuscany.sdo.util.SDOUtil;
+import commonj.sdo.helper.XMLHelper;
+import commonj.sdo.helper.XSDHelper;
+import commonj.sdo.DataObject;
+import commonj.sdo.DataGraph;
+import commonj.sdo.Sequence;
+
+/**
+ * Demonstrates a variety of methods available to obtain the root DataObject
+ * contained within an xml representation of a DataGraph. This is currently a grey
+ * area of the specification and this samples demonstrates spec compliant means, as
+ * well as utility methods that have been added to Tuscany to address issues within
+ * the specification.
+ *
+ * The following sample is from the <a href="http://incubator.apache.org/tuscany"
+ * target="_blank"> Apache Tuscany</a> project. It was written to help users
+ * understand and experiment with SDO. It is based upon example code contained
+ * within, and is meant for use with, and reference to the <a
+ * href="http://osoa.org/download/attachments/36/Java-SDO-Spec-v2.1.0-FINAL.pdf?version=1"
+ * target="_bank">SDO Specification</a>. This sample attempts to clarify aspects of
+ * the the AccessDataObjectsUsingXPath example from the Examples section of the SDO
+ * specification.<br>
+ * <br>
+ * To define the correct Types for each DataObject ( CompanyType, DepartmentType etc )
+ * this sample relies upon
+ * {@link org.apache.tuscany.samples.sdo.SdoSampleConstants#COMPANY_XSD} which is
+ * provided in the resources directory of these samples. The xml file
+ * {@link org.apache.tuscany.samples.sdo.SdoSampleConstants#COMPANY_DATAGRAPH_XML} is
+ * used to load the DataGraph and is also located in this resources directory. <br>
+ * <P>
+ * <b>Usage:</b> <br>
+ * 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.
+ * <br><br>
+ * If executing as a standalone application please do the following:
+ * <br>
+ * <UL>
+ * <LI>Include the following jar files on your classpath :
+ * <UL>
+ * <LI>SDO API and Tuscany Implementation
+ * <UL>
+ * <LI>sdo-api-{version}.jar - SDO API
+ * <LI>tuscany-sdo-impl-{version}.jar - Tuscany SDO implementation
+ * </UL>
+ * </LI>
+ * <LI>EMF dependencies.
+ * <UL>
+ * <LI>emf-common-{version}.jar - some common framework utility and base classes
+ * <LI>emf-ecore-{version}.jar - the EMF core runtime implementation classes (the Ecore metamodel)
+ * <LI>emf-ecore-change-{version}.jar - the EMF change recorder and framework
+ * <LI>emf-ecore-xmi-{version}.jar - EMF's default XML (and XMI) serializer and loader
+ * <LI>xsd-{version}.jar - the XML Schema model
+ * </UL>
+ * </LI>
+ * </UL>
+ *
+ * These jar files can be obtained by downloading and unpacking a <a href="http://cwiki.apache.org/TUSCANY/sdo-downloads.html" target="_blank">Tuscany binary distribution</a> </LI>
+ * <LI>Execute: <br>
+ * java org.apache.tuscany.samples.sdo.specCodeSnippets.ObtainingDataGraphFromXml</LI>
+ * </UL>
+ *
+ * @see org.apache.tuscany.samples.sdo.specExampleSection.AccessDataObjectsUsingXPath
+ */
+
+public class ObtainingDataGraphFromXml {
+
+ /**
+ * Execute this method in order to run the sample.
+ *
+ * @param args
+ */
+ public static void main(String[] args) {
+ System.out.println("***************************************");
+ System.out.println("SDO Sample ObtainingDataGraphFromXml");
+ System.out.println("***************************************");
+ System.out.println("Demonstrates a vareity of methods available to obtain the root DataObject"
+ + " contained within an xml representation of a DataGraph.");
+ System.out.println("***************************************");
+
+
+ // define Types
+ try {
+ System.out.println("Defining Types using XSD");
+ InputStream is = null;
+ is = ClassLoader.getSystemResourceAsStream(SdoSampleConstants.COMPANY_XSD);
+ XSDHelper.INSTANCE.define(is, null);
+ is.close();
+ System.out.println("Type definition completed");
+ } catch (Exception e) {
+ System.out.println("Exception caught defining types " + e.toString());
+ e.printStackTrace();
+ }
+
+ try {
+
+ /**
+ * A DataGraph is an optional envelope for a graph of DataObjects and an
+ * associated ChangeSummary.
+ *
+ * The specification group is currently investigating options regarding
+ * obtaining a DataGraph from an xml file as well as the role of the
+ * DataGraph within the SDO specification.
+ *
+ * In order to obtain the rootObject contained within the specification
+ * the specification demonstrates reading in an XML file and obtaining a
+ * DataObject that represents the datagraph contained within the file.
+ * Note, that the specification does not obtain a DataGraph - there are
+ * not mechanisms within the specification for obtaining a DataGraph from
+ * xml. Obtaining the root DataObject from this datagraph representation
+ * is quite cumbersome and is demonstrated below.
+ *
+ * In order to address this current limitation within the specification
+ * Tuscany has added a utility method to SDOUtil that allows a user to
+ * obtain an actual DataGraph from xml.
+ */
+
+ DataObject company = null;
+
+ /**
+ * Use specification mechanism for obtaining a DataObject that represents the datagraph
+ */
+ System.out.println("Using specification methods to obtain DataObject represeenting a datagraph from xml");
+
+ // When the xml file represents a DataGraph the root Object
+ // of the XMLDocument is a DataGraph
+ DataObject dataObjectRepresentingDataGraph = XMLHelper.INSTANCE.load(
+ ClassLoader.getSystemResourceAsStream(SdoSampleConstants.COMPANY_DATAGRAPH_XML)).getRootObject();
+
+ // Obtain the company DataObject from the DataObject representing the datagraph
+ company = dataObjectRepresentingDataGraph.getDataObject("company");
+
+ System.out.println("Obtained DataObject representing datagraph");
+ System.out.println(dataObjectRepresentingDataGraph);
+ System.out.println("Obtained root DataObject from datagraph");
+ System.out.println(company);
+ System.out.println();
+
+
+ /**
+ * Use utility method to obtain an actual DataGraph from the xml
+ */
+ DataGraph datagraph = SDOUtil.loadDataGraph(ClassLoader.getSystemResourceAsStream(SdoSampleConstants.COMPANY_DATAGRAPH_XML), null);
+ // Obtain the company DataObject from the actual DataGraph
+ company = datagraph.getRootObject();
+ System.out.println("Obtained actual DataGraph:");
+ System.out.println(datagraph);
+ System.out.println("Obtained root DataObject from DataGraph:");
+ System.out.println(company);
+ System.out.println();
+
+ } catch (Exception e) {
+ System.out.println("Sorry there was an error encountered " + e.toString());
+ e.printStackTrace();
+ }
+ System.out.println("GoodBye");
+
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specCodeSnippets/PrintPropertiesOfDataObject.java b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specCodeSnippets/PrintPropertiesOfDataObject.java
new file mode 100644
index 0000000000..46d6738cc4
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specCodeSnippets/PrintPropertiesOfDataObject.java
@@ -0,0 +1,173 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.samples.sdo.specCodeSnippets;
+
+import java.util.List;
+
+import org.apache.tuscany.samples.sdo.SdoSampleConstants;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+import commonj.sdo.helper.XMLHelper;
+import commonj.sdo.helper.XSDHelper;
+
+/**
+ * Demonstrates iterating through, and inspecting properites of a DataObject. This
+ * sample shows listing properties of a DataObject, determining if the properties are
+ * set and whether they are simple properties or represent DataObjects <br>
+ * <br>
+ * This sample is from the <a href="http://incubator.apache.org/tuscany"
+ * target="_blank"> Apache Tuscany</a> 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 <a
+ * href=http://osoa.org/download/attachments/36/Java-SDO-Spec-v2.1.0-FINAL.pdf?version=1"
+ * target="_bank">SDO Specification</a>. This specific examples was based upon code
+ * snippets in the section titled 'Property Indexes'. <br>
+ * <b>Usage:</b> <br>
+ * 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.
+ * <br><br>
+ * If executing as a standalone application please do the following:
+ * <br>
+ * <UL>
+ * <LI>Include the following jar files on your classpath :
+ * <UL>
+ * <LI>SDO API and Tuscany Implementation
+ * <UL>
+ * <LI>sdo-api-{version}.jar - SDO API
+ * <LI>tuscany-sdo-impl-{version}.jar - Tuscany SDO implementation
+ * </UL>
+ * </LI>
+ * <LI>EMF dependencies.
+ * <UL>
+ * <LI>emf-common-{version}.jar - some common framework utility and base classes
+ * <LI>emf-ecore-{version}.jar - the EMF core runtime implementation classes (the Ecore metamodel)
+ * <LI>emf-ecore-change-{version}.jar - the EMF change recorder and framework
+ * <LI>emf-ecore-xmi-{version}.jar - EMF's default XML (and XMI) serializer and loader
+ * <LI>xsd-{version}.jar - the XML Schema model
+ * </UL>
+ * </LI>
+ * </UL>
+ *
+ * These jar files can be obtained by downloading and unpacking a <a href="http://cwiki.apache.org/TUSCANY/sdo-downloads.html" target="_blank">Tuscany binary distribution</a> </LI>
+ * <LI>Execute: <br>
+ * java org.apache.tuscany.samples.sdo.specCodeSnippets.PrintPropertiesOfDataObject</LI>
+ * </UL>
+ */
+
+public class PrintPropertiesOfDataObject {
+
+ /**
+ * Calls recursive method to inspect and print properties of a DataObject.
+ *
+ * @param DataObject.
+ * The DataObject to print the properties of
+ */
+ public static void printDataObjectProperties(DataObject myDo) throws Exception {
+ System.out.println("Recursivly inspecting and printing properties of DataObject");
+ printAndInspectDataObject(" ", myDo);
+ }
+
+ /**
+ * Recursivly inspects and prints DataObject. This method will list all set
+ * properties
+ *
+ * @param buffer.
+ * Blank string to help with formating
+ * @param myDo.
+ * DataObject to recursivly inspect and print the properties of.
+ * @throws Exception
+ */
+ private static void printAndInspectDataObject(String buffer, DataObject myDo) throws Exception {
+
+ for (int i = 0; i < myDo.getInstanceProperties().size(); i++) {
+ Property p = (Property) myDo.getInstanceProperties().get(i);
+ // just print out the name, type and string value of the property
+ Type type = p.getType();
+ System.out.print(buffer + " " + p.getName() + ",type=" + type.getName());
+ if (myDo.isSet(p)) {
+ // see if this represents a simple property or if the type is also a
+ // datatype
+ if (type.isDataType()) {
+ System.out.println(", simple type : " + myDo.get(i));
+ } else {
+
+ // check to see if the property has many values
+ if (p.isMany()) {
+ System.out.println(buffer + ", many valued with list of DataObjects : ");
+ List dataObjects = myDo.getList(p);
+ for (int x = 0; x < dataObjects.size(); x++) {
+ printAndInspectDataObject(buffer + " ", (DataObject) dataObjects.get(x));
+ System.out.println();
+ }
+
+ } else {
+
+ System.out.println(buffer + ", data object : ");
+ DataObject newDataObject = myDo.getDataObject(p);
+ printAndInspectDataObject(buffer + " ", newDataObject);
+ System.out.println("");
+ }
+ }
+ } else {
+ System.out.println(buffer + ", is not set");
+ }
+ }
+
+ }
+
+ /**
+ * @param args.
+ * none required.
+ */
+ public static void main(String[] args) {
+ // information
+ System.out.println("***************************************");
+ System.out.println("SDO Sample InspectAndPrintPropertiesOfDataObject");
+ System.out.println("***************************************");
+ System.out.println("Demonstrates a common pattern of looping through and inspecting the META-DATA for all instance properties."
+ + "This example uses recursion to iterate through properties which themselves are DataObjects.");
+ System.out.println("***************************************");
+
+ // create a DataObejct
+ DataObject purchaseOrder = null;
+ try {
+ XSDHelper.INSTANCE.define(ClassLoader.getSystemResourceAsStream(SdoSampleConstants.PO_XSD_RESOURCE), null);
+ purchaseOrder = XMLHelper.INSTANCE.load(ClassLoader.getSystemResourceAsStream(SdoSampleConstants.PO_XML_RESOURCE)).getRootObject();
+ System.out.println("DataObject created");
+ } catch (Exception e) {
+ System.out.println("Error creating DataObject " + e.toString());
+ e.printStackTrace();
+ return;
+ }
+
+ //print and inspect properties of the DataObject
+ try {
+ System.out.println("Will iterate and inspect the properties of the following data object " + purchaseOrder.toString());
+ printDataObjectProperties(purchaseOrder);
+
+ } catch (Exception e) {
+ System.out.println("Sorry, an error was encountered inspecting DataObject " + e.toString());
+ }
+ System.out.println("GoodBye");
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specCodeSnippets/UsingXPath.java b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specCodeSnippets/UsingXPath.java
new file mode 100644
index 0000000000..9d23290cd2
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specCodeSnippets/UsingXPath.java
@@ -0,0 +1,140 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.samples.sdo.specCodeSnippets;
+
+import org.apache.tuscany.samples.sdo.SdoSampleConstants;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.helper.XMLHelper;
+import commonj.sdo.helper.XSDHelper;
+
+/**
+ * Demonstrates accessing a created DataObject's properties using SDO's XPath like syntax.
+ *
+ * This sample is from the <a href="http://incubator.apache.org/tuscany" target="_blank"> Apache Tuscany</a> 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 <a
+ * href="http://osoa.org/download/attachments/36/Java-SDO-Spec-v2.1.0-FINAL.pdf?version=1" target="_bank">SDO Specification</a>
+ * <P>
+ * <b>Usage:</b> <br>
+ * 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. <br>
+ * <br>
+ * If executing as a standalone application please do the following: <br>
+ * <UL>
+ * <LI>Include the following jar files on your classpath :
+ * <UL>
+ * <LI>SDO API and Tuscany Implementation
+ * <UL>
+ * <LI>sdo-api-{version}.jar - SDO API
+ * <LI>tuscany-sdo-impl-{version}.jar - Tuscany SDO implementation
+ * </UL>
+ * </LI>
+ * <LI>EMF dependencies.
+ * <UL>
+ * <LI>emf-common-{version}.jar - some common framework utility and base classes
+ * <LI>emf-ecore-{version}.jar - the EMF core runtime implementation classes (the Ecore metamodel)
+ * <LI>emf-ecore-change-{version}.jar - the EMF change recorder and framework
+ * <LI>emf-ecore-xmi-{version}.jar - EMF's default XML (and XMI) serializer and loader
+ * <LI>xsd-{version}.jar - the XML Schema model
+ * </UL>
+ * </LI>
+ * </UL>
+ *
+ * These jar files can be obtained by downloading and unpacking a <a href="http://cwiki.apache.org/TUSCANY/sdo-downloads.html" target="_blank">Tuscany binary distribution </a> </LI>
+ * <LI>Execute: <br>
+ * java org.apache.tuscany.samples.sdo.specCodeSnippets.UsingXPath</LI>
+ * </UL>
+ */
+public class UsingXPath {
+
+ /**
+ * Prints a subset of item properties to System.out where the individual item was accessed using an xPath expression
+ *
+ * @param purchaseOrder.
+ * DataObject defined by Types in {@link org.apache.tuscany.samples.sdo.SdoSampleConstants#PO_XSD_RESOURCE}
+ */
+ public static void accessDataObjectUsingXPath(DataObject purchaseOrder) throws Exception {
+ // TODO: use variety of xpath expressions such as items/item[1]
+ // TODO: add to junit test cases for test cases above
+
+ // xpath expressions for obtaining various items
+ String[] xPathExpressions = { "items/item[1]","items/item[productName=\"Baby Monitor\"]" };
+
+ for (int i = 0; i < xPathExpressions.length; i++) {
+ try {
+ System.out.println("Accessing individual item from list using xpath expression" + xPathExpressions[i]);
+
+ DataObject item = purchaseOrder.getDataObject(xPathExpressions[i]);
+ System.out.println(" DataObject toString : " + item.toString());
+
+ System.out.println(" Item name:" + item.get("productName"));
+ System.out.println(" Part num: " + item.get("partNum"));
+ } catch (Exception e) {
+ System.out.println(" Sorry there was an error executing expression " + xPathExpressions[i]);
+ throw e;
+ }
+ }
+
+ //TODO: select various lists of properties from DataObjects using xPath.
+ }
+
+ /**
+ * Accesses and modifies properties of a purchase order DataObject using xPath( properties are defined in the xsd
+ * {@link org.apache.tuscany.samples.sdo.SdoSampleConstants#PO_XSD_RESOURCE} and populated by xml
+ * {@link org.apache.tuscany.samples.sdo.SdoSampleConstants#PO_XML_RESOURCE} )
+ *
+ * @param args.
+ * No parameters required.
+ */
+ public static void main(String[] args) {
+
+ // information
+ System.out.println("***************************************");
+ System.out.println("SDO Sample UsingXPath");
+ System.out.println("***************************************");
+ System.out.println("Demonstrats accessing a created DataObject's properties using xPath.");
+ System.out.println("***************************************");
+
+ // create a DataObejct
+ DataObject purchaseOrder = null;
+ try {
+ XSDHelper.INSTANCE.define(ClassLoader.getSystemResourceAsStream(SdoSampleConstants.PO_XSD_RESOURCE), null);
+ purchaseOrder = XMLHelper.INSTANCE.load(ClassLoader.getSystemResourceAsStream(SdoSampleConstants.PO_XML_RESOURCE)).getRootObject();
+ System.out.println("DataObject created");
+ } catch (Exception e) {
+ System.out.println("Error creating DataObject " + e.toString());
+ e.printStackTrace();
+ return;
+ }
+
+ // start of sample
+ try {
+
+ accessDataObjectUsingXPath(purchaseOrder);
+ } catch (Exception e) {
+ System.out.println("Sorry there was an error accessing properties by name " + e.toString());
+ e.printStackTrace();
+ }
+ System.out.println("GoodBye");
+ // end of sample
+ }
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specCodeSnippets/package.html b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specCodeSnippets/package.html
new file mode 100644
index 0000000000..b07bad89ff
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specCodeSnippets/package.html
@@ -0,0 +1,40 @@
+<html>
+<!--
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * -->
+<head>
+ <title>package information</title>
+</head>
+<body>
+
+Provides examples containing code snippets located throughout the SDO Specification. In general these samples attempt to use the
+code and comments contained within the specification but allow a certain degree of flexibility to extend or improve
+upon the code snippets where desirable.
+ The user is encouraged to modify and execute these code examples.
+
+
+<h2>Related Documentation</h2>
+
+For overviews, tutorials, examples, guides, and tool documentation, please see the
+<a href="http://cwiki.apache.org/TUSCANY/sdo-overview.html"> SDO Java Overview
+</a>
+section of the Tuscany website.
+
+</body>
+</html> \ No newline at end of file
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specExampleSection/AccessDataObjectsUsingXPath.java b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specExampleSection/AccessDataObjectsUsingXPath.java
new file mode 100644
index 0000000000..5fd7dbd0d1
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specExampleSection/AccessDataObjectsUsingXPath.java
@@ -0,0 +1,249 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.samples.sdo.specExampleSection;
+
+import java.util.List;
+
+import org.apache.tuscany.samples.sdo.SdoSampleConstants;
+
+import commonj.sdo.helper.XMLHelper;
+import commonj.sdo.helper.XSDHelper;
+import commonj.sdo.DataObject;
+
+/**
+ * Demonstrates accessing the properties of a DataObject using XPath queries.
+ *
+ * The following sample is from the <a href="http://incubator.apache.org/tuscany"
+ * target="_blank"> Apache Tuscany</a> 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 <a
+ * href="http://www.osoa.org/download/attachments/791/SDO_Specification_Java_V2.01.pdf?version=1"
+ * target="_bank">SDO Specification</a>. In general this sample attempts to use the
+ * code and comments contained within the specification, exceptions to this are noted
+ * in comments.<br>
+ * <br>
+ * This specific sample is based upon the AccessDataObjectsUsingXPath example from
+ * the Examples section of the SDO specification. It shows the use of DataObjects and
+ * the XMLHelper and demonstrates accessing the properties of a DataObject using
+ * XPath queries. <br>
+ * <br>
+ * This sample reads an xml file representing a DataObject of a company. A
+ * DataAccessService (DAS) is simply a component which creates a DataGraph or
+ * DataObject, it can also be responcible for creating SDO Types for created
+ * DataObjects. In order to create a DataObject or DataGraph this sample relies upon
+ * XMLHelper class which is essentially an example of a XML DAS. The code shown here
+ * would work just as well against an equivalent DataGraph or DataObject that was
+ * provided by any DAS that creates an identical DataObject/DataGraph of the same
+ * Type used here. <br>
+ * <br>
+ * To define the correct Types for each DataObject ( CompanyType, DepartmentType etc )
+ * this sample relies upon
+ * {@link org.apache.tuscany.samples.sdo.SdoSampleConstants#COMPANY_XSD} which is
+ * provided in the resources directory of these samples. The xml file
+ * {@link org.apache.tuscany.samples.sdo.SdoSampleConstants#COMPANY_DATAOBJECT_XML}
+ * used to load the DataObject is also located in this resources directory. The xsd
+ * the xml was generated by
+ * {@link org.apache.tuscany.samples.sdo.otherSources.CreateCompany} which is a good
+ * resource for how to populate or create DataObjects or DataGraphs dynamically. <br>
+ * <br>
+ * The following example has the same effect as
+ * {@link org.apache.tuscany.samples.sdo.specExampleSection.AccessDataObjectsViaPropertyIndex}.
+ * <br><br>
+ * <b>Usage:</b> <br>
+ * 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.
+ * <br><br>
+ * If executing as a standalone application please do the following:
+ * <br>
+ * <UL>
+ * <LI>Include the following jar files on your classpath :
+ * <UL>
+ * <LI>SDO API and Tuscany Implementation
+ * <UL>
+ * <LI>sdo-api-{version}.jar - SDO API
+ * <LI>tuscany-sdo-impl-{version}.jar - Tuscany SDO implementation
+ * </UL>
+ * </LI>
+ * <LI>EMF dependencies.
+ * <UL>
+ * <LI>emf-common-{version}.jar - some common framework utility and base classes
+ * <LI>emf-ecore-{version}.jar - the EMF core runtime implementation classes (the Ecore metamodel)
+ * <LI>emf-ecore-change-{version}.jar - the EMF change recorder and framework
+ * <LI>emf-ecore-xmi-{version}.jar - EMF's default XML (and XMI) serializer and loader
+ * <LI>xsd-{version}.jar - the XML Schema model
+ * </UL>
+ * </LI>
+ * </UL>
+ *
+ * These jar files can be obtained by downloading and unpacking a <a href="http://cwiki.apache.org/TUSCANY/sdo-downloads.html" target="_blank">Tuscany binary distribution</a></LI>
+ * <LI>Execute: <br>
+ * java org.apache.tuscany.samples.sdo.specExampleSection.AccessDataObjectsUsingXPath </LI>
+ * </UL>
+ *
+ * @author Robbie Minshall
+ * @see org.apache.tuscany.samples.sdo.specCodeSnippets.ObtainingDataGraphFromXml
+ */
+
+public class AccessDataObjectsUsingXPath {
+
+ /**
+ * Execute this method in order to run the sample.
+ *
+ * @param args
+ */
+ public static void main(String[] args) {
+ System.out.println("***************************************");
+ System.out.println("SDO Sample AccessDataObjectsUsingXPath");
+ System.out.println("***************************************");
+ System.out.println("Demonstrates accessing the properties of a DataObject using XPath queries");
+ System.out.println("***************************************");
+
+ /**
+ * In order to associate the correct Type, to the DataObjects represented in
+ * the xml Read in the model/schema which is declared within the xsd so that
+ * it can be associated. If the Types were not defined in this manner you can
+ * still populate, access and use a DataObject or DataGraph but would not
+ * have the protection and use of use afforded by the relationships declared
+ * within the model.
+ */
+ try {
+ System.out.println("Defining Types using XSD");
+ XSDHelper.INSTANCE.define(ClassLoader.getSystemResourceAsStream(SdoSampleConstants.COMPANY_XSD), null);
+ System.out.println("Type definition completed");
+ } catch (Exception e) {
+ System.out.println("Exception caught defining types " + e.toString());
+ e.printStackTrace();
+ }
+
+ try {
+
+ /**
+ * The specification Example demonstrates using both a DataObject and
+ * DataGraph representation of a compony model. This example simply uses
+ * a DataObject representation.
+ *
+ * Obtain the RootObject from the XMLDocument obtained from the XMLHelper
+ * instance. In this case the root object is a DataObject representing a
+ * company
+ */
+
+ DataObject company = XMLHelper.INSTANCE.load(ClassLoader.getSystemResourceAsStream(SdoSampleConstants.COMPANY_DATAOBJECT_XML)).getRootObject();
+
+ // print out some information to show the user what the objects
+ // look like
+ System.out.println("Company DataObject:");
+ System.out.println(company);
+
+ String generatedXml = XMLHelper.INSTANCE.save(company, SdoSampleConstants.COMPANY_NAMESPACE, "company");
+ System.out.println("Company data object xml representation: ");
+ System.out.println(generatedXml);
+
+ /*
+ * If we wish to change the name of the company DataObject from "ACME" to
+ * "MEGACORP" , we could use the following:
+ */
+
+ // Set the "name" property for the company
+ System.out.println("Setting 'name' property for the company DataObject to 'MEGACORP'");
+ company.setString("name", " MegaCorp");
+ System.out.println();
+
+ /*
+ * Now, suppose we wish to access the employee whose serial number is
+ * "E0002" If we know that this employee is located at index 1 within the
+ * department that is located at index 0 within the company object one
+ * way to do this is by traversing each reference in the data graph and
+ * locating each DataObject in the many-valued department property using
+ * it's index in the list. For example, from the company, we can get a
+ * list of departments, from that list we can get the department at index
+ * 0, from there we can get a list of employees, and from that list we
+ * can get the employee at index 1.
+ */
+
+ System.out
+ .println("Obtain employee whose serial number is 'E0002' by acessing list of departments via index, and then accessing specific employee by index. This requies that we know the indices of both the department and employee");
+ // Get the list of departments
+ List departments = company.getList("departments");
+ // Get the department at index 0 on the list
+ DataObject department = (DataObject) departments.get(0);
+ // Get the list of employees for the department
+ List employees = department.getList("employees");
+ // Get the employee at index 2 on the list
+ DataObject employeeFromList = (DataObject) employees.get(2);
+
+ /*
+ * Alternatively, we can write a single XPath expression that directly
+ * accesses the employee from the root company. Please note that the
+ * specification's use of . indexing starting at index 0 is not true
+ * xPath. Please see the
+ * org.apache.tuscany.samples.sdo.specCodeSnippets.UsingXPath
+ * example for more examples of using xPath. A more appropiate use of
+ * xPath might be
+ *
+ * employeeFromXPath =
+ * company.getDataObject("departments[1]/employees[3]");
+ *
+ */
+
+ System.out.println("Obtain employee using xPath expression");
+ DataObject employeeFromXPath = company.getDataObject("departments.0/employees.2");
+
+ /*
+ * In order to remove that employee from the data graph, we could
+ */
+
+ // remove the employee from the list of employees
+ System.out.println("Removing employee " + employeeFromXPath.getString("name") + " from list of employees");
+ employeeFromXPath.detach();
+
+ /*
+ * And, finally, to create a new employee:
+ */
+ // create a new employee
+ System.out.println("Creating new employee (manager) Al Smith and adding to list");
+ DataObject newEmployee = department.createDataObject("employees");
+
+ newEmployee.set("name", "Al Smith");
+ newEmployee.set("SN", "E0005");
+ newEmployee.setBoolean("manager", true);
+
+ // Reset employeeOfTheMonth to be the new employee
+ System.out.println("Setting employee of the month to new employee");
+ company.set("employeeOfTheMonth", newEmployee.getString("SN"));
+
+ // print out some information to show the user what the objects
+ // look like
+ System.out.println("The modified company DataObject: ");
+ System.out.println(company);
+ System.out.println();
+
+ generatedXml = XMLHelper.INSTANCE.save(company, SdoSampleConstants.COMPANY_NAMESPACE, "company");
+ System.out.println("Company data object xml representation: ");
+ System.out.println(generatedXml);
+ System.out.println();
+
+ } catch (Exception e) {
+ System.out.println("Sorry there was an error encountered " + e.toString());
+ e.printStackTrace();
+ }
+ System.out.println("GoodBye");
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specExampleSection/AccessingDataObjectsViaPropertyIndex.java b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specExampleSection/AccessingDataObjectsViaPropertyIndex.java
new file mode 100644
index 0000000000..6d112f5e51
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specExampleSection/AccessingDataObjectsViaPropertyIndex.java
@@ -0,0 +1,230 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.samples.sdo.specExampleSection;
+
+import java.io.InputStream;
+import java.util.List;
+
+import org.apache.tuscany.samples.sdo.SdoSampleConstants;
+
+import commonj.sdo.helper.XMLHelper;
+import commonj.sdo.helper.XSDHelper;
+import commonj.sdo.DataObject;
+
+/**
+ * Demonstrates accessing the properties of a DataObject using property indices.
+ *
+ * The following sample is from the <a href="http://incubator.apache.org/tuscany"
+ * target="_blank"> Apache Tuscany</a> project. It was written to help users
+ * understand and experiment with SDO. It is based upon example code contained
+ * within, and is meant for use with, and reference to the <a
+ * href="http://www.osoa.org/download/attachments/791/SDO_Specification_Java_V2.01.pdf?version=1"
+ * target="_bank">SDO Specification</a>. In general this sample attempts to use the
+ * code and comments contained within the specification, exceptions to this are noted
+ * in comments.<br>
+ * <br>
+ * The following sample is based upon the 'Accessing DataObjects via Property Index'
+ * example from the Examples section of the SDO specification. It shows the use of
+ * DataObjects and the XMLHelper amd demonstrates accessing the properties of a
+ * DataObject using property indices. <br>
+ * <br>
+ * The following example has the same effect as
+ * {@link org.apache.tuscany.samples.sdo.specExampleSection.AccessDataObjectsUsingXPath}.
+ * The indexes for the properties are defined as constants in this class. <br>
+ * <br>
+ * This sample reads an xml file representing a DataObject of a company. In order to
+ * create a DataObject or DataGraph this sample relies upon XMLHelper class which is
+ * essentially example of a XML DAS implementation. The code shown here would work
+ * just as well against an equivalent DataObject that was provided by any DAS. <br>
+ * <br>
+ * To define the correct Types for each DataObject ( CompanyType, DepartmentType etc )
+ * this sample relies upon
+ * {@link org.apache.tuscany.samples.sdo.SdoSampleConstants#COMPANY_XSD} which is
+ * provided in the resources directory of these samples <br>
+ * The xml file
+ * {@link org.apache.tuscany.samples.sdo.SdoSampleConstants#COMPANY_DATAOBJECT_XML}
+ * used to load the DataObject is also located in this resources directory. To help
+ * ensure consistancy with the xsd the xml was generated by
+ * {@link org.apache.tuscany.samples.sdo.otherSources.CreateCompany} which is a good
+ * resource for populating DataObjects, or creating DataGraphs dynamically.
+ * <br><br>
+ * <b>Usage:</b> <br>
+ * 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.
+ * <br><br>
+ * If executing as a standalone application please do the following:
+ * <br>
+ * <UL>
+ * <LI>Include the following jar files on your classpath :
+ * <UL>
+ * <LI>SDO API and Tuscany Implementation
+ * <UL>
+ * <LI>sdo-api-{version}.jar - SDO API
+ * <LI>tuscany-sdo-impl-{version}.jar - Tuscany SDO implementation
+ * </UL>
+ * </LI>
+ * <LI>EMF dependencies.
+ * <UL>
+ * <LI>emf-common-{version}.jar - some common framework utility and base classes
+ * <LI>emf-ecore-{version}.jar - the EMF core runtime implementation classes (the Ecore metamodel)
+ * <LI>emf-ecore-change-{version}.jar - the EMF change recorder and framework
+ * <LI>emf-ecore-xmi-{version}.jar - EMF's default XML (and XMI) serializer and loader
+ * <LI>xsd-{version}.jar - the XML Schema model
+ * </UL>
+ * </LI>
+ * </UL>
+ *
+ * These jar files can be obtained by downloading and unpacking a <a href="http://cwiki.apache.org/TUSCANY/sdo-downloads.html" target="_blank">Tuscany binary distribution </a> </LI>
+ * <LI>Execute: <br>
+ * java org.apache.tuscany.samples.sdo.specExampleSection.AccessingDataObjectsViaPropertyIndex </LI>
+ * </UL>
+ *
+ * Note: when reading this source code in conjunction with the specification there is scope for confusion
+ * over what the values of the numeric indices ought to be, depending on your understanding of the
+ * word "lexical" in the context of sequencing. So the SDO specification at the 2.0.1 level (and before) says
+ * <i>The order of Properties in Type.getDeclaredProperties() is the lexical order of declarations in the
+ * XML Schema ComplexType.</i>. So if your background is in computing and in particular in lexical parsing
+ * then you would understand this to mean "the sequence of tokens produced by the lexical analyis (first) phase of a compiler"
+ * and if you ran a lexical parser against the complex type then you would see the elements emerege in the order they were
+ * written down. If however you think more in terms of lexical in the context of lexicons or dictionaries, you may
+ * expect the indices to correspond to the lexically sorted (essentially alphabetically sorted) list of element names.
+ * After some investigation it is understood that the intention of the spec is to convey the first of these meanings.
+ * A clarification in the SDO 2.1 spec is being sought, but may not make it into that document in time.
+ *
+ * @author Robbie Minshall
+ */
+
+public class AccessingDataObjectsViaPropertyIndex {
+
+ /**
+ * Predefine the property indexes.
+ *
+
+ */
+
+ private static final int COMPANY_DEPARTMENT = 0;
+
+ private static final int COMPANY_EMPLOYEE_OF_MONTH = 1;
+
+ private static final int COMPANY_NAME = 2;
+
+ private static final int DEPARTMENT_EMPLOYEES = 0;
+
+ private static final int EMPLOYEE_NAME = 0;
+ private static final int EMPLOYEE_SN = 1;
+ private static final int EMPLOYEE_MANAGER = 2;
+
+
+ /**
+ * Execute this method in order to run the sample.
+ *
+ * @param args
+ */
+ public static void main(String[] args) {
+ System.out.println("***************************************");
+ System.out.println("SDO Sample AccessingDataObjectsViaPropertyIndex");
+ System.out.println("***************************************");
+ System.out.println("Demonstrates accessing the properties of a DataObject using property indices.");
+ System.out.println("***************************************");
+
+ // TODO: what happens if not type is defined
+ try {
+ System.out.println("Defining Types using XSD");
+ InputStream is = null;
+ is = ClassLoader.getSystemResourceAsStream(SdoSampleConstants.COMPANY_XSD);
+ XSDHelper.INSTANCE.define(is, null);
+ is.close();
+ System.out.println("Type definition completed");
+ } catch (Exception e) {
+ System.out.println("Exception caught defining types " + e.toString());
+ e.printStackTrace();
+ }
+
+ try {
+
+ /**
+ * In this example simply use a company DataObject read in from xml
+ */
+
+ // For DataObjects
+ // Obtain the RootObject from the XMLDocument obtained from the XMLHelper
+ // instance.
+ // In this case the root object is a DataObject representing a company
+ DataObject company = XMLHelper.INSTANCE.load(ClassLoader.getSystemResourceAsStream(SdoSampleConstants.COMPANY_DATAOBJECT_XML))
+ .getRootObject();
+
+ // print out some information to show the user what the objects look like
+ System.out.println("Company DataObject:");
+ System.out.println(company);
+
+ String generatedXml = XMLHelper.INSTANCE.save(company, SdoSampleConstants.COMPANY_NAMESPACE, "company");
+ System.out.println("Company data object xml representation: ");
+ System.out.println(generatedXml);
+
+ System.out.println("Setting name of company to MegaCorp");
+ // Set the "name" property for the company
+ company.setString(COMPANY_NAME, "MegaCorp");
+ // Get the list of departments
+ List departments = company.getList(COMPANY_DEPARTMENT);
+ // Get the department at index 0 on the list
+ DataObject department = (DataObject) departments.get(0);
+ // Get the list of employees for the department
+ List employees = department.getList(DEPARTMENT_EMPLOYEES);
+ // Get the employee at index 1 on the list
+ DataObject employeeFromList = (DataObject) employees.get(2);
+
+ // remove the employee from the graph
+ System.out.println("Removing employee " + employeeFromList.getString("name") + " from list of employees");
+ employeeFromList.detach();
+
+ // create a new employee
+ System.out.println("Creating new employee (manager) Al Smith and adding to list");
+ DataObject newEmployee = department.createDataObject(DEPARTMENT_EMPLOYEES);
+
+ /**
+ * Properties from Type.getDeclaredProperties, or Type.getProperties
+ * should be in lexical (alphanumerical) ordering of the xml schema
+ * complex type.
+ */
+
+ newEmployee.set(EMPLOYEE_NAME, "Al Smith");
+ newEmployee.set(EMPLOYEE_SN, "E0005");
+ newEmployee.setBoolean(EMPLOYEE_MANAGER, true);
+
+ System.out.println("setting employee of the month to new employee");
+ company.set(COMPANY_EMPLOYEE_OF_MONTH, newEmployee.get(EMPLOYEE_SN));
+
+ // print out some information to show the user what the objects look like
+ System.out.println("The modified company DataObject :");
+ System.out.println(company);
+
+ generatedXml = XMLHelper.INSTANCE.save(company, SdoSampleConstants.COMPANY_NAMESPACE, "company");
+ System.out.println("Company data object xml representation: ");
+ System.out.println(generatedXml);
+
+ } catch (Exception e) {
+ System.out.println("Sorry there was an error encountered " + e.toString());
+ e.printStackTrace();
+ }
+ System.out.println("GoodBye");
+
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specExampleSection/AccessingTheContentsOfASequence.java b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specExampleSection/AccessingTheContentsOfASequence.java
new file mode 100644
index 0000000000..c6db6001ed
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specExampleSection/AccessingTheContentsOfASequence.java
@@ -0,0 +1,192 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.samples.sdo.specExampleSection;
+
+
+import commonj.sdo.helper.XMLHelper;
+import commonj.sdo.helper.XSDHelper;
+import commonj.sdo.DataObject;
+import commonj.sdo.Sequence;
+import commonj.sdo.Property;
+
+/**
+ * Demonstrates accessing the sequence from a DataObject containing mixed content.
+ *
+ * The following sample is from the <a href="http://incubator.apache.org/tuscany"
+ * target="_blank"> Apache Tuscany</a> 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 <a
+ * href="http://www.osoa.org/download/attachments/791/SDO_Specification_Java_V2.01.pdf?version=1"
+ * target="_bank">SDO Specification</a>. In general this sample attempts to use the
+ * code and comments contained within the specification, exceptions to this are noted
+ * in comments.<br>
+ *
+ * Specifically the following sample is based upon the 'Accessing the contents of a Sequence' example from the Examples section of the SDO specification. <br>
+ * <br>
+ * The following code uses the Sequence interface to analyze the contents of a DataObject that conforms to teh Letter model defined in
+ * {@link #LETTER_XSD}. This code first goes through the Sequence looking for unformatted text entrires and prints them out. Then the code checks to
+ * verify that the contents of teh "lastName" property of the DataObject matches the contents of the same property of the Sequence. <br>
+ * <br>
+ * This sample reads an xml file (@link #LETTER_XML} representing a DataObject of a letter. In order to create a DataObject or DataGraph this sample
+ * relies upon XMLHelper class which is an example of a XML DAS. The code shown here would work just as well against an equivalent DataObject that was
+ * provided by any DAS. <br>
+ *
+ * The XSD for {@link #LETTER_XSD} defines the FormLetter complex type as mixed. Mixed content and sequences are often used for semi structured business data.
+ * <br><br>
+ * <b>Usage:</b> <br>
+ * 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.
+ * <br><br>
+ * If executing as a standalone application please do the following:
+ * <br>
+ * <UL>
+ * <LI>Include the following jar files on your classpath :
+ * <UL>
+ * <LI>SDO API and Tuscany Implementation
+ * <UL>
+ * <LI>sdo-api-{version}.jar - SDO API
+ * <LI>tuscany-sdo-impl-{version}.jar - Tuscany SDO implementation
+ * </UL>
+ * </LI>
+ * <LI>EMF dependencies.
+ * <UL>
+ * <LI>emf-common-{version}.jar - some common framework utility and base classes
+ * <LI>emf-ecore-{version}.jar - the EMF core runtime implementation classes (the Ecore metamodel)
+ * <LI>emf-ecore-change-{version}.jar - the EMF change recorder and framework
+ * <LI>emf-ecore-xmi-{version}.jar - EMF's default XML (and XMI) serializer and loader
+ * <LI>xsd-{version}.jar - the XML Schema model
+ * </UL>
+ * </LI>
+ * </UL>
+ *
+ * These jar files can be obtained by downloading and unpacking a <a href="http://cwiki.apache.org/TUSCANY/sdo-downloads.html" target="_blank">Tuscany binary distribution </a> </LI>
+ * <LI>Execute: <br>
+ * java org.apache.tuscany.samples.sdo.specExampleSection.AccessingTheContentsOfASequence</LI>
+ * </UL>
+ *
+ * @author Robbie Minshall
+ */
+
+public class AccessingTheContentsOfASequence {
+
+ /**
+ * previously created XSD file used
+ */
+ public static final String LETTER_XSD = "letter.xsd";
+
+ /**
+ * previously created XML file used
+ */
+ public static final String LETTER_XML = "letter.xml";
+
+ /**
+ * Execute this method in order to run the sample.
+ *
+ * @param args
+ */
+ public static void main(String[] args) {
+ System.out.println("***************************************");
+ System.out.println("SDO Sample AccessingTheContentsOfASequence");
+ System.out.println("***************************************");
+ System.out.println("Demonstrates accessing the sequence from a DataObject containing mixed content.");
+ System.out.println("***************************************");
+
+ try {
+ // define model
+ System.out.println("Defining Types using XSD");
+ XSDHelper.INSTANCE.define(ClassLoader.getSystemResourceAsStream(LETTER_XSD), null);
+
+ // define letter data object
+ System.out.println("Loading Letter DataObject from XML");
+ DataObject letter = XMLHelper.INSTANCE.load(ClassLoader.getSystemResourceAsStream(LETTER_XML)).getRootObject();
+
+ // print letter sequence
+ System.out.println("Printing sequence for " + letter);
+ System.out.println(XMLHelper.INSTANCE.save(letter, "letter.xsd", "letter"));
+ printSequence(letter);
+
+ } catch (Exception e) {
+ System.out.println("Sorry there was an error encountered " + e.toString());
+ e.printStackTrace();
+ }
+ System.out.println("GoodBye");
+
+ }
+
+ /**
+ * Uses the Sequence interface to analyze the contents of a DataObject that conforms to teh Letter model defined in
+ * {@link #LETTER_XSD}. This code first goes through the Sequence looking for unformatted text entrires and prints them out. Then the code checks
+ * to verify that the contents of the "lastName" property of the DataObject matches the contents of the same property of the Sequence. <br>
+ *
+ * @param letter. Letter DataObject conforming to {@link #LETTER_XSD}
+ */
+ public static void printSequence(DataObject letter) {
+ // Access the Sequence of the FormLetter
+ System.out.println("The type is for letter dataObject is mixed " + XSDHelper.INSTANCE.isMixed(letter.getType()));
+
+ Sequence letterSequence = letter.getSequence();
+ // Print out all the settings that contain unstructured text
+ System.out.println("Unstructured text:");
+ for (int i = 0; i < letterSequence.size(); i++) {
+
+ /*
+ * Please note that the following line is a correction to the 2.0 specification which incorrectly calls:
+ *
+ * String propertyName = ((Property) letterSequence.getProperty(i)).getName();
+ *
+ * According to the SDO API sequence.getProperty will return null if the content is mixed, in this case
+ * we want to print it out as unstructured text
+ */
+ Property prop = letterSequence.getProperty(i);
+ if (prop == null) {
+ String text = (String) letterSequence.getValue(i);
+ System.out.println("\t(" + text + ")");
+ }
+
+ }
+
+ /*
+ * Please note that the following line is a correction to the 2.0 Specification which incorrectly uses letterDataObject variable rather than
+ * simply letter
+ */
+ // Verify that the lastName property of the DataObject has the same
+ // value as the lastName property for the Sequence.
+ String dataObjectLastName = letter.getString("lastName");
+ for (int i = 0; i < letterSequence.size(); i++) {
+
+ /*
+ * The following line has been corrected from the 2.0 specification
+ * According to the SDO API sequence.getProperty will return null if the content is mixed.
+ * We want to check that the content is not mixed, and then check that it it is the property which
+ * we are looking for
+ */
+ Property property = letterSequence.getProperty(i);
+
+ if ( (property != null) && ("lastName".equals(property.getName()))) {
+ String sequenceLastName = (String) letterSequence.getValue(i);
+ if (dataObjectLastName == sequenceLastName)
+ System.out.println("Last Name property matches");
+ break;
+ }
+ }
+ }
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specExampleSection/CreatingDataObjectTreesFromXMLDocuments.java b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specExampleSection/CreatingDataObjectTreesFromXMLDocuments.java
new file mode 100644
index 0000000000..dc7253de88
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specExampleSection/CreatingDataObjectTreesFromXMLDocuments.java
@@ -0,0 +1,134 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.samples.sdo.specExampleSection;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.helper.XMLHelper;
+import commonj.sdo.helper.XSDHelper;
+
+import org.apache.tuscany.samples.sdo.SdoSampleConstants;
+
+/**
+ * Demonstrates creating a DataObject from an XML String.
+ * <br>
+ * The following sample is from the <a href="http://incubator.apache.org/tuscany"
+ * target="_blank"> Apache Tuscany</a> 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 <a
+ * href="http://www.osoa.org/download/attachments/791/SDO_Specification_Java_V2.01.pdf?version=1"
+ * target="_bank">SDO Specification</a>. In general this sample attempts to use the
+ * code and comments contained within the specification, exceptions to this are noted
+ * in comments.<br>
+ * <br>
+ * Specifically this sample is based upon the 'Creating DataObject Trees from XML
+ * documents' example from the Examples section of the SDO Specification. It is
+ * possible to convert to and from XML documents to build DataObject trees, which is
+ * useful when assembling DataObjects from serval data sources. This sample uses the
+ * XMLHelper to convert xml Strings to DataObjects. <br>
+ * <br>
+ * Uses previously defined model
+ * {@link org.apache.tuscany.samples.sdo.SdoSampleConstants#PO_XSD_RESOURCE} to
+ * define types then generates a purchase order DataObject and persists to
+ * {@link org.apache.tuscany.samples.sdo.SdoSampleConstants#PO_XML_GENERATED}
+ * <br><br>
+ * <b>Usage:</b> <br>
+ * 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.
+ * <br><br>
+ * If executing as a standalone application please do the following:
+ * <br>
+ * <UL>
+ * <LI>Include the following jar files on your classpath :
+ * <UL>
+ * <LI>SDO API and Tuscany Implementation
+ * <UL>
+ * <LI>sdo-api-{version}.jar - SDO API
+ * <LI>tuscany-sdo-impl-{version}.jar - Tuscany SDO implementation
+ * </UL>
+ * </LI>
+ * <LI>EMF dependencies.
+ * <UL>
+ * <LI>emf-common-{version}.jar - some common framework utility and base classes
+ * <LI>emf-ecore-{version}.jar - the EMF core runtime implementation classes (the Ecore metamodel)
+ * <LI>emf-ecore-change-{version}.jar - the EMF change recorder and framework
+ * <LI>emf-ecore-xmi-{version}.jar - EMF's default XML (and XMI) serializer and loader
+ * <LI>xsd-{version}.jar - the XML Schema model
+ * </UL>
+ * </LI>
+ * </UL>
+ *
+ * These jar files can be obtained by downloading and unpacking a <a href="http://cwiki.apache.org/TUSCANY/sdo-downloads.html" target="_blank">Tuscany binary distribution </a> </LI>
+ * <LI>Execute: <br>
+ * java org.apache.tuscany.samples.sdo.specExampleSection.CreatingDataObjectTreesFromXMLDocuments</LI>
+ * </UL>
+ *
+ * @author Robbie Minshall
+ * @see {@link org.apache.tuscany.samples.sdo.otherSources.CreatePurchaseOrder}
+ */
+
+public class CreatingDataObjectTreesFromXMLDocuments {
+
+ /**
+ * Drives sample
+ *
+ * @param args.
+ * none required.
+ */
+ public static void main(String[] args) {
+ try {
+
+ System.out.println("***************************************");
+ System.out.println("SDO Sample CreatingDataObjectTreesFromXMLDocuments");
+ System.out.println("***************************************");
+
+ // use xsd to define purchase order types
+ System.out.println("Definging purchase order types using " + SdoSampleConstants.PO_XSD_RESOURCE);
+ XSDHelper.INSTANCE.define(ClassLoader.getSystemResourceAsStream(SdoSampleConstants.PO_XSD_RESOURCE), null);
+ System.out.println("Defined Types using xsd");
+
+ System.out.println("Creating purchase order DataObject using previously created " + SdoSampleConstants.PO_XML_RESOURCE);
+ DataObject purchaseOrder = XMLHelper.INSTANCE.load(ClassLoader.getSystemResourceAsStream(SdoSampleConstants.PO_XML_RESOURCE))
+ .getRootObject();
+
+ // To create the shipTo DataObject from XML:
+ String shipToXML = "<shipTo country='US'>" + " <name>Alice Smith</name>" + " <street>123 Maple Street</street>"
+ + " <city>Mill Valley</city>" + " <state>PA</state>" + " <zip>90952</zip>" + "</shipTo>";
+ DataObject shipTo = XMLHelper.INSTANCE.load(shipToXML).getRootObject();
+
+ // Modify shipTo DataObject on purchaseOrder to value created from a
+ // String
+ System.out.println("Modifying shipTo DataObject on purchaseOrder to value created from a String");
+ purchaseOrder.set("shipTo", shipTo);
+
+ // Obtain and convert the billTo DataObject to XML
+ System.out.println("Obtaining billTo dataObject from purchase order and converting to XML");
+ DataObject billTo = purchaseOrder.getDataObject("billTo");
+ String billToXML = XMLHelper.INSTANCE.save(billTo, null, "billTo");
+ System.out.println("billTo DataObject:");
+ System.out.println(billToXML);
+
+ } catch (Exception e) {
+ System.out.println("Sorry an error occured " + e.toString());
+ e.printStackTrace();
+ }
+ System.out.println("GoodBye");
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specExampleSection/CreatingXmlFromDataObjects.java b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specExampleSection/CreatingXmlFromDataObjects.java
new file mode 100644
index 0000000000..ff9d213c1d
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specExampleSection/CreatingXmlFromDataObjects.java
@@ -0,0 +1,158 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.samples.sdo.specExampleSection;
+
+import java.io.FileOutputStream;
+import java.io.OutputStream;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.helper.DataFactory;
+import commonj.sdo.helper.XMLHelper;
+import commonj.sdo.helper.XSDHelper;
+
+import org.apache.tuscany.samples.sdo.SdoSampleConstants;
+
+/**
+ * Demonstrates programmatically creating a DataObject and generating an XML String.
+ * <br>
+ * The following sample is from the <a href="http://incubator.apache.org/tuscany"
+ * target="_blank"> Apache Tuscany</a> 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 <a
+ * href="http://www.osoa.org/download/attachments/791/SDO_Specification_Java_V2.01.pdf?version=1"
+ * target="_bank">SDO Specification</a>. In general this sample attempts to use the
+ * code and comments contained within the specification, exceptions to this are noted
+ * in comments.<br>
+ * <br>
+ * Specifically this sample is based upon the 'Creating XML from DataObjects' example
+ * from the SDO specification's Examples section. <br>
+ * <br>
+ * Uses previously defined model
+ * {@link org.apache.tuscany.samples.sdo.SdoSampleConstants#PO_XSD_RESOURCE} to
+ * define types then generates a purchase order DataObject and persists to
+ * {@link org.apache.tuscany.samples.sdo.SdoSampleConstants#PO_XML_GENERATED}
+ * <br><br>
+ * <b>Usage:</b> <br>
+ * 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.
+ * <br><br>
+ * If executing as a standalone application please do the following:
+ * <br>
+ * <UL>
+ * <LI>Include the following jar files on your classpath :
+ * <UL>
+ * <LI>SDO API and Tuscany Implementation
+ * <UL>
+ * <LI>sdo-api-{version}.jar - SDO API
+ * <LI>tuscany-sdo-impl-{version}.jar - Tuscany SDO implementation
+ * </UL>
+ * </LI>
+ * <LI>EMF dependencies.
+ * <UL>
+ * <LI>emf-common-{version}.jar - some common framework utility and base classes
+ * <LI>emf-ecore-{version}.jar - the EMF core runtime implementation classes (the Ecore metamodel)
+ * <LI>emf-ecore-change-{version}.jar - the EMF change recorder and framework
+ * <LI>emf-ecore-xmi-{version}.jar - EMF's default XML (and XMI) serializer and loader
+ * <LI>xsd-{version}.jar - the XML Schema model
+ * </UL>
+ * </LI>
+ * </UL>
+ *
+ * These jar files can be obtained by downloading and unpacking a <a href="http://cwiki.apache.org/TUSCANY/sdo-downloads.html" target="_blank">Tuscany binary distribution </a> </LI>
+ * <LI>Execute: <br>
+ * java org.apache.tuscany.samples.sdo.specExampleSection.CreatingXmlFromDataObjects</LI>
+ * </UL>
+ *
+ * @author Robbie Minshall
+ * @see {@link org.apache.tuscany.samples.sdo.otherSources.CreatePurchaseOrder}
+ */
+
+public class CreatingXmlFromDataObjects {
+
+ /**
+ * Drives sample
+ *
+ * @param args.
+ * none required.
+ */
+ public static void main(String[] args) {
+ try {
+
+ System.out.println("***************************************");
+ System.out.println("SDO Sample CreatingXmlFromDataObjects");
+ System.out.println("***************************************");
+ System.out.println("Demonstrates programmatically creating a DataObject and generating an XML String");
+ System.out.println("***************************************");
+
+ XSDHelper.INSTANCE.define(ClassLoader.getSystemResourceAsStream(SdoSampleConstants.PO_XSD_RESOURCE), null);
+ System.out.println("Defined Types using xsd");
+ DataObject purchaseOrder = DataFactory.INSTANCE.create(SdoSampleConstants.PO_NAMESPACE, "PurchaseOrderType");
+ System.out.println("Created DataObject using DataFactory");
+
+ System.out.println("Populating purchase order data object");
+
+ purchaseOrder.setString("orderDate", "1999-10-20");
+
+ DataObject shipTo = purchaseOrder.createDataObject("shipTo");
+ shipTo.set("country", "US");
+ shipTo.set("name", "Alice Smith");
+ shipTo.set("street", "123 Maple Street");
+ shipTo.set("city", "Mill Valley");
+ shipTo.set("state", "CA");
+ shipTo.setString("zip", "90952");
+ DataObject billTo = purchaseOrder.createDataObject("billTo");
+ billTo.set("country", "US");
+ billTo.set("name", "Robert Smith");
+ billTo.set("street", "8 Oak Avenue");
+ billTo.set("city", "Mill Valley");
+ billTo.set("state", "PA");
+ billTo.setString("zip", "95819");
+ purchaseOrder.set("comment", "Hurry, my lawn is going wild!");
+
+ DataObject items = purchaseOrder.createDataObject("items");
+
+ DataObject item1 = items.createDataObject("item");
+ item1.set("partNum", "872-AA");
+ item1.set("productName", "Lawnmower");
+ item1.setInt("quantity", 1);
+ item1.setString("price", "148.95");
+
+ item1.set("comment", "Confirm this is electric");
+
+ DataObject item2 = items.createDataObject("item");
+ item2.set("partNum", "926-AA");
+ item2.set("productName", "Baby Monitor");
+ item2.setInt("quantity", 1);
+ item2.setString("price", "39.98");
+ item2.setString("shipDate", "1999-05-21");
+
+ OutputStream stream = new FileOutputStream(SdoSampleConstants.PO_XML_GENERATED);
+ XMLHelper.INSTANCE.save(purchaseOrder, SdoSampleConstants.PO_NAMESPACE, "purchaseOrder", stream);
+ System.out.println("Created file " + SdoSampleConstants.PO_XML_GENERATED);
+ System.out.println("Populated with :");
+ System.out.println(XMLHelper.INSTANCE.save(purchaseOrder, SdoSampleConstants.PO_NAMESPACE, "purchaseOrder"));
+ } catch (Exception e) {
+ System.out.println("Sorry an error occured " + e.toString());
+ e.printStackTrace();
+ }
+ System.out.println("GoodBye");
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specExampleSection/SerializingDesearializingADataObject.java b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specExampleSection/SerializingDesearializingADataObject.java
new file mode 100644
index 0000000000..b3851c4649
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specExampleSection/SerializingDesearializingADataObject.java
@@ -0,0 +1,181 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.samples.sdo.specExampleSection;
+
+import commonj.sdo.helper.XMLHelper;
+import commonj.sdo.helper.XSDHelper;
+import commonj.sdo.helper.EqualityHelper;
+import commonj.sdo.DataObject;
+
+import java.io.BufferedReader;
+import java.io.FileInputStream;
+import java.io.InputStreamReader;
+import java.io.ObjectInputStream;
+import java.io.FileOutputStream;
+import java.io.ObjectOutputStream;
+import java.io.IOException;
+
+
+import org.apache.tuscany.samples.sdo.SdoSampleConstants;
+
+/**
+ * Demonstrates serializing and deserializing a DataObject to disk.
+ *
+ * The following sample is from the <a href="http://incubator.apache.org/tuscany"
+ * target="_blank"> Apache Tuscany</a> 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 <a
+ * href="http://www.osoa.org/download/attachments/791/SDO_Specification_Java_V2.01.pdf?version=1"
+ * target="_bank">SDO Specification</a>. In general this sample attempts to use the
+ * code and comments contained within the specification, exceptions to this are noted
+ * in comments.<br>
+ * <br>
+ * The following sample is based upon the 'Serializing/Deserializing a DataGraph or DataObject' example from the Examples section of the SDO
+ * specification. <br>
+ * <br>
+ * The DataObject and DataGraph interfaces extend java.io.Serializable, so any DataObject
+ * or DataGraph be serialized. The following code serializes the company dataObject to a file
+ * of the user's choosing. The file is not deleted after execution.<br>
+ * <br><br>
+ * <b>Usage:</b> <br>
+ * 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.
+ * <br><br>
+ * If executing as a standalone application please do the following:
+ * <br>
+ * <UL>
+ * <LI>Include the following jar files on your classpath :
+ * <UL>
+ * <LI>SDO API and Tuscany Implementation
+ * <UL>
+ * <LI>sdo-api-{version}.jar - SDO API
+ * <LI>tuscany-sdo-impl-{version}.jar - Tuscany SDO implementation
+ * </UL>
+ * </LI>
+ * <LI>EMF dependencies.
+ * <UL>
+ * <LI>emf-common-{version}.jar - some common framework utility and base classes
+ * <LI>emf-ecore-{version}.jar - the EMF core runtime implementation classes (the Ecore metamodel)
+ * <LI>emf-ecore-change-{version}.jar - the EMF change recorder and framework
+ * <LI>emf-ecore-xmi-{version}.jar - EMF's default XML (and XMI) serializer and loader
+ * <LI>xsd-{version}.jar - the XML Schema model
+ * </UL>
+ * </LI>
+ * </UL>
+ *
+ * These jar files can be obtained by downloading and unpacking a <a href="http://cwiki.apache.org/TUSCANY/sdo-downloads.html" target="_blank">Tuscany binary distribution </a> </LI>
+ * <LI>Execute: <br>
+ * java org.apache.tuscany.samples.sdo.specExampleSection.SerializingDesearializingADataObject</LI>
+ * </UL>
+ *
+ * @author Robbie Minshall
+ */
+
+public class SerializingDesearializingADataObject {
+
+ /**
+ * Default fileName to serialize DataObject to
+ */
+ public static final String DEFAULT_FILE_NAME = "temporarySerializedDataObject.xml";
+
+ public static void serializeDO(DataObject DataObject, String fileName) throws IOException {
+ // serialize data object
+ FileOutputStream fos = new FileOutputStream(fileName);
+ ObjectOutputStream out = new ObjectOutputStream(fos);
+ out.writeObject(DataObject);
+ out.close();
+ }
+
+ /**
+ * Execute this method in order to run the sample.
+ *
+ * @param args
+ */
+ public static void main(String[] args) {
+ System.out.println("***************************************");
+ System.out.println("SDO Sample AccessingTheContentsOfASequence");
+ System.out.println("***************************************");
+ System.out.println("Demonstrates serializing and deserializing a DataObject to disk.");
+ System.out.println("***************************************");
+
+
+ try {
+ // define Types using XSDHelper and predefined xsd file
+ System.out.println("Defining Types using XSD");
+ XSDHelper.INSTANCE.define(ClassLoader.getSystemResourceAsStream(SdoSampleConstants.COMPANY_XSD), null);
+ System.out.println("Type definition completed");
+
+ // create company DataObject using XMLHelper which is an example of a XML DAS
+ System.out.println("Creating company DataObject");
+ DataObject company = XMLHelper.INSTANCE.load(ClassLoader.getSystemResourceAsStream(SdoSampleConstants.COMPANY_DATAOBJECT_XML))
+ .getRootObject();
+
+ // prompt user for a fileName
+ BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
+ System.out.print("Please enter file name, enter for default :");
+ String fileName = in.readLine();
+ if ( (fileName == null) || (fileName.equals(""))){
+ fileName = DEFAULT_FILE_NAME;
+ }
+
+ // serialize dataObject out
+ System.out.println("Serializing DataObject to " + fileName);
+ FileOutputStream fos = new FileOutputStream(fileName);
+ ObjectOutputStream out = new ObjectOutputStream(fos);
+ out.writeObject(company);
+ out.close();
+
+ // read in DataObject
+ System.out.println("Deserialize DataObject from file");
+ FileInputStream fis = new FileInputStream(fileName);
+ ObjectInputStream input = new ObjectInputStream(fis);
+ DataObject newDataObject = (DataObject) input.readObject();
+ input.close();
+
+ /**
+ * Compare DataObjects
+ */
+
+ System.out.println("Comparing original and deserialized DataObject");
+ //determine if two graphs of DataObjects are equal
+ System.out.println("DataObjects are equal: " + EqualityHelper.INSTANCE.equal(company, newDataObject));
+
+ //determine if two DataObjects have the same values for their datatype properties
+ System.out.println("DataObjects have same values for their datatype properties : " + EqualityHelper.INSTANCE.equalShallow(company, newDataObject));
+
+ //print out xml representation
+ System.out.println();
+ System.out.println("Original company DataObject:");
+ System.out.println(XMLHelper.INSTANCE.save(company, SdoSampleConstants.COMPANY_NAMESPACE, "company"));
+
+ System.out.println();
+ System.out.println("Deserialized company DataObject:");
+ System.out.println(XMLHelper.INSTANCE.save(newDataObject, SdoSampleConstants.COMPANY_NAMESPACE, "company"));
+
+ } catch (Exception e) {
+ System.out.println("Sorry there was an error encountered " + e.toString());
+ e.printStackTrace();
+ }
+
+ System.out.println("GoodBye");
+
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specExampleSection/UsingTypeAndPropertyWithDataObjects.java b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specExampleSection/UsingTypeAndPropertyWithDataObjects.java
new file mode 100644
index 0000000000..fd4e142e92
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specExampleSection/UsingTypeAndPropertyWithDataObjects.java
@@ -0,0 +1,188 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.samples.sdo.specExampleSection;
+
+import commonj.sdo.helper.XMLHelper;
+import commonj.sdo.helper.XSDHelper;
+import commonj.sdo.DataObject;
+import commonj.sdo.Type;
+import commonj.sdo.Property;
+
+import java.util.List;
+
+import org.apache.tuscany.samples.sdo.SdoSampleConstants;
+
+/**
+ * Demonstrates the use of Type and Property to display and the META-DATA for and access Properties of a DataObject.
+ * <br>
+ * The following sample is from the <a href="http://incubator.apache.org/tuscany"
+ * target="_blank"> Apache Tuscany</a> 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 <a
+ * href="http://www.osoa.org/download/attachments/791/SDO_Specification_Java_V2.01.pdf?version=1"
+ * target="_bank">SDO Specification</a>. In general this sample attempts to use the
+ * code and comments contained within the specification, exceptions to this are noted
+ * in comments.<br>
+ * <br>
+ * The following sample is based upon the 'Using Type and Property with DataObjects' example from the Examples section of the SDO specification. <br>
+ * <br>
+ * 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.<br>
+ * <br><br>
+ * <b>Usage:</b> <br>
+ * 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.
+ * <br><br>
+ * If executing as a standalone application please do the following:
+ * <br>
+ * <UL>
+ * <LI>Include the following jar files on your classpath :
+ * <UL>
+ * <LI>SDO API and Tuscany Implementation
+ * <UL>
+ * <LI>sdo-api-{version}.jar - SDO API
+ * <LI>tuscany-sdo-impl-{version}.jar - Tuscany SDO implementation
+ * </UL>
+ * </LI>
+ * <LI>EMF dependencies.
+ * <UL>
+ * <LI>emf-common-{version}.jar - some common framework utility and base classes
+ * <LI>emf-ecore-{version}.jar - the EMF core runtime implementation classes (the Ecore metamodel)
+ * <LI>emf-ecore-change-{version}.jar - the EMF change recorder and framework
+ * <LI>emf-ecore-xmi-{version}.jar - EMF's default XML (and XMI) serializer and loader
+ * <LI>xsd-{version}.jar - the XML Schema model
+ * </UL>
+ * </LI>
+ * </UL>
+ *
+ * These jar files can be obtained by downloading and unpacking a <a href="http://cwiki.apache.org/TUSCANY/sdo-downloads.html" target="_blank">Tuscany binary distribution</a> </LI>
+ * <LI>Execute: <br>
+ * java org.apache.tuscany.samples.sdo.specExampleSection.UsingTypeAndPropertyWithDataObjects</LI>
+ * </UL>
+ *
+ * @author Robbie Minshall
+ * @see org.apache.tuscany.samples.sdo.specCodeSnippets.PrintPropertiesOfDataObject
+ */
+
+public class UsingTypeAndPropertyWithDataObjects {
+
+ /**
+ * Execute this method in order to run the sample.
+ *
+ * @param args
+ */
+ public static void main(String[] args) {
+ System.out.println("***************************************");
+ System.out.println("SDO Sample UsingTypeAndPropertyWithDataObjects");
+ System.out.println("***************************************");
+ System.out.println("Demonstrates the use of Type and Property to display and the META-DATA for and access Properties of a DataObject.");
+ System.out.println("***************************************");
+
+ try {
+ // define Types using XSDHelper and predefined xsd file
+ System.out.println("Defining company Types using XSD");
+ XSDHelper.INSTANCE.define(ClassLoader.getSystemResourceAsStream(SdoSampleConstants.COMPANY_XSD), null);
+ System.out.println("Type definition completed");
+
+ // create company DataObject using XMLHelper which is an example of a XML DAS
+ System.out.println("Creating company DataObject");
+ DataObject company = XMLHelper.INSTANCE.load(ClassLoader.getSystemResourceAsStream(SdoSampleConstants.COMPANY_DATAOBJECT_XML))
+ .getRootObject();
+
+ printDataObject(company, 0);
+
+ System.out.println("Defining purchase order types");
+ XSDHelper.INSTANCE.define(ClassLoader.getSystemResourceAsStream(SdoSampleConstants.PO_XSD_RESOURCE), null);
+ System.out.println("Type definition completed");
+
+ // create company DataObject using XMLHelper which is an example of a XML DAS
+ System.out.println("Creating purchase order DataObject");
+ DataObject po = XMLHelper.INSTANCE.load(ClassLoader.getSystemResourceAsStream(SdoSampleConstants.PO_XML_RESOURCE))
+ .getRootObject();
+
+ printDataObject(po, 0);
+
+
+
+
+
+
+
+ } catch (Exception e) {
+ System.out.println("Sorry there was an error encountered " + e.toString());
+ e.printStackTrace();
+ }
+ System.out.println("GoodBye");
+ }
+
+ /**
+ * Prints out the contents of a DataObject, each property has it's meta-data displayed, accessed dynamically using Type and Property.
+ * @param dataObject. DataObject to be printed.
+ * @param indent. For formatting
+ */
+ public static void printDataObject(DataObject dataObject, int indent) {
+ // For each Property
+ List properties = dataObject.getInstanceProperties();
+ for (int p = 0, size = properties.size(); p < size; p++) {
+ if (dataObject.isSet(p)) {
+ Property property = (Property) properties.get(p);
+ if (property.isMany()) {
+ // For many-valued properties, process a list of values
+ List values = dataObject.getList(p);
+ for (int v = 0, count = values.size(); v < count; v++) {
+ printValue(values.get(v), property, indent);
+ }
+ } else {
+ // For single-valued properties, print out the value
+ printValue(dataObject.get(p), property, indent);
+ }
+ }
+ }
+ }
+
+ /**
+ * Prints the value of a property
+ * @param value. Value of Property to be printed
+ * @param property. Property to be printed
+ * @param indent. For formatting
+ */
+ public static void printValue(Object value, Property property, int indent) {
+ // Get the name of the property
+ String propertyName = property.getName();
+ // Construct a string for the proper indentation
+ String margin = "";
+ for (int i = 0; i < indent; i++)
+ margin += "\t";
+ if (value != null && property.isContainment()) {
+ // For containment properties, display the value
+ // with printDataObject
+ Type type = property.getType();
+ String typeName = type.getName();
+ System.out.println(margin + propertyName + " (" + typeName + "):");
+ printDataObject((DataObject) value, indent + 1);
+ } else {
+ // For non-containment properties, just print the value
+ System.out.println(margin + propertyName + ": " + value);
+ }
+ }
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specExampleSection/package.html b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specExampleSection/package.html
new file mode 100644
index 0000000000..8132b4381c
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specExampleSection/package.html
@@ -0,0 +1,40 @@
+<html>
+<!--
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * -->
+<head>
+ <title>package information</title>
+</head>
+<body>
+
+Provides samples from the Examples section of the SDO Specification. In general these samples attempt to use the
+code and comments contained within the specification; exceptions to this are noted in comments.
+ The user is encouraged to modify and execute these code examples.
+
+
+
+<h2>Related Documentation</h2>
+For overviews, tutorials, examples, guides, and tool documentation, please see the
+<a href="http://cwiki.apache.org/TUSCANY/sdo-overview.html"> SDO Java Overview
+</a>
+section of the Tuscany website.
+
+
+</body>
+</html>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/resources/company.xsd b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/resources/company.xsd
new file mode 100644
index 0000000000..c699f89e31
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/resources/company.xsd
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ -->
+
+ <xsd:schema xmlns:company="company.xsd"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="company.xsd">
+ <xsd:element name="company" type="company:CompanyType"/>
+ <xsd:complexType name="CompanyType">
+ <xsd:sequence>
+ <xsd:element name="departments" type="company:DepartmentType" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string"/>
+ <xsd:attribute name="employeeOfTheMonth" type="xsd:string"/>
+ </xsd:complexType>
+ <xsd:complexType name="DepartmentType">
+ <xsd:sequence>
+ <xsd:element name="employees" type="company:EmployeeType" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string"/>
+ <xsd:attribute name="location" type="xsd:string"/>
+ <xsd:attribute name="number" type="xsd:int"/>
+ </xsd:complexType>
+ <xsd:complexType name="EmployeeType">
+ <xsd:attribute name="name" type="xsd:string"/>
+ <xsd:attribute name="SN" type="xsd:ID"/>
+ <xsd:attribute name="manager" type="xsd:boolean"/>
+ </xsd:complexType>
+ </xsd:schema>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/resources/companyCompleteDataGraph.xml b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/resources/companyCompleteDataGraph.xml
new file mode 100644
index 0000000000..f636f2131e
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/resources/companyCompleteDataGraph.xml
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ -->
+<sdo:datagraph xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+xmlns:company="company.xsd"
+xmlns:sdo="commonj.sdo">
+
+ <xsd>
+ <xsd:schema targetNamespace="company.xsd">
+ <xsd:element name="company" type="company:CompanyType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:complexType name="CompanyType">
+ <xsd:sequence>
+ <xsd:element name="departments" type="company:DepartmentType" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string"/>
+ <xsd:attribute name="employeeOfTheMonth" type="xsd:string"/>
+ </xsd:complexType>
+ <xsd:complexType name="DepartmentType">
+ <xsd:sequence>
+ <xsd:element name="employees" type="company:EmployeeType" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string"/>
+ <xsd:attribute name="location" type="xsd:string"/>
+ <xsd:attribute name="number" type="xsd:int"/>
+ </xsd:complexType>
+ <xsd:complexType name="EmployeeType">
+ <xsd:attribute name="name" type="xsd:string"/>
+ <xsd:attribute name="SN" type="xsd:ID"/>
+ <xsd:attribute name="manager" type="xsd:boolean"/>
+ </xsd:complexType>
+ </xsd:schema>
+ </xsd>
+
+ <changeSummary create="E0004" delete="E0002">
+ <company sdo:ref="#/company" name="ACME"
+ employeeOfTheMonth="E0002"/>
+ <departments sdo:ref="#/company/departments[1]">
+ <employees sdo:ref="E0001"/>
+ <employees name="Mary Smith" SN="E0002" manager="true"/>
+ <employees sdo:ref="E0003"/>
+ </departments>
+ </changeSummary>
+
+ <company:company name="MegaCorp" employeeOfTheMonth="E0004">
+ <departments name="Advanced Technologies" location="NY" number="123">
+ <employees name="John Jones" SN="E0001"/>
+ <employees name="Jane Doe" SN="E0003"/>
+ <employees name="Al Smith" SN="E0004" manager="true"/>
+ </departments>
+ </company:company>
+
+</sdo:datagraph>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/resources/companyDataGraph.xml b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/resources/companyDataGraph.xml
new file mode 100644
index 0000000000..7114b98fdf
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/resources/companyDataGraph.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ -->
+
+<sdo:datagraph xmlns:company="company.xsd"
+ xmlns:sdo="commonj.sdo">
+ <company:company name="ACME" employeeOfTheMonth="E0002">
+ <departments name="Advanced Technologies" location="NY" number="123">
+ <employees name="John Jones" SN="E0001"/>
+ <employees name="Mary Smith" SN="E0002" manager="true"/>
+ <employees name="Jane Doe" SN="E0003"/>
+ </departments>
+ </company:company>
+</sdo:datagraph>
+
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/resources/companyDataGraphGenerated.xml b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/resources/companyDataGraphGenerated.xml
new file mode 100644
index 0000000000..a99e71bbaa
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/resources/companyDataGraphGenerated.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ -->
+
+<sdo:datagraph xmlns:company="company.xsd" xmlns:sdo="commonj.sdo">
+ <company:company employeeOfTheMonth="E0002"
+ name="ACME">
+ <departments location="NY" name="Advanced Technologies" number="123">
+ <employees name="John Jones" SN="E0001"/>
+ <employees name="Jane Doe" SN="E0003"/>
+ <employees manager="true" name="Al Smith" SN="E0004"/>
+ </departments>
+ </company:company>
+</sdo:datagraph>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/resources/companyGenerated.xml b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/resources/companyGenerated.xml
new file mode 100644
index 0000000000..0108e67a4b
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/resources/companyGenerated.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ -->
+<company:company xmlns:company="company.xsd" employeeOfTheMonth="E0001"
+ name="ACME">
+ <departments location="NY" name="Advanced Technologies" number="123">
+ <employees name="John Jones" SN="E0001"/>
+ <employees name="Jane Doe" SN="E0003"/>
+ <employees manager="true" name="A Varone" SN="E0004"/>
+ </departments>
+</company:company> \ No newline at end of file
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/resources/doc-files/cmdPrompt.GIF b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/resources/doc-files/cmdPrompt.GIF
new file mode 100644
index 0000000000..ad2fbbf46f
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/resources/doc-files/cmdPrompt.GIF
Binary files differ
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/resources/letter.xml b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/resources/letter.xml
new file mode 100644
index 0000000000..85e0bd42b8
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/resources/letter.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ -->
+
+<letter:letters xmlns:letter="letter.xsd"><date>August 1, 2003</date>Mutual of Omaha Wild Kingdom, USA Dear<firstName>Casy</firstName><lastName>Crocodile</lastName>Please buy more shark repellent. Your premium is past due.</letter:letters> \ No newline at end of file
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/resources/letter.xsd b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/resources/letter.xsd
new file mode 100644
index 0000000000..e6e077ff75
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/resources/letter.xsd
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ -->
+
+<xsd:schema xmlns:letter="letter.xsd" targetNamespace="letter.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+ <xsd:element name="letters" type="letter:FormLetter"/>
+ <xsd:complexType name="FormLetter" mixed="true">
+ <xsd:sequence>
+ <xsd:element name="date" minOccurs="0" type="xsd:string"/>
+ <xsd:element name="firstName" minOccurs="0" type="xsd:string"/>
+ <xsd:element name="lastName" minOccurs="0" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+</xsd:schema>
+
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/resources/po.xml b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/resources/po.xml
new file mode 100644
index 0000000000..e44cb07720
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/resources/po.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ -->
+
+<PO:purchaseOrder xmlns:PO="http://www.example.com/PO" orderDate="1999-10-20">
+ <shipTo country="US">
+ <name>Robbie Minshall</name>
+ <street>123 Maple Street</street>
+ <city>Mill Valley</city>
+ <state>CA</state>
+ <zip>90952</zip>
+ </shipTo>
+ <billTo country="US">
+ <name>Robert Smith</name>
+ <street>8 Oak Avenue</street>
+ <city>Mill Valley</city>
+ <state>PA</state>
+ <zip>95819</zip>
+ </billTo>
+ <PO:comment>Hurry, my lawn is going wild!</PO:comment>
+ <items>
+ <item partNum="872-AA">
+ <productName>Lawnmower</productName>
+ <price>148.95</price>
+ <quantity>1</quantity>
+ <PO:comment>Confirm this is electric</PO:comment>
+ </item>
+ <item partNum="926-AA">
+ <productName>Baby Monitor</productName>
+ <price>39.98</price>
+ <quantity>1</quantity>
+ <shipDate>1999-05-21</shipDate>
+ </item>
+ <item partNum="876">
+ <productName>GrassSeed</productName>
+ <price>50</price>
+ <quantity>100</quantity>
+ <PO:comment>For Shade</PO:comment>
+ </item>
+ </items>
+</PO:purchaseOrder> \ No newline at end of file
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/resources/po.xsd b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/resources/po.xsd
new file mode 100644
index 0000000000..8929775d49
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/sample/src/main/resources/po.xsd
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ -->
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns="http://www.example.com/PO" targetNamespace="http://www.example.com/PO">
+
+ <xsd:element name="purchaseOrder" type="PurchaseOrderType"/>
+ <xsd:element name="comment" type="xsd:string"/>
+
+ <xsd:complexType name="PurchaseOrderType">
+ <xsd:sequence>
+ <xsd:element name="shipTo" type="USAddress"/>
+ <xsd:element name="billTo" type="USAddress"/>
+ <xsd:element ref="comment" minOccurs="0"/>
+ <xsd:element name="items" type="Items"/>
+
+ </xsd:sequence>
+ <xsd:attribute name="orderDate" type="xsd:date"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="USAddress">
+ <xsd:sequence>
+ <xsd:element name="name" type="xsd:string"/>
+
+ <xsd:element name="street" type="xsd:string"/>
+ <xsd:element name="city" type="xsd:string"/>
+ <xsd:element name="state" type="xsd:string"/>
+ <xsd:element name="zip" type="xsd:decimal"/>
+ </xsd:sequence>
+ <xsd:attribute name="country" type="xsd:NMTOKEN" fixed="US"/>
+
+ </xsd:complexType>
+
+ <xsd:complexType name="Items">
+ <xsd:sequence>
+ <xsd:element name="item" minOccurs="0" maxOccurs="unbounded">
+ <xsd:complexType>
+ <xsd:sequence>
+
+ <xsd:element name="productName" type="xsd:string"/>
+ <xsd:element name="price" type="xsd:decimal"/>
+ <xsd:element name="quantity">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:positiveInteger">
+ <xsd:maxExclusive value="100"/>
+ </xsd:restriction>
+
+ </xsd:simpleType>
+ </xsd:element>
+ <xsd:element ref="comment" minOccurs="0"/>
+ <xsd:element name="shipDate" type="xsd:date" minOccurs="0"/>
+ </xsd:sequence>
+
+ <xsd:attribute name="partNum" type="SKU" use="required"/>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:simpleType name="SKU">
+
+ <xsd:restriction base="xsd:string">
+ <xsd:pattern value="\d{3}-[A-Z]{2}"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:schema> \ No newline at end of file
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/sdo.xml b/sdo-java/tags/1.0-incubator-M3/sdo/sdo.xml
new file mode 100644
index 0000000000..50151af745
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/sdo.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Copyright (c) 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ -->
+<assembly>
+ <id>bin</id>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <formats>
+ <format>zip</format>
+ <format>tar.gz</format>
+ </formats>
+
+ <fileSets>
+ <!-- include legal and other files -->
+ <fileSet>
+ <outputDirectory>tuscany-sdo-${sdo.version}</outputDirectory>
+ <includes>
+ <include>LICENSE.txt</include>
+ <include>NOTICE.txt</include>
+ <include>STATUS.txt</include>
+ </includes>
+ </fileSet>
+ <fileSet>
+ <directory>distribution</directory>
+ <outputDirectory>tuscany-sdo-${sdo.version}</outputDirectory>
+ </fileSet>
+ <fileSet>
+ <directory>target/javadoc/api</directory>
+ <outputDirectory>tuscany-sdo-${sdo.version}/javadoc/api</outputDirectory>
+ </fileSet>
+ <fileSet>
+ <directory>target/site/apidocs</directory>
+ <outputDirectory>tuscany-sdo-${sdo.version}/javadoc/impl</outputDirectory>
+ </fileSet>
+ </fileSets>
+
+ <moduleSets>
+ <moduleSet>
+ <includes>
+ <include>org.apache.tuscany.sdo:tuscany-sdo-impl</include>
+ <include>org.apache.tuscany.sdo:tuscany-sdo-tools</include>
+ </includes>
+ <binaries>
+ <outputDirectory>tuscany-sdo-${sdo.version}/lib</outputDirectory>
+ <unpack>false</unpack>
+ <includeDependencies>true</includeDependencies>
+ </binaries>
+ </moduleSet>
+ </moduleSets>
+</assembly>
+
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/pom.xml b/sdo-java/tags/1.0-incubator-M3/sdo/tools/pom.xml
new file mode 100644
index 0000000000..ce85c92c36
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/pom.xml
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <parent>
+ <groupId>org.apache.tuscany.sdo</groupId>
+ <artifactId>tuscany-sdo</artifactId>
+ <version>1.0-incubator-M3</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>tuscany-sdo-tools</artifactId>
+ <name>Tuscany SDO Tools</name>
+ <description>SDO Tools.</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sdo</groupId>
+ <artifactId>tuscany-sdo-impl</artifactId>
+ <version>${pom.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.emf</groupId>
+ <artifactId>codegen</artifactId>
+ <version>${emfVersion}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.emf</groupId>
+ <artifactId>codegen-ecore</artifactId>
+ <version>${emfVersion}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </dependency>
+
+ <!-- this is needed because test program calls XMLHelper.save() and SDOXMLResourceImpl (in the sdo/impl project) uses StAX ??? -->
+ <dependency>
+ <groupId>stax</groupId>
+ <artifactId>stax-api</artifactId>
+ <version>1.0.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <!-- <overview>${basedir}/src/main/java/org/apache/tuscany/sdo/overview.html</overview> -->
+ <version>2.0</version>
+ </configuration>
+ <!-- <executions>
+ <execution>
+ <id>package</id>
+ <phase>package</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions> -->
+ </plugin>
+
+ </plugins>
+ </build>
+
+
+</project>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/readme.htm b/sdo-java/tags/1.0-incubator-M3/sdo/tools/readme.htm
new file mode 100644
index 0000000000..e7aa8d6718
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/readme.htm
@@ -0,0 +1,44 @@
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+ <!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+
+<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
+<meta content="text/css" http-equiv="Content-Style-Type"><title>Tuscany SDO Tools</title>
+
+<style type="text/css" media="all">
+@import url("../../css/maven-base.css");
+@import url("../../css/maven-theme.css");
+@import url("../../css/site.css");
+</style>
+<link rel="stylesheet" href="./css/print.css" type="text/css" media="print"></head>
+
+<body>
+<h2>Tuscany SDO Tools</h2>
+<h3>Building SDO Tools</h3>
+
+To build the Tuscany SDO Java Generator tools, perform the following steps
+<ul>
+<li> Ensure that the environment variable JAVA_HOME is set to point to an installation of Java 5 (Java 1.5.0_6 works) </li>
+<li> Run the command "mvn" </li>
+</ul>
+<b>Note:</b> only the Interface2JavaGenerator class requires Java 5. You can build the XSD2JavaGenerator tool using a Java 1.4 JDK by removing the Interface2JavaGenerator.java file before running the "mvn" command.
+
+</body></html>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/Interface2JavaGenerator.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/Interface2JavaGenerator.java
new file mode 100644
index 0000000000..9cb5d64c38
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/Interface2JavaGenerator.java
@@ -0,0 +1,244 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.generate;
+
+import java.lang.reflect.Method;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.tuscany.sdo.util.DataObjectUtil;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EcoreFactory;
+import org.eclipse.emf.ecore.impl.EPackageRegistryImpl;
+
+import commonj.sdo.helper.TypeHelper;
+
+public class Interface2JavaGenerator extends JavaGenerator
+{
+ /**
+ * Generate static SDOs from Java interfaces
+ *
+ * Usage arguments: see JavaGenerator
+ *
+ * [ -targetDirectory <target-root-directory> ]
+ * [ -javaPackage <java-package-name> ]
+ * [ -namespace <xsd-namespace> ]
+ * [ other options ... ]
+ * interface-names
+ *
+ * Options:
+ *
+ * -namespace
+ * Set the namespaceURI of the generated SDO Types to the specified value.
+ *
+ * NOTE: see the base class JavaGenerator for other options.
+ *
+ * Example:
+ *
+ * generate somepackage.InterfaceA somepackage.InterfaceB
+ *
+ */
+ public static void main(String args[])
+ {
+ try
+ {
+ JavaGenerator generator = new Interface2JavaGenerator();
+ generator.processArguments(args);
+ generator.run(args);
+ }
+ catch (IllegalArgumentException e)
+ {
+ printUsage();
+ }
+ }
+
+ protected String namespace = null;
+
+ protected int handleArgument(String args[], int index)
+ {
+ if (args[index].equalsIgnoreCase("-namespace"))
+ {
+ namespace = args[++index];
+ }
+ else
+ {
+ return super.handleArgument(args, index);
+ }
+
+ return index + 1;
+ }
+
+ protected void run(String args[])
+ {
+ List javaInterfaces=new ArrayList();
+
+ for (int index = inputIndex; index < args.length; ++index)
+ {
+ javaInterfaces.add(args[index]);
+ }
+
+ ClassLoader classLoader=JavaGenerator.class.getClassLoader();
+ generateFromJavaInterfaces(classLoader, javaInterfaces, namespace, targetDirectory, javaPackage, prefix, genOptions);
+ }
+
+ public static void generateFromJavaInterfaces(ClassLoader classLoader, List javaInterfaces, String packageURI, String targetDirectory, String javaPackage, String prefix, int genOptions)
+ {
+ try
+ {
+ // Initialize the SDO runtime
+ DataObjectUtil.initRuntime();
+ EPackage.Registry packageRegistry = new EPackageRegistryImpl(EPackage.Registry.INSTANCE);
+
+ // Create an EPackage for the generated SDO
+ if (packageURI == null)
+ packageURI = "http://" + javaPackage;
+ EPackage implEPackage = EcoreFactory.eINSTANCE.createEPackage();
+ implEPackage.setNsURI(packageURI);
+ String shortName = shortName(packageURI);
+ implEPackage.setName(shortName);
+ implEPackage.setNsPrefix(shortName.toLowerCase());
+ packageRegistry.put(packageURI, implEPackage);
+
+ // Create EClasses for all the given Java interfaces
+ Map eClasses = new HashMap();
+ for (Iterator iter = javaInterfaces.iterator(); iter.hasNext();)
+ {
+ String interfaceName = (String)iter.next();
+ Class instanceClass = Class.forName(interfaceName, true, classLoader);
+
+ EClass implEClass = EcoreFactory.eINSTANCE.createEClass();
+ String className = shortName(instanceClass.getName());
+ implEClass.setName(className);
+ implEClass.setInstanceClass(instanceClass);
+
+ eClasses.put(instanceClass, implEClass);
+ implEPackage.getEClassifiers().add(implEClass);
+ }
+
+ // Populate the EClasses with EAttributes and EReferences for their properties
+ for (Iterator iter = implEPackage.getEClassifiers().iterator(); iter.hasNext();)
+ {
+ EClass implEClass = (EClass)iter.next();
+ Class instanceClass = implEClass.getInstanceClass();
+ Method[] methods = instanceClass.getMethods();
+ for (int m = 0; m < methods.length; m++)
+ {
+ Method method = methods[m];
+ String propertyName = null;
+ if (method.getName().startsWith("get"))
+ propertyName = method.getName().substring(3);
+ else if (method.getName().startsWith("is"))
+ propertyName = method.getName().substring(2);
+
+ if (propertyName != null)
+ {
+ if (propertyName.length() > 1)
+ propertyName = propertyName.substring(0, 1).toLowerCase() + propertyName.substring(1);
+
+ Class propertyClass = method.getReturnType();
+ EClass propertyEClass = (EClass)eClasses.get(propertyClass);
+
+ if (propertyEClass != null)
+ {
+ // The property is another SDO, create an EReference to represent the property
+ EReference reference = EcoreFactory.eINSTANCE.createEReference();
+ reference.setName(propertyName);
+ reference.setContainment(true);
+ reference.setEType(propertyEClass);
+ implEClass.getEStructuralFeatures().add(reference);
+
+ }
+ else
+ {
+ // The property is a List<T> and T is an SDO, created a 0..many EReference to represent the property
+ if (propertyClass == List.class)
+ {
+ Type genericType = method.getGenericReturnType();
+ if (genericType instanceof ParameterizedType)
+ {
+ ParameterizedType parameterizedType = (ParameterizedType)genericType;
+ Type[] targs = parameterizedType.getActualTypeArguments();
+ if (targs.length != 0 && eClasses.containsKey(targs[0]))
+ {
+ propertyEClass = (EClass)eClasses.get(targs[0]);
+ if (propertyEClass != null)
+ {
+ EReference reference = EcoreFactory.eINSTANCE.createEReference();
+ reference.setName(propertyName);
+ reference.setContainment(true);
+ reference.setEType(propertyEClass);
+ reference.setUpperBound(-1);
+ implEClass.getEStructuralFeatures().add(reference);
+ }
+ }
+ }
+ continue;
+ }
+
+ // The property is a regular Java type / not an SDO, create an EAttribute to represent it
+ EAttribute attribute = EcoreFactory.eINSTANCE.createEAttribute();
+ attribute.setName(propertyName);
+ EDataType dataType = (EDataType)TypeHelper.INSTANCE.getType(propertyClass);
+ attribute.setEType(dataType);
+ implEClass.getEStructuralFeatures().add(attribute);
+ }
+ }
+ }
+ }
+
+ generatePackages(packageRegistry.values(), packageURI, shortName, targetDirectory, javaPackage, prefix, genOptions);
+ }
+ catch (ClassNotFoundException e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ protected static void printUsage()
+ {
+ System.out.println("Usage arguments:");
+ System.out.println(" [ -targetDirectory <target-root-directory> ]");
+ System.out.println(" [ -javaPackage <java-package-name> ]");
+ System.out.println(" [ -prefix <prefix-string> ]");
+ System.out.println(" [ -namespace <xsd-namespace> ]");
+ System.out.println(" [ -noInterfaces ]");
+ System.out.println(" [ -noContainment ]");
+ System.out.println(" [ -noNotification ]");
+ System.out.println(" [ -noUnsettable ]");
+ /* Future Option: System.out.println(" [ -sparsePattern | -storePattern ]"); */
+ /* Future Option: System.out.println(" [ -arrayAccessors ]"); */
+ /* Future Option: System.out.println(" [ -generateLoader ]"); */
+ System.out.println(" interface-names");
+ System.out.println("");
+ System.out.println("For example:");
+ System.out.println("");
+ System.out.println(" generate somepackage.InterfaceA somepackage.InterfaceB");
+ }
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/JavaGenerator.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/JavaGenerator.java
new file mode 100644
index 0000000000..df0d5cea5c
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/JavaGenerator.java
@@ -0,0 +1,621 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.generate;
+
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.StringTokenizer;
+
+import org.apache.tuscany.sdo.generate.adapter.SDOGenModelGeneratorAdapterFactory;
+import org.apache.tuscany.sdo.helper.XSDHelperImpl;
+import org.apache.tuscany.sdo.impl.SDOPackageImpl;
+import org.apache.tuscany.sdo.model.ModelFactory;
+import org.apache.tuscany.sdo.util.DataObjectUtil;
+import org.eclipse.emf.codegen.ecore.generator.Generator;
+import org.eclipse.emf.codegen.ecore.generator.GeneratorAdapterFactory;
+import org.eclipse.emf.codegen.ecore.genmodel.GenClass;
+import org.eclipse.emf.codegen.ecore.genmodel.GenDelegationKind;
+import org.eclipse.emf.codegen.ecore.genmodel.GenModel;
+import org.eclipse.emf.codegen.ecore.genmodel.GenModelFactory;
+import org.eclipse.emf.codegen.ecore.genmodel.GenModelPackage;
+import org.eclipse.emf.codegen.ecore.genmodel.GenPackage;
+import org.eclipse.emf.codegen.ecore.genmodel.GenResourceKind;
+import org.eclipse.emf.codegen.ecore.genmodel.generator.GenBaseGeneratorAdapter;
+import org.eclipse.emf.codegen.ecore.genmodel.generator.GenModelGeneratorAdapterFactory;
+import org.eclipse.emf.codegen.util.CodeGenUtil;
+import org.eclipse.emf.common.util.BasicMonitor;
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.impl.EPackageRegistryImpl;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.util.BasicExtendedMetaData;
+import org.eclipse.emf.ecore.util.Diagnostician;
+import org.eclipse.emf.ecore.util.ExtendedMetaData;
+import org.eclipse.xsd.XSDSchema;
+
+import commonj.sdo.helper.XSDHelper;
+
+/**
+ * Abstract base class for static SDO code generators. See XSD2JavaGenerator and Interface2JavaGenerator for
+ * concrete generator commands.
+ *
+ * Supports the following command line options:
+ *
+ * [ -targetDirectory <target-root-directory> ]
+ * [ -javaPackage <java-package-name> ]
+ * [ -prefix <prefix-string> ]
+ * [ -noInterfaces ]
+ * [ -noContainment ]
+ * [ -noNotification ]
+ * [ -noUnsettable ]
+ *
+ * Not supported (future options):
+ *
+ * [ -arrayAccessors ]
+ * [ -generateLoader ]
+ * [ -interfaceDataObject ]
+ * [ -sparsePattern | -storePattern ]
+ *
+ * Basic options:
+ *
+ * -javaPackage
+ * Overrides the Java package for the generated classes. By default the package name is derived
+ * from the targetNamespace of the XML schema being generated. For example, if the targetNamespace is
+ * "http://www.example.com/simple", the default package will be "com.example.simple".
+ * -prefix
+ * Specifies the prefix string to use for naming the generated factory. For example "-prefix Foo" will
+ * result in a factory interface with the name "FooFactory".
+ * -targetDirectory
+ * Generates the Java source code in the specified directory. By default, the code is generated
+ * in the same directory as the input xsd or wsdl file.
+ * is not necessary.
+ *
+ * Extended options:
+ *
+ * -noContainment
+ * Turns off container management for containment properties. DataObject.getContainer() will always
+ * return null for data objects generated with this option, even if a containment reference is set.
+ * Setting a containment reference will also not automatically remove the target object from its
+ * previous container, if it had one, so it will need to be explicitly removed by the client. Use
+ * of this option is only recommended for scenarios where this kind of container movement/management
+ * -noInterfaces
+ * By default, each DataObject generates both a Java interface and a corresponding implementation
+ * class. If an SDO metamodel does not use multiple inheritance (which is always the case for
+ * XML Schema derived models), then this option can be used to eliminate the interface and to generate
+ * only an implementation class.
+ * -noNotification
+ * This option eliminates all change notification overhead in the generated classes. Changes to
+ * DataObjects generated using this option cannot be recorded, and consequently the classes cannot
+ * be used with an SDO ChangeSummary or DataGraph.
+ * -noUnsettable
+ * By default, some XML constructs result in SDO property implementations that maintain additional
+ * state information to record when the property has been set to the "default value", as opposed to
+ * being truly unset (see DataObject.isSet() and DataObject.unset()). The SDO specification allows an
+ * implementation to choose to provide this behavior or not. With this option, all generated properties
+ * will not record their unset state. The generated isSet() methods simply returns whether the current
+ * value is equal to the property's "default value".
+ *
+ * Following are planned but not supported yet:
+ *
+ * -arrayAccessors
+ * Generates Java array getters/setters for multiplicity-many properties. With this option,
+ * the set of "standard" JavaBean array accessor methods (e.g., Foo[] getFoo(), Foo getFoo(int),
+ * int getFooLength(), setFoo(Foo[]), and void setFoo(int, Foo)) are generated. The normal
+ * List-returning accessor is renamed with the suffix "List" (e.g., List getFooList()). The array
+ * returned by the generated method is not a copy, but instead a pointer to the underlying storage
+ * array, so directly modifying it can have undesirable consequences and should be avoided.
+ * -generateLoader
+ * Generate a fast XML parser/loader for instances of the model. The details of this option are
+ * subject to change, but currently it generates two additional classes in a "util" package:
+ * <prefix>ResourceImpl and <prefix>ResourceFactoryImpl. To use the generated loader at runtime,
+ * you need to pass an option to the XMLHelper.load() method like this:
+ * Map options = new HashMap();
+ * options.put("GENERATED_LOADER", <prefix>ResourceFactoryImpl.class);
+ * XMLDocument doc = XMLHelper.INSTANCE.load(new FileInputStream("somefile.xml"), null, options);
+ * Note: this option currently only works for simple schemas without substitution groups or wildcards.
+ * -interfaceDataObject
+ * This option is used to generate static interfaces that extend commonj.sdo.DataObject
+ * -sparsePattern
+ * For SDO metamodels that have classes with many properties of which only a few are typically set at
+ * runtime, this option can be used to produce a space-optimized implementation (at the expense of speed).
+ * -storePattern
+ * This option can be used to generate static classes that work with a Store-based DataObject
+ * implementation. It changes the generator pattern to generate accessors which delegate to the
+ * reflective methods (as opposed to the other way around) and changes the DataObject base class
+ * to org.apache.tuscany.sdo.impl.StoreDataObjectImpl. Note that this option generates classes that
+ * require a Store implementation to be provided before they can be run.
+ *
+ *
+ */
+public abstract class JavaGenerator
+{
+ public static int OPTION_NO_INTERFACES=0x1;
+ public static int OPTION_SPARSE_PATTERN=0x2;
+ public static int OPTION_STORE_PATTERN=0x4;
+ public static int OPTION_NO_CONTAINMENT=0x8;
+ public static int OPTION_NO_NOTIFICATION=0x10;
+ public static int OPTION_ARRAY_ACCESSORS=0x20;
+ public static int OPTION_GENERATE_LOADER=0x40;
+ public static int OPTION_NO_UNSETTABLE=0x80;
+ //FIXME Temporary, I need this option for now to get Switch classes generated for the SCDL models
+ public static int OPTION_GENERATE_SWITCH=0x100;
+ public static int OPTION_INTERFACE_DO=0x400;
+
+ static
+ {
+ System.setProperty("EMF_NO_CONSTRAINTS", "true"); // never generate a validator class
+ }
+
+ /**
+ * @deprecated replaced by XSD2JavaGenerator
+ */
+ public static void main(String args[])
+ {
+ try
+ {
+ JavaGenerator generator = new XSD2JavaGenerator();
+ generator.processArguments(args);
+ generator.run(args);
+ }
+ catch (IllegalArgumentException e)
+ {
+ printUsage();
+ }
+ }
+
+ protected void processArguments(String args[])
+ {
+ if (args.length == 0)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ int index = 0;
+ while (args[index].startsWith("-"))
+ {
+ int newIndex = handleArgument(args, index);
+ if (newIndex == index)
+ {
+ throw new IllegalArgumentException();
+ }
+ index = newIndex;
+ if (index == args.length)
+ {
+ throw new IllegalArgumentException();
+ }
+ }
+
+ inputIndex = index;
+ }
+
+ protected String targetDirectory = null;
+ protected String javaPackage = null;
+ protected String prefix = null;
+ protected int genOptions = 0;
+ protected String xsdFileName;
+ protected int inputIndex;
+
+ protected int handleArgument(String args[], int index)
+ {
+ if (args[index].equalsIgnoreCase("-targetDirectory"))
+ {
+ targetDirectory = args[++index];
+ }
+ else if (args[index].equalsIgnoreCase("-javaPackage"))
+ {
+ javaPackage = args[++index];
+ }
+ else if (args[index].equalsIgnoreCase("-prefix"))
+ {
+ prefix = args[++index];
+ }
+ else if (args[index].equalsIgnoreCase("-noInterfaces"))
+ {
+ genOptions |= OPTION_NO_INTERFACES;
+ }
+ else if (args[index].equalsIgnoreCase("-sparsePattern"))
+ {
+ genOptions |= OPTION_SPARSE_PATTERN;
+ }
+ else if (args[index].equalsIgnoreCase("-storePattern"))
+ {
+ genOptions |= OPTION_STORE_PATTERN;
+ }
+ else if (args[index].equalsIgnoreCase("-noContainment"))
+ {
+ genOptions |= OPTION_NO_CONTAINMENT;
+ }
+ else if (args[index].equalsIgnoreCase("-noNotification"))
+ {
+ genOptions |= OPTION_NO_NOTIFICATION;
+ }
+ else if (args[index].equalsIgnoreCase("-arrayAccessors"))
+ {
+ genOptions |= OPTION_ARRAY_ACCESSORS;
+ }
+ else if (args[index].equalsIgnoreCase("-generateLoader"))
+ {
+ genOptions |= OPTION_GENERATE_LOADER;
+ }
+ else if (args[index].equalsIgnoreCase("-noUnsettable"))
+ {
+ genOptions |= OPTION_NO_UNSETTABLE;
+ }
+ else if (args[index].equalsIgnoreCase("-noEMF"))
+ {
+ System.out.println("Warning: -noEMF is deprecated. It is the default now.");
+ //genOptions |= OPTION_NO_EMF;
+ }
+ else if (args[index].equalsIgnoreCase("-interfaceDataObject"))
+ {
+ genOptions |= OPTION_INTERFACE_DO;
+ }
+ //else if (...)
+ else
+ {
+ return index;
+ }
+
+ return index + 1;
+ }
+
+ protected abstract void run(String args[]);
+
+ /**
+ * @deprecated moved to XSD2JavaGenerator
+ */
+ public static void generateFromXMLSchema(String xsdFileName, String targetDirectory, String javaPackage, String prefix, int genOptions)
+ {
+ DataObjectUtil.initRuntime();
+ EPackage.Registry packageRegistry = new EPackageRegistryImpl(EPackage.Registry.INSTANCE);
+ ExtendedMetaData extendedMetaData = new BasicExtendedMetaData(packageRegistry);
+ XSDHelper xsdHelper = new XSDHelperImpl(extendedMetaData, null);
+
+ try
+ {
+ File inputFile = new File(xsdFileName).getAbsoluteFile();
+ InputStream inputStream = new FileInputStream(inputFile);
+ xsdHelper.define(inputStream, inputFile.toURI().toString());
+
+ if (targetDirectory == null)
+ {
+ targetDirectory = new File(xsdFileName).getCanonicalFile().getParent();
+ }
+ else
+ {
+ targetDirectory = new File(targetDirectory).getCanonicalPath();
+ }
+
+ if (!packageRegistry.values().isEmpty())
+ {
+ String packageURI = getSchemaNamespace(xsdFileName);
+ generatePackages(packageRegistry.values(), packageURI, null, targetDirectory, javaPackage, prefix, genOptions);
+ }
+
+ /*
+ for (Iterator iter = packageRegistry.values().iterator(); iter.hasNext();)
+ {
+ EPackage ePackage = (EPackage)iter.next();
+ String basePackage = extractBasePackageName(ePackage, javaPackage);
+ if (prefix == null)
+ {
+ prefix = CodeGenUtil.capName(ePackage.getName());
+ }
+ generateFromEPackage(ePackage, targetDirectory, basePackage, prefix, genOptions);
+ }
+ */
+ }
+ catch (IOException e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ public static void generatePackages(Collection packageList, String packageURI, String shortName, String targetDirectory, String javaPackage, String prefix, int genOptions)
+ {
+ ResourceSet resourceSet = DataObjectUtil.createResourceSet();
+ List usedGenPackages = new ArrayList();
+ GenModel genModel = null;
+ for (Iterator iter = packageList.iterator(); iter.hasNext();)
+ {
+ EPackage currentEPackage = (EPackage)iter.next();
+ boolean generateCurrent = currentEPackage.getNsURI().equals(packageURI);
+ String currentBasePackage = extractBasePackageName(currentEPackage, generateCurrent ? javaPackage : null);
+ String currentPrefix = generateCurrent && prefix != null ? prefix : CodeGenUtil.capName(shortName != null ? shortName : currentEPackage.getName());
+ GenPackage currentGenPackage = createGenPackage(currentEPackage, currentBasePackage, currentPrefix, genOptions, resourceSet);
+ if (generateCurrent)
+ {
+ genModel = currentGenPackage.getGenModel();
+ }
+ else
+ {
+ usedGenPackages.add(currentGenPackage);
+ }
+ }
+
+ if (genModel == null) return; // nothing to generate
+
+ usedGenPackages.add(createGenPackage(SDOPackageImpl.eINSTANCE, "org.apache.tuscany", "SDO", 0, resourceSet));
+ usedGenPackages.add(createGenPackage((EPackage)ModelFactory.INSTANCE, "org.apache.tuscany.sdo", "Model", 0, resourceSet));
+ genModel.getUsedGenPackages().addAll(usedGenPackages);
+
+ // Invoke the SDO JavaGenerator to generate the SDO classes
+ try
+ {
+ generateFromGenModel(genModel, new File(targetDirectory).getCanonicalPath(), genOptions);
+ }
+ catch (IOException e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * @deprecated
+ */
+ public static String getSchemaNamespace(String xsdFileName)
+ {
+ ResourceSet resourceSet = DataObjectUtil.createResourceSet();
+ File inputFile = new File(xsdFileName).getAbsoluteFile();
+ Resource model = resourceSet.getResource(URI.createURI(inputFile.toURI().toString()), true);
+ XSDSchema schema = (XSDSchema)model.getContents().get(0);
+ return schema.getTargetNamespace();
+ }
+
+ public static GenPackage createGenPackage(EPackage ePackage, String basePackage, String prefix, int genOptions, ResourceSet resourceSet)
+ {
+ GenModel genModel = ecore2GenModel(ePackage, basePackage, prefix, genOptions);
+
+ URI ecoreURI = URI.createURI("file:///" + ePackage.getName() + ".ecore");
+ URI genModelURI = ecoreURI.trimFileExtension().appendFileExtension("genmodel");
+
+ Resource ecoreResource = resourceSet.createResource(ecoreURI);
+ ecoreResource.getContents().add(ePackage);
+
+ Resource genModelResource = resourceSet.createResource(genModelURI);
+ genModelResource.getContents().add(genModel);
+
+ return (GenPackage)genModel.getGenPackages().get(0);
+ }
+
+ public static void generateFromEPackage(EPackage ePackage, String targetDirectory, String basePackage, String prefix, int genOptions)
+ {
+ GenModel genModel = ecore2GenModel(ePackage, basePackage, prefix, genOptions);
+
+ ResourceSet resourceSet = DataObjectUtil.createResourceSet();
+ URI ecoreURI = URI.createURI("file:///temp.ecore");
+ URI genModelURI = ecoreURI.trimFileExtension().appendFileExtension("genmodel");
+
+ Resource ecoreResource = resourceSet.createResource(ecoreURI);
+ ecoreResource.getContents().add(ePackage);
+
+ Resource genModelResource = resourceSet.createResource(genModelURI);
+ genModelResource.getContents().add(genModel);
+
+ generateFromGenModel(genModel, targetDirectory, genOptions);
+ }
+
+ public static void generateFromGenModel(GenModel genModel, String targetDirectory, int genOptions)
+ {
+ Resource resource = genModel.eResource();
+
+ if (targetDirectory != null)
+ {
+ resource.getResourceSet().getURIConverter().getURIMap().put(
+ URI.createURI("platform:/resource/TargetProject/"),
+ URI.createFileURI(targetDirectory + "/"));
+ genModel.setModelDirectory("/TargetProject");
+ }
+
+ //genModel.gen(new BasicMonitor.Printing(System.out));
+ GeneratorAdapterFactory.Descriptor.Registry.INSTANCE.addDescriptor
+ (GenModelPackage.eNS_URI, GenModelGeneratorAdapterFactory.DESCRIPTOR);
+
+ Generator generator = new Generator();
+
+ //if ((genOptions & OPTION_USE_EMF_PATTERNS) == 0)
+ {
+ generator.getAdapterFactoryDescriptorRegistry().addDescriptor
+ (GenModelPackage.eNS_URI, SDOGenModelGeneratorAdapterFactory.DESCRIPTOR);
+ }
+
+ generator.setInput(genModel);
+ generator.generate(genModel, GenBaseGeneratorAdapter.MODEL_PROJECT_TYPE, new BasicMonitor.Printing(System.out));
+
+
+ for (Iterator j = resource.getContents().iterator(); j.hasNext();)
+ {
+ EObject eObject = (EObject)j.next();
+ Diagnostic diagnostic = Diagnostician.INSTANCE.validate(eObject);
+ if (diagnostic.getSeverity() != Diagnostic.OK)
+ {
+ printDiagnostic(diagnostic, "");
+ }
+ }
+ }
+
+ public static GenModel ecore2GenModel(EPackage ePackage, String basePackage, String prefix, int genOptions)
+ {
+ GenModel genModel = GenModelFactory.eINSTANCE.createGenModel();
+ genModel.initialize(Collections.singleton(ePackage));
+
+ genModel.setRootExtendsInterface("");
+ genModel.setRootImplementsInterface("commonj.sdo.DataObject");
+ genModel.setRootExtendsClass("org.apache.tuscany.sdo.impl.DataObjectImpl");
+ genModel.setFeatureMapWrapperInterface("commonj.sdo.Sequence");
+ genModel.setFeatureMapWrapperInternalInterface("org.apache.tuscany.sdo.util.BasicSequence");
+ genModel.setFeatureMapWrapperClass("org.apache.tuscany.sdo.util.BasicSequence");
+ genModel.setSuppressEMFTypes(true);
+ genModel.setSuppressEMFMetaData(true);
+ genModel.setSuppressEMFModelTags(true);
+ genModel.setCanGenerate(true);
+ //FIXME workaround java.lang.NoClassDefFoundError: org/eclipse/jdt/core/jdom/IDOMNode with 02162006 build
+ genModel.setFacadeHelperClass("Hack");
+ genModel.setForceOverwrite(true);
+
+ if ((genOptions & OPTION_NO_INTERFACES) != 0)
+ {
+ genModel.setSuppressInterfaces(true);
+ }
+
+ if ((genOptions & OPTION_SPARSE_PATTERN) != 0)
+ {
+ genModel.setFeatureDelegation(GenDelegationKind.VIRTUAL_LITERAL);
+ }
+ else if ((genOptions & OPTION_STORE_PATTERN) != 0)
+ {
+ genModel.setFeatureDelegation(GenDelegationKind.REFLECTIVE_LITERAL);
+ genModel.setRootExtendsClass("org.apache.tuscany.sdo.impl.StoreDataObjectImpl");
+ }
+
+ if ((genOptions & OPTION_NO_CONTAINMENT) != 0)
+ {
+ genModel.setSuppressContainment(true);
+ }
+
+ if ((genOptions & OPTION_NO_NOTIFICATION) != 0)
+ {
+ genModel.setSuppressNotification(true);
+ }
+
+ if ((genOptions & OPTION_ARRAY_ACCESSORS) != 0)
+ {
+ genModel.setArrayAccessors(true);
+ }
+
+ if ((genOptions & OPTION_NO_UNSETTABLE) != 0)
+ {
+ genModel.setSuppressUnsettable(true);
+ }
+
+ //if ((genOptions & OPTION_USE_EMF_PATTERNS) == 0)
+ {
+ genModel.setRootExtendsClass("org.apache.tuscany.sdo.impl.DataObjectBase");
+ }
+
+ if ((genOptions & OPTION_INTERFACE_DO) != 0)
+ {
+ genModel.setRootExtendsInterface("commonj.sdo.DataObject");
+ }
+ else
+ {
+ genModel.setRootExtendsInterface("java.io.Serializable");
+ }
+
+ GenPackage genPackage = (GenPackage)genModel.getGenPackages().get(0);
+
+ if (basePackage != null)
+ {
+ genPackage.setBasePackage(basePackage);
+ }
+ if (prefix != null)
+ {
+ genPackage.setPrefix(prefix);
+ }
+
+ //FIXME Temporary, I need this option for now to get Switch classes generated for the SCDL models
+ if ((genOptions & OPTION_GENERATE_SWITCH) == 0)
+ {
+ genPackage.setAdapterFactory(false);
+ }
+
+ if ((genOptions & OPTION_GENERATE_LOADER) != 0)
+ {
+ //FIXME workaround compile error with 02162006 build, generated code references non-existent EcoreResourceImpl class
+ genPackage.setResource(GenResourceKind.XML_LITERAL);
+ //genPackage.setDataTypeConverters(true);
+ }
+ else
+ {
+ genPackage.setResource(GenResourceKind.NONE_LITERAL);
+ for (Iterator iter = genPackage.getGenClasses().iterator(); iter.hasNext();)
+ {
+ GenClass genClass = (GenClass)iter.next();
+ if ("DocumentRoot".equals(genClass.getName()))
+ {
+ genClass.setDynamic(true); // Don't generate DocumentRoot class
+ break;
+ }
+ }
+ }
+
+ return genModel;
+ }
+
+ public static String extractBasePackageName(EPackage ePackage, String javaPackage)
+ {
+ String qualifiedName = javaPackage != null ? javaPackage : ePackage.getName();
+ String name = /*CodeGenUtil.*/shortName(qualifiedName);
+ String baseName = qualifiedName.substring(0, qualifiedName.length() - name.length());
+ if (javaPackage != null || !name.equals(qualifiedName))
+ {
+ ePackage.setName(name);
+ }
+ return baseName != null ? /*CodeGenUtil.*/safeQualifiedName(baseName) : null;
+ }
+
+ public static String shortName(String qualifiedName)
+ {
+ int index = qualifiedName.lastIndexOf(".");
+ return index != -1 ? qualifiedName.substring(index + 1) : qualifiedName;
+ }
+
+ public static String safeQualifiedName(String qualifiedName)
+ {
+ StringBuffer safeQualifiedName = new StringBuffer();
+ for (StringTokenizer stringTokenizer = new StringTokenizer(qualifiedName, "."); stringTokenizer.hasMoreTokens();)
+ {
+ String name = stringTokenizer.nextToken();
+ safeQualifiedName.append(CodeGenUtil.safeName(name));
+ if (stringTokenizer.hasMoreTokens())
+ {
+ safeQualifiedName.append('.');
+ }
+ }
+ return safeQualifiedName.toString();
+ }
+
+ protected static void printDiagnostic(Diagnostic diagnostic, String indent)
+ {
+ System.out.print(indent);
+ System.out.println(diagnostic.getMessage());
+ for (Iterator i = diagnostic.getChildren().iterator(); i.hasNext();)
+ {
+ printDiagnostic((Diagnostic)i.next(), indent + " ");
+ }
+ }
+
+ protected static void printUsage()
+ {
+ System.out.println("Usage: this is a deprecated command replaced by XSD2JavaGenerator");
+ }
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/XSD2JavaGenerator.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/XSD2JavaGenerator.java
new file mode 100644
index 0000000000..6d9b1ad765
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/XSD2JavaGenerator.java
@@ -0,0 +1,193 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.generate;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.apache.tuscany.sdo.helper.XSDHelperImpl;
+import org.apache.tuscany.sdo.util.DataObjectUtil;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.impl.EPackageRegistryImpl;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.util.BasicExtendedMetaData;
+import org.eclipse.emf.ecore.util.ExtendedMetaData;
+import org.eclipse.xsd.XSDSchema;
+
+import commonj.sdo.helper.XSDHelper;
+
+public class XSD2JavaGenerator extends JavaGenerator
+{
+ /**
+ * Generate static SDOs from XML Schema
+ *
+ * Usage arguments: see JavaGenerator
+ *
+ * [ -targetDirectory <target-root-directory> ]
+ * [ -javaPackage <java-package-name> ]
+ * [ -schemaNamespace <namespace-uri> ]
+ * [ other options ... ]
+ * <xsd-file> | <wsdl-file>
+ *
+ * Options:
+ *
+ * -schemaNamespace
+ * Generate classes for XSD types in the specified targetNamespace. By default, types in the
+ * targetNamespace of the first schema in the specified xsd or wsdl file are generated.
+ *
+ * NOTE: see the base class JavaGenerator for other options.
+ *
+ * Example:
+ *
+ * generate somedir/somefile.xsd
+ *
+ * See base class JavaGenerator for details and the other options.
+ *
+ */
+ public static void main(String args[])
+ {
+ try
+ {
+ XSD2JavaGenerator generator = new XSD2JavaGenerator();
+ generator.processArguments(args);
+ generator.run(args);
+ }
+ catch (IllegalArgumentException e)
+ {
+ printUsage();
+ }
+ }
+
+ protected String schemaNamespace = null;
+ protected String generateBuiltIn = null;
+
+ protected int handleArgument(String args[], int index)
+ {
+ if (args[index].equalsIgnoreCase("-schemaNamespace"))
+ {
+ schemaNamespace = args[++index];
+ }
+ else if (args[index].equalsIgnoreCase("-generateBuiltIn"))
+ {
+ // Internal option used when regenerating one of the built-in (predefined) models (e.g., commonj.sdo).
+ generateBuiltIn = args[++index];
+ }
+ else
+ {
+ return super.handleArgument(args, index);
+ }
+
+ return index + 1;
+ }
+
+ protected void run(String args[])
+ {
+ String xsdFileName = args[inputIndex];
+ generateFromXMLSchema(xsdFileName, schemaNamespace, targetDirectory, javaPackage, prefix, genOptions, generateBuiltIn);
+ }
+
+ public static void generateFromXMLSchema(String xsdFileName, String namespace, String targetDirectory, String javaPackage, String prefix, int genOptions)
+ {
+ generateFromXMLSchema(xsdFileName, namespace, targetDirectory, javaPackage, prefix, genOptions, null);
+ }
+
+ protected static void generateFromXMLSchema(String xsdFileName, String namespace, String targetDirectory, String javaPackage, String prefix, int genOptions, String regenerateBuiltIn)
+ {
+ DataObjectUtil.initRuntime();
+ EPackage.Registry packageRegistry = new EPackageRegistryImpl(EPackage.Registry.INSTANCE);
+ ExtendedMetaData extendedMetaData = new BasicExtendedMetaData(packageRegistry);
+ XSDHelper xsdHelper = new XSDHelperImpl(extendedMetaData, regenerateBuiltIn);
+
+ try
+ {
+ File inputFile = new File(xsdFileName).getAbsoluteFile();
+ InputStream inputStream = new FileInputStream(inputFile);
+ xsdHelper.define(inputStream, inputFile.toURI().toString());
+
+ if (targetDirectory == null)
+ {
+ targetDirectory = new File(xsdFileName).getCanonicalFile().getParent();
+ }
+ else
+ {
+ targetDirectory = new File(targetDirectory).getCanonicalPath();
+ }
+
+ if (!packageRegistry.values().isEmpty())
+ {
+ String packageURI = namespace != null ? namespace : getSchemaNamespace(xsdFileName);
+ generatePackages(packageRegistry.values(), packageURI, null, targetDirectory, javaPackage, prefix, genOptions);
+ }
+
+ /*
+ for (Iterator iter = packageRegistry.values().iterator(); iter.hasNext();)
+ {
+ EPackage ePackage = (EPackage)iter.next();
+ String basePackage = extractBasePackageName(ePackage, javaPackage);
+ if (prefix == null)
+ {
+ prefix = CodeGenUtil.capName(ePackage.getName());
+ }
+ generateFromEPackage(ePackage, targetDirectory, basePackage, prefix, genOptions);
+ }
+ */
+ }
+ catch (IOException e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ public static String getSchemaNamespace(String xsdFileName)
+ {
+ ResourceSet resourceSet = DataObjectUtil.createResourceSet();
+ File inputFile = new File(xsdFileName).getAbsoluteFile();
+ Resource model = resourceSet.getResource(URI.createURI(inputFile.toURI().toString()), true);
+ XSDSchema schema = (XSDSchema)model.getContents().get(0);
+ return schema.getTargetNamespace();
+ }
+
+ protected static void printUsage()
+ {
+ System.out.println("Usage arguments:");
+ System.out.println(" [ -targetDirectory <target-root-directory> ]");
+ System.out.println(" [ -javaPackage <java-package-name> ]");
+ System.out.println(" [ -prefix <prefix-string> ]");
+ System.out.println(" [ -schemaNamespace <namespace-uri> ]");
+ System.out.println(" [ -noInterfaces ]");
+ System.out.println(" [ -noContainment ]");
+ System.out.println(" [ -noNotification ]");
+ System.out.println(" [ -noUnsettable ]");
+ /* Future Option: System.out.println(" [ -sparsePattern | -storePattern ]"); */
+ /* Future Option: System.out.println(" [ -arrayAccessors ]"); */
+ /* Future Option: System.out.println(" [ -generateLoader ]"); */
+ /* Future Option: System.out.println(" [ -interfaceDataObject ]"); */
+ System.out.println(" <xsd-file> | <wsdl-file>");
+ System.out.println("");
+ System.out.println("For example:");
+ System.out.println("");
+ System.out.println(" generate somedir/somefile.xsd");
+ }
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/adapter/SDOGenClassGeneratorAdapter.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/adapter/SDOGenClassGeneratorAdapter.java
new file mode 100644
index 0000000000..80f8fe7755
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/adapter/SDOGenClassGeneratorAdapter.java
@@ -0,0 +1,46 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.generate.adapter;
+
+import org.eclipse.emf.codegen.ecore.generator.GeneratorAdapterFactory;
+import org.eclipse.emf.codegen.ecore.genmodel.generator.GenClassGeneratorAdapter;
+
+public class SDOGenClassGeneratorAdapter extends GenClassGeneratorAdapter {
+
+ public SDOGenClassGeneratorAdapter(GeneratorAdapterFactory generatorAdapterFactory)
+ {
+ super(generatorAdapterFactory);
+ }
+
+ private static JETEmitterDescriptor[] jetEmitterDescriptors;
+
+ protected JETEmitterDescriptor[] getJETEmitterDescriptors()
+ {
+ if (jetEmitterDescriptors == null)
+ {
+ JETEmitterDescriptor[] base = super.getJETEmitterDescriptors();
+ jetEmitterDescriptors = new JETEmitterDescriptor[base.length];
+ System.arraycopy(base, 0, jetEmitterDescriptors, 0, base.length);
+ jetEmitterDescriptors[CLASS_ID] = new JETEmitterDescriptor("model/SDOClass.javajet", "org.apache.tuscany.sdo.generate.templates.model.SDOClass");
+ }
+ return jetEmitterDescriptors;
+ }
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/adapter/SDOGenModelGeneratorAdapterFactory.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/adapter/SDOGenModelGeneratorAdapterFactory.java
new file mode 100644
index 0000000000..eabf90c310
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/adapter/SDOGenModelGeneratorAdapterFactory.java
@@ -0,0 +1,54 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.generate.adapter;
+
+import org.eclipse.emf.codegen.ecore.generator.GeneratorAdapterFactory;
+import org.eclipse.emf.codegen.ecore.genmodel.generator.GenModelGeneratorAdapterFactory;
+import org.eclipse.emf.common.notify.Adapter;
+
+public class SDOGenModelGeneratorAdapterFactory extends
+ GenModelGeneratorAdapterFactory {
+
+ public static final GeneratorAdapterFactory.Descriptor DESCRIPTOR = new GeneratorAdapterFactory.Descriptor()
+ {
+ public GeneratorAdapterFactory createAdapterFactory()
+ {
+ return new SDOGenModelGeneratorAdapterFactory();
+ }
+ };
+
+ public Adapter createGenClassAdapter()
+ {
+ if (genClassGeneratorAdapter == null)
+ {
+ genClassGeneratorAdapter = new SDOGenClassGeneratorAdapter(this);
+ }
+ return genClassGeneratorAdapter;
+ }
+
+ public Adapter createGenPackageAdapter()
+ {
+ if (genPackageGeneratorAdapter == null)
+ {
+ genPackageGeneratorAdapter = new SDOGenPackageGeneratorAdapter(this);
+ }
+ return genPackageGeneratorAdapter;
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/adapter/SDOGenPackageGeneratorAdapter.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/adapter/SDOGenPackageGeneratorAdapter.java
new file mode 100644
index 0000000000..4a187674ce
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/adapter/SDOGenPackageGeneratorAdapter.java
@@ -0,0 +1,52 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.generate.adapter;
+
+import org.eclipse.emf.codegen.ecore.generator.GeneratorAdapterFactory;
+import org.eclipse.emf.codegen.ecore.genmodel.GenPackage;
+import org.eclipse.emf.codegen.ecore.genmodel.generator.GenPackageGeneratorAdapter;
+import org.eclipse.emf.common.util.Monitor;
+
+public class SDOGenPackageGeneratorAdapter extends GenPackageGeneratorAdapter
+{
+ public SDOGenPackageGeneratorAdapter(GeneratorAdapterFactory generatorAdapterFactory)
+ {
+ super(generatorAdapterFactory);
+ }
+
+ private static JETEmitterDescriptor[] jetEmitterDescriptors;
+
+ protected JETEmitterDescriptor[] getJETEmitterDescriptors()
+ {
+ if (jetEmitterDescriptors == null)
+ {
+ JETEmitterDescriptor[] base = super.getJETEmitterDescriptors();
+ jetEmitterDescriptors = new JETEmitterDescriptor[base.length];
+ System.arraycopy(base, 0, jetEmitterDescriptors, 0, base.length);
+ jetEmitterDescriptors[FACTORY_CLASS_ID] = new JETEmitterDescriptor("model/SDOFactoryClass.javajet", "org.apache.tuscany.sdo.generate.templates.model.SDOFactoryClass");
+ }
+ return jetEmitterDescriptors;
+ }
+
+ protected void generatePackageClass(GenPackage genPackage, Monitor monitor)
+ {
+ // do nothing
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/templates/model/SDOClass.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/templates/model/SDOClass.java
new file mode 100644
index 0000000000..93ea7e4f94
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/templates/model/SDOClass.java
@@ -0,0 +1,4281 @@
+package org.apache.tuscany.sdo.generate.templates.model;
+
+import org.eclipse.emf.codegen.util.*;
+import org.apache.tuscany.sdo.impl.*;
+import java.util.*;
+import org.eclipse.emf.codegen.ecore.genmodel.*;
+import org.apache.tuscany.sdo.generate.util.*;
+
+public class SDOClass
+{
+ protected static String nl;
+ public static synchronized SDOClass create(String lineSeparator)
+ {
+ nl = lineSeparator;
+ SDOClass result = new SDOClass();
+ nl = null;
+ return result;
+ }
+
+ protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
+ protected final String TEXT_1 = "";
+ protected final String TEXT_2 = "/**" + NL + " * <copyright>" + NL + " * </copyright>" + NL + " *" + NL + " * ";
+ protected final String TEXT_3 = "Id";
+ protected final String TEXT_4 = NL + " */";
+ protected final String TEXT_5 = NL + "package ";
+ protected final String TEXT_6 = ";";
+ protected final String TEXT_7 = NL + "package ";
+ protected final String TEXT_8 = ";";
+ protected final String TEXT_9 = NL;
+ protected final String TEXT_10 = NL;
+ protected final String TEXT_11 = NL + " // EYECATCHER 1";
+ protected final String TEXT_12 = NL + "/**" + NL + " * <!-- begin-user-doc -->" + NL + " * A representation of the model object '<em><b>";
+ protected final String TEXT_13 = "</b></em>'." + NL + " * <!-- end-user-doc -->";
+ protected final String TEXT_14 = NL + " *" + NL + " * <!-- begin-model-doc -->" + NL + " * ";
+ protected final String TEXT_15 = NL + " * <!-- end-model-doc -->";
+ protected final String TEXT_16 = NL + " *";
+ protected final String TEXT_17 = NL + " * <p>" + NL + " * The following features are supported:" + NL + " * <ul>";
+ protected final String TEXT_18 = NL + " * <li>{@link ";
+ protected final String TEXT_19 = "#";
+ protected final String TEXT_20 = " <em>";
+ protected final String TEXT_21 = "</em>}</li>";
+ protected final String TEXT_22 = NL + " * </ul>" + NL + " * </p>";
+ protected final String TEXT_23 = NL + " *";
+ protected final String TEXT_24 = NL + " * @see ";
+ protected final String TEXT_25 = "#get";
+ protected final String TEXT_26 = "()";
+ protected final String TEXT_27 = NL + " * @model ";
+ protected final String TEXT_28 = NL + " * ";
+ protected final String TEXT_29 = NL + " * @model";
+ protected final String TEXT_30 = NL + " * @extends ";
+ protected final String TEXT_31 = NL + " * @generated" + NL + " */";
+ protected final String TEXT_32 = NL + "/**" + NL + " * <!-- begin-user-doc -->" + NL + " * An implementation of the model object '<em><b>";
+ protected final String TEXT_33 = "</b></em>'." + NL + " * <!-- end-user-doc -->" + NL + " * <p>";
+ protected final String TEXT_34 = NL + " * The following features are implemented:" + NL + " * <ul>";
+ protected final String TEXT_35 = NL + " * <li>{@link ";
+ protected final String TEXT_36 = "#";
+ protected final String TEXT_37 = " <em>";
+ protected final String TEXT_38 = "</em>}</li>";
+ protected final String TEXT_39 = NL + " * </ul>";
+ protected final String TEXT_40 = NL + " * </p>" + NL + " *" + NL + " * @generated" + NL + " */";
+ protected final String TEXT_41 = NL + "public";
+ protected final String TEXT_42 = " abstract";
+ protected final String TEXT_43 = " class ";
+ protected final String TEXT_44 = NL + "public interface ";
+ protected final String TEXT_45 = NL + "{";
+ protected final String TEXT_46 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\t";
+ protected final String TEXT_47 = " copyright = \"";
+ protected final String TEXT_48 = "\";";
+ protected final String TEXT_49 = NL;
+ protected final String TEXT_50 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static final ";
+ protected final String TEXT_51 = " mofDriverNumber = \"";
+ protected final String TEXT_52 = "\";";
+ protected final String TEXT_53 = NL;
+ protected final String TEXT_54 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final long serialVersionUID = 1L;" + NL;
+ protected final String TEXT_55 = NL + "\t/**" + NL + "\t * An array of objects representing the values of non-primitive features." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected Object[] ";
+ protected final String TEXT_56 = " = null;" + NL;
+ protected final String TEXT_57 = NL + "\t/**" + NL + "\t * A bit field representing the indices of non-primitive feature values." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected int ";
+ protected final String TEXT_58 = " = 0;" + NL;
+ protected final String TEXT_59 = NL + "\t/**" + NL + "\t * A set of bit flags representing the values of boolean attributes and whether unsettable features have been set." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t * @ordered" + NL + "\t */" + NL + "\tprotected int ";
+ protected final String TEXT_60 = " = 0;" + NL;
+ protected final String TEXT_61 = NL;
+ protected final String TEXT_62 = NL + "\tpublic final static int ";
+ protected final String TEXT_63 = " = ";
+ protected final String TEXT_64 = ";" + NL;
+ protected final String TEXT_65 = NL + "\tpublic final static int ";
+ protected final String TEXT_66 = " = ";
+ protected final String TEXT_67 = ";" + NL;
+ protected final String TEXT_68 = NL + "\tpublic final static int SDO_PROPERTY_COUNT = ";
+ protected final String TEXT_69 = ";" + NL;
+ protected final String TEXT_70 = NL + "\tpublic final static int EXTENDED_PROPERTY_COUNT = ";
+ protected final String TEXT_71 = ";" + NL + NL;
+ protected final String TEXT_72 = NL + "\t/**" + NL + "\t * The internal feature id for the '<em><b>";
+ protected final String TEXT_73 = "</b></em>' ";
+ protected final String TEXT_74 = "." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t * @ordered" + NL + "\t */";
+ protected final String TEXT_75 = " " + NL + "\tpublic final static int INTERNAL_";
+ protected final String TEXT_76 = " = ";
+ protected final String TEXT_77 = ";" + NL;
+ protected final String TEXT_78 = NL + "\t/**" + NL + "\t * The number of properties for this type." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t * @ordered" + NL + "\t */";
+ protected final String TEXT_79 = NL + "\tpublic final static int INTERNAL_PROPERTY_COUNT = ";
+ protected final String TEXT_80 = ";" + NL + "" + NL + "\tprotected int internalConvertIndex(int internalIndex)" + NL + "\t{" + NL + "\t\tswitch (internalIndex)" + NL + "\t\t{";
+ protected final String TEXT_81 = NL + "\t\t\tcase INTERNAL_";
+ protected final String TEXT_82 = ": return ";
+ protected final String TEXT_83 = ";";
+ protected final String TEXT_84 = NL + "\t\t}" + NL + "\t\treturn super.internalConvertIndex(internalIndex);" + NL + "\t}" + NL + NL;
+ protected final String TEXT_85 = NL + "\t/**" + NL + "\t * The cached value of the '{@link #";
+ protected final String TEXT_86 = "() <em>";
+ protected final String TEXT_87 = "</em>}' ";
+ protected final String TEXT_88 = "." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @see #";
+ protected final String TEXT_89 = "()" + NL + "\t * @generated" + NL + "\t * @ordered" + NL + "\t */" + NL + "\t" + NL + "\tprotected ";
+ protected final String TEXT_90 = " ";
+ protected final String TEXT_91 = " = null;" + NL + "\t";
+ protected final String TEXT_92 = NL + "\t/**" + NL + "\t * The empty value for the '{@link #";
+ protected final String TEXT_93 = "() <em>";
+ protected final String TEXT_94 = "</em>}' array accessor." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @see #";
+ protected final String TEXT_95 = "()" + NL + "\t * @generated" + NL + "\t * @ordered" + NL + "\t */" + NL + "\tprotected static final ";
+ protected final String TEXT_96 = "[] ";
+ protected final String TEXT_97 = "_EEMPTY_ARRAY = new ";
+ protected final String TEXT_98 = " [0];" + NL;
+ protected final String TEXT_99 = NL + "\t/**" + NL + "\t * The default value of the '{@link #";
+ protected final String TEXT_100 = "() <em>";
+ protected final String TEXT_101 = "</em>}' ";
+ protected final String TEXT_102 = "." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @see #";
+ protected final String TEXT_103 = "()" + NL + "\t * @generated" + NL + "\t * @ordered" + NL + "\t */" + NL + "\tprotected static final ";
+ protected final String TEXT_104 = " ";
+ protected final String TEXT_105 = "_DEFAULT_ = ";
+ protected final String TEXT_106 = ";";
+ protected final String TEXT_107 = NL;
+ protected final String TEXT_108 = NL + "\t/**" + NL + "\t * An additional set of bit flags representing the values of boolean attributes and whether unsettable features have been set." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t * @ordered" + NL + "\t */" + NL + "\tprotected int ";
+ protected final String TEXT_109 = " = 0;" + NL;
+ protected final String TEXT_110 = NL + "\t/**" + NL + "\t * The flag representing the value of the '{@link #";
+ protected final String TEXT_111 = "() <em>";
+ protected final String TEXT_112 = "</em>}' ";
+ protected final String TEXT_113 = "." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @see #";
+ protected final String TEXT_114 = "()" + NL + "\t * @generated" + NL + "\t * @ordered" + NL + "\t */" + NL + "\tprotected static final int ";
+ protected final String TEXT_115 = "_EFLAG = 1 ";
+ protected final String TEXT_116 = ";" + NL;
+ protected final String TEXT_117 = NL + "\t/**" + NL + "\t * The cached value of the '{@link #";
+ protected final String TEXT_118 = "() <em>";
+ protected final String TEXT_119 = "</em>}' ";
+ protected final String TEXT_120 = "." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @see #";
+ protected final String TEXT_121 = "()" + NL + "\t * @generated" + NL + "\t * @ordered" + NL + "\t */" + NL + "\tprotected ";
+ protected final String TEXT_122 = " ";
+ protected final String TEXT_123 = " = ";
+ protected final String TEXT_124 = "_DEFAULT_;" + NL;
+ protected final String TEXT_125 = NL + "\t/**" + NL + "\t * An additional set of bit flags representing the values of boolean attributes and whether unsettable features have been set." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t * @ordered" + NL + "\t */" + NL + "\tprotected int ";
+ protected final String TEXT_126 = " = 0;" + NL;
+ protected final String TEXT_127 = NL + "\t/**" + NL + "\t * The flag representing whether the ";
+ protected final String TEXT_128 = " ";
+ protected final String TEXT_129 = " has been set." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t * @ordered" + NL + "\t */" + NL + "\tprotected static final int ";
+ protected final String TEXT_130 = "_ESETFLAG = 1 ";
+ protected final String TEXT_131 = ";" + NL;
+ protected final String TEXT_132 = NL + "\t/**" + NL + "\t * This is true if the ";
+ protected final String TEXT_133 = " ";
+ protected final String TEXT_134 = " has been set." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t * @ordered" + NL + "\t */" + NL + "\tprotected boolean ";
+ protected final String TEXT_135 = "_set_ = false;" + NL;
+ protected final String TEXT_136 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
+ protected final String TEXT_137 = "()" + NL + "\t{" + NL + "\t\tsuper();";
+ protected final String TEXT_138 = NL + "\t\t";
+ protected final String TEXT_139 = " |= ";
+ protected final String TEXT_140 = "_EFLAG;";
+ protected final String TEXT_141 = NL + "\t\tcreateChangeSummary(";
+ protected final String TEXT_142 = ");";
+ protected final String TEXT_143 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
+ protected final String TEXT_144 = " getType()" + NL + "\t{" + NL + "\t\treturn ((";
+ protected final String TEXT_145 = ")";
+ protected final String TEXT_146 = ".INSTANCE).get";
+ protected final String TEXT_147 = "();" + NL + "\t}" + NL;
+ protected final String TEXT_148 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */";
+ protected final String TEXT_149 = NL + "\t";
+ protected final String TEXT_150 = "[] ";
+ protected final String TEXT_151 = "();" + NL;
+ protected final String TEXT_152 = NL + "\tpublic ";
+ protected final String TEXT_153 = "[] ";
+ protected final String TEXT_154 = "()" + NL + "\t{";
+ protected final String TEXT_155 = NL + "\t\t";
+ protected final String TEXT_156 = " list = (";
+ protected final String TEXT_157 = ")";
+ protected final String TEXT_158 = "();" + NL + "\t\tif (list.isEmpty()) return ";
+ protected final String TEXT_159 = "_EEMPTY_ARRAY;";
+ protected final String TEXT_160 = NL + "\t\tif (";
+ protected final String TEXT_161 = " == null || ";
+ protected final String TEXT_162 = ".isEmpty()) return ";
+ protected final String TEXT_163 = "_EEMPTY_ARRAY;" + NL + "\t\t";
+ protected final String TEXT_164 = " list = (";
+ protected final String TEXT_165 = ")";
+ protected final String TEXT_166 = ";";
+ protected final String TEXT_167 = NL + "\t\tlist.shrink();" + NL + "\t\treturn (";
+ protected final String TEXT_168 = "[])list.data();" + NL + "\t}" + NL;
+ protected final String TEXT_169 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */";
+ protected final String TEXT_170 = NL + "\t";
+ protected final String TEXT_171 = " get";
+ protected final String TEXT_172 = "(int index);";
+ protected final String TEXT_173 = NL + "\tpublic ";
+ protected final String TEXT_174 = " get";
+ protected final String TEXT_175 = "(int index)" + NL + "\t{" + NL + "\t\treturn (";
+ protected final String TEXT_176 = ")";
+ protected final String TEXT_177 = "().get(index);" + NL + "\t}";
+ protected final String TEXT_178 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */";
+ protected final String TEXT_179 = NL + "\tint get";
+ protected final String TEXT_180 = "Length();" + NL;
+ protected final String TEXT_181 = NL + "\tpublic int get";
+ protected final String TEXT_182 = "Length()" + NL + "\t{";
+ protected final String TEXT_183 = NL + "\t\treturn ";
+ protected final String TEXT_184 = "().size();";
+ protected final String TEXT_185 = NL + "\t\treturn ";
+ protected final String TEXT_186 = " == null ? 0 : ";
+ protected final String TEXT_187 = ".size();";
+ protected final String TEXT_188 = NL + "\t}" + NL;
+ protected final String TEXT_189 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */";
+ protected final String TEXT_190 = NL + "\tvoid set";
+ protected final String TEXT_191 = "(";
+ protected final String TEXT_192 = "[] new";
+ protected final String TEXT_193 = ");" + NL;
+ protected final String TEXT_194 = NL + "\tpublic void set";
+ protected final String TEXT_195 = "(";
+ protected final String TEXT_196 = "[] new";
+ protected final String TEXT_197 = ")" + NL + "\t{" + NL + "\t\t((";
+ protected final String TEXT_198 = ")";
+ protected final String TEXT_199 = "()).setData(new";
+ protected final String TEXT_200 = ".length, new";
+ protected final String TEXT_201 = ");" + NL + "\t}" + NL;
+ protected final String TEXT_202 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */";
+ protected final String TEXT_203 = NL + "\tvoid set";
+ protected final String TEXT_204 = "(int index, ";
+ protected final String TEXT_205 = " element);" + NL;
+ protected final String TEXT_206 = NL + "\tpublic void set";
+ protected final String TEXT_207 = "(int index, ";
+ protected final String TEXT_208 = " element)" + NL + "\t{" + NL + "\t\t";
+ protected final String TEXT_209 = "().set(index, element);" + NL + "\t}" + NL;
+ protected final String TEXT_210 = NL + "\t/**" + NL + "\t * Returns the value of the '<em><b>";
+ protected final String TEXT_211 = "</b></em>' ";
+ protected final String TEXT_212 = ".";
+ protected final String TEXT_213 = NL + "\t * The key is of type ";
+ protected final String TEXT_214 = "list of {@link ";
+ protected final String TEXT_215 = "}";
+ protected final String TEXT_216 = "{@link ";
+ protected final String TEXT_217 = "}";
+ protected final String TEXT_218 = "," + NL + "\t * and the value is of type ";
+ protected final String TEXT_219 = "list of {@link ";
+ protected final String TEXT_220 = "}";
+ protected final String TEXT_221 = "{@link ";
+ protected final String TEXT_222 = "}";
+ protected final String TEXT_223 = ",";
+ protected final String TEXT_224 = NL + "\t * The list contents are of type {@link ";
+ protected final String TEXT_225 = "}.";
+ protected final String TEXT_226 = NL + "\t * The default value is <code>";
+ protected final String TEXT_227 = "</code>.";
+ protected final String TEXT_228 = NL + "\t * The literals are from the enumeration {@link ";
+ protected final String TEXT_229 = "}.";
+ protected final String TEXT_230 = NL + "\t * It is bidirectional and its opposite is '{@link ";
+ protected final String TEXT_231 = "#";
+ protected final String TEXT_232 = " <em>";
+ protected final String TEXT_233 = "</em>}'.";
+ protected final String TEXT_234 = NL + "\t * <!-- begin-user-doc -->";
+ protected final String TEXT_235 = NL + "\t * <p>" + NL + "\t * If the meaning of the '<em>";
+ protected final String TEXT_236 = "</em>' ";
+ protected final String TEXT_237 = " isn't clear," + NL + "\t * there really should be more of a description here..." + NL + "\t * </p>";
+ protected final String TEXT_238 = NL + "\t * <!-- end-user-doc -->";
+ protected final String TEXT_239 = NL + "\t * <!-- begin-model-doc -->" + NL + "\t * ";
+ protected final String TEXT_240 = NL + "\t * <!-- end-model-doc -->";
+ protected final String TEXT_241 = NL + "\t * @return the value of the '<em>";
+ protected final String TEXT_242 = "</em>' ";
+ protected final String TEXT_243 = ".";
+ protected final String TEXT_244 = NL + "\t * @see ";
+ protected final String TEXT_245 = NL + "\t * @see #isSet";
+ protected final String TEXT_246 = "()";
+ protected final String TEXT_247 = NL + "\t * @see #unset";
+ protected final String TEXT_248 = "()";
+ protected final String TEXT_249 = NL + "\t * @see #set";
+ protected final String TEXT_250 = "(";
+ protected final String TEXT_251 = ")";
+ protected final String TEXT_252 = NL + "\t * @see ";
+ protected final String TEXT_253 = "#get";
+ protected final String TEXT_254 = "()";
+ protected final String TEXT_255 = NL + "\t * @see ";
+ protected final String TEXT_256 = "#";
+ protected final String TEXT_257 = NL + "\t * @model ";
+ protected final String TEXT_258 = NL + "\t * ";
+ protected final String TEXT_259 = NL + "\t * @model";
+ protected final String TEXT_260 = NL + "\t * @generated" + NL + "\t */";
+ protected final String TEXT_261 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */";
+ protected final String TEXT_262 = NL + "\t";
+ protected final String TEXT_263 = " ";
+ protected final String TEXT_264 = "();" + NL;
+ protected final String TEXT_265 = NL + "\tpublic ";
+ protected final String TEXT_266 = " ";
+ protected final String TEXT_267 = "()" + NL + "\t{";
+ protected final String TEXT_268 = NL + "\t\treturn ";
+ protected final String TEXT_269 = "(";
+ protected final String TEXT_270 = "(";
+ protected final String TEXT_271 = ")get(";
+ protected final String TEXT_272 = ", true)";
+ protected final String TEXT_273 = ").";
+ protected final String TEXT_274 = "()";
+ protected final String TEXT_275 = ";";
+ protected final String TEXT_276 = NL + "\t\t";
+ protected final String TEXT_277 = " ";
+ protected final String TEXT_278 = " = (";
+ protected final String TEXT_279 = ")eVirtualGet(";
+ protected final String TEXT_280 = ");";
+ protected final String TEXT_281 = NL + "\t\tif (";
+ protected final String TEXT_282 = " == null)" + NL + "\t\t{";
+ protected final String TEXT_283 = NL + "\t\t\teVirtualSet(";
+ protected final String TEXT_284 = ", ";
+ protected final String TEXT_285 = " = new ";
+ protected final String TEXT_286 = ");";
+ protected final String TEXT_287 = NL + "\t\t ";
+ protected final String TEXT_288 = " = createSequence(INTERNAL_";
+ protected final String TEXT_289 = ");";
+ protected final String TEXT_290 = NL + "\t\t ";
+ protected final String TEXT_291 = " = createPropertyList(";
+ protected final String TEXT_292 = ", ";
+ protected final String TEXT_293 = ".class, ";
+ protected final String TEXT_294 = ", ";
+ protected final String TEXT_295 = ");";
+ protected final String TEXT_296 = NL + "\t\t}" + NL + "\t\treturn ";
+ protected final String TEXT_297 = ";";
+ protected final String TEXT_298 = NL + "\t\tif (eContainerFeatureID != ";
+ protected final String TEXT_299 = ") return null;" + NL + "\t\treturn (";
+ protected final String TEXT_300 = ")eContainer();";
+ protected final String TEXT_301 = NL + "\t\t";
+ protected final String TEXT_302 = " ";
+ protected final String TEXT_303 = " = (";
+ protected final String TEXT_304 = ")eVirtualGet(";
+ protected final String TEXT_305 = ", ";
+ protected final String TEXT_306 = "_DEFAULT_";
+ protected final String TEXT_307 = ");";
+ protected final String TEXT_308 = NL + "\t\tif (";
+ protected final String TEXT_309 = " != null && isProxy(";
+ protected final String TEXT_310 = "))" + NL + "\t\t{" + NL + "\t\t\tObject old";
+ protected final String TEXT_311 = " = ";
+ protected final String TEXT_312 = ";" + NL + "\t\t\t";
+ protected final String TEXT_313 = " = ";
+ protected final String TEXT_314 = "resolveProxy(old";
+ protected final String TEXT_315 = ");" + NL + "\t\t\tif (";
+ protected final String TEXT_316 = " != old";
+ protected final String TEXT_317 = ")" + NL + "\t\t\t{";
+ protected final String TEXT_318 = NL + "\t\t\t\t";
+ protected final String TEXT_319 = " new";
+ protected final String TEXT_320 = " = (";
+ protected final String TEXT_321 = ")";
+ protected final String TEXT_322 = ";";
+ protected final String TEXT_323 = NL + "\t\t\t\tChangeContext changeContext = old";
+ protected final String TEXT_324 = ".inverseRemove(this, EOPPOSITE_FEATURE_BASE - ";
+ protected final String TEXT_325 = ", null, null);";
+ protected final String TEXT_326 = NL + "\t\t\t\t";
+ protected final String TEXT_327 = " changeContext = old";
+ protected final String TEXT_328 = ".inverseRemove(this, ";
+ protected final String TEXT_329 = ", ";
+ protected final String TEXT_330 = ".class, null);";
+ protected final String TEXT_331 = NL + "\t\t\t\tif (new";
+ protected final String TEXT_332 = ".eInternalContainer() == null)" + NL + "\t\t\t\t{";
+ protected final String TEXT_333 = NL + "\t\t\t\t\tchangeContext = new";
+ protected final String TEXT_334 = ".eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ";
+ protected final String TEXT_335 = ", null, changeContext);";
+ protected final String TEXT_336 = NL + "\t\t\t\t\tchangeContext = new";
+ protected final String TEXT_337 = ".eInverseAdd(this, ";
+ protected final String TEXT_338 = ", ";
+ protected final String TEXT_339 = ".class, changeContext);";
+ protected final String TEXT_340 = NL + "\t\t\t\t}" + NL + "\t\t\t\tif (changeContext != null) dispatch(changeContext);";
+ protected final String TEXT_341 = NL + "\t\t\t\teVirtualSet(";
+ protected final String TEXT_342 = ", ";
+ protected final String TEXT_343 = ");";
+ protected final String TEXT_344 = NL + "\t\t\t\tif (isNotifying())" + NL + "\t\t\t\t\tnotify(ChangeKind.RESOLVE, ";
+ protected final String TEXT_345 = ", old";
+ protected final String TEXT_346 = ", ";
+ protected final String TEXT_347 = ");";
+ protected final String TEXT_348 = NL + "\t\t\t}" + NL + "\t\t}";
+ protected final String TEXT_349 = NL + "\t\treturn (";
+ protected final String TEXT_350 = ")eVirtualGet(";
+ protected final String TEXT_351 = ", ";
+ protected final String TEXT_352 = "_DEFAULT_";
+ protected final String TEXT_353 = ");";
+ protected final String TEXT_354 = NL + "\t\treturn (";
+ protected final String TEXT_355 = " & ";
+ protected final String TEXT_356 = "_EFLAG) != 0;";
+ protected final String TEXT_357 = NL + "\t\treturn ";
+ protected final String TEXT_358 = ";";
+ protected final String TEXT_359 = NL + "\t\t";
+ protected final String TEXT_360 = " ";
+ protected final String TEXT_361 = " = basicGet";
+ protected final String TEXT_362 = "();" + NL + "\t\treturn ";
+ protected final String TEXT_363 = " != null && ";
+ protected final String TEXT_364 = ".isProxy() ? ";
+ protected final String TEXT_365 = "eResolveProxy((";
+ protected final String TEXT_366 = ")";
+ protected final String TEXT_367 = ") : ";
+ protected final String TEXT_368 = ";";
+ protected final String TEXT_369 = NL + "\t\treturn create";
+ protected final String TEXT_370 = "(get";
+ protected final String TEXT_371 = "(), getType(), INTERNAL_";
+ protected final String TEXT_372 = ");";
+ protected final String TEXT_373 = NL + "\t\treturn (";
+ protected final String TEXT_374 = ")((";
+ protected final String TEXT_375 = ")get";
+ protected final String TEXT_376 = "()).list(";
+ protected final String TEXT_377 = ");";
+ protected final String TEXT_378 = NL + "\t\treturn get";
+ protected final String TEXT_379 = "(get";
+ protected final String TEXT_380 = "(), getType(), INTERNAL_";
+ protected final String TEXT_381 = ");";
+ protected final String TEXT_382 = NL + "\t\treturn ((";
+ protected final String TEXT_383 = ")get";
+ protected final String TEXT_384 = "()).list(";
+ protected final String TEXT_385 = ");";
+ protected final String TEXT_386 = NL + "\t\treturn ";
+ protected final String TEXT_387 = "(";
+ protected final String TEXT_388 = "(";
+ protected final String TEXT_389 = ")get(get";
+ protected final String TEXT_390 = "(), getType(), INTERNAL_";
+ protected final String TEXT_391 = ")";
+ protected final String TEXT_392 = ").";
+ protected final String TEXT_393 = "()";
+ protected final String TEXT_394 = ";";
+ protected final String TEXT_395 = NL + "\t\treturn ";
+ protected final String TEXT_396 = "(";
+ protected final String TEXT_397 = "(";
+ protected final String TEXT_398 = ")get(get";
+ protected final String TEXT_399 = "(), getType(), INTERNAL_";
+ protected final String TEXT_400 = ")";
+ protected final String TEXT_401 = ").";
+ protected final String TEXT_402 = "()";
+ protected final String TEXT_403 = ";";
+ protected final String TEXT_404 = NL + "\t\t// TODO: implement this method to return the '";
+ protected final String TEXT_405 = "' ";
+ protected final String TEXT_406 = NL + "\t\t// Ensure that you remove @generated or mark it @generated NOT" + NL + "\t\tthrow new UnsupportedOperationException();";
+ protected final String TEXT_407 = NL + "\t}";
+ protected final String TEXT_408 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
+ protected final String TEXT_409 = " basicGet";
+ protected final String TEXT_410 = "()" + NL + "\t{";
+ protected final String TEXT_411 = NL + "\t\tif (eContainerFeatureID != ";
+ protected final String TEXT_412 = ") return null;" + NL + "\t\treturn (";
+ protected final String TEXT_413 = ")eInternalContainer();";
+ protected final String TEXT_414 = NL + "\t\treturn (";
+ protected final String TEXT_415 = ")eVirtualGet(";
+ protected final String TEXT_416 = ");";
+ protected final String TEXT_417 = NL + "\t\treturn ";
+ protected final String TEXT_418 = ";";
+ protected final String TEXT_419 = NL + "\t\treturn (";
+ protected final String TEXT_420 = ")get(get";
+ protected final String TEXT_421 = "(), getType(), INTERNAL_";
+ protected final String TEXT_422 = ");";
+ protected final String TEXT_423 = NL + "\t\treturn (";
+ protected final String TEXT_424 = ")get";
+ protected final String TEXT_425 = "().get(";
+ protected final String TEXT_426 = ", false);";
+ protected final String TEXT_427 = NL + "\t\t// TODO: implement this method to return the '";
+ protected final String TEXT_428 = "' ";
+ protected final String TEXT_429 = NL + "\t\t// -> do not perform proxy resolution" + NL + "\t\t// Ensure that you remove @generated or mark it @generated NOT" + NL + "\t\tthrow new UnsupportedOperationException();";
+ protected final String TEXT_430 = NL + "\t}" + NL;
+ protected final String TEXT_431 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ChangeContext basicSet";
+ protected final String TEXT_432 = "(";
+ protected final String TEXT_433 = " new";
+ protected final String TEXT_434 = ", ChangeContext changeContext)" + NL + "\t{";
+ protected final String TEXT_435 = NL + "\t\tObject old";
+ protected final String TEXT_436 = " = eVirtualSet(";
+ protected final String TEXT_437 = ", new";
+ protected final String TEXT_438 = ");";
+ protected final String TEXT_439 = NL + "\t\t";
+ protected final String TEXT_440 = " old";
+ protected final String TEXT_441 = " = ";
+ protected final String TEXT_442 = ";" + NL + "\t\t";
+ protected final String TEXT_443 = " = new";
+ protected final String TEXT_444 = ";";
+ protected final String TEXT_445 = NL + "\t\tboolean isSetChange = old";
+ protected final String TEXT_446 = " == EVIRTUAL_NO_VALUE;";
+ protected final String TEXT_447 = NL + "\t\tboolean old";
+ protected final String TEXT_448 = "_set_ = (";
+ protected final String TEXT_449 = " & ";
+ protected final String TEXT_450 = "_ESETFLAG) != 0;" + NL + "\t\t";
+ protected final String TEXT_451 = " |= ";
+ protected final String TEXT_452 = "_ESETFLAG;";
+ protected final String TEXT_453 = NL + "\t\tboolean old";
+ protected final String TEXT_454 = "_set_ = ";
+ protected final String TEXT_455 = "_set_;" + NL + "\t\t";
+ protected final String TEXT_456 = "_set_ = true;";
+ protected final String TEXT_457 = NL + "\t\tif (isNotifying())" + NL + "\t\t{";
+ protected final String TEXT_458 = NL + "\t\t\taddNotification(this, ChangeKind.SET, ";
+ protected final String TEXT_459 = ", ";
+ protected final String TEXT_460 = "isSetChange ? null : old";
+ protected final String TEXT_461 = "old";
+ protected final String TEXT_462 = ", new";
+ protected final String TEXT_463 = ", ";
+ protected final String TEXT_464 = "isSetChange";
+ protected final String TEXT_465 = "!old";
+ protected final String TEXT_466 = "_set_";
+ protected final String TEXT_467 = ", changeContext);";
+ protected final String TEXT_468 = NL + "\t\t\taddNotification(this, ChangeKind.SET, ";
+ protected final String TEXT_469 = ", ";
+ protected final String TEXT_470 = "old";
+ protected final String TEXT_471 = " == EVIRTUAL_NO_VALUE ? null : old";
+ protected final String TEXT_472 = "old";
+ protected final String TEXT_473 = ", new";
+ protected final String TEXT_474 = ", changeContext);";
+ protected final String TEXT_475 = NL + "\t\t}";
+ protected final String TEXT_476 = NL + "\t\treturn changeContext;";
+ protected final String TEXT_477 = NL + "\t\treturn basicAdd(get";
+ protected final String TEXT_478 = "(), getType(), INTERNAL_";
+ protected final String TEXT_479 = ", new";
+ protected final String TEXT_480 = ", changeContext);";
+ protected final String TEXT_481 = NL + "\t\treturn basicAdd(get";
+ protected final String TEXT_482 = "(), getType(), INTERNAL_";
+ protected final String TEXT_483 = ", new";
+ protected final String TEXT_484 = ", changeContext);";
+ protected final String TEXT_485 = NL + "\t\t// TODO: implement this method to set the contained '";
+ protected final String TEXT_486 = "' ";
+ protected final String TEXT_487 = NL + "\t\t// -> this method is automatically invoked to keep the containment relationship in synch" + NL + "\t\t// -> do not modify other features" + NL + "\t\t// -> return changeContext, after adding any generated Notification to it (if it is null, a NotificationChain object must be created first)" + NL + "\t\t// Ensure that you remove @generated or mark it @generated NOT" + NL + "\t\tthrow new UnsupportedOperationException();";
+ protected final String TEXT_488 = NL + "\t}" + NL;
+ protected final String TEXT_489 = NL + "\t/**" + NL + "\t * Sets the value of the '{@link ";
+ protected final String TEXT_490 = "#";
+ protected final String TEXT_491 = " <em>";
+ protected final String TEXT_492 = "</em>}' ";
+ protected final String TEXT_493 = "." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @param value the new value of the '<em>";
+ protected final String TEXT_494 = "</em>' ";
+ protected final String TEXT_495 = ".";
+ protected final String TEXT_496 = NL + "\t * @see ";
+ protected final String TEXT_497 = NL + "\t * @see #isSet";
+ protected final String TEXT_498 = "()";
+ protected final String TEXT_499 = NL + "\t * @see #unset";
+ protected final String TEXT_500 = "()";
+ protected final String TEXT_501 = NL + "\t * @see #";
+ protected final String TEXT_502 = "()" + NL + "\t * @generated" + NL + "\t */";
+ protected final String TEXT_503 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */";
+ protected final String TEXT_504 = NL + "\tvoid set";
+ protected final String TEXT_505 = "(";
+ protected final String TEXT_506 = " value);" + NL;
+ protected final String TEXT_507 = NL + "\tpublic void set";
+ protected final String TEXT_508 = "(";
+ protected final String TEXT_509 = " new";
+ protected final String TEXT_510 = ")" + NL + "\t{";
+ protected final String TEXT_511 = NL + "\t\t_set_(";
+ protected final String TEXT_512 = ", ";
+ protected final String TEXT_513 = "new ";
+ protected final String TEXT_514 = "(";
+ protected final String TEXT_515 = "new";
+ protected final String TEXT_516 = ")";
+ protected final String TEXT_517 = ");";
+ protected final String TEXT_518 = NL + "\t\tif (new";
+ protected final String TEXT_519 = " != eInternalContainer() || (eContainerFeatureID != ";
+ protected final String TEXT_520 = " && new";
+ protected final String TEXT_521 = " != null))" + NL + "\t\t{" + NL + "\t\t\tif (";
+ protected final String TEXT_522 = ".isAncestor(this, ";
+ protected final String TEXT_523 = "new";
+ protected final String TEXT_524 = "))" + NL + "\t\t\t\tthrow new ";
+ protected final String TEXT_525 = "(\"Recursive containment not allowed for \" + toString());";
+ protected final String TEXT_526 = NL + "\t\t\tChangeContext changeContext = null;" + NL + "\t\t\tif (eInternalContainer() != null)" + NL + "\t\t\t\tchangeContext = eBasicRemoveFromContainer(changeContext);" + NL + "\t\t\tif (new";
+ protected final String TEXT_527 = " != null)" + NL + "\t\t\t\tchangeContext = ((";
+ protected final String TEXT_528 = ")new";
+ protected final String TEXT_529 = ").eInverseAdd(this, ";
+ protected final String TEXT_530 = ", ";
+ protected final String TEXT_531 = ".class, changeContext);" + NL + "\t\t\tchangeContext = eBasicSetContainer((";
+ protected final String TEXT_532 = ")new";
+ protected final String TEXT_533 = ", ";
+ protected final String TEXT_534 = ", changeContext);" + NL + "\t\t\tif (changeContext != null) dispatch(changeContext);" + NL + "\t\t}";
+ protected final String TEXT_535 = NL + "\t\telse if (isNotifying())" + NL + "\t\t\tnotify(ChangeKind.SET, ";
+ protected final String TEXT_536 = ", new";
+ protected final String TEXT_537 = ", new";
+ protected final String TEXT_538 = ");";
+ protected final String TEXT_539 = NL + "\t\t";
+ protected final String TEXT_540 = " ";
+ protected final String TEXT_541 = " = (";
+ protected final String TEXT_542 = ")eVirtualGet(";
+ protected final String TEXT_543 = ");";
+ protected final String TEXT_544 = NL + "\t\tif (new";
+ protected final String TEXT_545 = " != ";
+ protected final String TEXT_546 = ")" + NL + "\t\t{" + NL + "\t\t\tChangeContext changeContext = null;" + NL + "\t\t\tif (";
+ protected final String TEXT_547 = " != null)";
+ protected final String TEXT_548 = NL + "\t\t\t\tchangeContext = inverseRemove(";
+ protected final String TEXT_549 = ", this, OPPOSITE_FEATURE_BASE - ";
+ protected final String TEXT_550 = ", null, changeContext);" + NL + "\t\t\tif (new";
+ protected final String TEXT_551 = " != null)" + NL + "\t\t\t\tchangeContext = inverseAdd(new";
+ protected final String TEXT_552 = ", this, OPPOSITE_FEATURE_BASE - ";
+ protected final String TEXT_553 = ", null, changeContext);";
+ protected final String TEXT_554 = NL + "\t\t\t\tchangeContext = inverseRemove(";
+ protected final String TEXT_555 = ", this, ";
+ protected final String TEXT_556 = ", ";
+ protected final String TEXT_557 = ".class, changeContext);" + NL + "\t\t\tif (new";
+ protected final String TEXT_558 = " != null)" + NL + "\t\t\t\tchangeContext = inverseAdd(new";
+ protected final String TEXT_559 = ", this, ";
+ protected final String TEXT_560 = ", ";
+ protected final String TEXT_561 = ".class, changeContext);";
+ protected final String TEXT_562 = NL + "\t\t\tchangeContext = basicSet";
+ protected final String TEXT_563 = "(";
+ protected final String TEXT_564 = "new";
+ protected final String TEXT_565 = ", changeContext);" + NL + "\t\t\tif (changeContext != null) dispatch(changeContext);" + NL + "\t\t}";
+ protected final String TEXT_566 = NL + "\t\telse" + NL + " \t{";
+ protected final String TEXT_567 = NL + "\t\t\tboolean old";
+ protected final String TEXT_568 = "_set_ = eVirtualIsSet(";
+ protected final String TEXT_569 = ");";
+ protected final String TEXT_570 = NL + "\t\t\tboolean old";
+ protected final String TEXT_571 = "_set_ = (";
+ protected final String TEXT_572 = " & ";
+ protected final String TEXT_573 = "_ESETFLAG) != 0;";
+ protected final String TEXT_574 = NL + "\t\t\t";
+ protected final String TEXT_575 = " |= ";
+ protected final String TEXT_576 = "_ESETFLAG;";
+ protected final String TEXT_577 = NL + "\t\t\tboolean old";
+ protected final String TEXT_578 = "_set_ = ";
+ protected final String TEXT_579 = "_set_;";
+ protected final String TEXT_580 = NL + "\t\t\t";
+ protected final String TEXT_581 = "_set_ = true;";
+ protected final String TEXT_582 = NL + "\t\t\tif (isNotifying())" + NL + "\t\t\t\tnotify(ChangeKind.SET, ";
+ protected final String TEXT_583 = ", new";
+ protected final String TEXT_584 = ", new";
+ protected final String TEXT_585 = ", !old";
+ protected final String TEXT_586 = "_set_);";
+ protected final String TEXT_587 = NL + " \t}";
+ protected final String TEXT_588 = NL + "\t\telse if (isNotifying())" + NL + "\t\t\tnotify(ChangeKind.SET, ";
+ protected final String TEXT_589 = ", new";
+ protected final String TEXT_590 = ", new";
+ protected final String TEXT_591 = ");";
+ protected final String TEXT_592 = NL + "\t\t";
+ protected final String TEXT_593 = " old";
+ protected final String TEXT_594 = " = (";
+ protected final String TEXT_595 = " & ";
+ protected final String TEXT_596 = "_EFLAG) != 0;";
+ protected final String TEXT_597 = NL + "\t\tif (new";
+ protected final String TEXT_598 = ") ";
+ protected final String TEXT_599 = " |= ";
+ protected final String TEXT_600 = "_EFLAG; else ";
+ protected final String TEXT_601 = " &= ~";
+ protected final String TEXT_602 = "_EFLAG;";
+ protected final String TEXT_603 = NL + "\t\t";
+ protected final String TEXT_604 = " old";
+ protected final String TEXT_605 = " = ";
+ protected final String TEXT_606 = ";";
+ protected final String TEXT_607 = NL + "\t\t";
+ protected final String TEXT_608 = " ";
+ protected final String TEXT_609 = " = new";
+ protected final String TEXT_610 = " == null ? ";
+ protected final String TEXT_611 = "_DEFAULT_ : new";
+ protected final String TEXT_612 = ";";
+ protected final String TEXT_613 = NL + "\t\t";
+ protected final String TEXT_614 = " = new";
+ protected final String TEXT_615 = " == null ? ";
+ protected final String TEXT_616 = "_DEFAULT_ : new";
+ protected final String TEXT_617 = ";";
+ protected final String TEXT_618 = NL + "\t\t";
+ protected final String TEXT_619 = " ";
+ protected final String TEXT_620 = " = ";
+ protected final String TEXT_621 = "new";
+ protected final String TEXT_622 = ";";
+ protected final String TEXT_623 = NL + "\t\t";
+ protected final String TEXT_624 = " = ";
+ protected final String TEXT_625 = "new";
+ protected final String TEXT_626 = ";";
+ protected final String TEXT_627 = NL + "\t\tObject old";
+ protected final String TEXT_628 = " = eVirtualSet(";
+ protected final String TEXT_629 = ", ";
+ protected final String TEXT_630 = ");";
+ protected final String TEXT_631 = NL + "\t\tboolean isSetChange = old";
+ protected final String TEXT_632 = " == EVIRTUAL_NO_VALUE;";
+ protected final String TEXT_633 = NL + "\t\tboolean old";
+ protected final String TEXT_634 = "_set_ = (";
+ protected final String TEXT_635 = " & ";
+ protected final String TEXT_636 = "_ESETFLAG) != 0;";
+ protected final String TEXT_637 = NL + "\t\t";
+ protected final String TEXT_638 = " |= ";
+ protected final String TEXT_639 = "_ESETFLAG;";
+ protected final String TEXT_640 = NL + "\t\tboolean old";
+ protected final String TEXT_641 = "_set_ = ";
+ protected final String TEXT_642 = "_set_;";
+ protected final String TEXT_643 = NL + "\t\t";
+ protected final String TEXT_644 = "_set_ = true;";
+ protected final String TEXT_645 = NL + "\t\tif (isNotifying())" + NL + "\t\t\tnotify(ChangeKind.SET, ";
+ protected final String TEXT_646 = ", ";
+ protected final String TEXT_647 = "isSetChange ? ";
+ protected final String TEXT_648 = "null";
+ protected final String TEXT_649 = "_DEFAULT_";
+ protected final String TEXT_650 = " : old";
+ protected final String TEXT_651 = "old";
+ protected final String TEXT_652 = ", ";
+ protected final String TEXT_653 = "new";
+ protected final String TEXT_654 = ", ";
+ protected final String TEXT_655 = "isSetChange";
+ protected final String TEXT_656 = "!old";
+ protected final String TEXT_657 = "_set_";
+ protected final String TEXT_658 = ");";
+ protected final String TEXT_659 = NL + "\t\tif (isNotifying())" + NL + "\t\t\tnotify(ChangeKind.SET, ";
+ protected final String TEXT_660 = ", ";
+ protected final String TEXT_661 = "old";
+ protected final String TEXT_662 = " == EVIRTUAL_NO_VALUE ? ";
+ protected final String TEXT_663 = "null";
+ protected final String TEXT_664 = "_DEFAULT_";
+ protected final String TEXT_665 = " : old";
+ protected final String TEXT_666 = "old";
+ protected final String TEXT_667 = ", ";
+ protected final String TEXT_668 = "new";
+ protected final String TEXT_669 = ");";
+ protected final String TEXT_670 = NL + "\t\tset(get";
+ protected final String TEXT_671 = "(), getType(), INTERNAL_";
+ protected final String TEXT_672 = ", ";
+ protected final String TEXT_673 = " new ";
+ protected final String TEXT_674 = "(";
+ protected final String TEXT_675 = "new";
+ protected final String TEXT_676 = ")";
+ protected final String TEXT_677 = ");";
+ protected final String TEXT_678 = NL + "\t\t((";
+ protected final String TEXT_679 = ".Internal)get";
+ protected final String TEXT_680 = "()).set(";
+ protected final String TEXT_681 = ", ";
+ protected final String TEXT_682 = "new ";
+ protected final String TEXT_683 = "(";
+ protected final String TEXT_684 = "new";
+ protected final String TEXT_685 = ")";
+ protected final String TEXT_686 = ");";
+ protected final String TEXT_687 = NL + "\t\t// TODO: implement this method to set the '";
+ protected final String TEXT_688 = "' ";
+ protected final String TEXT_689 = NL + "\t\t// Ensure that you remove @generated or mark it @generated NOT" + NL + "\t\tthrow new UnsupportedOperationException();";
+ protected final String TEXT_690 = NL + "\t}" + NL;
+ protected final String TEXT_691 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ChangeContext basicUnset";
+ protected final String TEXT_692 = "(ChangeContext changeContext)" + NL + "\t{";
+ protected final String TEXT_693 = NL + "\t\tObject old";
+ protected final String TEXT_694 = " = eVirtualUnset(";
+ protected final String TEXT_695 = ");";
+ protected final String TEXT_696 = NL + "\t\t";
+ protected final String TEXT_697 = " old";
+ protected final String TEXT_698 = " = ";
+ protected final String TEXT_699 = ";" + NL + "\t\t";
+ protected final String TEXT_700 = " = null;";
+ protected final String TEXT_701 = NL + "\t\tboolean isSetChange = old";
+ protected final String TEXT_702 = " != EVIRTUAL_NO_VALUE;";
+ protected final String TEXT_703 = NL + "\t\tboolean old";
+ protected final String TEXT_704 = "_set_ = (";
+ protected final String TEXT_705 = " & ";
+ protected final String TEXT_706 = "_ESETFLAG) != 0;" + NL + "\t\t";
+ protected final String TEXT_707 = " &= ~";
+ protected final String TEXT_708 = "_ESETFLAG;";
+ protected final String TEXT_709 = NL + "\t\tboolean old";
+ protected final String TEXT_710 = "_set_ = ";
+ protected final String TEXT_711 = "_set_;" + NL + "\t\t";
+ protected final String TEXT_712 = "_set_ = false;";
+ protected final String TEXT_713 = NL + "\t\tif (isNotifying())" + NL + "\t\t{";
+ protected final String TEXT_714 = NL + "\t\t\taddNotification(this, ChangeKind.UNSET, ";
+ protected final String TEXT_715 = ", ";
+ protected final String TEXT_716 = "isSetChange ? null : old";
+ protected final String TEXT_717 = "old";
+ protected final String TEXT_718 = ", null, ";
+ protected final String TEXT_719 = "isSetChange";
+ protected final String TEXT_720 = "!old";
+ protected final String TEXT_721 = "_set_";
+ protected final String TEXT_722 = ", changeContext);";
+ protected final String TEXT_723 = NL + "\t\t\taddNotification(this, ChangeKind.UNSET, ";
+ protected final String TEXT_724 = ", ";
+ protected final String TEXT_725 = "old";
+ protected final String TEXT_726 = " == EVIRTUAL_NO_VALUE ? null : old";
+ protected final String TEXT_727 = "old";
+ protected final String TEXT_728 = ", null, changeContext);";
+ protected final String TEXT_729 = NL + "\t\t}";
+ protected final String TEXT_730 = NL + "\t\treturn changeContext;";
+ protected final String TEXT_731 = NL + "\t\t// TODO: implement this method to unset the contained '";
+ protected final String TEXT_732 = "' ";
+ protected final String TEXT_733 = NL + "\t\t// -> this method is automatically invoked to keep the containment relationship in synch" + NL + "\t\t// -> do not modify other features" + NL + "\t\t// -> return changeContext, after adding any generated Notification to it (if it is null, a NotificationChain object must be created first)" + NL + "\t\t// Ensure that you remove @generated or mark it @generated NOT" + NL + "\t\tthrow new UnsupportedOperationException();";
+ protected final String TEXT_734 = NL + "\t}" + NL;
+ protected final String TEXT_735 = NL + "\t/**" + NL + "\t * Unsets the value of the '{@link ";
+ protected final String TEXT_736 = "#";
+ protected final String TEXT_737 = " <em>";
+ protected final String TEXT_738 = "</em>}' ";
+ protected final String TEXT_739 = "." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->";
+ protected final String TEXT_740 = NL + "\t * @see #isSet";
+ protected final String TEXT_741 = "()";
+ protected final String TEXT_742 = NL + "\t * @see #";
+ protected final String TEXT_743 = "()";
+ protected final String TEXT_744 = NL + "\t * @see #set";
+ protected final String TEXT_745 = "(";
+ protected final String TEXT_746 = ")";
+ protected final String TEXT_747 = NL + "\t * @generated" + NL + "\t */";
+ protected final String TEXT_748 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */";
+ protected final String TEXT_749 = NL + "\tvoid unset";
+ protected final String TEXT_750 = "();" + NL;
+ protected final String TEXT_751 = NL + "\tpublic void unset";
+ protected final String TEXT_752 = "()" + NL + "\t{";
+ protected final String TEXT_753 = NL + "\t\tunset(";
+ protected final String TEXT_754 = ");";
+ protected final String TEXT_755 = NL + "\t\t((";
+ protected final String TEXT_756 = ".Unsettable)get";
+ protected final String TEXT_757 = "()).unset();";
+ protected final String TEXT_758 = NL + "\t\t";
+ protected final String TEXT_759 = " ";
+ protected final String TEXT_760 = " = (";
+ protected final String TEXT_761 = ")eVirtualGet(";
+ protected final String TEXT_762 = ");";
+ protected final String TEXT_763 = NL + "\t\tif (";
+ protected final String TEXT_764 = " != null)" + NL + "\t\t{" + NL + "\t\t\tChangeContext changeContext = null;";
+ protected final String TEXT_765 = NL + "\t\t\tchangeContext = inverseRemove(";
+ protected final String TEXT_766 = ", this, EOPPOSITE_FEATURE_BASE - ";
+ protected final String TEXT_767 = ", null, changeContext);";
+ protected final String TEXT_768 = NL + "\t\t\tchangeContext = inverseRemove(";
+ protected final String TEXT_769 = ", this, ";
+ protected final String TEXT_770 = ", ";
+ protected final String TEXT_771 = ".class, changeContext);";
+ protected final String TEXT_772 = NL + "\t\t\tchangeContext = basicUnset";
+ protected final String TEXT_773 = "(changeContext);" + NL + "\t\t\tif (changeContext != null) dispatch(changeContext);" + NL + "\t\t}" + NL + "\t\telse" + NL + " \t{";
+ protected final String TEXT_774 = NL + "\t\t\tboolean old";
+ protected final String TEXT_775 = "_set_ = eVirtualIsSet(";
+ protected final String TEXT_776 = ");";
+ protected final String TEXT_777 = NL + "\t\t\tboolean old";
+ protected final String TEXT_778 = "_set_ = (";
+ protected final String TEXT_779 = " & ";
+ protected final String TEXT_780 = "_ESETFLAG) != 0;";
+ protected final String TEXT_781 = NL + "\t\t\t";
+ protected final String TEXT_782 = " &= ~";
+ protected final String TEXT_783 = "_ESETFLAG;";
+ protected final String TEXT_784 = NL + "\t\t\tboolean old";
+ protected final String TEXT_785 = "_set_ = ";
+ protected final String TEXT_786 = "_set_;";
+ protected final String TEXT_787 = NL + "\t\t\t";
+ protected final String TEXT_788 = "_set_ = false;";
+ protected final String TEXT_789 = NL + "\t\t\tif (isNotifying())" + NL + "\t\t\t\tnotify(ChangeKind.UNSET, ";
+ protected final String TEXT_790 = ", null, null, old";
+ protected final String TEXT_791 = "_set_);";
+ protected final String TEXT_792 = NL + " \t}";
+ protected final String TEXT_793 = NL + "\t\t";
+ protected final String TEXT_794 = " old";
+ protected final String TEXT_795 = " = (";
+ protected final String TEXT_796 = " & ";
+ protected final String TEXT_797 = "_EFLAG) != 0;";
+ protected final String TEXT_798 = NL + "\t\tObject old";
+ protected final String TEXT_799 = " = eVirtualUnset(";
+ protected final String TEXT_800 = ");";
+ protected final String TEXT_801 = NL + "\t\t";
+ protected final String TEXT_802 = " old";
+ protected final String TEXT_803 = " = ";
+ protected final String TEXT_804 = ";";
+ protected final String TEXT_805 = NL + "\t\tboolean isSetChange = old";
+ protected final String TEXT_806 = " != EVIRTUAL_NO_VALUE;";
+ protected final String TEXT_807 = NL + "\t\tboolean old";
+ protected final String TEXT_808 = "_set_ = (";
+ protected final String TEXT_809 = " & ";
+ protected final String TEXT_810 = "_ESETFLAG) != 0;";
+ protected final String TEXT_811 = NL + "\t\tboolean old";
+ protected final String TEXT_812 = "_set_ = ";
+ protected final String TEXT_813 = "_set_;";
+ protected final String TEXT_814 = NL + "\t\t";
+ protected final String TEXT_815 = " = null;";
+ protected final String TEXT_816 = NL + "\t\t";
+ protected final String TEXT_817 = " &= ~";
+ protected final String TEXT_818 = "_ESETFLAG;";
+ protected final String TEXT_819 = NL + "\t\t";
+ protected final String TEXT_820 = "_set_ = false;";
+ protected final String TEXT_821 = NL + "\t\tif (isNotifying())" + NL + "\t\t\tnotify(ChangeKind.UNSET, ";
+ protected final String TEXT_822 = ", ";
+ protected final String TEXT_823 = "isSetChange ? old";
+ protected final String TEXT_824 = " : null";
+ protected final String TEXT_825 = "old";
+ protected final String TEXT_826 = ", null, ";
+ protected final String TEXT_827 = "isSetChange";
+ protected final String TEXT_828 = "old";
+ protected final String TEXT_829 = "_set_";
+ protected final String TEXT_830 = ");";
+ protected final String TEXT_831 = NL + "\t\tif (";
+ protected final String TEXT_832 = "_DEFAULT_) ";
+ protected final String TEXT_833 = " |= ";
+ protected final String TEXT_834 = "_EFLAG; else ";
+ protected final String TEXT_835 = " &= ~";
+ protected final String TEXT_836 = "_EFLAG;";
+ protected final String TEXT_837 = NL + "\t\t";
+ protected final String TEXT_838 = " = ";
+ protected final String TEXT_839 = "_DEFAULT_;";
+ protected final String TEXT_840 = NL + "\t\t";
+ protected final String TEXT_841 = " &= ~";
+ protected final String TEXT_842 = "_ESETFLAG;";
+ protected final String TEXT_843 = NL + "\t\t";
+ protected final String TEXT_844 = "_set_ = false;";
+ protected final String TEXT_845 = NL + "\t\tif (isNotifying())" + NL + "\t\t\tnotify(ChangeKind.UNSET, ";
+ protected final String TEXT_846 = ", ";
+ protected final String TEXT_847 = "isSetChange ? old";
+ protected final String TEXT_848 = " : ";
+ protected final String TEXT_849 = "_DEFAULT_";
+ protected final String TEXT_850 = "old";
+ protected final String TEXT_851 = ", ";
+ protected final String TEXT_852 = "_DEFAULT_, ";
+ protected final String TEXT_853 = "isSetChange";
+ protected final String TEXT_854 = "old";
+ protected final String TEXT_855 = "_set_";
+ protected final String TEXT_856 = ");";
+ protected final String TEXT_857 = NL + " unset(get";
+ protected final String TEXT_858 = "(), getType(), INTERNAL_";
+ protected final String TEXT_859 = ");";
+ protected final String TEXT_860 = NL + " unset";
+ protected final String TEXT_861 = "(get";
+ protected final String TEXT_862 = "());";
+ protected final String TEXT_863 = NL + "\t\t// TODO: implement this method to unset the '";
+ protected final String TEXT_864 = "' ";
+ protected final String TEXT_865 = NL + "\t\t// Ensure that you remove @generated or mark it @generated NOT" + NL + "\t\tthrow new UnsupportedOperationException();";
+ protected final String TEXT_866 = NL + "\t}" + NL;
+ protected final String TEXT_867 = NL + "\t/**" + NL + "\t * Returns whether the value of the '{@link ";
+ protected final String TEXT_868 = "#";
+ protected final String TEXT_869 = " <em>";
+ protected final String TEXT_870 = "</em>}' ";
+ protected final String TEXT_871 = " is set." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @return whether the value of the '<em>";
+ protected final String TEXT_872 = "</em>' ";
+ protected final String TEXT_873 = " is set.";
+ protected final String TEXT_874 = NL + "\t * @see #unset";
+ protected final String TEXT_875 = "()";
+ protected final String TEXT_876 = NL + "\t * @see #";
+ protected final String TEXT_877 = "()";
+ protected final String TEXT_878 = NL + "\t * @see #set";
+ protected final String TEXT_879 = "(";
+ protected final String TEXT_880 = ")";
+ protected final String TEXT_881 = NL + "\t * @generated" + NL + "\t */";
+ protected final String TEXT_882 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */";
+ protected final String TEXT_883 = NL + "\tboolean isSet";
+ protected final String TEXT_884 = "();" + NL;
+ protected final String TEXT_885 = NL + "\tpublic boolean isSet";
+ protected final String TEXT_886 = "()" + NL + "\t{";
+ protected final String TEXT_887 = NL + "\t\treturn isSet(";
+ protected final String TEXT_888 = ");";
+ protected final String TEXT_889 = NL + "\t\t";
+ protected final String TEXT_890 = " ";
+ protected final String TEXT_891 = " = (";
+ protected final String TEXT_892 = ")eVirtualGet(";
+ protected final String TEXT_893 = ");";
+ protected final String TEXT_894 = NL + "\t\treturn ";
+ protected final String TEXT_895 = " != null && ((";
+ protected final String TEXT_896 = ".Unsettable)";
+ protected final String TEXT_897 = ").isSet();";
+ protected final String TEXT_898 = NL + "\t\treturn eVirtualIsSet(";
+ protected final String TEXT_899 = ");";
+ protected final String TEXT_900 = NL + "\t\treturn (";
+ protected final String TEXT_901 = " & ";
+ protected final String TEXT_902 = "_ESETFLAG) != 0;";
+ protected final String TEXT_903 = NL + "\t\treturn ";
+ protected final String TEXT_904 = "_set_;";
+ protected final String TEXT_905 = NL + " return isSet(get";
+ protected final String TEXT_906 = "(), getType(), INTERNAL_";
+ protected final String TEXT_907 = ");";
+ protected final String TEXT_908 = NL + "\t\treturn !((";
+ protected final String TEXT_909 = ".Internal)get";
+ protected final String TEXT_910 = "()).isEmpty(";
+ protected final String TEXT_911 = ");";
+ protected final String TEXT_912 = NL + "\t\t// TODO: implement this method to return whether the '";
+ protected final String TEXT_913 = "' ";
+ protected final String TEXT_914 = " is set" + NL + "\t\t// Ensure that you remove @generated or mark it @generated NOT" + NL + "\t\tthrow new UnsupportedOperationException();";
+ protected final String TEXT_915 = NL + "\t}" + NL;
+ protected final String TEXT_916 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->";
+ protected final String TEXT_917 = NL + "\t * <!-- begin-model-doc -->" + NL + "\t * ";
+ protected final String TEXT_918 = NL + "\t * <!-- end-model-doc -->";
+ protected final String TEXT_919 = NL + "\t * @model ";
+ protected final String TEXT_920 = NL + "\t * ";
+ protected final String TEXT_921 = NL + "\t * @model";
+ protected final String TEXT_922 = NL + "\t * @generated" + NL + "\t */";
+ protected final String TEXT_923 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */";
+ protected final String TEXT_924 = NL + "\t";
+ protected final String TEXT_925 = " ";
+ protected final String TEXT_926 = "(";
+ protected final String TEXT_927 = ")";
+ protected final String TEXT_928 = ";" + NL;
+ protected final String TEXT_929 = NL + "\tpublic ";
+ protected final String TEXT_930 = " ";
+ protected final String TEXT_931 = "(";
+ protected final String TEXT_932 = ")";
+ protected final String TEXT_933 = NL + "\t{";
+ protected final String TEXT_934 = NL + "\t\t";
+ protected final String TEXT_935 = NL + "\t\t// TODO: implement this method" + NL + "\t\t// -> specify the condition that violates the invariant" + NL + "\t\t// -> verify the details of the diagnostic, including severity and message" + NL + "\t\t// Ensure that you remove @generated or mark it @generated NOT" + NL + "\t\tif (false)" + NL + "\t\t{" + NL + "\t\t\tif (";
+ protected final String TEXT_936 = " != null)" + NL + "\t\t\t{" + NL + "\t\t\t\t";
+ protected final String TEXT_937 = ".add" + NL + "\t\t\t\t\t(new ";
+ protected final String TEXT_938 = NL + "\t\t\t\t\t\t(";
+ protected final String TEXT_939 = ".ERROR," + NL + "\t\t\t\t\t\t ";
+ protected final String TEXT_940 = ".DIAGNOSTIC_SOURCE," + NL + "\t\t\t\t\t\t ";
+ protected final String TEXT_941 = ".";
+ protected final String TEXT_942 = "," + NL + "\t\t\t\t\t\t ";
+ protected final String TEXT_943 = ".INSTANCE.getString(\"_UI_GenericInvariant_diagnostic\", new Object[] { \"";
+ protected final String TEXT_944 = "\", ";
+ protected final String TEXT_945 = ".getObjectLabel(this, ";
+ protected final String TEXT_946 = ") }),";
+ protected final String TEXT_947 = NL + "\t\t\t\t\t\t new Object [] { this }));" + NL + "\t\t\t}" + NL + "\t\t\treturn false;" + NL + "\t\t}" + NL + "\t\treturn true;";
+ protected final String TEXT_948 = NL + "\t\t// TODO: implement this method" + NL + "\t\t// Ensure that you remove @generated or mark it @generated NOT" + NL + "\t\tthrow new UnsupportedOperationException();";
+ protected final String TEXT_949 = NL + "\t}" + NL;
+ protected final String TEXT_950 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ChangeContext eInverseAdd(";
+ protected final String TEXT_951 = " otherEnd, int propertyIndex, ChangeContext changeContext)" + NL + "\t{" + NL + "\t\tswitch (propertyIndex)" + NL + "\t\t{";
+ protected final String TEXT_952 = NL + "\t\t\tcase ";
+ protected final String TEXT_953 = ":";
+ protected final String TEXT_954 = NL + "\t\t\t\treturn ((";
+ protected final String TEXT_955 = ")((";
+ protected final String TEXT_956 = ".InternalMapView)";
+ protected final String TEXT_957 = "()).eMap()).basicAdd(otherEnd, changeContext);";
+ protected final String TEXT_958 = NL + "\t\t\t\treturn ((";
+ protected final String TEXT_959 = ")";
+ protected final String TEXT_960 = "()).basicAdd(otherEnd, changeContext);";
+ protected final String TEXT_961 = NL + "\t\t\t\tif (eInternalContainer() != null)" + NL + "\t\t\t\t\tchangeContext = eBasicRemoveFromContainer(changeContext);" + NL + "\t\t\t\treturn eBasicSetContainer(otherEnd, ";
+ protected final String TEXT_962 = ", changeContext);";
+ protected final String TEXT_963 = NL + "\t\t\t\t";
+ protected final String TEXT_964 = " ";
+ protected final String TEXT_965 = " = (";
+ protected final String TEXT_966 = ")eVirtualGet(";
+ protected final String TEXT_967 = ");";
+ protected final String TEXT_968 = NL + "\t\t\t\tif (";
+ protected final String TEXT_969 = " != null)";
+ protected final String TEXT_970 = NL + "\t\t\t\t\tchangeContext = ((";
+ protected final String TEXT_971 = ")";
+ protected final String TEXT_972 = ").inverseRemove(this, EOPPOSITE_FEATURE_BASE - ";
+ protected final String TEXT_973 = ", null, changeContext);";
+ protected final String TEXT_974 = NL + "\t\t\t\t\tchangeContext = ((";
+ protected final String TEXT_975 = ")";
+ protected final String TEXT_976 = ").inverseRemove(this, ";
+ protected final String TEXT_977 = ", ";
+ protected final String TEXT_978 = ".class, changeContext);";
+ protected final String TEXT_979 = NL + "\t\t\t\treturn basicSet";
+ protected final String TEXT_980 = "((";
+ protected final String TEXT_981 = ")otherEnd, changeContext);";
+ protected final String TEXT_982 = NL + "\t\t}";
+ protected final String TEXT_983 = NL + "\t\treturn super.eInverseAdd(otherEnd, propertyIndex, changeContext);";
+ protected final String TEXT_984 = NL + "\t\treturn eDynamicInverseAdd(otherEnd, propertyIndex, changeContext);";
+ protected final String TEXT_985 = NL + "\t}" + NL;
+ protected final String TEXT_986 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ChangeContext inverseRemove(";
+ protected final String TEXT_987 = " otherEnd, int propertyIndex, ChangeContext changeContext)" + NL + "\t{" + NL + "\t\tswitch (propertyIndex)" + NL + "\t\t{";
+ protected final String TEXT_988 = NL + "\t\t\tcase ";
+ protected final String TEXT_989 = ":";
+ protected final String TEXT_990 = NL + "\t\t\t\treturn ((";
+ protected final String TEXT_991 = ")((";
+ protected final String TEXT_992 = ".InternalMapView)";
+ protected final String TEXT_993 = "()).eMap()).basicRemove(otherEnd, changeContext);";
+ protected final String TEXT_994 = NL + "\t\t\t\treturn removeFrom";
+ protected final String TEXT_995 = "(";
+ protected final String TEXT_996 = "(), otherEnd, changeContext);";
+ protected final String TEXT_997 = NL + "\t\t\t\treturn removeFromList(";
+ protected final String TEXT_998 = "(), otherEnd, changeContext);";
+ protected final String TEXT_999 = NL + "\t\t\t\treturn eBasicSetContainer(null, ";
+ protected final String TEXT_1000 = ", changeContext);";
+ protected final String TEXT_1001 = NL + "\t\t\t\treturn basicUnset";
+ protected final String TEXT_1002 = "(changeContext);";
+ protected final String TEXT_1003 = NL + "\t\t\t\treturn basicSet";
+ protected final String TEXT_1004 = "(null, changeContext);";
+ protected final String TEXT_1005 = NL + "\t\t}";
+ protected final String TEXT_1006 = NL + "\t\treturn super.inverseRemove(otherEnd, propertyIndex, changeContext);";
+ protected final String TEXT_1007 = NL + "\t\treturn eDynamicInverseRemove(otherEnd, propertyIndex, changeContext);";
+ protected final String TEXT_1008 = NL + "\t}" + NL;
+ protected final String TEXT_1009 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ChangeContext eBasicRemoveFromContainerFeature(ChangeContext changeContext)" + NL + "\t{" + NL + "\t\tswitch (eContainerFeatureID)" + NL + "\t\t{";
+ protected final String TEXT_1010 = NL + "\t\t\tcase ";
+ protected final String TEXT_1011 = ":" + NL + "\t\t\t\treturn eInternalContainer().inverseRemove(this, ";
+ protected final String TEXT_1012 = ", ";
+ protected final String TEXT_1013 = ".class, changeContext);";
+ protected final String TEXT_1014 = NL + "\t\t}";
+ protected final String TEXT_1015 = NL + "\t\treturn super.eBasicRemoveFromContainerFeature(changeContext);";
+ protected final String TEXT_1016 = NL + "\t\treturn eDynamicBasicRemoveFromContainer(changeContext);";
+ protected final String TEXT_1017 = NL + "\t}" + NL;
+ protected final String TEXT_1018 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Object get(int propertyIndex, boolean resolve)" + NL + "\t{" + NL + "\t\tswitch (propertyIndex)" + NL + "\t\t{";
+ protected final String TEXT_1019 = NL + "\t\t\tcase ";
+ protected final String TEXT_1020 = ":";
+ protected final String TEXT_1021 = NL + "\t\t\t\treturn ";
+ protected final String TEXT_1022 = "() ? Boolean.TRUE : Boolean.FALSE;";
+ protected final String TEXT_1023 = NL + "\t\t\t\treturn new ";
+ protected final String TEXT_1024 = "(";
+ protected final String TEXT_1025 = "());";
+ protected final String TEXT_1026 = NL + "\t\t\t\tif (resolve) return ";
+ protected final String TEXT_1027 = "();" + NL + "\t\t\t\treturn basicGet";
+ protected final String TEXT_1028 = "();";
+ protected final String TEXT_1029 = NL + "\t\t\t\tif (coreType) return ((";
+ protected final String TEXT_1030 = ".InternalMapView)";
+ protected final String TEXT_1031 = "()).eMap();" + NL + "\t\t\t\telse return ";
+ protected final String TEXT_1032 = "();";
+ protected final String TEXT_1033 = NL + "\t\t\t\tif (coreType) return ";
+ protected final String TEXT_1034 = "();" + NL + "\t\t\t\telse return ";
+ protected final String TEXT_1035 = "().map();";
+ protected final String TEXT_1036 = NL + "\t\t\t\t// XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view" + NL + "\t\t\t\t//if (coreType) " + NL + "\t\t\t\treturn ";
+ protected final String TEXT_1037 = "();";
+ protected final String TEXT_1038 = NL + "\t\t\t\tif (coreType) return ";
+ protected final String TEXT_1039 = "();" + NL + "\t\t\t\treturn ((";
+ protected final String TEXT_1040 = ".Internal)";
+ protected final String TEXT_1041 = "()).getWrapper();";
+ protected final String TEXT_1042 = NL + "\t\t\t\treturn ";
+ protected final String TEXT_1043 = "();";
+ protected final String TEXT_1044 = NL + "\t\t}";
+ protected final String TEXT_1045 = NL + "\t\treturn super.get(propertyIndex, resolve);";
+ protected final String TEXT_1046 = NL + "\t\treturn eDynamicGet(propertyIndex, resolve, coreType);";
+ protected final String TEXT_1047 = NL + "\t}" + NL;
+ protected final String TEXT_1048 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void set(int propertyIndex, Object newValue)" + NL + "\t{" + NL + "\t\tswitch (propertyIndex)" + NL + "\t\t{";
+ protected final String TEXT_1049 = NL + "\t\t\tcase ";
+ protected final String TEXT_1050 = ":";
+ protected final String TEXT_1051 = NL + " \tset";
+ protected final String TEXT_1052 = "(";
+ protected final String TEXT_1053 = "(), newValue);";
+ protected final String TEXT_1054 = NL + "\t\t\t\t((";
+ protected final String TEXT_1055 = ".Internal)";
+ protected final String TEXT_1056 = "()).set(newValue);";
+ protected final String TEXT_1057 = NL + "\t\t\t\t((";
+ protected final String TEXT_1058 = ".Setting)((";
+ protected final String TEXT_1059 = ".InternalMapView)";
+ protected final String TEXT_1060 = "()).eMap()).set(newValue);";
+ protected final String TEXT_1061 = NL + "\t\t\t\t((";
+ protected final String TEXT_1062 = ".Setting)";
+ protected final String TEXT_1063 = "()).set(newValue);";
+ protected final String TEXT_1064 = NL + "\t\t\t\t";
+ protected final String TEXT_1065 = "().clear();" + NL + "\t\t\t\t";
+ protected final String TEXT_1066 = "().addAll((";
+ protected final String TEXT_1067 = ")newValue);";
+ protected final String TEXT_1068 = NL + "\t\t\t\tset";
+ protected final String TEXT_1069 = "(((";
+ protected final String TEXT_1070 = ")newValue).";
+ protected final String TEXT_1071 = "());";
+ protected final String TEXT_1072 = NL + "\t\t\t\tset";
+ protected final String TEXT_1073 = "((";
+ protected final String TEXT_1074 = ")newValue);";
+ protected final String TEXT_1075 = NL + "\t\t\t\treturn;";
+ protected final String TEXT_1076 = NL + "\t\t}";
+ protected final String TEXT_1077 = NL + "\t\tsuper.set(propertyIndex, newValue);";
+ protected final String TEXT_1078 = NL + "\t\teDynamicSet(propertyIndex, newValue);";
+ protected final String TEXT_1079 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void unset(int propertyIndex)" + NL + "\t{" + NL + "\t\tswitch (propertyIndex)" + NL + "\t\t{";
+ protected final String TEXT_1080 = NL + "\t\t\tcase ";
+ protected final String TEXT_1081 = ":";
+ protected final String TEXT_1082 = NL + "\t\t\t\tunset";
+ protected final String TEXT_1083 = "(";
+ protected final String TEXT_1084 = "());";
+ protected final String TEXT_1085 = NL + "\t\t\t\t";
+ protected final String TEXT_1086 = "().clear();";
+ protected final String TEXT_1087 = NL + "\t\t\t\tunset";
+ protected final String TEXT_1088 = "();";
+ protected final String TEXT_1089 = NL + "\t\t\t\tset";
+ protected final String TEXT_1090 = "((";
+ protected final String TEXT_1091 = ")null);";
+ protected final String TEXT_1092 = NL + "\t\t\t\tset";
+ protected final String TEXT_1093 = "(";
+ protected final String TEXT_1094 = "_DEFAULT_);";
+ protected final String TEXT_1095 = NL + "\t\t\t\treturn;";
+ protected final String TEXT_1096 = NL + "\t\t}";
+ protected final String TEXT_1097 = NL + "\t\tsuper.unset(propertyIndex);";
+ protected final String TEXT_1098 = NL + "\t\teDynamicUnset(propertyIndex);";
+ protected final String TEXT_1099 = NL + "\t}" + NL;
+ protected final String TEXT_1100 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic boolean isSet(int propertyIndex)" + NL + "\t{" + NL + "\t\tswitch (propertyIndex)" + NL + "\t\t{";
+ protected final String TEXT_1101 = NL + "\t\t\tcase ";
+ protected final String TEXT_1102 = ":";
+ protected final String TEXT_1103 = NL + "\t\t\t\treturn !is";
+ protected final String TEXT_1104 = "Empty(";
+ protected final String TEXT_1105 = "());";
+ protected final String TEXT_1106 = NL + "\t\t\t\treturn ";
+ protected final String TEXT_1107 = " != null && !is";
+ protected final String TEXT_1108 = "Empty(";
+ protected final String TEXT_1109 = "());";
+ protected final String TEXT_1110 = NL + "\t\t\t\treturn ";
+ protected final String TEXT_1111 = " != null && !";
+ protected final String TEXT_1112 = ".isEmpty();";
+ protected final String TEXT_1113 = NL + "\t\t\t\t";
+ protected final String TEXT_1114 = " ";
+ protected final String TEXT_1115 = " = (";
+ protected final String TEXT_1116 = ")eVirtualGet(";
+ protected final String TEXT_1117 = ");" + NL + "\t\t\t\treturn ";
+ protected final String TEXT_1118 = " != null && !";
+ protected final String TEXT_1119 = ".isEmpty();";
+ protected final String TEXT_1120 = NL + "\t\t\t\treturn !";
+ protected final String TEXT_1121 = "().isEmpty();";
+ protected final String TEXT_1122 = NL + "\t\t\t\treturn isSet";
+ protected final String TEXT_1123 = "();";
+ protected final String TEXT_1124 = NL + "\t\t\t\treturn ";
+ protected final String TEXT_1125 = " != null;";
+ protected final String TEXT_1126 = NL + "\t\t\t\treturn eVirtualGet(";
+ protected final String TEXT_1127 = ") != null;";
+ protected final String TEXT_1128 = NL + "\t\t\t\treturn basicGet";
+ protected final String TEXT_1129 = "() != null;";
+ protected final String TEXT_1130 = NL + "\t\t\t\treturn ";
+ protected final String TEXT_1131 = " != null;";
+ protected final String TEXT_1132 = NL + "\t\t\t\treturn eVirtualGet(";
+ protected final String TEXT_1133 = ") != null;";
+ protected final String TEXT_1134 = NL + "\t\t\t\treturn ";
+ protected final String TEXT_1135 = "() != null;";
+ protected final String TEXT_1136 = NL + "\t\t\t\treturn ((";
+ protected final String TEXT_1137 = " & ";
+ protected final String TEXT_1138 = "_EFLAG) != 0) != ";
+ protected final String TEXT_1139 = "_DEFAULT_;";
+ protected final String TEXT_1140 = NL + "\t\t\t\treturn ";
+ protected final String TEXT_1141 = " != ";
+ protected final String TEXT_1142 = "_DEFAULT_;";
+ protected final String TEXT_1143 = NL + "\t\t\t\treturn eVirtualGet(";
+ protected final String TEXT_1144 = ", ";
+ protected final String TEXT_1145 = "_DEFAULT_) != ";
+ protected final String TEXT_1146 = "_DEFAULT_;";
+ protected final String TEXT_1147 = NL + "\t\t\t\treturn ";
+ protected final String TEXT_1148 = "() != ";
+ protected final String TEXT_1149 = "_DEFAULT_;";
+ protected final String TEXT_1150 = NL + "\t\t\t\treturn ";
+ protected final String TEXT_1151 = "_DEFAULT_ == null ? ";
+ protected final String TEXT_1152 = " != null : !";
+ protected final String TEXT_1153 = "_DEFAULT_.equals(";
+ protected final String TEXT_1154 = ");";
+ protected final String TEXT_1155 = NL + "\t\t\t\t";
+ protected final String TEXT_1156 = " ";
+ protected final String TEXT_1157 = " = (";
+ protected final String TEXT_1158 = ")eVirtualGet(";
+ protected final String TEXT_1159 = ", ";
+ protected final String TEXT_1160 = "_DEFAULT_);" + NL + "\t\t\t\treturn ";
+ protected final String TEXT_1161 = "_DEFAULT_ == null ? ";
+ protected final String TEXT_1162 = " != null : !";
+ protected final String TEXT_1163 = "_DEFAULT_.equals(";
+ protected final String TEXT_1164 = ");";
+ protected final String TEXT_1165 = NL + "\t\t\t\treturn ";
+ protected final String TEXT_1166 = "_DEFAULT_ == null ? ";
+ protected final String TEXT_1167 = "() != null : !";
+ protected final String TEXT_1168 = "_DEFAULT_.equals(";
+ protected final String TEXT_1169 = "());";
+ protected final String TEXT_1170 = NL + "\t\t}";
+ protected final String TEXT_1171 = NL + "\t\treturn super.isSet(propertyIndex);";
+ protected final String TEXT_1172 = NL + "\t\treturn eDynamicIsSet(propertyIndex);";
+ protected final String TEXT_1173 = NL + "\t}" + NL;
+ protected final String TEXT_1174 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass)" + NL + "\t{";
+ protected final String TEXT_1175 = NL + "\t\tif (baseClass == ";
+ protected final String TEXT_1176 = ".class)" + NL + "\t\t{" + NL + "\t\t\tswitch (derivedFeatureID)" + NL + "\t\t\t{";
+ protected final String TEXT_1177 = NL + "\t\t\t\tcase ";
+ protected final String TEXT_1178 = ": return ";
+ protected final String TEXT_1179 = ";";
+ protected final String TEXT_1180 = NL + "\t\t\t\tdefault: return -1;" + NL + "\t\t\t}" + NL + "\t\t}";
+ protected final String TEXT_1181 = NL + "\t\treturn super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass)" + NL + "\t{";
+ protected final String TEXT_1182 = NL + "\t\tif (baseClass == ";
+ protected final String TEXT_1183 = ".class)" + NL + "\t\t{" + NL + "\t\t\tswitch (baseFeatureID)" + NL + "\t\t\t{";
+ protected final String TEXT_1184 = NL + "\t\t\t\tcase ";
+ protected final String TEXT_1185 = ": return ";
+ protected final String TEXT_1186 = ";";
+ protected final String TEXT_1187 = NL + "\t\t\t\tdefault: return -1;" + NL + "\t\t\t}" + NL + "\t\t}";
+ protected final String TEXT_1188 = NL + "\t\treturn super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);" + NL + "\t}" + NL;
+ protected final String TEXT_1189 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected Object[] eVirtualValues()" + NL + "\t{" + NL + "\t\treturn ";
+ protected final String TEXT_1190 = ";" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void setVirtualValues(Object[] newValues)" + NL + "\t{" + NL + "\t\t";
+ protected final String TEXT_1191 = " = newValues;" + NL + "\t}" + NL;
+ protected final String TEXT_1192 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected int eVirtualIndexBits(int offset)" + NL + "\t{" + NL + "\t\tswitch (offset)" + NL + "\t\t{";
+ protected final String TEXT_1193 = NL + "\t\t\tcase ";
+ protected final String TEXT_1194 = " :" + NL + "\t\t\t\treturn ";
+ protected final String TEXT_1195 = ";";
+ protected final String TEXT_1196 = NL + "\t\t\tdefault :" + NL + "\t\t\t\tthrow new IndexOutOfBoundsException();" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void setVirtualIndexBits(int offset, int newIndexBits)" + NL + "\t{" + NL + "\t\tswitch (offset)" + NL + "\t\t{";
+ protected final String TEXT_1197 = NL + "\t\t\tcase ";
+ protected final String TEXT_1198 = " :" + NL + "\t\t\t\t";
+ protected final String TEXT_1199 = " = newIndexBits;" + NL + "\t\t\t\tbreak;";
+ protected final String TEXT_1200 = NL + "\t\t\tdefault :" + NL + "\t\t\t\tthrow new IndexOutOfBoundsException();" + NL + "\t\t}" + NL + "\t}" + NL;
+ protected final String TEXT_1201 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic String toString()" + NL + "\t{" + NL + "\t\tif (isProxy(this)) return super.toString();" + NL + "" + NL + "\t\tStringBuffer result = new StringBuffer(super.toString());";
+ protected final String TEXT_1202 = NL + "\t\tresult.append(\" (";
+ protected final String TEXT_1203 = ": \");";
+ protected final String TEXT_1204 = NL + "\t\tresult.append(\", ";
+ protected final String TEXT_1205 = ": \");";
+ protected final String TEXT_1206 = NL + "\t\tif (eVirtualIsSet(";
+ protected final String TEXT_1207 = ")) result.append(eVirtualGet(";
+ protected final String TEXT_1208 = ")); else result.append(\"<unset>\");";
+ protected final String TEXT_1209 = NL + "\t\tif (";
+ protected final String TEXT_1210 = "(";
+ protected final String TEXT_1211 = " & ";
+ protected final String TEXT_1212 = "_ESETFLAG) != 0";
+ protected final String TEXT_1213 = "_set_";
+ protected final String TEXT_1214 = ") result.append((";
+ protected final String TEXT_1215 = " & ";
+ protected final String TEXT_1216 = "_EFLAG) != 0); else result.append(\"<unset>\");";
+ protected final String TEXT_1217 = NL + "\t\tif (";
+ protected final String TEXT_1218 = "(";
+ protected final String TEXT_1219 = " & ";
+ protected final String TEXT_1220 = "_ESETFLAG) != 0";
+ protected final String TEXT_1221 = "_set_";
+ protected final String TEXT_1222 = ") result.append(";
+ protected final String TEXT_1223 = "); else result.append(\"<unset>\");";
+ protected final String TEXT_1224 = NL + "\t\tresult.append(eVirtualGet(";
+ protected final String TEXT_1225 = ", ";
+ protected final String TEXT_1226 = "_DEFAULT_";
+ protected final String TEXT_1227 = "));";
+ protected final String TEXT_1228 = NL + "\t\tresult.append((";
+ protected final String TEXT_1229 = " & ";
+ protected final String TEXT_1230 = "_EFLAG) != 0);";
+ protected final String TEXT_1231 = NL + "\t\tresult.append(";
+ protected final String TEXT_1232 = ");";
+ protected final String TEXT_1233 = NL + "\t\tresult.append(')');" + NL + "\t\treturn result.toString();" + NL + "\t}" + NL;
+ protected final String TEXT_1234 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected int hash = -1;" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + " \t * @generated" + NL + " \t */" + NL + "\tpublic int getHash()" + NL + "\t{" + NL + "\t\tif (hash == -1)" + NL + "\t\t{" + NL + "\t\t\tObject theKey = getKey();" + NL + "\t\t\thash = (theKey == null ? 0 : theKey.hashCode());" + NL + "\t\t}" + NL + "\t\treturn hash;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + " \t * <!-- begin-user-doc -->" + NL + " \t * <!-- end-user-doc -->" + NL + " \t * @generated" + NL + " \t */" + NL + "\tpublic void setHash(int hash)" + NL + "\t{" + NL + "\t\tthis.hash = hash;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + " \t * <!-- begin-user-doc -->" + NL + " \t * <!-- end-user-doc -->" + NL + " \t * @generated" + NL + " \t */" + NL + "\tpublic Object getKey()" + NL + "\t{" + NL + " \t";
+ protected final String TEXT_1235 = NL + "\t\treturn new ";
+ protected final String TEXT_1236 = "(getTypedKey());" + NL + " \t";
+ protected final String TEXT_1237 = NL + "\t\treturn getTypedKey();" + NL + " \t";
+ protected final String TEXT_1238 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void setKey(Object key)" + NL + "\t{";
+ protected final String TEXT_1239 = NL + "\t\tgetTypedKey().addAll((";
+ protected final String TEXT_1240 = ")key);";
+ protected final String TEXT_1241 = NL + "\t\tsetTypedKey(((";
+ protected final String TEXT_1242 = ")key).";
+ protected final String TEXT_1243 = "());";
+ protected final String TEXT_1244 = NL + "\t\tsetTypedKey((";
+ protected final String TEXT_1245 = ")key);";
+ protected final String TEXT_1246 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Object getValue()" + NL + "\t{" + NL + " \t";
+ protected final String TEXT_1247 = NL + "\t\treturn new ";
+ protected final String TEXT_1248 = "(getTypedValue());" + NL + " \t";
+ protected final String TEXT_1249 = NL + "\t\treturn getTypedValue();" + NL + " \t";
+ protected final String TEXT_1250 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Object setValue(Object value)" + NL + "\t{" + NL + "\t\tObject oldValue = getValue();" + NL + " \t";
+ protected final String TEXT_1251 = NL + "\t\tgetTypedValue().clear();" + NL + "\t\tgetTypedValue().addAll((";
+ protected final String TEXT_1252 = ")value);" + NL + " \t";
+ protected final String TEXT_1253 = NL + "\t\tsetTypedValue(((";
+ protected final String TEXT_1254 = ")value).";
+ protected final String TEXT_1255 = "());" + NL + " \t";
+ protected final String TEXT_1256 = NL + "\t\tsetTypedValue((";
+ protected final String TEXT_1257 = ")value);" + NL + " \t";
+ protected final String TEXT_1258 = NL + "\t\treturn oldValue;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
+ protected final String TEXT_1259 = " getEMap()" + NL + "\t{" + NL + "\t\t";
+ protected final String TEXT_1260 = " container = eContainer();" + NL + "\t\treturn container == null ? null : (";
+ protected final String TEXT_1261 = ")container.get(eContainmentFeature());" + NL + "\t}";
+ protected final String TEXT_1262 = NL + "} //";
+ protected final String TEXT_1263 = NL;
+
+ public String generate(Object argument)
+ {
+ final StringBuffer stringBuffer = new StringBuffer();
+
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+ GenClass genClass = (GenClass)((Object[])argument)[0]; GenPackage genPackage = genClass.getGenPackage(); GenModel genModel=genPackage.getGenModel();
+ boolean isInterface = Boolean.TRUE.equals(((Object[])argument)[1]); boolean isImplementation = Boolean.TRUE.equals(((Object[])argument)[2]);
+ boolean isDebug = false;
+ String publicStaticFinalFlag = isImplementation ? "public static final " : "";
+ /*
+ * Output preamble and javadoc header
+ */
+ stringBuffer.append(TEXT_1);
+ stringBuffer.append(TEXT_2);
+ stringBuffer.append("$");
+ stringBuffer.append(TEXT_3);
+ stringBuffer.append("$");
+ stringBuffer.append(TEXT_4);
+ if (isInterface) {
+ stringBuffer.append(TEXT_5);
+ stringBuffer.append(genPackage.getInterfacePackageName());
+ stringBuffer.append(TEXT_6);
+ } else {
+ stringBuffer.append(TEXT_7);
+ stringBuffer.append(genPackage.getClassPackageName());
+ stringBuffer.append(TEXT_8);
+ }
+ stringBuffer.append(TEXT_9);
+ genModel.markImportLocation(stringBuffer, genPackage);
+ stringBuffer.append(TEXT_10);
+ if (isDebug) { // EYECATCHER 1
+ stringBuffer.append(TEXT_11);
+ }
+ if (isInterface) {
+ stringBuffer.append(TEXT_12);
+ stringBuffer.append(genClass.getFormattedName());
+ stringBuffer.append(TEXT_13);
+ if (genClass.hasDocumentation()) {
+ stringBuffer.append(TEXT_14);
+ stringBuffer.append(genClass.getDocumentation(genModel.getIndentation(stringBuffer)));
+ stringBuffer.append(TEXT_15);
+ }
+ stringBuffer.append(TEXT_16);
+ if (!genClass.getGenFeatures().isEmpty()) {
+ stringBuffer.append(TEXT_17);
+ for (Iterator i=genClass.getGenFeatures().iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();
+ if (!genFeature.isSuppressedGetVisibility()) {
+ stringBuffer.append(TEXT_18);
+ stringBuffer.append(genClass.getQualifiedInterfaceName());
+ stringBuffer.append(TEXT_19);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_20);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_21);
+ }
+ }
+ stringBuffer.append(TEXT_22);
+ }
+ stringBuffer.append(TEXT_23);
+ if (!genModel.isSuppressEMFMetaData()) {
+ stringBuffer.append(TEXT_24);
+ stringBuffer.append(genPackage.getQualifiedPackageInterfaceName());
+ stringBuffer.append(TEXT_25);
+ stringBuffer.append(genClass.getClassifierAccessorName());
+ stringBuffer.append(TEXT_26);
+ }
+ if (!genModel.isSuppressEMFModelTags()) { boolean first = true; for (StringTokenizer stringTokenizer = new StringTokenizer(genClass.getModelInfo(), "\n\r"); stringTokenizer.hasMoreTokens(); ) { String modelInfo = stringTokenizer.nextToken(); if (first) { first = false;
+ stringBuffer.append(TEXT_27);
+ stringBuffer.append(modelInfo);
+ } else {
+ stringBuffer.append(TEXT_28);
+ stringBuffer.append(modelInfo);
+ }} if (first) {
+ stringBuffer.append(TEXT_29);
+ }}
+ if (genClass.needsRootExtendsInterfaceExtendsTag()) { // does it need an @extends tag
+ stringBuffer.append(TEXT_30);
+ stringBuffer.append(genModel.getImportedName(genModel.getRootExtendsInterface()));
+ }
+ stringBuffer.append(TEXT_31);
+ } else {
+ stringBuffer.append(TEXT_32);
+ stringBuffer.append(genClass.getFormattedName());
+ stringBuffer.append(TEXT_33);
+ if (!genClass.getImplementedGenFeatures().isEmpty()) {
+ stringBuffer.append(TEXT_34);
+ for (Iterator i=genClass.getImplementedGenFeatures().iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();
+ stringBuffer.append(TEXT_35);
+ stringBuffer.append(genClass.getQualifiedClassName());
+ stringBuffer.append(TEXT_36);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_37);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_38);
+ }
+ stringBuffer.append(TEXT_39);
+ }
+ stringBuffer.append(TEXT_40);
+ }
+ if (isImplementation) {
+ stringBuffer.append(TEXT_41);
+ if (genClass.isAbstract()) {
+ stringBuffer.append(TEXT_42);
+ }
+ stringBuffer.append(TEXT_43);
+ stringBuffer.append(genClass.getClassName());
+ stringBuffer.append(genClass.getClassExtends());
+ stringBuffer.append(genClass.getClassImplements());
+ } else {
+ stringBuffer.append(TEXT_44);
+ stringBuffer.append(genClass.getInterfaceName());
+ stringBuffer.append(genClass.getInterfaceExtends());
+ }
+ stringBuffer.append(TEXT_45);
+ if (genModel.getCopyrightText() != null) {
+ stringBuffer.append(TEXT_46);
+ stringBuffer.append(publicStaticFinalFlag);
+ stringBuffer.append(genModel.getImportedName("java.lang.String"));
+ stringBuffer.append(TEXT_47);
+ stringBuffer.append(genModel.getCopyrightText());
+ stringBuffer.append(TEXT_48);
+ stringBuffer.append(genModel.getNonNLS());
+ stringBuffer.append(TEXT_49);
+ }
+ if (isImplementation && genModel.getDriverNumber() != null) {
+ stringBuffer.append(TEXT_50);
+ stringBuffer.append(genModel.getImportedName("java.lang.String"));
+ stringBuffer.append(TEXT_51);
+ stringBuffer.append(genModel.getDriverNumber());
+ stringBuffer.append(TEXT_52);
+ stringBuffer.append(genModel.getNonNLS());
+ stringBuffer.append(TEXT_53);
+ }
+ if (isImplementation && genClass.isJavaIOSerializable()) {
+ stringBuffer.append(TEXT_54);
+ }
+ if (isImplementation && genModel.isVirtualDelegation()) { String eVirtualValuesField = genClass.getEVirtualValuesField();
+ if (eVirtualValuesField != null) {
+ stringBuffer.append(TEXT_55);
+ stringBuffer.append(eVirtualValuesField);
+ stringBuffer.append(TEXT_56);
+ }
+ { List eVirtualIndexBitFields = genClass.getEVirtualIndexBitFields(new ArrayList());
+ if (!eVirtualIndexBitFields.isEmpty()) {
+ for (Iterator i = eVirtualIndexBitFields.iterator(); i.hasNext();) { String eVirtualIndexBitField = (String)i.next();
+ stringBuffer.append(TEXT_57);
+ stringBuffer.append(eVirtualIndexBitField);
+ stringBuffer.append(TEXT_58);
+ }
+ }
+ }
+ }
+ if (isImplementation && genClass.isModelRoot() && genModel.isBooleanFlagsEnabled() && genModel.getBooleanFlagsReservedBits() == -1) {
+ stringBuffer.append(TEXT_59);
+ stringBuffer.append(genModel.getBooleanFlagsField());
+ stringBuffer.append(TEXT_60);
+ }
+ if (isImplementation && !genModel.isReflectiveDelegation()) {
+ stringBuffer.append(TEXT_61);
+ ClassImpl classImpl = (ClassImpl) genClass.getEcoreClass();
+ List declaredProperties = classImpl.getDeclaredProperties();
+ List extendedProperties = classImpl.getExtendedProperties();
+ int declaredPropertiesCount = 0;
+ int extendedPropertiesCount = 0;
+ for (Iterator f=genClass.getAllGenFeatures().iterator(); f.hasNext();) { GenFeature genFeature = (GenFeature)f.next();
+ if (declaredProperties.contains(genFeature.getEcoreFeature())){
+ declaredPropertiesCount++;
+ String featureValue = "";
+ List allFeatures = genClass.getAllGenFeatures();
+ int g = allFeatures.indexOf(genFeature);
+ GenClass base = genClass.getBaseGenClass();
+ if (base == null)
+ {
+ featureValue = Integer.toString(declaredProperties.indexOf(genFeature.getEcoreFeature()));
+ } else {
+ int baseCount = base.getFeatureCount();
+ if (g < baseCount)
+ {
+ featureValue = base.getClassName() + "." + genFeature.getUpperName();
+ } else {
+ String baseCountID = base.getClassName() + "." + "SDO_PROPERTY_COUNT";
+ featureValue = baseCountID + " + " + Integer.toString(declaredProperties.indexOf(genFeature.getEcoreFeature()));
+ }
+ }
+ stringBuffer.append(TEXT_62);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_63);
+ stringBuffer.append(featureValue);
+ stringBuffer.append(TEXT_64);
+ } else if (extendedProperties.contains(genFeature.getEcoreFeature())){
+ extendedPropertiesCount++;
+ String featureValue = "";
+ List allFeatures = genClass.getAllGenFeatures();
+ int g = allFeatures.indexOf(genFeature);
+ GenClass base = genClass.getBaseGenClass();
+ if (base == null)
+ {
+ featureValue = Integer.toString(-1 - extendedProperties.indexOf(genFeature.getEcoreFeature()));
+ } else {
+ int baseCount = base.getFeatureCount();
+ if (g < baseCount)
+ {
+ featureValue = base.getClassName() + "." + genFeature.getUpperName();
+ } else {
+ String baseCountID = base.getClassName() + "." + "EXTENDED_PROPERTY_COUNT";
+ featureValue = baseCountID + " + " + Integer.toString(-1 - extendedProperties.indexOf(genFeature.getEcoreFeature()));
+ }
+ }
+ stringBuffer.append(TEXT_65);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_66);
+ stringBuffer.append(featureValue);
+ stringBuffer.append(TEXT_67);
+ }
+ }
+ String featureCount = "";
+ GenClass base = genClass.getBaseGenClass();
+ if (base == null)
+ {
+ featureCount = Integer.toString(declaredPropertiesCount);
+ }
+ else {
+ String baseCountID = base.getClassName() + "." + "SDO_PROPERTY_COUNT";
+ featureCount = baseCountID + " + " + Integer.toString(declaredPropertiesCount);
+ }
+ stringBuffer.append(TEXT_68);
+ stringBuffer.append(featureCount);
+ stringBuffer.append(TEXT_69);
+ featureCount = "";
+ base = genClass.getBaseGenClass();
+ if (base == null)
+ {
+ featureCount = Integer.toString(extendedPropertiesCount*-1);
+ }
+ else {
+ String baseCountID = base.getClassName() + "." + "EXTENDED_PROPERTY_COUNT";
+ featureCount = baseCountID + " - " + Integer.toString(extendedPropertiesCount);
+ }
+ stringBuffer.append(TEXT_70);
+ stringBuffer.append(featureCount);
+ stringBuffer.append(TEXT_71);
+ for (Iterator f=genClass.getAllGenFeatures().iterator(); f.hasNext();) { GenFeature genFeature = (GenFeature)f.next();
+ stringBuffer.append(TEXT_72);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_73);
+ stringBuffer.append(genFeature.getFeatureKind());
+ stringBuffer.append(TEXT_74);
+ String featureValue = "";
+ List allFeatures = genClass.getAllGenFeatures();
+ int g = allFeatures.indexOf(genFeature);
+ base = genClass.getBaseGenClass();
+ if (base == null)
+ {
+ featureValue = Integer.toString(g);
+ } else {
+ int baseCount = base.getFeatureCount();
+ if (g < baseCount)
+ {
+ featureValue = base.getClassName() + "." + genFeature.getUpperName();
+ } else {
+ String baseCountID = base.getClassName() + "." + "INTERNAL_PROPERTY_COUNT";
+ featureValue = baseCountID + " + " + Integer.toString(g - baseCount);
+ }
+ }
+ stringBuffer.append(TEXT_75);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_76);
+ stringBuffer.append(featureValue);
+ stringBuffer.append(TEXT_77);
+ }
+ stringBuffer.append(TEXT_78);
+ featureCount = "";
+ base = genClass.getBaseGenClass();
+ if (base == null)
+ {
+ featureCount = Integer.toString(genClass.getFeatureCount());
+ }
+ else {
+ String baseCountID = base.getClassName() + "." + "INTERNAL_PROPERTY_COUNT";
+ featureCount = baseCountID + " + " + Integer.toString(genClass.getFeatureCount() - base.getFeatureCount());
+ }
+ stringBuffer.append(TEXT_79);
+ stringBuffer.append(featureCount);
+ stringBuffer.append(TEXT_80);
+ for (Iterator f=genClass.getAllGenFeatures().iterator(); f.hasNext();) { GenFeature genFeature = (GenFeature)f.next();
+ stringBuffer.append(TEXT_81);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_82);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_83);
+ }
+ stringBuffer.append(TEXT_84);
+ for (Iterator i=genClass.getDeclaredFieldGenFeatures().iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();
+ if (genFeature.isListType() || genFeature.isReferenceType()) {
+ if (genClass.isField(genFeature)) {
+ stringBuffer.append(TEXT_85);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_86);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_87);
+ stringBuffer.append(genFeature.getFeatureKind());
+ stringBuffer.append(TEXT_88);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_89);
+ stringBuffer.append(genModel.getImportedName(genFeature.getType()));
+ stringBuffer.append(TEXT_90);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_91);
+ }
+ if (genModel.isArrayAccessors() && !genFeature.isFeatureMapType() && !genFeature.isMapType()) {
+ stringBuffer.append(TEXT_92);
+ stringBuffer.append(genFeature.getGetArrayAccessor());
+ stringBuffer.append(TEXT_93);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_94);
+ stringBuffer.append(genFeature.getGetArrayAccessor());
+ stringBuffer.append(TEXT_95);
+ stringBuffer.append(genFeature.getListItemType());
+ stringBuffer.append(TEXT_96);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_97);
+ stringBuffer.append(genFeature.getListItemType());
+ stringBuffer.append(TEXT_98);
+ }
+ } else {
+ if (!genFeature.isVolatile() || !genModel.isReflectiveDelegation() && (!genFeature.hasDelegateFeature() || !genFeature.isUnsettable())) {
+ stringBuffer.append(TEXT_99);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_100);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_101);
+ stringBuffer.append(genFeature.getFeatureKind());
+ stringBuffer.append(TEXT_102);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_103);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_104);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_105);
+ stringBuffer.append(genFeature.getStaticDefaultValue());
+ stringBuffer.append(TEXT_106);
+ stringBuffer.append(genModel.getNonNLS(genFeature.getStaticDefaultValue()));
+ stringBuffer.append(TEXT_107);
+ }
+ if (genClass.isField(genFeature)) {
+ if (genClass.isFlag(genFeature)) {
+ if (genClass.getFlagIndex(genFeature) > 31 && genClass.getFlagIndex(genFeature) % 32 == 0) {
+ stringBuffer.append(TEXT_108);
+ stringBuffer.append(genClass.getFlagsField(genFeature));
+ stringBuffer.append(TEXT_109);
+ }
+ stringBuffer.append(TEXT_110);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_111);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_112);
+ stringBuffer.append(genFeature.getFeatureKind());
+ stringBuffer.append(TEXT_113);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_114);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_115);
+ stringBuffer.append("<< " + genClass.getFlagIndex(genFeature) % 32 );
+ stringBuffer.append(TEXT_116);
+ } else {
+ stringBuffer.append(TEXT_117);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_118);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_119);
+ stringBuffer.append(genFeature.getFeatureKind());
+ stringBuffer.append(TEXT_120);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_121);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_122);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_123);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_124);
+ }
+ }
+ }
+ if (genClass.isESetField(genFeature)) {
+ if (genClass.isESetFlag(genFeature)) {
+ if (genClass.getESetFlagIndex(genFeature) > 31 && genClass.getESetFlagIndex(genFeature) % 32 == 0) {
+ stringBuffer.append(TEXT_125);
+ stringBuffer.append(genClass.getESetFlagsField(genFeature));
+ stringBuffer.append(TEXT_126);
+ }
+ stringBuffer.append(TEXT_127);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_128);
+ stringBuffer.append(genFeature.getFeatureKind());
+ stringBuffer.append(TEXT_129);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_130);
+ stringBuffer.append("<< " + genClass.getESetFlagIndex(genFeature) % 32 );
+ stringBuffer.append(TEXT_131);
+ } else {
+ stringBuffer.append(TEXT_132);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_133);
+ stringBuffer.append(genFeature.getFeatureKind());
+ stringBuffer.append(TEXT_134);
+ stringBuffer.append(genFeature.getUncapName());
+ stringBuffer.append(TEXT_135);
+ }
+ }
+ }
+ //Class/declaredFieldGenFeature.override.javajetinc
+ }
+ if (isImplementation) { // create constructor
+ stringBuffer.append(TEXT_136);
+ stringBuffer.append(genClass.getClassName());
+ stringBuffer.append(TEXT_137);
+ for (Iterator i=genClass.getFlagGenFeatures("true").iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();
+ stringBuffer.append(TEXT_138);
+ stringBuffer.append(genClass.getFlagsField(genFeature));
+ stringBuffer.append(TEXT_139);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_140);
+ }
+ if (SDOGenUtil.hasChangeSummaryProperty(genClass)) {
+ stringBuffer.append(TEXT_141);
+ stringBuffer.append(SDOGenUtil.getChangeSummaryProperty(genClass));
+ stringBuffer.append(TEXT_142);
+ }
+ stringBuffer.append(TEXT_143);
+ stringBuffer.append(genModel.getImportedName("commonj.sdo.Type"));
+ stringBuffer.append(TEXT_144);
+ stringBuffer.append(genPackage.getImportedFactoryClassName());
+ stringBuffer.append(TEXT_145);
+ stringBuffer.append(genPackage.getImportedFactoryInterfaceName());
+ stringBuffer.append(TEXT_146);
+ stringBuffer.append(genClass.getClassifierAccessorName());
+ stringBuffer.append(TEXT_147);
+ }
+ /*
+ * Output getter and setter interfaces / impls
+ */
+
+ for (Iterator i=(isImplementation ? genClass.getImplementedGenFeatures() : genClass.getDeclaredGenFeatures()).iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();
+ if (genModel.isArrayAccessors() && genFeature.isListType() && !genFeature.isFeatureMapType() && !genFeature.isMapType()) {
+ stringBuffer.append(TEXT_148);
+ if (!isImplementation) {
+ stringBuffer.append(TEXT_149);
+ stringBuffer.append(genFeature.getListItemType());
+ stringBuffer.append(TEXT_150);
+ stringBuffer.append(genFeature.getGetArrayAccessor());
+ stringBuffer.append(TEXT_151);
+ } else {
+ stringBuffer.append(TEXT_152);
+ stringBuffer.append(genFeature.getListItemType());
+ stringBuffer.append(TEXT_153);
+ stringBuffer.append(genFeature.getGetArrayAccessor());
+ stringBuffer.append(TEXT_154);
+ if (genFeature.isVolatile()) {
+ stringBuffer.append(TEXT_155);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.BasicEList"));
+ stringBuffer.append(TEXT_156);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.BasicEList"));
+ stringBuffer.append(TEXT_157);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_158);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_159);
+ } else {
+ stringBuffer.append(TEXT_160);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_161);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_162);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_163);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.BasicEList"));
+ stringBuffer.append(TEXT_164);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.BasicEList"));
+ stringBuffer.append(TEXT_165);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_166);
+ }
+ stringBuffer.append(TEXT_167);
+ stringBuffer.append(genFeature.getListItemType());
+ stringBuffer.append(TEXT_168);
+ }
+ stringBuffer.append(TEXT_169);
+ if (!isImplementation) {
+ stringBuffer.append(TEXT_170);
+ stringBuffer.append(genFeature.getListItemType());
+ stringBuffer.append(TEXT_171);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_172);
+ } else {
+ stringBuffer.append(TEXT_173);
+ stringBuffer.append(genFeature.getListItemType());
+ stringBuffer.append(TEXT_174);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_175);
+ stringBuffer.append(genFeature.getListItemType());
+ stringBuffer.append(TEXT_176);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_177);
+ }
+ stringBuffer.append(TEXT_178);
+ if (!isImplementation) {
+ stringBuffer.append(TEXT_179);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_180);
+ } else {
+ stringBuffer.append(TEXT_181);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_182);
+ if (genFeature.isVolatile()) {
+ stringBuffer.append(TEXT_183);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_184);
+ } else {
+ stringBuffer.append(TEXT_185);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_186);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_187);
+ }
+ stringBuffer.append(TEXT_188);
+ }
+ stringBuffer.append(TEXT_189);
+ if (!isImplementation) {
+ stringBuffer.append(TEXT_190);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_191);
+ stringBuffer.append(genFeature.getListItemType());
+ stringBuffer.append(TEXT_192);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_193);
+ } else {
+ stringBuffer.append(TEXT_194);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_195);
+ stringBuffer.append(genFeature.getListItemType());
+ stringBuffer.append(TEXT_196);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_197);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.BasicEList"));
+ stringBuffer.append(TEXT_198);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_199);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_200);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_201);
+ }
+ stringBuffer.append(TEXT_202);
+ if (!isImplementation) {
+ stringBuffer.append(TEXT_203);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_204);
+ stringBuffer.append(genFeature.getListItemType());
+ stringBuffer.append(TEXT_205);
+ } else {
+ stringBuffer.append(TEXT_206);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_207);
+ stringBuffer.append(genFeature.getListItemType());
+ stringBuffer.append(TEXT_208);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_209);
+ }
+ }
+ if (genFeature.isGet() && (isImplementation || !genFeature.isSuppressedGetVisibility())) {
+ if (isInterface) {
+ stringBuffer.append(TEXT_210);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_211);
+ stringBuffer.append(genFeature.getFeatureKind());
+ stringBuffer.append(TEXT_212);
+ if (genFeature.isListType()) {
+ if (genFeature.isMapType()) { GenFeature keyFeature = genFeature.getMapEntryTypeGenClass().getMapEntryKeyFeature(); GenFeature valueFeature = genFeature.getMapEntryTypeGenClass().getMapEntryValueFeature();
+ stringBuffer.append(TEXT_213);
+ if (keyFeature.isListType()) {
+ stringBuffer.append(TEXT_214);
+ stringBuffer.append(keyFeature.getQualifiedListItemType());
+ stringBuffer.append(TEXT_215);
+ } else {
+ stringBuffer.append(TEXT_216);
+ stringBuffer.append(keyFeature.getType());
+ stringBuffer.append(TEXT_217);
+ }
+ stringBuffer.append(TEXT_218);
+ if (valueFeature.isListType()) {
+ stringBuffer.append(TEXT_219);
+ stringBuffer.append(valueFeature.getQualifiedListItemType());
+ stringBuffer.append(TEXT_220);
+ } else {
+ stringBuffer.append(TEXT_221);
+ stringBuffer.append(valueFeature.getType());
+ stringBuffer.append(TEXT_222);
+ }
+ stringBuffer.append(TEXT_223);
+ } else if (!genFeature.isWrappedFeatureMapType() && !(genModel.isSuppressEMFMetaData() && "org.eclipse.emf.ecore.EObject".equals(genFeature.getQualifiedListItemType()))) {
+ stringBuffer.append(TEXT_224);
+ stringBuffer.append(genFeature.getQualifiedListItemType());
+ stringBuffer.append(TEXT_225);
+ }
+ } else if (genFeature.isSetDefaultValue()) {
+ stringBuffer.append(TEXT_226);
+ stringBuffer.append(genFeature.getDefaultValue());
+ stringBuffer.append(TEXT_227);
+ }
+ if (genFeature.getTypeGenEnum() != null) {
+ stringBuffer.append(TEXT_228);
+ stringBuffer.append(genFeature.getTypeGenEnum().getQualifiedName());
+ stringBuffer.append(TEXT_229);
+ }
+ if (genFeature.isBidirectional() && !genFeature.getReverse().getGenClass().isMapEntry()) { GenFeature reverseGenFeature = genFeature.getReverse();
+ if (!reverseGenFeature.isSuppressedGetVisibility()) {
+ stringBuffer.append(TEXT_230);
+ stringBuffer.append(reverseGenFeature.getGenClass().getQualifiedInterfaceName());
+ stringBuffer.append(TEXT_231);
+ stringBuffer.append(reverseGenFeature.getGetAccessor());
+ stringBuffer.append(TEXT_232);
+ stringBuffer.append(reverseGenFeature.getFormattedName());
+ stringBuffer.append(TEXT_233);
+ }
+ }
+ stringBuffer.append(TEXT_234);
+ if (!genFeature.hasDocumentation()) {
+ stringBuffer.append(TEXT_235);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_236);
+ stringBuffer.append(genFeature.getFeatureKind());
+ stringBuffer.append(TEXT_237);
+ }
+ stringBuffer.append(TEXT_238);
+ if (genFeature.hasDocumentation()) {
+ stringBuffer.append(TEXT_239);
+ stringBuffer.append(genFeature.getDocumentation(genModel.getIndentation(stringBuffer)));
+ stringBuffer.append(TEXT_240);
+ }
+ stringBuffer.append(TEXT_241);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_242);
+ stringBuffer.append(genFeature.getFeatureKind());
+ stringBuffer.append(TEXT_243);
+ if (genFeature.getTypeGenEnum() != null) {
+ stringBuffer.append(TEXT_244);
+ stringBuffer.append(genFeature.getTypeGenEnum().getQualifiedName());
+ }
+ if (genFeature.isUnsettable()) {
+ if (!genFeature.isSuppressedIsSetVisibility()) {
+ stringBuffer.append(TEXT_245);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_246);
+ }
+ if (genFeature.isChangeable() && !genFeature.isSuppressedUnsetVisibility()) {
+ stringBuffer.append(TEXT_247);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_248);
+ }
+ }
+ if (genFeature.isChangeable() && !genFeature.isListType() && !genFeature.isSuppressedSetVisibility()) {
+ stringBuffer.append(TEXT_249);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_250);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_251);
+ }
+ if (!genModel.isSuppressEMFMetaData()) {
+ stringBuffer.append(TEXT_252);
+ stringBuffer.append(genPackage.getQualifiedPackageInterfaceName());
+ stringBuffer.append(TEXT_253);
+ stringBuffer.append(genFeature.getFeatureAccessorName());
+ stringBuffer.append(TEXT_254);
+ }
+ if (genFeature.isBidirectional() && !genFeature.getReverse().getGenClass().isMapEntry()) { GenFeature reverseGenFeature = genFeature.getReverse();
+ if (!reverseGenFeature.isSuppressedGetVisibility()) {
+ stringBuffer.append(TEXT_255);
+ stringBuffer.append(reverseGenFeature.getGenClass().getQualifiedInterfaceName());
+ stringBuffer.append(TEXT_256);
+ stringBuffer.append(reverseGenFeature.getGetAccessor());
+ }
+ }
+ if (!genModel.isSuppressEMFModelTags()) { boolean first = true; for (StringTokenizer stringTokenizer = new StringTokenizer(genFeature.getModelInfo(), "\n\r"); stringTokenizer.hasMoreTokens(); ) { String modelInfo = stringTokenizer.nextToken(); if (first) { first = false;
+ stringBuffer.append(TEXT_257);
+ stringBuffer.append(modelInfo);
+ } else {
+ stringBuffer.append(TEXT_258);
+ stringBuffer.append(modelInfo);
+ }} if (first) {
+ stringBuffer.append(TEXT_259);
+ }}
+ stringBuffer.append(TEXT_260);
+ } else {
+ stringBuffer.append(TEXT_261);
+ }
+ if (!isImplementation) {
+ stringBuffer.append(TEXT_262);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_263);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_264);
+ } else {
+ stringBuffer.append(TEXT_265);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_266);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_267);
+ if (genModel.isReflectiveDelegation()) {
+ stringBuffer.append(TEXT_268);
+ if (genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_269);
+ }
+ stringBuffer.append(TEXT_270);
+ stringBuffer.append(genFeature.getObjectType());
+ stringBuffer.append(TEXT_271);
+ stringBuffer.append(genFeature.getQualifiedFeatureAccessor());
+ stringBuffer.append(TEXT_272);
+ if (genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_273);
+ stringBuffer.append(genFeature.getPrimitiveValueFunction());
+ stringBuffer.append(TEXT_274);
+ }
+ stringBuffer.append(TEXT_275);
+ } else if (!genFeature.isVolatile()) {
+ if (genFeature.isListType()) {
+ if (genModel.isVirtualDelegation()) {
+ stringBuffer.append(TEXT_276);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_277);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_278);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_279);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_280);
+ }
+ stringBuffer.append(TEXT_281);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_282);
+ if (genModel.isVirtualDelegation()) {
+ stringBuffer.append(TEXT_283);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_284);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_285);
+ stringBuffer.append(genClass.getListConstructor(genFeature));
+ stringBuffer.append(TEXT_286);
+ } else {
+ if (genFeature.getType().equals("commonj.sdo.Sequence")){
+ stringBuffer.append(TEXT_287);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_288);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_289);
+ } else {
+ stringBuffer.append(TEXT_290);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_291);
+ stringBuffer.append(SDOGenUtil.getListKind(genFeature, genFeature.isUnsettable()));
+ stringBuffer.append(TEXT_292);
+ stringBuffer.append(genFeature.getListItemType());
+ stringBuffer.append(TEXT_293);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_294);
+ stringBuffer.append(genFeature.isBidirectional()?genFeature.getReverse().getUpperName():"0" );
+ stringBuffer.append(TEXT_295);
+ }}
+ stringBuffer.append(TEXT_296);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(genFeature.isMapType() && genFeature.isEffectiveSuppressEMFTypes() ? ".map()" : "");
+ stringBuffer.append(TEXT_297);
+ } else if (genFeature.isContainer()) {
+ stringBuffer.append(TEXT_298);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_299);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_300);
+ } else {
+ if (genFeature.isResolveProxies()) {
+ if (genModel.isVirtualDelegation()) {
+ stringBuffer.append(TEXT_301);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_302);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_303);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_304);
+ stringBuffer.append(genFeature.getUpperName());
+ if (!genFeature.isReferenceType()) {
+ stringBuffer.append(TEXT_305);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_306);
+ }
+ stringBuffer.append(TEXT_307);
+ }
+ stringBuffer.append(TEXT_308);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_309);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_310);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_311);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_312);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_313);
+ stringBuffer.append(genFeature.getNonEObjectInternalTypeCast());
+ stringBuffer.append(TEXT_314);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_315);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_316);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_317);
+ if (genFeature.isEffectiveContains()) {
+ stringBuffer.append(TEXT_318);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject"));
+ stringBuffer.append(TEXT_319);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_320);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject"));
+ stringBuffer.append(TEXT_321);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_322);
+ if (!genFeature.isBidirectional()) {
+ stringBuffer.append(TEXT_323);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_324);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_325);
+ } else { GenFeature reverseFeature = genFeature.getReverse(); GenClass targetClass = reverseFeature.getGenClass();
+ stringBuffer.append(TEXT_326);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.notify.ChangeContext"));
+ stringBuffer.append(TEXT_327);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_328);
+ stringBuffer.append(targetClass.getQualifiedFeatureID(reverseFeature));
+ stringBuffer.append(TEXT_329);
+ stringBuffer.append(targetClass.getImportedInterfaceName());
+ stringBuffer.append(TEXT_330);
+ }
+ stringBuffer.append(TEXT_331);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_332);
+ if (!genFeature.isBidirectional()) {
+ stringBuffer.append(TEXT_333);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_334);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_335);
+ } else { GenFeature reverseFeature = genFeature.getReverse(); GenClass targetClass = reverseFeature.getGenClass();
+ stringBuffer.append(TEXT_336);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_337);
+ stringBuffer.append(targetClass.getQualifiedFeatureID(reverseFeature));
+ stringBuffer.append(TEXT_338);
+ stringBuffer.append(targetClass.getImportedInterfaceName());
+ stringBuffer.append(TEXT_339);
+ }
+ stringBuffer.append(TEXT_340);
+ } else if (genModel.isVirtualDelegation()) {
+ stringBuffer.append(TEXT_341);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_342);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_343);
+ }
+ if (!genModel.isSuppressNotification()) {
+ stringBuffer.append(TEXT_344);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_345);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_346);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_347);
+ }
+ stringBuffer.append(TEXT_348);
+ }
+ if (!genFeature.isResolveProxies() && genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_349);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_350);
+ stringBuffer.append(genFeature.getUpperName());
+ if (!genFeature.isReferenceType()) {
+ stringBuffer.append(TEXT_351);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_352);
+ }
+ stringBuffer.append(TEXT_353);
+ } else if (genClass.isFlag(genFeature)) {
+ stringBuffer.append(TEXT_354);
+ stringBuffer.append(genClass.getFlagsField(genFeature));
+ stringBuffer.append(TEXT_355);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_356);
+ } else {
+ stringBuffer.append(TEXT_357);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_358);
+ }
+ }
+ } else {//volatile
+ if (genFeature.isResolveProxies() && !genFeature.isListType()) {
+ stringBuffer.append(TEXT_359);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_360);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_361);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_362);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_363);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_364);
+ stringBuffer.append(genFeature.getNonEObjectInternalTypeCast());
+ stringBuffer.append(TEXT_365);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject"));
+ stringBuffer.append(TEXT_366);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_367);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_368);
+ } else if (genFeature.hasDelegateFeature()) { GenFeature delegateFeature = genFeature.getDelegateFeature(); // AAAA
+ if (genFeature.isFeatureMapType()) {
+ if (delegateFeature.isWrappedFeatureMapType()) {
+ stringBuffer.append(TEXT_369);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_370);
+ stringBuffer.append(delegateFeature.getAccessorName());
+ stringBuffer.append(TEXT_371);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_372);
+ } else {
+ stringBuffer.append(TEXT_373);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap"));
+ stringBuffer.append(TEXT_374);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap"));
+ stringBuffer.append(TEXT_375);
+ stringBuffer.append(delegateFeature.getAccessorName());
+ stringBuffer.append(TEXT_376);
+ stringBuffer.append(genFeature.getQualifiedFeatureAccessor());
+ stringBuffer.append(TEXT_377);
+ }
+ } else if (genFeature.isListType()) {
+ if (delegateFeature.isWrappedFeatureMapType()) {
+ stringBuffer.append(TEXT_378);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_379);
+ stringBuffer.append(delegateFeature.getAccessorName());
+ stringBuffer.append(TEXT_380);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_381);
+ } else {
+ stringBuffer.append(TEXT_382);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap"));
+ stringBuffer.append(TEXT_383);
+ stringBuffer.append(delegateFeature.getAccessorName());
+ stringBuffer.append(TEXT_384);
+ stringBuffer.append(genFeature.getQualifiedFeatureAccessor());
+ stringBuffer.append(TEXT_385);
+ }
+ } else {
+ if (delegateFeature.isWrappedFeatureMapType()) {
+ stringBuffer.append(TEXT_386);
+ if (genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_387);
+ }
+ stringBuffer.append(TEXT_388);
+ stringBuffer.append(genFeature.getObjectType());
+ stringBuffer.append(TEXT_389);
+ stringBuffer.append(delegateFeature.getAccessorName());
+ stringBuffer.append(TEXT_390);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_391);
+ if (genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_392);
+ stringBuffer.append(genFeature.getPrimitiveValueFunction());
+ stringBuffer.append(TEXT_393);
+ }
+ stringBuffer.append(TEXT_394);
+ } else {
+ stringBuffer.append(TEXT_395);
+ if (genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_396);
+ }
+ stringBuffer.append(TEXT_397);
+ stringBuffer.append(genFeature.getObjectType());
+ stringBuffer.append(TEXT_398);
+ stringBuffer.append(delegateFeature.getAccessorName());
+ stringBuffer.append(TEXT_399);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_400);
+ if (genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_401);
+ stringBuffer.append(genFeature.getPrimitiveValueFunction());
+ stringBuffer.append(TEXT_402);
+ }
+ stringBuffer.append(TEXT_403);
+ }
+ }
+ } else {
+ stringBuffer.append(TEXT_404);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_405);
+ stringBuffer.append(genFeature.getFeatureKind());
+ stringBuffer.append(TEXT_406);
+ //Class/getGenFeature.todo.override.javajetinc
+ }
+ }
+ stringBuffer.append(TEXT_407);
+ }
+ //Class/getGenFeature.override.javajetinc
+ }
+ if (isImplementation && !genModel.isReflectiveDelegation() && genFeature.isBasicGet()) {
+ stringBuffer.append(TEXT_408);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_409);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_410);
+ if (genFeature.isContainer()) {
+ stringBuffer.append(TEXT_411);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_412);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_413);
+ } else if (!genFeature.isVolatile()) {
+ if (genModel.isVirtualDelegation()) {
+ stringBuffer.append(TEXT_414);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_415);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_416);
+ } else {
+ stringBuffer.append(TEXT_417);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_418);
+ }
+ } else if (genFeature.hasDelegateFeature()) { GenFeature delegateFeature = genFeature.getDelegateFeature(); //BBBB
+ if (delegateFeature.isWrappedFeatureMapType()) {
+ stringBuffer.append(TEXT_419);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_420);
+ stringBuffer.append(delegateFeature.getAccessorName());
+ stringBuffer.append(TEXT_421);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_422);
+ } else {
+ stringBuffer.append(TEXT_423);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_424);
+ stringBuffer.append(delegateFeature.getAccessorName());
+ stringBuffer.append(TEXT_425);
+ stringBuffer.append(genFeature.getQualifiedFeatureAccessor());
+ stringBuffer.append(TEXT_426);
+ }
+ } else {
+ stringBuffer.append(TEXT_427);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_428);
+ stringBuffer.append(genFeature.getFeatureKind());
+ stringBuffer.append(TEXT_429);
+ //Class/basicGetGenFeature.todo.override.javajetinc
+ }
+ stringBuffer.append(TEXT_430);
+ //Class/basicGetGenFeature.override.javajetinc
+ }
+ if (isImplementation && !genModel.isReflectiveDelegation() && genFeature.isBasicSet()) {
+ stringBuffer.append(TEXT_431);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_432);
+ stringBuffer.append(genFeature.getImportedInternalType());
+ stringBuffer.append(TEXT_433);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_434);
+ if (!genFeature.isVolatile()) {
+ if (genModel.isVirtualDelegation()) {
+ stringBuffer.append(TEXT_435);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_436);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_437);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_438);
+ } else {
+ stringBuffer.append(TEXT_439);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_440);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_441);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_442);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_443);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_444);
+ }
+ if (genFeature.isUnsettable()) {
+ if (genModel.isVirtualDelegation()) {
+ stringBuffer.append(TEXT_445);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_446);
+ } else if (genClass.isESetFlag(genFeature)) {
+ stringBuffer.append(TEXT_447);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_448);
+ stringBuffer.append(genClass.getESetFlagsField(genFeature));
+ stringBuffer.append(TEXT_449);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_450);
+ stringBuffer.append(genClass.getESetFlagsField(genFeature));
+ stringBuffer.append(TEXT_451);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_452);
+ } else {
+ stringBuffer.append(TEXT_453);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_454);
+ stringBuffer.append(genFeature.getUncapName());
+ stringBuffer.append(TEXT_455);
+ stringBuffer.append(genFeature.getUncapName());
+ stringBuffer.append(TEXT_456);
+ }
+ }
+ if (!genModel.isSuppressNotification()) {
+ stringBuffer.append(TEXT_457);
+ if (genFeature.isUnsettable()) {
+ stringBuffer.append(TEXT_458);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_459);
+ if (genModel.isVirtualDelegation()) {
+ stringBuffer.append(TEXT_460);
+ stringBuffer.append(genFeature.getCapName());
+ } else {
+ stringBuffer.append(TEXT_461);
+ stringBuffer.append(genFeature.getCapName());
+ }
+ stringBuffer.append(TEXT_462);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_463);
+ if (genModel.isVirtualDelegation()) {
+ stringBuffer.append(TEXT_464);
+ } else {
+ stringBuffer.append(TEXT_465);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_466);
+ }
+ stringBuffer.append(TEXT_467);
+ } else {
+ stringBuffer.append(TEXT_468);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_469);
+ if (genModel.isVirtualDelegation()) {
+ stringBuffer.append(TEXT_470);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_471);
+ stringBuffer.append(genFeature.getCapName());
+ } else {
+ stringBuffer.append(TEXT_472);
+ stringBuffer.append(genFeature.getCapName());
+ }
+ stringBuffer.append(TEXT_473);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_474);
+ }
+ stringBuffer.append(TEXT_475);
+ }
+ stringBuffer.append(TEXT_476);
+ } else if (genFeature.hasDelegateFeature()) { GenFeature delegateFeature = genFeature.getDelegateFeature(); //CCCC
+ if (delegateFeature.isWrappedFeatureMapType()) {
+ stringBuffer.append(TEXT_477);
+ stringBuffer.append(delegateFeature.getAccessorName());
+ stringBuffer.append(TEXT_478);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_479);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_480);
+ } else {
+ stringBuffer.append(TEXT_481);
+ stringBuffer.append(delegateFeature.getAccessorName());
+ stringBuffer.append(TEXT_482);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_483);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_484);
+ }
+ } else {
+ stringBuffer.append(TEXT_485);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_486);
+ stringBuffer.append(genFeature.getFeatureKind());
+ stringBuffer.append(TEXT_487);
+ //Class/basicSetGenFeature.todo.override.javajetinc
+ }
+ stringBuffer.append(TEXT_488);
+ //Class/basicSetGenFeature.override.javajetinc
+ }
+ if (genFeature.isSet() && (isImplementation || !genFeature.isSuppressedSetVisibility())) {
+ if (isInterface) {
+ stringBuffer.append(TEXT_489);
+ stringBuffer.append(genClass.getQualifiedInterfaceName());
+ stringBuffer.append(TEXT_490);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_491);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_492);
+ stringBuffer.append(genFeature.getFeatureKind());
+ stringBuffer.append(TEXT_493);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_494);
+ stringBuffer.append(genFeature.getFeatureKind());
+ stringBuffer.append(TEXT_495);
+ if (genFeature.isEnumType()) {
+ stringBuffer.append(TEXT_496);
+ stringBuffer.append(genFeature.getTypeGenEnum().getQualifiedName());
+ }
+ if (genFeature.isUnsettable()) {
+ if (!genFeature.isSuppressedIsSetVisibility()) {
+ stringBuffer.append(TEXT_497);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_498);
+ }
+ if (!genFeature.isSuppressedUnsetVisibility()) {
+ stringBuffer.append(TEXT_499);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_500);
+ }
+ }
+ stringBuffer.append(TEXT_501);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_502);
+ } else {
+ stringBuffer.append(TEXT_503);
+ }
+ if (!isImplementation) {
+ stringBuffer.append(TEXT_504);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_505);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_506);
+ } else {
+ stringBuffer.append(TEXT_507);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_508);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_509);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_510);
+ if (genModel.isReflectiveDelegation()) {
+ stringBuffer.append(TEXT_511);
+ stringBuffer.append(genFeature.getQualifiedFeatureAccessor());
+ stringBuffer.append(TEXT_512);
+ if (genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_513);
+ stringBuffer.append(genFeature.getObjectType());
+ stringBuffer.append(TEXT_514);
+ }
+ stringBuffer.append(TEXT_515);
+ stringBuffer.append(genFeature.getCapName());
+ if (genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_516);
+ }
+ stringBuffer.append(TEXT_517);
+ } else if (!genFeature.isVolatile()) {
+ if (genFeature.isContainer()) { GenFeature reverseFeature = genFeature.getReverse(); GenClass targetClass = reverseFeature.getGenClass();
+ stringBuffer.append(TEXT_518);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_519);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_520);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_521);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.EcoreUtil"));
+ stringBuffer.append(TEXT_522);
+ stringBuffer.append(genFeature.getEObjectCast());
+ stringBuffer.append(TEXT_523);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_524);
+ stringBuffer.append(genModel.getImportedName("java.lang.IllegalArgumentException"));
+ stringBuffer.append(TEXT_525);
+ stringBuffer.append(genModel.getNonNLS());
+ stringBuffer.append(TEXT_526);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_527);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject"));
+ stringBuffer.append(TEXT_528);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_529);
+ stringBuffer.append(targetClass.getQualifiedFeatureID(reverseFeature));
+ stringBuffer.append(TEXT_530);
+ stringBuffer.append(targetClass.getImportedInterfaceName());
+ stringBuffer.append(TEXT_531);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject"));
+ stringBuffer.append(TEXT_532);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_533);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_534);
+ if (!genModel.isSuppressNotification()) {
+ stringBuffer.append(TEXT_535);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_536);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_537);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_538);
+ }
+ } else if (genFeature.isBidirectional() || genFeature.isEffectiveContains()) {
+ if (genModel.isVirtualDelegation()) {
+ stringBuffer.append(TEXT_539);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_540);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_541);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_542);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_543);
+ }
+ stringBuffer.append(TEXT_544);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_545);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_546);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_547);
+ if (!genFeature.isBidirectional()) {
+ stringBuffer.append(TEXT_548);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_549);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_550);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_551);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_552);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_553);
+ } else { GenFeature reverseFeature = genFeature.getReverse(); GenClass targetClass = reverseFeature.getGenClass();
+ stringBuffer.append(TEXT_554);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_555);
+ stringBuffer.append(targetClass.getQualifiedFeatureID(reverseFeature));
+ stringBuffer.append(TEXT_556);
+ stringBuffer.append(targetClass.getImportedInterfaceName());
+ stringBuffer.append(TEXT_557);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_558);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_559);
+ stringBuffer.append(targetClass.getQualifiedFeatureID(reverseFeature));
+ stringBuffer.append(TEXT_560);
+ stringBuffer.append(targetClass.getImportedInterfaceName());
+ stringBuffer.append(TEXT_561);
+ }
+ stringBuffer.append(TEXT_562);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_563);
+ stringBuffer.append(genFeature.getInternalTypeCast());
+ stringBuffer.append(TEXT_564);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_565);
+ if (genFeature.isUnsettable()) {
+ stringBuffer.append(TEXT_566);
+ if (genModel.isVirtualDelegation()) {
+ stringBuffer.append(TEXT_567);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_568);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_569);
+ } else if (genClass.isESetFlag(genFeature)) {
+ if (!genModel.isSuppressNotification()) {
+ stringBuffer.append(TEXT_570);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_571);
+ stringBuffer.append(genClass.getESetFlagsField(genFeature));
+ stringBuffer.append(TEXT_572);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_573);
+ }
+ stringBuffer.append(TEXT_574);
+ stringBuffer.append(genClass.getESetFlagsField(genFeature));
+ stringBuffer.append(TEXT_575);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_576);
+ } else {
+ if (!genModel.isSuppressNotification()) {
+ stringBuffer.append(TEXT_577);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_578);
+ stringBuffer.append(genFeature.getUncapName());
+ stringBuffer.append(TEXT_579);
+ }
+ stringBuffer.append(TEXT_580);
+ stringBuffer.append(genFeature.getUncapName());
+ stringBuffer.append(TEXT_581);
+ }
+ if (!genModel.isSuppressNotification()) {
+ stringBuffer.append(TEXT_582);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_583);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_584);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_585);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_586);
+ }
+ stringBuffer.append(TEXT_587);
+ } else {
+ if (!genModel.isSuppressNotification()) {
+ stringBuffer.append(TEXT_588);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_589);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_590);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_591);
+ }
+ }
+ } else {
+ if (genClass.isFlag(genFeature)) {
+ if (!genModel.isSuppressNotification()) {
+ stringBuffer.append(TEXT_592);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_593);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_594);
+ stringBuffer.append(genClass.getFlagsField(genFeature));
+ stringBuffer.append(TEXT_595);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_596);
+ }
+ stringBuffer.append(TEXT_597);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_598);
+ stringBuffer.append(genClass.getFlagsField(genFeature));
+ stringBuffer.append(TEXT_599);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_600);
+ stringBuffer.append(genClass.getFlagsField(genFeature));
+ stringBuffer.append(TEXT_601);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_602);
+ } else {
+ if (!genModel.isVirtualDelegation() || genFeature.isPrimitiveType()) {
+ if (!genModel.isSuppressNotification()) {
+ stringBuffer.append(TEXT_603);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_604);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_605);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_606);
+ }
+ }
+ if (genFeature.isEnumType()) {
+ if (genModel.isVirtualDelegation()) {
+ stringBuffer.append(TEXT_607);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_608);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_609);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_610);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_611);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_612);
+ } else {
+ stringBuffer.append(TEXT_613);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_614);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_615);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_616);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_617);
+ }
+ } else {
+ if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_618);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_619);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_620);
+ stringBuffer.append(genFeature.getInternalTypeCast());
+ stringBuffer.append(TEXT_621);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_622);
+ } else {
+ stringBuffer.append(TEXT_623);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_624);
+ stringBuffer.append(genFeature.getInternalTypeCast());
+ stringBuffer.append(TEXT_625);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_626);
+ }
+ }
+ if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_627);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_628);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_629);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_630);
+ }
+ }
+ if (genFeature.isUnsettable()) {
+ if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_631);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_632);
+ } else if (genClass.isESetFlag(genFeature)) {
+ if (!genModel.isSuppressNotification()) {
+ stringBuffer.append(TEXT_633);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_634);
+ stringBuffer.append(genClass.getESetFlagsField(genFeature));
+ stringBuffer.append(TEXT_635);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_636);
+ }
+ stringBuffer.append(TEXT_637);
+ stringBuffer.append(genClass.getESetFlagsField(genFeature));
+ stringBuffer.append(TEXT_638);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_639);
+ } else {
+ if (!genModel.isSuppressNotification()) {
+ stringBuffer.append(TEXT_640);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_641);
+ stringBuffer.append(genFeature.getUncapName());
+ stringBuffer.append(TEXT_642);
+ }
+ stringBuffer.append(TEXT_643);
+ stringBuffer.append(genFeature.getUncapName());
+ stringBuffer.append(TEXT_644);
+ }
+ if (!genModel.isSuppressNotification()) {
+ stringBuffer.append(TEXT_645);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_646);
+ if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_647);
+ if (genFeature.isReferenceType()) {
+ stringBuffer.append(TEXT_648);
+ } else {
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_649);
+ }
+ stringBuffer.append(TEXT_650);
+ stringBuffer.append(genFeature.getCapName());
+ } else {
+ stringBuffer.append(TEXT_651);
+ stringBuffer.append(genFeature.getCapName());
+ }
+ stringBuffer.append(TEXT_652);
+ if (genClass.isFlag(genFeature)) {
+ stringBuffer.append(TEXT_653);
+ stringBuffer.append(genFeature.getCapName());
+ } else {
+ stringBuffer.append(genFeature.getSafeName());
+ }
+ stringBuffer.append(TEXT_654);
+ if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_655);
+ } else {
+ stringBuffer.append(TEXT_656);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_657);
+ }
+ stringBuffer.append(TEXT_658);
+ }
+ } else {
+ if (!genModel.isSuppressNotification()) {
+ stringBuffer.append(TEXT_659);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_660);
+ if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_661);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_662);
+ if (genFeature.isReferenceType()) {
+ stringBuffer.append(TEXT_663);
+ } else {
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_664);
+ }
+ stringBuffer.append(TEXT_665);
+ stringBuffer.append(genFeature.getCapName());
+ } else {
+ stringBuffer.append(TEXT_666);
+ stringBuffer.append(genFeature.getCapName());
+ }
+ stringBuffer.append(TEXT_667);
+ if (genClass.isFlag(genFeature)) {
+ stringBuffer.append(TEXT_668);
+ stringBuffer.append(genFeature.getCapName());
+ } else {
+ stringBuffer.append(genFeature.getSafeName());
+ }
+ stringBuffer.append(TEXT_669);
+ }
+ }
+ }
+ } else if (genFeature.hasDelegateFeature()) { GenFeature delegateFeature = genFeature.getDelegateFeature(); // DDDD
+ if (delegateFeature.isWrappedFeatureMapType()) {
+ stringBuffer.append(TEXT_670);
+ stringBuffer.append(delegateFeature.getAccessorName());
+ stringBuffer.append(TEXT_671);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_672);
+ if (genFeature.isPrimitiveType()){
+ stringBuffer.append(TEXT_673);
+ stringBuffer.append(genFeature.getObjectType());
+ stringBuffer.append(TEXT_674);
+ }
+ stringBuffer.append(TEXT_675);
+ stringBuffer.append(genFeature.getCapName());
+ if (genFeature.isPrimitiveType()){
+ stringBuffer.append(TEXT_676);
+ }
+ stringBuffer.append(TEXT_677);
+ } else {
+ stringBuffer.append(TEXT_678);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap"));
+ stringBuffer.append(TEXT_679);
+ stringBuffer.append(delegateFeature.getAccessorName());
+ stringBuffer.append(TEXT_680);
+ stringBuffer.append(genFeature.getQualifiedFeatureAccessor());
+ stringBuffer.append(TEXT_681);
+ if (genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_682);
+ stringBuffer.append(genFeature.getObjectType());
+ stringBuffer.append(TEXT_683);
+ }
+ stringBuffer.append(TEXT_684);
+ stringBuffer.append(genFeature.getCapName());
+ if (genFeature.isPrimitiveType()){
+ stringBuffer.append(TEXT_685);
+ }
+ stringBuffer.append(TEXT_686);
+ }
+ } else {
+ stringBuffer.append(TEXT_687);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_688);
+ stringBuffer.append(genFeature.getFeatureKind());
+ stringBuffer.append(TEXT_689);
+ //Class/setGenFeature.todo.override.javajetinc
+ }
+ stringBuffer.append(TEXT_690);
+ }
+ //Class/setGenFeature.override.javajetinc
+ }
+ if (isImplementation && !genModel.isReflectiveDelegation() && genFeature.isBasicUnset()) {
+ stringBuffer.append(TEXT_691);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_692);
+ if (!genFeature.isVolatile()) {
+ if (genModel.isVirtualDelegation()) {
+ stringBuffer.append(TEXT_693);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_694);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_695);
+ } else {
+ stringBuffer.append(TEXT_696);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_697);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_698);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_699);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_700);
+ }
+ if (genModel.isVirtualDelegation()) {
+ stringBuffer.append(TEXT_701);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_702);
+ } else if (genClass.isESetFlag(genFeature)) {
+ stringBuffer.append(TEXT_703);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_704);
+ stringBuffer.append(genClass.getESetFlagsField(genFeature));
+ stringBuffer.append(TEXT_705);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_706);
+ stringBuffer.append(genClass.getESetFlagsField(genFeature));
+ stringBuffer.append(TEXT_707);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_708);
+ } else {
+ stringBuffer.append(TEXT_709);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_710);
+ stringBuffer.append(genFeature.getUncapName());
+ stringBuffer.append(TEXT_711);
+ stringBuffer.append(genFeature.getUncapName());
+ stringBuffer.append(TEXT_712);
+ }
+ if (!genModel.isSuppressNotification()) {
+ stringBuffer.append(TEXT_713);
+ if (genFeature.isUnsettable()) {
+ stringBuffer.append(TEXT_714);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_715);
+ if (genModel.isVirtualDelegation()) {
+ stringBuffer.append(TEXT_716);
+ stringBuffer.append(genFeature.getCapName());
+ } else {
+ stringBuffer.append(TEXT_717);
+ stringBuffer.append(genFeature.getCapName());
+ }
+ stringBuffer.append(TEXT_718);
+ if (genModel.isVirtualDelegation()) {
+ stringBuffer.append(TEXT_719);
+ } else {
+ stringBuffer.append(TEXT_720);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_721);
+ }
+ stringBuffer.append(TEXT_722);
+ } else {
+ stringBuffer.append(TEXT_723);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_724);
+ if (genModel.isVirtualDelegation()) {
+ stringBuffer.append(TEXT_725);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_726);
+ stringBuffer.append(genFeature.getCapName());
+ } else {
+ stringBuffer.append(TEXT_727);
+ stringBuffer.append(genFeature.getCapName());
+ }
+ stringBuffer.append(TEXT_728);
+ }
+ stringBuffer.append(TEXT_729);
+ }
+ stringBuffer.append(TEXT_730);
+ } else {
+ stringBuffer.append(TEXT_731);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_732);
+ stringBuffer.append(genFeature.getFeatureKind());
+ stringBuffer.append(TEXT_733);
+ //Class/basicUnsetGenFeature.todo.override.javajetinc
+ }
+ stringBuffer.append(TEXT_734);
+ //Class.basicUnsetGenFeature.override.javajetinc
+ }
+ if (genFeature.isUnset() && (isImplementation || !genFeature.isSuppressedUnsetVisibility())) {
+ if (isInterface) {
+ stringBuffer.append(TEXT_735);
+ stringBuffer.append(genClass.getQualifiedInterfaceName());
+ stringBuffer.append(TEXT_736);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_737);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_738);
+ stringBuffer.append(genFeature.getFeatureKind());
+ stringBuffer.append(TEXT_739);
+ if (!genFeature.isSuppressedIsSetVisibility()) {
+ stringBuffer.append(TEXT_740);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_741);
+ }
+ stringBuffer.append(TEXT_742);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_743);
+ if (!genFeature.isListType() && !genFeature.isSuppressedSetVisibility()) {
+ stringBuffer.append(TEXT_744);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_745);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_746);
+ }
+ stringBuffer.append(TEXT_747);
+ } else {
+ stringBuffer.append(TEXT_748);
+ }
+ if (!isImplementation) {
+ stringBuffer.append(TEXT_749);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_750);
+ } else {
+ stringBuffer.append(TEXT_751);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_752);
+ if (genModel.isReflectiveDelegation()) {
+ stringBuffer.append(TEXT_753);
+ stringBuffer.append(genFeature.getQualifiedFeatureAccessor());
+ stringBuffer.append(TEXT_754);
+ } else if (!genFeature.isVolatile()) {
+ if (genFeature.isListType()) {
+ stringBuffer.append(TEXT_755);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.InternalEList"));
+ stringBuffer.append(TEXT_756);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_757);
+ } else if (genFeature.isBidirectional() || genFeature.isEffectiveContains()) {
+ if (genModel.isVirtualDelegation()) {
+ stringBuffer.append(TEXT_758);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_759);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_760);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_761);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_762);
+ }
+ stringBuffer.append(TEXT_763);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_764);
+ if (!genFeature.isBidirectional()) {
+ stringBuffer.append(TEXT_765);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_766);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_767);
+ } else { GenFeature reverseFeature = genFeature.getReverse(); GenClass targetClass = reverseFeature.getGenClass();
+ stringBuffer.append(TEXT_768);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_769);
+ stringBuffer.append(targetClass.getQualifiedFeatureID(reverseFeature));
+ stringBuffer.append(TEXT_770);
+ stringBuffer.append(targetClass.getImportedInterfaceName());
+ stringBuffer.append(TEXT_771);
+ }
+ stringBuffer.append(TEXT_772);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_773);
+ if (genModel.isVirtualDelegation()) {
+ stringBuffer.append(TEXT_774);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_775);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_776);
+ } else if (genClass.isESetFlag(genFeature)) {
+ if (!genModel.isSuppressNotification()) {
+ stringBuffer.append(TEXT_777);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_778);
+ stringBuffer.append(genClass.getESetFlagsField(genFeature));
+ stringBuffer.append(TEXT_779);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_780);
+ }
+ stringBuffer.append(TEXT_781);
+ stringBuffer.append(genClass.getESetFlagsField(genFeature));
+ stringBuffer.append(TEXT_782);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_783);
+ } else {
+ if (!genModel.isSuppressNotification()) {
+ stringBuffer.append(TEXT_784);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_785);
+ stringBuffer.append(genFeature.getUncapName());
+ stringBuffer.append(TEXT_786);
+ }
+ stringBuffer.append(TEXT_787);
+ stringBuffer.append(genFeature.getUncapName());
+ stringBuffer.append(TEXT_788);
+ }
+ if (!genModel.isSuppressNotification()) {
+ stringBuffer.append(TEXT_789);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_790);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_791);
+ }
+ stringBuffer.append(TEXT_792);
+ } else {
+ if (genClass.isFlag(genFeature)) {
+ if (!genModel.isSuppressNotification()) {
+ stringBuffer.append(TEXT_793);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_794);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_795);
+ stringBuffer.append(genClass.getFlagsField(genFeature));
+ stringBuffer.append(TEXT_796);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_797);
+ }
+ } else if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_798);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_799);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_800);
+ } else {
+ if (!genModel.isSuppressNotification()) {
+ stringBuffer.append(TEXT_801);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_802);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_803);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_804);
+ }
+ }
+ if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_805);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_806);
+ } else if (genClass.isESetFlag(genFeature)) {
+ stringBuffer.append(TEXT_807);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_808);
+ stringBuffer.append(genClass.getESetFlagsField(genFeature));
+ stringBuffer.append(TEXT_809);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_810);
+ } else {
+ if (!genModel.isSuppressNotification()) {
+ stringBuffer.append(TEXT_811);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_812);
+ stringBuffer.append(genFeature.getUncapName());
+ stringBuffer.append(TEXT_813);
+ }
+ }
+ if (genFeature.isReferenceType()) {
+ stringBuffer.append(TEXT_814);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_815);
+ if (!genModel.isVirtualDelegation()) {
+ if (genClass.isESetFlag(genFeature)) {
+ stringBuffer.append(TEXT_816);
+ stringBuffer.append(genClass.getESetFlagsField(genFeature));
+ stringBuffer.append(TEXT_817);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_818);
+ } else {
+ stringBuffer.append(TEXT_819);
+ stringBuffer.append(genFeature.getUncapName());
+ stringBuffer.append(TEXT_820);
+ }
+ }
+ if (!genModel.isSuppressNotification()) {
+ stringBuffer.append(TEXT_821);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_822);
+ if (genModel.isVirtualDelegation()) {
+ stringBuffer.append(TEXT_823);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_824);
+ } else {
+ stringBuffer.append(TEXT_825);
+ stringBuffer.append(genFeature.getCapName());
+ }
+ stringBuffer.append(TEXT_826);
+ if (genModel.isVirtualDelegation()) {
+ stringBuffer.append(TEXT_827);
+ } else {
+ stringBuffer.append(TEXT_828);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_829);
+ }
+ stringBuffer.append(TEXT_830);
+ }
+ } else {
+ if (genClass.isFlag(genFeature)) {
+ stringBuffer.append(TEXT_831);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_832);
+ stringBuffer.append(genClass.getFlagsField(genFeature));
+ stringBuffer.append(TEXT_833);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_834);
+ stringBuffer.append(genClass.getFlagsField(genFeature));
+ stringBuffer.append(TEXT_835);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_836);
+ } else if (!genModel.isVirtualDelegation() || genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_837);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_838);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_839);
+ }
+ if (!genModel.isVirtualDelegation() || genFeature.isPrimitiveType()) {
+ if (genClass.isESetFlag(genFeature)) {
+ stringBuffer.append(TEXT_840);
+ stringBuffer.append(genClass.getESetFlagsField(genFeature));
+ stringBuffer.append(TEXT_841);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_842);
+ } else {
+ stringBuffer.append(TEXT_843);
+ stringBuffer.append(genFeature.getUncapName());
+ stringBuffer.append(TEXT_844);
+ }
+ }
+ if (!genModel.isSuppressNotification()) {
+ stringBuffer.append(TEXT_845);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_846);
+ if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_847);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_848);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_849);
+ } else {
+ stringBuffer.append(TEXT_850);
+ stringBuffer.append(genFeature.getCapName());
+ }
+ stringBuffer.append(TEXT_851);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_852);
+ if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_853);
+ } else {
+ stringBuffer.append(TEXT_854);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_855);
+ }
+ stringBuffer.append(TEXT_856);
+ }
+ }
+ }
+ } else if (genFeature.hasDelegateFeature()) { GenFeature delegateFeature = genFeature.getDelegateFeature(); //EEEE
+ if (delegateFeature.isWrappedFeatureMapType()) {
+ stringBuffer.append(TEXT_857);
+ stringBuffer.append(delegateFeature.getAccessorName());
+ stringBuffer.append(TEXT_858);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_859);
+ } else {
+ stringBuffer.append(TEXT_860);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_861);
+ stringBuffer.append(delegateFeature.getAccessorName());
+ stringBuffer.append(TEXT_862);
+ }
+ } else {
+ stringBuffer.append(TEXT_863);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_864);
+ stringBuffer.append(genFeature.getFeatureKind());
+ stringBuffer.append(TEXT_865);
+ //Class/unsetGenFeature.todo.override.javajetinc
+ }
+ stringBuffer.append(TEXT_866);
+ }
+ //Class/unsetGenFeature.override.javajetinc
+ }
+ if (genFeature.isIsSet() && (isImplementation || !genFeature.isSuppressedIsSetVisibility())) {
+ if (isInterface) {
+ stringBuffer.append(TEXT_867);
+ stringBuffer.append(genClass.getQualifiedInterfaceName());
+ stringBuffer.append(TEXT_868);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_869);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_870);
+ stringBuffer.append(genFeature.getFeatureKind());
+ stringBuffer.append(TEXT_871);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_872);
+ stringBuffer.append(genFeature.getFeatureKind());
+ stringBuffer.append(TEXT_873);
+ if (genFeature.isChangeable() && !genFeature.isSuppressedUnsetVisibility()) {
+ stringBuffer.append(TEXT_874);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_875);
+ }
+ stringBuffer.append(TEXT_876);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_877);
+ if (!genFeature.isListType() && genFeature.isChangeable() && !genFeature.isSuppressedSetVisibility()) {
+ stringBuffer.append(TEXT_878);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_879);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_880);
+ }
+ stringBuffer.append(TEXT_881);
+ } else {
+ stringBuffer.append(TEXT_882);
+ }
+ if (!isImplementation) {
+ stringBuffer.append(TEXT_883);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_884);
+ } else {
+ stringBuffer.append(TEXT_885);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_886);
+ if (genModel.isReflectiveDelegation()) {
+ stringBuffer.append(TEXT_887);
+ stringBuffer.append(genFeature.getQualifiedFeatureAccessor());
+ stringBuffer.append(TEXT_888);
+ } else if (!genFeature.isVolatile()) {
+ if (genFeature.isListType()) {
+ if (genModel.isVirtualDelegation()) {
+ stringBuffer.append(TEXT_889);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_890);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_891);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_892);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_893);
+ }
+ stringBuffer.append(TEXT_894);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_895);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.InternalEList"));
+ stringBuffer.append(TEXT_896);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_897);
+ } else {
+ if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_898);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_899);
+ } else if (genClass.isESetFlag(genFeature)) {
+ stringBuffer.append(TEXT_900);
+ stringBuffer.append(genClass.getESetFlagsField(genFeature));
+ stringBuffer.append(TEXT_901);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_902);
+ } else {
+ stringBuffer.append(TEXT_903);
+ stringBuffer.append(genFeature.getUncapName());
+ stringBuffer.append(TEXT_904);
+ }
+ }
+ } else if (genFeature.hasDelegateFeature()) { GenFeature delegateFeature = genFeature.getDelegateFeature(); //FFFF
+ if (delegateFeature.isWrappedFeatureMapType()) {
+ stringBuffer.append(TEXT_905);
+ stringBuffer.append(delegateFeature.getAccessorName());
+ stringBuffer.append(TEXT_906);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_907);
+ } else {
+ stringBuffer.append(TEXT_908);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap"));
+ stringBuffer.append(TEXT_909);
+ stringBuffer.append(delegateFeature.getAccessorName());
+ stringBuffer.append(TEXT_910);
+ stringBuffer.append(genFeature.getQualifiedFeatureAccessor());
+ stringBuffer.append(TEXT_911);
+ }
+ } else {
+ stringBuffer.append(TEXT_912);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_913);
+ stringBuffer.append(genFeature.getFeatureKind());
+ stringBuffer.append(TEXT_914);
+ //Class/isSetGenFeature.todo.override.javajetinc
+ }
+ stringBuffer.append(TEXT_915);
+ }
+ //Class/isSetGenFeature.override.javajetinc
+ }
+ //Class/genFeature.override.javajetinc
+ }// end output getter and setter interfaces or impls
+ for (Iterator i= (isImplementation ? genClass.getImplementedGenOperations() : genClass.getDeclaredGenOperations()).iterator(); i.hasNext();) { GenOperation genOperation = (GenOperation)i.next();
+ if (isInterface) {
+ stringBuffer.append(TEXT_916);
+ if (genOperation.hasDocumentation()) {
+ stringBuffer.append(TEXT_917);
+ stringBuffer.append(genOperation.getDocumentation(genModel.getIndentation(stringBuffer)));
+ stringBuffer.append(TEXT_918);
+ }
+ if (!genModel.isSuppressEMFModelTags()) { boolean first = true; for (StringTokenizer stringTokenizer = new StringTokenizer(genOperation.getModelInfo(), "\n\r"); stringTokenizer.hasMoreTokens(); ) { String modelInfo = stringTokenizer.nextToken(); if (first) { first = false;
+ stringBuffer.append(TEXT_919);
+ stringBuffer.append(modelInfo);
+ } else {
+ stringBuffer.append(TEXT_920);
+ stringBuffer.append(modelInfo);
+ }} if (first) {
+ stringBuffer.append(TEXT_921);
+ }}
+ stringBuffer.append(TEXT_922);
+ } else {
+ stringBuffer.append(TEXT_923);
+ }
+ if (!isImplementation) {
+ stringBuffer.append(TEXT_924);
+ stringBuffer.append(genOperation.getImportedType());
+ stringBuffer.append(TEXT_925);
+ stringBuffer.append(genOperation.getName());
+ stringBuffer.append(TEXT_926);
+ stringBuffer.append(genOperation.getParameters());
+ stringBuffer.append(TEXT_927);
+ stringBuffer.append(genOperation.getThrows());
+ stringBuffer.append(TEXT_928);
+ } else {
+ stringBuffer.append(TEXT_929);
+ stringBuffer.append(genOperation.getImportedType());
+ stringBuffer.append(TEXT_930);
+ stringBuffer.append(genOperation.getName());
+ stringBuffer.append(TEXT_931);
+ stringBuffer.append(genOperation.getParameters());
+ stringBuffer.append(TEXT_932);
+ stringBuffer.append(genOperation.getThrows());
+ stringBuffer.append(TEXT_933);
+ if (genOperation.hasBody()) {
+ stringBuffer.append(TEXT_934);
+ stringBuffer.append(genOperation.getBody(genModel.getIndentation(stringBuffer)));
+ } else if (genOperation.isInvariant()) {GenClass opClass = genOperation.getGenClass(); String diagnostics = ((GenParameter)genOperation.getGenParameters().get(0)).getName(); String context = ((GenParameter)genOperation.getGenParameters().get(1)).getName();
+ stringBuffer.append(TEXT_935);
+ stringBuffer.append(diagnostics);
+ stringBuffer.append(TEXT_936);
+ stringBuffer.append(diagnostics);
+ stringBuffer.append(TEXT_937);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.BasicDiagnostic"));
+ stringBuffer.append(TEXT_938);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.Diagnostic"));
+ stringBuffer.append(TEXT_939);
+ stringBuffer.append(opClass.getGenPackage().getImportedValidatorClassName());
+ stringBuffer.append(TEXT_940);
+ stringBuffer.append(opClass.getGenPackage().getImportedValidatorClassName());
+ stringBuffer.append(TEXT_941);
+ stringBuffer.append(opClass.getOperationID(genOperation));
+ stringBuffer.append(TEXT_942);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.plugin.EcorePlugin"));
+ stringBuffer.append(TEXT_943);
+ stringBuffer.append(genOperation.getName());
+ stringBuffer.append(TEXT_944);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.EObjectValidator"));
+ stringBuffer.append(TEXT_945);
+ stringBuffer.append(context);
+ stringBuffer.append(TEXT_946);
+ stringBuffer.append(genModel.getNonNLS());
+ stringBuffer.append(genModel.getNonNLS(2));
+ stringBuffer.append(TEXT_947);
+ } else {
+ stringBuffer.append(TEXT_948);
+ //Class/implementedGenOperation.todo.override.javajetinc
+ }
+ stringBuffer.append(TEXT_949);
+ }
+ //Class/implementedGenOperation.override.javajetinc
+ }//for
+ if (isImplementation && !genModel.isReflectiveDelegation() && genClass.implementsAny(genClass.getEInverseAddGenFeatures())) {
+ stringBuffer.append(TEXT_950);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject"));
+ stringBuffer.append(TEXT_951);
+ for (Iterator i=genClass.getEInverseAddGenFeatures().iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();
+ if (!genModel.isMinimalReflectiveMethods() || genClass.getImplementedGenFeatures().contains(genFeature)) {
+ stringBuffer.append(TEXT_952);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_953);
+ if (genFeature.isListType()) {
+ if (genFeature.isMapType() && genFeature.isEffectiveSuppressEMFTypes()) {
+ stringBuffer.append(TEXT_954);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.InternalEList"));
+ stringBuffer.append(TEXT_955);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.EMap"));
+ stringBuffer.append(TEXT_956);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_957);
+ } else {
+ stringBuffer.append(TEXT_958);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.InternalEList"));
+ stringBuffer.append(TEXT_959);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_960);
+ }
+ } else if (genFeature.isContainer()) {
+ stringBuffer.append(TEXT_961);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_962);
+ } else {
+ if (genClass.getImplementingGenModel(genFeature).isVirtualDelegation()) {
+ stringBuffer.append(TEXT_963);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_964);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_965);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_966);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_967);
+ }
+ stringBuffer.append(TEXT_968);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_969);
+ if (genFeature.isEffectiveContains()) {
+ stringBuffer.append(TEXT_970);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject"));
+ stringBuffer.append(TEXT_971);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_972);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_973);
+ } else { GenFeature reverseFeature = genFeature.getReverse(); GenClass targetClass = reverseFeature.getGenClass();
+ stringBuffer.append(TEXT_974);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject"));
+ stringBuffer.append(TEXT_975);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_976);
+ stringBuffer.append(targetClass.getQualifiedFeatureID(reverseFeature));
+ stringBuffer.append(TEXT_977);
+ stringBuffer.append(targetClass.getImportedInterfaceName());
+ stringBuffer.append(TEXT_978);
+ }
+ stringBuffer.append(TEXT_979);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_980);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_981);
+ }
+ }
+ }
+ stringBuffer.append(TEXT_982);
+ if (genModel.isMinimalReflectiveMethods()) {
+ stringBuffer.append(TEXT_983);
+ } else {
+ stringBuffer.append(TEXT_984);
+ }
+ stringBuffer.append(TEXT_985);
+ }
+ if (isImplementation && !genModel.isReflectiveDelegation() && genClass.implementsAny(genClass.getEInverseRemoveGenFeatures())) {
+ stringBuffer.append(TEXT_986);
+ stringBuffer.append(genModel.getImportedName("java.lang.Object"));
+ stringBuffer.append(TEXT_987);
+ for (Iterator i=genClass.getEInverseRemoveGenFeatures().iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();
+ if (!genModel.isMinimalReflectiveMethods() || genClass.getImplementedGenFeatures().contains(genFeature)) {
+ stringBuffer.append(TEXT_988);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_989);
+ if (genFeature.isListType()) {
+ if (genFeature.isMapType() && genFeature.isEffectiveSuppressEMFTypes()) {
+ stringBuffer.append(TEXT_990);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.InternalEList"));
+ stringBuffer.append(TEXT_991);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.EMap"));
+ stringBuffer.append(TEXT_992);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_993);
+ } else if (genFeature.isWrappedFeatureMapType()) {
+ stringBuffer.append(TEXT_994);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_995);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_996);
+ } else {
+ stringBuffer.append(TEXT_997);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_998);
+ }
+ } else if (genFeature.isContainer()) {
+ stringBuffer.append(TEXT_999);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1000);
+ } else if (genFeature.isUnsettable()) {
+ stringBuffer.append(TEXT_1001);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_1002);
+ } else {
+ stringBuffer.append(TEXT_1003);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_1004);
+ }
+ }
+ }
+ stringBuffer.append(TEXT_1005);
+ if (genModel.isMinimalReflectiveMethods()) {
+ stringBuffer.append(TEXT_1006);
+ } else {
+ stringBuffer.append(TEXT_1007);
+ }
+ stringBuffer.append(TEXT_1008);
+ }
+ if (isImplementation && !genModel.isReflectiveDelegation() && genClass.implementsAny(genClass.getEBasicRemoveFromContainerGenFeatures())) {
+ stringBuffer.append(TEXT_1009);
+ for (Iterator i=genClass.getEBasicRemoveFromContainerGenFeatures().iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();
+ GenFeature reverseFeature = genFeature.getReverse(); GenClass targetClass = reverseFeature.getGenClass();
+ if (!genModel.isMinimalReflectiveMethods() || genClass.getImplementedGenFeatures().contains(genFeature)) {
+ stringBuffer.append(TEXT_1010);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1011);
+ stringBuffer.append(targetClass.getQualifiedFeatureID(reverseFeature));
+ stringBuffer.append(TEXT_1012);
+ stringBuffer.append(targetClass.getImportedInterfaceName());
+ stringBuffer.append(TEXT_1013);
+ }
+ }
+ stringBuffer.append(TEXT_1014);
+ if (genModel.isMinimalReflectiveMethods()) {
+ stringBuffer.append(TEXT_1015);
+ } else {
+ stringBuffer.append(TEXT_1016);
+ }
+ stringBuffer.append(TEXT_1017);
+ }
+ if (isImplementation && !genModel.isReflectiveDelegation() && !genClass.getImplementedGenFeatures().isEmpty()) {
+ stringBuffer.append(TEXT_1018);
+ for (Iterator i=genClass.getAllGenFeatures().iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();
+ if (!genModel.isMinimalReflectiveMethods() || genClass.getImplementedGenFeatures().contains(genFeature)) {
+ stringBuffer.append(TEXT_1019);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1020);
+ if (genFeature.isPrimitiveType()) {
+ if (genFeature.isBooleanType()) {
+ stringBuffer.append(TEXT_1021);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1022);
+ } else {
+ stringBuffer.append(TEXT_1023);
+ stringBuffer.append(genFeature.getObjectType());
+ stringBuffer.append(TEXT_1024);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1025);
+ }
+ } else if (genFeature.isResolveProxies() && !genFeature.isListType()) {
+ stringBuffer.append(TEXT_1026);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1027);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_1028);
+ } else if (genFeature.isMapType()) {
+ if (genFeature.isEffectiveSuppressEMFTypes()) {
+ stringBuffer.append(TEXT_1029);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.EMap"));
+ stringBuffer.append(TEXT_1030);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1031);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1032);
+ } else {
+ stringBuffer.append(TEXT_1033);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1034);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1035);
+ }
+ } else if (genFeature.isWrappedFeatureMapType()) {
+ stringBuffer.append(TEXT_1036);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1037);
+ } else if (genFeature.isFeatureMapType()) {
+ stringBuffer.append(TEXT_1038);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1039);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap"));
+ stringBuffer.append(TEXT_1040);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1041);
+ } else {
+ stringBuffer.append(TEXT_1042);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1043);
+ }
+ }
+ }
+ stringBuffer.append(TEXT_1044);
+ if (genModel.isMinimalReflectiveMethods()) {
+ stringBuffer.append(TEXT_1045);
+ } else {
+ stringBuffer.append(TEXT_1046);
+ }
+ stringBuffer.append(TEXT_1047);
+ }
+ if (isImplementation && !genModel.isReflectiveDelegation() && genClass.implementsAny(genClass.getESetGenFeatures())) {
+ stringBuffer.append(TEXT_1048);
+ for (Iterator i=genClass.getESetGenFeatures().iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();
+ if (!genModel.isMinimalReflectiveMethods() || genClass.getImplementedGenFeatures().contains(genFeature)) {
+ stringBuffer.append(TEXT_1049);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1050);
+ if (genFeature.isListType()) {
+ if (genFeature.isWrappedFeatureMapType()) {
+ stringBuffer.append(TEXT_1051);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_1052);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1053);
+ } else if (genFeature.isFeatureMapType()) {
+ stringBuffer.append(TEXT_1054);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap"));
+ stringBuffer.append(TEXT_1055);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1056);
+ } else if (genFeature.isMapType()) {
+ if (genFeature.isEffectiveSuppressEMFTypes()) {
+ stringBuffer.append(TEXT_1057);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
+ stringBuffer.append(TEXT_1058);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.EMap"));
+ stringBuffer.append(TEXT_1059);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1060);
+ } else {
+ stringBuffer.append(TEXT_1061);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
+ stringBuffer.append(TEXT_1062);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1063);
+ }
+ } else {
+ stringBuffer.append(TEXT_1064);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1065);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1066);
+ stringBuffer.append(genModel.getImportedName("java.util.Collection"));
+ stringBuffer.append(TEXT_1067);
+ }
+ } else if (genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_1068);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_1069);
+ stringBuffer.append(genFeature.getObjectType());
+ stringBuffer.append(TEXT_1070);
+ stringBuffer.append(genFeature.getPrimitiveValueFunction());
+ stringBuffer.append(TEXT_1071);
+ } else {
+ stringBuffer.append(TEXT_1072);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_1073);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_1074);
+ }
+ stringBuffer.append(TEXT_1075);
+ }
+ }
+ stringBuffer.append(TEXT_1076);
+ if (genModel.isMinimalReflectiveMethods()) {
+ stringBuffer.append(TEXT_1077);
+ } else {
+ stringBuffer.append(TEXT_1078);
+ }
+ stringBuffer.append(TEXT_1079);
+ for (Iterator i=genClass.getESetGenFeatures().iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();
+ if (!genModel.isMinimalReflectiveMethods() || genClass.getImplementedGenFeatures().contains(genFeature)) {
+ stringBuffer.append(TEXT_1080);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1081);
+ if (genFeature.isListType() && !genFeature.isUnsettable()) {
+ if (genFeature.isWrappedFeatureMapType()) {
+ stringBuffer.append(TEXT_1082);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_1083);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1084);
+ } else {
+ stringBuffer.append(TEXT_1085);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1086);
+ }
+ } else if (genFeature.isUnsettable()) {
+ stringBuffer.append(TEXT_1087);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_1088);
+ } else if (genFeature.isReferenceType()) {
+ stringBuffer.append(TEXT_1089);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_1090);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_1091);
+ } else {
+ stringBuffer.append(TEXT_1092);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_1093);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1094);
+ }
+ stringBuffer.append(TEXT_1095);
+ }
+ }
+ stringBuffer.append(TEXT_1096);
+ if (genModel.isMinimalReflectiveMethods()) {
+ stringBuffer.append(TEXT_1097);
+ } else {
+ stringBuffer.append(TEXT_1098);
+ }
+ stringBuffer.append(TEXT_1099);
+ }
+ if (isImplementation && !genModel.isReflectiveDelegation() && !genClass.getImplementedGenFeatures().isEmpty()) {
+ stringBuffer.append(TEXT_1100);
+ for (Iterator i=genClass.getAllGenFeatures().iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();
+ if (!genModel.isMinimalReflectiveMethods() || genClass.getImplementedGenFeatures().contains(genFeature)) {
+ stringBuffer.append(TEXT_1101);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1102);
+ if (genFeature.isListType() && !genFeature.isUnsettable()) {
+ if (genFeature.isWrappedFeatureMapType()) {
+ if (genFeature.isVolatile()) {
+ stringBuffer.append(TEXT_1103);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_1104);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1105);
+ } else {
+ stringBuffer.append(TEXT_1106);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_1107);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_1108);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1109);
+ }
+ } else {
+ if (genClass.isField(genFeature)) {
+ stringBuffer.append(TEXT_1110);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_1111);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_1112);
+ } else {
+ if (genFeature.isField() && genClass.getImplementingGenModel(genFeature).isVirtualDelegation()) {
+ stringBuffer.append(TEXT_1113);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_1114);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_1115);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_1116);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1117);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_1118);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_1119);
+ } else {
+ stringBuffer.append(TEXT_1120);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1121);
+ }
+ }
+ }
+ } else if (genFeature.isUnsettable()) {
+ stringBuffer.append(TEXT_1122);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_1123);
+ } else if (genFeature.isResolveProxies()) {
+ if (genClass.isField(genFeature)) {
+ stringBuffer.append(TEXT_1124);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_1125);
+ } else {
+ if (genFeature.isField() && genClass.getImplementingGenModel(genFeature).isVirtualDelegation()) {
+ stringBuffer.append(TEXT_1126);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1127);
+ } else {
+ stringBuffer.append(TEXT_1128);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_1129);
+ }
+ }
+ } else if (genFeature.isReferenceType()) {
+ if (genClass.isField(genFeature)) {
+ stringBuffer.append(TEXT_1130);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_1131);
+ } else {
+ if (genFeature.isField() && genClass.getImplementingGenModel(genFeature).isVirtualDelegation()) {
+ stringBuffer.append(TEXT_1132);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1133);
+ } else {
+ stringBuffer.append(TEXT_1134);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1135);
+ }
+ }
+ } else if (genFeature.isPrimitiveType() || genFeature.isEnumType()) {
+ if (genClass.isField(genFeature)) {
+ if (genClass.isFlag(genFeature)) {
+ stringBuffer.append(TEXT_1136);
+ stringBuffer.append(genClass.getFlagsField(genFeature));
+ stringBuffer.append(TEXT_1137);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1138);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1139);
+ } else {
+ stringBuffer.append(TEXT_1140);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_1141);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1142);
+ }
+ } else {
+ if (genFeature.isEnumType() && genFeature.isField() && genClass.getImplementingGenModel(genFeature).isVirtualDelegation()) {
+ stringBuffer.append(TEXT_1143);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1144);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1145);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1146);
+ } else {
+ stringBuffer.append(TEXT_1147);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1148);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1149);
+ }
+ }
+ } else {//datatype
+ if (genClass.isField(genFeature)) {
+ stringBuffer.append(TEXT_1150);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1151);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_1152);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1153);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_1154);
+ } else {
+ if (genFeature.isField() && genClass.getImplementingGenModel(genFeature).isVirtualDelegation()) {
+ stringBuffer.append(TEXT_1155);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_1156);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_1157);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_1158);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1159);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1160);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1161);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_1162);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1163);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_1164);
+ } else {
+ stringBuffer.append(TEXT_1165);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1166);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1167);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1168);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1169);
+ }
+ }
+ }
+ }
+ }
+ stringBuffer.append(TEXT_1170);
+ if (genModel.isMinimalReflectiveMethods()) {
+ stringBuffer.append(TEXT_1171);
+ } else {
+ stringBuffer.append(TEXT_1172);
+ }
+ stringBuffer.append(TEXT_1173);
+ //Class/eIsSet.override.javajetinc
+ }
+ if (isImplementation && !genClass.getMixinGenFeatures().isEmpty()) {
+ stringBuffer.append(TEXT_1174);
+ for (Iterator m=genClass.getMixinGenClasses().iterator(); m.hasNext();) { GenClass mixinGenClass = (GenClass)m.next();
+ stringBuffer.append(TEXT_1175);
+ stringBuffer.append(mixinGenClass.getImportedInterfaceName());
+ stringBuffer.append(TEXT_1176);
+ for (Iterator f=mixinGenClass.getGenFeatures().iterator(); f.hasNext();) { GenFeature genFeature = (GenFeature)f.next();
+ stringBuffer.append(TEXT_1177);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1178);
+ stringBuffer.append(mixinGenClass.getQualifiedFeatureID(genFeature));
+ stringBuffer.append(TEXT_1179);
+ }
+ stringBuffer.append(TEXT_1180);
+ }
+ stringBuffer.append(TEXT_1181);
+ for (Iterator m=genClass.getMixinGenClasses().iterator(); m.hasNext();) { GenClass mixinGenClass = (GenClass)m.next();
+ stringBuffer.append(TEXT_1182);
+ stringBuffer.append(mixinGenClass.getImportedInterfaceName());
+ stringBuffer.append(TEXT_1183);
+ for (Iterator f=mixinGenClass.getGenFeatures().iterator(); f.hasNext();) { GenFeature genFeature = (GenFeature)f.next();
+ stringBuffer.append(TEXT_1184);
+ stringBuffer.append(mixinGenClass.getQualifiedFeatureID(genFeature));
+ stringBuffer.append(TEXT_1185);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1186);
+ }
+ stringBuffer.append(TEXT_1187);
+ }
+ stringBuffer.append(TEXT_1188);
+ }
+ if (isImplementation && genModel.isVirtualDelegation()) { String eVirtualValuesField = genClass.getEVirtualValuesField();
+ if (eVirtualValuesField != null) {
+ stringBuffer.append(TEXT_1189);
+ stringBuffer.append(eVirtualValuesField);
+ stringBuffer.append(TEXT_1190);
+ stringBuffer.append(eVirtualValuesField);
+ stringBuffer.append(TEXT_1191);
+ }
+ { List eVirtualIndexBitFields = genClass.getEVirtualIndexBitFields(new ArrayList());
+ if (!eVirtualIndexBitFields.isEmpty()) { List allEVirtualIndexBitFields = genClass.getAllEVirtualIndexBitFields(new ArrayList());
+ stringBuffer.append(TEXT_1192);
+ for (int i = 0; i < allEVirtualIndexBitFields.size(); i++) {
+ stringBuffer.append(TEXT_1193);
+ stringBuffer.append(i);
+ stringBuffer.append(TEXT_1194);
+ stringBuffer.append(allEVirtualIndexBitFields.get(i));
+ stringBuffer.append(TEXT_1195);
+ }
+ stringBuffer.append(TEXT_1196);
+ for (int i = 0; i < allEVirtualIndexBitFields.size(); i++) {
+ stringBuffer.append(TEXT_1197);
+ stringBuffer.append(i);
+ stringBuffer.append(TEXT_1198);
+ stringBuffer.append(allEVirtualIndexBitFields.get(i));
+ stringBuffer.append(TEXT_1199);
+ }
+ stringBuffer.append(TEXT_1200);
+ }
+ }
+ }
+ if (isImplementation && !genModel.isReflectiveDelegation() && !genClass.getToStringGenFeatures().isEmpty()) {
+ stringBuffer.append(TEXT_1201);
+ { boolean first = true;
+ for (Iterator i=genClass.getToStringGenFeatures().iterator(); i.hasNext(); ) { GenFeature genFeature = (GenFeature)i.next();
+ if (first) { first = false;
+ stringBuffer.append(TEXT_1202);
+ stringBuffer.append(genFeature.getName());
+ stringBuffer.append(TEXT_1203);
+ stringBuffer.append(genModel.getNonNLS());
+ } else {
+ stringBuffer.append(TEXT_1204);
+ stringBuffer.append(genFeature.getName());
+ stringBuffer.append(TEXT_1205);
+ stringBuffer.append(genModel.getNonNLS());
+ }
+ if (genFeature.isUnsettable() && !genFeature.isListType()) {
+ if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_1206);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1207);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1208);
+ stringBuffer.append(genModel.getNonNLS());
+ } else {
+ if (genClass.isFlag(genFeature)) {
+ stringBuffer.append(TEXT_1209);
+ if (genClass.isESetFlag(genFeature)) {
+ stringBuffer.append(TEXT_1210);
+ stringBuffer.append(genClass.getESetFlagsField(genFeature));
+ stringBuffer.append(TEXT_1211);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1212);
+ } else {
+ stringBuffer.append(genFeature.getUncapName());
+ stringBuffer.append(TEXT_1213);
+ }
+ stringBuffer.append(TEXT_1214);
+ stringBuffer.append(genClass.getFlagsField(genFeature));
+ stringBuffer.append(TEXT_1215);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1216);
+ stringBuffer.append(genModel.getNonNLS());
+ } else {
+ stringBuffer.append(TEXT_1217);
+ if (genClass.isESetFlag(genFeature)) {
+ stringBuffer.append(TEXT_1218);
+ stringBuffer.append(genClass.getESetFlagsField(genFeature));
+ stringBuffer.append(TEXT_1219);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1220);
+ } else {
+ stringBuffer.append(genFeature.getUncapName());
+ stringBuffer.append(TEXT_1221);
+ }
+ stringBuffer.append(TEXT_1222);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_1223);
+ stringBuffer.append(genModel.getNonNLS());
+ }
+ }
+ } else {
+ if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_1224);
+ stringBuffer.append(genFeature.getUpperName());
+ if (!genFeature.isListType() && !genFeature.isReferenceType()){
+ stringBuffer.append(TEXT_1225);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1226);
+ }
+ stringBuffer.append(TEXT_1227);
+ } else {
+ if (genClass.isFlag(genFeature)) {
+ stringBuffer.append(TEXT_1228);
+ stringBuffer.append(genClass.getFlagsField(genFeature));
+ stringBuffer.append(TEXT_1229);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1230);
+ } else {
+ stringBuffer.append(TEXT_1231);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_1232);
+ }
+ }
+ }
+ }
+ }
+ stringBuffer.append(TEXT_1233);
+ }
+ if (isImplementation && genClass.isMapEntry()) { GenFeature keyFeature = genClass.getMapEntryKeyFeature(); GenFeature valueFeature = genClass.getMapEntryValueFeature();
+ stringBuffer.append(TEXT_1234);
+ if (keyFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_1235);
+ stringBuffer.append(keyFeature.getObjectType());
+ stringBuffer.append(TEXT_1236);
+ } else {
+ stringBuffer.append(TEXT_1237);
+ }
+ stringBuffer.append(TEXT_1238);
+ if (keyFeature.isListType()) {
+ stringBuffer.append(TEXT_1239);
+ stringBuffer.append(genModel.getImportedName("java.util.Collection"));
+ stringBuffer.append(TEXT_1240);
+ } else if (keyFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_1241);
+ stringBuffer.append(keyFeature.getObjectType());
+ stringBuffer.append(TEXT_1242);
+ stringBuffer.append(keyFeature.getPrimitiveValueFunction());
+ stringBuffer.append(TEXT_1243);
+ } else {
+ stringBuffer.append(TEXT_1244);
+ stringBuffer.append(keyFeature.getImportedType());
+ stringBuffer.append(TEXT_1245);
+ }
+ stringBuffer.append(TEXT_1246);
+ if (valueFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_1247);
+ stringBuffer.append(valueFeature.getObjectType());
+ stringBuffer.append(TEXT_1248);
+ } else {
+ stringBuffer.append(TEXT_1249);
+ }
+ stringBuffer.append(TEXT_1250);
+ if (valueFeature.isListType()) {
+ stringBuffer.append(TEXT_1251);
+ stringBuffer.append(genModel.getImportedName("java.util.Collection"));
+ stringBuffer.append(TEXT_1252);
+ } else if (valueFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_1253);
+ stringBuffer.append(valueFeature.getObjectType());
+ stringBuffer.append(TEXT_1254);
+ stringBuffer.append(valueFeature.getPrimitiveValueFunction());
+ stringBuffer.append(TEXT_1255);
+ } else {
+ stringBuffer.append(TEXT_1256);
+ stringBuffer.append(valueFeature.getImportedType());
+ stringBuffer.append(TEXT_1257);
+ }
+ stringBuffer.append(TEXT_1258);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.EMap"));
+ stringBuffer.append(TEXT_1259);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_1260);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.EMap"));
+ stringBuffer.append(TEXT_1261);
+ }
+ stringBuffer.append(TEXT_1262);
+ stringBuffer.append(isInterface ? " " + genClass.getInterfaceName() : genClass.getClassName());
+ // TODO fix the space above
+ genModel.emitSortedImports();
+ stringBuffer.append(TEXT_1263);
+ return stringBuffer.toString();
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/templates/model/SDOFactoryClass.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/templates/model/SDOFactoryClass.java
new file mode 100644
index 0000000000..2bad65a051
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/templates/model/SDOFactoryClass.java
@@ -0,0 +1,1153 @@
+package org.apache.tuscany.sdo.generate.templates.model;
+
+import org.apache.tuscany.sdo.generate.util.*;
+import java.util.*;
+import org.eclipse.emf.codegen.ecore.genmodel.*;
+import org.eclipse.emf.ecore.*;
+import org.eclipse.emf.codegen.ecore.genmodel.impl.Literals;
+import org.eclipse.emf.ecore.util.*;
+import org.eclipse.emf.codegen.util.CodeGenUtil;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+ public class SDOFactoryClass
+ {
+ protected static String nl;
+ public static synchronized SDOFactoryClass create(String lineSeparator)
+ {
+ nl = lineSeparator;
+ SDOFactoryClass result = new SDOFactoryClass();
+ nl = null;
+ return result;
+ }
+
+ protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
+ protected final String TEXT_1 = "";
+ protected final String TEXT_2 = "/**" + NL + " * <copyright>" + NL + " * </copyright>" + NL + " *" + NL + " * ";
+ protected final String TEXT_3 = "Id";
+ protected final String TEXT_4 = NL + " */";
+ protected final String TEXT_5 = NL + "package ";
+ protected final String TEXT_6 = ";";
+ protected final String TEXT_7 = NL + "package ";
+ protected final String TEXT_8 = ";";
+ protected final String TEXT_9 = NL + NL + "import commonj.sdo.helper.HelperContext;";
+ protected final String TEXT_10 = NL + "import org.apache.tuscany.sdo.helper.TypeHelperImpl;";
+ protected final String TEXT_11 = NL;
+ protected final String TEXT_12 = NL;
+ protected final String TEXT_13 = NL + "/**" + NL + " * <!-- begin-user-doc -->" + NL + " * The <b>Factory</b> for the model." + NL + " * It provides a create method for each non-abstract class of the model." + NL + " * <!-- end-user-doc -->";
+ protected final String TEXT_14 = NL + " * @see ";
+ protected final String TEXT_15 = NL + " * patternVersion=";
+ protected final String TEXT_16 = ";";
+ protected final String TEXT_17 = NL + " * @generated" + NL + " */";
+ protected final String TEXT_18 = NL + "/**" + NL + " * <!-- begin-user-doc -->" + NL + " * An implementation of the model <b>Factory</b>." + NL + " * Generator information:" + NL + " * patternVersion=";
+ protected final String TEXT_19 = ";";
+ protected final String TEXT_20 = NL + " * <!-- end-user-doc -->" + NL + " * @generated" + NL + " */";
+ protected final String TEXT_21 = NL + "public class ";
+ protected final String TEXT_22 = " extends ";
+ protected final String TEXT_23 = " implements ";
+ protected final String TEXT_24 = NL + "public interface ";
+ protected final String TEXT_25 = " extends ";
+ protected final String TEXT_26 = NL + "{";
+ protected final String TEXT_27 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\t";
+ protected final String TEXT_28 = " copyright = \"";
+ protected final String TEXT_29 = "\";";
+ protected final String TEXT_30 = NL;
+ protected final String TEXT_31 = NL;
+ protected final String TEXT_32 = NL + "\t/**" + NL + "\t * The singleton instance of the factory." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\t";
+ protected final String TEXT_33 = " INSTANCE = ";
+ protected final String TEXT_34 = ".init();" + NL;
+ protected final String TEXT_35 = NL + "\t/**" + NL + "\t * The singleton instance of the factory." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\t";
+ protected final String TEXT_36 = " eINSTANCE = ";
+ protected final String TEXT_37 = ".init();" + NL;
+ protected final String TEXT_38 = NL + "\t/**" + NL + "\t * The package namespace URI." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\t";
+ protected final String TEXT_39 = " NAMESPACE_URI = \"";
+ protected final String TEXT_40 = "\";";
+ protected final String TEXT_41 = NL + NL + "\t/**" + NL + "\t * The package namespace name." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\t";
+ protected final String TEXT_42 = " NAMESPACE_PREFIX = \"";
+ protected final String TEXT_43 = "\";";
+ protected final String TEXT_44 = NL + NL + "\t/**" + NL + "\t * The version of the generator pattern used to generate this class." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\t";
+ protected final String TEXT_45 = " PATTERN_VERSION = \"";
+ protected final String TEXT_46 = "\";" + NL;
+ protected final String TEXT_47 = "\t" + NL + "\t";
+ protected final String TEXT_48 = "int ";
+ protected final String TEXT_49 = " = ";
+ protected final String TEXT_50 = ";";
+ protected final String TEXT_51 = NL + "\t";
+ protected final String TEXT_52 = NL + "\t/**" + NL + "\t * Creates an instance of the factory." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
+ protected final String TEXT_53 = "()" + NL + "\t{" + NL + "\t\tsuper(NAMESPACE_URI, NAMESPACE_PREFIX, \"";
+ protected final String TEXT_54 = "\");" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Registers the Factory instance so that it is available within the supplied scope." + NL + " * @argument scope a HelperContext instance that will make the types supported by this Factory available." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */\t" + NL + "\tpublic void register(HelperContext scope) {" + NL + " if(scope == null) {" + NL + " throw new IllegalArgumentException(\"Scope can not be null\");" + NL + " } " + NL + " TypeHelperImpl th = (TypeHelperImpl)scope.getTypeHelper();" + NL + " th.getExtendedMetaData().putPackage(NAMESPACE_URI, this);" + NL + " }" + NL + "\t" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
+ protected final String TEXT_55 = " create(int typeNumber)" + NL + "\t{" + NL + "\t\tswitch (typeNumber)" + NL + "\t\t{";
+ protected final String TEXT_56 = NL + "\t\t\tcase ";
+ protected final String TEXT_57 = ": return (";
+ protected final String TEXT_58 = ")create";
+ protected final String TEXT_59 = "();";
+ protected final String TEXT_60 = NL + "\t\t\tdefault:" + NL + "\t\t\t\treturn super.create(typeNumber);" + NL + "\t\t}" + NL + "\t}" + NL;
+ protected final String TEXT_61 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Object createFromString(int typeNumber, String initialValue)" + NL + "\t{" + NL + "\t\tswitch (typeNumber)" + NL + "\t\t{";
+ protected final String TEXT_62 = NL + "\t\t\tcase ";
+ protected final String TEXT_63 = ":" + NL + "\t\t\t\treturn create";
+ protected final String TEXT_64 = "FromString(initialValue);";
+ protected final String TEXT_65 = NL + "\t\t\tdefault:" + NL + "\t\t\t\tthrow new IllegalArgumentException(\"The type number '\" + typeNumber + \"' is not a valid datatype\");";
+ protected final String TEXT_66 = NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic String convertToString(int typeNumber, Object instanceValue)" + NL + "\t{" + NL + "\t\tswitch (typeNumber)" + NL + "\t\t{";
+ protected final String TEXT_67 = NL + "\t\t\tcase ";
+ protected final String TEXT_68 = ":" + NL + "\t\t\t\treturn convert";
+ protected final String TEXT_69 = "ToString(instanceValue);";
+ protected final String TEXT_70 = NL + "\t\t\tdefault:" + NL + "\t\t\t\tthrow new IllegalArgumentException(\"The type number '\" + typeNumber + \"' is not a valid datatype\");";
+ protected final String TEXT_71 = NL + "\t\t}" + NL + "\t}";
+ protected final String TEXT_72 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
+ protected final String TEXT_73 = " create";
+ protected final String TEXT_74 = "()" + NL + "\t{";
+ protected final String TEXT_75 = NL + "\t\t";
+ protected final String TEXT_76 = " ";
+ protected final String TEXT_77 = " = ";
+ protected final String TEXT_78 = "super.create(";
+ protected final String TEXT_79 = ");";
+ protected final String TEXT_80 = NL + "\t\t";
+ protected final String TEXT_81 = " ";
+ protected final String TEXT_82 = " = new ";
+ protected final String TEXT_83 = "()";
+ protected final String TEXT_84 = "{}";
+ protected final String TEXT_85 = ";";
+ protected final String TEXT_86 = NL + "\t\treturn ";
+ protected final String TEXT_87 = ";" + NL + "\t}";
+ protected final String TEXT_88 = NL + "\t" + NL + "\t// Following creates and initializes SDO metadata for the supported types.";
+ protected final String TEXT_89 = "\t";
+ protected final String TEXT_90 = "\t" + NL + "\tprotected ";
+ protected final String TEXT_91 = " ";
+ protected final String TEXT_92 = "Type = null;" + NL + "" + NL + "\tpublic ";
+ protected final String TEXT_93 = " get";
+ protected final String TEXT_94 = "()" + NL + "\t{" + NL + "\t\treturn ";
+ protected final String TEXT_95 = "Type;" + NL + "\t}" + NL;
+ protected final String TEXT_96 = "\t" + NL + "" + NL + "\tprivate static boolean isInited = false;" + NL + "" + NL + "\tpublic static ";
+ protected final String TEXT_97 = " init()" + NL + "\t{" + NL + "\t\tif (isInited) return (";
+ protected final String TEXT_98 = ")FactoryBase.getStaticFactory(";
+ protected final String TEXT_99 = ".NAMESPACE_URI);" + NL + "\t\t";
+ protected final String TEXT_100 = " the";
+ protected final String TEXT_101 = " = new ";
+ protected final String TEXT_102 = "();" + NL + "\t\tisInited = true;" + NL + "" + NL + "\t\t// Initialize simple dependencies";
+ protected final String TEXT_103 = NL + "\t\t";
+ protected final String TEXT_104 = ".registerStaticTypes(";
+ protected final String TEXT_105 = ".class);";
+ protected final String TEXT_106 = NL + NL + "\t\t// Create package meta-data objects" + NL + "\t\tthe";
+ protected final String TEXT_107 = ".createMetaData();" + NL + "" + NL + "\t\t// Initialize created meta-data" + NL + "\t\tthe";
+ protected final String TEXT_108 = ".initializeMetaData();" + NL + "" + NL + "\t\t// Mark meta-data to indicate it can't be changed" + NL + "\t\t//the";
+ protected final String TEXT_109 = ".freeze(); //FB do we need to freeze / should we freeze ????" + NL + "" + NL + "\t\treturn the";
+ protected final String TEXT_110 = ";" + NL + "\t}" + NL + " " + NL + "\tprivate boolean isCreated = false;" + NL + "" + NL + "\tpublic void createMetaData()" + NL + "\t{" + NL + "\t\tif (isCreated) return;" + NL + "\t\tisCreated = true;";
+ protected final String TEXT_111 = "\t" + NL + "" + NL + "\t\t// Create types and their properties";
+ protected final String TEXT_112 = NL + " ";
+ protected final String TEXT_113 = "Type = createType(false, ";
+ protected final String TEXT_114 = ");";
+ protected final String TEXT_115 = NL + "\t\tcreateProperty(";
+ protected final String TEXT_116 = ", ";
+ protected final String TEXT_117 = "Type,";
+ protected final String TEXT_118 = ".INTERNAL_";
+ protected final String TEXT_119 = "); ";
+ protected final String TEXT_120 = NL + NL + "\t\t// Create data types";
+ protected final String TEXT_121 = NL + "\t\t";
+ protected final String TEXT_122 = "Type = createType(true, ";
+ protected final String TEXT_123 = " );";
+ protected final String TEXT_124 = NL + "\t}" + NL + "\t" + NL + "\tprivate boolean isInitialized = false;" + NL + "" + NL + "\tpublic void initializeMetaData()" + NL + "\t{" + NL + "\t\tif (isInitialized) return;" + NL + "\t\tisInitialized = true;";
+ protected final String TEXT_125 = NL + NL + "\t\t// Obtain other dependent packages";
+ protected final String TEXT_126 = NL + "\t\t";
+ protected final String TEXT_127 = " ";
+ protected final String TEXT_128 = " = (";
+ protected final String TEXT_129 = ")FactoryBase.getStaticFactory(";
+ protected final String TEXT_130 = ".NAMESPACE_URI);";
+ protected final String TEXT_131 = NL + "\t\t";
+ protected final String TEXT_132 = " property = null;" + NL + "" + NL + "\t\t// Add supertypes to types";
+ protected final String TEXT_133 = NL + "\t\taddSuperType(";
+ protected final String TEXT_134 = "Type, ";
+ protected final String TEXT_135 = "Type);";
+ protected final String TEXT_136 = NL + NL + "\t\t// Initialize types and properties";
+ protected final String TEXT_137 = NL + "\t\tinitializeType(";
+ protected final String TEXT_138 = "Type, ";
+ protected final String TEXT_139 = ".class, \"";
+ protected final String TEXT_140 = "\", ";
+ protected final String TEXT_141 = ");";
+ protected final String TEXT_142 = NL + "\t\tsetInstanceProperty (";
+ protected final String TEXT_143 = "Type, \"";
+ protected final String TEXT_144 = "\", ";
+ protected final String TEXT_145 = ", ";
+ protected final String TEXT_146 = ");";
+ protected final String TEXT_147 = NL + "\t\tproperty = getProperty(";
+ protected final String TEXT_148 = "Type, ";
+ protected final String TEXT_149 = ".INTERNAL_";
+ protected final String TEXT_150 = ");";
+ protected final String TEXT_151 = NL + "\t\tinitializeProperty(property, ";
+ protected final String TEXT_152 = ", \"";
+ protected final String TEXT_153 = "\", ";
+ protected final String TEXT_154 = ", ";
+ protected final String TEXT_155 = ", ";
+ protected final String TEXT_156 = ", ";
+ protected final String TEXT_157 = ", ";
+ protected final String TEXT_158 = ", ";
+ protected final String TEXT_159 = ", ";
+ protected final String TEXT_160 = ", ";
+ protected final String TEXT_161 = " , ";
+ protected final String TEXT_162 = ");";
+ protected final String TEXT_163 = NL + "\t\tinitializeProperty(property, ";
+ protected final String TEXT_164 = ", \"";
+ protected final String TEXT_165 = "\", ";
+ protected final String TEXT_166 = ", ";
+ protected final String TEXT_167 = ", ";
+ protected final String TEXT_168 = ", ";
+ protected final String TEXT_169 = ", ";
+ protected final String TEXT_170 = ", ";
+ protected final String TEXT_171 = ", ";
+ protected final String TEXT_172 = ");";
+ protected final String TEXT_173 = NL + "\t\tsetInstanceProperty (property, \"";
+ protected final String TEXT_174 = "\", ";
+ protected final String TEXT_175 = ", ";
+ protected final String TEXT_176 = ");";
+ protected final String TEXT_177 = NL;
+ protected final String TEXT_178 = NL + "\t\t// Initialize data types";
+ protected final String TEXT_179 = NL + "\t\tinitializeType(";
+ protected final String TEXT_180 = "Type, ";
+ protected final String TEXT_181 = ".class, \"";
+ protected final String TEXT_182 = "\", ";
+ protected final String TEXT_183 = ", ";
+ protected final String TEXT_184 = ");";
+ protected final String TEXT_185 = NL + "\t\tsetInstanceProperty (";
+ protected final String TEXT_186 = "Type, \"";
+ protected final String TEXT_187 = "\", ";
+ protected final String TEXT_188 = ", ";
+ protected final String TEXT_189 = ");";
+ protected final String TEXT_190 = NL;
+ protected final String TEXT_191 = NL + "\t\tcreateXSDMetaData(";
+ protected final String TEXT_192 = ");" + NL + "\t}" + NL + "\t " + NL + "\tprotected void createXSDMetaData(";
+ protected final String TEXT_193 = ")" + NL + "\t{" + NL + "\t\tsuper.initXSD();" + NL + "\t\t" + NL + "\t\t";
+ protected final String TEXT_194 = " property = null;" + NL + "\t\t";
+ protected final String TEXT_195 = NL + "\t\taddXSDMapping" + NL + "\t\t (new String[]" + NL + "\t\t\t {";
+ protected final String TEXT_196 = NL + "\t\t\t ";
+ protected final String TEXT_197 = ", ";
+ protected final String TEXT_198 = NL + "\t\t\t });" + NL;
+ protected final String TEXT_199 = NL;
+ protected final String TEXT_200 = NL + "\t\taddXSDMapping" + NL + "\t\t (";
+ protected final String TEXT_201 = "Type," + NL + "\t\t\t new String[] " + NL + "\t\t\t {";
+ protected final String TEXT_202 = NL + "\t\t\t ";
+ protected final String TEXT_203 = ", ";
+ protected final String TEXT_204 = NL + "\t\t\t });" + NL;
+ protected final String TEXT_205 = NL + "\t\tproperty = createGlobalProperty" + NL + "\t\t (\"";
+ protected final String TEXT_206 = "\"," + NL + "\t\t ";
+ protected final String TEXT_207 = ".get";
+ protected final String TEXT_208 = "()," + NL + "\t\t\t new String[]" + NL + "\t\t\t {";
+ protected final String TEXT_209 = NL + "\t\t\t ";
+ protected final String TEXT_210 = ", ";
+ protected final String TEXT_211 = NL + "\t\t\t }," + NL + "\t\t\t IS_ATTRIBUTE);";
+ protected final String TEXT_212 = NL + "\t\t\t });";
+ protected final String TEXT_213 = NL + " ";
+ protected final String TEXT_214 = NL + "\t\tsetInstanceProperty" + NL + "\t\t (property," + NL + "\t\t\t \"";
+ protected final String TEXT_215 = "\"," + NL + "\t\t\t ";
+ protected final String TEXT_216 = ", ";
+ protected final String TEXT_217 = ");";
+ protected final String TEXT_218 = NL + " ";
+ protected final String TEXT_219 = " ";
+ protected final String TEXT_220 = NL + "\t\taddXSDMapping" + NL + "\t\t\t(getProperty(";
+ protected final String TEXT_221 = "Type, ";
+ protected final String TEXT_222 = ".INTERNAL_";
+ protected final String TEXT_223 = ")," + NL + "\t\t\t new String[]" + NL + "\t\t\t {";
+ protected final String TEXT_224 = NL + "\t\t\t ";
+ protected final String TEXT_225 = ", ";
+ protected final String TEXT_226 = NL + "\t\t\t });" + NL;
+ protected final String TEXT_227 = NL + " }" + NL + " ";
+ protected final String TEXT_228 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
+ protected final String TEXT_229 = " create";
+ protected final String TEXT_230 = "FromString(String initialValue)" + NL + "\t{";
+ protected final String TEXT_231 = NL + "\t\t";
+ protected final String TEXT_232 = " result = ";
+ protected final String TEXT_233 = ".get(initialValue);" + NL + "\t\tif (result == null) throw new IllegalArgumentException(\"The value '\" + initialValue + \"' is not a valid enumerator of '\" + type.getName() + \"'\");";
+ protected final String TEXT_234 = NL + "\t\treturn result;";
+ protected final String TEXT_235 = NL + "\t\treturn (";
+ protected final String TEXT_236 = ")create";
+ protected final String TEXT_237 = "FromString(initialValue);";
+ protected final String TEXT_238 = NL + "\t\treturn (";
+ protected final String TEXT_239 = ")";
+ protected final String TEXT_240 = ".create";
+ protected final String TEXT_241 = "FromString(initialValue);";
+ protected final String TEXT_242 = NL + "\t\tif (initialValue == null) return null;" + NL + "\t\t";
+ protected final String TEXT_243 = " result = new ";
+ protected final String TEXT_244 = "();" + NL + "\t\tfor (";
+ protected final String TEXT_245 = " stringTokenizer = new ";
+ protected final String TEXT_246 = "(initialValue); stringTokenizer.hasMoreTokens(); )" + NL + "\t\t{" + NL + "\t\t\tString item = stringTokenizer.nextToken();";
+ protected final String TEXT_247 = NL + "\t\t\tresult.add(create";
+ protected final String TEXT_248 = "FromString(item));";
+ protected final String TEXT_249 = NL + "\t\t\tresult.add(";
+ protected final String TEXT_250 = ".create";
+ protected final String TEXT_251 = "FromString(item));";
+ protected final String TEXT_252 = NL + "\t\t}" + NL + "\t\treturn result;";
+ protected final String TEXT_253 = NL + "\t\tif (initialValue == null) return null;" + NL + "\t\t";
+ protected final String TEXT_254 = " result = null;" + NL + "\t\tRuntimeException exception = null;";
+ protected final String TEXT_255 = NL + "\t\ttry" + NL + "\t\t{";
+ protected final String TEXT_256 = NL + "\t\t\tresult = (";
+ protected final String TEXT_257 = ")create";
+ protected final String TEXT_258 = "FromString(initialValue);";
+ protected final String TEXT_259 = NL + "\t\t\tresult = (";
+ protected final String TEXT_260 = ")";
+ protected final String TEXT_261 = ".create";
+ protected final String TEXT_262 = "FromString(initialValue);";
+ protected final String TEXT_263 = NL + "\t\t\tif (result != null/* && Diagnostician.INSTANCE.validate(type, result, null, null)*/)" + NL + "\t\t\t{" + NL + "\t\t\t\treturn result;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tcatch (RuntimeException e)" + NL + "\t\t{" + NL + "\t\t\texception = e;" + NL + "\t\t}";
+ protected final String TEXT_264 = NL + "\t\tif (result != null || exception == null) return result;" + NL + " " + NL + "\t\tthrow exception;";
+ protected final String TEXT_265 = NL + "\t\t// TODO: implement this method" + NL + "\t\t// Ensure that you remove @generated or mark it @generated NOT" + NL + "\t\tthrow new ";
+ protected final String TEXT_266 = "();";
+ protected final String TEXT_267 = NL + "\t\treturn (";
+ protected final String TEXT_268 = ")super.createFromString(";
+ protected final String TEXT_269 = ", initialValue);";
+ protected final String TEXT_270 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic String convert";
+ protected final String TEXT_271 = "ToString(Object instanceValue)" + NL + "\t{";
+ protected final String TEXT_272 = NL + "\t\treturn instanceValue == null ? null : instanceValue.toString();";
+ protected final String TEXT_273 = NL + "\t\treturn convert";
+ protected final String TEXT_274 = "ToString(instanceValue);";
+ protected final String TEXT_275 = NL + "\t\treturn ";
+ protected final String TEXT_276 = ".convert";
+ protected final String TEXT_277 = "ToString(instanceValue);";
+ protected final String TEXT_278 = NL + "\t\tif (instanceValue == null) return null;" + NL + "\t\t";
+ protected final String TEXT_279 = " list = (";
+ protected final String TEXT_280 = ")instanceValue;" + NL + "\t\tif (list.isEmpty()) return \"\";" + NL + "\t\t";
+ protected final String TEXT_281 = " result = new ";
+ protected final String TEXT_282 = "();" + NL + "\t\tfor (";
+ protected final String TEXT_283 = " i = list.iterator(); i.hasNext(); )" + NL + "\t\t{";
+ protected final String TEXT_284 = NL + "\t\t\tresult.append(convert";
+ protected final String TEXT_285 = "ToString(i.next()));";
+ protected final String TEXT_286 = NL + "\t\t\tresult.append(";
+ protected final String TEXT_287 = ".convert";
+ protected final String TEXT_288 = "ToString(i.next()));";
+ protected final String TEXT_289 = NL + "\t\t\tresult.append(' ');" + NL + "\t\t}" + NL + "\t\treturn result.substring(0, result.length() - 1);";
+ protected final String TEXT_290 = NL + "\t\tif (instanceValue == null) return null;";
+ protected final String TEXT_291 = NL + "\t\tif (";
+ protected final String TEXT_292 = ".isInstance(instanceValue))" + NL + "\t\t{" + NL + "\t\t\ttry" + NL + "\t\t\t{";
+ protected final String TEXT_293 = NL + "\t\t\t\tString value = convert";
+ protected final String TEXT_294 = "ToString(instanceValue);";
+ protected final String TEXT_295 = NL + "\t\t\t\tString value = ";
+ protected final String TEXT_296 = ".convert";
+ protected final String TEXT_297 = "ToString(instanceValue);";
+ protected final String TEXT_298 = NL + "\t\t\t\tif (value != null) return value;" + NL + "\t\t\t}" + NL + "\t\t\tcatch (Exception e)" + NL + "\t\t\t{" + NL + "\t\t\t}" + NL + "\t\t}";
+ protected final String TEXT_299 = NL + "\t\tthrow new IllegalArgumentException(\"Invalid value: '\"+instanceValue+\"' for datatype :";
+ protected final String TEXT_300 = "\");";
+ protected final String TEXT_301 = NL + "\t\t// TODO: implement this method" + NL + "\t\t// Ensure that you remove @generated or mark it @generated NOT" + NL + "\t\tthrow new ";
+ protected final String TEXT_302 = "();";
+ protected final String TEXT_303 = NL + "\t\treturn super.convertToString(";
+ protected final String TEXT_304 = ", instanceValue);";
+ protected final String TEXT_305 = NL + "\t}" + NL;
+ protected final String TEXT_306 = NL + "\t/**" + NL + "\t * Returns a new object of class '<em>";
+ protected final String TEXT_307 = "</em>'." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @return a new object of class '<em>";
+ protected final String TEXT_308 = "</em>'." + NL + "\t * @generated" + NL + "\t */" + NL + "\t";
+ protected final String TEXT_309 = " create";
+ protected final String TEXT_310 = "();" + NL;
+ protected final String TEXT_311 = NL + " /**" + NL + " * Registers the types supported by this Factory within the supplied scope.argument" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @param scope an instance of HelperContext used to manage the scoping of types." + NL + "\t * @generated" + NL + " */" + NL + " public void register(HelperContext scope);" + NL + " ";
+ protected final String TEXT_312 = NL + "\t/**" + NL + "\t * Returns an instance of data type '<em>";
+ protected final String TEXT_313 = "</em>' corresponding the given literal." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @param literal a literal of the data type." + NL + "\t * @return a new instance value of the data type." + NL + "\t * @generated" + NL + "\t */" + NL + "\t";
+ protected final String TEXT_314 = " create";
+ protected final String TEXT_315 = "(String literal);" + NL + "" + NL + "\t/**" + NL + "\t * Returns a literal representation of an instance of data type '<em>";
+ protected final String TEXT_316 = "</em>'." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @param instanceValue an instance value of the data type." + NL + "\t * @return a literal representation of the instance value." + NL + "\t * @generated" + NL + "\t */" + NL + "\tString convert";
+ protected final String TEXT_317 = "(";
+ protected final String TEXT_318 = " instanceValue);" + NL;
+ protected final String TEXT_319 = NL + "} //";
+ protected final String TEXT_320 = NL;
+
+ public String generate(Object argument)
+ {
+ final StringBuffer stringBuffer = new StringBuffer();
+
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+ GenPackage genPackage = (GenPackage)((Object[])argument)[0]; GenModel genModel=genPackage.getGenModel();
+ boolean isInterface = Boolean.TRUE.equals(((Object[])argument)[1]); boolean isImplementation = Boolean.TRUE.equals(((Object[])argument)[2]);
+ String factoryPatternVersion = "1.1";
+ String publicStaticFinalFlag = isImplementation ? "public static final " : "";
+ stringBuffer.append(TEXT_1);
+ stringBuffer.append(TEXT_2);
+ stringBuffer.append("$");
+ stringBuffer.append(TEXT_3);
+ stringBuffer.append("$");
+ stringBuffer.append(TEXT_4);
+ if (isInterface || genModel.isSuppressInterfaces()) {
+ stringBuffer.append(TEXT_5);
+ stringBuffer.append(genPackage.getReflectionPackageName());
+ stringBuffer.append(TEXT_6);
+ } else {
+ stringBuffer.append(TEXT_7);
+ stringBuffer.append(genPackage.getClassPackageName());
+ stringBuffer.append(TEXT_8);
+ }
+ stringBuffer.append(TEXT_9);
+ if (!isInterface || genModel.isSuppressInterfaces()) {
+ stringBuffer.append(TEXT_10);
+ }
+ stringBuffer.append(TEXT_11);
+ if (isImplementation) {
+ if (!genPackage.hasJavaLangConflict() && !genPackage.hasInterfaceImplConflict() && !genPackage.getClassPackageName().equals(genPackage.getInterfacePackageName())) genModel.addImport(genPackage.getInterfacePackageName() + ".*");
+ }
+ genModel.markImportLocation(stringBuffer);
+ stringBuffer.append(TEXT_12);
+ if (isInterface) {
+ stringBuffer.append(TEXT_13);
+ if (!genModel.isSuppressEMFMetaData()) {
+ stringBuffer.append(TEXT_14);
+ stringBuffer.append(genPackage.getQualifiedPackageInterfaceName());
+ }
+ if (genModel.isSuppressInterfaces()) {
+ stringBuffer.append(TEXT_15);
+ stringBuffer.append(factoryPatternVersion);
+ stringBuffer.append(TEXT_16);
+ stringBuffer.append(SDOGenUtil.printArguments(genPackage, genModel) );
+ }
+ stringBuffer.append(TEXT_17);
+ } else {
+ stringBuffer.append(TEXT_18);
+ stringBuffer.append(factoryPatternVersion);
+ stringBuffer.append(TEXT_19);
+ stringBuffer.append(SDOGenUtil.printArguments(genPackage, genModel) );
+ stringBuffer.append(TEXT_20);
+ }
+ if (isImplementation) {
+ stringBuffer.append(TEXT_21);
+ stringBuffer.append(genPackage.getFactoryClassName());
+ stringBuffer.append(TEXT_22);
+ stringBuffer.append(genModel.getImportedName("org.apache.tuscany.sdo.impl.FactoryBase"));
+ if (!genModel.isSuppressInterfaces()) {
+ stringBuffer.append(TEXT_23);
+ stringBuffer.append(genPackage.getImportedFactoryInterfaceName());
+ }
+ } else {
+ stringBuffer.append(TEXT_24);
+ stringBuffer.append(genPackage.getFactoryInterfaceName());
+ if (!genModel.isSuppressEMFMetaData()) {
+ stringBuffer.append(TEXT_25);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.EFactory"));
+ }
+ }
+ stringBuffer.append(TEXT_26);
+ if (genModel.getCopyrightText() != null) {
+ stringBuffer.append(TEXT_27);
+ stringBuffer.append(publicStaticFinalFlag);
+ stringBuffer.append(genModel.getImportedName("java.lang.String"));
+ stringBuffer.append(TEXT_28);
+ stringBuffer.append(genModel.getCopyrightText());
+ stringBuffer.append(TEXT_29);
+ stringBuffer.append(genModel.getNonNLS());
+ stringBuffer.append(TEXT_30);
+ }
+ stringBuffer.append(TEXT_31);
+ if (isInterface && genModel.isSuppressEMFMetaData()) {
+ stringBuffer.append(TEXT_32);
+ stringBuffer.append(publicStaticFinalFlag);
+ stringBuffer.append(genPackage.getFactoryInterfaceName());
+ stringBuffer.append(TEXT_33);
+ stringBuffer.append(genPackage.getQualifiedFactoryClassName());
+ stringBuffer.append(TEXT_34);
+ } else if (isInterface && !genModel.isSuppressInterfaces()) {
+ stringBuffer.append(TEXT_35);
+ stringBuffer.append(publicStaticFinalFlag);
+ stringBuffer.append(genPackage.getFactoryInterfaceName());
+ stringBuffer.append(TEXT_36);
+ stringBuffer.append(genPackage.getQualifiedFactoryClassName());
+ stringBuffer.append(TEXT_37);
+ }
+ if (isImplementation) {
+ stringBuffer.append(TEXT_38);
+ stringBuffer.append(publicStaticFinalFlag);
+ stringBuffer.append(genModel.getImportedName("java.lang.String"));
+ stringBuffer.append(TEXT_39);
+ stringBuffer.append(genPackage.getNSURI());
+ stringBuffer.append(TEXT_40);
+ stringBuffer.append(genModel.getNonNLS());
+ stringBuffer.append(TEXT_41);
+ stringBuffer.append(publicStaticFinalFlag);
+ stringBuffer.append(genModel.getImportedName("java.lang.String"));
+ stringBuffer.append(TEXT_42);
+ stringBuffer.append(genPackage.getNSName());
+ stringBuffer.append(TEXT_43);
+ stringBuffer.append(genModel.getNonNLS());
+ stringBuffer.append(TEXT_44);
+ stringBuffer.append(publicStaticFinalFlag);
+ stringBuffer.append(genModel.getImportedName("java.lang.String"));
+ stringBuffer.append(TEXT_45);
+ stringBuffer.append(factoryPatternVersion);
+ stringBuffer.append(TEXT_46);
+ int genIndex = 1;
+for (Iterator i=genPackage.getOrderedGenClassifiers().iterator(); i.hasNext();) { GenClassifier genClassifier = (GenClassifier)i.next();
+ if (!genPackage.getClassifierID(genClassifier).equals("DOCUMENT_ROOT")) {
+ stringBuffer.append(TEXT_47);
+ stringBuffer.append(publicStaticFinalFlag);
+ stringBuffer.append(TEXT_48);
+ stringBuffer.append(genPackage.getClassifierID(genClassifier));
+ stringBuffer.append(TEXT_49);
+ stringBuffer.append(genIndex);
+ stringBuffer.append(TEXT_50);
+ genIndex++;
+ } }
+ stringBuffer.append(TEXT_51);
+ String factoryType = genModel.isSuppressEMFMetaData() ? genPackage.getFactoryClassName() : genPackage.getImportedFactoryInterfaceName();
+ stringBuffer.append(TEXT_52);
+ stringBuffer.append(genPackage.getFactoryClassName());
+ stringBuffer.append(TEXT_53);
+ stringBuffer.append(genPackage.getReflectionPackageName());
+ stringBuffer.append(TEXT_54);
+ stringBuffer.append(genModel.getImportedName("commonj.sdo.DataObject"));
+ stringBuffer.append(TEXT_55);
+ for (Iterator i=genPackage.getGenClasses().iterator(); i.hasNext();) { GenClass genClass = (GenClass)i.next();
+ if (!genClass.isAbstract() && !genClass.isDynamic()) {
+ stringBuffer.append(TEXT_56);
+ stringBuffer.append(genClass.getClassifierID());
+ stringBuffer.append(TEXT_57);
+ stringBuffer.append(genModel.getImportedName("commonj.sdo.DataObject"));
+ stringBuffer.append(TEXT_58);
+ stringBuffer.append(genClass.getName());
+ stringBuffer.append(TEXT_59);
+ }
+ }
+ stringBuffer.append(TEXT_60);
+ if (!genPackage.getAllGenDataTypes().isEmpty()) {
+ stringBuffer.append(TEXT_61);
+ for (Iterator i=genPackage.getAllGenDataTypes().iterator(); i.hasNext();) { GenDataType genDataType = (GenDataType)i.next();
+ if (genDataType.isSerializable()) {
+ stringBuffer.append(TEXT_62);
+ stringBuffer.append(genDataType.getClassifierID());
+ stringBuffer.append(TEXT_63);
+ stringBuffer.append(genDataType.getName());
+ stringBuffer.append(TEXT_64);
+ }
+ }
+ stringBuffer.append(TEXT_65);
+ stringBuffer.append(genModel.getNonNLS());
+ stringBuffer.append(genModel.getNonNLS(2));
+ stringBuffer.append(TEXT_66);
+ for (Iterator i=genPackage.getAllGenDataTypes().iterator(); i.hasNext();) { GenDataType genDataType = (GenDataType)i.next();
+ if (genDataType.isSerializable()) {
+ stringBuffer.append(TEXT_67);
+ stringBuffer.append(genDataType.getClassifierID());
+ stringBuffer.append(TEXT_68);
+ stringBuffer.append(genDataType.getName());
+ stringBuffer.append(TEXT_69);
+ }
+ }
+ stringBuffer.append(TEXT_70);
+ stringBuffer.append(genModel.getNonNLS());
+ stringBuffer.append(genModel.getNonNLS(2));
+ stringBuffer.append(TEXT_71);
+ }
+ for (Iterator i=genPackage.getGenClasses().iterator(); i.hasNext();) { GenClass genClass = (GenClass)i.next();
+ if (!genClass.isAbstract() && !genClass.isDynamic()) {
+ stringBuffer.append(TEXT_72);
+ stringBuffer.append(genClass.getImportedInterfaceName());
+ stringBuffer.append(TEXT_73);
+ stringBuffer.append(genClass.getName());
+ stringBuffer.append(TEXT_74);
+ if (genClass.isDynamic()) {
+ stringBuffer.append(TEXT_75);
+ stringBuffer.append(genClass.getImportedInterfaceName());
+ stringBuffer.append(TEXT_76);
+ stringBuffer.append(genClass.getSafeUncapName());
+ stringBuffer.append(TEXT_77);
+ stringBuffer.append(genClass.getCastFromEObject());
+ stringBuffer.append(TEXT_78);
+ stringBuffer.append(genClass.getQualifiedClassifierAccessor());
+ stringBuffer.append(TEXT_79);
+ } else {
+ stringBuffer.append(TEXT_80);
+ stringBuffer.append(genClass.getImportedClassName());
+ stringBuffer.append(TEXT_81);
+ stringBuffer.append(genClass.getSafeUncapName());
+ stringBuffer.append(TEXT_82);
+ stringBuffer.append(genClass.getImportedClassName());
+ stringBuffer.append(TEXT_83);
+ if (genModel.isSuppressInterfaces() && !genPackage.getReflectionPackageName().equals(genPackage.getInterfacePackageName())) {
+ stringBuffer.append(TEXT_84);
+ }
+ stringBuffer.append(TEXT_85);
+ }
+ stringBuffer.append(TEXT_86);
+ stringBuffer.append(genClass.getSafeUncapName());
+ stringBuffer.append(TEXT_87);
+ }
+ }
+ stringBuffer.append(TEXT_88);
+ for (Iterator i=genPackage.getOrderedGenClassifiers().iterator(); i.hasNext();) { GenClassifier genClassifier = (GenClassifier)i.next();
+ stringBuffer.append(TEXT_89);
+ if (!genPackage.getClassifierID(genClassifier).equals("DOCUMENT_ROOT")) {
+ stringBuffer.append(TEXT_90);
+ stringBuffer.append(genModel.getImportedName("commonj.sdo.Type"));
+ stringBuffer.append(TEXT_91);
+ stringBuffer.append(genClassifier.getSafeUncapName());
+ stringBuffer.append(TEXT_92);
+ stringBuffer.append(genModel.getImportedName("commonj.sdo.Type"));
+ stringBuffer.append(TEXT_93);
+ stringBuffer.append(genClassifier.getClassifierAccessorName());
+ stringBuffer.append(TEXT_94);
+ stringBuffer.append(genClassifier.getSafeUncapName());
+ stringBuffer.append(TEXT_95);
+ } }
+ stringBuffer.append(TEXT_96);
+ stringBuffer.append(factoryType);
+ stringBuffer.append(TEXT_97);
+ stringBuffer.append(factoryType);
+ stringBuffer.append(TEXT_98);
+ stringBuffer.append(factoryType);
+ stringBuffer.append(TEXT_99);
+ stringBuffer.append(factoryType);
+ stringBuffer.append(TEXT_100);
+ stringBuffer.append(factoryType);
+ stringBuffer.append(TEXT_101);
+ stringBuffer.append(factoryType);
+ stringBuffer.append(TEXT_102);
+ for (Iterator p=genPackage.getPackageSimpleDependencies().iterator(); p.hasNext();) { GenPackage dep = (GenPackage)p.next();
+ stringBuffer.append(TEXT_103);
+ stringBuffer.append(genModel.getImportedName("org.apache.tuscany.sdo.util.SDOUtil"));
+ stringBuffer.append(TEXT_104);
+ stringBuffer.append(dep.getImportedFactoryInterfaceName());
+ stringBuffer.append(TEXT_105);
+ }
+ stringBuffer.append(TEXT_106);
+ stringBuffer.append(factoryType);
+ stringBuffer.append(TEXT_107);
+ stringBuffer.append(factoryType);
+ stringBuffer.append(TEXT_108);
+ stringBuffer.append(factoryType);
+ stringBuffer.append(TEXT_109);
+ stringBuffer.append(factoryType);
+ stringBuffer.append(TEXT_110);
+ if (!genPackage.getGenClasses().isEmpty()) {
+ stringBuffer.append(TEXT_111);
+ for (Iterator c=genPackage.getGenClasses().iterator(); c.hasNext();) { GenClass genClass = (GenClass)c.next();
+ if (!genClass.isDynamic()) {
+ stringBuffer.append(TEXT_112);
+ stringBuffer.append(genClass.getSafeUncapName());
+ stringBuffer.append(TEXT_113);
+ stringBuffer.append(genPackage.getClassifierID(genClass));
+ stringBuffer.append(TEXT_114);
+ for (Iterator j=genClass.getGenFeatures().iterator(); j.hasNext();) { GenFeature genFeature = (GenFeature)j.next();
+ stringBuffer.append(TEXT_115);
+ stringBuffer.append(!genFeature.isReferenceType());
+ stringBuffer.append(TEXT_116);
+ stringBuffer.append(genClass.getSafeUncapName());
+ stringBuffer.append(TEXT_117);
+ stringBuffer.append(genClass.getClassName());
+ stringBuffer.append(TEXT_118);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_119);
+ }
+ }
+ }
+ }
+ if (!genPackage.getGenDataTypes().isEmpty()) {
+ stringBuffer.append(TEXT_120);
+ for (Iterator d=genPackage.getGenDataTypes().iterator(); d.hasNext();) { GenDataType genDataType = (GenDataType)d.next();
+ stringBuffer.append(TEXT_121);
+ stringBuffer.append(genDataType.getSafeUncapName());
+ stringBuffer.append(TEXT_122);
+ stringBuffer.append(genPackage.getClassifierID(genDataType));
+ stringBuffer.append(TEXT_123);
+ }
+ }
+ stringBuffer.append(TEXT_124);
+ if (!genPackage.getPackageInitializationDependencies().isEmpty()) {
+ stringBuffer.append(TEXT_125);
+ for (Iterator p=genPackage.getPackageInitializationDependencies().iterator(); p.hasNext();) { GenPackage dep = (GenPackage)p.next();
+ stringBuffer.append(TEXT_126);
+ stringBuffer.append(dep.getImportedFactoryClassName());
+ stringBuffer.append(TEXT_127);
+ stringBuffer.append(genPackage.getPackageInstanceVariable(dep));
+ stringBuffer.append(TEXT_128);
+ stringBuffer.append(dep.getImportedFactoryClassName());
+ stringBuffer.append(TEXT_129);
+ stringBuffer.append(dep.getImportedFactoryClassName());
+ stringBuffer.append(TEXT_130);
+ }
+ }
+ List annotationSources = genPackage.getAnnotationSources();
+ annotationSources.remove(ExtendedMetaData.ANNOTATION_URI);
+ stringBuffer.append(TEXT_131);
+ stringBuffer.append(genModel.getImportedName("commonj.sdo.Property"));
+ stringBuffer.append(TEXT_132);
+ for (Iterator c=genPackage.getGenClasses().iterator(); c.hasNext();) { GenClass genClass = (GenClass)c.next();
+ for (Iterator b=genClass.getBaseGenClasses().iterator(); b.hasNext();) { GenClass baseGenClass = (GenClass)b.next();
+ stringBuffer.append(TEXT_133);
+ stringBuffer.append(genClass.getSafeUncapName());
+ stringBuffer.append(TEXT_134);
+ stringBuffer.append(baseGenClass.getSafeUncapName());
+ stringBuffer.append(TEXT_135);
+ }
+ }
+ stringBuffer.append(TEXT_136);
+ for (Iterator i=genPackage.getGenClasses().iterator(); i.hasNext();) { GenClass genClass = (GenClass)i.next();
+ if (!genClass.isDynamic()) {
+ stringBuffer.append(TEXT_137);
+ stringBuffer.append(genClass.getSafeUncapName());
+ stringBuffer.append(TEXT_138);
+ stringBuffer.append(genClass.getImportedInterfaceName());
+ stringBuffer.append(TEXT_139);
+ stringBuffer.append(genClass.getName());
+ stringBuffer.append(TEXT_140);
+ stringBuffer.append(genClass.isAbstract());
+ stringBuffer.append(TEXT_141);
+ for (Iterator sources = annotationSources.iterator(); sources.hasNext();) { String annotationSource = (String)sources.next();
+ EAnnotation classAnnotation = genClass.getEcoreClassifier().getEAnnotation(annotationSource);
+ if (classAnnotation != null) {
+ for (Iterator k = classAnnotation.getDetails().iterator(); k.hasNext();) { Map.Entry detail = (Map.Entry)k.next(); String key = Literals.toStringLiteral((String)detail.getKey(), genModel); String value = Literals.toStringLiteral((String)detail.getValue(), genModel);
+ stringBuffer.append(TEXT_142);
+ stringBuffer.append(genClass.getSafeUncapName());
+ stringBuffer.append(TEXT_143);
+ stringBuffer.append(annotationSource);
+ stringBuffer.append(TEXT_144);
+ stringBuffer.append(key);
+ stringBuffer.append(TEXT_145);
+ stringBuffer.append(value);
+ stringBuffer.append(genModel.getNonNLS(key + value));
+ stringBuffer.append(TEXT_146);
+ }
+ }
+ }
+ for (Iterator j=genClass.getGenFeatures().iterator(); j.hasNext();) {GenFeature genFeature = (GenFeature)j.next();
+ String type = genFeature.getType().equals("commonj.sdo.Sequence") ? "getSequence()" : genPackage.getPackageInstanceVariable(genFeature.getTypeGenPackage()) + ".get" + genFeature.getTypeClassifierAccessorName() + "()";
+ stringBuffer.append(TEXT_147);
+ stringBuffer.append(genClass.getSafeUncapName());
+ stringBuffer.append(TEXT_148);
+ stringBuffer.append(genClass.getClassName());
+ stringBuffer.append(TEXT_149);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_150);
+ if (genFeature.isReferenceType()) { GenFeature reverseGenFeature = genFeature.getReverse();
+ String reverse = reverseGenFeature == null ? "null" : genPackage.getPackageInstanceVariable(reverseGenFeature.getGenPackage()) + ".get" + reverseGenFeature.getFeatureAccessorName() + "()";
+ stringBuffer.append(TEXT_151);
+ stringBuffer.append(type);
+ stringBuffer.append(TEXT_152);
+ stringBuffer.append(genFeature.getName());
+ stringBuffer.append(TEXT_153);
+ stringBuffer.append(genFeature.getDefaultValue());
+ stringBuffer.append(TEXT_154);
+ stringBuffer.append(genFeature.getLowerBound());
+ stringBuffer.append(TEXT_155);
+ stringBuffer.append(genFeature.getUpperBound());
+ stringBuffer.append(TEXT_156);
+ stringBuffer.append(genFeature.getContainerClass());
+ stringBuffer.append(TEXT_157);
+ stringBuffer.append(genFeature.getChangeableFlag().equals("IS_CHANGEABLE") ? "false" : "true");
+ stringBuffer.append(TEXT_158);
+ stringBuffer.append(genFeature.getUnsettableFlag().equals("IS_UNSETTABLE") ? "true": "false");
+ stringBuffer.append(TEXT_159);
+ stringBuffer.append(genFeature.getDerivedFlag().equals("IS_DERIVED") ? "true" : "false");
+ stringBuffer.append(TEXT_160);
+ stringBuffer.append(genFeature.getContainmentFlag().equals("IS_COMPOSITE")? "true": "false");
+ stringBuffer.append(TEXT_161);
+ stringBuffer.append(reverse);
+ stringBuffer.append(TEXT_162);
+ }else{
+ stringBuffer.append(TEXT_163);
+ stringBuffer.append(type);
+ stringBuffer.append(TEXT_164);
+ stringBuffer.append(genFeature.getName());
+ stringBuffer.append(TEXT_165);
+ stringBuffer.append(genFeature.getDefaultValue());
+ stringBuffer.append(TEXT_166);
+ stringBuffer.append(genFeature.getLowerBound());
+ stringBuffer.append(TEXT_167);
+ stringBuffer.append(genFeature.getUpperBound());
+ stringBuffer.append(TEXT_168);
+ stringBuffer.append(genFeature.getContainerClass());
+ stringBuffer.append(TEXT_169);
+ stringBuffer.append(genFeature.getChangeableFlag().equals("IS_CHANGEABLE") ? "false" : "true");
+ stringBuffer.append(TEXT_170);
+ stringBuffer.append(genFeature.getUnsettableFlag().equals("IS_UNSETTABLE") ? "true": "false");
+ stringBuffer.append(TEXT_171);
+ stringBuffer.append(genFeature.getDerivedFlag().equals("IS_DERIVED") ? "true" : "false");
+ stringBuffer.append(TEXT_172);
+ }
+ for (Iterator sources = annotationSources.iterator(); sources.hasNext();) { String annotationSource = (String)sources.next();
+ EAnnotation featureAnnotation = genFeature.getEcoreFeature().getEAnnotation(annotationSource);
+ if (featureAnnotation != null) {
+ for (Iterator k = featureAnnotation.getDetails().iterator(); k.hasNext();) { Map.Entry detail = (Map.Entry)k.next(); String key = Literals.toStringLiteral((String)detail.getKey(), genModel); String value = Literals.toStringLiteral((String)detail.getValue(), genModel);
+ stringBuffer.append(TEXT_173);
+ stringBuffer.append(annotationSource);
+ stringBuffer.append(TEXT_174);
+ stringBuffer.append(key);
+ stringBuffer.append(TEXT_175);
+ stringBuffer.append(value);
+ stringBuffer.append(genModel.getNonNLS(key + value));
+ stringBuffer.append(TEXT_176);
+ }
+ }
+ }
+ stringBuffer.append(TEXT_177);
+ }
+ }
+ }
+ if (!genPackage.getGenDataTypes().isEmpty()) {
+ stringBuffer.append(TEXT_178);
+ for (Iterator d=genPackage.getGenDataTypes().iterator(); d.hasNext();) { GenDataType genDataType = (GenDataType)d.next();
+ stringBuffer.append(TEXT_179);
+ stringBuffer.append(genDataType.getSafeUncapName());
+ stringBuffer.append(TEXT_180);
+ stringBuffer.append(genDataType.getImportedInstanceClassName());
+ stringBuffer.append(TEXT_181);
+ stringBuffer.append(genDataType.getName());
+ stringBuffer.append(TEXT_182);
+ stringBuffer.append(genDataType.getSerializableFlag().equals("IS_SERIALIZABLE") ? "true" : "false");
+ stringBuffer.append(TEXT_183);
+ stringBuffer.append(genDataType.getGeneratedInstanceClassFlag().equals("IS_GENERATED_INSTANCE_CLASS") ? "true" : "false" );
+ stringBuffer.append(TEXT_184);
+ stringBuffer.append(genModel.getNonNLS());
+ for (Iterator sources = annotationSources.iterator(); sources.hasNext();) { String annotationSource = (String)sources.next();
+ EAnnotation dataTypeAnnotation = genDataType.getEcoreDataType().getEAnnotation(annotationSource);
+ if (dataTypeAnnotation != null) {
+ for (Iterator k = dataTypeAnnotation.getDetails().iterator(); k.hasNext();) { Map.Entry detail = (Map.Entry)k.next(); String key = Literals.toStringLiteral((String)detail.getKey(), genModel); String value = Literals.toStringLiteral((String)detail.getValue(), genModel);
+ stringBuffer.append(TEXT_185);
+ stringBuffer.append(genDataType.getSafeUncapName());
+ stringBuffer.append(TEXT_186);
+ stringBuffer.append(annotationSource);
+ stringBuffer.append(TEXT_187);
+ stringBuffer.append(key);
+ stringBuffer.append(TEXT_188);
+ stringBuffer.append(value);
+ stringBuffer.append(genModel.getNonNLS(key + value));
+ stringBuffer.append(TEXT_189);
+ }
+ }
+ }
+ stringBuffer.append(TEXT_190);
+ }
+ }
+ stringBuffer.append(TEXT_191);
+ stringBuffer.append(SDOGenUtil.getDependentFactoryArgumentList(genPackage, false));
+ stringBuffer.append(TEXT_192);
+ stringBuffer.append(SDOGenUtil.getDependentFactoryArgumentList(genPackage, true));
+ stringBuffer.append(TEXT_193);
+ stringBuffer.append(genModel.getImportedName("commonj.sdo.Property"));
+ stringBuffer.append(TEXT_194);
+ String extendedMetaDataSource = ExtendedMetaData.ANNOTATION_URI;
+ EAnnotation packageAnnotation = genPackage.getEcorePackage().getEAnnotation(extendedMetaDataSource);
+ if (packageAnnotation != null){
+ stringBuffer.append(TEXT_195);
+ for (Iterator k = packageAnnotation.getDetails().iterator(); k.hasNext();) { Map.Entry detail = (Map.Entry)k.next(); String key = Literals.toStringLiteral((String)detail.getKey(), genModel); String value = Literals.toStringLiteral((String)detail.getValue(), genModel);
+ stringBuffer.append(TEXT_196);
+ stringBuffer.append(key);
+ stringBuffer.append(TEXT_197);
+ stringBuffer.append(value);
+ stringBuffer.append(k.hasNext() ? "," : "");
+ stringBuffer.append(genModel.getNonNLS(key + value));
+ }
+ stringBuffer.append(TEXT_198);
+ }
+ stringBuffer.append(TEXT_199);
+ for (Iterator i=genPackage.getGenClassifiers().iterator(); i.hasNext();) { GenClassifier genClassifier = (GenClassifier)i.next(); EAnnotation classAnnotation = genClassifier.getEcoreClassifier().getEAnnotation(extendedMetaDataSource);
+ if (classAnnotation != null && !genClassifier.getName().equals("DocumentRoot")) {
+ stringBuffer.append(TEXT_200);
+ stringBuffer.append(genClassifier.getSafeUncapName());
+ stringBuffer.append(TEXT_201);
+ for (Iterator k = classAnnotation.getDetails().iterator(); k.hasNext();) { Map.Entry detail = (Map.Entry)k.next(); String key = Literals.toStringLiteral((String)detail.getKey(), genModel); String value = Literals.toStringLiteral((String)detail.getValue(), genModel);
+ stringBuffer.append(TEXT_202);
+ stringBuffer.append(key);
+ stringBuffer.append(TEXT_203);
+ stringBuffer.append(value);
+ stringBuffer.append(k.hasNext() ? "," : "");
+ stringBuffer.append(genModel.getNonNLS(key + value));
+ }
+ stringBuffer.append(TEXT_204);
+ }
+ if (genClassifier instanceof GenClass) { GenClass genClass = (GenClass) genClassifier;
+ for (Iterator j=genClass.getGenFeatures().iterator(); j.hasNext();) { GenFeature genFeature = (GenFeature)j.next();
+ EAnnotation featureAnnotation = genFeature.getEcoreFeature().getEAnnotation(extendedMetaDataSource);
+ if (genClass.getName().equals("DocumentRoot")) {
+ if (!(genFeature.getName().equals("mixed") || genFeature.getName().equals("xMLNSPrefixMap") || genFeature.getName().equals("xSISchemaLocation"))) {
+ stringBuffer.append(TEXT_205);
+ stringBuffer.append(genFeature.getName());
+ stringBuffer.append(TEXT_206);
+ stringBuffer.append(genPackage.getPackageInstanceVariable(genFeature.getTypeGenPackage()));
+ stringBuffer.append(TEXT_207);
+ stringBuffer.append(genFeature.getTypeClassifierAccessorName());
+ stringBuffer.append(TEXT_208);
+ for (Iterator k = featureAnnotation.getDetails().iterator(); k.hasNext();) { Map.Entry detail = (Map.Entry)k.next(); String key = Literals.toStringLiteral((String)detail.getKey(), genModel); String value = Literals.toStringLiteral((String)detail.getValue(), genModel);
+ stringBuffer.append(TEXT_209);
+ stringBuffer.append(key);
+ stringBuffer.append(TEXT_210);
+ stringBuffer.append(value);
+ stringBuffer.append(k.hasNext() ? "," : "");
+ stringBuffer.append(genModel.getNonNLS(key + value));
+ }
+ if (!genFeature.isReferenceType()) {
+ stringBuffer.append(TEXT_211);
+ } else {
+ stringBuffer.append(TEXT_212);
+ }
+ stringBuffer.append(TEXT_213);
+ for (Iterator sources = genPackage.getAnnotationSources().iterator(); sources.hasNext();) { String annotationSource = (String)sources.next();
+ if (!annotationSource.equals(extendedMetaDataSource)) {
+ EAnnotation globalAnnotation = genFeature.getEcoreFeature().getEAnnotation(annotationSource);
+ if (globalAnnotation != null) {
+ for (Iterator k = globalAnnotation.getDetails().iterator(); k.hasNext();) { Map.Entry detail = (Map.Entry)k.next(); String key = Literals.toStringLiteral((String)detail.getKey(), genModel); String value = Literals.toStringLiteral((String)detail.getValue(), genModel);
+ stringBuffer.append(TEXT_214);
+ stringBuffer.append(annotationSource);
+ stringBuffer.append(TEXT_215);
+ stringBuffer.append(key);
+ stringBuffer.append(TEXT_216);
+ stringBuffer.append(value);
+ stringBuffer.append(genModel.getNonNLS(key + value));
+ stringBuffer.append(TEXT_217);
+ }
+ stringBuffer.append(TEXT_218);
+ }
+ }
+ stringBuffer.append(TEXT_219);
+ }
+ }
+ } else {
+ stringBuffer.append(TEXT_220);
+ stringBuffer.append(genClassifier.getSafeUncapName());
+ stringBuffer.append(TEXT_221);
+ stringBuffer.append(genClass.getClassName());
+ stringBuffer.append(TEXT_222);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_223);
+ for (Iterator k = featureAnnotation.getDetails().iterator(); k.hasNext();) { Map.Entry detail = (Map.Entry)k.next(); String key = Literals.toStringLiteral((String)detail.getKey(), genModel); String value = Literals.toStringLiteral((String)detail.getValue(), genModel);
+ stringBuffer.append(TEXT_224);
+ stringBuffer.append(key);
+ stringBuffer.append(TEXT_225);
+ stringBuffer.append(value);
+ stringBuffer.append(k.hasNext() ? "," : "");
+ stringBuffer.append(genModel.getNonNLS(key + value));
+ }
+ stringBuffer.append(TEXT_226);
+ }
+ }
+ }
+ }
+ stringBuffer.append(TEXT_227);
+ for (Iterator i=genPackage.getAllGenDataTypes().iterator(); i.hasNext();) { GenDataType genDataType = (GenDataType)i.next();
+ if (genDataType.isSerializable()) {
+ stringBuffer.append(TEXT_228);
+ stringBuffer.append(genDataType.getObjectInstanceClassName());
+ stringBuffer.append(TEXT_229);
+ stringBuffer.append(genDataType.getName());
+ stringBuffer.append(TEXT_230);
+ if (genDataType instanceof GenEnum) {
+ stringBuffer.append(TEXT_231);
+ stringBuffer.append(((GenEnum)genDataType).getImportedInstanceClassName());
+ stringBuffer.append(TEXT_232);
+ stringBuffer.append(((GenEnum)genDataType).getImportedInstanceClassName());
+ stringBuffer.append(TEXT_233);
+ stringBuffer.append(genModel.getNonNLS());
+ stringBuffer.append(genModel.getNonNLS(2));
+ stringBuffer.append(genModel.getNonNLS(3));
+ stringBuffer.append(TEXT_234);
+ } else if (genDataType.getBaseType() != null) { GenDataType genBaseType = genDataType.getBaseType();
+ if (genBaseType.getGenPackage() == genPackage) {
+ stringBuffer.append(TEXT_235);
+ stringBuffer.append(genDataType.getObjectInstanceClassName());
+ stringBuffer.append(TEXT_236);
+ stringBuffer.append(genBaseType.getName());
+ stringBuffer.append(TEXT_237);
+ } else {
+ stringBuffer.append(TEXT_238);
+ stringBuffer.append(genDataType.getObjectInstanceClassName());
+ stringBuffer.append(TEXT_239);
+ stringBuffer.append(SDOGenUtil.getFactoryImpl(genBaseType.getGenPackage()));
+ stringBuffer.append(TEXT_240);
+ stringBuffer.append(genBaseType.getName());
+ stringBuffer.append(TEXT_241);
+ }
+ } else if (genDataType.getItemType() != null) { GenDataType genItemType = genDataType.getItemType();
+ stringBuffer.append(TEXT_242);
+ stringBuffer.append(genModel.getImportedName("java.util.List"));
+ stringBuffer.append(TEXT_243);
+ stringBuffer.append(genModel.getImportedName("java.util.ArrayList"));
+ stringBuffer.append(TEXT_244);
+ stringBuffer.append(genModel.getImportedName("java.util.StringTokenizer"));
+ stringBuffer.append(TEXT_245);
+ stringBuffer.append(genModel.getImportedName("java.util.StringTokenizer"));
+ stringBuffer.append(TEXT_246);
+ if (genItemType.getGenPackage() == genPackage) {
+ stringBuffer.append(TEXT_247);
+ stringBuffer.append(genItemType.getName());
+ stringBuffer.append(TEXT_248);
+ } else {
+ stringBuffer.append(TEXT_249);
+ stringBuffer.append(SDOGenUtil.getFactoryImpl(genItemType.getGenPackage()));
+ stringBuffer.append(TEXT_250);
+ stringBuffer.append(genItemType.getName());
+ stringBuffer.append(TEXT_251);
+ }
+ stringBuffer.append(TEXT_252);
+ } else if (!genDataType.getMemberTypes().isEmpty()) {
+ stringBuffer.append(TEXT_253);
+ stringBuffer.append(genDataType.getObjectInstanceClassName());
+ stringBuffer.append(TEXT_254);
+ for (Iterator j = genDataType.getMemberTypes().iterator(); j.hasNext(); ) { GenDataType genMemberType = (GenDataType)j.next();
+ stringBuffer.append(TEXT_255);
+ if (genMemberType.getGenPackage() == genPackage) {
+ stringBuffer.append(TEXT_256);
+ stringBuffer.append(genDataType.getObjectInstanceClassName());
+ stringBuffer.append(TEXT_257);
+ stringBuffer.append(genMemberType.getName());
+ stringBuffer.append(TEXT_258);
+ } else {
+ stringBuffer.append(TEXT_259);
+ stringBuffer.append(genDataType.getObjectInstanceClassName());
+ stringBuffer.append(TEXT_260);
+ stringBuffer.append(SDOGenUtil.getFactoryImpl(genMemberType.getGenPackage()));
+ stringBuffer.append(TEXT_261);
+ stringBuffer.append(genMemberType.getName());
+ stringBuffer.append(TEXT_262);
+ }
+ stringBuffer.append(TEXT_263);
+ }
+ stringBuffer.append(TEXT_264);
+ } else if (genDataType.isArrayType()) {
+ stringBuffer.append(TEXT_265);
+ stringBuffer.append(genModel.getImportedName("java.lang.UnsupportedOperationException"));
+ stringBuffer.append(TEXT_266);
+ } else {
+ stringBuffer.append(TEXT_267);
+ stringBuffer.append(genDataType.getObjectInstanceClassName());
+ stringBuffer.append(TEXT_268);
+ stringBuffer.append(genDataType.getClassifierID());
+ stringBuffer.append(TEXT_269);
+ }
+ stringBuffer.append(TEXT_270);
+ stringBuffer.append(genDataType.getName());
+ stringBuffer.append(TEXT_271);
+ if (genDataType instanceof GenEnum) {
+ stringBuffer.append(TEXT_272);
+ } else if (genDataType.getBaseType() != null) { GenDataType genBaseType = genDataType.getBaseType();
+ if (genBaseType.getGenPackage() == genPackage) {
+ stringBuffer.append(TEXT_273);
+ stringBuffer.append(genBaseType.getName());
+ stringBuffer.append(TEXT_274);
+ } else {
+ stringBuffer.append(TEXT_275);
+ stringBuffer.append(SDOGenUtil.getFactoryImpl(genBaseType.getGenPackage()));
+ stringBuffer.append(TEXT_276);
+ stringBuffer.append(genBaseType.getName());
+ stringBuffer.append(TEXT_277);
+ }
+ } else if (genDataType.getItemType() != null) { GenDataType genItemType = genDataType.getItemType();
+ stringBuffer.append(TEXT_278);
+ stringBuffer.append(genModel.getImportedName("java.util.List"));
+ stringBuffer.append(TEXT_279);
+ stringBuffer.append(genModel.getImportedName("java.util.List"));
+ stringBuffer.append(TEXT_280);
+ stringBuffer.append(genModel.getImportedName("java.lang.StringBuffer"));
+ stringBuffer.append(TEXT_281);
+ stringBuffer.append(genModel.getImportedName("java.lang.StringBuffer"));
+ stringBuffer.append(TEXT_282);
+ stringBuffer.append(genModel.getImportedName("java.util.Iterator"));
+ stringBuffer.append(TEXT_283);
+ if (genItemType.getGenPackage() == genPackage) {
+ stringBuffer.append(TEXT_284);
+ stringBuffer.append(genItemType.getName());
+ stringBuffer.append(TEXT_285);
+ } else {
+ stringBuffer.append(TEXT_286);
+ stringBuffer.append(SDOGenUtil.getFactoryImpl(genItemType.getGenPackage()));
+ stringBuffer.append(TEXT_287);
+ stringBuffer.append(genItemType.getName());
+ stringBuffer.append(TEXT_288);
+ }
+ stringBuffer.append(TEXT_289);
+ } else if (!genDataType.getMemberTypes().isEmpty()) {
+ stringBuffer.append(TEXT_290);
+ for (Iterator j = genDataType.getMemberTypes().iterator(); j.hasNext(); ) { GenDataType genMemberType = (GenDataType)j.next();
+ stringBuffer.append(TEXT_291);
+ stringBuffer.append(SDOGenUtil.getQualifiedTypeAccessor(genMemberType));
+ stringBuffer.append(TEXT_292);
+ if (genMemberType.getGenPackage() == genPackage) {
+ stringBuffer.append(TEXT_293);
+ stringBuffer.append(genMemberType.getName());
+ stringBuffer.append(TEXT_294);
+ } else {
+ stringBuffer.append(TEXT_295);
+ stringBuffer.append(SDOGenUtil.getFactoryImpl(genMemberType.getGenPackage()));
+ stringBuffer.append(TEXT_296);
+ stringBuffer.append(genMemberType.getName());
+ stringBuffer.append(TEXT_297);
+ }
+ stringBuffer.append(TEXT_298);
+ }
+ stringBuffer.append(TEXT_299);
+ stringBuffer.append(genDataType.getName());
+ stringBuffer.append(TEXT_300);
+ } else if (genDataType.isArrayType()) {
+ stringBuffer.append(TEXT_301);
+ stringBuffer.append(genModel.getImportedName("java.lang.UnsupportedOperationException"));
+ stringBuffer.append(TEXT_302);
+ } else {
+ stringBuffer.append(TEXT_303);
+ stringBuffer.append(genDataType.getClassifierID());
+ stringBuffer.append(TEXT_304);
+ }
+ stringBuffer.append(TEXT_305);
+ }
+ }
+ } else {
+ for (Iterator i=genPackage.getGenClasses().iterator(); i.hasNext();) { GenClass genClass = (GenClass)i.next();
+ if (genClass.hasFactoryInterfaceCreateMethod()) {
+ stringBuffer.append(TEXT_306);
+ stringBuffer.append(genClass.getFormattedName());
+ stringBuffer.append(TEXT_307);
+ stringBuffer.append(genClass.getFormattedName());
+ stringBuffer.append(TEXT_308);
+ stringBuffer.append(genClass.getImportedInterfaceName());
+ stringBuffer.append(TEXT_309);
+ stringBuffer.append(genClass.getName());
+ stringBuffer.append(TEXT_310);
+ }
+ }
+ stringBuffer.append(TEXT_311);
+ if (genPackage.isDataTypeConverters()) {
+ for (Iterator i=genPackage.getAllGenDataTypes().iterator(); i.hasNext();) { GenDataType genDataType = (GenDataType)i.next();
+ if (genDataType.isSerializable()) {
+ stringBuffer.append(TEXT_312);
+ stringBuffer.append(genDataType.getFormattedName());
+ stringBuffer.append(TEXT_313);
+ stringBuffer.append(genDataType.getImportedInstanceClassName());
+ stringBuffer.append(TEXT_314);
+ stringBuffer.append(genDataType.getName());
+ stringBuffer.append(TEXT_315);
+ stringBuffer.append(genDataType.getFormattedName());
+ stringBuffer.append(TEXT_316);
+ stringBuffer.append(genDataType.getName());
+ stringBuffer.append(TEXT_317);
+ stringBuffer.append(genDataType.getImportedInstanceClassName());
+ stringBuffer.append(TEXT_318);
+ }
+ }
+ }
+ }
+ stringBuffer.append(TEXT_319);
+ stringBuffer.append(isInterface ? genPackage.getFactoryInterfaceName() : genPackage.getFactoryClassName());
+ genModel.emitSortedImports();
+ stringBuffer.append(TEXT_320);
+ return stringBuffer.toString();
+ }
+} \ No newline at end of file
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/util/SDOGenUtil.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/util/SDOGenUtil.java
new file mode 100644
index 0000000000..7e5cd16913
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/util/SDOGenUtil.java
@@ -0,0 +1,245 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.generate.util;
+
+import java.util.Iterator;
+
+import org.apache.tuscany.sdo.model.ModelFactory;
+import org.apache.tuscany.sdo.model.impl.ModelFactoryImpl;
+import org.eclipse.emf.codegen.ecore.genmodel.GenClass;
+import org.eclipse.emf.codegen.ecore.genmodel.GenClassifier;
+import org.eclipse.emf.codegen.ecore.genmodel.GenDelegationKind;
+import org.eclipse.emf.codegen.ecore.genmodel.GenFeature;
+import org.eclipse.emf.codegen.ecore.genmodel.GenModel;
+import org.eclipse.emf.codegen.ecore.genmodel.GenPackage;
+import org.eclipse.emf.codegen.util.CodeGenUtil;
+import org.eclipse.emf.ecore.EClassifier;
+
+import commonj.sdo.Type;
+
+public class SDOGenUtil {
+
+ public static String getQualifiedTypeAccessor(GenClassifier genClassifier)
+ {
+ GenPackage genPackage = genClassifier.getGenPackage();
+ return getFactoryImpl(genPackage) + ".get" + genClassifier.getClassifierAccessorName() + "()";
+ }
+
+ public static String getDependentFactoryArgumentList(GenPackage genPackage, boolean isFormalArguments)
+ {
+ StringBuffer result = new StringBuffer();
+ for (Iterator iter = genPackage.getPackageInitializationDependencies().iterator(); iter.hasNext(); )
+ {
+ GenPackage dep = (GenPackage)iter.next();
+ if (isFormalArguments)
+ {
+ result.append(dep.getImportedFactoryClassName());
+ result.append(" ");
+ }
+ result.append(genPackage.getPackageInstanceVariable(dep));
+ if (iter.hasNext()) result.append(", ");
+ }
+ return result.toString();
+ }
+
+ public static String getFactoryImpl(GenPackage genPackage)
+ {
+ return "((" + genPackage.getImportedFactoryClassName() + ")"
+ + genPackage.getImportedFactoryInterfaceName() + ".INSTANCE)";
+ }
+
+ public static String getListKind(GenFeature genFeature, boolean suppressNotification )
+ {
+ boolean unsettable = genFeature.isUnsettable();
+
+ if (suppressNotification)
+ {
+ return "ListKind.BASIC";
+ }
+ else if (genFeature.isEffectiveContains())
+ {
+ if (genFeature.isBidirectional())
+ {
+ if (genFeature.isResolveProxies())
+ {
+ if( unsettable )
+ return "ListKind.CONTAINMENT_INVERSE_RESOLVING_UNSETTABLE";
+ else
+ return "ListKind.CONTAINMENT_INVERSE_RESOLVING";
+ }
+ else
+ {
+ if( unsettable )
+ return "ListKind.CONTAINMENT_INVERSE_UNSETTABLE";
+ else
+ return "ListKind.CONTAINMENT_INVERSE";
+ }
+ }
+ else
+ {
+ if (genFeature.isResolveProxies())
+ {
+ if( unsettable )
+ return "ListKind.CONTAINMENT_RESOLVING_UNSETTABLE";
+ else
+ return "ListKind.CONTAINMENT_RESOLVING";
+ }
+ else
+ {
+ if( unsettable )
+ return "ListKind.CONTAINMENT_UNSETTABLE";
+ else
+ return "ListKind.CONTAINMENT";
+ }
+ }
+ }
+ else if (genFeature.isReferenceType())
+ {
+ if (genFeature.isBidirectional())
+ {
+ GenFeature reverseFeature = genFeature.getReverse();
+ if (genFeature.isResolveProxies())
+ {
+ if (reverseFeature.isListType())
+ {
+ if( unsettable )
+ return "ListKind.NONCONTAINMENT_MANYINVERSE_RESOLVING_UNSETTABLE";
+ else
+ return "ListKind.NONCONTAINMENT_MANYINVERSE_RESOLVING";
+ }
+ else
+ {
+ if( unsettable )
+ return "ListKind.NONCONTAINMENT_INVERSE_RESOLVING_UNSETTABLE";
+ else
+ return "ListKind.NONCONTAINMENT_INVERSE_RESOLVING";
+ }
+ }
+ else
+ {
+ if (reverseFeature.isListType())
+ {
+ if( unsettable )
+ return "ListKind.NONCONTAINMENT_MANYINVERSE_UNSETTABLE";
+ else
+ return "ListKind.NONCONTAINMENT_MANYINVERSE";
+ }
+ else
+ {
+ if( unsettable )
+ return "ListKind.NONCONTAINMENT_INVERSE_UNSETTABLE";
+ else
+ return "ListKind.NONCONTAINMENT_INVERSE";
+ }
+ }
+ }
+ else
+ {
+ if (genFeature.isResolveProxies())
+ {
+ if( unsettable )
+ return "ListKind.NONCONTAINMENT_RESOLVING_UNSETTABLE";
+ else
+ return "ListKind.NONCONTAINMENT_RESOLVING";
+ }
+ else
+ {
+ if( unsettable )
+ return "ListKind.NONCONTAINMENT_UNSETTABLE";
+ else
+ return "ListKind.NONCONTAINMENT";
+ }
+ }
+ }
+ else
+ { //datatype
+ if (genFeature.isUnique())
+ {
+ if( unsettable )
+ return "ListKind.DATATYPE_UNIQUE_UNSETTABLE";
+ else
+ return "ListKind.DATATYPE_UNIQUE";
+ }
+ else
+ {
+ if( unsettable )
+ return "ListKind.DATATYPE_UNSETTABLE";
+ else
+ return "ListKind.DATATYPE";
+ }
+ }
+ }
+
+ public static boolean hasChangeSummaryProperty(GenClass genClass)
+ {
+ return getChangeSummaryProperty(genClass) != null;
+ }
+
+ public static String getChangeSummaryProperty(GenClass genClass)
+ {
+ Type csType = ((ModelFactoryImpl)ModelFactory.INSTANCE).getChangeSummaryType();
+ for (Iterator i = genClass.getGenFeatures().iterator(); i.hasNext(); )
+ {
+ GenFeature genFeature = (GenFeature)i.next();
+ EClassifier eClassifier = genFeature.getEcoreFeature().getEType();
+ if (eClassifier instanceof Type)
+ {
+ Type type = (Type)eClassifier;
+ //if (csType == type)// this doesn't work when generating sdoModel.xsd
+ if (csType.getName().equals(type.getName()) && csType.getURI().equals(type.getURI()))
+ {
+ return genFeature.getUpperName();
+ }
+ }
+ }
+ return null;
+ }
+
+ public static String printArguments(GenPackage genPackage, GenModel genModel) {
+ StringBuffer result = new StringBuffer();
+ if(!CodeGenUtil.capName(genPackage.getNSName()).equals(genPackage.getPrefix())) {
+ result.append(" -prefix " + genPackage.getPrefix());
+ }
+ if (genModel.isSuppressInterfaces()) {
+ result.append(" -noInterfaces");
+ }
+ if ( genModel.getFeatureDelegation() == GenDelegationKind.VIRTUAL_LITERAL) {
+ result.append(" -sparsePattern");
+ }
+ if ("org.apache.tuscany.sdo.impl.StoreDataObjectImpl".equals(genModel.getRootExtendsClass())) {
+ result.append(" -storePattern");
+ }
+ if (genModel.isSuppressNotification()) {
+ result.append(" -noNotification");
+ }
+ if (genModel.isSuppressContainment()) {
+ result.append(" -noContainment");
+ }
+ if (genModel.isArrayAccessors()) {
+ result.append(" -arrayAccessors");
+ }
+ if (genModel.isSuppressUnsettable()) {
+ result.append(" -noUnsettable");
+ }
+
+ return result.toString();
+ }
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/java/org/eclipse/jdt/core/formatter/CodeFormatter.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/java/org/eclipse/jdt/core/formatter/CodeFormatter.java
new file mode 100644
index 0000000000..1c1f37682f
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/java/org/eclipse/jdt/core/formatter/CodeFormatter.java
@@ -0,0 +1,27 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*******************************************************************************
+ * TEMPORARY dummy file to work around EMF generator dependency problem.
+ * This file will be deleted as soon as the EMF generator is fixed.
+ *******************************************************************************/
+package org.eclipse.jdt.core.formatter;
+
+public abstract class CodeFormatter {
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/resources/META-INF/LICENSE.txt b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/resources/META-INF/LICENSE.txt
new file mode 100644
index 0000000000..7ad41eb165
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/resources/META-INF/LICENSE.txt
@@ -0,0 +1,483 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+
+APACHE TUSCANY SDO SUBCOMPONENTS:
+
+The Apache Tuscany SDO distribution includes a number of subcomponents with
+separate copyright notices and license terms. Your use of the source
+code for the these subcomponents is subject to the terms and
+conditions of the following licenses.
+
+##
+License for the Service Data Objects JavaDoc and Interface Definition files. (sdo-api-r2.0.1-1.0-incubator-M2.jar)
+
+Permission to copy, make derivative works of, and distribute the Service Data Objects
+JavaDoc and Interface Definition Files files in any medium without fee or royalty as part
+of a compliant implementation of the Service Data Objects Specification is hereby granted.
+The Service Data Objects Specification may be found at any of the following locations:
+
+http://dev2dev.bea.com/technologies/commonj/index.jsp
+http://www.ibm.com/developerworks/library/specification/ws-sdo/
+http://oracle.com/technology/webservices/sca
+https://www.sdn.sap.com/
+http://www.xcalia/xdn/specs/sdo
+
+THE SERVICE DATA OBJECTS SPECIFICATION AND THE JAVADOC AND INTERFACE DEFINITION FILES
+ARE PROVIDED "AS IS," AND THE AUTHORS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS
+SPECIFICATION OR THE JAVADOC AND INTERFACE DEFINITION FILES AND THE IMPLEMENTATION OF THEIR CONTENTS,
+INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
+NON-INFRINGEMENT OR TITLE. THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL,
+INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO ANY USE OR DISTRIBUTION OF THE
+SERVICE DATA OBJECTS SPECIFICATION OR THE JAVADOC OR INTERFACE DEFINTION FILES.
+
+The name and trademarks of the Authors may NOT be used in any manner, including advertising or
+publicity pertaining to the Service Component Architecture Specification or its contents without specific,
+written prior permission. Title to copyright in the Service Data Objects Specification and the
+JavaDoc and Interface Definition Files will at all times remain with the Authors.
+
+No other rights are granted by implication, estoppel or otherwise.
+
+===============================================================================
+
+For the Eclipse Modeling Framework component
+
+applicable to the jars ...
+
+codegen-2.2.2.jar
+codegen-ecore-2.2.2.jar
+common-2.2.2.jar
+ecore-2.2.2.jar
+ecore-change-2.2.2.jar
+ecore-xmi-2.2.2.jar
+xsd-2.2.2.jar
+
+Eclipse Public License - v 1.0
+
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
+PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF
+THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+
+1. DEFINITIONS
+
+"Contribution" means:
+
+a) in the case of the initial Contributor, the initial code and
+documentation distributed under this Agreement, and
+b) in the case of each subsequent Contributor:
+
+i) changes to the Program, and
+
+ii) additions to the Program;
+
+where such changes and/or additions to the Program originate from and
+are distributed by that particular Contributor. A Contribution
+'originates' from a Contributor if it was added to the Program by such
+Contributor itself or anyone acting on such Contributor's behalf.
+Contributions do not include additions to the Program which: (i) are
+separate modules of software distributed in conjunction with the
+Program under their own license agreement, and (ii) are not derivative
+works of the Program.
+
+"Contributor" means any person or entity that distributes the Program.
+
+"Licensed Patents " mean patent claims licensable by a Contributor
+which are necessarily infringed by the use or sale of its Contribution
+alone or when combined with the Program.
+
+"Program" means the Contributions distributed in accordance with this
+Agreement.
+
+"Recipient" means anyone who receives the Program under this
+Agreement, including all Contributors.
+
+2. GRANT OF RIGHTS
+
+a) Subject to the terms of this Agreement, each Contributor hereby
+grants Recipient a non-exclusive, worldwide, royalty-free copyright
+license to reproduce, prepare derivative works of, publicly display,
+publicly perform, distribute and sublicense the Contribution of such
+Contributor, if any, and such derivative works, in source code and
+object code form.
+
+b) Subject to the terms of this Agreement, each Contributor hereby
+grants Recipient a non-exclusive, worldwide, royalty-free patent
+license under Licensed Patents to make, use, sell, offer to sell,
+import and otherwise transfer the Contribution of such Contributor, if
+any, in source code and object code form. This patent license shall
+apply to the combination of the Contribution and the Program if, at
+the time the Contribution is added by the Contributor, such addition
+of the Contribution causes such combination to be covered by the
+Licensed Patents. The patent license shall not apply to any other
+combinations which include the Contribution. No hardware per se is
+licensed hereunder.
+
+c) Recipient understands that although each Contributor grants the
+licenses to its Contributions set forth herein, no assurances are
+provided by any Contributor that the Program does not infringe the
+patent or other intellectual property rights of any other entity. Each
+Contributor disclaims any liability to Recipient for claims brought by
+any other entity based on infringement of intellectual property rights
+or otherwise. As a condition to exercising the rights and licenses
+granted hereunder, each Recipient hereby assumes sole responsibility
+to secure any other intellectual property rights needed, if any. For
+example, if a third party patent license is required to allow
+Recipient to distribute the Program, it is Recipient's responsibility
+to acquire that license before distributing the Program.
+
+d) Each Contributor represents that to its knowledge it has sufficient
+copyright rights in its Contribution, if any, to grant the copyright
+license set forth in this Agreement.
+
+3. REQUIREMENTS
+
+A Contributor may choose to distribute the Program in object code form
+under its own license agreement, provided that:
+
+a) it complies with the terms and conditions of this Agreement; and
+
+b) its license agreement:
+
+i) effectively disclaims on behalf of all Contributors all warranties
+and conditions, express and implied, including warranties or
+conditions of title and non-infringement, and implied warranties or
+conditions of merchantability and fitness for a particular purpose;
+
+ii) effectively excludes on behalf of all Contributors all liability
+for damages, including direct, indirect, special, incidental and
+consequential damages, such as lost profits;
+
+iii) states that any provisions which differ from this Agreement are
+offered by that Contributor alone and not by any other party; and
+
+iv) states that source code for the Program is available from such
+Contributor, and informs licensees how to obtain it in a reasonable
+manner on or through a medium customarily used for software exchange.
+
+When the Program is made available in source code form:
+
+a) it must be made available under this Agreement; and
+
+b) a copy of this Agreement must be included with each copy of the
+Program.
+
+Contributors may not remove or alter any copyright notices contained
+within the Program.
+
+Each Contributor must identify itself as the originator of its
+Contribution, if any, in a manner that reasonably allows subsequent
+Recipients to identify the originator of the Contribution.
+
+4. COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain
+responsibilities with respect to end users, business partners and the
+like. While this license is intended to facilitate the commercial use
+of the Program, the Contributor who includes the Program in a
+commercial product offering should do so in a manner which does not
+create potential liability for other Contributors. Therefore, if a
+Contributor includes the Program in a commercial product offering,
+such Contributor ("Commercial Contributor") hereby agrees to defend
+and indemnify every other Contributor ("Indemnified Contributor")
+against any losses, damages and costs (collectively "Losses") arising
+from claims, lawsuits and other legal actions brought by a third party
+against the Indemnified Contributor to the extent caused by the acts
+or omissions of such Commercial Contributor in connection with its
+distribution of the Program in a commercial product offering. The
+obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement.
+In order to qualify, an Indemnified Contributor must: a) promptly
+notify the Commercial Contributor in writing of such claim, and b)
+allow the Commercial Contributor to control, and cooperate with the
+Commercial Contributor in, the defense and any related settlement
+negotiations. The Indemnified Contributor may participate in any such
+claim at its own expense.
+
+For example, a Contributor might include the Program in a commercial
+product offering, Product X. That Contributor is then a Commercial
+Contributor. If that Commercial Contributor then makes performance
+claims, or offers warranties related to Product X, those performance
+claims and warranties are such Commercial Contributor's responsibility
+alone. Under this section, the Commercial Contributor would have to
+defend claims against the other Contributors related to those
+performance claims and warranties, and if a court requires any other
+Contributor to pay any damages as a result, the Commercial Contributor
+must pay those damages.
+
+5. NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS
+PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY
+WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY
+OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
+responsible for determining the appropriateness of using and
+distributing the Program and assumes all risks associated with its
+exercise of rights under this Agreement , including but not limited to
+the risks and costs of program errors, compliance with applicable
+laws, damage to or loss of data, programs or equipment, and
+unavailability or interruption of operations.
+
+6. DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR
+ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING
+WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR
+DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
+HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under
+applicable law, it shall not affect the validity or enforceability of
+the remainder of the terms of this Agreement, and without further
+action by the parties hereto, such provision shall be reformed to the
+minimum extent necessary to make such provision valid and enforceable.
+
+If Recipient institutes patent litigation against any entity
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+the Program itself (excluding combinations of the Program with other
+software or hardware) infringes such Recipient's patent(s), then such
+Recipient's rights granted under Section 2(b) shall terminate as of
+the date such litigation is filed.
+
+All Recipient's rights under this Agreement shall terminate if it
+fails to comply with any of the material terms or conditions of this
+Agreement and does not cure such failure in a reasonable period of
+time after becoming aware of such noncompliance. If all Recipient's
+rights under this Agreement terminate, Recipient agrees to cease use
+and distribution of the Program as soon as reasonably practicable.
+However, Recipient's obligations under this Agreement and any licenses
+granted by Recipient relating to the Program shall continue and
+survive.
+
+Everyone is permitted to copy and distribute copies of this Agreement,
+but in order to avoid inconsistency the Agreement is copyrighted and
+may only be modified in the following manner. The Agreement Steward
+reserves the right to publish new versions (including revisions) of
+this Agreement from time to time. No one other than the Agreement
+Steward has the right to modify this Agreement. The Eclipse Foundation
+is the initial Agreement Steward. The Eclipse Foundation may assign
+the responsibility to serve as the Agreement Steward to a suitable
+separate entity. Each new version of the Agreement will be given a
+distinguishing version number. The Program (including Contributions)
+may always be distributed subject to the version of the Agreement
+under which it was received. In addition, after a new version of the
+Agreement is published, Contributor may elect to distribute the
+Program (including its Contributions) under the new version. Except as
+expressly stated in Sections 2(a) and 2(b) above, Recipient receives
+no rights or licenses to the intellectual property of any Contributor
+under this Agreement, whether expressly, by implication, estoppel or
+otherwise. All rights in the Program not expressly granted under this
+Agreement are reserved.
+
+This Agreement is governed by the laws of the State of New York and
+the intellectual property laws of the United States of America. No
+party to this Agreement will bring a legal action under this Agreement
+more than one year after the cause of action arose. Each party waives
+its rights to a jury trial in any resulting litigation.
+
+===============================================================================
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/resources/META-INF/MANIFEST.MF b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/resources/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..8bb7dea1fe
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/resources/META-INF/MANIFEST.MF
@@ -0,0 +1,21 @@
+Manifest-Version: 1.0
+Extension-Name: tuscany-sdo-tools
+Specification-Title: Tuscany SDO Tools Implementation
+Specification-Vendor: Apache Software Foundation
+Implementation-Vendor: Apache Software Foundation
+Implementation-Vendor-Id: org.apache
+Implementation-Title: tuscany-sdo-tools
+Implementation-Version: incubating-M3
+Bundle-ManifestVersion: 2
+Bundle-Name: Tuscany SDO Tools Implementation
+Bundle-SymbolicName: org.apache.tuscany.sdo.tools
+Bundle-Version: 1.0.0
+Bundle-Vendor: Apache Software Foundation
+Require-Bundle: org.eclipse.emf.common,
+ org.eclipse.emf.ecore,
+ org.eclipse.emf.ecore.change,
+ org.eclipse.emf.ecore.xmi,
+ org.eclipse.xsd,
+ org.apache.tuscany.sdo.spec;visibility:=reexport
+Export-Package: org.apache.tuscany.sdo.generate,
+ org.apache.tuscany.sdo.generate.util
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/resources/META-INF/NOTICE b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/resources/META-INF/NOTICE
new file mode 100644
index 0000000000..ad4a1a0214
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/resources/META-INF/NOTICE
@@ -0,0 +1,28 @@
+Apache Tuscany SDO for Java
+Copyright 2006, 2007 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+Apache Tuscany is an effort undergoing incubation at The Apache Software Foundation (ASF),
+sponsored by the Apache Web Services PMC. Incubation is required of all newly accepted
+projects until a further review indicates that the infrastructure, communications,
+and decision making process have stabilized in a manner consistent with other successful
+ASF projects. While incubation status is not necessarily a reflection of the completeness
+or stability of the code, it does indicate that the project has yet to be fully endorsed
+by the ASF.
+
+Unless otherwise indicated, all distribution made available by the Apache Software Foundation
+is provided to you under the terms and conditions of the Apache License Version 2.0 ("AL").
+A copy of the AL is provided with this distribution as the LICENSE.txt file present in the
+root directory, and is also available at http://www.apache.org/licenses/.
+
+The terms and conditions governing the distribution may refer to the AL or other license
+agreements, notices or terms and conditions. Some of these other license agreements may
+include (but are not limited to):
+
+ . Eclipse Public License Version 1.0 (available at http://www.eclipse.org/legal/epl-v10.html)
+
+It is your obligation to read and accept all such terms and conditions prior to use of the
+distribution. If term or condition is provided, please contact the Apache Software Foundation
+to determine what terms and conditions govern that particular distribution.
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/resources/META-INF/README.txt b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/resources/META-INF/README.txt
new file mode 100644
index 0000000000..b53994461b
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/main/resources/META-INF/README.txt
@@ -0,0 +1,35 @@
+Apache Tuscany M3 build (March 2007)
+===================================
+
+http://incubator.apache.org/tuscany/
+
+Tuscany is an effort undergoing incubation at the Apache Software Foundation
+(ASF), sponsored by the Web Services PMC.
+
+Incubation is required of all newly accepted projects until a further review
+indicates that the infrastructure, communications, and decision making process
+have stabilized in a manner consistent with other successful ASF projects.
+
+While incubation status is not necessarily a reflection of the completeness or
+stability of the code, it does indicate that the project has yet to be fully
+endorsed by the ASF.
+
+
+Support
+-------
+
+Any problem with this release can be reported to the Tuscany mailing list
+or in the JIRA issue tracker.
+
+Mailing list subscription:
+ tuscany-dev-subscribe@ws.apache.org
+
+Jira:
+ http://issues.apache.org/jira/browse/Tuscany
+
+
+Thank you for using Tuscany!
+
+
+The Tuscany Team.
+
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/noInterfaces/simple/Quote.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/noInterfaces/simple/Quote.java
new file mode 100644
index 0000000000..84906b6ac5
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/noInterfaces/simple/Quote.java
@@ -0,0 +1,1237 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.noInterfaces.simple;
+
+import commonj.sdo.Type;
+
+import java.io.Serializable;
+
+import java.math.BigDecimal;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.tuscany.sdo.impl.DataObjectBase;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Quote</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link com.example.noInterfaces.simple.Quote#getSymbol <em>Symbol</em>}</li>
+ * <li>{@link com.example.noInterfaces.simple.Quote#getCompanyName <em>Company Name</em>}</li>
+ * <li>{@link com.example.noInterfaces.simple.Quote#getPrice <em>Price</em>}</li>
+ * <li>{@link com.example.noInterfaces.simple.Quote#getOpen1 <em>Open1</em>}</li>
+ * <li>{@link com.example.noInterfaces.simple.Quote#getHigh <em>High</em>}</li>
+ * <li>{@link com.example.noInterfaces.simple.Quote#getLow <em>Low</em>}</li>
+ * <li>{@link com.example.noInterfaces.simple.Quote#getVolume <em>Volume</em>}</li>
+ * <li>{@link com.example.noInterfaces.simple.Quote#getChange1 <em>Change1</em>}</li>
+ * <li>{@link com.example.noInterfaces.simple.Quote#getQuotes <em>Quotes</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @extends Serializable
+ * @generated
+ */
+public class Quote extends DataObjectBase implements Serializable
+{
+
+ public final static int SYMBOL = 0;
+
+ public final static int COMPANY_NAME = 1;
+
+ public final static int PRICE = 2;
+
+ public final static int OPEN1 = 3;
+
+ public final static int HIGH = 4;
+
+ public final static int LOW = 5;
+
+ public final static int VOLUME = 6;
+
+ public final static int CHANGE1 = 7;
+
+ public final static int QUOTES = 8;
+
+ public final static int SDO_PROPERTY_COUNT = 9;
+
+ public final static int EXTENDED_PROPERTY_COUNT = 0;
+
+
+ /**
+ * The internal feature id for the '<em><b>Symbol</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_SYMBOL = 0;
+
+ /**
+ * The internal feature id for the '<em><b>Company Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_COMPANY_NAME = 1;
+
+ /**
+ * The internal feature id for the '<em><b>Price</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_PRICE = 2;
+
+ /**
+ * The internal feature id for the '<em><b>Open1</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_OPEN1 = 3;
+
+ /**
+ * The internal feature id for the '<em><b>High</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_HIGH = 4;
+
+ /**
+ * The internal feature id for the '<em><b>Low</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_LOW = 5;
+
+ /**
+ * The internal feature id for the '<em><b>Volume</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_VOLUME = 6;
+
+ /**
+ * The internal feature id for the '<em><b>Change1</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_CHANGE1 = 7;
+
+ /**
+ * The internal feature id for the '<em><b>Quotes</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_QUOTES = 8;
+
+ /**
+ * The number of properties for this type.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_PROPERTY_COUNT = 9;
+
+ protected int internalConvertIndex(int internalIndex)
+ {
+ switch (internalIndex)
+ {
+ case INTERNAL_SYMBOL: return SYMBOL;
+ case INTERNAL_COMPANY_NAME: return COMPANY_NAME;
+ case INTERNAL_PRICE: return PRICE;
+ case INTERNAL_OPEN1: return OPEN1;
+ case INTERNAL_HIGH: return HIGH;
+ case INTERNAL_LOW: return LOW;
+ case INTERNAL_VOLUME: return VOLUME;
+ case INTERNAL_CHANGE1: return CHANGE1;
+ case INTERNAL_QUOTES: return QUOTES;
+ }
+ return super.internalConvertIndex(internalIndex);
+ }
+
+
+ /**
+ * The default value of the '{@link #getSymbol() <em>Symbol</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getSymbol()
+ * @generated
+ * @ordered
+ */
+ protected static final String SYMBOL_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getSymbol() <em>Symbol</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getSymbol()
+ * @generated
+ * @ordered
+ */
+ protected String symbol = SYMBOL_DEFAULT_;
+
+ /**
+ * This is true if the Symbol attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean symbol_set_ = false;
+
+ /**
+ * The default value of the '{@link #getCompanyName() <em>Company Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getCompanyName()
+ * @generated
+ * @ordered
+ */
+ protected static final String COMPANY_NAME_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getCompanyName() <em>Company Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getCompanyName()
+ * @generated
+ * @ordered
+ */
+ protected String companyName = COMPANY_NAME_DEFAULT_;
+
+ /**
+ * This is true if the Company Name attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean companyName_set_ = false;
+
+ /**
+ * The default value of the '{@link #getPrice() <em>Price</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getPrice()
+ * @generated
+ * @ordered
+ */
+ protected static final BigDecimal PRICE_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getPrice() <em>Price</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getPrice()
+ * @generated
+ * @ordered
+ */
+ protected BigDecimal price = PRICE_DEFAULT_;
+
+ /**
+ * This is true if the Price attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean price_set_ = false;
+
+ /**
+ * The default value of the '{@link #getOpen1() <em>Open1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getOpen1()
+ * @generated
+ * @ordered
+ */
+ protected static final BigDecimal OPEN1_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getOpen1() <em>Open1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getOpen1()
+ * @generated
+ * @ordered
+ */
+ protected BigDecimal open1 = OPEN1_DEFAULT_;
+
+ /**
+ * This is true if the Open1 attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean open1_set_ = false;
+
+ /**
+ * The default value of the '{@link #getHigh() <em>High</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getHigh()
+ * @generated
+ * @ordered
+ */
+ protected static final BigDecimal HIGH_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getHigh() <em>High</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getHigh()
+ * @generated
+ * @ordered
+ */
+ protected BigDecimal high = HIGH_DEFAULT_;
+
+ /**
+ * This is true if the High attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean high_set_ = false;
+
+ /**
+ * The default value of the '{@link #getLow() <em>Low</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getLow()
+ * @generated
+ * @ordered
+ */
+ protected static final BigDecimal LOW_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getLow() <em>Low</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getLow()
+ * @generated
+ * @ordered
+ */
+ protected BigDecimal low = LOW_DEFAULT_;
+
+ /**
+ * This is true if the Low attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean low_set_ = false;
+
+ /**
+ * The default value of the '{@link #getVolume() <em>Volume</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getVolume()
+ * @generated
+ * @ordered
+ */
+ protected static final double VOLUME_DEFAULT_ = 0.0;
+
+ /**
+ * The cached value of the '{@link #getVolume() <em>Volume</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getVolume()
+ * @generated
+ * @ordered
+ */
+ protected double volume = VOLUME_DEFAULT_;
+
+ /**
+ * This is true if the Volume attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean volume_set_ = false;
+
+ /**
+ * The default value of the '{@link #getChange1() <em>Change1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getChange1()
+ * @generated
+ * @ordered
+ */
+ protected static final double CHANGE1_DEFAULT_ = 0.0;
+
+ /**
+ * The cached value of the '{@link #getChange1() <em>Change1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getChange1()
+ * @generated
+ * @ordered
+ */
+ protected double change1 = CHANGE1_DEFAULT_;
+
+ /**
+ * This is true if the Change1 attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean change1_set_ = false;
+
+ /**
+ * The cached value of the '{@link #getQuotes() <em>Quotes</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getQuotes()
+ * @generated
+ * @ordered
+ */
+
+ protected List quotes = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Quote()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Type getType()
+ {
+ return ((SimpleFactory)SimpleFactory.INSTANCE).getQuote();
+ }
+
+ /**
+ * Returns the value of the '<em><b>Symbol</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Symbol</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Symbol</em>' attribute.
+ * @see #isSetSymbol()
+ * @see #unsetSymbol()
+ * @see #setSymbol(String)
+ * @generated
+ */
+ public String getSymbol()
+ {
+ return symbol;
+ }
+ /**
+ * Sets the value of the '{@link com.example.noInterfaces.simple.Quote#getSymbol <em>Symbol</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Symbol</em>' attribute.
+ * @see #isSetSymbol()
+ * @see #unsetSymbol()
+ * @see #getSymbol()
+ * @generated
+ */
+ public void setSymbol(String newSymbol)
+ {
+ String oldSymbol = symbol;
+ symbol = newSymbol;
+ boolean oldSymbol_set_ = symbol_set_;
+ symbol_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, SYMBOL, oldSymbol, symbol, !oldSymbol_set_);
+ }
+
+ /**
+ * Unsets the value of the '{@link com.example.noInterfaces.simple.Quote#getSymbol <em>Symbol</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetSymbol()
+ * @see #getSymbol()
+ * @see #setSymbol(String)
+ * @generated
+ */
+ public void unsetSymbol()
+ {
+ String oldSymbol = symbol;
+ boolean oldSymbol_set_ = symbol_set_;
+ symbol = SYMBOL_DEFAULT_;
+ symbol_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, SYMBOL, oldSymbol, SYMBOL_DEFAULT_, oldSymbol_set_);
+ }
+
+ /**
+ * Returns whether the value of the '{@link com.example.noInterfaces.simple.Quote#getSymbol <em>Symbol</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Symbol</em>' attribute is set.
+ * @see #unsetSymbol()
+ * @see #getSymbol()
+ * @see #setSymbol(String)
+ * @generated
+ */
+ public boolean isSetSymbol()
+ {
+ return symbol_set_;
+ }
+
+ /**
+ * Returns the value of the '<em><b>Company Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Company Name</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Company Name</em>' attribute.
+ * @see #isSetCompanyName()
+ * @see #unsetCompanyName()
+ * @see #setCompanyName(String)
+ * @generated
+ */
+ public String getCompanyName()
+ {
+ return companyName;
+ }
+ /**
+ * Sets the value of the '{@link com.example.noInterfaces.simple.Quote#getCompanyName <em>Company Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Company Name</em>' attribute.
+ * @see #isSetCompanyName()
+ * @see #unsetCompanyName()
+ * @see #getCompanyName()
+ * @generated
+ */
+ public void setCompanyName(String newCompanyName)
+ {
+ String oldCompanyName = companyName;
+ companyName = newCompanyName;
+ boolean oldCompanyName_set_ = companyName_set_;
+ companyName_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, COMPANY_NAME, oldCompanyName, companyName, !oldCompanyName_set_);
+ }
+
+ /**
+ * Unsets the value of the '{@link com.example.noInterfaces.simple.Quote#getCompanyName <em>Company Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetCompanyName()
+ * @see #getCompanyName()
+ * @see #setCompanyName(String)
+ * @generated
+ */
+ public void unsetCompanyName()
+ {
+ String oldCompanyName = companyName;
+ boolean oldCompanyName_set_ = companyName_set_;
+ companyName = COMPANY_NAME_DEFAULT_;
+ companyName_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, COMPANY_NAME, oldCompanyName, COMPANY_NAME_DEFAULT_, oldCompanyName_set_);
+ }
+
+ /**
+ * Returns whether the value of the '{@link com.example.noInterfaces.simple.Quote#getCompanyName <em>Company Name</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Company Name</em>' attribute is set.
+ * @see #unsetCompanyName()
+ * @see #getCompanyName()
+ * @see #setCompanyName(String)
+ * @generated
+ */
+ public boolean isSetCompanyName()
+ {
+ return companyName_set_;
+ }
+
+ /**
+ * Returns the value of the '<em><b>Price</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Price</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Price</em>' attribute.
+ * @see #isSetPrice()
+ * @see #unsetPrice()
+ * @see #setPrice(BigDecimal)
+ * @generated
+ */
+ public BigDecimal getPrice()
+ {
+ return price;
+ }
+ /**
+ * Sets the value of the '{@link com.example.noInterfaces.simple.Quote#getPrice <em>Price</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Price</em>' attribute.
+ * @see #isSetPrice()
+ * @see #unsetPrice()
+ * @see #getPrice()
+ * @generated
+ */
+ public void setPrice(BigDecimal newPrice)
+ {
+ BigDecimal oldPrice = price;
+ price = newPrice;
+ boolean oldPrice_set_ = price_set_;
+ price_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, PRICE, oldPrice, price, !oldPrice_set_);
+ }
+
+ /**
+ * Unsets the value of the '{@link com.example.noInterfaces.simple.Quote#getPrice <em>Price</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetPrice()
+ * @see #getPrice()
+ * @see #setPrice(BigDecimal)
+ * @generated
+ */
+ public void unsetPrice()
+ {
+ BigDecimal oldPrice = price;
+ boolean oldPrice_set_ = price_set_;
+ price = PRICE_DEFAULT_;
+ price_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, PRICE, oldPrice, PRICE_DEFAULT_, oldPrice_set_);
+ }
+
+ /**
+ * Returns whether the value of the '{@link com.example.noInterfaces.simple.Quote#getPrice <em>Price</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Price</em>' attribute is set.
+ * @see #unsetPrice()
+ * @see #getPrice()
+ * @see #setPrice(BigDecimal)
+ * @generated
+ */
+ public boolean isSetPrice()
+ {
+ return price_set_;
+ }
+
+ /**
+ * Returns the value of the '<em><b>Open1</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Open1</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Open1</em>' attribute.
+ * @see #isSetOpen1()
+ * @see #unsetOpen1()
+ * @see #setOpen1(BigDecimal)
+ * @generated
+ */
+ public BigDecimal getOpen1()
+ {
+ return open1;
+ }
+ /**
+ * Sets the value of the '{@link com.example.noInterfaces.simple.Quote#getOpen1 <em>Open1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Open1</em>' attribute.
+ * @see #isSetOpen1()
+ * @see #unsetOpen1()
+ * @see #getOpen1()
+ * @generated
+ */
+ public void setOpen1(BigDecimal newOpen1)
+ {
+ BigDecimal oldOpen1 = open1;
+ open1 = newOpen1;
+ boolean oldOpen1_set_ = open1_set_;
+ open1_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, OPEN1, oldOpen1, open1, !oldOpen1_set_);
+ }
+
+ /**
+ * Unsets the value of the '{@link com.example.noInterfaces.simple.Quote#getOpen1 <em>Open1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetOpen1()
+ * @see #getOpen1()
+ * @see #setOpen1(BigDecimal)
+ * @generated
+ */
+ public void unsetOpen1()
+ {
+ BigDecimal oldOpen1 = open1;
+ boolean oldOpen1_set_ = open1_set_;
+ open1 = OPEN1_DEFAULT_;
+ open1_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, OPEN1, oldOpen1, OPEN1_DEFAULT_, oldOpen1_set_);
+ }
+
+ /**
+ * Returns whether the value of the '{@link com.example.noInterfaces.simple.Quote#getOpen1 <em>Open1</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Open1</em>' attribute is set.
+ * @see #unsetOpen1()
+ * @see #getOpen1()
+ * @see #setOpen1(BigDecimal)
+ * @generated
+ */
+ public boolean isSetOpen1()
+ {
+ return open1_set_;
+ }
+
+ /**
+ * Returns the value of the '<em><b>High</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>High</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>High</em>' attribute.
+ * @see #isSetHigh()
+ * @see #unsetHigh()
+ * @see #setHigh(BigDecimal)
+ * @generated
+ */
+ public BigDecimal getHigh()
+ {
+ return high;
+ }
+ /**
+ * Sets the value of the '{@link com.example.noInterfaces.simple.Quote#getHigh <em>High</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>High</em>' attribute.
+ * @see #isSetHigh()
+ * @see #unsetHigh()
+ * @see #getHigh()
+ * @generated
+ */
+ public void setHigh(BigDecimal newHigh)
+ {
+ BigDecimal oldHigh = high;
+ high = newHigh;
+ boolean oldHigh_set_ = high_set_;
+ high_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, HIGH, oldHigh, high, !oldHigh_set_);
+ }
+
+ /**
+ * Unsets the value of the '{@link com.example.noInterfaces.simple.Quote#getHigh <em>High</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetHigh()
+ * @see #getHigh()
+ * @see #setHigh(BigDecimal)
+ * @generated
+ */
+ public void unsetHigh()
+ {
+ BigDecimal oldHigh = high;
+ boolean oldHigh_set_ = high_set_;
+ high = HIGH_DEFAULT_;
+ high_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, HIGH, oldHigh, HIGH_DEFAULT_, oldHigh_set_);
+ }
+
+ /**
+ * Returns whether the value of the '{@link com.example.noInterfaces.simple.Quote#getHigh <em>High</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>High</em>' attribute is set.
+ * @see #unsetHigh()
+ * @see #getHigh()
+ * @see #setHigh(BigDecimal)
+ * @generated
+ */
+ public boolean isSetHigh()
+ {
+ return high_set_;
+ }
+
+ /**
+ * Returns the value of the '<em><b>Low</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Low</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Low</em>' attribute.
+ * @see #isSetLow()
+ * @see #unsetLow()
+ * @see #setLow(BigDecimal)
+ * @generated
+ */
+ public BigDecimal getLow()
+ {
+ return low;
+ }
+ /**
+ * Sets the value of the '{@link com.example.noInterfaces.simple.Quote#getLow <em>Low</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Low</em>' attribute.
+ * @see #isSetLow()
+ * @see #unsetLow()
+ * @see #getLow()
+ * @generated
+ */
+ public void setLow(BigDecimal newLow)
+ {
+ BigDecimal oldLow = low;
+ low = newLow;
+ boolean oldLow_set_ = low_set_;
+ low_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, LOW, oldLow, low, !oldLow_set_);
+ }
+
+ /**
+ * Unsets the value of the '{@link com.example.noInterfaces.simple.Quote#getLow <em>Low</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetLow()
+ * @see #getLow()
+ * @see #setLow(BigDecimal)
+ * @generated
+ */
+ public void unsetLow()
+ {
+ BigDecimal oldLow = low;
+ boolean oldLow_set_ = low_set_;
+ low = LOW_DEFAULT_;
+ low_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, LOW, oldLow, LOW_DEFAULT_, oldLow_set_);
+ }
+
+ /**
+ * Returns whether the value of the '{@link com.example.noInterfaces.simple.Quote#getLow <em>Low</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Low</em>' attribute is set.
+ * @see #unsetLow()
+ * @see #getLow()
+ * @see #setLow(BigDecimal)
+ * @generated
+ */
+ public boolean isSetLow()
+ {
+ return low_set_;
+ }
+
+ /**
+ * Returns the value of the '<em><b>Volume</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Volume</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Volume</em>' attribute.
+ * @see #isSetVolume()
+ * @see #unsetVolume()
+ * @see #setVolume(double)
+ * @generated
+ */
+ public double getVolume()
+ {
+ return volume;
+ }
+ /**
+ * Sets the value of the '{@link com.example.noInterfaces.simple.Quote#getVolume <em>Volume</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Volume</em>' attribute.
+ * @see #isSetVolume()
+ * @see #unsetVolume()
+ * @see #getVolume()
+ * @generated
+ */
+ public void setVolume(double newVolume)
+ {
+ double oldVolume = volume;
+ volume = newVolume;
+ boolean oldVolume_set_ = volume_set_;
+ volume_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, VOLUME, oldVolume, volume, !oldVolume_set_);
+ }
+
+ /**
+ * Unsets the value of the '{@link com.example.noInterfaces.simple.Quote#getVolume <em>Volume</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetVolume()
+ * @see #getVolume()
+ * @see #setVolume(double)
+ * @generated
+ */
+ public void unsetVolume()
+ {
+ double oldVolume = volume;
+ boolean oldVolume_set_ = volume_set_;
+ volume = VOLUME_DEFAULT_;
+ volume_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, VOLUME, oldVolume, VOLUME_DEFAULT_, oldVolume_set_);
+ }
+
+ /**
+ * Returns whether the value of the '{@link com.example.noInterfaces.simple.Quote#getVolume <em>Volume</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Volume</em>' attribute is set.
+ * @see #unsetVolume()
+ * @see #getVolume()
+ * @see #setVolume(double)
+ * @generated
+ */
+ public boolean isSetVolume()
+ {
+ return volume_set_;
+ }
+
+ /**
+ * Returns the value of the '<em><b>Change1</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Change1</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Change1</em>' attribute.
+ * @see #isSetChange1()
+ * @see #unsetChange1()
+ * @see #setChange1(double)
+ * @generated
+ */
+ public double getChange1()
+ {
+ return change1;
+ }
+ /**
+ * Sets the value of the '{@link com.example.noInterfaces.simple.Quote#getChange1 <em>Change1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Change1</em>' attribute.
+ * @see #isSetChange1()
+ * @see #unsetChange1()
+ * @see #getChange1()
+ * @generated
+ */
+ public void setChange1(double newChange1)
+ {
+ double oldChange1 = change1;
+ change1 = newChange1;
+ boolean oldChange1_set_ = change1_set_;
+ change1_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, CHANGE1, oldChange1, change1, !oldChange1_set_);
+ }
+
+ /**
+ * Unsets the value of the '{@link com.example.noInterfaces.simple.Quote#getChange1 <em>Change1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetChange1()
+ * @see #getChange1()
+ * @see #setChange1(double)
+ * @generated
+ */
+ public void unsetChange1()
+ {
+ double oldChange1 = change1;
+ boolean oldChange1_set_ = change1_set_;
+ change1 = CHANGE1_DEFAULT_;
+ change1_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, CHANGE1, oldChange1, CHANGE1_DEFAULT_, oldChange1_set_);
+ }
+
+ /**
+ * Returns whether the value of the '{@link com.example.noInterfaces.simple.Quote#getChange1 <em>Change1</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Change1</em>' attribute is set.
+ * @see #unsetChange1()
+ * @see #getChange1()
+ * @see #setChange1(double)
+ * @generated
+ */
+ public boolean isSetChange1()
+ {
+ return change1_set_;
+ }
+
+ /**
+ * Returns the value of the '<em><b>Quotes</b></em>' containment reference list.
+ * The list contents are of type {@link com.example.noInterfaces.simple.Quote}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Quotes</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Quotes</em>' containment reference list.
+ * @generated
+ */
+ public List getQuotes()
+ {
+ if (quotes == null)
+ {
+ quotes = createPropertyList(ListKind.CONTAINMENT, Quote.class, QUOTES);
+ }
+ return quotes;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeContext inverseRemove(Object otherEnd, int propertyIndex, ChangeContext changeContext)
+ {
+ switch (propertyIndex)
+ {
+ case QUOTES:
+ return removeFromList(getQuotes(), otherEnd, changeContext);
+ }
+ return super.inverseRemove(otherEnd, propertyIndex, changeContext);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object get(int propertyIndex, boolean resolve)
+ {
+ switch (propertyIndex)
+ {
+ case SYMBOL:
+ return getSymbol();
+ case COMPANY_NAME:
+ return getCompanyName();
+ case PRICE:
+ return getPrice();
+ case OPEN1:
+ return getOpen1();
+ case HIGH:
+ return getHigh();
+ case LOW:
+ return getLow();
+ case VOLUME:
+ return new Double(getVolume());
+ case CHANGE1:
+ return new Double(getChange1());
+ case QUOTES:
+ return getQuotes();
+ }
+ return super.get(propertyIndex, resolve);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void set(int propertyIndex, Object newValue)
+ {
+ switch (propertyIndex)
+ {
+ case SYMBOL:
+ setSymbol((String)newValue);
+ return;
+ case COMPANY_NAME:
+ setCompanyName((String)newValue);
+ return;
+ case PRICE:
+ setPrice((BigDecimal)newValue);
+ return;
+ case OPEN1:
+ setOpen1((BigDecimal)newValue);
+ return;
+ case HIGH:
+ setHigh((BigDecimal)newValue);
+ return;
+ case LOW:
+ setLow((BigDecimal)newValue);
+ return;
+ case VOLUME:
+ setVolume(((Double)newValue).doubleValue());
+ return;
+ case CHANGE1:
+ setChange1(((Double)newValue).doubleValue());
+ return;
+ case QUOTES:
+ getQuotes().clear();
+ getQuotes().addAll((Collection)newValue);
+ return;
+ }
+ super.set(propertyIndex, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unset(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case SYMBOL:
+ unsetSymbol();
+ return;
+ case COMPANY_NAME:
+ unsetCompanyName();
+ return;
+ case PRICE:
+ unsetPrice();
+ return;
+ case OPEN1:
+ unsetOpen1();
+ return;
+ case HIGH:
+ unsetHigh();
+ return;
+ case LOW:
+ unsetLow();
+ return;
+ case VOLUME:
+ unsetVolume();
+ return;
+ case CHANGE1:
+ unsetChange1();
+ return;
+ case QUOTES:
+ getQuotes().clear();
+ return;
+ }
+ super.unset(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSet(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case SYMBOL:
+ return isSetSymbol();
+ case COMPANY_NAME:
+ return isSetCompanyName();
+ case PRICE:
+ return isSetPrice();
+ case OPEN1:
+ return isSetOpen1();
+ case HIGH:
+ return isSetHigh();
+ case LOW:
+ return isSetLow();
+ case VOLUME:
+ return isSetVolume();
+ case CHANGE1:
+ return isSetChange1();
+ case QUOTES:
+ return quotes != null && !quotes.isEmpty();
+ }
+ return super.isSet(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString()
+ {
+ if (isProxy(this)) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (symbol: ");
+ if (symbol_set_) result.append(symbol); else result.append("<unset>");
+ result.append(", companyName: ");
+ if (companyName_set_) result.append(companyName); else result.append("<unset>");
+ result.append(", price: ");
+ if (price_set_) result.append(price); else result.append("<unset>");
+ result.append(", open1: ");
+ if (open1_set_) result.append(open1); else result.append("<unset>");
+ result.append(", high: ");
+ if (high_set_) result.append(high); else result.append("<unset>");
+ result.append(", low: ");
+ if (low_set_) result.append(low); else result.append("<unset>");
+ result.append(", volume: ");
+ if (volume_set_) result.append(volume); else result.append("<unset>");
+ result.append(", change1: ");
+ if (change1_set_) result.append(change1); else result.append("<unset>");
+ result.append(')');
+ return result.toString();
+ }
+
+} // Quote
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/noInterfaces/simple/SimpleFactory.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/noInterfaces/simple/SimpleFactory.java
new file mode 100644
index 0000000000..c35cdfa2cc
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/noInterfaces/simple/SimpleFactory.java
@@ -0,0 +1,333 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.noInterfaces.simple;
+
+import commonj.sdo.helper.HelperContext;
+import org.apache.tuscany.sdo.helper.TypeHelperImpl;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+
+import org.apache.tuscany.sdo.SDOFactory;
+
+import org.apache.tuscany.sdo.impl.FactoryBase;
+
+import org.apache.tuscany.sdo.model.ModelFactory;
+
+import org.apache.tuscany.sdo.model.impl.ModelFactoryImpl;
+
+import org.apache.tuscany.sdo.util.SDOUtil;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Factory</b> for the model.
+ * It provides a create method for each non-abstract class of the model.
+ * <!-- end-user-doc -->
+ * patternVersion=1.1; -noInterfaces
+ * @generated
+ */
+public class SimpleFactory extends FactoryBase
+{
+
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final SimpleFactory INSTANCE = com.example.noInterfaces.simple.SimpleFactory.init();
+
+ /**
+ * The package namespace URI.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String NAMESPACE_URI = "http://www.example.com/simple";
+
+ /**
+ * The package namespace name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String NAMESPACE_PREFIX = "simple";
+
+ /**
+ * The version of the generator pattern used to generate this class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String PATTERN_VERSION = "1.1";
+
+ public static final int QUOTE = 1;
+
+ /**
+ * Creates an instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public SimpleFactory()
+ {
+ super(NAMESPACE_URI, NAMESPACE_PREFIX, "com.example.noInterfaces.simple");
+ }
+
+ /**
+ * Registers the Factory instance so that it is available within the supplied scope.
+ * @argument scope a HelperContext instance that will make the types supported by this Factory available.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void register(HelperContext scope) {
+ if(scope == null) {
+ throw new IllegalArgumentException("Scope can not be null");
+ }
+ TypeHelperImpl th = (TypeHelperImpl)scope.getTypeHelper();
+ th.getExtendedMetaData().putPackage(NAMESPACE_URI, this);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public DataObject create(int typeNumber)
+ {
+ switch (typeNumber)
+ {
+ case QUOTE: return (DataObject)createQuote();
+ default:
+ return super.create(typeNumber);
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Quote createQuote()
+ {
+ Quote quote = new Quote();
+ return quote;
+ }
+
+ // Following creates and initializes SDO metadata for the supported types.
+ protected Type quoteType = null;
+
+ public Type getQuote()
+ {
+ return quoteType;
+ }
+
+
+ private static boolean isInited = false;
+
+ public static SimpleFactory init()
+ {
+ if (isInited) return (SimpleFactory)FactoryBase.getStaticFactory(SimpleFactory.NAMESPACE_URI);
+ SimpleFactory theSimpleFactory = new SimpleFactory();
+ isInited = true;
+
+ // Initialize simple dependencies
+ SDOUtil.registerStaticTypes(SDOFactory.class);
+ SDOUtil.registerStaticTypes(ModelFactory.class);
+
+ // Create package meta-data objects
+ theSimpleFactory.createMetaData();
+
+ // Initialize created meta-data
+ theSimpleFactory.initializeMetaData();
+
+ // Mark meta-data to indicate it can't be changed
+ //theSimpleFactory.freeze(); //FB do we need to freeze / should we freeze ????
+
+ return theSimpleFactory;
+ }
+
+ private boolean isCreated = false;
+
+ public void createMetaData()
+ {
+ if (isCreated) return;
+ isCreated = true;
+
+ // Create types and their properties
+ quoteType = createType(false, QUOTE);
+ createProperty(true, quoteType,Quote.INTERNAL_SYMBOL);
+ createProperty(true, quoteType,Quote.INTERNAL_COMPANY_NAME);
+ createProperty(true, quoteType,Quote.INTERNAL_PRICE);
+ createProperty(true, quoteType,Quote.INTERNAL_OPEN1);
+ createProperty(true, quoteType,Quote.INTERNAL_HIGH);
+ createProperty(true, quoteType,Quote.INTERNAL_LOW);
+ createProperty(true, quoteType,Quote.INTERNAL_VOLUME);
+ createProperty(true, quoteType,Quote.INTERNAL_CHANGE1);
+ createProperty(false, quoteType,Quote.INTERNAL_QUOTES);
+ }
+
+ private boolean isInitialized = false;
+
+ public void initializeMetaData()
+ {
+ if (isInitialized) return;
+ isInitialized = true;
+
+ // Obtain other dependent packages
+ ModelFactoryImpl theModelPackageImpl = (ModelFactoryImpl)FactoryBase.getStaticFactory(ModelFactoryImpl.NAMESPACE_URI);
+ Property property = null;
+
+ // Add supertypes to types
+
+ // Initialize types and properties
+ initializeType(quoteType, Quote.class, "Quote", false);
+ property = getProperty(quoteType, Quote.INTERNAL_SYMBOL);
+ initializeProperty(property, theModelPackageImpl.getString(), "symbol", null, 1, 1, Quote.class, false, true, false);
+
+ property = getProperty(quoteType, Quote.INTERNAL_COMPANY_NAME);
+ initializeProperty(property, theModelPackageImpl.getString(), "companyName", null, 1, 1, Quote.class, false, true, false);
+
+ property = getProperty(quoteType, Quote.INTERNAL_PRICE);
+ initializeProperty(property, theModelPackageImpl.getDecimal(), "price", null, 1, 1, Quote.class, false, true, false);
+
+ property = getProperty(quoteType, Quote.INTERNAL_OPEN1);
+ initializeProperty(property, theModelPackageImpl.getDecimal(), "open1", null, 1, 1, Quote.class, false, true, false);
+
+ property = getProperty(quoteType, Quote.INTERNAL_HIGH);
+ initializeProperty(property, theModelPackageImpl.getDecimal(), "high", null, 1, 1, Quote.class, false, true, false);
+
+ property = getProperty(quoteType, Quote.INTERNAL_LOW);
+ initializeProperty(property, theModelPackageImpl.getDecimal(), "low", null, 1, 1, Quote.class, false, true, false);
+
+ property = getProperty(quoteType, Quote.INTERNAL_VOLUME);
+ initializeProperty(property, theModelPackageImpl.getDouble(), "volume", null, 1, 1, Quote.class, false, true, false);
+
+ property = getProperty(quoteType, Quote.INTERNAL_CHANGE1);
+ initializeProperty(property, theModelPackageImpl.getDouble(), "change1", null, 1, 1, Quote.class, false, true, false);
+
+ property = getProperty(quoteType, Quote.INTERNAL_QUOTES);
+ initializeProperty(property, this.getQuote(), "quotes", null, 0, -1, Quote.class, false, false, false, true , null);
+
+ createXSDMetaData(theModelPackageImpl);
+ }
+
+ protected void createXSDMetaData(ModelFactoryImpl theModelPackageImpl)
+ {
+ super.initXSD();
+
+ Property property = null;
+
+
+ property = createGlobalProperty
+ ("stockQuote",
+ this.getQuote(),
+ new String[]
+ {
+ "kind", "element",
+ "name", "stockQuote",
+ "namespace", "##targetNamespace"
+ });
+
+ addXSDMapping
+ (quoteType,
+ new String[]
+ {
+ "name", "Quote",
+ "kind", "elementOnly"
+ });
+
+ addXSDMapping
+ (getProperty(quoteType, Quote.INTERNAL_SYMBOL),
+ new String[]
+ {
+ "kind", "element",
+ "name", "symbol"
+ });
+
+ addXSDMapping
+ (getProperty(quoteType, Quote.INTERNAL_COMPANY_NAME),
+ new String[]
+ {
+ "kind", "element",
+ "name", "companyName"
+ });
+
+ addXSDMapping
+ (getProperty(quoteType, Quote.INTERNAL_PRICE),
+ new String[]
+ {
+ "kind", "element",
+ "name", "price"
+ });
+
+ addXSDMapping
+ (getProperty(quoteType, Quote.INTERNAL_OPEN1),
+ new String[]
+ {
+ "kind", "element",
+ "name", "open1"
+ });
+
+ addXSDMapping
+ (getProperty(quoteType, Quote.INTERNAL_HIGH),
+ new String[]
+ {
+ "kind", "element",
+ "name", "high"
+ });
+
+ addXSDMapping
+ (getProperty(quoteType, Quote.INTERNAL_LOW),
+ new String[]
+ {
+ "kind", "element",
+ "name", "low"
+ });
+
+ addXSDMapping
+ (getProperty(quoteType, Quote.INTERNAL_VOLUME),
+ new String[]
+ {
+ "kind", "element",
+ "name", "volume"
+ });
+
+ addXSDMapping
+ (getProperty(quoteType, Quote.INTERNAL_CHANGE1),
+ new String[]
+ {
+ "kind", "element",
+ "name", "change1"
+ });
+
+ addXSDMapping
+ (getProperty(quoteType, Quote.INTERNAL_QUOTES),
+ new String[]
+ {
+ "kind", "element",
+ "name", "quotes"
+ });
+
+ }
+
+} //SimpleFactory
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/repchoice/RCType.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/repchoice/RCType.java
new file mode 100644
index 0000000000..29a558b5a2
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/repchoice/RCType.java
@@ -0,0 +1,103 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.repchoice;
+
+import commonj.sdo.Sequence;
+
+import java.io.Serializable;
+
+import java.util.List;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>RC Type</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link com.example.repchoice.RCType#getGroup <em>Group</em>}</li>
+ * <li>{@link com.example.repchoice.RCType#getS <em>S</em>}</li>
+ * <li>{@link com.example.repchoice.RCType#getI <em>I</em>}</li>
+ * <li>{@link com.example.repchoice.RCType#getF <em>F</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @extends Serializable
+ * @generated
+ */
+public interface RCType extends Serializable
+{
+ /**
+ * Returns the value of the '<em><b>Group</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Group</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Group</em>' attribute list.
+ * @generated
+ */
+ Sequence getGroup();
+
+ /**
+ * Returns the value of the '<em><b>S</b></em>' attribute list.
+ * The list contents are of type {@link java.lang.String}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>S</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>S</em>' attribute list.
+ * @generated
+ */
+ List getS();
+
+ /**
+ * Returns the value of the '<em><b>I</b></em>' attribute list.
+ * The list contents are of type {@link java.lang.Integer}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>I</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>I</em>' attribute list.
+ * @generated
+ */
+ List getI();
+
+ /**
+ * Returns the value of the '<em><b>F</b></em>' attribute list.
+ * The list contents are of type {@link java.lang.Float}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>F</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>F</em>' attribute list.
+ * @generated
+ */
+ List getF();
+
+} // RCType
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/repchoice/RepchoiceFactory.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/repchoice/RepchoiceFactory.java
new file mode 100644
index 0000000000..9a7c3033a5
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/repchoice/RepchoiceFactory.java
@@ -0,0 +1,61 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.repchoice;
+
+import commonj.sdo.helper.HelperContext;
+
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Factory</b> for the model.
+ * It provides a create method for each non-abstract class of the model.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public interface RepchoiceFactory
+{
+
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ RepchoiceFactory INSTANCE = com.example.repchoice.impl.RepchoiceFactoryImpl.init();
+
+ /**
+ * Returns a new object of class '<em>RC Type</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>RC Type</em>'.
+ * @generated
+ */
+ RCType createRCType();
+
+ /**
+ * Registers the types supported by this Factory within the supplied scope.argument
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param scope an instance of HelperContext used to manage the scoping of types.
+ * @generated
+ */
+ public void register(HelperContext scope);
+
+} //RepchoiceFactory
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/repchoice/impl/RCTypeImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/repchoice/impl/RCTypeImpl.java
new file mode 100644
index 0000000000..ad40d8f131
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/repchoice/impl/RCTypeImpl.java
@@ -0,0 +1,325 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.repchoice.impl;
+
+import com.example.repchoice.RCType;
+import com.example.repchoice.RepchoiceFactory;
+
+import commonj.sdo.Sequence;
+import commonj.sdo.Type;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.tuscany.sdo.impl.DataObjectBase;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>RC Type</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link com.example.repchoice.impl.RCTypeImpl#getGroup <em>Group</em>}</li>
+ * <li>{@link com.example.repchoice.impl.RCTypeImpl#getS <em>S</em>}</li>
+ * <li>{@link com.example.repchoice.impl.RCTypeImpl#getI <em>I</em>}</li>
+ * <li>{@link com.example.repchoice.impl.RCTypeImpl#getF <em>F</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class RCTypeImpl extends DataObjectBase implements RCType
+{
+
+ public final static int GROUP = -1;
+
+ public final static int S = 0;
+
+ public final static int I = 1;
+
+ public final static int F = 2;
+
+ public final static int SDO_PROPERTY_COUNT = 3;
+
+ public final static int EXTENDED_PROPERTY_COUNT = -1;
+
+
+ /**
+ * The internal feature id for the '<em><b>Group</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_GROUP = 0;
+
+ /**
+ * The internal feature id for the '<em><b>S</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_S = 1;
+
+ /**
+ * The internal feature id for the '<em><b>I</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_I = 2;
+
+ /**
+ * The internal feature id for the '<em><b>F</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_F = 3;
+
+ /**
+ * The number of properties for this type.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_PROPERTY_COUNT = 4;
+
+ protected int internalConvertIndex(int internalIndex)
+ {
+ switch (internalIndex)
+ {
+ case INTERNAL_GROUP: return GROUP;
+ case INTERNAL_S: return S;
+ case INTERNAL_I: return I;
+ case INTERNAL_F: return F;
+ }
+ return super.internalConvertIndex(internalIndex);
+ }
+
+
+ /**
+ * The cached value of the '{@link #getGroup() <em>Group</em>}' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getGroup()
+ * @generated
+ * @ordered
+ */
+
+ protected Sequence group = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public RCTypeImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Type getType()
+ {
+ return ((RepchoiceFactoryImpl)RepchoiceFactory.INSTANCE).getRCType();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Sequence getGroup()
+ {
+ if (group == null)
+ {
+ group = createSequence(INTERNAL_GROUP);
+ }
+ return group;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public List getS()
+ {
+ return getList(getGroup(), getType(), S);
+
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public List getI()
+ {
+ return getList(getGroup(), getType(), I);
+
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public List getF()
+ {
+ return getList(getGroup(), getType(), F);
+
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeContext inverseRemove(Object otherEnd, int propertyIndex, ChangeContext changeContext)
+ {
+ switch (propertyIndex)
+ {
+ case GROUP:
+ return removeFromSequence(getGroup(), otherEnd, changeContext);
+ }
+ return super.inverseRemove(otherEnd, propertyIndex, changeContext);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object get(int propertyIndex, boolean resolve)
+ {
+ switch (propertyIndex)
+ {
+ case GROUP:
+ // XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view
+ //if (coreType)
+ return getGroup();
+ case S:
+ return getS();
+ case I:
+ return getI();
+ case F:
+ return getF();
+ }
+ return super.get(propertyIndex, resolve);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void set(int propertyIndex, Object newValue)
+ {
+ switch (propertyIndex)
+ {
+ case GROUP:
+ setSequence(getGroup(), newValue);
+ return;
+ case S:
+ getS().clear();
+ getS().addAll((Collection)newValue);
+ return;
+ case I:
+ getI().clear();
+ getI().addAll((Collection)newValue);
+ return;
+ case F:
+ getF().clear();
+ getF().addAll((Collection)newValue);
+ return;
+ }
+ super.set(propertyIndex, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unset(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case GROUP:
+ unsetSequence(getGroup());
+ return;
+ case S:
+ getS().clear();
+ return;
+ case I:
+ getI().clear();
+ return;
+ case F:
+ getF().clear();
+ return;
+ }
+ super.unset(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSet(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case GROUP:
+ return group != null && !isSequenceEmpty(getGroup());
+ case S:
+ return !getS().isEmpty();
+ case I:
+ return !getI().isEmpty();
+ case F:
+ return !getF().isEmpty();
+ }
+ return super.isSet(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString()
+ {
+ if (isProxy(this)) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (group: ");
+ result.append(group);
+ result.append(')');
+ return result.toString();
+ }
+
+} //RCTypeImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/repchoice/impl/RepchoiceFactoryImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/repchoice/impl/RepchoiceFactoryImpl.java
new file mode 100644
index 0000000000..8d71ff4c3b
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/repchoice/impl/RepchoiceFactoryImpl.java
@@ -0,0 +1,270 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.repchoice.impl;
+
+import commonj.sdo.helper.HelperContext;
+import org.apache.tuscany.sdo.helper.TypeHelperImpl;
+
+import com.example.repchoice.*;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+
+import org.apache.tuscany.sdo.SDOFactory;
+
+import org.apache.tuscany.sdo.impl.FactoryBase;
+
+import org.apache.tuscany.sdo.model.ModelFactory;
+
+import org.apache.tuscany.sdo.model.impl.ModelFactoryImpl;
+
+import org.apache.tuscany.sdo.util.SDOUtil;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Factory</b>.
+ * Generator information:
+ * patternVersion=1.1;
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class RepchoiceFactoryImpl extends FactoryBase implements RepchoiceFactory
+{
+
+ /**
+ * The package namespace URI.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String NAMESPACE_URI = "http://www.example.com/repchoice";
+
+ /**
+ * The package namespace name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String NAMESPACE_PREFIX = "repchoice";
+
+ /**
+ * The version of the generator pattern used to generate this class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String PATTERN_VERSION = "1.1";
+
+ public static final int RC_TYPE = 1;
+
+ /**
+ * Creates an instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public RepchoiceFactoryImpl()
+ {
+ super(NAMESPACE_URI, NAMESPACE_PREFIX, "com.example.repchoice");
+ }
+
+ /**
+ * Registers the Factory instance so that it is available within the supplied scope.
+ * @argument scope a HelperContext instance that will make the types supported by this Factory available.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void register(HelperContext scope) {
+ if(scope == null) {
+ throw new IllegalArgumentException("Scope can not be null");
+ }
+ TypeHelperImpl th = (TypeHelperImpl)scope.getTypeHelper();
+ th.getExtendedMetaData().putPackage(NAMESPACE_URI, this);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public DataObject create(int typeNumber)
+ {
+ switch (typeNumber)
+ {
+ case RC_TYPE: return (DataObject)createRCType();
+ default:
+ return super.create(typeNumber);
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public RCType createRCType()
+ {
+ RCTypeImpl rcType = new RCTypeImpl();
+ return rcType;
+ }
+
+ // Following creates and initializes SDO metadata for the supported types.
+ protected Type rcTypeType = null;
+
+ public Type getRCType()
+ {
+ return rcTypeType;
+ }
+
+
+ private static boolean isInited = false;
+
+ public static RepchoiceFactoryImpl init()
+ {
+ if (isInited) return (RepchoiceFactoryImpl)FactoryBase.getStaticFactory(RepchoiceFactoryImpl.NAMESPACE_URI);
+ RepchoiceFactoryImpl theRepchoiceFactoryImpl = new RepchoiceFactoryImpl();
+ isInited = true;
+
+ // Initialize simple dependencies
+ SDOUtil.registerStaticTypes(SDOFactory.class);
+ SDOUtil.registerStaticTypes(ModelFactory.class);
+
+ // Create package meta-data objects
+ theRepchoiceFactoryImpl.createMetaData();
+
+ // Initialize created meta-data
+ theRepchoiceFactoryImpl.initializeMetaData();
+
+ // Mark meta-data to indicate it can't be changed
+ //theRepchoiceFactoryImpl.freeze(); //FB do we need to freeze / should we freeze ????
+
+ return theRepchoiceFactoryImpl;
+ }
+
+ private boolean isCreated = false;
+
+ public void createMetaData()
+ {
+ if (isCreated) return;
+ isCreated = true;
+
+ // Create types and their properties
+ rcTypeType = createType(false, RC_TYPE);
+ createProperty(true, rcTypeType,RCTypeImpl.INTERNAL_GROUP);
+ createProperty(true, rcTypeType,RCTypeImpl.INTERNAL_S);
+ createProperty(true, rcTypeType,RCTypeImpl.INTERNAL_I);
+ createProperty(true, rcTypeType,RCTypeImpl.INTERNAL_F);
+ }
+
+ private boolean isInitialized = false;
+
+ public void initializeMetaData()
+ {
+ if (isInitialized) return;
+ isInitialized = true;
+
+ // Obtain other dependent packages
+ ModelFactoryImpl theModelPackageImpl = (ModelFactoryImpl)FactoryBase.getStaticFactory(ModelFactoryImpl.NAMESPACE_URI);
+ Property property = null;
+
+ // Add supertypes to types
+
+ // Initialize types and properties
+ initializeType(rcTypeType, RCType.class, "RCType", false);
+ property = getProperty(rcTypeType, RCTypeImpl.INTERNAL_GROUP);
+ initializeProperty(property, getSequence(), "group", null, 0, -1, RCType.class, false, false, false);
+
+ property = getProperty(rcTypeType, RCTypeImpl.INTERNAL_S);
+ initializeProperty(property, theModelPackageImpl.getString(), "s", null, 0, -1, RCType.class, false, false, true);
+
+ property = getProperty(rcTypeType, RCTypeImpl.INTERNAL_I);
+ initializeProperty(property, theModelPackageImpl.getInt(), "i", null, 0, -1, RCType.class, false, false, true);
+
+ property = getProperty(rcTypeType, RCTypeImpl.INTERNAL_F);
+ initializeProperty(property, theModelPackageImpl.getFloat(), "f", null, 0, -1, RCType.class, false, false, true);
+
+ createXSDMetaData(theModelPackageImpl);
+ }
+
+ protected void createXSDMetaData(ModelFactoryImpl theModelPackageImpl)
+ {
+ super.initXSD();
+
+ Property property = null;
+
+
+ property = createGlobalProperty
+ ("rc",
+ this.getRCType(),
+ new String[]
+ {
+ "kind", "element",
+ "name", "rc",
+ "namespace", "##targetNamespace"
+ });
+
+ addXSDMapping
+ (rcTypeType,
+ new String[]
+ {
+ "name", "RCType",
+ "kind", "elementOnly"
+ });
+
+ addXSDMapping
+ (getProperty(rcTypeType, RCTypeImpl.INTERNAL_GROUP),
+ new String[]
+ {
+ "kind", "group",
+ "name", "group:0"
+ });
+
+ addXSDMapping
+ (getProperty(rcTypeType, RCTypeImpl.INTERNAL_S),
+ new String[]
+ {
+ "kind", "element",
+ "name", "s",
+ "group", "#group:0"
+ });
+
+ addXSDMapping
+ (getProperty(rcTypeType, RCTypeImpl.INTERNAL_I),
+ new String[]
+ {
+ "kind", "element",
+ "name", "i",
+ "group", "#group:0"
+ });
+
+ addXSDMapping
+ (getProperty(rcTypeType, RCTypeImpl.INTERNAL_F),
+ new String[]
+ {
+ "kind", "element",
+ "name", "f",
+ "group", "#group:0"
+ });
+
+ }
+
+} //RepchoiceFactoryImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/MixedQuote.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/MixedQuote.java
new file mode 100644
index 0000000000..f1882ba616
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/MixedQuote.java
@@ -0,0 +1,491 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.sequences;
+
+import commonj.sdo.Sequence;
+
+import java.io.Serializable;
+
+import java.math.BigDecimal;
+
+import java.util.List;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Mixed Quote</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link com.example.sequences.MixedQuote#getMixed <em>Mixed</em>}</li>
+ * <li>{@link com.example.sequences.MixedQuote#getSymbol <em>Symbol</em>}</li>
+ * <li>{@link com.example.sequences.MixedQuote#getCompanyName <em>Company Name</em>}</li>
+ * <li>{@link com.example.sequences.MixedQuote#getPrice <em>Price</em>}</li>
+ * <li>{@link com.example.sequences.MixedQuote#getOpen1 <em>Open1</em>}</li>
+ * <li>{@link com.example.sequences.MixedQuote#getHigh <em>High</em>}</li>
+ * <li>{@link com.example.sequences.MixedQuote#getLow <em>Low</em>}</li>
+ * <li>{@link com.example.sequences.MixedQuote#getVolume <em>Volume</em>}</li>
+ * <li>{@link com.example.sequences.MixedQuote#getChange1 <em>Change1</em>}</li>
+ * <li>{@link com.example.sequences.MixedQuote#getQuotes <em>Quotes</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @extends Serializable
+ * @generated
+ */
+public interface MixedQuote extends Serializable
+{
+ /**
+ * Returns the value of the '<em><b>Mixed</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Mixed</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Mixed</em>' attribute list.
+ * @generated
+ */
+ Sequence getMixed();
+
+ /**
+ * Returns the value of the '<em><b>Symbol</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Symbol</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Symbol</em>' attribute.
+ * @see #isSetSymbol()
+ * @see #unsetSymbol()
+ * @see #setSymbol(String)
+ * @generated
+ */
+ String getSymbol();
+
+ /**
+ * Sets the value of the '{@link com.example.sequences.MixedQuote#getSymbol <em>Symbol</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Symbol</em>' attribute.
+ * @see #isSetSymbol()
+ * @see #unsetSymbol()
+ * @see #getSymbol()
+ * @generated
+ */
+ void setSymbol(String value);
+
+ /**
+ * Unsets the value of the '{@link com.example.sequences.MixedQuote#getSymbol <em>Symbol</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetSymbol()
+ * @see #getSymbol()
+ * @see #setSymbol(String)
+ * @generated
+ */
+ void unsetSymbol();
+
+ /**
+ * Returns whether the value of the '{@link com.example.sequences.MixedQuote#getSymbol <em>Symbol</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Symbol</em>' attribute is set.
+ * @see #unsetSymbol()
+ * @see #getSymbol()
+ * @see #setSymbol(String)
+ * @generated
+ */
+ boolean isSetSymbol();
+
+ /**
+ * Returns the value of the '<em><b>Company Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Company Name</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Company Name</em>' attribute.
+ * @see #isSetCompanyName()
+ * @see #unsetCompanyName()
+ * @see #setCompanyName(String)
+ * @generated
+ */
+ String getCompanyName();
+
+ /**
+ * Sets the value of the '{@link com.example.sequences.MixedQuote#getCompanyName <em>Company Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Company Name</em>' attribute.
+ * @see #isSetCompanyName()
+ * @see #unsetCompanyName()
+ * @see #getCompanyName()
+ * @generated
+ */
+ void setCompanyName(String value);
+
+ /**
+ * Unsets the value of the '{@link com.example.sequences.MixedQuote#getCompanyName <em>Company Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetCompanyName()
+ * @see #getCompanyName()
+ * @see #setCompanyName(String)
+ * @generated
+ */
+ void unsetCompanyName();
+
+ /**
+ * Returns whether the value of the '{@link com.example.sequences.MixedQuote#getCompanyName <em>Company Name</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Company Name</em>' attribute is set.
+ * @see #unsetCompanyName()
+ * @see #getCompanyName()
+ * @see #setCompanyName(String)
+ * @generated
+ */
+ boolean isSetCompanyName();
+
+ /**
+ * Returns the value of the '<em><b>Price</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Price</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Price</em>' attribute.
+ * @see #isSetPrice()
+ * @see #unsetPrice()
+ * @see #setPrice(BigDecimal)
+ * @generated
+ */
+ BigDecimal getPrice();
+
+ /**
+ * Sets the value of the '{@link com.example.sequences.MixedQuote#getPrice <em>Price</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Price</em>' attribute.
+ * @see #isSetPrice()
+ * @see #unsetPrice()
+ * @see #getPrice()
+ * @generated
+ */
+ void setPrice(BigDecimal value);
+
+ /**
+ * Unsets the value of the '{@link com.example.sequences.MixedQuote#getPrice <em>Price</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetPrice()
+ * @see #getPrice()
+ * @see #setPrice(BigDecimal)
+ * @generated
+ */
+ void unsetPrice();
+
+ /**
+ * Returns whether the value of the '{@link com.example.sequences.MixedQuote#getPrice <em>Price</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Price</em>' attribute is set.
+ * @see #unsetPrice()
+ * @see #getPrice()
+ * @see #setPrice(BigDecimal)
+ * @generated
+ */
+ boolean isSetPrice();
+
+ /**
+ * Returns the value of the '<em><b>Open1</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Open1</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Open1</em>' attribute.
+ * @see #isSetOpen1()
+ * @see #unsetOpen1()
+ * @see #setOpen1(BigDecimal)
+ * @generated
+ */
+ BigDecimal getOpen1();
+
+ /**
+ * Sets the value of the '{@link com.example.sequences.MixedQuote#getOpen1 <em>Open1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Open1</em>' attribute.
+ * @see #isSetOpen1()
+ * @see #unsetOpen1()
+ * @see #getOpen1()
+ * @generated
+ */
+ void setOpen1(BigDecimal value);
+
+ /**
+ * Unsets the value of the '{@link com.example.sequences.MixedQuote#getOpen1 <em>Open1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetOpen1()
+ * @see #getOpen1()
+ * @see #setOpen1(BigDecimal)
+ * @generated
+ */
+ void unsetOpen1();
+
+ /**
+ * Returns whether the value of the '{@link com.example.sequences.MixedQuote#getOpen1 <em>Open1</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Open1</em>' attribute is set.
+ * @see #unsetOpen1()
+ * @see #getOpen1()
+ * @see #setOpen1(BigDecimal)
+ * @generated
+ */
+ boolean isSetOpen1();
+
+ /**
+ * Returns the value of the '<em><b>High</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>High</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>High</em>' attribute.
+ * @see #isSetHigh()
+ * @see #unsetHigh()
+ * @see #setHigh(BigDecimal)
+ * @generated
+ */
+ BigDecimal getHigh();
+
+ /**
+ * Sets the value of the '{@link com.example.sequences.MixedQuote#getHigh <em>High</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>High</em>' attribute.
+ * @see #isSetHigh()
+ * @see #unsetHigh()
+ * @see #getHigh()
+ * @generated
+ */
+ void setHigh(BigDecimal value);
+
+ /**
+ * Unsets the value of the '{@link com.example.sequences.MixedQuote#getHigh <em>High</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetHigh()
+ * @see #getHigh()
+ * @see #setHigh(BigDecimal)
+ * @generated
+ */
+ void unsetHigh();
+
+ /**
+ * Returns whether the value of the '{@link com.example.sequences.MixedQuote#getHigh <em>High</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>High</em>' attribute is set.
+ * @see #unsetHigh()
+ * @see #getHigh()
+ * @see #setHigh(BigDecimal)
+ * @generated
+ */
+ boolean isSetHigh();
+
+ /**
+ * Returns the value of the '<em><b>Low</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Low</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Low</em>' attribute.
+ * @see #isSetLow()
+ * @see #unsetLow()
+ * @see #setLow(BigDecimal)
+ * @generated
+ */
+ BigDecimal getLow();
+
+ /**
+ * Sets the value of the '{@link com.example.sequences.MixedQuote#getLow <em>Low</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Low</em>' attribute.
+ * @see #isSetLow()
+ * @see #unsetLow()
+ * @see #getLow()
+ * @generated
+ */
+ void setLow(BigDecimal value);
+
+ /**
+ * Unsets the value of the '{@link com.example.sequences.MixedQuote#getLow <em>Low</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetLow()
+ * @see #getLow()
+ * @see #setLow(BigDecimal)
+ * @generated
+ */
+ void unsetLow();
+
+ /**
+ * Returns whether the value of the '{@link com.example.sequences.MixedQuote#getLow <em>Low</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Low</em>' attribute is set.
+ * @see #unsetLow()
+ * @see #getLow()
+ * @see #setLow(BigDecimal)
+ * @generated
+ */
+ boolean isSetLow();
+
+ /**
+ * Returns the value of the '<em><b>Volume</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Volume</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Volume</em>' attribute.
+ * @see #isSetVolume()
+ * @see #unsetVolume()
+ * @see #setVolume(double)
+ * @generated
+ */
+ double getVolume();
+
+ /**
+ * Sets the value of the '{@link com.example.sequences.MixedQuote#getVolume <em>Volume</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Volume</em>' attribute.
+ * @see #isSetVolume()
+ * @see #unsetVolume()
+ * @see #getVolume()
+ * @generated
+ */
+ void setVolume(double value);
+
+ /**
+ * Unsets the value of the '{@link com.example.sequences.MixedQuote#getVolume <em>Volume</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetVolume()
+ * @see #getVolume()
+ * @see #setVolume(double)
+ * @generated
+ */
+ void unsetVolume();
+
+ /**
+ * Returns whether the value of the '{@link com.example.sequences.MixedQuote#getVolume <em>Volume</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Volume</em>' attribute is set.
+ * @see #unsetVolume()
+ * @see #getVolume()
+ * @see #setVolume(double)
+ * @generated
+ */
+ boolean isSetVolume();
+
+ /**
+ * Returns the value of the '<em><b>Change1</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Change1</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Change1</em>' attribute.
+ * @see #isSetChange1()
+ * @see #unsetChange1()
+ * @see #setChange1(double)
+ * @generated
+ */
+ double getChange1();
+
+ /**
+ * Sets the value of the '{@link com.example.sequences.MixedQuote#getChange1 <em>Change1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Change1</em>' attribute.
+ * @see #isSetChange1()
+ * @see #unsetChange1()
+ * @see #getChange1()
+ * @generated
+ */
+ void setChange1(double value);
+
+ /**
+ * Unsets the value of the '{@link com.example.sequences.MixedQuote#getChange1 <em>Change1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetChange1()
+ * @see #getChange1()
+ * @see #setChange1(double)
+ * @generated
+ */
+ void unsetChange1();
+
+ /**
+ * Returns whether the value of the '{@link com.example.sequences.MixedQuote#getChange1 <em>Change1</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Change1</em>' attribute is set.
+ * @see #unsetChange1()
+ * @see #getChange1()
+ * @see #setChange1(double)
+ * @generated
+ */
+ boolean isSetChange1();
+
+ /**
+ * Returns the value of the '<em><b>Quotes</b></em>' containment reference list.
+ * The list contents are of type {@link com.example.sequences.MixedQuote}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Quotes</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Quotes</em>' containment reference list.
+ * @generated
+ */
+ List getQuotes();
+
+} // MixedQuote
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/MixedRepeatingChoice.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/MixedRepeatingChoice.java
new file mode 100644
index 0000000000..dba64b0487
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/MixedRepeatingChoice.java
@@ -0,0 +1,102 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.sequences;
+
+import commonj.sdo.Sequence;
+
+import java.io.Serializable;
+
+import java.util.List;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Mixed Repeating Choice</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link com.example.sequences.MixedRepeatingChoice#getMixed <em>Mixed</em>}</li>
+ * <li>{@link com.example.sequences.MixedRepeatingChoice#getGroup <em>Group</em>}</li>
+ * <li>{@link com.example.sequences.MixedRepeatingChoice#getA <em>A</em>}</li>
+ * <li>{@link com.example.sequences.MixedRepeatingChoice#getB <em>B</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @extends Serializable
+ * @generated
+ */
+public interface MixedRepeatingChoice extends Serializable
+{
+ /**
+ * Returns the value of the '<em><b>Mixed</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Mixed</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Mixed</em>' attribute list.
+ * @generated
+ */
+ Sequence getMixed();
+
+ /**
+ * Returns the value of the '<em><b>Group</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Group</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Group</em>' attribute list.
+ * @generated
+ */
+ Sequence getGroup();
+
+ /**
+ * Returns the value of the '<em><b>A</b></em>' attribute list.
+ * The list contents are of type {@link java.lang.String}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>A</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>A</em>' attribute list.
+ * @generated
+ */
+ List getA();
+
+ /**
+ * Returns the value of the '<em><b>B</b></em>' attribute list.
+ * The list contents are of type {@link java.lang.Integer}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>B</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>B</em>' attribute list.
+ * @generated
+ */
+ List getB();
+
+} // MixedRepeatingChoice
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/RepeatingChoice.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/RepeatingChoice.java
new file mode 100644
index 0000000000..3f0b0839f2
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/RepeatingChoice.java
@@ -0,0 +1,88 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.sequences;
+
+import commonj.sdo.Sequence;
+
+import java.io.Serializable;
+
+import java.util.List;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Repeating Choice</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link com.example.sequences.RepeatingChoice#getGroup <em>Group</em>}</li>
+ * <li>{@link com.example.sequences.RepeatingChoice#getA <em>A</em>}</li>
+ * <li>{@link com.example.sequences.RepeatingChoice#getB <em>B</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @extends Serializable
+ * @generated
+ */
+public interface RepeatingChoice extends Serializable
+{
+ /**
+ * Returns the value of the '<em><b>Group</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Group</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Group</em>' attribute list.
+ * @generated
+ */
+ Sequence getGroup();
+
+ /**
+ * Returns the value of the '<em><b>A</b></em>' attribute list.
+ * The list contents are of type {@link java.lang.String}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>A</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>A</em>' attribute list.
+ * @generated
+ */
+ List getA();
+
+ /**
+ * Returns the value of the '<em><b>B</b></em>' attribute list.
+ * The list contents are of type {@link java.lang.Integer}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>B</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>B</em>' attribute list.
+ * @generated
+ */
+ List getB();
+
+} // RepeatingChoice
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/SequencesFactory.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/SequencesFactory.java
new file mode 100644
index 0000000000..900b51ddc3
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/SequencesFactory.java
@@ -0,0 +1,97 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.sequences;
+
+import commonj.sdo.helper.HelperContext;
+
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Factory</b> for the model.
+ * It provides a create method for each non-abstract class of the model.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public interface SequencesFactory
+{
+
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ SequencesFactory INSTANCE = com.example.sequences.impl.SequencesFactoryImpl.init();
+
+ /**
+ * Returns a new object of class '<em>Mixed Quote</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Mixed Quote</em>'.
+ * @generated
+ */
+ MixedQuote createMixedQuote();
+
+ /**
+ * Returns a new object of class '<em>Mixed Repeating Choice</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Mixed Repeating Choice</em>'.
+ * @generated
+ */
+ MixedRepeatingChoice createMixedRepeatingChoice();
+
+ /**
+ * Returns a new object of class '<em>Repeating Choice</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Repeating Choice</em>'.
+ * @generated
+ */
+ RepeatingChoice createRepeatingChoice();
+
+ /**
+ * Returns a new object of class '<em>Two RCs</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Two RCs</em>'.
+ * @generated
+ */
+ TwoRCs createTwoRCs();
+
+ /**
+ * Returns a new object of class '<em>Two RCs Mixed</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Two RCs Mixed</em>'.
+ * @generated
+ */
+ TwoRCsMixed createTwoRCsMixed();
+
+ /**
+ * Registers the types supported by this Factory within the supplied scope.argument
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param scope an instance of HelperContext used to manage the scoping of types.
+ * @generated
+ */
+ public void register(HelperContext scope);
+
+} //SequencesFactory
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/TwoRCs.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/TwoRCs.java
new file mode 100644
index 0000000000..c6e54e6598
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/TwoRCs.java
@@ -0,0 +1,184 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.sequences;
+
+import commonj.sdo.Sequence;
+
+import java.io.Serializable;
+
+import java.util.List;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Two RCs</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link com.example.sequences.TwoRCs#getGroup <em>Group</em>}</li>
+ * <li>{@link com.example.sequences.TwoRCs#getA <em>A</em>}</li>
+ * <li>{@link com.example.sequences.TwoRCs#getB <em>B</em>}</li>
+ * <li>{@link com.example.sequences.TwoRCs#getSplit <em>Split</em>}</li>
+ * <li>{@link com.example.sequences.TwoRCs#getGroup1 <em>Group1</em>}</li>
+ * <li>{@link com.example.sequences.TwoRCs#getY <em>Y</em>}</li>
+ * <li>{@link com.example.sequences.TwoRCs#getZ <em>Z</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @extends Serializable
+ * @generated
+ */
+public interface TwoRCs extends Serializable
+{
+ /**
+ * Returns the value of the '<em><b>Group</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Group</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Group</em>' attribute list.
+ * @generated
+ */
+ Sequence getGroup();
+
+ /**
+ * Returns the value of the '<em><b>A</b></em>' attribute list.
+ * The list contents are of type {@link java.lang.String}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>A</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>A</em>' attribute list.
+ * @generated
+ */
+ List getA();
+
+ /**
+ * Returns the value of the '<em><b>B</b></em>' attribute list.
+ * The list contents are of type {@link java.lang.Integer}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>B</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>B</em>' attribute list.
+ * @generated
+ */
+ List getB();
+
+ /**
+ * Returns the value of the '<em><b>Split</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Split</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Split</em>' attribute.
+ * @see #isSetSplit()
+ * @see #unsetSplit()
+ * @see #setSplit(String)
+ * @generated
+ */
+ String getSplit();
+
+ /**
+ * Sets the value of the '{@link com.example.sequences.TwoRCs#getSplit <em>Split</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Split</em>' attribute.
+ * @see #isSetSplit()
+ * @see #unsetSplit()
+ * @see #getSplit()
+ * @generated
+ */
+ void setSplit(String value);
+
+ /**
+ * Unsets the value of the '{@link com.example.sequences.TwoRCs#getSplit <em>Split</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetSplit()
+ * @see #getSplit()
+ * @see #setSplit(String)
+ * @generated
+ */
+ void unsetSplit();
+
+ /**
+ * Returns whether the value of the '{@link com.example.sequences.TwoRCs#getSplit <em>Split</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Split</em>' attribute is set.
+ * @see #unsetSplit()
+ * @see #getSplit()
+ * @see #setSplit(String)
+ * @generated
+ */
+ boolean isSetSplit();
+
+ /**
+ * Returns the value of the '<em><b>Group1</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Group1</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Group1</em>' attribute list.
+ * @generated
+ */
+ Sequence getGroup1();
+
+ /**
+ * Returns the value of the '<em><b>Y</b></em>' attribute list.
+ * The list contents are of type {@link java.lang.String}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Y</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Y</em>' attribute list.
+ * @generated
+ */
+ List getY();
+
+ /**
+ * Returns the value of the '<em><b>Z</b></em>' attribute list.
+ * The list contents are of type {@link java.lang.Integer}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Z</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Z</em>' attribute list.
+ * @generated
+ */
+ List getZ();
+
+} // TwoRCs
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/TwoRCsMixed.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/TwoRCsMixed.java
new file mode 100644
index 0000000000..90d5f942b6
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/TwoRCsMixed.java
@@ -0,0 +1,198 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.sequences;
+
+import commonj.sdo.Sequence;
+
+import java.io.Serializable;
+
+import java.util.List;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Two RCs Mixed</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link com.example.sequences.TwoRCsMixed#getMixed <em>Mixed</em>}</li>
+ * <li>{@link com.example.sequences.TwoRCsMixed#getGroup <em>Group</em>}</li>
+ * <li>{@link com.example.sequences.TwoRCsMixed#getA <em>A</em>}</li>
+ * <li>{@link com.example.sequences.TwoRCsMixed#getB <em>B</em>}</li>
+ * <li>{@link com.example.sequences.TwoRCsMixed#getSplit <em>Split</em>}</li>
+ * <li>{@link com.example.sequences.TwoRCsMixed#getGroup1 <em>Group1</em>}</li>
+ * <li>{@link com.example.sequences.TwoRCsMixed#getY <em>Y</em>}</li>
+ * <li>{@link com.example.sequences.TwoRCsMixed#getZ <em>Z</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @extends Serializable
+ * @generated
+ */
+public interface TwoRCsMixed extends Serializable
+{
+ /**
+ * Returns the value of the '<em><b>Mixed</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Mixed</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Mixed</em>' attribute list.
+ * @generated
+ */
+ Sequence getMixed();
+
+ /**
+ * Returns the value of the '<em><b>Group</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Group</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Group</em>' attribute list.
+ * @generated
+ */
+ Sequence getGroup();
+
+ /**
+ * Returns the value of the '<em><b>A</b></em>' attribute list.
+ * The list contents are of type {@link java.lang.String}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>A</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>A</em>' attribute list.
+ * @generated
+ */
+ List getA();
+
+ /**
+ * Returns the value of the '<em><b>B</b></em>' attribute list.
+ * The list contents are of type {@link java.lang.Integer}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>B</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>B</em>' attribute list.
+ * @generated
+ */
+ List getB();
+
+ /**
+ * Returns the value of the '<em><b>Split</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Split</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Split</em>' attribute.
+ * @see #isSetSplit()
+ * @see #unsetSplit()
+ * @see #setSplit(String)
+ * @generated
+ */
+ String getSplit();
+
+ /**
+ * Sets the value of the '{@link com.example.sequences.TwoRCsMixed#getSplit <em>Split</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Split</em>' attribute.
+ * @see #isSetSplit()
+ * @see #unsetSplit()
+ * @see #getSplit()
+ * @generated
+ */
+ void setSplit(String value);
+
+ /**
+ * Unsets the value of the '{@link com.example.sequences.TwoRCsMixed#getSplit <em>Split</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetSplit()
+ * @see #getSplit()
+ * @see #setSplit(String)
+ * @generated
+ */
+ void unsetSplit();
+
+ /**
+ * Returns whether the value of the '{@link com.example.sequences.TwoRCsMixed#getSplit <em>Split</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Split</em>' attribute is set.
+ * @see #unsetSplit()
+ * @see #getSplit()
+ * @see #setSplit(String)
+ * @generated
+ */
+ boolean isSetSplit();
+
+ /**
+ * Returns the value of the '<em><b>Group1</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Group1</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Group1</em>' attribute list.
+ * @generated
+ */
+ Sequence getGroup1();
+
+ /**
+ * Returns the value of the '<em><b>Y</b></em>' attribute list.
+ * The list contents are of type {@link java.lang.String}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Y</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Y</em>' attribute list.
+ * @generated
+ */
+ List getY();
+
+ /**
+ * Returns the value of the '<em><b>Z</b></em>' attribute list.
+ * The list contents are of type {@link java.lang.Integer}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Z</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Z</em>' attribute list.
+ * @generated
+ */
+ List getZ();
+
+} // TwoRCsMixed
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/impl/MixedQuoteImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/impl/MixedQuoteImpl.java
new file mode 100644
index 0000000000..044ed4468c
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/impl/MixedQuoteImpl.java
@@ -0,0 +1,757 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.sequences.impl;
+
+import com.example.sequences.MixedQuote;
+import com.example.sequences.SequencesFactory;
+
+import commonj.sdo.Sequence;
+import commonj.sdo.Type;
+
+import java.math.BigDecimal;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.tuscany.sdo.impl.DataObjectBase;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Mixed Quote</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link com.example.sequences.impl.MixedQuoteImpl#getMixed <em>Mixed</em>}</li>
+ * <li>{@link com.example.sequences.impl.MixedQuoteImpl#getSymbol <em>Symbol</em>}</li>
+ * <li>{@link com.example.sequences.impl.MixedQuoteImpl#getCompanyName <em>Company Name</em>}</li>
+ * <li>{@link com.example.sequences.impl.MixedQuoteImpl#getPrice <em>Price</em>}</li>
+ * <li>{@link com.example.sequences.impl.MixedQuoteImpl#getOpen1 <em>Open1</em>}</li>
+ * <li>{@link com.example.sequences.impl.MixedQuoteImpl#getHigh <em>High</em>}</li>
+ * <li>{@link com.example.sequences.impl.MixedQuoteImpl#getLow <em>Low</em>}</li>
+ * <li>{@link com.example.sequences.impl.MixedQuoteImpl#getVolume <em>Volume</em>}</li>
+ * <li>{@link com.example.sequences.impl.MixedQuoteImpl#getChange1 <em>Change1</em>}</li>
+ * <li>{@link com.example.sequences.impl.MixedQuoteImpl#getQuotes <em>Quotes</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class MixedQuoteImpl extends DataObjectBase implements MixedQuote
+{
+
+ public final static int MIXED = -1;
+
+ public final static int SYMBOL = 0;
+
+ public final static int COMPANY_NAME = 1;
+
+ public final static int PRICE = 2;
+
+ public final static int OPEN1 = 3;
+
+ public final static int HIGH = 4;
+
+ public final static int LOW = 5;
+
+ public final static int VOLUME = 6;
+
+ public final static int CHANGE1 = 7;
+
+ public final static int QUOTES = 8;
+
+ public final static int SDO_PROPERTY_COUNT = 9;
+
+ public final static int EXTENDED_PROPERTY_COUNT = -1;
+
+
+ /**
+ * The internal feature id for the '<em><b>Mixed</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_MIXED = 0;
+
+ /**
+ * The internal feature id for the '<em><b>Symbol</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_SYMBOL = 1;
+
+ /**
+ * The internal feature id for the '<em><b>Company Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_COMPANY_NAME = 2;
+
+ /**
+ * The internal feature id for the '<em><b>Price</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_PRICE = 3;
+
+ /**
+ * The internal feature id for the '<em><b>Open1</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_OPEN1 = 4;
+
+ /**
+ * The internal feature id for the '<em><b>High</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_HIGH = 5;
+
+ /**
+ * The internal feature id for the '<em><b>Low</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_LOW = 6;
+
+ /**
+ * The internal feature id for the '<em><b>Volume</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_VOLUME = 7;
+
+ /**
+ * The internal feature id for the '<em><b>Change1</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_CHANGE1 = 8;
+
+ /**
+ * The internal feature id for the '<em><b>Quotes</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_QUOTES = 9;
+
+ /**
+ * The number of properties for this type.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_PROPERTY_COUNT = 10;
+
+ protected int internalConvertIndex(int internalIndex)
+ {
+ switch (internalIndex)
+ {
+ case INTERNAL_MIXED: return MIXED;
+ case INTERNAL_SYMBOL: return SYMBOL;
+ case INTERNAL_COMPANY_NAME: return COMPANY_NAME;
+ case INTERNAL_PRICE: return PRICE;
+ case INTERNAL_OPEN1: return OPEN1;
+ case INTERNAL_HIGH: return HIGH;
+ case INTERNAL_LOW: return LOW;
+ case INTERNAL_VOLUME: return VOLUME;
+ case INTERNAL_CHANGE1: return CHANGE1;
+ case INTERNAL_QUOTES: return QUOTES;
+ }
+ return super.internalConvertIndex(internalIndex);
+ }
+
+
+ /**
+ * The cached value of the '{@link #getMixed() <em>Mixed</em>}' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getMixed()
+ * @generated
+ * @ordered
+ */
+
+ protected Sequence mixed = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public MixedQuoteImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Type getType()
+ {
+ return ((SequencesFactoryImpl)SequencesFactory.INSTANCE).getMixedQuote();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Sequence getMixed()
+ {
+ if (mixed == null)
+ {
+ mixed = createSequence(INTERNAL_MIXED);
+ }
+ return mixed;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getSymbol()
+ {
+ return (String)get(getMixed(), getType(), INTERNAL_SYMBOL);
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setSymbol(String newSymbol)
+ {
+ set(getMixed(), getType(), INTERNAL_SYMBOL, newSymbol);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetSymbol()
+ {
+ unset(getMixed(), getType(), SYMBOL);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetSymbol()
+ {
+ return isSet(getMixed(), getType(), SYMBOL);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getCompanyName()
+ {
+ return (String)get(getMixed(), getType(), INTERNAL_COMPANY_NAME);
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setCompanyName(String newCompanyName)
+ {
+ set(getMixed(), getType(), INTERNAL_COMPANY_NAME, newCompanyName);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetCompanyName()
+ {
+ unset(getMixed(), getType(), COMPANY_NAME);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetCompanyName()
+ {
+ return isSet(getMixed(), getType(), COMPANY_NAME);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public BigDecimal getPrice()
+ {
+ return (BigDecimal)get(getMixed(), getType(), INTERNAL_PRICE);
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setPrice(BigDecimal newPrice)
+ {
+ set(getMixed(), getType(), INTERNAL_PRICE, newPrice);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetPrice()
+ {
+ unset(getMixed(), getType(), PRICE);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetPrice()
+ {
+ return isSet(getMixed(), getType(), PRICE);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public BigDecimal getOpen1()
+ {
+ return (BigDecimal)get(getMixed(), getType(), INTERNAL_OPEN1);
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setOpen1(BigDecimal newOpen1)
+ {
+ set(getMixed(), getType(), INTERNAL_OPEN1, newOpen1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetOpen1()
+ {
+ unset(getMixed(), getType(), OPEN1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetOpen1()
+ {
+ return isSet(getMixed(), getType(), OPEN1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public BigDecimal getHigh()
+ {
+ return (BigDecimal)get(getMixed(), getType(), INTERNAL_HIGH);
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setHigh(BigDecimal newHigh)
+ {
+ set(getMixed(), getType(), INTERNAL_HIGH, newHigh);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetHigh()
+ {
+ unset(getMixed(), getType(), HIGH);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetHigh()
+ {
+ return isSet(getMixed(), getType(), HIGH);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public BigDecimal getLow()
+ {
+ return (BigDecimal)get(getMixed(), getType(), INTERNAL_LOW);
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setLow(BigDecimal newLow)
+ {
+ set(getMixed(), getType(), INTERNAL_LOW, newLow);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetLow()
+ {
+ unset(getMixed(), getType(), LOW);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetLow()
+ {
+ return isSet(getMixed(), getType(), LOW);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public double getVolume()
+ {
+ return ((Double)get(getMixed(), getType(), INTERNAL_VOLUME)).doubleValue();
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setVolume(double newVolume)
+ {
+ set(getMixed(), getType(), INTERNAL_VOLUME, new Double(newVolume));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetVolume()
+ {
+ unset(getMixed(), getType(), VOLUME);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetVolume()
+ {
+ return isSet(getMixed(), getType(), VOLUME);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public double getChange1()
+ {
+ return ((Double)get(getMixed(), getType(), INTERNAL_CHANGE1)).doubleValue();
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setChange1(double newChange1)
+ {
+ set(getMixed(), getType(), INTERNAL_CHANGE1, new Double(newChange1));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetChange1()
+ {
+ unset(getMixed(), getType(), CHANGE1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetChange1()
+ {
+ return isSet(getMixed(), getType(), CHANGE1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public List getQuotes()
+ {
+ return getList(getMixed(), getType(), QUOTES);
+
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeContext inverseRemove(Object otherEnd, int propertyIndex, ChangeContext changeContext)
+ {
+ switch (propertyIndex)
+ {
+ case MIXED:
+ return removeFromSequence(getMixed(), otherEnd, changeContext);
+ case QUOTES:
+ return removeFromList(getQuotes(), otherEnd, changeContext);
+ }
+ return super.inverseRemove(otherEnd, propertyIndex, changeContext);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object get(int propertyIndex, boolean resolve)
+ {
+ switch (propertyIndex)
+ {
+ case MIXED:
+ // XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view
+ //if (coreType)
+ return getMixed();
+ case SYMBOL:
+ return getSymbol();
+ case COMPANY_NAME:
+ return getCompanyName();
+ case PRICE:
+ return getPrice();
+ case OPEN1:
+ return getOpen1();
+ case HIGH:
+ return getHigh();
+ case LOW:
+ return getLow();
+ case VOLUME:
+ return new Double(getVolume());
+ case CHANGE1:
+ return new Double(getChange1());
+ case QUOTES:
+ return getQuotes();
+ }
+ return super.get(propertyIndex, resolve);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void set(int propertyIndex, Object newValue)
+ {
+ switch (propertyIndex)
+ {
+ case MIXED:
+ setSequence(getMixed(), newValue);
+ return;
+ case SYMBOL:
+ setSymbol((String)newValue);
+ return;
+ case COMPANY_NAME:
+ setCompanyName((String)newValue);
+ return;
+ case PRICE:
+ setPrice((BigDecimal)newValue);
+ return;
+ case OPEN1:
+ setOpen1((BigDecimal)newValue);
+ return;
+ case HIGH:
+ setHigh((BigDecimal)newValue);
+ return;
+ case LOW:
+ setLow((BigDecimal)newValue);
+ return;
+ case VOLUME:
+ setVolume(((Double)newValue).doubleValue());
+ return;
+ case CHANGE1:
+ setChange1(((Double)newValue).doubleValue());
+ return;
+ case QUOTES:
+ getQuotes().clear();
+ getQuotes().addAll((Collection)newValue);
+ return;
+ }
+ super.set(propertyIndex, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unset(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case MIXED:
+ unsetSequence(getMixed());
+ return;
+ case SYMBOL:
+ unsetSymbol();
+ return;
+ case COMPANY_NAME:
+ unsetCompanyName();
+ return;
+ case PRICE:
+ unsetPrice();
+ return;
+ case OPEN1:
+ unsetOpen1();
+ return;
+ case HIGH:
+ unsetHigh();
+ return;
+ case LOW:
+ unsetLow();
+ return;
+ case VOLUME:
+ unsetVolume();
+ return;
+ case CHANGE1:
+ unsetChange1();
+ return;
+ case QUOTES:
+ getQuotes().clear();
+ return;
+ }
+ super.unset(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSet(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case MIXED:
+ return mixed != null && !isSequenceEmpty(getMixed());
+ case SYMBOL:
+ return isSetSymbol();
+ case COMPANY_NAME:
+ return isSetCompanyName();
+ case PRICE:
+ return isSetPrice();
+ case OPEN1:
+ return isSetOpen1();
+ case HIGH:
+ return isSetHigh();
+ case LOW:
+ return isSetLow();
+ case VOLUME:
+ return isSetVolume();
+ case CHANGE1:
+ return isSetChange1();
+ case QUOTES:
+ return !getQuotes().isEmpty();
+ }
+ return super.isSet(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString()
+ {
+ if (isProxy(this)) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (mixed: ");
+ result.append(mixed);
+ result.append(')');
+ return result.toString();
+ }
+
+} //MixedQuoteImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/impl/MixedRepeatingChoiceImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/impl/MixedRepeatingChoiceImpl.java
new file mode 100644
index 0000000000..aa4720ec4a
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/impl/MixedRepeatingChoiceImpl.java
@@ -0,0 +1,327 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.sequences.impl;
+
+import com.example.sequences.MixedRepeatingChoice;
+import com.example.sequences.SequencesFactory;
+
+import commonj.sdo.Sequence;
+import commonj.sdo.Type;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.tuscany.sdo.impl.DataObjectBase;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Mixed Repeating Choice</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link com.example.sequences.impl.MixedRepeatingChoiceImpl#getMixed <em>Mixed</em>}</li>
+ * <li>{@link com.example.sequences.impl.MixedRepeatingChoiceImpl#getGroup <em>Group</em>}</li>
+ * <li>{@link com.example.sequences.impl.MixedRepeatingChoiceImpl#getA <em>A</em>}</li>
+ * <li>{@link com.example.sequences.impl.MixedRepeatingChoiceImpl#getB <em>B</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class MixedRepeatingChoiceImpl extends DataObjectBase implements MixedRepeatingChoice
+{
+
+ public final static int MIXED = -1;
+
+ public final static int GROUP = -2;
+
+ public final static int A = 0;
+
+ public final static int B = 1;
+
+ public final static int SDO_PROPERTY_COUNT = 2;
+
+ public final static int EXTENDED_PROPERTY_COUNT = -2;
+
+
+ /**
+ * The internal feature id for the '<em><b>Mixed</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_MIXED = 0;
+
+ /**
+ * The internal feature id for the '<em><b>Group</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_GROUP = 1;
+
+ /**
+ * The internal feature id for the '<em><b>A</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_A = 2;
+
+ /**
+ * The internal feature id for the '<em><b>B</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_B = 3;
+
+ /**
+ * The number of properties for this type.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_PROPERTY_COUNT = 4;
+
+ protected int internalConvertIndex(int internalIndex)
+ {
+ switch (internalIndex)
+ {
+ case INTERNAL_MIXED: return MIXED;
+ case INTERNAL_GROUP: return GROUP;
+ case INTERNAL_A: return A;
+ case INTERNAL_B: return B;
+ }
+ return super.internalConvertIndex(internalIndex);
+ }
+
+
+ /**
+ * The cached value of the '{@link #getMixed() <em>Mixed</em>}' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getMixed()
+ * @generated
+ * @ordered
+ */
+
+ protected Sequence mixed = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public MixedRepeatingChoiceImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Type getType()
+ {
+ return ((SequencesFactoryImpl)SequencesFactory.INSTANCE).getMixedRepeatingChoice();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Sequence getMixed()
+ {
+ if (mixed == null)
+ {
+ mixed = createSequence(INTERNAL_MIXED);
+ }
+ return mixed;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Sequence getGroup()
+ {
+ return createSequence(getMixed(), getType(), GROUP);
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public List getA()
+ {
+ return getList(getGroup(), getType(), A);
+
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public List getB()
+ {
+ return getList(getGroup(), getType(), B);
+
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeContext inverseRemove(Object otherEnd, int propertyIndex, ChangeContext changeContext)
+ {
+ switch (propertyIndex)
+ {
+ case MIXED:
+ return removeFromSequence(getMixed(), otherEnd, changeContext);
+ case GROUP:
+ return removeFromSequence(getGroup(), otherEnd, changeContext);
+ }
+ return super.inverseRemove(otherEnd, propertyIndex, changeContext);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object get(int propertyIndex, boolean resolve)
+ {
+ switch (propertyIndex)
+ {
+ case MIXED:
+ // XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view
+ //if (coreType)
+ return getMixed();
+ case GROUP:
+ // XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view
+ //if (coreType)
+ return getGroup();
+ case A:
+ return getA();
+ case B:
+ return getB();
+ }
+ return super.get(propertyIndex, resolve);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void set(int propertyIndex, Object newValue)
+ {
+ switch (propertyIndex)
+ {
+ case MIXED:
+ setSequence(getMixed(), newValue);
+ return;
+ case GROUP:
+ setSequence(getGroup(), newValue);
+ return;
+ case A:
+ getA().clear();
+ getA().addAll((Collection)newValue);
+ return;
+ case B:
+ getB().clear();
+ getB().addAll((Collection)newValue);
+ return;
+ }
+ super.set(propertyIndex, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unset(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case MIXED:
+ unsetSequence(getMixed());
+ return;
+ case GROUP:
+ unsetSequence(getGroup());
+ return;
+ case A:
+ getA().clear();
+ return;
+ case B:
+ getB().clear();
+ return;
+ }
+ super.unset(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSet(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case MIXED:
+ return mixed != null && !isSequenceEmpty(getMixed());
+ case GROUP:
+ return !isSequenceEmpty(getGroup());
+ case A:
+ return !getA().isEmpty();
+ case B:
+ return !getB().isEmpty();
+ }
+ return super.isSet(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString()
+ {
+ if (isProxy(this)) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (mixed: ");
+ result.append(mixed);
+ result.append(')');
+ return result.toString();
+ }
+
+} //MixedRepeatingChoiceImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/impl/RepeatingChoiceImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/impl/RepeatingChoiceImpl.java
new file mode 100644
index 0000000000..e1c97128e0
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/impl/RepeatingChoiceImpl.java
@@ -0,0 +1,291 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.sequences.impl;
+
+import com.example.sequences.RepeatingChoice;
+import com.example.sequences.SequencesFactory;
+
+import commonj.sdo.Sequence;
+import commonj.sdo.Type;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.tuscany.sdo.impl.DataObjectBase;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Repeating Choice</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link com.example.sequences.impl.RepeatingChoiceImpl#getGroup <em>Group</em>}</li>
+ * <li>{@link com.example.sequences.impl.RepeatingChoiceImpl#getA <em>A</em>}</li>
+ * <li>{@link com.example.sequences.impl.RepeatingChoiceImpl#getB <em>B</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class RepeatingChoiceImpl extends DataObjectBase implements RepeatingChoice
+{
+
+ public final static int GROUP = -1;
+
+ public final static int A = 0;
+
+ public final static int B = 1;
+
+ public final static int SDO_PROPERTY_COUNT = 2;
+
+ public final static int EXTENDED_PROPERTY_COUNT = -1;
+
+
+ /**
+ * The internal feature id for the '<em><b>Group</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_GROUP = 0;
+
+ /**
+ * The internal feature id for the '<em><b>A</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_A = 1;
+
+ /**
+ * The internal feature id for the '<em><b>B</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_B = 2;
+
+ /**
+ * The number of properties for this type.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_PROPERTY_COUNT = 3;
+
+ protected int internalConvertIndex(int internalIndex)
+ {
+ switch (internalIndex)
+ {
+ case INTERNAL_GROUP: return GROUP;
+ case INTERNAL_A: return A;
+ case INTERNAL_B: return B;
+ }
+ return super.internalConvertIndex(internalIndex);
+ }
+
+
+ /**
+ * The cached value of the '{@link #getGroup() <em>Group</em>}' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getGroup()
+ * @generated
+ * @ordered
+ */
+
+ protected Sequence group = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public RepeatingChoiceImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Type getType()
+ {
+ return ((SequencesFactoryImpl)SequencesFactory.INSTANCE).getRepeatingChoice();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Sequence getGroup()
+ {
+ if (group == null)
+ {
+ group = createSequence(INTERNAL_GROUP);
+ }
+ return group;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public List getA()
+ {
+ return getList(getGroup(), getType(), A);
+
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public List getB()
+ {
+ return getList(getGroup(), getType(), B);
+
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeContext inverseRemove(Object otherEnd, int propertyIndex, ChangeContext changeContext)
+ {
+ switch (propertyIndex)
+ {
+ case GROUP:
+ return removeFromSequence(getGroup(), otherEnd, changeContext);
+ }
+ return super.inverseRemove(otherEnd, propertyIndex, changeContext);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object get(int propertyIndex, boolean resolve)
+ {
+ switch (propertyIndex)
+ {
+ case GROUP:
+ // XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view
+ //if (coreType)
+ return getGroup();
+ case A:
+ return getA();
+ case B:
+ return getB();
+ }
+ return super.get(propertyIndex, resolve);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void set(int propertyIndex, Object newValue)
+ {
+ switch (propertyIndex)
+ {
+ case GROUP:
+ setSequence(getGroup(), newValue);
+ return;
+ case A:
+ getA().clear();
+ getA().addAll((Collection)newValue);
+ return;
+ case B:
+ getB().clear();
+ getB().addAll((Collection)newValue);
+ return;
+ }
+ super.set(propertyIndex, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unset(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case GROUP:
+ unsetSequence(getGroup());
+ return;
+ case A:
+ getA().clear();
+ return;
+ case B:
+ getB().clear();
+ return;
+ }
+ super.unset(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSet(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case GROUP:
+ return group != null && !isSequenceEmpty(getGroup());
+ case A:
+ return !getA().isEmpty();
+ case B:
+ return !getB().isEmpty();
+ }
+ return super.isSet(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString()
+ {
+ if (isProxy(this)) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (group: ");
+ result.append(group);
+ result.append(')');
+ return result.toString();
+ }
+
+} //RepeatingChoiceImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/impl/SequencesFactoryImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/impl/SequencesFactoryImpl.java
new file mode 100644
index 0000000000..be6d7be9bc
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/impl/SequencesFactoryImpl.java
@@ -0,0 +1,771 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.sequences.impl;
+
+import commonj.sdo.helper.HelperContext;
+import org.apache.tuscany.sdo.helper.TypeHelperImpl;
+
+import com.example.sequences.*;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+
+import org.apache.tuscany.sdo.SDOFactory;
+
+import org.apache.tuscany.sdo.impl.FactoryBase;
+
+import org.apache.tuscany.sdo.model.ModelFactory;
+
+import org.apache.tuscany.sdo.model.impl.ModelFactoryImpl;
+
+import org.apache.tuscany.sdo.util.SDOUtil;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Factory</b>.
+ * Generator information:
+ * patternVersion=1.1; -prefix Sequences
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class SequencesFactoryImpl extends FactoryBase implements SequencesFactory
+{
+
+ /**
+ * The package namespace URI.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String NAMESPACE_URI = "http://www.example.com/sequences";
+
+ /**
+ * The package namespace name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String NAMESPACE_PREFIX = "seq";
+
+ /**
+ * The version of the generator pattern used to generate this class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String PATTERN_VERSION = "1.1";
+
+ public static final int MIXED_QUOTE = 1;
+ public static final int MIXED_REPEATING_CHOICE = 2;
+ public static final int REPEATING_CHOICE = 3;
+ public static final int TWO_RCS = 4;
+ public static final int TWO_RCS_MIXED = 5;
+
+ /**
+ * Creates an instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public SequencesFactoryImpl()
+ {
+ super(NAMESPACE_URI, NAMESPACE_PREFIX, "com.example.sequences");
+ }
+
+ /**
+ * Registers the Factory instance so that it is available within the supplied scope.
+ * @argument scope a HelperContext instance that will make the types supported by this Factory available.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void register(HelperContext scope) {
+ if(scope == null) {
+ throw new IllegalArgumentException("Scope can not be null");
+ }
+ TypeHelperImpl th = (TypeHelperImpl)scope.getTypeHelper();
+ th.getExtendedMetaData().putPackage(NAMESPACE_URI, this);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public DataObject create(int typeNumber)
+ {
+ switch (typeNumber)
+ {
+ case MIXED_QUOTE: return (DataObject)createMixedQuote();
+ case MIXED_REPEATING_CHOICE: return (DataObject)createMixedRepeatingChoice();
+ case REPEATING_CHOICE: return (DataObject)createRepeatingChoice();
+ case TWO_RCS: return (DataObject)createTwoRCs();
+ case TWO_RCS_MIXED: return (DataObject)createTwoRCsMixed();
+ default:
+ return super.create(typeNumber);
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public MixedQuote createMixedQuote()
+ {
+ MixedQuoteImpl mixedQuote = new MixedQuoteImpl();
+ return mixedQuote;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public MixedRepeatingChoice createMixedRepeatingChoice()
+ {
+ MixedRepeatingChoiceImpl mixedRepeatingChoice = new MixedRepeatingChoiceImpl();
+ return mixedRepeatingChoice;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public RepeatingChoice createRepeatingChoice()
+ {
+ RepeatingChoiceImpl repeatingChoice = new RepeatingChoiceImpl();
+ return repeatingChoice;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public TwoRCs createTwoRCs()
+ {
+ TwoRCsImpl twoRCs = new TwoRCsImpl();
+ return twoRCs;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public TwoRCsMixed createTwoRCsMixed()
+ {
+ TwoRCsMixedImpl twoRCsMixed = new TwoRCsMixedImpl();
+ return twoRCsMixed;
+ }
+
+ // Following creates and initializes SDO metadata for the supported types.
+ protected Type mixedQuoteType = null;
+
+ public Type getMixedQuote()
+ {
+ return mixedQuoteType;
+ }
+
+ protected Type mixedRepeatingChoiceType = null;
+
+ public Type getMixedRepeatingChoice()
+ {
+ return mixedRepeatingChoiceType;
+ }
+
+ protected Type repeatingChoiceType = null;
+
+ public Type getRepeatingChoice()
+ {
+ return repeatingChoiceType;
+ }
+
+ protected Type twoRCsType = null;
+
+ public Type getTwoRCs()
+ {
+ return twoRCsType;
+ }
+
+ protected Type twoRCsMixedType = null;
+
+ public Type getTwoRCsMixed()
+ {
+ return twoRCsMixedType;
+ }
+
+
+ private static boolean isInited = false;
+
+ public static SequencesFactoryImpl init()
+ {
+ if (isInited) return (SequencesFactoryImpl)FactoryBase.getStaticFactory(SequencesFactoryImpl.NAMESPACE_URI);
+ SequencesFactoryImpl theSequencesFactoryImpl = new SequencesFactoryImpl();
+ isInited = true;
+
+ // Initialize simple dependencies
+ SDOUtil.registerStaticTypes(SDOFactory.class);
+ SDOUtil.registerStaticTypes(ModelFactory.class);
+
+ // Create package meta-data objects
+ theSequencesFactoryImpl.createMetaData();
+
+ // Initialize created meta-data
+ theSequencesFactoryImpl.initializeMetaData();
+
+ // Mark meta-data to indicate it can't be changed
+ //theSequencesFactoryImpl.freeze(); //FB do we need to freeze / should we freeze ????
+
+ return theSequencesFactoryImpl;
+ }
+
+ private boolean isCreated = false;
+
+ public void createMetaData()
+ {
+ if (isCreated) return;
+ isCreated = true;
+
+ // Create types and their properties
+ mixedQuoteType = createType(false, MIXED_QUOTE);
+ createProperty(true, mixedQuoteType,MixedQuoteImpl.INTERNAL_MIXED);
+ createProperty(true, mixedQuoteType,MixedQuoteImpl.INTERNAL_SYMBOL);
+ createProperty(true, mixedQuoteType,MixedQuoteImpl.INTERNAL_COMPANY_NAME);
+ createProperty(true, mixedQuoteType,MixedQuoteImpl.INTERNAL_PRICE);
+ createProperty(true, mixedQuoteType,MixedQuoteImpl.INTERNAL_OPEN1);
+ createProperty(true, mixedQuoteType,MixedQuoteImpl.INTERNAL_HIGH);
+ createProperty(true, mixedQuoteType,MixedQuoteImpl.INTERNAL_LOW);
+ createProperty(true, mixedQuoteType,MixedQuoteImpl.INTERNAL_VOLUME);
+ createProperty(true, mixedQuoteType,MixedQuoteImpl.INTERNAL_CHANGE1);
+ createProperty(false, mixedQuoteType,MixedQuoteImpl.INTERNAL_QUOTES);
+ mixedRepeatingChoiceType = createType(false, MIXED_REPEATING_CHOICE);
+ createProperty(true, mixedRepeatingChoiceType,MixedRepeatingChoiceImpl.INTERNAL_MIXED);
+ createProperty(true, mixedRepeatingChoiceType,MixedRepeatingChoiceImpl.INTERNAL_GROUP);
+ createProperty(true, mixedRepeatingChoiceType,MixedRepeatingChoiceImpl.INTERNAL_A);
+ createProperty(true, mixedRepeatingChoiceType,MixedRepeatingChoiceImpl.INTERNAL_B);
+ repeatingChoiceType = createType(false, REPEATING_CHOICE);
+ createProperty(true, repeatingChoiceType,RepeatingChoiceImpl.INTERNAL_GROUP);
+ createProperty(true, repeatingChoiceType,RepeatingChoiceImpl.INTERNAL_A);
+ createProperty(true, repeatingChoiceType,RepeatingChoiceImpl.INTERNAL_B);
+ twoRCsType = createType(false, TWO_RCS);
+ createProperty(true, twoRCsType,TwoRCsImpl.INTERNAL_GROUP);
+ createProperty(true, twoRCsType,TwoRCsImpl.INTERNAL_A);
+ createProperty(true, twoRCsType,TwoRCsImpl.INTERNAL_B);
+ createProperty(true, twoRCsType,TwoRCsImpl.INTERNAL_SPLIT);
+ createProperty(true, twoRCsType,TwoRCsImpl.INTERNAL_GROUP1);
+ createProperty(true, twoRCsType,TwoRCsImpl.INTERNAL_Y);
+ createProperty(true, twoRCsType,TwoRCsImpl.INTERNAL_Z);
+ twoRCsMixedType = createType(false, TWO_RCS_MIXED);
+ createProperty(true, twoRCsMixedType,TwoRCsMixedImpl.INTERNAL_MIXED);
+ createProperty(true, twoRCsMixedType,TwoRCsMixedImpl.INTERNAL_GROUP);
+ createProperty(true, twoRCsMixedType,TwoRCsMixedImpl.INTERNAL_A);
+ createProperty(true, twoRCsMixedType,TwoRCsMixedImpl.INTERNAL_B);
+ createProperty(true, twoRCsMixedType,TwoRCsMixedImpl.INTERNAL_SPLIT);
+ createProperty(true, twoRCsMixedType,TwoRCsMixedImpl.INTERNAL_GROUP1);
+ createProperty(true, twoRCsMixedType,TwoRCsMixedImpl.INTERNAL_Y);
+ createProperty(true, twoRCsMixedType,TwoRCsMixedImpl.INTERNAL_Z);
+ }
+
+ private boolean isInitialized = false;
+
+ public void initializeMetaData()
+ {
+ if (isInitialized) return;
+ isInitialized = true;
+
+ // Obtain other dependent packages
+ ModelFactoryImpl theModelPackageImpl = (ModelFactoryImpl)FactoryBase.getStaticFactory(ModelFactoryImpl.NAMESPACE_URI);
+ Property property = null;
+
+ // Add supertypes to types
+
+ // Initialize types and properties
+ initializeType(mixedQuoteType, MixedQuote.class, "MixedQuote", false);
+ property = getProperty(mixedQuoteType, MixedQuoteImpl.INTERNAL_MIXED);
+ initializeProperty(property, getSequence(), "mixed", null, 0, -1, MixedQuote.class, false, false, false);
+
+ property = getProperty(mixedQuoteType, MixedQuoteImpl.INTERNAL_SYMBOL);
+ initializeProperty(property, theModelPackageImpl.getString(), "symbol", null, 1, 1, MixedQuote.class, false, true, true);
+
+ property = getProperty(mixedQuoteType, MixedQuoteImpl.INTERNAL_COMPANY_NAME);
+ initializeProperty(property, theModelPackageImpl.getString(), "companyName", null, 1, 1, MixedQuote.class, false, true, true);
+
+ property = getProperty(mixedQuoteType, MixedQuoteImpl.INTERNAL_PRICE);
+ initializeProperty(property, theModelPackageImpl.getDecimal(), "price", null, 1, 1, MixedQuote.class, false, true, true);
+
+ property = getProperty(mixedQuoteType, MixedQuoteImpl.INTERNAL_OPEN1);
+ initializeProperty(property, theModelPackageImpl.getDecimal(), "open1", null, 1, 1, MixedQuote.class, false, true, true);
+
+ property = getProperty(mixedQuoteType, MixedQuoteImpl.INTERNAL_HIGH);
+ initializeProperty(property, theModelPackageImpl.getDecimal(), "high", null, 1, 1, MixedQuote.class, false, true, true);
+
+ property = getProperty(mixedQuoteType, MixedQuoteImpl.INTERNAL_LOW);
+ initializeProperty(property, theModelPackageImpl.getDecimal(), "low", null, 1, 1, MixedQuote.class, false, true, true);
+
+ property = getProperty(mixedQuoteType, MixedQuoteImpl.INTERNAL_VOLUME);
+ initializeProperty(property, theModelPackageImpl.getDouble(), "volume", null, 1, 1, MixedQuote.class, false, true, true);
+
+ property = getProperty(mixedQuoteType, MixedQuoteImpl.INTERNAL_CHANGE1);
+ initializeProperty(property, theModelPackageImpl.getDouble(), "change1", null, 1, 1, MixedQuote.class, false, true, true);
+
+ property = getProperty(mixedQuoteType, MixedQuoteImpl.INTERNAL_QUOTES);
+ initializeProperty(property, this.getMixedQuote(), "quotes", null, 0, -1, MixedQuote.class, false, false, true, true , null);
+
+ initializeType(mixedRepeatingChoiceType, MixedRepeatingChoice.class, "MixedRepeatingChoice", false);
+ property = getProperty(mixedRepeatingChoiceType, MixedRepeatingChoiceImpl.INTERNAL_MIXED);
+ initializeProperty(property, getSequence(), "mixed", null, 0, -1, MixedRepeatingChoice.class, false, false, false);
+
+ property = getProperty(mixedRepeatingChoiceType, MixedRepeatingChoiceImpl.INTERNAL_GROUP);
+ initializeProperty(property, getSequence(), "group", null, 0, -1, MixedRepeatingChoice.class, false, false, true);
+
+ property = getProperty(mixedRepeatingChoiceType, MixedRepeatingChoiceImpl.INTERNAL_A);
+ initializeProperty(property, theModelPackageImpl.getString(), "a", null, 0, -1, MixedRepeatingChoice.class, false, false, true);
+
+ property = getProperty(mixedRepeatingChoiceType, MixedRepeatingChoiceImpl.INTERNAL_B);
+ initializeProperty(property, theModelPackageImpl.getInt(), "b", null, 0, -1, MixedRepeatingChoice.class, false, false, true);
+
+ initializeType(repeatingChoiceType, RepeatingChoice.class, "RepeatingChoice", false);
+ property = getProperty(repeatingChoiceType, RepeatingChoiceImpl.INTERNAL_GROUP);
+ initializeProperty(property, getSequence(), "group", null, 0, -1, RepeatingChoice.class, false, false, false);
+
+ property = getProperty(repeatingChoiceType, RepeatingChoiceImpl.INTERNAL_A);
+ initializeProperty(property, theModelPackageImpl.getString(), "a", null, 0, -1, RepeatingChoice.class, false, false, true);
+
+ property = getProperty(repeatingChoiceType, RepeatingChoiceImpl.INTERNAL_B);
+ initializeProperty(property, theModelPackageImpl.getInt(), "b", null, 0, -1, RepeatingChoice.class, false, false, true);
+
+ initializeType(twoRCsType, TwoRCs.class, "TwoRCs", false);
+ property = getProperty(twoRCsType, TwoRCsImpl.INTERNAL_GROUP);
+ initializeProperty(property, getSequence(), "group", null, 0, -1, TwoRCs.class, false, false, false);
+
+ property = getProperty(twoRCsType, TwoRCsImpl.INTERNAL_A);
+ initializeProperty(property, theModelPackageImpl.getString(), "a", null, 0, -1, TwoRCs.class, false, false, true);
+
+ property = getProperty(twoRCsType, TwoRCsImpl.INTERNAL_B);
+ initializeProperty(property, theModelPackageImpl.getInt(), "b", null, 0, -1, TwoRCs.class, false, false, true);
+
+ property = getProperty(twoRCsType, TwoRCsImpl.INTERNAL_SPLIT);
+ initializeProperty(property, theModelPackageImpl.getString(), "split", null, 1, 1, TwoRCs.class, false, true, false);
+
+ property = getProperty(twoRCsType, TwoRCsImpl.INTERNAL_GROUP1);
+ initializeProperty(property, getSequence(), "group1", null, 0, -1, TwoRCs.class, false, false, false);
+
+ property = getProperty(twoRCsType, TwoRCsImpl.INTERNAL_Y);
+ initializeProperty(property, theModelPackageImpl.getString(), "y", null, 0, -1, TwoRCs.class, false, false, true);
+
+ property = getProperty(twoRCsType, TwoRCsImpl.INTERNAL_Z);
+ initializeProperty(property, theModelPackageImpl.getInt(), "z", null, 0, -1, TwoRCs.class, false, false, true);
+
+ initializeType(twoRCsMixedType, TwoRCsMixed.class, "TwoRCsMixed", false);
+ property = getProperty(twoRCsMixedType, TwoRCsMixedImpl.INTERNAL_MIXED);
+ initializeProperty(property, getSequence(), "mixed", null, 0, -1, TwoRCsMixed.class, false, false, false);
+
+ property = getProperty(twoRCsMixedType, TwoRCsMixedImpl.INTERNAL_GROUP);
+ initializeProperty(property, getSequence(), "group", null, 0, -1, TwoRCsMixed.class, false, false, true);
+
+ property = getProperty(twoRCsMixedType, TwoRCsMixedImpl.INTERNAL_A);
+ initializeProperty(property, theModelPackageImpl.getString(), "a", null, 0, -1, TwoRCsMixed.class, false, false, true);
+
+ property = getProperty(twoRCsMixedType, TwoRCsMixedImpl.INTERNAL_B);
+ initializeProperty(property, theModelPackageImpl.getInt(), "b", null, 0, -1, TwoRCsMixed.class, false, false, true);
+
+ property = getProperty(twoRCsMixedType, TwoRCsMixedImpl.INTERNAL_SPLIT);
+ initializeProperty(property, theModelPackageImpl.getString(), "split", null, 1, 1, TwoRCsMixed.class, false, true, true);
+
+ property = getProperty(twoRCsMixedType, TwoRCsMixedImpl.INTERNAL_GROUP1);
+ initializeProperty(property, getSequence(), "group1", null, 0, -1, TwoRCsMixed.class, false, false, true);
+
+ property = getProperty(twoRCsMixedType, TwoRCsMixedImpl.INTERNAL_Y);
+ initializeProperty(property, theModelPackageImpl.getString(), "y", null, 0, -1, TwoRCsMixed.class, false, false, true);
+
+ property = getProperty(twoRCsMixedType, TwoRCsMixedImpl.INTERNAL_Z);
+ initializeProperty(property, theModelPackageImpl.getInt(), "z", null, 0, -1, TwoRCsMixed.class, false, false, true);
+
+ createXSDMetaData(theModelPackageImpl);
+ }
+
+ protected void createXSDMetaData(ModelFactoryImpl theModelPackageImpl)
+ {
+ super.initXSD();
+
+ Property property = null;
+
+
+ property = createGlobalProperty
+ ("mixedStockQuote",
+ this.getMixedQuote(),
+ new String[]
+ {
+ "kind", "element",
+ "name", "mixedStockQuote",
+ "namespace", "##targetNamespace"
+ });
+
+ property = createGlobalProperty
+ ("mrc",
+ this.getMixedRepeatingChoice(),
+ new String[]
+ {
+ "kind", "element",
+ "name", "mrc",
+ "namespace", "##targetNamespace"
+ });
+
+ property = createGlobalProperty
+ ("mrc2",
+ this.getTwoRCsMixed(),
+ new String[]
+ {
+ "kind", "element",
+ "name", "mrc2",
+ "namespace", "##targetNamespace"
+ });
+
+ property = createGlobalProperty
+ ("rc",
+ this.getRepeatingChoice(),
+ new String[]
+ {
+ "kind", "element",
+ "name", "rc",
+ "namespace", "##targetNamespace"
+ });
+
+ property = createGlobalProperty
+ ("rc2",
+ this.getTwoRCs(),
+ new String[]
+ {
+ "kind", "element",
+ "name", "rc2",
+ "namespace", "##targetNamespace"
+ });
+
+ addXSDMapping
+ (mixedQuoteType,
+ new String[]
+ {
+ "name", "MixedQuote",
+ "kind", "mixed"
+ });
+
+ addXSDMapping
+ (getProperty(mixedQuoteType, MixedQuoteImpl.INTERNAL_MIXED),
+ new String[]
+ {
+ "kind", "elementWildcard",
+ "name", ":mixed"
+ });
+
+ addXSDMapping
+ (getProperty(mixedQuoteType, MixedQuoteImpl.INTERNAL_SYMBOL),
+ new String[]
+ {
+ "kind", "element",
+ "name", "symbol"
+ });
+
+ addXSDMapping
+ (getProperty(mixedQuoteType, MixedQuoteImpl.INTERNAL_COMPANY_NAME),
+ new String[]
+ {
+ "kind", "element",
+ "name", "companyName"
+ });
+
+ addXSDMapping
+ (getProperty(mixedQuoteType, MixedQuoteImpl.INTERNAL_PRICE),
+ new String[]
+ {
+ "kind", "element",
+ "name", "price"
+ });
+
+ addXSDMapping
+ (getProperty(mixedQuoteType, MixedQuoteImpl.INTERNAL_OPEN1),
+ new String[]
+ {
+ "kind", "element",
+ "name", "open1"
+ });
+
+ addXSDMapping
+ (getProperty(mixedQuoteType, MixedQuoteImpl.INTERNAL_HIGH),
+ new String[]
+ {
+ "kind", "element",
+ "name", "high"
+ });
+
+ addXSDMapping
+ (getProperty(mixedQuoteType, MixedQuoteImpl.INTERNAL_LOW),
+ new String[]
+ {
+ "kind", "element",
+ "name", "low"
+ });
+
+ addXSDMapping
+ (getProperty(mixedQuoteType, MixedQuoteImpl.INTERNAL_VOLUME),
+ new String[]
+ {
+ "kind", "element",
+ "name", "volume"
+ });
+
+ addXSDMapping
+ (getProperty(mixedQuoteType, MixedQuoteImpl.INTERNAL_CHANGE1),
+ new String[]
+ {
+ "kind", "element",
+ "name", "change1"
+ });
+
+ addXSDMapping
+ (getProperty(mixedQuoteType, MixedQuoteImpl.INTERNAL_QUOTES),
+ new String[]
+ {
+ "kind", "element",
+ "name", "quotes"
+ });
+
+ addXSDMapping
+ (mixedRepeatingChoiceType,
+ new String[]
+ {
+ "name", "MixedRepeatingChoice",
+ "kind", "mixed"
+ });
+
+ addXSDMapping
+ (getProperty(mixedRepeatingChoiceType, MixedRepeatingChoiceImpl.INTERNAL_MIXED),
+ new String[]
+ {
+ "kind", "elementWildcard",
+ "name", ":mixed"
+ });
+
+ addXSDMapping
+ (getProperty(mixedRepeatingChoiceType, MixedRepeatingChoiceImpl.INTERNAL_GROUP),
+ new String[]
+ {
+ "kind", "group",
+ "name", "group:1"
+ });
+
+ addXSDMapping
+ (getProperty(mixedRepeatingChoiceType, MixedRepeatingChoiceImpl.INTERNAL_A),
+ new String[]
+ {
+ "kind", "element",
+ "name", "a",
+ "group", "#group:1"
+ });
+
+ addXSDMapping
+ (getProperty(mixedRepeatingChoiceType, MixedRepeatingChoiceImpl.INTERNAL_B),
+ new String[]
+ {
+ "kind", "element",
+ "name", "b",
+ "group", "#group:1"
+ });
+
+ addXSDMapping
+ (repeatingChoiceType,
+ new String[]
+ {
+ "name", "RepeatingChoice",
+ "kind", "elementOnly"
+ });
+
+ addXSDMapping
+ (getProperty(repeatingChoiceType, RepeatingChoiceImpl.INTERNAL_GROUP),
+ new String[]
+ {
+ "kind", "group",
+ "name", "group:0"
+ });
+
+ addXSDMapping
+ (getProperty(repeatingChoiceType, RepeatingChoiceImpl.INTERNAL_A),
+ new String[]
+ {
+ "kind", "element",
+ "name", "a",
+ "group", "#group:0"
+ });
+
+ addXSDMapping
+ (getProperty(repeatingChoiceType, RepeatingChoiceImpl.INTERNAL_B),
+ new String[]
+ {
+ "kind", "element",
+ "name", "b",
+ "group", "#group:0"
+ });
+
+ addXSDMapping
+ (twoRCsType,
+ new String[]
+ {
+ "name", "TwoRCs",
+ "kind", "elementOnly"
+ });
+
+ addXSDMapping
+ (getProperty(twoRCsType, TwoRCsImpl.INTERNAL_GROUP),
+ new String[]
+ {
+ "kind", "group",
+ "name", "group:0"
+ });
+
+ addXSDMapping
+ (getProperty(twoRCsType, TwoRCsImpl.INTERNAL_A),
+ new String[]
+ {
+ "kind", "element",
+ "name", "a",
+ "group", "#group:0"
+ });
+
+ addXSDMapping
+ (getProperty(twoRCsType, TwoRCsImpl.INTERNAL_B),
+ new String[]
+ {
+ "kind", "element",
+ "name", "b",
+ "group", "#group:0"
+ });
+
+ addXSDMapping
+ (getProperty(twoRCsType, TwoRCsImpl.INTERNAL_SPLIT),
+ new String[]
+ {
+ "kind", "element",
+ "name", "split"
+ });
+
+ addXSDMapping
+ (getProperty(twoRCsType, TwoRCsImpl.INTERNAL_GROUP1),
+ new String[]
+ {
+ "kind", "group",
+ "name", "group:4"
+ });
+
+ addXSDMapping
+ (getProperty(twoRCsType, TwoRCsImpl.INTERNAL_Y),
+ new String[]
+ {
+ "kind", "element",
+ "name", "y",
+ "group", "#group:4"
+ });
+
+ addXSDMapping
+ (getProperty(twoRCsType, TwoRCsImpl.INTERNAL_Z),
+ new String[]
+ {
+ "kind", "element",
+ "name", "z",
+ "group", "#group:4"
+ });
+
+ addXSDMapping
+ (twoRCsMixedType,
+ new String[]
+ {
+ "name", "TwoRCsMixed",
+ "kind", "mixed"
+ });
+
+ addXSDMapping
+ (getProperty(twoRCsMixedType, TwoRCsMixedImpl.INTERNAL_MIXED),
+ new String[]
+ {
+ "kind", "elementWildcard",
+ "name", ":mixed"
+ });
+
+ addXSDMapping
+ (getProperty(twoRCsMixedType, TwoRCsMixedImpl.INTERNAL_GROUP),
+ new String[]
+ {
+ "kind", "group",
+ "name", "group:1"
+ });
+
+ addXSDMapping
+ (getProperty(twoRCsMixedType, TwoRCsMixedImpl.INTERNAL_A),
+ new String[]
+ {
+ "kind", "element",
+ "name", "a",
+ "group", "#group:1"
+ });
+
+ addXSDMapping
+ (getProperty(twoRCsMixedType, TwoRCsMixedImpl.INTERNAL_B),
+ new String[]
+ {
+ "kind", "element",
+ "name", "b",
+ "group", "#group:1"
+ });
+
+ addXSDMapping
+ (getProperty(twoRCsMixedType, TwoRCsMixedImpl.INTERNAL_SPLIT),
+ new String[]
+ {
+ "kind", "element",
+ "name", "split"
+ });
+
+ addXSDMapping
+ (getProperty(twoRCsMixedType, TwoRCsMixedImpl.INTERNAL_GROUP1),
+ new String[]
+ {
+ "kind", "group",
+ "name", "group:5"
+ });
+
+ addXSDMapping
+ (getProperty(twoRCsMixedType, TwoRCsMixedImpl.INTERNAL_Y),
+ new String[]
+ {
+ "kind", "element",
+ "name", "y",
+ "group", "#group:5"
+ });
+
+ addXSDMapping
+ (getProperty(twoRCsMixedType, TwoRCsMixedImpl.INTERNAL_Z),
+ new String[]
+ {
+ "kind", "element",
+ "name", "z",
+ "group", "#group:5"
+ });
+
+ }
+
+} //SequencesFactoryImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/impl/TwoRCsImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/impl/TwoRCsImpl.java
new file mode 100644
index 0000000000..976bbd8929
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/impl/TwoRCsImpl.java
@@ -0,0 +1,515 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.sequences.impl;
+
+import com.example.sequences.SequencesFactory;
+import com.example.sequences.TwoRCs;
+
+import commonj.sdo.Sequence;
+import commonj.sdo.Type;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.tuscany.sdo.impl.DataObjectBase;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Two RCs</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link com.example.sequences.impl.TwoRCsImpl#getGroup <em>Group</em>}</li>
+ * <li>{@link com.example.sequences.impl.TwoRCsImpl#getA <em>A</em>}</li>
+ * <li>{@link com.example.sequences.impl.TwoRCsImpl#getB <em>B</em>}</li>
+ * <li>{@link com.example.sequences.impl.TwoRCsImpl#getSplit <em>Split</em>}</li>
+ * <li>{@link com.example.sequences.impl.TwoRCsImpl#getGroup1 <em>Group1</em>}</li>
+ * <li>{@link com.example.sequences.impl.TwoRCsImpl#getY <em>Y</em>}</li>
+ * <li>{@link com.example.sequences.impl.TwoRCsImpl#getZ <em>Z</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class TwoRCsImpl extends DataObjectBase implements TwoRCs
+{
+
+ public final static int GROUP = -1;
+
+ public final static int A = 0;
+
+ public final static int B = 1;
+
+ public final static int SPLIT = 2;
+
+ public final static int GROUP1 = -2;
+
+ public final static int Y = 3;
+
+ public final static int Z = 4;
+
+ public final static int SDO_PROPERTY_COUNT = 5;
+
+ public final static int EXTENDED_PROPERTY_COUNT = -2;
+
+
+ /**
+ * The internal feature id for the '<em><b>Group</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_GROUP = 0;
+
+ /**
+ * The internal feature id for the '<em><b>A</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_A = 1;
+
+ /**
+ * The internal feature id for the '<em><b>B</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_B = 2;
+
+ /**
+ * The internal feature id for the '<em><b>Split</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_SPLIT = 3;
+
+ /**
+ * The internal feature id for the '<em><b>Group1</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_GROUP1 = 4;
+
+ /**
+ * The internal feature id for the '<em><b>Y</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_Y = 5;
+
+ /**
+ * The internal feature id for the '<em><b>Z</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_Z = 6;
+
+ /**
+ * The number of properties for this type.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_PROPERTY_COUNT = 7;
+
+ protected int internalConvertIndex(int internalIndex)
+ {
+ switch (internalIndex)
+ {
+ case INTERNAL_GROUP: return GROUP;
+ case INTERNAL_A: return A;
+ case INTERNAL_B: return B;
+ case INTERNAL_SPLIT: return SPLIT;
+ case INTERNAL_GROUP1: return GROUP1;
+ case INTERNAL_Y: return Y;
+ case INTERNAL_Z: return Z;
+ }
+ return super.internalConvertIndex(internalIndex);
+ }
+
+
+ /**
+ * The cached value of the '{@link #getGroup() <em>Group</em>}' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getGroup()
+ * @generated
+ * @ordered
+ */
+
+ protected Sequence group = null;
+
+ /**
+ * The default value of the '{@link #getSplit() <em>Split</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getSplit()
+ * @generated
+ * @ordered
+ */
+ protected static final String SPLIT_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getSplit() <em>Split</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getSplit()
+ * @generated
+ * @ordered
+ */
+ protected String split = SPLIT_DEFAULT_;
+
+ /**
+ * This is true if the Split attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean split_set_ = false;
+
+ /**
+ * The cached value of the '{@link #getGroup1() <em>Group1</em>}' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getGroup1()
+ * @generated
+ * @ordered
+ */
+
+ protected Sequence group1 = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public TwoRCsImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Type getType()
+ {
+ return ((SequencesFactoryImpl)SequencesFactory.INSTANCE).getTwoRCs();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Sequence getGroup()
+ {
+ if (group == null)
+ {
+ group = createSequence(INTERNAL_GROUP);
+ }
+ return group;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public List getA()
+ {
+ return getList(getGroup(), getType(), A);
+
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public List getB()
+ {
+ return getList(getGroup(), getType(), B);
+
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getSplit()
+ {
+ return split;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setSplit(String newSplit)
+ {
+ String oldSplit = split;
+ split = newSplit;
+ boolean oldSplit_set_ = split_set_;
+ split_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, SPLIT, oldSplit, split, !oldSplit_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetSplit()
+ {
+ String oldSplit = split;
+ boolean oldSplit_set_ = split_set_;
+ split = SPLIT_DEFAULT_;
+ split_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, SPLIT, oldSplit, SPLIT_DEFAULT_, oldSplit_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetSplit()
+ {
+ return split_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Sequence getGroup1()
+ {
+ if (group1 == null)
+ {
+ group1 = createSequence(INTERNAL_GROUP1);
+ }
+ return group1;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public List getY()
+ {
+ return getList(getGroup1(), getType(), Y);
+
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public List getZ()
+ {
+ return getList(getGroup1(), getType(), Z);
+
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeContext inverseRemove(Object otherEnd, int propertyIndex, ChangeContext changeContext)
+ {
+ switch (propertyIndex)
+ {
+ case GROUP:
+ return removeFromSequence(getGroup(), otherEnd, changeContext);
+ case GROUP1:
+ return removeFromSequence(getGroup1(), otherEnd, changeContext);
+ }
+ return super.inverseRemove(otherEnd, propertyIndex, changeContext);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object get(int propertyIndex, boolean resolve)
+ {
+ switch (propertyIndex)
+ {
+ case GROUP:
+ // XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view
+ //if (coreType)
+ return getGroup();
+ case A:
+ return getA();
+ case B:
+ return getB();
+ case SPLIT:
+ return getSplit();
+ case GROUP1:
+ // XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view
+ //if (coreType)
+ return getGroup1();
+ case Y:
+ return getY();
+ case Z:
+ return getZ();
+ }
+ return super.get(propertyIndex, resolve);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void set(int propertyIndex, Object newValue)
+ {
+ switch (propertyIndex)
+ {
+ case GROUP:
+ setSequence(getGroup(), newValue);
+ return;
+ case A:
+ getA().clear();
+ getA().addAll((Collection)newValue);
+ return;
+ case B:
+ getB().clear();
+ getB().addAll((Collection)newValue);
+ return;
+ case SPLIT:
+ setSplit((String)newValue);
+ return;
+ case GROUP1:
+ setSequence(getGroup1(), newValue);
+ return;
+ case Y:
+ getY().clear();
+ getY().addAll((Collection)newValue);
+ return;
+ case Z:
+ getZ().clear();
+ getZ().addAll((Collection)newValue);
+ return;
+ }
+ super.set(propertyIndex, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unset(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case GROUP:
+ unsetSequence(getGroup());
+ return;
+ case A:
+ getA().clear();
+ return;
+ case B:
+ getB().clear();
+ return;
+ case SPLIT:
+ unsetSplit();
+ return;
+ case GROUP1:
+ unsetSequence(getGroup1());
+ return;
+ case Y:
+ getY().clear();
+ return;
+ case Z:
+ getZ().clear();
+ return;
+ }
+ super.unset(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSet(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case GROUP:
+ return group != null && !isSequenceEmpty(getGroup());
+ case A:
+ return !getA().isEmpty();
+ case B:
+ return !getB().isEmpty();
+ case SPLIT:
+ return isSetSplit();
+ case GROUP1:
+ return group1 != null && !isSequenceEmpty(getGroup1());
+ case Y:
+ return !getY().isEmpty();
+ case Z:
+ return !getZ().isEmpty();
+ }
+ return super.isSet(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString()
+ {
+ if (isProxy(this)) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (group: ");
+ result.append(group);
+ result.append(", split: ");
+ if (split_set_) result.append(split); else result.append("<unset>");
+ result.append(", group1: ");
+ result.append(group1);
+ result.append(')');
+ return result.toString();
+ }
+
+} //TwoRCsImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/impl/TwoRCsMixedImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/impl/TwoRCsMixedImpl.java
new file mode 100644
index 0000000000..ee90e414ff
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/sequences/impl/TwoRCsMixedImpl.java
@@ -0,0 +1,493 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.sequences.impl;
+
+import com.example.sequences.SequencesFactory;
+import com.example.sequences.TwoRCsMixed;
+
+import commonj.sdo.Sequence;
+import commonj.sdo.Type;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.tuscany.sdo.impl.DataObjectBase;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Two RCs Mixed</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link com.example.sequences.impl.TwoRCsMixedImpl#getMixed <em>Mixed</em>}</li>
+ * <li>{@link com.example.sequences.impl.TwoRCsMixedImpl#getGroup <em>Group</em>}</li>
+ * <li>{@link com.example.sequences.impl.TwoRCsMixedImpl#getA <em>A</em>}</li>
+ * <li>{@link com.example.sequences.impl.TwoRCsMixedImpl#getB <em>B</em>}</li>
+ * <li>{@link com.example.sequences.impl.TwoRCsMixedImpl#getSplit <em>Split</em>}</li>
+ * <li>{@link com.example.sequences.impl.TwoRCsMixedImpl#getGroup1 <em>Group1</em>}</li>
+ * <li>{@link com.example.sequences.impl.TwoRCsMixedImpl#getY <em>Y</em>}</li>
+ * <li>{@link com.example.sequences.impl.TwoRCsMixedImpl#getZ <em>Z</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class TwoRCsMixedImpl extends DataObjectBase implements TwoRCsMixed
+{
+
+ public final static int MIXED = -1;
+
+ public final static int GROUP = -2;
+
+ public final static int A = 0;
+
+ public final static int B = 1;
+
+ public final static int SPLIT = 2;
+
+ public final static int GROUP1 = -3;
+
+ public final static int Y = 3;
+
+ public final static int Z = 4;
+
+ public final static int SDO_PROPERTY_COUNT = 5;
+
+ public final static int EXTENDED_PROPERTY_COUNT = -3;
+
+
+ /**
+ * The internal feature id for the '<em><b>Mixed</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_MIXED = 0;
+
+ /**
+ * The internal feature id for the '<em><b>Group</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_GROUP = 1;
+
+ /**
+ * The internal feature id for the '<em><b>A</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_A = 2;
+
+ /**
+ * The internal feature id for the '<em><b>B</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_B = 3;
+
+ /**
+ * The internal feature id for the '<em><b>Split</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_SPLIT = 4;
+
+ /**
+ * The internal feature id for the '<em><b>Group1</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_GROUP1 = 5;
+
+ /**
+ * The internal feature id for the '<em><b>Y</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_Y = 6;
+
+ /**
+ * The internal feature id for the '<em><b>Z</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_Z = 7;
+
+ /**
+ * The number of properties for this type.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_PROPERTY_COUNT = 8;
+
+ protected int internalConvertIndex(int internalIndex)
+ {
+ switch (internalIndex)
+ {
+ case INTERNAL_MIXED: return MIXED;
+ case INTERNAL_GROUP: return GROUP;
+ case INTERNAL_A: return A;
+ case INTERNAL_B: return B;
+ case INTERNAL_SPLIT: return SPLIT;
+ case INTERNAL_GROUP1: return GROUP1;
+ case INTERNAL_Y: return Y;
+ case INTERNAL_Z: return Z;
+ }
+ return super.internalConvertIndex(internalIndex);
+ }
+
+
+ /**
+ * The cached value of the '{@link #getMixed() <em>Mixed</em>}' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getMixed()
+ * @generated
+ * @ordered
+ */
+
+ protected Sequence mixed = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public TwoRCsMixedImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Type getType()
+ {
+ return ((SequencesFactoryImpl)SequencesFactory.INSTANCE).getTwoRCsMixed();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Sequence getMixed()
+ {
+ if (mixed == null)
+ {
+ mixed = createSequence(INTERNAL_MIXED);
+ }
+ return mixed;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Sequence getGroup()
+ {
+ return createSequence(getMixed(), getType(), GROUP);
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public List getA()
+ {
+ return getList(getGroup(), getType(), A);
+
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public List getB()
+ {
+ return getList(getGroup(), getType(), B);
+
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getSplit()
+ {
+ return (String)get(getMixed(), getType(), INTERNAL_SPLIT);
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setSplit(String newSplit)
+ {
+ set(getMixed(), getType(), INTERNAL_SPLIT, newSplit);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetSplit()
+ {
+ unset(getMixed(), getType(), SPLIT);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetSplit()
+ {
+ return isSet(getMixed(), getType(), SPLIT);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Sequence getGroup1()
+ {
+ return createSequence(getMixed(), getType(), GROUP1);
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public List getY()
+ {
+ return getList(getGroup1(), getType(), Y);
+
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public List getZ()
+ {
+ return getList(getGroup1(), getType(), Z);
+
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeContext inverseRemove(Object otherEnd, int propertyIndex, ChangeContext changeContext)
+ {
+ switch (propertyIndex)
+ {
+ case MIXED:
+ return removeFromSequence(getMixed(), otherEnd, changeContext);
+ case GROUP:
+ return removeFromSequence(getGroup(), otherEnd, changeContext);
+ case GROUP1:
+ return removeFromSequence(getGroup1(), otherEnd, changeContext);
+ }
+ return super.inverseRemove(otherEnd, propertyIndex, changeContext);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object get(int propertyIndex, boolean resolve)
+ {
+ switch (propertyIndex)
+ {
+ case MIXED:
+ // XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view
+ //if (coreType)
+ return getMixed();
+ case GROUP:
+ // XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view
+ //if (coreType)
+ return getGroup();
+ case A:
+ return getA();
+ case B:
+ return getB();
+ case SPLIT:
+ return getSplit();
+ case GROUP1:
+ // XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view
+ //if (coreType)
+ return getGroup1();
+ case Y:
+ return getY();
+ case Z:
+ return getZ();
+ }
+ return super.get(propertyIndex, resolve);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void set(int propertyIndex, Object newValue)
+ {
+ switch (propertyIndex)
+ {
+ case MIXED:
+ setSequence(getMixed(), newValue);
+ return;
+ case GROUP:
+ setSequence(getGroup(), newValue);
+ return;
+ case A:
+ getA().clear();
+ getA().addAll((Collection)newValue);
+ return;
+ case B:
+ getB().clear();
+ getB().addAll((Collection)newValue);
+ return;
+ case SPLIT:
+ setSplit((String)newValue);
+ return;
+ case GROUP1:
+ setSequence(getGroup1(), newValue);
+ return;
+ case Y:
+ getY().clear();
+ getY().addAll((Collection)newValue);
+ return;
+ case Z:
+ getZ().clear();
+ getZ().addAll((Collection)newValue);
+ return;
+ }
+ super.set(propertyIndex, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unset(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case MIXED:
+ unsetSequence(getMixed());
+ return;
+ case GROUP:
+ unsetSequence(getGroup());
+ return;
+ case A:
+ getA().clear();
+ return;
+ case B:
+ getB().clear();
+ return;
+ case SPLIT:
+ unsetSplit();
+ return;
+ case GROUP1:
+ unsetSequence(getGroup1());
+ return;
+ case Y:
+ getY().clear();
+ return;
+ case Z:
+ getZ().clear();
+ return;
+ }
+ super.unset(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSet(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case MIXED:
+ return mixed != null && !isSequenceEmpty(getMixed());
+ case GROUP:
+ return !isSequenceEmpty(getGroup());
+ case A:
+ return !getA().isEmpty();
+ case B:
+ return !getB().isEmpty();
+ case SPLIT:
+ return isSetSplit();
+ case GROUP1:
+ return !isSequenceEmpty(getGroup1());
+ case Y:
+ return !getY().isEmpty();
+ case Z:
+ return !getZ().isEmpty();
+ }
+ return super.isSet(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString()
+ {
+ if (isProxy(this)) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (mixed: ");
+ result.append(mixed);
+ result.append(')');
+ return result.toString();
+ }
+
+} //TwoRCsMixedImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/simple/Quote.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/simple/Quote.java
new file mode 100644
index 0000000000..48dcf96d64
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/simple/Quote.java
@@ -0,0 +1,475 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.simple;
+
+import java.io.Serializable;
+
+import java.math.BigDecimal;
+
+import java.util.List;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Quote</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link com.example.simple.Quote#getSymbol <em>Symbol</em>}</li>
+ * <li>{@link com.example.simple.Quote#getCompanyName <em>Company Name</em>}</li>
+ * <li>{@link com.example.simple.Quote#getPrice <em>Price</em>}</li>
+ * <li>{@link com.example.simple.Quote#getOpen1 <em>Open1</em>}</li>
+ * <li>{@link com.example.simple.Quote#getHigh <em>High</em>}</li>
+ * <li>{@link com.example.simple.Quote#getLow <em>Low</em>}</li>
+ * <li>{@link com.example.simple.Quote#getVolume <em>Volume</em>}</li>
+ * <li>{@link com.example.simple.Quote#getChange1 <em>Change1</em>}</li>
+ * <li>{@link com.example.simple.Quote#getQuotes <em>Quotes</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @extends Serializable
+ * @generated
+ */
+public interface Quote extends Serializable
+{
+ /**
+ * Returns the value of the '<em><b>Symbol</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Symbol</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Symbol</em>' attribute.
+ * @see #isSetSymbol()
+ * @see #unsetSymbol()
+ * @see #setSymbol(String)
+ * @generated
+ */
+ String getSymbol();
+
+ /**
+ * Sets the value of the '{@link com.example.simple.Quote#getSymbol <em>Symbol</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Symbol</em>' attribute.
+ * @see #isSetSymbol()
+ * @see #unsetSymbol()
+ * @see #getSymbol()
+ * @generated
+ */
+ void setSymbol(String value);
+
+ /**
+ * Unsets the value of the '{@link com.example.simple.Quote#getSymbol <em>Symbol</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetSymbol()
+ * @see #getSymbol()
+ * @see #setSymbol(String)
+ * @generated
+ */
+ void unsetSymbol();
+
+ /**
+ * Returns whether the value of the '{@link com.example.simple.Quote#getSymbol <em>Symbol</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Symbol</em>' attribute is set.
+ * @see #unsetSymbol()
+ * @see #getSymbol()
+ * @see #setSymbol(String)
+ * @generated
+ */
+ boolean isSetSymbol();
+
+ /**
+ * Returns the value of the '<em><b>Company Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Company Name</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Company Name</em>' attribute.
+ * @see #isSetCompanyName()
+ * @see #unsetCompanyName()
+ * @see #setCompanyName(String)
+ * @generated
+ */
+ String getCompanyName();
+
+ /**
+ * Sets the value of the '{@link com.example.simple.Quote#getCompanyName <em>Company Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Company Name</em>' attribute.
+ * @see #isSetCompanyName()
+ * @see #unsetCompanyName()
+ * @see #getCompanyName()
+ * @generated
+ */
+ void setCompanyName(String value);
+
+ /**
+ * Unsets the value of the '{@link com.example.simple.Quote#getCompanyName <em>Company Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetCompanyName()
+ * @see #getCompanyName()
+ * @see #setCompanyName(String)
+ * @generated
+ */
+ void unsetCompanyName();
+
+ /**
+ * Returns whether the value of the '{@link com.example.simple.Quote#getCompanyName <em>Company Name</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Company Name</em>' attribute is set.
+ * @see #unsetCompanyName()
+ * @see #getCompanyName()
+ * @see #setCompanyName(String)
+ * @generated
+ */
+ boolean isSetCompanyName();
+
+ /**
+ * Returns the value of the '<em><b>Price</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Price</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Price</em>' attribute.
+ * @see #isSetPrice()
+ * @see #unsetPrice()
+ * @see #setPrice(BigDecimal)
+ * @generated
+ */
+ BigDecimal getPrice();
+
+ /**
+ * Sets the value of the '{@link com.example.simple.Quote#getPrice <em>Price</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Price</em>' attribute.
+ * @see #isSetPrice()
+ * @see #unsetPrice()
+ * @see #getPrice()
+ * @generated
+ */
+ void setPrice(BigDecimal value);
+
+ /**
+ * Unsets the value of the '{@link com.example.simple.Quote#getPrice <em>Price</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetPrice()
+ * @see #getPrice()
+ * @see #setPrice(BigDecimal)
+ * @generated
+ */
+ void unsetPrice();
+
+ /**
+ * Returns whether the value of the '{@link com.example.simple.Quote#getPrice <em>Price</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Price</em>' attribute is set.
+ * @see #unsetPrice()
+ * @see #getPrice()
+ * @see #setPrice(BigDecimal)
+ * @generated
+ */
+ boolean isSetPrice();
+
+ /**
+ * Returns the value of the '<em><b>Open1</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Open1</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Open1</em>' attribute.
+ * @see #isSetOpen1()
+ * @see #unsetOpen1()
+ * @see #setOpen1(BigDecimal)
+ * @generated
+ */
+ BigDecimal getOpen1();
+
+ /**
+ * Sets the value of the '{@link com.example.simple.Quote#getOpen1 <em>Open1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Open1</em>' attribute.
+ * @see #isSetOpen1()
+ * @see #unsetOpen1()
+ * @see #getOpen1()
+ * @generated
+ */
+ void setOpen1(BigDecimal value);
+
+ /**
+ * Unsets the value of the '{@link com.example.simple.Quote#getOpen1 <em>Open1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetOpen1()
+ * @see #getOpen1()
+ * @see #setOpen1(BigDecimal)
+ * @generated
+ */
+ void unsetOpen1();
+
+ /**
+ * Returns whether the value of the '{@link com.example.simple.Quote#getOpen1 <em>Open1</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Open1</em>' attribute is set.
+ * @see #unsetOpen1()
+ * @see #getOpen1()
+ * @see #setOpen1(BigDecimal)
+ * @generated
+ */
+ boolean isSetOpen1();
+
+ /**
+ * Returns the value of the '<em><b>High</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>High</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>High</em>' attribute.
+ * @see #isSetHigh()
+ * @see #unsetHigh()
+ * @see #setHigh(BigDecimal)
+ * @generated
+ */
+ BigDecimal getHigh();
+
+ /**
+ * Sets the value of the '{@link com.example.simple.Quote#getHigh <em>High</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>High</em>' attribute.
+ * @see #isSetHigh()
+ * @see #unsetHigh()
+ * @see #getHigh()
+ * @generated
+ */
+ void setHigh(BigDecimal value);
+
+ /**
+ * Unsets the value of the '{@link com.example.simple.Quote#getHigh <em>High</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetHigh()
+ * @see #getHigh()
+ * @see #setHigh(BigDecimal)
+ * @generated
+ */
+ void unsetHigh();
+
+ /**
+ * Returns whether the value of the '{@link com.example.simple.Quote#getHigh <em>High</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>High</em>' attribute is set.
+ * @see #unsetHigh()
+ * @see #getHigh()
+ * @see #setHigh(BigDecimal)
+ * @generated
+ */
+ boolean isSetHigh();
+
+ /**
+ * Returns the value of the '<em><b>Low</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Low</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Low</em>' attribute.
+ * @see #isSetLow()
+ * @see #unsetLow()
+ * @see #setLow(BigDecimal)
+ * @generated
+ */
+ BigDecimal getLow();
+
+ /**
+ * Sets the value of the '{@link com.example.simple.Quote#getLow <em>Low</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Low</em>' attribute.
+ * @see #isSetLow()
+ * @see #unsetLow()
+ * @see #getLow()
+ * @generated
+ */
+ void setLow(BigDecimal value);
+
+ /**
+ * Unsets the value of the '{@link com.example.simple.Quote#getLow <em>Low</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetLow()
+ * @see #getLow()
+ * @see #setLow(BigDecimal)
+ * @generated
+ */
+ void unsetLow();
+
+ /**
+ * Returns whether the value of the '{@link com.example.simple.Quote#getLow <em>Low</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Low</em>' attribute is set.
+ * @see #unsetLow()
+ * @see #getLow()
+ * @see #setLow(BigDecimal)
+ * @generated
+ */
+ boolean isSetLow();
+
+ /**
+ * Returns the value of the '<em><b>Volume</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Volume</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Volume</em>' attribute.
+ * @see #isSetVolume()
+ * @see #unsetVolume()
+ * @see #setVolume(double)
+ * @generated
+ */
+ double getVolume();
+
+ /**
+ * Sets the value of the '{@link com.example.simple.Quote#getVolume <em>Volume</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Volume</em>' attribute.
+ * @see #isSetVolume()
+ * @see #unsetVolume()
+ * @see #getVolume()
+ * @generated
+ */
+ void setVolume(double value);
+
+ /**
+ * Unsets the value of the '{@link com.example.simple.Quote#getVolume <em>Volume</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetVolume()
+ * @see #getVolume()
+ * @see #setVolume(double)
+ * @generated
+ */
+ void unsetVolume();
+
+ /**
+ * Returns whether the value of the '{@link com.example.simple.Quote#getVolume <em>Volume</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Volume</em>' attribute is set.
+ * @see #unsetVolume()
+ * @see #getVolume()
+ * @see #setVolume(double)
+ * @generated
+ */
+ boolean isSetVolume();
+
+ /**
+ * Returns the value of the '<em><b>Change1</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Change1</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Change1</em>' attribute.
+ * @see #isSetChange1()
+ * @see #unsetChange1()
+ * @see #setChange1(double)
+ * @generated
+ */
+ double getChange1();
+
+ /**
+ * Sets the value of the '{@link com.example.simple.Quote#getChange1 <em>Change1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Change1</em>' attribute.
+ * @see #isSetChange1()
+ * @see #unsetChange1()
+ * @see #getChange1()
+ * @generated
+ */
+ void setChange1(double value);
+
+ /**
+ * Unsets the value of the '{@link com.example.simple.Quote#getChange1 <em>Change1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetChange1()
+ * @see #getChange1()
+ * @see #setChange1(double)
+ * @generated
+ */
+ void unsetChange1();
+
+ /**
+ * Returns whether the value of the '{@link com.example.simple.Quote#getChange1 <em>Change1</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Change1</em>' attribute is set.
+ * @see #unsetChange1()
+ * @see #getChange1()
+ * @see #setChange1(double)
+ * @generated
+ */
+ boolean isSetChange1();
+
+ /**
+ * Returns the value of the '<em><b>Quotes</b></em>' containment reference list.
+ * The list contents are of type {@link com.example.simple.Quote}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Quotes</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Quotes</em>' containment reference list.
+ * @generated
+ */
+ List getQuotes();
+
+} // Quote
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/simple/SimpleFactory.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/simple/SimpleFactory.java
new file mode 100644
index 0000000000..98dc01d69a
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/simple/SimpleFactory.java
@@ -0,0 +1,61 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.simple;
+
+import commonj.sdo.helper.HelperContext;
+
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Factory</b> for the model.
+ * It provides a create method for each non-abstract class of the model.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public interface SimpleFactory
+{
+
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ SimpleFactory INSTANCE = com.example.simple.impl.SimpleFactoryImpl.init();
+
+ /**
+ * Returns a new object of class '<em>Quote</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Quote</em>'.
+ * @generated
+ */
+ Quote createQuote();
+
+ /**
+ * Registers the types supported by this Factory within the supplied scope.argument
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param scope an instance of HelperContext used to manage the scoping of types.
+ * @generated
+ */
+ public void register(HelperContext scope);
+
+} //SimpleFactory
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/simple/cs/CSFactory.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/simple/cs/CSFactory.java
new file mode 100644
index 0000000000..6a742b2cdf
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/simple/cs/CSFactory.java
@@ -0,0 +1,70 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.simple.cs;
+
+import commonj.sdo.helper.HelperContext;
+
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Factory</b> for the model.
+ * It provides a create method for each non-abstract class of the model.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public interface CSFactory
+{
+
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ CSFactory INSTANCE = com.example.simple.cs.impl.CSFactoryImpl.init();
+
+ /**
+ * Returns a new object of class '<em>Quote</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Quote</em>'.
+ * @generated
+ */
+ Quote createQuote();
+
+ /**
+ * Returns a new object of class '<em>Quote Base</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Quote Base</em>'.
+ * @generated
+ */
+ QuoteBase createQuoteBase();
+
+ /**
+ * Registers the types supported by this Factory within the supplied scope.argument
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param scope an instance of HelperContext used to manage the scoping of types.
+ * @generated
+ */
+ public void register(HelperContext scope);
+
+} //CSFactory
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/simple/cs/Quote.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/simple/cs/Quote.java
new file mode 100644
index 0000000000..f18f8117c4
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/simple/cs/Quote.java
@@ -0,0 +1,475 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.simple.cs;
+
+import java.io.Serializable;
+
+import java.math.BigDecimal;
+
+import java.util.List;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Quote</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link com.example.simple.cs.Quote#getSymbol <em>Symbol</em>}</li>
+ * <li>{@link com.example.simple.cs.Quote#getCompanyName <em>Company Name</em>}</li>
+ * <li>{@link com.example.simple.cs.Quote#getPrice <em>Price</em>}</li>
+ * <li>{@link com.example.simple.cs.Quote#getOpen1 <em>Open1</em>}</li>
+ * <li>{@link com.example.simple.cs.Quote#getHigh <em>High</em>}</li>
+ * <li>{@link com.example.simple.cs.Quote#getLow <em>Low</em>}</li>
+ * <li>{@link com.example.simple.cs.Quote#getVolume <em>Volume</em>}</li>
+ * <li>{@link com.example.simple.cs.Quote#getChange1 <em>Change1</em>}</li>
+ * <li>{@link com.example.simple.cs.Quote#getQuotes <em>Quotes</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @extends Serializable
+ * @generated
+ */
+public interface Quote extends Serializable
+{
+ /**
+ * Returns the value of the '<em><b>Symbol</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Symbol</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Symbol</em>' attribute.
+ * @see #isSetSymbol()
+ * @see #unsetSymbol()
+ * @see #setSymbol(String)
+ * @generated
+ */
+ String getSymbol();
+
+ /**
+ * Sets the value of the '{@link com.example.simple.cs.Quote#getSymbol <em>Symbol</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Symbol</em>' attribute.
+ * @see #isSetSymbol()
+ * @see #unsetSymbol()
+ * @see #getSymbol()
+ * @generated
+ */
+ void setSymbol(String value);
+
+ /**
+ * Unsets the value of the '{@link com.example.simple.cs.Quote#getSymbol <em>Symbol</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetSymbol()
+ * @see #getSymbol()
+ * @see #setSymbol(String)
+ * @generated
+ */
+ void unsetSymbol();
+
+ /**
+ * Returns whether the value of the '{@link com.example.simple.cs.Quote#getSymbol <em>Symbol</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Symbol</em>' attribute is set.
+ * @see #unsetSymbol()
+ * @see #getSymbol()
+ * @see #setSymbol(String)
+ * @generated
+ */
+ boolean isSetSymbol();
+
+ /**
+ * Returns the value of the '<em><b>Company Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Company Name</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Company Name</em>' attribute.
+ * @see #isSetCompanyName()
+ * @see #unsetCompanyName()
+ * @see #setCompanyName(String)
+ * @generated
+ */
+ String getCompanyName();
+
+ /**
+ * Sets the value of the '{@link com.example.simple.cs.Quote#getCompanyName <em>Company Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Company Name</em>' attribute.
+ * @see #isSetCompanyName()
+ * @see #unsetCompanyName()
+ * @see #getCompanyName()
+ * @generated
+ */
+ void setCompanyName(String value);
+
+ /**
+ * Unsets the value of the '{@link com.example.simple.cs.Quote#getCompanyName <em>Company Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetCompanyName()
+ * @see #getCompanyName()
+ * @see #setCompanyName(String)
+ * @generated
+ */
+ void unsetCompanyName();
+
+ /**
+ * Returns whether the value of the '{@link com.example.simple.cs.Quote#getCompanyName <em>Company Name</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Company Name</em>' attribute is set.
+ * @see #unsetCompanyName()
+ * @see #getCompanyName()
+ * @see #setCompanyName(String)
+ * @generated
+ */
+ boolean isSetCompanyName();
+
+ /**
+ * Returns the value of the '<em><b>Price</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Price</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Price</em>' attribute.
+ * @see #isSetPrice()
+ * @see #unsetPrice()
+ * @see #setPrice(BigDecimal)
+ * @generated
+ */
+ BigDecimal getPrice();
+
+ /**
+ * Sets the value of the '{@link com.example.simple.cs.Quote#getPrice <em>Price</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Price</em>' attribute.
+ * @see #isSetPrice()
+ * @see #unsetPrice()
+ * @see #getPrice()
+ * @generated
+ */
+ void setPrice(BigDecimal value);
+
+ /**
+ * Unsets the value of the '{@link com.example.simple.cs.Quote#getPrice <em>Price</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetPrice()
+ * @see #getPrice()
+ * @see #setPrice(BigDecimal)
+ * @generated
+ */
+ void unsetPrice();
+
+ /**
+ * Returns whether the value of the '{@link com.example.simple.cs.Quote#getPrice <em>Price</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Price</em>' attribute is set.
+ * @see #unsetPrice()
+ * @see #getPrice()
+ * @see #setPrice(BigDecimal)
+ * @generated
+ */
+ boolean isSetPrice();
+
+ /**
+ * Returns the value of the '<em><b>Open1</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Open1</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Open1</em>' attribute.
+ * @see #isSetOpen1()
+ * @see #unsetOpen1()
+ * @see #setOpen1(BigDecimal)
+ * @generated
+ */
+ BigDecimal getOpen1();
+
+ /**
+ * Sets the value of the '{@link com.example.simple.cs.Quote#getOpen1 <em>Open1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Open1</em>' attribute.
+ * @see #isSetOpen1()
+ * @see #unsetOpen1()
+ * @see #getOpen1()
+ * @generated
+ */
+ void setOpen1(BigDecimal value);
+
+ /**
+ * Unsets the value of the '{@link com.example.simple.cs.Quote#getOpen1 <em>Open1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetOpen1()
+ * @see #getOpen1()
+ * @see #setOpen1(BigDecimal)
+ * @generated
+ */
+ void unsetOpen1();
+
+ /**
+ * Returns whether the value of the '{@link com.example.simple.cs.Quote#getOpen1 <em>Open1</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Open1</em>' attribute is set.
+ * @see #unsetOpen1()
+ * @see #getOpen1()
+ * @see #setOpen1(BigDecimal)
+ * @generated
+ */
+ boolean isSetOpen1();
+
+ /**
+ * Returns the value of the '<em><b>High</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>High</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>High</em>' attribute.
+ * @see #isSetHigh()
+ * @see #unsetHigh()
+ * @see #setHigh(BigDecimal)
+ * @generated
+ */
+ BigDecimal getHigh();
+
+ /**
+ * Sets the value of the '{@link com.example.simple.cs.Quote#getHigh <em>High</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>High</em>' attribute.
+ * @see #isSetHigh()
+ * @see #unsetHigh()
+ * @see #getHigh()
+ * @generated
+ */
+ void setHigh(BigDecimal value);
+
+ /**
+ * Unsets the value of the '{@link com.example.simple.cs.Quote#getHigh <em>High</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetHigh()
+ * @see #getHigh()
+ * @see #setHigh(BigDecimal)
+ * @generated
+ */
+ void unsetHigh();
+
+ /**
+ * Returns whether the value of the '{@link com.example.simple.cs.Quote#getHigh <em>High</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>High</em>' attribute is set.
+ * @see #unsetHigh()
+ * @see #getHigh()
+ * @see #setHigh(BigDecimal)
+ * @generated
+ */
+ boolean isSetHigh();
+
+ /**
+ * Returns the value of the '<em><b>Low</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Low</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Low</em>' attribute.
+ * @see #isSetLow()
+ * @see #unsetLow()
+ * @see #setLow(BigDecimal)
+ * @generated
+ */
+ BigDecimal getLow();
+
+ /**
+ * Sets the value of the '{@link com.example.simple.cs.Quote#getLow <em>Low</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Low</em>' attribute.
+ * @see #isSetLow()
+ * @see #unsetLow()
+ * @see #getLow()
+ * @generated
+ */
+ void setLow(BigDecimal value);
+
+ /**
+ * Unsets the value of the '{@link com.example.simple.cs.Quote#getLow <em>Low</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetLow()
+ * @see #getLow()
+ * @see #setLow(BigDecimal)
+ * @generated
+ */
+ void unsetLow();
+
+ /**
+ * Returns whether the value of the '{@link com.example.simple.cs.Quote#getLow <em>Low</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Low</em>' attribute is set.
+ * @see #unsetLow()
+ * @see #getLow()
+ * @see #setLow(BigDecimal)
+ * @generated
+ */
+ boolean isSetLow();
+
+ /**
+ * Returns the value of the '<em><b>Volume</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Volume</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Volume</em>' attribute.
+ * @see #isSetVolume()
+ * @see #unsetVolume()
+ * @see #setVolume(double)
+ * @generated
+ */
+ double getVolume();
+
+ /**
+ * Sets the value of the '{@link com.example.simple.cs.Quote#getVolume <em>Volume</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Volume</em>' attribute.
+ * @see #isSetVolume()
+ * @see #unsetVolume()
+ * @see #getVolume()
+ * @generated
+ */
+ void setVolume(double value);
+
+ /**
+ * Unsets the value of the '{@link com.example.simple.cs.Quote#getVolume <em>Volume</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetVolume()
+ * @see #getVolume()
+ * @see #setVolume(double)
+ * @generated
+ */
+ void unsetVolume();
+
+ /**
+ * Returns whether the value of the '{@link com.example.simple.cs.Quote#getVolume <em>Volume</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Volume</em>' attribute is set.
+ * @see #unsetVolume()
+ * @see #getVolume()
+ * @see #setVolume(double)
+ * @generated
+ */
+ boolean isSetVolume();
+
+ /**
+ * Returns the value of the '<em><b>Change1</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Change1</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Change1</em>' attribute.
+ * @see #isSetChange1()
+ * @see #unsetChange1()
+ * @see #setChange1(double)
+ * @generated
+ */
+ double getChange1();
+
+ /**
+ * Sets the value of the '{@link com.example.simple.cs.Quote#getChange1 <em>Change1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Change1</em>' attribute.
+ * @see #isSetChange1()
+ * @see #unsetChange1()
+ * @see #getChange1()
+ * @generated
+ */
+ void setChange1(double value);
+
+ /**
+ * Unsets the value of the '{@link com.example.simple.cs.Quote#getChange1 <em>Change1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetChange1()
+ * @see #getChange1()
+ * @see #setChange1(double)
+ * @generated
+ */
+ void unsetChange1();
+
+ /**
+ * Returns whether the value of the '{@link com.example.simple.cs.Quote#getChange1 <em>Change1</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Change1</em>' attribute is set.
+ * @see #unsetChange1()
+ * @see #getChange1()
+ * @see #setChange1(double)
+ * @generated
+ */
+ boolean isSetChange1();
+
+ /**
+ * Returns the value of the '<em><b>Quotes</b></em>' containment reference list.
+ * The list contents are of type {@link com.example.simple.cs.Quote}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Quotes</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Quotes</em>' containment reference list.
+ * @generated
+ */
+ List getQuotes();
+
+} // Quote
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/simple/cs/QuoteBase.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/simple/cs/QuoteBase.java
new file mode 100644
index 0000000000..c086be2c71
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/simple/cs/QuoteBase.java
@@ -0,0 +1,91 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.simple.cs;
+
+import commonj.sdo.ChangeSummary;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Quote Base</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link com.example.simple.cs.QuoteBase#getChanges <em>Changes</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public interface QuoteBase extends Quote
+{
+ /**
+ * Returns the value of the '<em><b>Changes</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Changes</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Changes</em>' attribute.
+ * @see #isSetChanges()
+ * @see #unsetChanges()
+ * @see #setChanges(ChangeSummary)
+ * @generated
+ */
+ ChangeSummary getChanges();
+
+ /**
+ * Sets the value of the '{@link com.example.simple.cs.QuoteBase#getChanges <em>Changes</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Changes</em>' attribute.
+ * @see #isSetChanges()
+ * @see #unsetChanges()
+ * @see #getChanges()
+ * @generated
+ */
+ void setChanges(ChangeSummary value);
+
+ /**
+ * Unsets the value of the '{@link com.example.simple.cs.QuoteBase#getChanges <em>Changes</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetChanges()
+ * @see #getChanges()
+ * @see #setChanges(ChangeSummary)
+ * @generated
+ */
+ void unsetChanges();
+
+ /**
+ * Returns whether the value of the '{@link com.example.simple.cs.QuoteBase#getChanges <em>Changes</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Changes</em>' attribute is set.
+ * @see #unsetChanges()
+ * @see #getChanges()
+ * @see #setChanges(ChangeSummary)
+ * @generated
+ */
+ boolean isSetChanges();
+
+} // QuoteBase
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/simple/cs/impl/CSFactoryImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/simple/cs/impl/CSFactoryImpl.java
new file mode 100644
index 0000000000..5f2c82dfb8
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/simple/cs/impl/CSFactoryImpl.java
@@ -0,0 +1,369 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.simple.cs.impl;
+
+import commonj.sdo.helper.HelperContext;
+import org.apache.tuscany.sdo.helper.TypeHelperImpl;
+
+import com.example.simple.cs.*;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+
+import org.apache.tuscany.sdo.SDOFactory;
+
+import org.apache.tuscany.sdo.impl.FactoryBase;
+
+import org.apache.tuscany.sdo.model.ModelFactory;
+
+import org.apache.tuscany.sdo.model.impl.ModelFactoryImpl;
+
+import org.apache.tuscany.sdo.util.SDOUtil;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Factory</b>.
+ * Generator information:
+ * patternVersion=1.1; -prefix CS
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class CSFactoryImpl extends FactoryBase implements CSFactory
+{
+
+ /**
+ * The package namespace URI.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String NAMESPACE_URI = "http://www.example.com/simpleCS";
+
+ /**
+ * The package namespace name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String NAMESPACE_PREFIX = "simpleCS";
+
+ /**
+ * The version of the generator pattern used to generate this class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String PATTERN_VERSION = "1.1";
+
+ public static final int QUOTE = 1;
+ public static final int QUOTE_BASE = 2;
+
+ /**
+ * Creates an instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public CSFactoryImpl()
+ {
+ super(NAMESPACE_URI, NAMESPACE_PREFIX, "com.example.simple.cs");
+ }
+
+ /**
+ * Registers the Factory instance so that it is available within the supplied scope.
+ * @argument scope a HelperContext instance that will make the types supported by this Factory available.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void register(HelperContext scope) {
+ if(scope == null) {
+ throw new IllegalArgumentException("Scope can not be null");
+ }
+ TypeHelperImpl th = (TypeHelperImpl)scope.getTypeHelper();
+ th.getExtendedMetaData().putPackage(NAMESPACE_URI, this);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public DataObject create(int typeNumber)
+ {
+ switch (typeNumber)
+ {
+ case QUOTE: return (DataObject)createQuote();
+ case QUOTE_BASE: return (DataObject)createQuoteBase();
+ default:
+ return super.create(typeNumber);
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Quote createQuote()
+ {
+ QuoteImpl quote = new QuoteImpl();
+ return quote;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public QuoteBase createQuoteBase()
+ {
+ QuoteBaseImpl quoteBase = new QuoteBaseImpl();
+ return quoteBase;
+ }
+
+ // Following creates and initializes SDO metadata for the supported types.
+ protected Type quoteType = null;
+
+ public Type getQuote()
+ {
+ return quoteType;
+ }
+
+ protected Type quoteBaseType = null;
+
+ public Type getQuoteBase()
+ {
+ return quoteBaseType;
+ }
+
+
+ private static boolean isInited = false;
+
+ public static CSFactoryImpl init()
+ {
+ if (isInited) return (CSFactoryImpl)FactoryBase.getStaticFactory(CSFactoryImpl.NAMESPACE_URI);
+ CSFactoryImpl theCSFactoryImpl = new CSFactoryImpl();
+ isInited = true;
+
+ // Initialize simple dependencies
+ SDOUtil.registerStaticTypes(SDOFactory.class);
+ SDOUtil.registerStaticTypes(ModelFactory.class);
+
+ // Create package meta-data objects
+ theCSFactoryImpl.createMetaData();
+
+ // Initialize created meta-data
+ theCSFactoryImpl.initializeMetaData();
+
+ // Mark meta-data to indicate it can't be changed
+ //theCSFactoryImpl.freeze(); //FB do we need to freeze / should we freeze ????
+
+ return theCSFactoryImpl;
+ }
+
+ private boolean isCreated = false;
+
+ public void createMetaData()
+ {
+ if (isCreated) return;
+ isCreated = true;
+
+ // Create types and their properties
+ quoteType = createType(false, QUOTE);
+ createProperty(true, quoteType,QuoteImpl.INTERNAL_SYMBOL);
+ createProperty(true, quoteType,QuoteImpl.INTERNAL_COMPANY_NAME);
+ createProperty(true, quoteType,QuoteImpl.INTERNAL_PRICE);
+ createProperty(true, quoteType,QuoteImpl.INTERNAL_OPEN1);
+ createProperty(true, quoteType,QuoteImpl.INTERNAL_HIGH);
+ createProperty(true, quoteType,QuoteImpl.INTERNAL_LOW);
+ createProperty(true, quoteType,QuoteImpl.INTERNAL_VOLUME);
+ createProperty(true, quoteType,QuoteImpl.INTERNAL_CHANGE1);
+ createProperty(false, quoteType,QuoteImpl.INTERNAL_QUOTES);
+ quoteBaseType = createType(false, QUOTE_BASE);
+ createProperty(true, quoteBaseType,QuoteBaseImpl.INTERNAL_CHANGES);
+ }
+
+ private boolean isInitialized = false;
+
+ public void initializeMetaData()
+ {
+ if (isInitialized) return;
+ isInitialized = true;
+
+ // Obtain other dependent packages
+ ModelFactoryImpl theModelPackageImpl = (ModelFactoryImpl)FactoryBase.getStaticFactory(ModelFactoryImpl.NAMESPACE_URI);
+ Property property = null;
+
+ // Add supertypes to types
+ addSuperType(quoteBaseType, quoteType);
+
+ // Initialize types and properties
+ initializeType(quoteType, Quote.class, "Quote", false);
+ property = getProperty(quoteType, QuoteImpl.INTERNAL_SYMBOL);
+ initializeProperty(property, theModelPackageImpl.getString(), "symbol", null, 1, 1, Quote.class, false, true, false);
+
+ property = getProperty(quoteType, QuoteImpl.INTERNAL_COMPANY_NAME);
+ initializeProperty(property, theModelPackageImpl.getString(), "companyName", null, 1, 1, Quote.class, false, true, false);
+
+ property = getProperty(quoteType, QuoteImpl.INTERNAL_PRICE);
+ initializeProperty(property, theModelPackageImpl.getDecimal(), "price", null, 1, 1, Quote.class, false, true, false);
+
+ property = getProperty(quoteType, QuoteImpl.INTERNAL_OPEN1);
+ initializeProperty(property, theModelPackageImpl.getDecimal(), "open1", null, 1, 1, Quote.class, false, true, false);
+
+ property = getProperty(quoteType, QuoteImpl.INTERNAL_HIGH);
+ initializeProperty(property, theModelPackageImpl.getDecimal(), "high", null, 1, 1, Quote.class, false, true, false);
+
+ property = getProperty(quoteType, QuoteImpl.INTERNAL_LOW);
+ initializeProperty(property, theModelPackageImpl.getDecimal(), "low", null, 1, 1, Quote.class, false, true, false);
+
+ property = getProperty(quoteType, QuoteImpl.INTERNAL_VOLUME);
+ initializeProperty(property, theModelPackageImpl.getDouble(), "volume", null, 1, 1, Quote.class, false, true, false);
+
+ property = getProperty(quoteType, QuoteImpl.INTERNAL_CHANGE1);
+ initializeProperty(property, theModelPackageImpl.getDouble(), "change1", null, 1, 1, Quote.class, false, true, false);
+
+ property = getProperty(quoteType, QuoteImpl.INTERNAL_QUOTES);
+ initializeProperty(property, this.getQuote(), "quotes", null, 0, -1, Quote.class, false, false, false, true , null);
+
+ initializeType(quoteBaseType, QuoteBase.class, "QuoteBase", false);
+ property = getProperty(quoteBaseType, QuoteBaseImpl.INTERNAL_CHANGES);
+ initializeProperty(property, theModelPackageImpl.getChangeSummaryType(), "changes", null, 1, 1, QuoteBase.class, false, true, false);
+
+ createXSDMetaData(theModelPackageImpl);
+ }
+
+ protected void createXSDMetaData(ModelFactoryImpl theModelPackageImpl)
+ {
+ super.initXSD();
+
+ Property property = null;
+
+
+ property = createGlobalProperty
+ ("stockQuote",
+ this.getQuoteBase(),
+ new String[]
+ {
+ "kind", "element",
+ "name", "stockQuote",
+ "namespace", "##targetNamespace"
+ });
+
+ addXSDMapping
+ (quoteType,
+ new String[]
+ {
+ "name", "Quote",
+ "kind", "elementOnly"
+ });
+
+ addXSDMapping
+ (getProperty(quoteType, QuoteImpl.INTERNAL_SYMBOL),
+ new String[]
+ {
+ "kind", "element",
+ "name", "symbol"
+ });
+
+ addXSDMapping
+ (getProperty(quoteType, QuoteImpl.INTERNAL_COMPANY_NAME),
+ new String[]
+ {
+ "kind", "element",
+ "name", "companyName"
+ });
+
+ addXSDMapping
+ (getProperty(quoteType, QuoteImpl.INTERNAL_PRICE),
+ new String[]
+ {
+ "kind", "element",
+ "name", "price"
+ });
+
+ addXSDMapping
+ (getProperty(quoteType, QuoteImpl.INTERNAL_OPEN1),
+ new String[]
+ {
+ "kind", "element",
+ "name", "open1"
+ });
+
+ addXSDMapping
+ (getProperty(quoteType, QuoteImpl.INTERNAL_HIGH),
+ new String[]
+ {
+ "kind", "element",
+ "name", "high"
+ });
+
+ addXSDMapping
+ (getProperty(quoteType, QuoteImpl.INTERNAL_LOW),
+ new String[]
+ {
+ "kind", "element",
+ "name", "low"
+ });
+
+ addXSDMapping
+ (getProperty(quoteType, QuoteImpl.INTERNAL_VOLUME),
+ new String[]
+ {
+ "kind", "element",
+ "name", "volume"
+ });
+
+ addXSDMapping
+ (getProperty(quoteType, QuoteImpl.INTERNAL_CHANGE1),
+ new String[]
+ {
+ "kind", "element",
+ "name", "change1"
+ });
+
+ addXSDMapping
+ (getProperty(quoteType, QuoteImpl.INTERNAL_QUOTES),
+ new String[]
+ {
+ "kind", "element",
+ "name", "quotes"
+ });
+
+ addXSDMapping
+ (quoteBaseType,
+ new String[]
+ {
+ "name", "QuoteBase",
+ "kind", "elementOnly"
+ });
+
+ addXSDMapping
+ (getProperty(quoteBaseType, QuoteBaseImpl.INTERNAL_CHANGES),
+ new String[]
+ {
+ "kind", "element",
+ "name", "changes"
+ });
+
+ }
+
+} //CSFactoryImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/simple/cs/impl/QuoteBaseImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/simple/cs/impl/QuoteBaseImpl.java
new file mode 100644
index 0000000000..edca4b5381
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/simple/cs/impl/QuoteBaseImpl.java
@@ -0,0 +1,346 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.simple.cs.impl;
+
+import com.example.simple.cs.CSFactory;
+import com.example.simple.cs.QuoteBase;
+
+import commonj.sdo.ChangeSummary;
+import commonj.sdo.Type;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Quote Base</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link com.example.simple.cs.impl.QuoteBaseImpl#getChanges <em>Changes</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class QuoteBaseImpl extends QuoteImpl implements QuoteBase
+{
+
+ public final static int CHANGES = QuoteImpl.SDO_PROPERTY_COUNT + 0;
+
+ public final static int SDO_PROPERTY_COUNT = QuoteImpl.SDO_PROPERTY_COUNT + 1;
+
+ public final static int EXTENDED_PROPERTY_COUNT = QuoteImpl.EXTENDED_PROPERTY_COUNT - 0;
+
+
+ /**
+ * The internal feature id for the '<em><b>Symbol</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_SYMBOL = QuoteImpl.SYMBOL;
+
+ /**
+ * The internal feature id for the '<em><b>Company Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_COMPANY_NAME = QuoteImpl.COMPANY_NAME;
+
+ /**
+ * The internal feature id for the '<em><b>Price</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_PRICE = QuoteImpl.PRICE;
+
+ /**
+ * The internal feature id for the '<em><b>Open1</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_OPEN1 = QuoteImpl.OPEN1;
+
+ /**
+ * The internal feature id for the '<em><b>High</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_HIGH = QuoteImpl.HIGH;
+
+ /**
+ * The internal feature id for the '<em><b>Low</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_LOW = QuoteImpl.LOW;
+
+ /**
+ * The internal feature id for the '<em><b>Volume</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_VOLUME = QuoteImpl.VOLUME;
+
+ /**
+ * The internal feature id for the '<em><b>Change1</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_CHANGE1 = QuoteImpl.CHANGE1;
+
+ /**
+ * The internal feature id for the '<em><b>Quotes</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_QUOTES = QuoteImpl.QUOTES;
+
+ /**
+ * The internal feature id for the '<em><b>Changes</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_CHANGES = QuoteImpl.INTERNAL_PROPERTY_COUNT + 0;
+
+ /**
+ * The number of properties for this type.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_PROPERTY_COUNT = QuoteImpl.INTERNAL_PROPERTY_COUNT + 1;
+
+ protected int internalConvertIndex(int internalIndex)
+ {
+ switch (internalIndex)
+ {
+ case INTERNAL_SYMBOL: return SYMBOL;
+ case INTERNAL_COMPANY_NAME: return COMPANY_NAME;
+ case INTERNAL_PRICE: return PRICE;
+ case INTERNAL_OPEN1: return OPEN1;
+ case INTERNAL_HIGH: return HIGH;
+ case INTERNAL_LOW: return LOW;
+ case INTERNAL_VOLUME: return VOLUME;
+ case INTERNAL_CHANGE1: return CHANGE1;
+ case INTERNAL_QUOTES: return QUOTES;
+ case INTERNAL_CHANGES: return CHANGES;
+ }
+ return super.internalConvertIndex(internalIndex);
+ }
+
+
+ /**
+ * The default value of the '{@link #getChanges() <em>Changes</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getChanges()
+ * @generated
+ * @ordered
+ */
+ protected static final ChangeSummary CHANGES_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getChanges() <em>Changes</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getChanges()
+ * @generated
+ * @ordered
+ */
+ protected ChangeSummary changes = CHANGES_DEFAULT_;
+
+ /**
+ * This is true if the Changes attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean changes_set_ = false;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public QuoteBaseImpl()
+ {
+ super();
+ createChangeSummary(CHANGES);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Type getType()
+ {
+ return ((CSFactoryImpl)CSFactory.INSTANCE).getQuoteBase();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeSummary getChanges()
+ {
+ return changes;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setChanges(ChangeSummary newChanges)
+ {
+ ChangeSummary oldChanges = changes;
+ changes = newChanges;
+ boolean oldChanges_set_ = changes_set_;
+ changes_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, CHANGES, oldChanges, changes, !oldChanges_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetChanges()
+ {
+ ChangeSummary oldChanges = changes;
+ boolean oldChanges_set_ = changes_set_;
+ changes = CHANGES_DEFAULT_;
+ changes_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, CHANGES, oldChanges, CHANGES_DEFAULT_, oldChanges_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetChanges()
+ {
+ return changes_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object get(int propertyIndex, boolean resolve)
+ {
+ switch (propertyIndex)
+ {
+ case CHANGES:
+ return getChanges();
+ }
+ return super.get(propertyIndex, resolve);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void set(int propertyIndex, Object newValue)
+ {
+ switch (propertyIndex)
+ {
+ case CHANGES:
+ setChanges((ChangeSummary)newValue);
+ return;
+ }
+ super.set(propertyIndex, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unset(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case CHANGES:
+ unsetChanges();
+ return;
+ }
+ super.unset(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSet(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case CHANGES:
+ return isSetChanges();
+ }
+ return super.isSet(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString()
+ {
+ if (isProxy(this)) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (changes: ");
+ if (changes_set_) result.append(changes); else result.append("<unset>");
+ result.append(')');
+ return result.toString();
+ }
+
+} //QuoteBaseImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/simple/cs/impl/QuoteImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/simple/cs/impl/QuoteImpl.java
new file mode 100644
index 0000000000..38c4a2c06a
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/simple/cs/impl/QuoteImpl.java
@@ -0,0 +1,1045 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.simple.cs.impl;
+
+import com.example.simple.cs.CSFactory;
+import com.example.simple.cs.Quote;
+
+import commonj.sdo.Type;
+
+import java.math.BigDecimal;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.tuscany.sdo.impl.DataObjectBase;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Quote</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link com.example.simple.cs.impl.QuoteImpl#getSymbol <em>Symbol</em>}</li>
+ * <li>{@link com.example.simple.cs.impl.QuoteImpl#getCompanyName <em>Company Name</em>}</li>
+ * <li>{@link com.example.simple.cs.impl.QuoteImpl#getPrice <em>Price</em>}</li>
+ * <li>{@link com.example.simple.cs.impl.QuoteImpl#getOpen1 <em>Open1</em>}</li>
+ * <li>{@link com.example.simple.cs.impl.QuoteImpl#getHigh <em>High</em>}</li>
+ * <li>{@link com.example.simple.cs.impl.QuoteImpl#getLow <em>Low</em>}</li>
+ * <li>{@link com.example.simple.cs.impl.QuoteImpl#getVolume <em>Volume</em>}</li>
+ * <li>{@link com.example.simple.cs.impl.QuoteImpl#getChange1 <em>Change1</em>}</li>
+ * <li>{@link com.example.simple.cs.impl.QuoteImpl#getQuotes <em>Quotes</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class QuoteImpl extends DataObjectBase implements Quote
+{
+
+ public final static int SYMBOL = 0;
+
+ public final static int COMPANY_NAME = 1;
+
+ public final static int PRICE = 2;
+
+ public final static int OPEN1 = 3;
+
+ public final static int HIGH = 4;
+
+ public final static int LOW = 5;
+
+ public final static int VOLUME = 6;
+
+ public final static int CHANGE1 = 7;
+
+ public final static int QUOTES = 8;
+
+ public final static int SDO_PROPERTY_COUNT = 9;
+
+ public final static int EXTENDED_PROPERTY_COUNT = 0;
+
+
+ /**
+ * The internal feature id for the '<em><b>Symbol</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_SYMBOL = 0;
+
+ /**
+ * The internal feature id for the '<em><b>Company Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_COMPANY_NAME = 1;
+
+ /**
+ * The internal feature id for the '<em><b>Price</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_PRICE = 2;
+
+ /**
+ * The internal feature id for the '<em><b>Open1</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_OPEN1 = 3;
+
+ /**
+ * The internal feature id for the '<em><b>High</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_HIGH = 4;
+
+ /**
+ * The internal feature id for the '<em><b>Low</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_LOW = 5;
+
+ /**
+ * The internal feature id for the '<em><b>Volume</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_VOLUME = 6;
+
+ /**
+ * The internal feature id for the '<em><b>Change1</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_CHANGE1 = 7;
+
+ /**
+ * The internal feature id for the '<em><b>Quotes</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_QUOTES = 8;
+
+ /**
+ * The number of properties for this type.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_PROPERTY_COUNT = 9;
+
+ protected int internalConvertIndex(int internalIndex)
+ {
+ switch (internalIndex)
+ {
+ case INTERNAL_SYMBOL: return SYMBOL;
+ case INTERNAL_COMPANY_NAME: return COMPANY_NAME;
+ case INTERNAL_PRICE: return PRICE;
+ case INTERNAL_OPEN1: return OPEN1;
+ case INTERNAL_HIGH: return HIGH;
+ case INTERNAL_LOW: return LOW;
+ case INTERNAL_VOLUME: return VOLUME;
+ case INTERNAL_CHANGE1: return CHANGE1;
+ case INTERNAL_QUOTES: return QUOTES;
+ }
+ return super.internalConvertIndex(internalIndex);
+ }
+
+
+ /**
+ * The default value of the '{@link #getSymbol() <em>Symbol</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getSymbol()
+ * @generated
+ * @ordered
+ */
+ protected static final String SYMBOL_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getSymbol() <em>Symbol</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getSymbol()
+ * @generated
+ * @ordered
+ */
+ protected String symbol = SYMBOL_DEFAULT_;
+
+ /**
+ * This is true if the Symbol attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean symbol_set_ = false;
+
+ /**
+ * The default value of the '{@link #getCompanyName() <em>Company Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getCompanyName()
+ * @generated
+ * @ordered
+ */
+ protected static final String COMPANY_NAME_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getCompanyName() <em>Company Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getCompanyName()
+ * @generated
+ * @ordered
+ */
+ protected String companyName = COMPANY_NAME_DEFAULT_;
+
+ /**
+ * This is true if the Company Name attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean companyName_set_ = false;
+
+ /**
+ * The default value of the '{@link #getPrice() <em>Price</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getPrice()
+ * @generated
+ * @ordered
+ */
+ protected static final BigDecimal PRICE_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getPrice() <em>Price</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getPrice()
+ * @generated
+ * @ordered
+ */
+ protected BigDecimal price = PRICE_DEFAULT_;
+
+ /**
+ * This is true if the Price attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean price_set_ = false;
+
+ /**
+ * The default value of the '{@link #getOpen1() <em>Open1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getOpen1()
+ * @generated
+ * @ordered
+ */
+ protected static final BigDecimal OPEN1_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getOpen1() <em>Open1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getOpen1()
+ * @generated
+ * @ordered
+ */
+ protected BigDecimal open1 = OPEN1_DEFAULT_;
+
+ /**
+ * This is true if the Open1 attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean open1_set_ = false;
+
+ /**
+ * The default value of the '{@link #getHigh() <em>High</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getHigh()
+ * @generated
+ * @ordered
+ */
+ protected static final BigDecimal HIGH_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getHigh() <em>High</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getHigh()
+ * @generated
+ * @ordered
+ */
+ protected BigDecimal high = HIGH_DEFAULT_;
+
+ /**
+ * This is true if the High attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean high_set_ = false;
+
+ /**
+ * The default value of the '{@link #getLow() <em>Low</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getLow()
+ * @generated
+ * @ordered
+ */
+ protected static final BigDecimal LOW_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getLow() <em>Low</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getLow()
+ * @generated
+ * @ordered
+ */
+ protected BigDecimal low = LOW_DEFAULT_;
+
+ /**
+ * This is true if the Low attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean low_set_ = false;
+
+ /**
+ * The default value of the '{@link #getVolume() <em>Volume</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getVolume()
+ * @generated
+ * @ordered
+ */
+ protected static final double VOLUME_DEFAULT_ = 0.0;
+
+ /**
+ * The cached value of the '{@link #getVolume() <em>Volume</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getVolume()
+ * @generated
+ * @ordered
+ */
+ protected double volume = VOLUME_DEFAULT_;
+
+ /**
+ * This is true if the Volume attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean volume_set_ = false;
+
+ /**
+ * The default value of the '{@link #getChange1() <em>Change1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getChange1()
+ * @generated
+ * @ordered
+ */
+ protected static final double CHANGE1_DEFAULT_ = 0.0;
+
+ /**
+ * The cached value of the '{@link #getChange1() <em>Change1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getChange1()
+ * @generated
+ * @ordered
+ */
+ protected double change1 = CHANGE1_DEFAULT_;
+
+ /**
+ * This is true if the Change1 attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean change1_set_ = false;
+
+ /**
+ * The cached value of the '{@link #getQuotes() <em>Quotes</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getQuotes()
+ * @generated
+ * @ordered
+ */
+
+ protected List quotes = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public QuoteImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Type getType()
+ {
+ return ((CSFactoryImpl)CSFactory.INSTANCE).getQuote();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getSymbol()
+ {
+ return symbol;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setSymbol(String newSymbol)
+ {
+ String oldSymbol = symbol;
+ symbol = newSymbol;
+ boolean oldSymbol_set_ = symbol_set_;
+ symbol_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, SYMBOL, oldSymbol, symbol, !oldSymbol_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetSymbol()
+ {
+ String oldSymbol = symbol;
+ boolean oldSymbol_set_ = symbol_set_;
+ symbol = SYMBOL_DEFAULT_;
+ symbol_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, SYMBOL, oldSymbol, SYMBOL_DEFAULT_, oldSymbol_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetSymbol()
+ {
+ return symbol_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getCompanyName()
+ {
+ return companyName;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setCompanyName(String newCompanyName)
+ {
+ String oldCompanyName = companyName;
+ companyName = newCompanyName;
+ boolean oldCompanyName_set_ = companyName_set_;
+ companyName_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, COMPANY_NAME, oldCompanyName, companyName, !oldCompanyName_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetCompanyName()
+ {
+ String oldCompanyName = companyName;
+ boolean oldCompanyName_set_ = companyName_set_;
+ companyName = COMPANY_NAME_DEFAULT_;
+ companyName_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, COMPANY_NAME, oldCompanyName, COMPANY_NAME_DEFAULT_, oldCompanyName_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetCompanyName()
+ {
+ return companyName_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public BigDecimal getPrice()
+ {
+ return price;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setPrice(BigDecimal newPrice)
+ {
+ BigDecimal oldPrice = price;
+ price = newPrice;
+ boolean oldPrice_set_ = price_set_;
+ price_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, PRICE, oldPrice, price, !oldPrice_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetPrice()
+ {
+ BigDecimal oldPrice = price;
+ boolean oldPrice_set_ = price_set_;
+ price = PRICE_DEFAULT_;
+ price_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, PRICE, oldPrice, PRICE_DEFAULT_, oldPrice_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetPrice()
+ {
+ return price_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public BigDecimal getOpen1()
+ {
+ return open1;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setOpen1(BigDecimal newOpen1)
+ {
+ BigDecimal oldOpen1 = open1;
+ open1 = newOpen1;
+ boolean oldOpen1_set_ = open1_set_;
+ open1_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, OPEN1, oldOpen1, open1, !oldOpen1_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetOpen1()
+ {
+ BigDecimal oldOpen1 = open1;
+ boolean oldOpen1_set_ = open1_set_;
+ open1 = OPEN1_DEFAULT_;
+ open1_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, OPEN1, oldOpen1, OPEN1_DEFAULT_, oldOpen1_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetOpen1()
+ {
+ return open1_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public BigDecimal getHigh()
+ {
+ return high;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setHigh(BigDecimal newHigh)
+ {
+ BigDecimal oldHigh = high;
+ high = newHigh;
+ boolean oldHigh_set_ = high_set_;
+ high_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, HIGH, oldHigh, high, !oldHigh_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetHigh()
+ {
+ BigDecimal oldHigh = high;
+ boolean oldHigh_set_ = high_set_;
+ high = HIGH_DEFAULT_;
+ high_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, HIGH, oldHigh, HIGH_DEFAULT_, oldHigh_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetHigh()
+ {
+ return high_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public BigDecimal getLow()
+ {
+ return low;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setLow(BigDecimal newLow)
+ {
+ BigDecimal oldLow = low;
+ low = newLow;
+ boolean oldLow_set_ = low_set_;
+ low_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, LOW, oldLow, low, !oldLow_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetLow()
+ {
+ BigDecimal oldLow = low;
+ boolean oldLow_set_ = low_set_;
+ low = LOW_DEFAULT_;
+ low_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, LOW, oldLow, LOW_DEFAULT_, oldLow_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetLow()
+ {
+ return low_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public double getVolume()
+ {
+ return volume;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setVolume(double newVolume)
+ {
+ double oldVolume = volume;
+ volume = newVolume;
+ boolean oldVolume_set_ = volume_set_;
+ volume_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, VOLUME, oldVolume, volume, !oldVolume_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetVolume()
+ {
+ double oldVolume = volume;
+ boolean oldVolume_set_ = volume_set_;
+ volume = VOLUME_DEFAULT_;
+ volume_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, VOLUME, oldVolume, VOLUME_DEFAULT_, oldVolume_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetVolume()
+ {
+ return volume_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public double getChange1()
+ {
+ return change1;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setChange1(double newChange1)
+ {
+ double oldChange1 = change1;
+ change1 = newChange1;
+ boolean oldChange1_set_ = change1_set_;
+ change1_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, CHANGE1, oldChange1, change1, !oldChange1_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetChange1()
+ {
+ double oldChange1 = change1;
+ boolean oldChange1_set_ = change1_set_;
+ change1 = CHANGE1_DEFAULT_;
+ change1_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, CHANGE1, oldChange1, CHANGE1_DEFAULT_, oldChange1_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetChange1()
+ {
+ return change1_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public List getQuotes()
+ {
+ if (quotes == null)
+ {
+ quotes = createPropertyList(ListKind.CONTAINMENT, Quote.class, QUOTES);
+ }
+ return quotes;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeContext inverseRemove(Object otherEnd, int propertyIndex, ChangeContext changeContext)
+ {
+ switch (propertyIndex)
+ {
+ case QUOTES:
+ return removeFromList(getQuotes(), otherEnd, changeContext);
+ }
+ return super.inverseRemove(otherEnd, propertyIndex, changeContext);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object get(int propertyIndex, boolean resolve)
+ {
+ switch (propertyIndex)
+ {
+ case SYMBOL:
+ return getSymbol();
+ case COMPANY_NAME:
+ return getCompanyName();
+ case PRICE:
+ return getPrice();
+ case OPEN1:
+ return getOpen1();
+ case HIGH:
+ return getHigh();
+ case LOW:
+ return getLow();
+ case VOLUME:
+ return new Double(getVolume());
+ case CHANGE1:
+ return new Double(getChange1());
+ case QUOTES:
+ return getQuotes();
+ }
+ return super.get(propertyIndex, resolve);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void set(int propertyIndex, Object newValue)
+ {
+ switch (propertyIndex)
+ {
+ case SYMBOL:
+ setSymbol((String)newValue);
+ return;
+ case COMPANY_NAME:
+ setCompanyName((String)newValue);
+ return;
+ case PRICE:
+ setPrice((BigDecimal)newValue);
+ return;
+ case OPEN1:
+ setOpen1((BigDecimal)newValue);
+ return;
+ case HIGH:
+ setHigh((BigDecimal)newValue);
+ return;
+ case LOW:
+ setLow((BigDecimal)newValue);
+ return;
+ case VOLUME:
+ setVolume(((Double)newValue).doubleValue());
+ return;
+ case CHANGE1:
+ setChange1(((Double)newValue).doubleValue());
+ return;
+ case QUOTES:
+ getQuotes().clear();
+ getQuotes().addAll((Collection)newValue);
+ return;
+ }
+ super.set(propertyIndex, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unset(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case SYMBOL:
+ unsetSymbol();
+ return;
+ case COMPANY_NAME:
+ unsetCompanyName();
+ return;
+ case PRICE:
+ unsetPrice();
+ return;
+ case OPEN1:
+ unsetOpen1();
+ return;
+ case HIGH:
+ unsetHigh();
+ return;
+ case LOW:
+ unsetLow();
+ return;
+ case VOLUME:
+ unsetVolume();
+ return;
+ case CHANGE1:
+ unsetChange1();
+ return;
+ case QUOTES:
+ getQuotes().clear();
+ return;
+ }
+ super.unset(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSet(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case SYMBOL:
+ return isSetSymbol();
+ case COMPANY_NAME:
+ return isSetCompanyName();
+ case PRICE:
+ return isSetPrice();
+ case OPEN1:
+ return isSetOpen1();
+ case HIGH:
+ return isSetHigh();
+ case LOW:
+ return isSetLow();
+ case VOLUME:
+ return isSetVolume();
+ case CHANGE1:
+ return isSetChange1();
+ case QUOTES:
+ return quotes != null && !quotes.isEmpty();
+ }
+ return super.isSet(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString()
+ {
+ if (isProxy(this)) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (symbol: ");
+ if (symbol_set_) result.append(symbol); else result.append("<unset>");
+ result.append(", companyName: ");
+ if (companyName_set_) result.append(companyName); else result.append("<unset>");
+ result.append(", price: ");
+ if (price_set_) result.append(price); else result.append("<unset>");
+ result.append(", open1: ");
+ if (open1_set_) result.append(open1); else result.append("<unset>");
+ result.append(", high: ");
+ if (high_set_) result.append(high); else result.append("<unset>");
+ result.append(", low: ");
+ if (low_set_) result.append(low); else result.append("<unset>");
+ result.append(", volume: ");
+ if (volume_set_) result.append(volume); else result.append("<unset>");
+ result.append(", change1: ");
+ if (change1_set_) result.append(change1); else result.append("<unset>");
+ result.append(')');
+ return result.toString();
+ }
+
+} //QuoteImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/simple/impl/QuoteImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/simple/impl/QuoteImpl.java
new file mode 100644
index 0000000000..121f989538
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/simple/impl/QuoteImpl.java
@@ -0,0 +1,1045 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.simple.impl;
+
+import com.example.simple.Quote;
+import com.example.simple.SimpleFactory;
+
+import commonj.sdo.Type;
+
+import java.math.BigDecimal;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.tuscany.sdo.impl.DataObjectBase;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Quote</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link com.example.simple.impl.QuoteImpl#getSymbol <em>Symbol</em>}</li>
+ * <li>{@link com.example.simple.impl.QuoteImpl#getCompanyName <em>Company Name</em>}</li>
+ * <li>{@link com.example.simple.impl.QuoteImpl#getPrice <em>Price</em>}</li>
+ * <li>{@link com.example.simple.impl.QuoteImpl#getOpen1 <em>Open1</em>}</li>
+ * <li>{@link com.example.simple.impl.QuoteImpl#getHigh <em>High</em>}</li>
+ * <li>{@link com.example.simple.impl.QuoteImpl#getLow <em>Low</em>}</li>
+ * <li>{@link com.example.simple.impl.QuoteImpl#getVolume <em>Volume</em>}</li>
+ * <li>{@link com.example.simple.impl.QuoteImpl#getChange1 <em>Change1</em>}</li>
+ * <li>{@link com.example.simple.impl.QuoteImpl#getQuotes <em>Quotes</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class QuoteImpl extends DataObjectBase implements Quote
+{
+
+ public final static int SYMBOL = 0;
+
+ public final static int COMPANY_NAME = 1;
+
+ public final static int PRICE = 2;
+
+ public final static int OPEN1 = 3;
+
+ public final static int HIGH = 4;
+
+ public final static int LOW = 5;
+
+ public final static int VOLUME = 6;
+
+ public final static int CHANGE1 = 7;
+
+ public final static int QUOTES = 8;
+
+ public final static int SDO_PROPERTY_COUNT = 9;
+
+ public final static int EXTENDED_PROPERTY_COUNT = 0;
+
+
+ /**
+ * The internal feature id for the '<em><b>Symbol</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_SYMBOL = 0;
+
+ /**
+ * The internal feature id for the '<em><b>Company Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_COMPANY_NAME = 1;
+
+ /**
+ * The internal feature id for the '<em><b>Price</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_PRICE = 2;
+
+ /**
+ * The internal feature id for the '<em><b>Open1</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_OPEN1 = 3;
+
+ /**
+ * The internal feature id for the '<em><b>High</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_HIGH = 4;
+
+ /**
+ * The internal feature id for the '<em><b>Low</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_LOW = 5;
+
+ /**
+ * The internal feature id for the '<em><b>Volume</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_VOLUME = 6;
+
+ /**
+ * The internal feature id for the '<em><b>Change1</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_CHANGE1 = 7;
+
+ /**
+ * The internal feature id for the '<em><b>Quotes</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_QUOTES = 8;
+
+ /**
+ * The number of properties for this type.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_PROPERTY_COUNT = 9;
+
+ protected int internalConvertIndex(int internalIndex)
+ {
+ switch (internalIndex)
+ {
+ case INTERNAL_SYMBOL: return SYMBOL;
+ case INTERNAL_COMPANY_NAME: return COMPANY_NAME;
+ case INTERNAL_PRICE: return PRICE;
+ case INTERNAL_OPEN1: return OPEN1;
+ case INTERNAL_HIGH: return HIGH;
+ case INTERNAL_LOW: return LOW;
+ case INTERNAL_VOLUME: return VOLUME;
+ case INTERNAL_CHANGE1: return CHANGE1;
+ case INTERNAL_QUOTES: return QUOTES;
+ }
+ return super.internalConvertIndex(internalIndex);
+ }
+
+
+ /**
+ * The default value of the '{@link #getSymbol() <em>Symbol</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getSymbol()
+ * @generated
+ * @ordered
+ */
+ protected static final String SYMBOL_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getSymbol() <em>Symbol</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getSymbol()
+ * @generated
+ * @ordered
+ */
+ protected String symbol = SYMBOL_DEFAULT_;
+
+ /**
+ * This is true if the Symbol attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean symbol_set_ = false;
+
+ /**
+ * The default value of the '{@link #getCompanyName() <em>Company Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getCompanyName()
+ * @generated
+ * @ordered
+ */
+ protected static final String COMPANY_NAME_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getCompanyName() <em>Company Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getCompanyName()
+ * @generated
+ * @ordered
+ */
+ protected String companyName = COMPANY_NAME_DEFAULT_;
+
+ /**
+ * This is true if the Company Name attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean companyName_set_ = false;
+
+ /**
+ * The default value of the '{@link #getPrice() <em>Price</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getPrice()
+ * @generated
+ * @ordered
+ */
+ protected static final BigDecimal PRICE_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getPrice() <em>Price</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getPrice()
+ * @generated
+ * @ordered
+ */
+ protected BigDecimal price = PRICE_DEFAULT_;
+
+ /**
+ * This is true if the Price attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean price_set_ = false;
+
+ /**
+ * The default value of the '{@link #getOpen1() <em>Open1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getOpen1()
+ * @generated
+ * @ordered
+ */
+ protected static final BigDecimal OPEN1_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getOpen1() <em>Open1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getOpen1()
+ * @generated
+ * @ordered
+ */
+ protected BigDecimal open1 = OPEN1_DEFAULT_;
+
+ /**
+ * This is true if the Open1 attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean open1_set_ = false;
+
+ /**
+ * The default value of the '{@link #getHigh() <em>High</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getHigh()
+ * @generated
+ * @ordered
+ */
+ protected static final BigDecimal HIGH_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getHigh() <em>High</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getHigh()
+ * @generated
+ * @ordered
+ */
+ protected BigDecimal high = HIGH_DEFAULT_;
+
+ /**
+ * This is true if the High attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean high_set_ = false;
+
+ /**
+ * The default value of the '{@link #getLow() <em>Low</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getLow()
+ * @generated
+ * @ordered
+ */
+ protected static final BigDecimal LOW_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getLow() <em>Low</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getLow()
+ * @generated
+ * @ordered
+ */
+ protected BigDecimal low = LOW_DEFAULT_;
+
+ /**
+ * This is true if the Low attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean low_set_ = false;
+
+ /**
+ * The default value of the '{@link #getVolume() <em>Volume</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getVolume()
+ * @generated
+ * @ordered
+ */
+ protected static final double VOLUME_DEFAULT_ = 0.0;
+
+ /**
+ * The cached value of the '{@link #getVolume() <em>Volume</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getVolume()
+ * @generated
+ * @ordered
+ */
+ protected double volume = VOLUME_DEFAULT_;
+
+ /**
+ * This is true if the Volume attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean volume_set_ = false;
+
+ /**
+ * The default value of the '{@link #getChange1() <em>Change1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getChange1()
+ * @generated
+ * @ordered
+ */
+ protected static final double CHANGE1_DEFAULT_ = 0.0;
+
+ /**
+ * The cached value of the '{@link #getChange1() <em>Change1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getChange1()
+ * @generated
+ * @ordered
+ */
+ protected double change1 = CHANGE1_DEFAULT_;
+
+ /**
+ * This is true if the Change1 attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean change1_set_ = false;
+
+ /**
+ * The cached value of the '{@link #getQuotes() <em>Quotes</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getQuotes()
+ * @generated
+ * @ordered
+ */
+
+ protected List quotes = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public QuoteImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Type getType()
+ {
+ return ((SimpleFactoryImpl)SimpleFactory.INSTANCE).getQuote();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getSymbol()
+ {
+ return symbol;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setSymbol(String newSymbol)
+ {
+ String oldSymbol = symbol;
+ symbol = newSymbol;
+ boolean oldSymbol_set_ = symbol_set_;
+ symbol_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, SYMBOL, oldSymbol, symbol, !oldSymbol_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetSymbol()
+ {
+ String oldSymbol = symbol;
+ boolean oldSymbol_set_ = symbol_set_;
+ symbol = SYMBOL_DEFAULT_;
+ symbol_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, SYMBOL, oldSymbol, SYMBOL_DEFAULT_, oldSymbol_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetSymbol()
+ {
+ return symbol_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getCompanyName()
+ {
+ return companyName;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setCompanyName(String newCompanyName)
+ {
+ String oldCompanyName = companyName;
+ companyName = newCompanyName;
+ boolean oldCompanyName_set_ = companyName_set_;
+ companyName_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, COMPANY_NAME, oldCompanyName, companyName, !oldCompanyName_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetCompanyName()
+ {
+ String oldCompanyName = companyName;
+ boolean oldCompanyName_set_ = companyName_set_;
+ companyName = COMPANY_NAME_DEFAULT_;
+ companyName_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, COMPANY_NAME, oldCompanyName, COMPANY_NAME_DEFAULT_, oldCompanyName_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetCompanyName()
+ {
+ return companyName_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public BigDecimal getPrice()
+ {
+ return price;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setPrice(BigDecimal newPrice)
+ {
+ BigDecimal oldPrice = price;
+ price = newPrice;
+ boolean oldPrice_set_ = price_set_;
+ price_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, PRICE, oldPrice, price, !oldPrice_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetPrice()
+ {
+ BigDecimal oldPrice = price;
+ boolean oldPrice_set_ = price_set_;
+ price = PRICE_DEFAULT_;
+ price_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, PRICE, oldPrice, PRICE_DEFAULT_, oldPrice_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetPrice()
+ {
+ return price_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public BigDecimal getOpen1()
+ {
+ return open1;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setOpen1(BigDecimal newOpen1)
+ {
+ BigDecimal oldOpen1 = open1;
+ open1 = newOpen1;
+ boolean oldOpen1_set_ = open1_set_;
+ open1_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, OPEN1, oldOpen1, open1, !oldOpen1_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetOpen1()
+ {
+ BigDecimal oldOpen1 = open1;
+ boolean oldOpen1_set_ = open1_set_;
+ open1 = OPEN1_DEFAULT_;
+ open1_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, OPEN1, oldOpen1, OPEN1_DEFAULT_, oldOpen1_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetOpen1()
+ {
+ return open1_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public BigDecimal getHigh()
+ {
+ return high;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setHigh(BigDecimal newHigh)
+ {
+ BigDecimal oldHigh = high;
+ high = newHigh;
+ boolean oldHigh_set_ = high_set_;
+ high_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, HIGH, oldHigh, high, !oldHigh_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetHigh()
+ {
+ BigDecimal oldHigh = high;
+ boolean oldHigh_set_ = high_set_;
+ high = HIGH_DEFAULT_;
+ high_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, HIGH, oldHigh, HIGH_DEFAULT_, oldHigh_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetHigh()
+ {
+ return high_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public BigDecimal getLow()
+ {
+ return low;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setLow(BigDecimal newLow)
+ {
+ BigDecimal oldLow = low;
+ low = newLow;
+ boolean oldLow_set_ = low_set_;
+ low_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, LOW, oldLow, low, !oldLow_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetLow()
+ {
+ BigDecimal oldLow = low;
+ boolean oldLow_set_ = low_set_;
+ low = LOW_DEFAULT_;
+ low_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, LOW, oldLow, LOW_DEFAULT_, oldLow_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetLow()
+ {
+ return low_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public double getVolume()
+ {
+ return volume;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setVolume(double newVolume)
+ {
+ double oldVolume = volume;
+ volume = newVolume;
+ boolean oldVolume_set_ = volume_set_;
+ volume_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, VOLUME, oldVolume, volume, !oldVolume_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetVolume()
+ {
+ double oldVolume = volume;
+ boolean oldVolume_set_ = volume_set_;
+ volume = VOLUME_DEFAULT_;
+ volume_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, VOLUME, oldVolume, VOLUME_DEFAULT_, oldVolume_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetVolume()
+ {
+ return volume_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public double getChange1()
+ {
+ return change1;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setChange1(double newChange1)
+ {
+ double oldChange1 = change1;
+ change1 = newChange1;
+ boolean oldChange1_set_ = change1_set_;
+ change1_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, CHANGE1, oldChange1, change1, !oldChange1_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetChange1()
+ {
+ double oldChange1 = change1;
+ boolean oldChange1_set_ = change1_set_;
+ change1 = CHANGE1_DEFAULT_;
+ change1_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, CHANGE1, oldChange1, CHANGE1_DEFAULT_, oldChange1_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetChange1()
+ {
+ return change1_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public List getQuotes()
+ {
+ if (quotes == null)
+ {
+ quotes = createPropertyList(ListKind.CONTAINMENT, Quote.class, QUOTES);
+ }
+ return quotes;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeContext inverseRemove(Object otherEnd, int propertyIndex, ChangeContext changeContext)
+ {
+ switch (propertyIndex)
+ {
+ case QUOTES:
+ return removeFromList(getQuotes(), otherEnd, changeContext);
+ }
+ return super.inverseRemove(otherEnd, propertyIndex, changeContext);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object get(int propertyIndex, boolean resolve)
+ {
+ switch (propertyIndex)
+ {
+ case SYMBOL:
+ return getSymbol();
+ case COMPANY_NAME:
+ return getCompanyName();
+ case PRICE:
+ return getPrice();
+ case OPEN1:
+ return getOpen1();
+ case HIGH:
+ return getHigh();
+ case LOW:
+ return getLow();
+ case VOLUME:
+ return new Double(getVolume());
+ case CHANGE1:
+ return new Double(getChange1());
+ case QUOTES:
+ return getQuotes();
+ }
+ return super.get(propertyIndex, resolve);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void set(int propertyIndex, Object newValue)
+ {
+ switch (propertyIndex)
+ {
+ case SYMBOL:
+ setSymbol((String)newValue);
+ return;
+ case COMPANY_NAME:
+ setCompanyName((String)newValue);
+ return;
+ case PRICE:
+ setPrice((BigDecimal)newValue);
+ return;
+ case OPEN1:
+ setOpen1((BigDecimal)newValue);
+ return;
+ case HIGH:
+ setHigh((BigDecimal)newValue);
+ return;
+ case LOW:
+ setLow((BigDecimal)newValue);
+ return;
+ case VOLUME:
+ setVolume(((Double)newValue).doubleValue());
+ return;
+ case CHANGE1:
+ setChange1(((Double)newValue).doubleValue());
+ return;
+ case QUOTES:
+ getQuotes().clear();
+ getQuotes().addAll((Collection)newValue);
+ return;
+ }
+ super.set(propertyIndex, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unset(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case SYMBOL:
+ unsetSymbol();
+ return;
+ case COMPANY_NAME:
+ unsetCompanyName();
+ return;
+ case PRICE:
+ unsetPrice();
+ return;
+ case OPEN1:
+ unsetOpen1();
+ return;
+ case HIGH:
+ unsetHigh();
+ return;
+ case LOW:
+ unsetLow();
+ return;
+ case VOLUME:
+ unsetVolume();
+ return;
+ case CHANGE1:
+ unsetChange1();
+ return;
+ case QUOTES:
+ getQuotes().clear();
+ return;
+ }
+ super.unset(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSet(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case SYMBOL:
+ return isSetSymbol();
+ case COMPANY_NAME:
+ return isSetCompanyName();
+ case PRICE:
+ return isSetPrice();
+ case OPEN1:
+ return isSetOpen1();
+ case HIGH:
+ return isSetHigh();
+ case LOW:
+ return isSetLow();
+ case VOLUME:
+ return isSetVolume();
+ case CHANGE1:
+ return isSetChange1();
+ case QUOTES:
+ return quotes != null && !quotes.isEmpty();
+ }
+ return super.isSet(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString()
+ {
+ if (isProxy(this)) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (symbol: ");
+ if (symbol_set_) result.append(symbol); else result.append("<unset>");
+ result.append(", companyName: ");
+ if (companyName_set_) result.append(companyName); else result.append("<unset>");
+ result.append(", price: ");
+ if (price_set_) result.append(price); else result.append("<unset>");
+ result.append(", open1: ");
+ if (open1_set_) result.append(open1); else result.append("<unset>");
+ result.append(", high: ");
+ if (high_set_) result.append(high); else result.append("<unset>");
+ result.append(", low: ");
+ if (low_set_) result.append(low); else result.append("<unset>");
+ result.append(", volume: ");
+ if (volume_set_) result.append(volume); else result.append("<unset>");
+ result.append(", change1: ");
+ if (change1_set_) result.append(change1); else result.append("<unset>");
+ result.append(')');
+ return result.toString();
+ }
+
+} //QuoteImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/simple/impl/SimpleFactoryImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/simple/impl/SimpleFactoryImpl.java
new file mode 100644
index 0000000000..972babf6ab
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/simple/impl/SimpleFactoryImpl.java
@@ -0,0 +1,327 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.simple.impl;
+
+import commonj.sdo.helper.HelperContext;
+import org.apache.tuscany.sdo.helper.TypeHelperImpl;
+
+import com.example.simple.*;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+
+import org.apache.tuscany.sdo.SDOFactory;
+
+import org.apache.tuscany.sdo.impl.FactoryBase;
+
+import org.apache.tuscany.sdo.model.ModelFactory;
+
+import org.apache.tuscany.sdo.model.impl.ModelFactoryImpl;
+
+import org.apache.tuscany.sdo.util.SDOUtil;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Factory</b>.
+ * Generator information:
+ * patternVersion=1.1;
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class SimpleFactoryImpl extends FactoryBase implements SimpleFactory
+{
+
+ /**
+ * The package namespace URI.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String NAMESPACE_URI = "http://www.example.com/simple";
+
+ /**
+ * The package namespace name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String NAMESPACE_PREFIX = "simple";
+
+ /**
+ * The version of the generator pattern used to generate this class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String PATTERN_VERSION = "1.1";
+
+ public static final int QUOTE = 1;
+
+ /**
+ * Creates an instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public SimpleFactoryImpl()
+ {
+ super(NAMESPACE_URI, NAMESPACE_PREFIX, "com.example.simple");
+ }
+
+ /**
+ * Registers the Factory instance so that it is available within the supplied scope.
+ * @argument scope a HelperContext instance that will make the types supported by this Factory available.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void register(HelperContext scope) {
+ if(scope == null) {
+ throw new IllegalArgumentException("Scope can not be null");
+ }
+ TypeHelperImpl th = (TypeHelperImpl)scope.getTypeHelper();
+ th.getExtendedMetaData().putPackage(NAMESPACE_URI, this);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public DataObject create(int typeNumber)
+ {
+ switch (typeNumber)
+ {
+ case QUOTE: return (DataObject)createQuote();
+ default:
+ return super.create(typeNumber);
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Quote createQuote()
+ {
+ QuoteImpl quote = new QuoteImpl();
+ return quote;
+ }
+
+ // Following creates and initializes SDO metadata for the supported types.
+ protected Type quoteType = null;
+
+ public Type getQuote()
+ {
+ return quoteType;
+ }
+
+
+ private static boolean isInited = false;
+
+ public static SimpleFactoryImpl init()
+ {
+ if (isInited) return (SimpleFactoryImpl)FactoryBase.getStaticFactory(SimpleFactoryImpl.NAMESPACE_URI);
+ SimpleFactoryImpl theSimpleFactoryImpl = new SimpleFactoryImpl();
+ isInited = true;
+
+ // Initialize simple dependencies
+ SDOUtil.registerStaticTypes(SDOFactory.class);
+ SDOUtil.registerStaticTypes(ModelFactory.class);
+
+ // Create package meta-data objects
+ theSimpleFactoryImpl.createMetaData();
+
+ // Initialize created meta-data
+ theSimpleFactoryImpl.initializeMetaData();
+
+ // Mark meta-data to indicate it can't be changed
+ //theSimpleFactoryImpl.freeze(); //FB do we need to freeze / should we freeze ????
+
+ return theSimpleFactoryImpl;
+ }
+
+ private boolean isCreated = false;
+
+ public void createMetaData()
+ {
+ if (isCreated) return;
+ isCreated = true;
+
+ // Create types and their properties
+ quoteType = createType(false, QUOTE);
+ createProperty(true, quoteType,QuoteImpl.INTERNAL_SYMBOL);
+ createProperty(true, quoteType,QuoteImpl.INTERNAL_COMPANY_NAME);
+ createProperty(true, quoteType,QuoteImpl.INTERNAL_PRICE);
+ createProperty(true, quoteType,QuoteImpl.INTERNAL_OPEN1);
+ createProperty(true, quoteType,QuoteImpl.INTERNAL_HIGH);
+ createProperty(true, quoteType,QuoteImpl.INTERNAL_LOW);
+ createProperty(true, quoteType,QuoteImpl.INTERNAL_VOLUME);
+ createProperty(true, quoteType,QuoteImpl.INTERNAL_CHANGE1);
+ createProperty(false, quoteType,QuoteImpl.INTERNAL_QUOTES);
+ }
+
+ private boolean isInitialized = false;
+
+ public void initializeMetaData()
+ {
+ if (isInitialized) return;
+ isInitialized = true;
+
+ // Obtain other dependent packages
+ ModelFactoryImpl theModelPackageImpl = (ModelFactoryImpl)FactoryBase.getStaticFactory(ModelFactoryImpl.NAMESPACE_URI);
+ Property property = null;
+
+ // Add supertypes to types
+
+ // Initialize types and properties
+ initializeType(quoteType, Quote.class, "Quote", false);
+ property = getProperty(quoteType, QuoteImpl.INTERNAL_SYMBOL);
+ initializeProperty(property, theModelPackageImpl.getString(), "symbol", null, 1, 1, Quote.class, false, true, false);
+
+ property = getProperty(quoteType, QuoteImpl.INTERNAL_COMPANY_NAME);
+ initializeProperty(property, theModelPackageImpl.getString(), "companyName", null, 1, 1, Quote.class, false, true, false);
+
+ property = getProperty(quoteType, QuoteImpl.INTERNAL_PRICE);
+ initializeProperty(property, theModelPackageImpl.getDecimal(), "price", null, 1, 1, Quote.class, false, true, false);
+
+ property = getProperty(quoteType, QuoteImpl.INTERNAL_OPEN1);
+ initializeProperty(property, theModelPackageImpl.getDecimal(), "open1", null, 1, 1, Quote.class, false, true, false);
+
+ property = getProperty(quoteType, QuoteImpl.INTERNAL_HIGH);
+ initializeProperty(property, theModelPackageImpl.getDecimal(), "high", null, 1, 1, Quote.class, false, true, false);
+
+ property = getProperty(quoteType, QuoteImpl.INTERNAL_LOW);
+ initializeProperty(property, theModelPackageImpl.getDecimal(), "low", null, 1, 1, Quote.class, false, true, false);
+
+ property = getProperty(quoteType, QuoteImpl.INTERNAL_VOLUME);
+ initializeProperty(property, theModelPackageImpl.getDouble(), "volume", null, 1, 1, Quote.class, false, true, false);
+
+ property = getProperty(quoteType, QuoteImpl.INTERNAL_CHANGE1);
+ initializeProperty(property, theModelPackageImpl.getDouble(), "change1", null, 1, 1, Quote.class, false, true, false);
+
+ property = getProperty(quoteType, QuoteImpl.INTERNAL_QUOTES);
+ initializeProperty(property, this.getQuote(), "quotes", null, 0, -1, Quote.class, false, false, false, true , null);
+
+ createXSDMetaData(theModelPackageImpl);
+ }
+
+ protected void createXSDMetaData(ModelFactoryImpl theModelPackageImpl)
+ {
+ super.initXSD();
+
+ Property property = null;
+
+
+ property = createGlobalProperty
+ ("stockQuote",
+ this.getQuote(),
+ new String[]
+ {
+ "kind", "element",
+ "name", "stockQuote",
+ "namespace", "##targetNamespace"
+ });
+
+ addXSDMapping
+ (quoteType,
+ new String[]
+ {
+ "name", "Quote",
+ "kind", "elementOnly"
+ });
+
+ addXSDMapping
+ (getProperty(quoteType, QuoteImpl.INTERNAL_SYMBOL),
+ new String[]
+ {
+ "kind", "element",
+ "name", "symbol"
+ });
+
+ addXSDMapping
+ (getProperty(quoteType, QuoteImpl.INTERNAL_COMPANY_NAME),
+ new String[]
+ {
+ "kind", "element",
+ "name", "companyName"
+ });
+
+ addXSDMapping
+ (getProperty(quoteType, QuoteImpl.INTERNAL_PRICE),
+ new String[]
+ {
+ "kind", "element",
+ "name", "price"
+ });
+
+ addXSDMapping
+ (getProperty(quoteType, QuoteImpl.INTERNAL_OPEN1),
+ new String[]
+ {
+ "kind", "element",
+ "name", "open1"
+ });
+
+ addXSDMapping
+ (getProperty(quoteType, QuoteImpl.INTERNAL_HIGH),
+ new String[]
+ {
+ "kind", "element",
+ "name", "high"
+ });
+
+ addXSDMapping
+ (getProperty(quoteType, QuoteImpl.INTERNAL_LOW),
+ new String[]
+ {
+ "kind", "element",
+ "name", "low"
+ });
+
+ addXSDMapping
+ (getProperty(quoteType, QuoteImpl.INTERNAL_VOLUME),
+ new String[]
+ {
+ "kind", "element",
+ "name", "volume"
+ });
+
+ addXSDMapping
+ (getProperty(quoteType, QuoteImpl.INTERNAL_CHANGE1),
+ new String[]
+ {
+ "kind", "element",
+ "name", "change1"
+ });
+
+ addXSDMapping
+ (getProperty(quoteType, QuoteImpl.INTERNAL_QUOTES),
+ new String[]
+ {
+ "kind", "element",
+ "name", "quotes"
+ });
+
+ }
+
+} //SimpleFactoryImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/subgroup/A.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/subgroup/A.java
new file mode 100644
index 0000000000..2e5f28e00e
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/subgroup/A.java
@@ -0,0 +1,108 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.subgroup;
+
+import commonj.sdo.Sequence;
+
+import java.io.Serializable;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>A</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link com.example.subgroup.A#getGe1Group <em>Ge1 Group</em>}</li>
+ * <li>{@link com.example.subgroup.A#getGe1 <em>Ge1</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @extends Serializable
+ * @generated
+ */
+public interface A extends Serializable
+{
+ /**
+ * Returns the value of the '<em><b>Ge1 Group</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Ge1 Group</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Ge1 Group</em>' attribute list.
+ * @generated
+ */
+ Sequence getGe1Group();
+
+ /**
+ * Returns the value of the '<em><b>Ge1</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Ge1</em>' containment reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Ge1</em>' containment reference.
+ * @see #isSetGe1()
+ * @see #unsetGe1()
+ * @see #setGe1(B)
+ * @generated
+ */
+ B getGe1();
+
+ /**
+ * Sets the value of the '{@link com.example.subgroup.A#getGe1 <em>Ge1</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Ge1</em>' containment reference.
+ * @see #isSetGe1()
+ * @see #unsetGe1()
+ * @see #getGe1()
+ * @generated
+ */
+ void setGe1(B value);
+
+ /**
+ * Unsets the value of the '{@link com.example.subgroup.A#getGe1 <em>Ge1</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetGe1()
+ * @see #getGe1()
+ * @see #setGe1(B)
+ * @generated
+ */
+ void unsetGe1();
+
+ /**
+ * Returns whether the value of the '{@link com.example.subgroup.A#getGe1 <em>Ge1</em>}' containment reference is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Ge1</em>' containment reference is set.
+ * @see #unsetGe1()
+ * @see #getGe1()
+ * @see #setGe1(B)
+ * @generated
+ */
+ boolean isSetGe1();
+
+} // A
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/subgroup/B.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/subgroup/B.java
new file mode 100644
index 0000000000..e306049ecb
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/subgroup/B.java
@@ -0,0 +1,92 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.subgroup;
+
+import java.io.Serializable;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>B</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link com.example.subgroup.B#getImInTypeB <em>Im In Type B</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @extends Serializable
+ * @generated
+ */
+public interface B extends Serializable
+{
+ /**
+ * Returns the value of the '<em><b>Im In Type B</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Im In Type B</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Im In Type B</em>' attribute.
+ * @see #isSetImInTypeB()
+ * @see #unsetImInTypeB()
+ * @see #setImInTypeB(String)
+ * @generated
+ */
+ String getImInTypeB();
+
+ /**
+ * Sets the value of the '{@link com.example.subgroup.B#getImInTypeB <em>Im In Type B</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Im In Type B</em>' attribute.
+ * @see #isSetImInTypeB()
+ * @see #unsetImInTypeB()
+ * @see #getImInTypeB()
+ * @generated
+ */
+ void setImInTypeB(String value);
+
+ /**
+ * Unsets the value of the '{@link com.example.subgroup.B#getImInTypeB <em>Im In Type B</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetImInTypeB()
+ * @see #getImInTypeB()
+ * @see #setImInTypeB(String)
+ * @generated
+ */
+ void unsetImInTypeB();
+
+ /**
+ * Returns whether the value of the '{@link com.example.subgroup.B#getImInTypeB <em>Im In Type B</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Im In Type B</em>' attribute is set.
+ * @see #unsetImInTypeB()
+ * @see #getImInTypeB()
+ * @see #setImInTypeB(String)
+ * @generated
+ */
+ boolean isSetImInTypeB();
+
+} // B
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/subgroup/Bprime.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/subgroup/Bprime.java
new file mode 100644
index 0000000000..ef7bac01c8
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/subgroup/Bprime.java
@@ -0,0 +1,90 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.subgroup;
+
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Bprime</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link com.example.subgroup.Bprime#getImInTypeBprime <em>Im In Type Bprime</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public interface Bprime extends B
+{
+ /**
+ * Returns the value of the '<em><b>Im In Type Bprime</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Im In Type Bprime</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Im In Type Bprime</em>' attribute.
+ * @see #isSetImInTypeBprime()
+ * @see #unsetImInTypeBprime()
+ * @see #setImInTypeBprime(String)
+ * @generated
+ */
+ String getImInTypeBprime();
+
+ /**
+ * Sets the value of the '{@link com.example.subgroup.Bprime#getImInTypeBprime <em>Im In Type Bprime</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Im In Type Bprime</em>' attribute.
+ * @see #isSetImInTypeBprime()
+ * @see #unsetImInTypeBprime()
+ * @see #getImInTypeBprime()
+ * @generated
+ */
+ void setImInTypeBprime(String value);
+
+ /**
+ * Unsets the value of the '{@link com.example.subgroup.Bprime#getImInTypeBprime <em>Im In Type Bprime</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetImInTypeBprime()
+ * @see #getImInTypeBprime()
+ * @see #setImInTypeBprime(String)
+ * @generated
+ */
+ void unsetImInTypeBprime();
+
+ /**
+ * Returns whether the value of the '{@link com.example.subgroup.Bprime#getImInTypeBprime <em>Im In Type Bprime</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Im In Type Bprime</em>' attribute is set.
+ * @see #unsetImInTypeBprime()
+ * @see #getImInTypeBprime()
+ * @see #setImInTypeBprime(String)
+ * @generated
+ */
+ boolean isSetImInTypeBprime();
+
+} // Bprime
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/subgroup/SubgroupFactory.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/subgroup/SubgroupFactory.java
new file mode 100644
index 0000000000..b5157b21df
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/subgroup/SubgroupFactory.java
@@ -0,0 +1,80 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package com.example.subgroup;
+
+import commonj.sdo.helper.HelperContext;
+
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Factory</b> for the model.
+ * It provides a create method for each non-abstract class of the model.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public interface SubgroupFactory
+{
+
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ SubgroupFactory INSTANCE = com.example.subgroup.impl.SubgroupFactoryImpl.init();
+
+ /**
+ * Returns a new object of class '<em>A</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>A</em>'.
+ * @generated
+ */
+ A createA();
+
+ /**
+ * Returns a new object of class '<em>B</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>B</em>'.
+ * @generated
+ */
+ B createB();
+
+ /**
+ * Returns a new object of class '<em>Bprime</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Bprime</em>'.
+ * @generated
+ */
+ Bprime createBprime();
+
+ /**
+ * Registers the types supported by this Factory within the supplied scope.argument
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param scope an instance of HelperContext used to manage the scoping of types.
+ * @generated
+ */
+ public void register(HelperContext scope);
+
+} //SubgroupFactory
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/subgroup/impl/AImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/subgroup/impl/AImpl.java
new file mode 100644
index 0000000000..4fb06e51c2
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/subgroup/impl/AImpl.java
@@ -0,0 +1,310 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.subgroup.impl;
+
+import com.example.subgroup.A;
+import com.example.subgroup.B;
+import com.example.subgroup.SubgroupFactory;
+
+import commonj.sdo.Sequence;
+import commonj.sdo.Type;
+
+import org.apache.tuscany.sdo.impl.DataObjectBase;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>A</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link com.example.subgroup.impl.AImpl#getGe1Group <em>Ge1 Group</em>}</li>
+ * <li>{@link com.example.subgroup.impl.AImpl#getGe1 <em>Ge1</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class AImpl extends DataObjectBase implements A
+{
+
+ public final static int GE1_GROUP = -1;
+
+ public final static int GE1 = 0;
+
+ public final static int SDO_PROPERTY_COUNT = 1;
+
+ public final static int EXTENDED_PROPERTY_COUNT = -1;
+
+
+ /**
+ * The internal feature id for the '<em><b>Ge1 Group</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_GE1_GROUP = 0;
+
+ /**
+ * The internal feature id for the '<em><b>Ge1</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_GE1 = 1;
+
+ /**
+ * The number of properties for this type.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_PROPERTY_COUNT = 2;
+
+ protected int internalConvertIndex(int internalIndex)
+ {
+ switch (internalIndex)
+ {
+ case INTERNAL_GE1_GROUP: return GE1_GROUP;
+ case INTERNAL_GE1: return GE1;
+ }
+ return super.internalConvertIndex(internalIndex);
+ }
+
+
+ /**
+ * The cached value of the '{@link #getGe1Group() <em>Ge1 Group</em>}' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getGe1Group()
+ * @generated
+ * @ordered
+ */
+
+ protected Sequence ge1Group = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public AImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Type getType()
+ {
+ return ((SubgroupFactoryImpl)SubgroupFactory.INSTANCE).getA();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Sequence getGe1Group()
+ {
+ if (ge1Group == null)
+ {
+ ge1Group = createSequence(INTERNAL_GE1_GROUP);
+ }
+ return ge1Group;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public B getGe1()
+ {
+ return (B)get(getGe1Group(), getType(), INTERNAL_GE1);
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeContext basicSetGe1(B newGe1, ChangeContext changeContext)
+ {
+ return basicAdd(getGe1Group(), getType(), GE1, newGe1, changeContext);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setGe1(B newGe1)
+ {
+ set(getGe1Group(), getType(), INTERNAL_GE1, newGe1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeContext basicUnsetGe1(ChangeContext changeContext)
+ {
+ // TODO: implement this method to unset the contained 'Ge1' containment reference
+ // -> this method is automatically invoked to keep the containment relationship in synch
+ // -> do not modify other features
+ // -> return changeContext, after adding any generated Notification to it (if it is null, a NotificationChain object must be created first)
+ // Ensure that you remove @generated or mark it @generated NOT
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetGe1()
+ {
+ unset(getGe1Group(), getType(), GE1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetGe1()
+ {
+ return isSet(getGe1Group(), getType(), GE1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeContext inverseRemove(Object otherEnd, int propertyIndex, ChangeContext changeContext)
+ {
+ switch (propertyIndex)
+ {
+ case GE1_GROUP:
+ return removeFromSequence(getGe1Group(), otherEnd, changeContext);
+ case GE1:
+ return basicUnsetGe1(changeContext);
+ }
+ return super.inverseRemove(otherEnd, propertyIndex, changeContext);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object get(int propertyIndex, boolean resolve)
+ {
+ switch (propertyIndex)
+ {
+ case GE1_GROUP:
+ // XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view
+ //if (coreType)
+ return getGe1Group();
+ case GE1:
+ return getGe1();
+ }
+ return super.get(propertyIndex, resolve);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void set(int propertyIndex, Object newValue)
+ {
+ switch (propertyIndex)
+ {
+ case GE1_GROUP:
+ setSequence(getGe1Group(), newValue);
+ return;
+ case GE1:
+ setGe1((B)newValue);
+ return;
+ }
+ super.set(propertyIndex, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unset(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case GE1_GROUP:
+ unsetSequence(getGe1Group());
+ return;
+ case GE1:
+ unsetGe1();
+ return;
+ }
+ super.unset(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSet(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case GE1_GROUP:
+ return ge1Group != null && !isSequenceEmpty(getGe1Group());
+ case GE1:
+ return isSetGe1();
+ }
+ return super.isSet(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString()
+ {
+ if (isProxy(this)) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (ge1Group: ");
+ result.append(ge1Group);
+ result.append(')');
+ return result.toString();
+ }
+
+} //AImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/subgroup/impl/BImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/subgroup/impl/BImpl.java
new file mode 100644
index 0000000000..e15776ecc0
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/subgroup/impl/BImpl.java
@@ -0,0 +1,256 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.subgroup.impl;
+
+import com.example.subgroup.B;
+import com.example.subgroup.SubgroupFactory;
+
+import commonj.sdo.Type;
+
+import org.apache.tuscany.sdo.impl.DataObjectBase;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>B</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link com.example.subgroup.impl.BImpl#getImInTypeB <em>Im In Type B</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class BImpl extends DataObjectBase implements B
+{
+
+ public final static int IM_IN_TYPE_B = 0;
+
+ public final static int SDO_PROPERTY_COUNT = 1;
+
+ public final static int EXTENDED_PROPERTY_COUNT = 0;
+
+
+ /**
+ * The internal feature id for the '<em><b>Im In Type B</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_IM_IN_TYPE_B = 0;
+
+ /**
+ * The number of properties for this type.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_PROPERTY_COUNT = 1;
+
+ protected int internalConvertIndex(int internalIndex)
+ {
+ switch (internalIndex)
+ {
+ case INTERNAL_IM_IN_TYPE_B: return IM_IN_TYPE_B;
+ }
+ return super.internalConvertIndex(internalIndex);
+ }
+
+
+ /**
+ * The default value of the '{@link #getImInTypeB() <em>Im In Type B</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getImInTypeB()
+ * @generated
+ * @ordered
+ */
+ protected static final String IM_IN_TYPE_B_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getImInTypeB() <em>Im In Type B</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getImInTypeB()
+ * @generated
+ * @ordered
+ */
+ protected String imInTypeB = IM_IN_TYPE_B_DEFAULT_;
+
+ /**
+ * This is true if the Im In Type B attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean imInTypeB_set_ = false;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public BImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Type getType()
+ {
+ return ((SubgroupFactoryImpl)SubgroupFactory.INSTANCE).getB();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getImInTypeB()
+ {
+ return imInTypeB;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setImInTypeB(String newImInTypeB)
+ {
+ String oldImInTypeB = imInTypeB;
+ imInTypeB = newImInTypeB;
+ boolean oldImInTypeB_set_ = imInTypeB_set_;
+ imInTypeB_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, IM_IN_TYPE_B, oldImInTypeB, imInTypeB, !oldImInTypeB_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetImInTypeB()
+ {
+ String oldImInTypeB = imInTypeB;
+ boolean oldImInTypeB_set_ = imInTypeB_set_;
+ imInTypeB = IM_IN_TYPE_B_DEFAULT_;
+ imInTypeB_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, IM_IN_TYPE_B, oldImInTypeB, IM_IN_TYPE_B_DEFAULT_, oldImInTypeB_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetImInTypeB()
+ {
+ return imInTypeB_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object get(int propertyIndex, boolean resolve)
+ {
+ switch (propertyIndex)
+ {
+ case IM_IN_TYPE_B:
+ return getImInTypeB();
+ }
+ return super.get(propertyIndex, resolve);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void set(int propertyIndex, Object newValue)
+ {
+ switch (propertyIndex)
+ {
+ case IM_IN_TYPE_B:
+ setImInTypeB((String)newValue);
+ return;
+ }
+ super.set(propertyIndex, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unset(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case IM_IN_TYPE_B:
+ unsetImInTypeB();
+ return;
+ }
+ super.unset(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSet(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case IM_IN_TYPE_B:
+ return isSetImInTypeB();
+ }
+ return super.isSet(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString()
+ {
+ if (isProxy(this)) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (imInTypeB: ");
+ if (imInTypeB_set_) result.append(imInTypeB); else result.append("<unset>");
+ result.append(')');
+ return result.toString();
+ }
+
+} //BImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/subgroup/impl/BprimeImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/subgroup/impl/BprimeImpl.java
new file mode 100644
index 0000000000..4ea390e6fc
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/subgroup/impl/BprimeImpl.java
@@ -0,0 +1,264 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.subgroup.impl;
+
+import com.example.subgroup.Bprime;
+import com.example.subgroup.SubgroupFactory;
+
+import commonj.sdo.Type;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Bprime</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link com.example.subgroup.impl.BprimeImpl#getImInTypeBprime <em>Im In Type Bprime</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class BprimeImpl extends BImpl implements Bprime
+{
+
+ public final static int IM_IN_TYPE_BPRIME = BImpl.SDO_PROPERTY_COUNT + 0;
+
+ public final static int SDO_PROPERTY_COUNT = BImpl.SDO_PROPERTY_COUNT + 1;
+
+ public final static int EXTENDED_PROPERTY_COUNT = BImpl.EXTENDED_PROPERTY_COUNT - 0;
+
+
+ /**
+ * The internal feature id for the '<em><b>Im In Type B</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_IM_IN_TYPE_B = BImpl.IM_IN_TYPE_B;
+
+ /**
+ * The internal feature id for the '<em><b>Im In Type Bprime</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_IM_IN_TYPE_BPRIME = BImpl.INTERNAL_PROPERTY_COUNT + 0;
+
+ /**
+ * The number of properties for this type.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_PROPERTY_COUNT = BImpl.INTERNAL_PROPERTY_COUNT + 1;
+
+ protected int internalConvertIndex(int internalIndex)
+ {
+ switch (internalIndex)
+ {
+ case INTERNAL_IM_IN_TYPE_B: return IM_IN_TYPE_B;
+ case INTERNAL_IM_IN_TYPE_BPRIME: return IM_IN_TYPE_BPRIME;
+ }
+ return super.internalConvertIndex(internalIndex);
+ }
+
+
+ /**
+ * The default value of the '{@link #getImInTypeBprime() <em>Im In Type Bprime</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getImInTypeBprime()
+ * @generated
+ * @ordered
+ */
+ protected static final String IM_IN_TYPE_BPRIME_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getImInTypeBprime() <em>Im In Type Bprime</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getImInTypeBprime()
+ * @generated
+ * @ordered
+ */
+ protected String imInTypeBprime = IM_IN_TYPE_BPRIME_DEFAULT_;
+
+ /**
+ * This is true if the Im In Type Bprime attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean imInTypeBprime_set_ = false;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public BprimeImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Type getType()
+ {
+ return ((SubgroupFactoryImpl)SubgroupFactory.INSTANCE).getBprime();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getImInTypeBprime()
+ {
+ return imInTypeBprime;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setImInTypeBprime(String newImInTypeBprime)
+ {
+ String oldImInTypeBprime = imInTypeBprime;
+ imInTypeBprime = newImInTypeBprime;
+ boolean oldImInTypeBprime_set_ = imInTypeBprime_set_;
+ imInTypeBprime_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, IM_IN_TYPE_BPRIME, oldImInTypeBprime, imInTypeBprime, !oldImInTypeBprime_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetImInTypeBprime()
+ {
+ String oldImInTypeBprime = imInTypeBprime;
+ boolean oldImInTypeBprime_set_ = imInTypeBprime_set_;
+ imInTypeBprime = IM_IN_TYPE_BPRIME_DEFAULT_;
+ imInTypeBprime_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, IM_IN_TYPE_BPRIME, oldImInTypeBprime, IM_IN_TYPE_BPRIME_DEFAULT_, oldImInTypeBprime_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetImInTypeBprime()
+ {
+ return imInTypeBprime_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object get(int propertyIndex, boolean resolve)
+ {
+ switch (propertyIndex)
+ {
+ case IM_IN_TYPE_BPRIME:
+ return getImInTypeBprime();
+ }
+ return super.get(propertyIndex, resolve);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void set(int propertyIndex, Object newValue)
+ {
+ switch (propertyIndex)
+ {
+ case IM_IN_TYPE_BPRIME:
+ setImInTypeBprime((String)newValue);
+ return;
+ }
+ super.set(propertyIndex, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unset(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case IM_IN_TYPE_BPRIME:
+ unsetImInTypeBprime();
+ return;
+ }
+ super.unset(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSet(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case IM_IN_TYPE_BPRIME:
+ return isSetImInTypeBprime();
+ }
+ return super.isSet(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString()
+ {
+ if (isProxy(this)) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (imInTypeBprime: ");
+ if (imInTypeBprime_set_) result.append(imInTypeBprime); else result.append("<unset>");
+ result.append(')');
+ return result.toString();
+ }
+
+} //BprimeImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/subgroup/impl/SubgroupFactoryImpl.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/subgroup/impl/SubgroupFactoryImpl.java
new file mode 100644
index 0000000000..26670e6221
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/com/example/subgroup/impl/SubgroupFactoryImpl.java
@@ -0,0 +1,352 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.subgroup.impl;
+
+import commonj.sdo.helper.HelperContext;
+import org.apache.tuscany.sdo.helper.TypeHelperImpl;
+
+import com.example.subgroup.*;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+
+import org.apache.tuscany.sdo.SDOFactory;
+
+import org.apache.tuscany.sdo.impl.FactoryBase;
+
+import org.apache.tuscany.sdo.model.ModelFactory;
+
+import org.apache.tuscany.sdo.model.impl.ModelFactoryImpl;
+
+import org.apache.tuscany.sdo.util.SDOUtil;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Factory</b>.
+ * Generator information:
+ * patternVersion=1.1; -prefix Subgroup
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class SubgroupFactoryImpl extends FactoryBase implements SubgroupFactory
+{
+
+ /**
+ * The package namespace URI.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String NAMESPACE_URI = "http://example.com/subgroup";
+
+ /**
+ * The package namespace name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String NAMESPACE_PREFIX = "sg";
+
+ /**
+ * The version of the generator pattern used to generate this class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String PATTERN_VERSION = "1.1";
+
+ public static final int A = 1;
+ public static final int B = 2;
+ public static final int BPRIME = 3;
+
+ /**
+ * Creates an instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public SubgroupFactoryImpl()
+ {
+ super(NAMESPACE_URI, NAMESPACE_PREFIX, "com.example.subgroup");
+ }
+
+ /**
+ * Registers the Factory instance so that it is available within the supplied scope.
+ * @argument scope a HelperContext instance that will make the types supported by this Factory available.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void register(HelperContext scope) {
+ if(scope == null) {
+ throw new IllegalArgumentException("Scope can not be null");
+ }
+ TypeHelperImpl th = (TypeHelperImpl)scope.getTypeHelper();
+ th.getExtendedMetaData().putPackage(NAMESPACE_URI, this);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public DataObject create(int typeNumber)
+ {
+ switch (typeNumber)
+ {
+ case A: return (DataObject)createA();
+ case B: return (DataObject)createB();
+ case BPRIME: return (DataObject)createBprime();
+ default:
+ return super.create(typeNumber);
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public A createA()
+ {
+ AImpl a = new AImpl();
+ return a;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public B createB()
+ {
+ BImpl b = new BImpl();
+ return b;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Bprime createBprime()
+ {
+ BprimeImpl bprime = new BprimeImpl();
+ return bprime;
+ }
+
+ // Following creates and initializes SDO metadata for the supported types.
+ protected Type aType = null;
+
+ public Type getA()
+ {
+ return aType;
+ }
+
+ protected Type bType = null;
+
+ public Type getB()
+ {
+ return bType;
+ }
+
+ protected Type bprimeType = null;
+
+ public Type getBprime()
+ {
+ return bprimeType;
+ }
+
+
+ private static boolean isInited = false;
+
+ public static SubgroupFactoryImpl init()
+ {
+ if (isInited) return (SubgroupFactoryImpl)FactoryBase.getStaticFactory(SubgroupFactoryImpl.NAMESPACE_URI);
+ SubgroupFactoryImpl theSubgroupFactoryImpl = new SubgroupFactoryImpl();
+ isInited = true;
+
+ // Initialize simple dependencies
+ SDOUtil.registerStaticTypes(SDOFactory.class);
+ SDOUtil.registerStaticTypes(ModelFactory.class);
+
+ // Create package meta-data objects
+ theSubgroupFactoryImpl.createMetaData();
+
+ // Initialize created meta-data
+ theSubgroupFactoryImpl.initializeMetaData();
+
+ // Mark meta-data to indicate it can't be changed
+ //theSubgroupFactoryImpl.freeze(); //FB do we need to freeze / should we freeze ????
+
+ return theSubgroupFactoryImpl;
+ }
+
+ private boolean isCreated = false;
+
+ public void createMetaData()
+ {
+ if (isCreated) return;
+ isCreated = true;
+
+ // Create types and their properties
+ aType = createType(false, A);
+ createProperty(true, aType,AImpl.INTERNAL_GE1_GROUP);
+ createProperty(false, aType,AImpl.INTERNAL_GE1);
+ bType = createType(false, B);
+ createProperty(true, bType,BImpl.INTERNAL_IM_IN_TYPE_B);
+ bprimeType = createType(false, BPRIME);
+ createProperty(true, bprimeType,BprimeImpl.INTERNAL_IM_IN_TYPE_BPRIME);
+ }
+
+ private boolean isInitialized = false;
+
+ public void initializeMetaData()
+ {
+ if (isInitialized) return;
+ isInitialized = true;
+
+ // Obtain other dependent packages
+ ModelFactoryImpl theModelPackageImpl = (ModelFactoryImpl)FactoryBase.getStaticFactory(ModelFactoryImpl.NAMESPACE_URI);
+ Property property = null;
+
+ // Add supertypes to types
+ addSuperType(bprimeType, bType);
+
+ // Initialize types and properties
+ initializeType(aType, A.class, "A", false);
+ property = getProperty(aType, AImpl.INTERNAL_GE1_GROUP);
+ initializeProperty(property, getSequence(), "ge1Group", null, 1, 1, A.class, false, false, false);
+
+ property = getProperty(aType, AImpl.INTERNAL_GE1);
+ initializeProperty(property, this.getB(), "ge1", null, 1, 1, A.class, false, true, true, true , null);
+
+ initializeType(bType, B.class, "B", false);
+ property = getProperty(bType, BImpl.INTERNAL_IM_IN_TYPE_B);
+ initializeProperty(property, theModelPackageImpl.getString(), "imInTypeB", null, 1, 1, B.class, false, true, false);
+
+ initializeType(bprimeType, Bprime.class, "Bprime", false);
+ property = getProperty(bprimeType, BprimeImpl.INTERNAL_IM_IN_TYPE_BPRIME);
+ initializeProperty(property, theModelPackageImpl.getString(), "imInTypeBprime", null, 1, 1, Bprime.class, false, true, false);
+
+ createXSDMetaData(theModelPackageImpl);
+ }
+
+ protected void createXSDMetaData(ModelFactoryImpl theModelPackageImpl)
+ {
+ super.initXSD();
+
+ Property property = null;
+
+
+ addXSDMapping
+ (aType,
+ new String[]
+ {
+ "name", "A",
+ "kind", "elementOnly"
+ });
+
+ addXSDMapping
+ (getProperty(aType, AImpl.INTERNAL_GE1_GROUP),
+ new String[]
+ {
+ "kind", "group",
+ "name", "ge1:group",
+ "namespace", "##targetNamespace"
+ });
+
+ addXSDMapping
+ (getProperty(aType, AImpl.INTERNAL_GE1),
+ new String[]
+ {
+ "kind", "element",
+ "name", "ge1",
+ "namespace", "##targetNamespace",
+ "group", "ge1:group"
+ });
+
+ addXSDMapping
+ (bType,
+ new String[]
+ {
+ "name", "B",
+ "kind", "elementOnly"
+ });
+
+ addXSDMapping
+ (getProperty(bType, BImpl.INTERNAL_IM_IN_TYPE_B),
+ new String[]
+ {
+ "kind", "element",
+ "name", "imInTypeB",
+ "namespace", "##targetNamespace"
+ });
+
+ addXSDMapping
+ (bprimeType,
+ new String[]
+ {
+ "name", "Bprime",
+ "kind", "elementOnly"
+ });
+
+ addXSDMapping
+ (getProperty(bprimeType, BprimeImpl.INTERNAL_IM_IN_TYPE_BPRIME),
+ new String[]
+ {
+ "kind", "element",
+ "name", "imInTypeBprime",
+ "namespace", "##targetNamespace"
+ });
+
+ property = createGlobalProperty
+ ("a",
+ this.getA(),
+ new String[]
+ {
+ "kind", "element",
+ "name", "a",
+ "namespace", "##targetNamespace"
+ });
+
+ property = createGlobalProperty
+ ("ge1",
+ this.getB(),
+ new String[]
+ {
+ "kind", "element",
+ "name", "ge1",
+ "namespace", "##targetNamespace"
+ });
+
+ property = createGlobalProperty
+ ("se1",
+ this.getBprime(),
+ new String[]
+ {
+ "kind", "element",
+ "name", "se1",
+ "namespace", "##targetNamespace",
+ "affiliation", "ge1"
+ });
+
+ }
+
+} //SubgroupFactoryImpl
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/AllTests.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/AllTests.java
new file mode 100644
index 0000000000..3e41d1cde6
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/AllTests.java
@@ -0,0 +1,49 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sdo.test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+public class AllTests extends TestCase {
+
+
+ public static TestSuite suite() {
+
+ TestSuite suite = new TestSuite();
+
+ suite.addTestSuite(ChangeSummaryGenTestCase.class);
+ suite.addTestSuite(GenPatternsTestCase.class);
+ suite.addTestSuite(InheritanceTestCase.class);
+ suite.addTestSuite(SimpleStaticTestCase.class);
+
+ return suite;
+ }
+
+
+
+ /**
+ * Runs the test suite using the textual runner.
+ */
+ public static void main(String[] args) {
+ junit.textui.TestRunner.run(suite());
+ }
+}
+
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/ChangeSummaryGenTestCase.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/ChangeSummaryGenTestCase.java
new file mode 100644
index 0000000000..a2bce3c0a7
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/ChangeSummaryGenTestCase.java
@@ -0,0 +1,71 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.tuscany.sdo.test;
+
+
+import java.io.IOException;
+import java.math.BigDecimal;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import com.example.simple.cs.CSFactory;
+import com.example.simple.cs.Quote;
+import com.example.simple.cs.QuoteBase;
+import commonj.sdo.ChangeSummary;
+import commonj.sdo.DataObject;
+
+
+public class ChangeSummaryGenTestCase extends TestCase {
+
+ public void testMixedQuoteType() throws IOException {
+ QuoteBase quote = CSFactory.INSTANCE.createQuoteBase();
+ DataObject dQuote = (DataObject)quote;
+
+ // ChangeSummary csp = quote.getChanges();
+ ChangeSummary cs = dQuote.getChangeSummary();
+ ChangeSummary csp = quote.getChanges();
+ cs.beginLogging();
+
+ assertSame(cs, csp);
+
+ quote.setSymbol("fbnt");
+ quote.setCompanyName("FlyByNightTechnology");
+ quote.setPrice(new BigDecimal("1000.0"));
+ quote.setOpen1(new BigDecimal("1000.0"));
+ quote.setHigh(new BigDecimal("1000.0"));
+ quote.setLow(new BigDecimal("1000.0"));
+ quote.setVolume(1000);
+ quote.setChange1(1000);
+
+ List quotes = quote.getQuotes();
+ Quote innerQuote = CSFactory.INSTANCE.createQuote();
+
+ quotes.add(innerQuote);
+ innerQuote.setPrice(new BigDecimal("2000.0"));
+
+ cs.endLogging();
+
+ //XMLHelper.INSTANCE.save(dQuote, "http://www.example.com/simpleCS", "quoteBase", System.out);
+
+ cs.undoChanges();
+
+ //System.out.println("\nAfter Undo Changes:");
+ //XMLHelper.INSTANCE.save(dQuote, "http://www.example.com/simpleCS", "quoteBase", System.out);
+ }
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/CreateTestClasses.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/CreateTestClasses.java
new file mode 100644
index 0000000000..92fef99006
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/CreateTestClasses.java
@@ -0,0 +1,46 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.test;
+
+import org.apache.tuscany.sdo.generate.XSD2JavaGenerator;
+
+/**
+ * A utility class to regenerate the classes for the test cases
+ */
+public class CreateTestClasses {
+
+ /**
+ * @param args
+ */
+ public static void main(String[] args) {
+
+ CreateTestClasses ctc = new CreateTestClasses();
+ ctc.run();
+
+
+ }
+
+ private void run() {
+
+ XSD2JavaGenerator.generateFromXMLSchema(getClass().getResource("/simpleWithChangeSummary.xsd").getFile(), "http://www.example.com/simpleCS", "src/test/java/", "org.example.simple.cs", "CS", 0);
+
+ }
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/GenPatternsTestCase.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/GenPatternsTestCase.java
new file mode 100644
index 0000000000..19fbc7b10e
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/GenPatternsTestCase.java
@@ -0,0 +1,115 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.test;
+
+import java.math.BigDecimal;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sdo.util.SDOUtil;
+
+import com.example.simple.SimpleFactory;
+import commonj.sdo.helper.HelperContext;
+
+
+public class GenPatternsTestCase extends TestCase
+{
+ /**
+ * Simple Default Generation Pattern Static SDO 2.1 test.
+ */
+ public void testSimpleDefaultGeneratedClasses()
+ {
+ try
+ {
+ HelperContext scope = SDOUtil.createHelperContext();
+ com.example.simple.SimpleFactory.INSTANCE.register(scope);
+
+ com.example.simple.Quote quote =
+ (com.example.simple.Quote)scope.getDataFactory().create(com.example.simple.Quote.class);
+
+ quote.setSymbol("fbnt");
+ quote.setCompanyName("FlyByNightTechnology");
+ quote.setPrice(new BigDecimal("1000.0"));
+ quote.setOpen1(new BigDecimal("1000.0"));
+ quote.setHigh(new BigDecimal("1000.0"));
+ quote.setLow(new BigDecimal("1000.0"));
+ quote.setVolume(1000);
+ quote.setChange1(1000);
+
+ com.example.simple.Quote child =
+ (com.example.simple.Quote)scope.getDataFactory().create(com.example.simple.Quote.class);
+ quote.getQuotes().add(child);
+ child.setPrice(new BigDecimal("2000.0"));
+
+ //XMLHelper.INSTANCE.save((DataObject)quote, "http://www.example.com/simple", "stockQuote", System.out);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Simple Default Generation Pattern Static SDO 2.1 test.
+ */
+ public void testSimpleNoInterfaceGeneratedClasses()
+ {
+ try
+ {
+ HelperContext scope = SDOUtil.createHelperContext();
+ com.example.noInterfaces.simple.SimpleFactory.INSTANCE.register(scope);
+
+ com.example.noInterfaces.simple.Quote quote =
+ (com.example.noInterfaces.simple.Quote)scope.getDataFactory().create(com.example.noInterfaces.simple.Quote.class);
+
+ quote.setSymbol("fbnt");
+ quote.setCompanyName("FlyByNightTechnology");
+ quote.setPrice(new BigDecimal("1000.0"));
+ quote.setOpen1(new BigDecimal("1000.0"));
+ quote.setHigh(new BigDecimal("1000.0"));
+ quote.setLow(new BigDecimal("1000.0"));
+ quote.setVolume(1000);
+ quote.setChange1(1000);
+
+ com.example.noInterfaces.simple.Quote child =
+ (com.example.noInterfaces.simple.Quote)scope.getDataFactory().create(com.example.noInterfaces.simple.Quote.class);
+ quote.getQuotes().add(child);
+ child.setPrice(new BigDecimal("2000.0"));
+
+ //XMLHelper.INSTANCE.save((DataObject)quote, "http://www.example.com/simple", "stockQuote", System.out);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ public void testFailureOnNullScope() {
+ try {
+ SimpleFactory.INSTANCE.register(null);
+ assertTrue("Should not be able to register in null scope", false);
+ }
+ catch (Exception e) {
+ // caught expected exception
+ }
+ }
+
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/InheritanceTestCase.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/InheritanceTestCase.java
new file mode 100644
index 0000000000..a971f79f0f
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/InheritanceTestCase.java
@@ -0,0 +1,102 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.test;
+
+import java.io.IOException;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sdo.util.SDOUtil;
+
+import com.example.subgroup.A;
+import com.example.subgroup.B;
+import com.example.subgroup.Bprime;
+import com.example.subgroup.SubgroupFactory;
+import com.example.subgroup.impl.AImpl;
+import commonj.sdo.DataObject;
+import commonj.sdo.helper.HelperContext;
+import commonj.sdo.helper.XMLDocument;
+
+public class InheritanceTestCase extends TestCase {
+
+ private HelperContext scope;
+
+ public void testSubGroupLoad() throws IOException {
+ XMLDocument doc = scope.getXMLHelper().load(
+ getClass().getResourceAsStream("/subgroup1.xml"));
+ assertEquals("a", doc.getRootElementName());
+ String strdoc = scope.getXMLHelper().save(
+ doc.getRootObject(), doc.getRootElementURI(), doc.getRootElementName());
+ assertTrue(strdoc.indexOf("<sg:imInTypeB>thisIsElB</sg:imInTypeB>") != -1);
+ }
+
+ public void testSubGroup_AcontainsB() {
+ A a = (A) scope.getDataFactory().create(A.class);
+ B b = (B) scope.getDataFactory().create(B.class);
+ b.setImInTypeB("thisIsElB");
+ a.setGe1(b);
+
+ assertSame(b, a.getGe1());
+ assertSame(b, ((AImpl) a).get(AImpl.GE1));
+
+ String doc = scope.getXMLHelper().save((DataObject) a,
+ "http://example.com/subgroup", "a");
+ assertTrue(doc.indexOf("<sg:imInTypeB>thisIsElB</sg:imInTypeB>") != -1);
+
+ }
+
+ public void testSubGroup_AcontainsBprime() {
+ A a = (A) scope.getDataFactory().create(A.class);
+ Bprime bp = (Bprime) scope.getDataFactory().create(Bprime.class);
+ bp.setImInTypeBprime("thisIsElBprime");
+ a.setGe1(bp);
+
+ assertSame(bp, a.getGe1());
+ assertSame(bp, ((AImpl) a).get(AImpl.GE1));
+
+ String doc = scope.getXMLHelper().save((DataObject) a,
+ "http://example.com/subgroup", "a");
+
+ assertTrue(doc.indexOf("<sg:imInTypeBprime>thisIsElBprime</sg:imInTypeBprime>") != -1);
+
+ }
+
+ public void testSubGroup_Bprime() {
+ Bprime bp = (Bprime) scope.getDataFactory().create(Bprime.class);
+ bp.setImInTypeB("bValue");
+ bp.setImInTypeBprime("bpvalue");
+ String doc = scope.getXMLHelper().save((DataObject) bp,
+ "http://example.com/subgroup", "bp");
+ assertTrue(doc.indexOf("<sg:imInTypeB>bValue</sg:imInTypeB>") != -1);
+ assertTrue(doc.indexOf("<sg:imInTypeBprime>bpvalue</sg:imInTypeBprime>") != -1);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ scope = SDOUtil.createHelperContext();
+
+ SubgroupFactory.INSTANCE.register(scope);
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/SimpleStaticTestCase.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/SimpleStaticTestCase.java
new file mode 100644
index 0000000000..207ccd4484
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/SimpleStaticTestCase.java
@@ -0,0 +1,86 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.test;
+
+import java.math.BigDecimal;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sdo.util.SDOUtil;
+
+import com.example.simple.Quote;
+import com.example.simple.SimpleFactory;
+import com.example.simple.impl.SimpleFactoryImpl;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.helper.HelperContext;
+import commonj.sdo.helper.XMLHelper;
+
+
+public class SimpleStaticTestCase extends TestCase
+{
+
+ HelperContext scope;
+ /**
+ * Simple Static SDO 2 test.
+ */
+ public void testSimpleStatic()
+ {
+ try
+ {
+ SimpleFactory.INSTANCE.register(scope);
+ // System.out.println(SimpleFactoryImpl.PATTERN_VERSION);
+
+ //Quote quote = (Quote)DataFactory.INSTANCE.create(Quote.class);
+ Quote quote = SimpleFactory.INSTANCE.createQuote();
+
+ quote.setSymbol("fbnt");
+ quote.setCompanyName("FlyByNightTechnology");
+ quote.setPrice(new BigDecimal("1000.0"));
+ quote.setOpen1(new BigDecimal("1000.0"));
+ quote.setHigh(new BigDecimal("1000.0"));
+ quote.setLow(new BigDecimal("1000.0"));
+ quote.setVolume(1000);
+ quote.setChange1(1000);
+
+ //Quote child = (Quote)((DataObject)quote).createDataObject(8);
+ Quote child = SimpleFactory.INSTANCE.createQuote();
+ quote.getQuotes().add(child);
+ child.setPrice(new BigDecimal("2000.0"));
+
+ // scope.getXMLHelper().save((DataObject)quote, "http://www.example.com/simple", "stockQuote", System.out);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ protected void setUp() throws Exception {
+ scope = SDOUtil.createHelperContext();
+ super.setUp();
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/TestUtil.java b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/TestUtil.java
new file mode 100644
index 0000000000..0ca49b6122
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/TestUtil.java
@@ -0,0 +1,288 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sdo.test;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.FactoryConfigurationError;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.DocumentType;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+public class TestUtil
+{
+ private static void getAllNodes(NodeList nodeList, List nodes)
+ {
+ int length = nodeList.getLength();
+ if (length == 0)
+ {
+ return;
+ }
+
+ for (int i=0; i<length; i++)
+ {
+ Node node = nodeList.item(i);
+ nodes.add(node);
+ getAllNodes(node.getChildNodes(), nodes);
+ } // for
+ }
+
+ private static boolean equalNamedNodeMap(NamedNodeMap mapA, NamedNodeMap mapB) {
+ if (mapA == null) {
+ if (mapB == null) {
+ return true;
+ }
+ return false;
+ }
+ if (mapA.getLength() != mapB.getLength()) {
+ return false;
+ }
+ for (int i = 0; i < mapA.getLength(); i++) {
+ Node trialNode = mapA.item(i);
+ if (trialNode == null) {
+ return false;
+ }
+ Node checkNode = mapB.getNamedItem(trialNode.getNodeName());
+ if (checkNode == null) {
+ return false;
+ }
+ if (!equalNode(trialNode, checkNode)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ private static boolean equalNode(Node nodeA, Node nodeB) {
+ if (nodeA == null) {
+ if (nodeB == null) {
+ return true;
+ }
+ return false;
+ }
+ // following is intended to provide same function as 1.5 isEqualNode()
+ if (nodeA.getNodeType() != nodeB.getNodeType()) {
+ return false;
+ }
+ if (!equalString(nodeA.getNodeName(), nodeB.getNodeName())) {
+ return false;
+ }
+ if (!equalString(nodeA.getLocalName(), nodeB.getLocalName())) {
+ return false;
+ }
+ if (!equalString(nodeA.getNamespaceURI(), nodeB.getNamespaceURI())) {
+ return false;
+ }
+ if (!equalString(nodeA.getNamespaceURI(), nodeB.getNamespaceURI())) {
+ return false;
+ }
+ if (!equalString(nodeA.getPrefix(), nodeB.getPrefix())) {
+ return false;
+ }
+ if (!equalString(nodeA.getNodeValue(), nodeB.getNodeValue())) {
+ return false;
+ }
+ if (!equalNamedNodeMap(nodeA.getAttributes(), nodeB.getAttributes())) {
+ return false;
+ }
+ if (!equalNodeList(nodeA.getChildNodes(), nodeB.getChildNodes())) {
+ return false;
+ }
+ if (nodeA.getNodeType() == Node.DOCUMENT_TYPE_NODE) {
+ DocumentType documentTypeA = (DocumentType) nodeA;
+ DocumentType documentTypeB = (DocumentType) nodeB;
+ if (!equalString(documentTypeA.getPublicId(), documentTypeB.getPublicId())) {
+ return false;
+ }
+ if (!equalString(documentTypeA.getSystemId(), documentTypeB.getSystemId())) {
+ return false;
+ }
+ if (!equalString(documentTypeA.getInternalSubset(), documentTypeB.getInternalSubset())) {
+ return false;
+ }
+ if (!equalNamedNodeMap(documentTypeA.getEntities(), documentTypeB.getEntities())) {
+ return false;
+ }
+ if (!equalNamedNodeMap(documentTypeA.getNotations(), documentTypeB.getNotations())) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ private static boolean equalNodeList(NodeList nodeListA, NodeList nodeListB) {
+ if (nodeListA == null) {
+ if (nodeListB == null) {
+ return true;
+ }
+ return false;
+ }
+ return equalNodes(nodeListA, nodeListB);
+ }
+
+ private static boolean equalString(String stringA, String stringB) {
+ if (stringA == null) {
+ if (stringB == null) {
+ return true;
+ }
+ return false;
+ }
+ return stringA.equals(stringB);
+ }
+
+ private static boolean equalNodes(NodeList sourceNodeList, NodeList targetNodeList)
+ {
+ ArrayList sourceNodes = new ArrayList();
+ ArrayList targetNodes = new ArrayList();
+
+ getAllNodes(sourceNodeList, sourceNodes);
+ getAllNodes(targetNodeList, targetNodes);
+
+ int sourceLength = sourceNodes.size();
+ int targetLength = targetNodes.size();
+
+ if (sourceLength != targetLength)
+ {
+ return false;
+ }
+
+ for (int i=0; i<sourceLength; i++)
+ {
+ Node sourceNode = (Node)sourceNodes.get(i);
+ Node targetNode = (Node)targetNodes.get(i);
+
+ /* remove comment when migrated to Java 1.5
+ if (!sourceNode.isEqualNode(targetNode))
+ {
+ return false;
+ }
+ */
+ // following is intended as 1.4 equivalent of isEqualNode()
+ if (!equalNode(sourceNode, targetNode))
+ {
+ return false;
+ }
+ } // for
+
+ return true;
+ }
+
+ public static boolean equalXmlFiles(URL source, URL target)
+ {
+ try {
+ return equalXmlFiles(source.openStream(), target.openStream());
+ }
+ catch (IOException e)
+ {
+ return false;
+ }
+ }
+
+ public static boolean equalXmlFiles(InputStream sourceStream, URL target)
+ {
+ try {
+ return equalXmlFiles(sourceStream, target.openStream());
+ }
+ catch (IOException e)
+ {
+ return false;
+ }
+ }
+
+ public static boolean equalXmlFiles(URL source, InputStream targetStream)
+ {
+ try {
+ return equalXmlFiles(source.openStream(), targetStream);
+ }
+ catch (IOException e)
+ {
+ return false;
+ }
+ }
+
+ public static boolean equalXmlFiles(InputStream sourceStream, InputStream targetStream)
+ {
+ DocumentBuilder builder;
+ Document sourceDocument;
+ Document targetDocument;
+
+ try {
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ factory.setIgnoringComments(true);
+ builder = factory.newDocumentBuilder();
+ //builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ sourceDocument = builder.parse(sourceStream);
+ targetDocument = builder.parse(targetStream);
+ }
+ catch (FactoryConfigurationError fce) {
+ return false;
+ }
+ catch (ParserConfigurationException ce) {
+ return false;
+ }
+ catch (SAXException se)
+ {
+ return false;
+ }
+ catch (IOException ie)
+ {
+ return false;
+ }
+
+ sourceDocument.normalize();
+ targetDocument.normalize();
+
+ /* remove comment when migrated to Java 1.5
+ if (!sourceDocument.getXmlVersion().equals(targetDocument.getXmlVersion()))
+ {
+ return false;
+ }
+
+ String sourceXmlEncoding = sourceDocument.getXmlEncoding();
+ String targetXmlEncoding = targetDocument.getXmlEncoding();
+
+ if (sourceXmlEncoding != null && targetXmlEncoding != null &&
+ sourceXmlEncoding.equalsIgnoreCase(targetXmlEncoding))
+ {
+ // continue
+ }
+ else
+ {
+ return false;
+ }
+ */
+
+ NodeList sourceNodes = sourceDocument.getChildNodes();
+ NodeList targetNodes = targetDocument.getChildNodes();
+
+ return equalNodes(sourceNodes, targetNodes);
+ }
+}
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/TUSCANY1050.xsd b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/TUSCANY1050.xsd
new file mode 100644
index 0000000000..a218eb574c
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/TUSCANY1050.xsd
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * -->
+<xsd:schema xmlns:tns="http://test.data"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified"
+ targetNamespace="http://test.data">
+
+ <xsd:element name="description" type="tns:description"/>
+ <xsd:complexType name="description">
+ <xsd:sequence>
+ <xsd:element name="field1" type="xsd:string"/>
+ <xsd:element name="field2" type="xsd:string"/>
+ <xsd:element name="field3" type="xsd:string"/>
+ <xsd:element name="field4" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+
+ <xsd:element name="Wrapper" type="tns:Wrapper"/>
+ <xsd:complexType name="Wrapper">
+ <xsd:sequence>
+ <xsd:element name="description" nillable="true" type="tns:description"/>
+ </xsd:sequence>
+ </xsd:complexType>
+</xsd:schema>
+
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/enum.xsd b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/enum.xsd
new file mode 100644
index 0000000000..6c906539a9
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/enum.xsd
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+<xsd:schema
+ targetNamespace="http://www.example.com/simple"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:simple="http://www.example.com/simple">
+
+ <xsd:element name="stockQuote" type="simple:Quote"/>
+
+ <xsd:simpleType name="PriceClass">
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="Large"/>
+ <xsd:enumeration value="Medium"/>
+ <xsd:enumeration value="Small"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+
+ <xsd:complexType name="Quote">
+ <xsd:sequence>
+ <xsd:element name="symbol" type="xsd:string"/>
+ <xsd:element name="companyName" type="xsd:string"/>
+ <xsd:element name="priceClass" type="simple:PriceClass"/>
+ <xsd:element name="price" type="xsd:decimal"/>
+ <xsd:element name="open1" type="xsd:decimal"/>
+ <xsd:element name="high" type="xsd:decimal"/>
+ <xsd:element name="low" type="xsd:decimal"/>
+ <xsd:element name="volume" type="xsd:double"/>
+ <xsd:element name="change1" type="xsd:double"/>
+ <xsd:element name="quotes" type="simple:Quote" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+</xsd:schema>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/mixedRepeatingChoiceTestResult.xml b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/mixedRepeatingChoiceTestResult.xml
new file mode 100644
index 0000000000..0aa17bb50a
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/mixedRepeatingChoiceTestResult.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+<sequences:mrc xmlns:sequences="http://www.example.com/sequences"><b>1</b><a>foo</a>some mixed text<a>bar</a><b>2</b></sequences:mrc>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/mixedStaticTestResult.xml b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/mixedStaticTestResult.xml
new file mode 100644
index 0000000000..9136f0780d
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/mixedStaticTestResult.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+<sequences:mixedStockQuote xmlns:sequences="http://www.example.com/sequences">
+ <symbol>fbnt</symbol>
+ <companyName>FlyByNightTechnology</companyName>
+ some text
+ <quotes><price>2000.0</price></quotes>
+ more text
+ <price>1000.0</price>
+</sequences:mixedStockQuote>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/repeatingChoice.xsd b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/repeatingChoice.xsd
new file mode 100644
index 0000000000..1d566da671
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/repeatingChoice.xsd
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+
+<xsd:schema xmlns:repchoice="http://www.example.com/repchoice" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.com/repchoice">
+
+ <xsd:element name="rc" type="repchoice:RCType"/>
+
+ <xsd:complexType name="RCType">
+ <xsd:choice maxOccurs="unbounded" minOccurs="0">
+ <xsd:element name="s" type="xsd:string"/>
+ <xsd:element name="i" type="xsd:int"/>
+ <xsd:element name="f" type="xsd:float"/>
+ </xsd:choice>
+ </xsd:complexType>
+
+</xsd:schema>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/repeatingChoiceTestResult.xml b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/repeatingChoiceTestResult.xml
new file mode 100644
index 0000000000..2719457b6d
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/repeatingChoiceTestResult.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+<sequences:rc xmlns:sequences="http://www.example.com/sequences">
+ <b>1</b>
+ <a>foo</a>
+ <a>bar</a>
+ <b>2</b>
+</sequences:rc>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/sdoModel.xsd b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/sdoModel.xsd
new file mode 100644
index 0000000000..645b7b700a
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/sdoModel.xsd
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ -->
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sdo="commonj.sdo" xmlns:sdoJava="commonj.sdo/java" targetNamespace="commonj.sdo">
+
+ <!-- Dummy XSD definition of special SDO ChangeSummaryType -->
+ <xsd:simpleType name="ChangeSummaryType" sdoJava:instanceClass="commonj.sdo.ChangeSummary">
+ <xsd:restriction base="xsd:string"/>
+ </xsd:simpleType>
+
+
+</xsd:schema>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/sequences.xsd b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/sequences.xsd
new file mode 100644
index 0000000000..b74a56eab7
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/sequences.xsd
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+<xsd:schema xmlns:seq="http://www.example.com/sequences"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://www.example.com/sequences">
+
+ <xsd:element name="mixedStockQuote" type="seq:MixedQuote" />
+ <xsd:element name="rc" type="seq:RepeatingChoice" />
+ <xsd:element name="mrc" type="seq:MixedRepeatingChoice" />
+ <xsd:element name="rc2" type="seq:TwoRCs" />
+ <xsd:element name="mrc2" type="seq:TwoRCsMixed" />
+
+
+
+ <xsd:complexType mixed="true" name="MixedQuote">
+ <xsd:sequence>
+ <xsd:element name="symbol" type="xsd:string" />
+ <xsd:element name="companyName" type="xsd:string" />
+ <xsd:element name="price" type="xsd:decimal" />
+ <xsd:element name="open1" type="xsd:decimal" />
+ <xsd:element name="high" type="xsd:decimal" />
+ <xsd:element name="low" type="xsd:decimal" />
+ <xsd:element name="volume" type="xsd:double" />
+ <xsd:element name="change1" type="xsd:double" />
+ <xsd:element maxOccurs="unbounded" minOccurs="0"
+ name="quotes" type="seq:MixedQuote" />
+ </xsd:sequence>
+ </xsd:complexType>
+
+
+ <xsd:complexType name="RepeatingChoice">
+ <xsd:choice maxOccurs="unbounded" minOccurs="0">
+ <xsd:element name="a" type="xsd:string" />
+ <xsd:element name="b" type="xsd:int" />
+ </xsd:choice>
+ </xsd:complexType>
+
+
+ <xsd:complexType mixed="true" name="MixedRepeatingChoice">
+ <xsd:choice maxOccurs="unbounded" minOccurs="0">
+ <xsd:element name="a" type="xsd:string" />
+ <xsd:element name="b" type="xsd:int" />
+ </xsd:choice>
+ </xsd:complexType>
+
+
+ <xsd:complexType name="TwoRCs">
+ <xsd:sequence>
+
+ <xsd:choice maxOccurs="unbounded" minOccurs="0">
+ <xsd:element name="a" type="xsd:string" />
+ <xsd:element name="b" type="xsd:int" />
+ </xsd:choice>
+
+ <xsd:element name="split" type="xsd:string" />
+
+ <xsd:choice maxOccurs="unbounded" minOccurs="0">
+ <xsd:element name="y" type="xsd:string" />
+ <xsd:element name="z" type="xsd:int" />
+ </xsd:choice>
+
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType mixed="true" name="TwoRCsMixed">
+ <xsd:sequence>
+
+ <xsd:choice maxOccurs="unbounded" minOccurs="0">
+ <xsd:element name="a" type="xsd:string" />
+ <xsd:element name="b" type="xsd:int" />
+ </xsd:choice>
+
+ <xsd:element name="split" type="xsd:string" />
+
+ <xsd:choice maxOccurs="unbounded" minOccurs="0">
+ <xsd:element name="y" type="xsd:string" />
+ <xsd:element name="z" type="xsd:int" />
+ </xsd:choice>
+
+ </xsd:sequence>
+ </xsd:complexType>
+
+</xsd:schema>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/simple.xsd b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/simple.xsd
new file mode 100644
index 0000000000..f058e5b63a
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/simple.xsd
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+<xsd:schema
+ targetNamespace="http://www.example.com/simple"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:simple="http://www.example.com/simple">
+
+ <xsd:element name="stockQuote" type="simple:Quote"/>
+
+ <xsd:complexType name="Quote">
+ <xsd:sequence>
+ <xsd:element name="symbol" type="xsd:string"/>
+ <xsd:element name="companyName" type="xsd:string"/>
+ <xsd:element name="price" type="xsd:decimal"/>
+ <xsd:element name="open1" type="xsd:decimal"/>
+ <xsd:element name="high" type="xsd:decimal"/>
+ <xsd:element name="low" type="xsd:decimal"/>
+ <xsd:element name="volume" type="xsd:double"/>
+ <xsd:element name="change1" type="xsd:double"/>
+ <xsd:element name="quotes" type="simple:Quote" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+</xsd:schema>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/simpleWithChangeSummary.xsd b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/simpleWithChangeSummary.xsd
new file mode 100644
index 0000000000..35d504425d
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/simpleWithChangeSummary.xsd
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Copyright (c) 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ -->
+<xsd:schema xmlns:sdo="commonj.sdo" xmlns:simpleCS="http://www.example.com/simpleCS" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" targetNamespace="http://www.example.com/simpleCS">
+
+
+ <xsd:import namespace="commonj.sdo" schemaLocation="sdoModel.xsd"/>
+
+ <xsd:complexType name="QuoteBase">
+ <xsd:complexContent>
+ <xsd:extension base="simpleCS:Quote">
+ <xsd:sequence>
+ <xsd:element name="changes" type="sdo:ChangeSummaryType"/>
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+
+ </xsd:complexType>
+
+ <xsd:element name="stockQuote" type="simpleCS:QuoteBase"/>
+
+ <xsd:complexType name="Quote">
+ <xsd:sequence>
+ <xsd:element name="symbol" type="xsd:string"/>
+ <xsd:element name="companyName" type="xsd:string"/>
+ <xsd:element name="price" type="xsd:decimal"/>
+ <xsd:element name="open1" type="xsd:decimal"/>
+ <xsd:element name="high" type="xsd:decimal"/>
+ <xsd:element name="low" type="xsd:decimal"/>
+ <xsd:element name="volume" type="xsd:double"/>
+ <xsd:element name="change1" type="xsd:double"/>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" name="quotes" type="simpleCS:Quote"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+</xsd:schema>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/subgroup.xsd b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/subgroup.xsd
new file mode 100644
index 0000000000..798085b88d
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/subgroup.xsd
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ -->
+<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:sg="http://example.com/subgroup" elementFormDefault="qualified" targetNamespace="http://example.com/subgroup">
+
+ <element name="a" type="sg:A"/>
+
+ <complexType name="A">
+ <sequence>
+ <element maxOccurs="1" minOccurs="1" ref="sg:ge1"/>
+ </sequence>
+ </complexType>
+
+ <element name="ge1" type="sg:B"/>
+ <element name="se1" substitutionGroup="sg:ge1" type="sg:Bprime"/>
+
+ <complexType name="B">
+ <sequence>
+ <element maxOccurs="1" name="imInTypeB" type="string"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="Bprime">
+ <complexContent>
+ <extension base="sg:B">
+ <sequence>
+ <element name="imInTypeBprime" type="string"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+</schema>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/subgroup1.xml b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/subgroup1.xml
new file mode 100644
index 0000000000..15eed43c10
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/subgroup1.xml
@@ -0,0 +1,23 @@
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ -->
+<subgroup:a xmlns:subgroup="http://example.com/subgroup">
+ <subgroup:ge1>
+ <subgroup:imInTypeB>thisIsElB</subgroup:imInTypeB>
+ </subgroup:ge1>
+</subgroup:a>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/twoRepeatingChoicesMixedTestResult.xml b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/twoRepeatingChoicesMixedTestResult.xml
new file mode 100644
index 0000000000..a62cd66b58
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/twoRepeatingChoicesMixedTestResult.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+<sequences:rc2m xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sequences="http://www.example.com/sequences" xsi:type="sequences:TwoRCsMixed"><b>1</b>where will this appear?<a>foo</a><a>bar</a><b>2</b><split>pea</split><z>99</z><y>fred</y></sequences:rc2m>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/twoRepeatingChoicesTestResult.xml b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/twoRepeatingChoicesTestResult.xml
new file mode 100644
index 0000000000..3585ad00d3
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/src/test/resources/twoRepeatingChoicesTestResult.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+<sequences:rc2 xmlns:sequences="http://www.example.com/sequences">
+ <b>1</b>
+ <a>foo</a>
+ <a>bar</a>
+ <b>2</b>
+ <split>banana</split>
+ <z>99</z>
+ <y>fred</y>
+</sequences:rc2>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/templates/Header.javajetinc b/sdo-java/tags/1.0-incubator-M3/sdo/tools/templates/Header.javajetinc
new file mode 100644
index 0000000000..27becf3645
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/templates/Header.javajetinc
@@ -0,0 +1,6 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * <%="$"%>Id<%="$"%>
+ */
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/templates/models/SDOClass.javajet b/sdo-java/tags/1.0-incubator-M3/sdo/tools/templates/models/SDOClass.javajet
new file mode 100644
index 0000000000..4b8c9787fa
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/templates/models/SDOClass.javajet
@@ -0,0 +1,1948 @@
+<%@ jet package="org.apache.tuscany.sdo.generate.templates.model" imports="org.eclipse.emf.codegen.util.* org.apache.tuscany.sdo.impl.* java.util.* org.eclipse.emf.codegen.ecore.genmodel.* org.apache.tuscany.sdo.generate.util.*" class="SDOClass" version="$Id: Class.javajet,v 1.41 2006/02/15 19:58:39 emerks Exp $" %>
+<%
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+%>
+<%GenClass genClass = (GenClass)((Object[])argument)[0]; GenPackage genPackage = genClass.getGenPackage(); GenModel genModel=genPackage.getGenModel();%>
+<%boolean isInterface = Boolean.TRUE.equals(((Object[])argument)[1]); boolean isImplementation = Boolean.TRUE.equals(((Object[])argument)[2]);%>
+<%boolean isDebug = false;%>
+<%String publicStaticFinalFlag = isImplementation ? "public static final " : "";%>
+<%/*%>
+<% * Output preamble and javadoc header%>
+<% */%>
+<%@ include file="../Header.javajetinc"%>
+<%if (isInterface) {%>
+package <%=genPackage.getInterfacePackageName()%>;
+<%} else {%>
+package <%=genPackage.getClassPackageName()%>;
+<%}%>
+
+<%genModel.markImportLocation(stringBuffer, genPackage);%>
+
+<%if (isDebug) { // EYECATCHER 1 %>
+ // EYECATCHER 1
+<%}%>
+<%if (isInterface) {%>
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b><%=genClass.getFormattedName()%></b></em>'.
+ * <!-- end-user-doc -->
+<%if (genClass.hasDocumentation()) {%>
+ *
+ * <!-- begin-model-doc -->
+ * <%=genClass.getDocumentation(genModel.getIndentation(stringBuffer))%>
+ * <!-- end-model-doc -->
+<%}%>
+ *
+<%if (!genClass.getGenFeatures().isEmpty()) {%>
+ * <p>
+ * The following features are supported:
+ * <ul>
+<%for (Iterator i=genClass.getGenFeatures().iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();%>
+ <%if (!genFeature.isSuppressedGetVisibility()) {%>
+ * <li>{@link <%=genClass.getQualifiedInterfaceName()%>#<%=genFeature.getGetAccessor()%> <em><%=genFeature.getFormattedName()%></em>}</li>
+ <%}%>
+<%}%>
+ * </ul>
+ * </p>
+<%}%>
+ *
+<%if (!genModel.isSuppressEMFMetaData()) {%>
+ * @see <%=genPackage.getQualifiedPackageInterfaceName()%>#get<%=genClass.getClassifierAccessorName()%>()
+<%}%>
+<%if (!genModel.isSuppressEMFModelTags()) { boolean first = true; for (StringTokenizer stringTokenizer = new StringTokenizer(genClass.getModelInfo(), "\n\r"); stringTokenizer.hasMoreTokens(); ) { String modelInfo = stringTokenizer.nextToken(); if (first) { first = false;%>
+ * @model <%=modelInfo%>
+<%} else {%>
+ * <%=modelInfo%>
+<%}} if (first) {%>
+ * @model
+<%}}%>
+<%if (genClass.needsRootExtendsInterfaceExtendsTag()) { // does it need an @extends tag %>
+ * @extends <%=genModel.getImportedName(genModel.getRootExtendsInterface())%>
+<%}%>
+ * @generated
+ */
+<%} else {%>
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b><%=genClass.getFormattedName()%></b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+<%if (!genClass.getImplementedGenFeatures().isEmpty()) {%>
+ * The following features are implemented:
+ * <ul>
+<%for (Iterator i=genClass.getImplementedGenFeatures().iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();%>
+ * <li>{@link <%=genClass.getQualifiedClassName()%>#<%=genFeature.getGetAccessor()%> <em><%=genFeature.getFormattedName()%></em>}</li>
+<%}%>
+ * </ul>
+<%}%>
+ * </p>
+ *
+ * @generated
+ */
+<%}%>
+<%if (isImplementation) {%>
+public<%if (genClass.isAbstract()) {%> abstract<%}%> class <%=genClass.getClassName()%><%=genClass.getClassExtends()%><%=genClass.getClassImplements()%>
+<%} else {%>
+public interface <%=genClass.getInterfaceName()%><%=genClass.getInterfaceExtends()%>
+<%}%>
+{
+<%if (genModel.getCopyrightText() != null) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%=publicStaticFinalFlag%><%=genModel.getImportedName("java.lang.String")%> copyright = "<%=genModel.getCopyrightText()%>";<%=genModel.getNonNLS()%>
+
+<%}%>
+<%if (isImplementation && genModel.getDriverNumber() != null) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final <%=genModel.getImportedName("java.lang.String")%> mofDriverNumber = "<%=genModel.getDriverNumber()%>";<%=genModel.getNonNLS()%>
+
+<%}%>
+<%if (isImplementation && genClass.isJavaIOSerializable()) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static final long serialVersionUID = 1L;
+
+<%}%>
+<%if (isImplementation && genModel.isVirtualDelegation()) { String eVirtualValuesField = genClass.getEVirtualValuesField();%>
+ <%if (eVirtualValuesField != null) {%>
+ /**
+ * An array of objects representing the values of non-primitive features.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Object[] <%=eVirtualValuesField%> = null;
+
+ <%}%>
+ <%{ List eVirtualIndexBitFields = genClass.getEVirtualIndexBitFields(new ArrayList());%>
+ <%if (!eVirtualIndexBitFields.isEmpty()) {%>
+ <%for (Iterator i = eVirtualIndexBitFields.iterator(); i.hasNext();) { String eVirtualIndexBitField = (String)i.next();%>
+ /**
+ * A bit field representing the indices of non-primitive feature values.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected int <%=eVirtualIndexBitField%> = 0;
+
+ <%}%>
+ <%}%>
+ <%}%>
+<%}%>
+<%if (isImplementation && genClass.isModelRoot() && genModel.isBooleanFlagsEnabled() && genModel.getBooleanFlagsReservedBits() == -1) {%>
+ /**
+ * A set of bit flags representing the values of boolean attributes and whether unsettable features have been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected int <%=genModel.getBooleanFlagsField()%> = 0;
+
+<%}%>
+<%if (isImplementation && !genModel.isReflectiveDelegation()) {%>
+
+ <%ClassImpl classImpl = (ClassImpl) genClass.getEcoreClass();%>
+ <%List declaredProperties = classImpl.getDeclaredProperties();%>
+ <%List extendedProperties = classImpl.getExtendedProperties();%>
+ <%int declaredPropertiesCount = 0;%>
+ <%int extendedPropertiesCount = 0;%>
+ <%for (Iterator f=genClass.getAllGenFeatures().iterator(); f.hasNext();) { GenFeature genFeature = (GenFeature)f.next();%>
+ <%if (declaredProperties.contains(genFeature.getEcoreFeature())){%>
+ <%declaredPropertiesCount++;%>
+ <%String featureValue = "";
+ List allFeatures = genClass.getAllGenFeatures();
+ int g = allFeatures.indexOf(genFeature);
+ GenClass base = genClass.getBaseGenClass();
+ if (base == null)
+ {
+ featureValue = Integer.toString(declaredProperties.indexOf(genFeature.getEcoreFeature()));
+ } else {
+ int baseCount = base.getFeatureCount();
+ if (g < baseCount)
+ {
+ featureValue = base.getClassName() + "." + genFeature.getUpperName();
+ } else {
+ String baseCountID = base.getClassName() + "." + "SDO_PROPERTY_COUNT";
+ featureValue = baseCountID + " + " + Integer.toString(declaredProperties.indexOf(genFeature.getEcoreFeature()));
+ }
+ }%>
+ public final static int <%=genFeature.getUpperName()%> = <%=featureValue%>;
+
+ <%} else if (extendedProperties.contains(genFeature.getEcoreFeature())){%>
+ <%extendedPropertiesCount++;%>
+ <%String featureValue = "";
+ List allFeatures = genClass.getAllGenFeatures();
+ int g = allFeatures.indexOf(genFeature);
+ GenClass base = genClass.getBaseGenClass();
+ if (base == null)
+ {
+ featureValue = Integer.toString(-1 - extendedProperties.indexOf(genFeature.getEcoreFeature()));
+ } else {
+ int baseCount = base.getFeatureCount();
+ if (g < baseCount)
+ {
+ featureValue = base.getClassName() + "." + genFeature.getUpperName();
+ } else {
+ String baseCountID = base.getClassName() + "." + "EXTENDED_PROPERTY_COUNT";
+ featureValue = baseCountID + " + " + Integer.toString(-1 - extendedProperties.indexOf(genFeature.getEcoreFeature()));
+ }
+ }%>
+ public final static int <%=genFeature.getUpperName()%> = <%=featureValue%>;
+
+ <%}%>
+ <%}%>
+ <%String featureCount = "";%>
+ <%GenClass base = genClass.getBaseGenClass();%>
+ <%if (base == null)%>
+ <%{%>
+ <%featureCount = Integer.toString(declaredPropertiesCount);%>
+ <%}%>
+ <%else {%>
+ <%String baseCountID = base.getClassName() + "." + "SDO_PROPERTY_COUNT";%>
+ <%featureCount = baseCountID + " + " + Integer.toString(declaredPropertiesCount);%>
+ <%}%>
+ public final static int SDO_PROPERTY_COUNT = <%=featureCount%>;
+
+ <%featureCount = "";%>
+ <%base = genClass.getBaseGenClass();%>
+ <%if (base == null)%>
+ <%{%>
+ <%featureCount = Integer.toString(extendedPropertiesCount*-1);%>
+ <%}%>
+ <%else {%>
+ <%String baseCountID = base.getClassName() + "." + "EXTENDED_PROPERTY_COUNT";%>
+ <%featureCount = baseCountID + " - " + Integer.toString(extendedPropertiesCount);%>
+ <%}%>
+ public final static int EXTENDED_PROPERTY_COUNT = <%=featureCount%>;
+
+
+ <%for (Iterator f=genClass.getAllGenFeatures().iterator(); f.hasNext();) { GenFeature genFeature = (GenFeature)f.next();%>
+ /**
+ * The internal feature id for the '<em><b><%=genFeature.getFormattedName()%></b></em>' <%=genFeature.getFeatureKind()%>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ <%String featureValue = "";%>
+ <%List allFeatures = genClass.getAllGenFeatures();%>
+ <%int g = allFeatures.indexOf(genFeature);%>
+ <%base = genClass.getBaseGenClass();%>
+ <%if (base == null)%>
+ <%{%>
+ <%featureValue = Integer.toString(g);%>
+ <%} else {%>
+ <%int baseCount = base.getFeatureCount();%>
+ <%if (g < baseCount)%>
+ <%{%>
+ <%featureValue = base.getClassName() + "." + genFeature.getUpperName();%>
+ <%} else {%>
+ <%String baseCountID = base.getClassName() + "." + "INTERNAL_PROPERTY_COUNT";%>
+ <%featureValue = baseCountID + " + " + Integer.toString(g - baseCount);%>
+ <%}%>
+ <%}%>
+ public final static int INTERNAL_<%=genFeature.getUpperName()%> = <%=featureValue%>;
+
+ <%}%>
+ /**
+ * The number of properties for this type.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ <%featureCount = "";
+ base = genClass.getBaseGenClass();
+ if (base == null)
+ {
+ featureCount = Integer.toString(genClass.getFeatureCount());
+ }
+ else {
+ String baseCountID = base.getClassName() + "." + "INTERNAL_PROPERTY_COUNT";
+ featureCount = baseCountID + " + " + Integer.toString(genClass.getFeatureCount() - base.getFeatureCount());
+ }%>
+ public final static int INTERNAL_PROPERTY_COUNT = <%=featureCount%>;
+
+ protected int internalConvertIndex(int internalIndex)
+ {
+ switch (internalIndex)
+ {
+ <%for (Iterator f=genClass.getAllGenFeatures().iterator(); f.hasNext();) { GenFeature genFeature = (GenFeature)f.next();%>
+ case INTERNAL_<%=genFeature.getUpperName()%>: return <%=genFeature.getUpperName()%>;
+ <%}%>
+ }
+ return super.internalConvertIndex(internalIndex);
+ }
+
+
+ <%for (Iterator i=genClass.getDeclaredFieldGenFeatures().iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();%>
+<%@ include file="Class/declaredFieldGenFeature.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ <%if (genFeature.isListType() || genFeature.isReferenceType()) {%>
+ <%if (genClass.isField(genFeature)) {%>
+ /**
+ * The cached value of the '{@link #<%=genFeature.getGetAccessor()%>() <em><%=genFeature.getFormattedName()%></em>}' <%=genFeature.getFeatureKind()%>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #<%=genFeature.getGetAccessor()%>()
+ * @generated
+ * @ordered
+ */
+
+ protected <%=genModel.getImportedName(genFeature.getType())%> <%=genFeature.getSafeName()%> = null;
+
+ <%}%>
+ <%if (genModel.isArrayAccessors() && !genFeature.isFeatureMapType() && !genFeature.isMapType()) {%>
+ /**
+ * The empty value for the '{@link #<%=genFeature.getGetArrayAccessor()%>() <em><%=genFeature.getFormattedName()%></em>}' array accessor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #<%=genFeature.getGetArrayAccessor()%>()
+ * @generated
+ * @ordered
+ */
+ protected static final <%=genFeature.getListItemType()%>[] <%=genFeature.getUpperName()%>_EEMPTY_ARRAY = new <%=genFeature.getListItemType()%> [0];
+
+ <%}%>
+ <%} else {%>
+ <%if (!genFeature.isVolatile() || !genModel.isReflectiveDelegation() && (!genFeature.hasDelegateFeature() || !genFeature.isUnsettable())) {%>
+ /**
+ * The default value of the '{@link #<%=genFeature.getGetAccessor()%>() <em><%=genFeature.getFormattedName()%></em>}' <%=genFeature.getFeatureKind()%>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #<%=genFeature.getGetAccessor()%>()
+ * @generated
+ * @ordered
+ */
+ protected static final <%=genFeature.getImportedType()%> <%=genFeature.getUpperName()%>_DEFAULT_ = <%=genFeature.getStaticDefaultValue()%>;<%=genModel.getNonNLS(genFeature.getStaticDefaultValue())%>
+
+ <%}%>
+ <%if (genClass.isField(genFeature)) {%>
+ <%if (genClass.isFlag(genFeature)) {%>
+ <%if (genClass.getFlagIndex(genFeature) > 31 && genClass.getFlagIndex(genFeature) % 32 == 0) {%>
+ /**
+ * An additional set of bit flags representing the values of boolean attributes and whether unsettable features have been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected int <%=genClass.getFlagsField(genFeature)%> = 0;
+
+ <%}%>
+ /**
+ * The flag representing the value of the '{@link #<%=genFeature.getGetAccessor()%>() <em><%=genFeature.getFormattedName()%></em>}' <%=genFeature.getFeatureKind()%>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #<%=genFeature.getGetAccessor()%>()
+ * @generated
+ * @ordered
+ */
+ protected static final int <%=genFeature.getUpperName()%>_EFLAG = 1 <%="<< " + genClass.getFlagIndex(genFeature) % 32 %>;
+
+ <%} else {%>
+ /**
+ * The cached value of the '{@link #<%=genFeature.getGetAccessor()%>() <em><%=genFeature.getFormattedName()%></em>}' <%=genFeature.getFeatureKind()%>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #<%=genFeature.getGetAccessor()%>()
+ * @generated
+ * @ordered
+ */
+ protected <%=genFeature.getImportedType()%> <%=genFeature.getSafeName()%> = <%=genFeature.getUpperName()%>_DEFAULT_;
+
+ <%}%>
+ <%}%>
+ <%}%>
+ <%if (genClass.isESetField(genFeature)) {%>
+ <%if (genClass.isESetFlag(genFeature)) {%>
+ <%if (genClass.getESetFlagIndex(genFeature) > 31 && genClass.getESetFlagIndex(genFeature) % 32 == 0) {%>
+ /**
+ * An additional set of bit flags representing the values of boolean attributes and whether unsettable features have been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected int <%=genClass.getESetFlagsField(genFeature)%> = 0;
+
+ <%}%>
+ /**
+ * The flag representing whether the <%=genFeature.getFormattedName()%> <%=genFeature.getFeatureKind()%> has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected static final int <%=genFeature.getUpperName()%>_ESETFLAG = 1 <%="<< " + genClass.getESetFlagIndex(genFeature) % 32 %>;
+
+ <%} else {%>
+ /**
+ * This is true if the <%=genFeature.getFormattedName()%> <%=genFeature.getFeatureKind()%> has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean <%=genFeature.getUncapName()%>_set_ = false;
+
+ <%}%>
+ <%}%>
+ <%}%>
+<%@ include file="Class/declaredFieldGenFeature.insert.javajetinc" fail="silent" %>
+<%@ end %><%//Class/declaredFieldGenFeature.override.javajetinc%>
+<%}%>
+<%if (isImplementation) { // create constructor %>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public <%=genClass.getClassName()%>()
+ {
+ super();
+ <%for (Iterator i=genClass.getFlagGenFeatures("true").iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();%>
+ <%=genClass.getFlagsField(genFeature)%> |= <%=genFeature.getUpperName()%>_EFLAG;
+ <%}%>
+ <%if (SDOGenUtil.hasChangeSummaryProperty(genClass)) {%>
+ createChangeSummary(<%=SDOGenUtil.getChangeSummaryProperty(genClass)%>);
+ <%}%>
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public <%=genModel.getImportedName("commonj.sdo.Type")%> getType()
+ {
+ return ((<%=genPackage.getImportedFactoryClassName()%>)<%=genPackage.getImportedFactoryInterfaceName()%>.INSTANCE).get<%=genClass.getClassifierAccessorName()%>();
+ }
+
+<%}%>
+<%/*%>
+<% * Output getter and setter interfaces / impls%>
+<% */%>
+<%%>
+<%for (Iterator i=(isImplementation ? genClass.getImplementedGenFeatures() : genClass.getDeclaredGenFeatures()).iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();%>
+<%@ include file="Class/genFeature.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ <%if (genModel.isArrayAccessors() && genFeature.isListType() && !genFeature.isFeatureMapType() && !genFeature.isMapType()) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%if (!isImplementation) {%>
+ <%=genFeature.getListItemType()%>[] <%=genFeature.getGetArrayAccessor()%>();
+
+ <%} else {%>
+ public <%=genFeature.getListItemType()%>[] <%=genFeature.getGetArrayAccessor()%>()
+ {
+ <%if (genFeature.isVolatile()) {%>
+ <%=genModel.getImportedName("org.eclipse.emf.common.util.BasicEList")%> list = (<%=genModel.getImportedName("org.eclipse.emf.common.util.BasicEList")%>)<%=genFeature.getGetAccessor()%>();
+ if (list.isEmpty()) return <%=genFeature.getUpperName()%>_EEMPTY_ARRAY;
+ <%} else {%>
+ if (<%=genFeature.getSafeName()%> == null || <%=genFeature.getSafeName()%>.isEmpty()) return <%=genFeature.getUpperName()%>_EEMPTY_ARRAY;
+ <%=genModel.getImportedName("org.eclipse.emf.common.util.BasicEList")%> list = (<%=genModel.getImportedName("org.eclipse.emf.common.util.BasicEList")%>)<%=genFeature.getSafeName()%>;
+ <%}%>
+ list.shrink();
+ return (<%=genFeature.getListItemType()%>[])list.data();
+ }
+
+ <%}%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%if (!isImplementation) {%>
+ <%=genFeature.getListItemType()%> get<%=genFeature.getAccessorName()%>(int index);
+ <%} else {%>
+ public <%=genFeature.getListItemType()%> get<%=genFeature.getAccessorName()%>(int index)
+ {
+ return (<%=genFeature.getListItemType()%>)<%=genFeature.getGetAccessor()%>().get(index);
+ }
+ <%}%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%if (!isImplementation) {%>
+ int get<%=genFeature.getAccessorName()%>Length();
+
+ <%} else {%>
+ public int get<%=genFeature.getAccessorName()%>Length()
+ {
+ <%if (genFeature.isVolatile()) {%>
+ return <%=genFeature.getGetAccessor()%>().size();
+ <%} else {%>
+ return <%=genFeature.getSafeName()%> == null ? 0 : <%=genFeature.getSafeName()%>.size();
+ <%}%>
+ }
+
+ <%}%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%if (!isImplementation) {%>
+ void set<%=genFeature.getAccessorName()%>(<%=genFeature.getListItemType()%>[] new<%=genFeature.getCapName()%>);
+
+ <%} else {%>
+ public void set<%=genFeature.getAccessorName()%>(<%=genFeature.getListItemType()%>[] new<%=genFeature.getCapName()%>)
+ {
+ ((<%=genModel.getImportedName("org.eclipse.emf.common.util.BasicEList")%>)<%=genFeature.getGetAccessor()%>()).setData(new<%=genFeature.getCapName()%>.length, new<%=genFeature.getCapName()%>);
+ }
+
+ <%}%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%if (!isImplementation) {%>
+ void set<%=genFeature.getAccessorName()%>(int index, <%=genFeature.getListItemType()%> element);
+
+ <%} else {%>
+ public void set<%=genFeature.getAccessorName()%>(int index, <%=genFeature.getListItemType()%> element)
+ {
+ <%=genFeature.getGetAccessor()%>().set(index, element);
+ }
+
+ <%}%>
+ <%}%>
+ <%if (genFeature.isGet() && (isImplementation || !genFeature.isSuppressedGetVisibility())) {%>
+<%@ include file="Class/getGenFeature.override.javajetinc" fail="alternative" %>
+<%@ start %>
+<%if (isInterface) {%>
+ /**
+ * Returns the value of the '<em><b><%=genFeature.getFormattedName()%></b></em>' <%=genFeature.getFeatureKind()%>.
+ <%if (genFeature.isListType()) {%>
+ <%if (genFeature.isMapType()) { GenFeature keyFeature = genFeature.getMapEntryTypeGenClass().getMapEntryKeyFeature(); GenFeature valueFeature = genFeature.getMapEntryTypeGenClass().getMapEntryValueFeature(); %>
+ * The key is of type <%if (keyFeature.isListType()) {%>list of {@link <%=keyFeature.getQualifiedListItemType()%>}<%} else {%>{@link <%=keyFeature.getType()%>}<%}%>,
+ * and the value is of type <%if (valueFeature.isListType()) {%>list of {@link <%=valueFeature.getQualifiedListItemType()%>}<%} else {%>{@link <%=valueFeature.getType()%>}<%}%>,
+ <%} else if (!genFeature.isWrappedFeatureMapType() && !(genModel.isSuppressEMFMetaData() && "org.eclipse.emf.ecore.EObject".equals(genFeature.getQualifiedListItemType()))) {%>
+ * The list contents are of type {@link <%=genFeature.getQualifiedListItemType()%>}.
+ <%}%>
+ <%} else if (genFeature.isSetDefaultValue()) {%>
+ * The default value is <code><%=genFeature.getDefaultValue()%></code>.
+ <%}%>
+ <%if (genFeature.getTypeGenEnum() != null) {%>
+ * The literals are from the enumeration {@link <%=genFeature.getTypeGenEnum().getQualifiedName()%>}.
+ <%}%>
+ <%if (genFeature.isBidirectional() && !genFeature.getReverse().getGenClass().isMapEntry()) { GenFeature reverseGenFeature = genFeature.getReverse(); %>
+ <%if (!reverseGenFeature.isSuppressedGetVisibility()) {%>
+ * It is bidirectional and its opposite is '{@link <%=reverseGenFeature.getGenClass().getQualifiedInterfaceName()%>#<%=reverseGenFeature.getGetAccessor()%> <em><%=reverseGenFeature.getFormattedName()%></em>}'.
+ <%}%>
+ <%}%>
+ * <!-- begin-user-doc -->
+ <%if (!genFeature.hasDocumentation()) {%>
+ * <p>
+ * If the meaning of the '<em><%=genFeature.getFormattedName()%></em>' <%=genFeature.getFeatureKind()%> isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ <%}%>
+ * <!-- end-user-doc -->
+ <%if (genFeature.hasDocumentation()) {%>
+ * <!-- begin-model-doc -->
+ * <%=genFeature.getDocumentation(genModel.getIndentation(stringBuffer))%>
+ * <!-- end-model-doc -->
+ <%}%>
+ * @return the value of the '<em><%=genFeature.getFormattedName()%></em>' <%=genFeature.getFeatureKind()%>.
+ <%if (genFeature.getTypeGenEnum() != null) {%>
+ * @see <%=genFeature.getTypeGenEnum().getQualifiedName()%>
+ <%}%>
+ <%if (genFeature.isUnsettable()) {%>
+ <%if (!genFeature.isSuppressedIsSetVisibility()) {%>
+ * @see #isSet<%=genFeature.getAccessorName()%>()
+ <%}%>
+ <%if (genFeature.isChangeable() && !genFeature.isSuppressedUnsetVisibility()) {%>
+ * @see #unset<%=genFeature.getAccessorName()%>()
+ <%}%>
+ <%}%>
+ <%if (genFeature.isChangeable() && !genFeature.isListType() && !genFeature.isSuppressedSetVisibility()) {%>
+ * @see #set<%=genFeature.getAccessorName()%>(<%=genFeature.getImportedType()%>)
+ <%}%>
+ <%if (!genModel.isSuppressEMFMetaData()) {%>
+ * @see <%=genPackage.getQualifiedPackageInterfaceName()%>#get<%=genFeature.getFeatureAccessorName()%>()
+ <%}%>
+ <%if (genFeature.isBidirectional() && !genFeature.getReverse().getGenClass().isMapEntry()) { GenFeature reverseGenFeature = genFeature.getReverse(); %>
+ <%if (!reverseGenFeature.isSuppressedGetVisibility()) {%>
+ * @see <%=reverseGenFeature.getGenClass().getQualifiedInterfaceName()%>#<%=reverseGenFeature.getGetAccessor()%>
+ <%}%>
+ <%}%>
+ <%if (!genModel.isSuppressEMFModelTags()) { boolean first = true; for (StringTokenizer stringTokenizer = new StringTokenizer(genFeature.getModelInfo(), "\n\r"); stringTokenizer.hasMoreTokens(); ) { String modelInfo = stringTokenizer.nextToken(); if (first) { first = false;%>
+ * @model <%=modelInfo%>
+ <%} else {%>
+ * <%=modelInfo%>
+ <%}} if (first) {%>
+ * @model
+ <%}}%>
+ * @generated
+ */
+<%} else {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+<%}%>
+<%if (!isImplementation) {%>
+ <%=genFeature.getImportedType()%> <%=genFeature.getGetAccessor()%>();
+
+<%} else {%>
+ public <%=genFeature.getImportedType()%> <%=genFeature.getGetAccessor()%>()
+ {
+<%@ include file="Class/getGenFeature.pre.insert.javajetinc" fail="silent" %>
+ <%if (genModel.isReflectiveDelegation()) {%>
+ return <%if (genFeature.isPrimitiveType()) {%>(<%}%>(<%=genFeature.getObjectType()%>)get(<%=genFeature.getQualifiedFeatureAccessor()%>, true)<%if (genFeature.isPrimitiveType()) {%>).<%=genFeature.getPrimitiveValueFunction()%>()<%}%>;
+ <%} else if (!genFeature.isVolatile()) {%>
+ <%if (genFeature.isListType()) {%>
+ <%if (genModel.isVirtualDelegation()) {%>
+ <%=genFeature.getImportedType()%> <%=genFeature.getSafeName()%> = (<%=genFeature.getImportedType()%>)eVirtualGet(<%=genFeature.getUpperName()%>);
+ <%}%>
+ if (<%=genFeature.getSafeName()%> == null)
+ {
+ <%if (genModel.isVirtualDelegation()) {%>
+ eVirtualSet(<%=genFeature.getUpperName()%>, <%=genFeature.getSafeName()%> = new <%=genClass.getListConstructor(genFeature)%>);
+ <%} else {
+ if (genFeature.getType().equals("commonj.sdo.Sequence")){%>
+ <%=genFeature.getSafeName()%> = createSequence(INTERNAL_<%=genFeature.getUpperName()%>);<%} else {%>
+ <%=genFeature.getSafeName()%> = createPropertyList(<%=SDOGenUtil.getListKind(genFeature, genFeature.isUnsettable())%>, <%=genFeature.getListItemType()%>.class, <%=genFeature.getUpperName()%>, <%=genFeature.isBidirectional()?genFeature.getReverse().getUpperName():"0" %>);<%}}%>
+ }
+ return <%=genFeature.getSafeName()%><%=genFeature.isMapType() && genFeature.isEffectiveSuppressEMFTypes() ? ".map()" : ""%>;
+ <%} else if (genFeature.isContainer()) {%>
+ if (eContainerFeatureID != <%=genFeature.getUpperName()%>) return null;
+ return (<%=genFeature.getImportedType()%>)eContainer();
+ <%} else {%>
+ <%if (genFeature.isResolveProxies()) {%>
+ <%if (genModel.isVirtualDelegation()) {%>
+ <%=genFeature.getImportedType()%> <%=genFeature.getSafeName()%> = (<%=genFeature.getImportedType()%>)eVirtualGet(<%=genFeature.getUpperName()%><%if (!genFeature.isReferenceType()) {%>, <%=genFeature.getUpperName()%>_DEFAULT_<%}%>);
+ <%}%>
+ if (<%=genFeature.getSafeName()%> != null && isProxy(<%=genFeature.getSafeName()%>))
+ {
+ Object old<%=genFeature.getCapName()%> = <%=genFeature.getSafeName()%>;
+ <%=genFeature.getSafeName()%> = <%=genFeature.getNonEObjectInternalTypeCast()%>resolveProxy(old<%=genFeature.getCapName()%>);
+ if (<%=genFeature.getSafeName()%> != old<%=genFeature.getCapName()%>)
+ {
+ <%if (genFeature.isEffectiveContains()) {%>
+ <%=genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject")%> new<%=genFeature.getCapName()%> = (<%=genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject")%>)<%=genFeature.getSafeName()%>;
+ <%if (!genFeature.isBidirectional()) {%>
+ ChangeContext changeContext = old<%=genFeature.getCapName()%>.inverseRemove(this, EOPPOSITE_FEATURE_BASE - <%=genFeature.getUpperName()%>, null, null);
+ <%} else { GenFeature reverseFeature = genFeature.getReverse(); GenClass targetClass = reverseFeature.getGenClass();%>
+ <%=genModel.getImportedName("org.eclipse.emf.common.notify.ChangeContext")%> changeContext = old<%=genFeature.getCapName()%>.inverseRemove(this, <%=targetClass.getQualifiedFeatureID(reverseFeature)%>, <%=targetClass.getImportedInterfaceName()%>.class, null);
+ <%}%>
+ if (new<%=genFeature.getCapName()%>.eInternalContainer() == null)
+ {
+ <%if (!genFeature.isBidirectional()) {%>
+ changeContext = new<%=genFeature.getCapName()%>.eInverseAdd(this, EOPPOSITE_FEATURE_BASE - <%=genFeature.getUpperName()%>, null, changeContext);
+ <%} else { GenFeature reverseFeature = genFeature.getReverse(); GenClass targetClass = reverseFeature.getGenClass();%>
+ changeContext = new<%=genFeature.getCapName()%>.eInverseAdd(this, <%=targetClass.getQualifiedFeatureID(reverseFeature)%>, <%=targetClass.getImportedInterfaceName()%>.class, changeContext);
+ <%}%>
+ }
+ if (changeContext != null) dispatch(changeContext);
+ <%} else if (genModel.isVirtualDelegation()) {%>
+ eVirtualSet(<%=genFeature.getUpperName()%>, <%=genFeature.getSafeName()%>);
+ <%}%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ if (isNotifying())
+ notify(ChangeKind.RESOLVE, <%=genFeature.getUpperName()%>, old<%=genFeature.getCapName()%>, <%=genFeature.getSafeName()%>);
+ <%}%>
+ }
+ }
+ <%}%>
+ <%if (!genFeature.isResolveProxies() && genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {%>
+ return (<%=genFeature.getImportedType()%>)eVirtualGet(<%=genFeature.getUpperName()%><%if (!genFeature.isReferenceType()) {%>, <%=genFeature.getUpperName()%>_DEFAULT_<%}%>);
+ <%} else if (genClass.isFlag(genFeature)) {%>
+ return (<%=genClass.getFlagsField(genFeature)%> & <%=genFeature.getUpperName()%>_EFLAG) != 0;
+ <%} else {%>
+ return <%=genFeature.getSafeName()%>;
+ <%}%>
+ <%}%>
+ <%} else {//volatile%>
+ <%if (genFeature.isResolveProxies() && !genFeature.isListType()) {%>
+ <%=genFeature.getImportedType()%> <%=genFeature.getSafeName()%> = basicGet<%=genFeature.getAccessorName()%>();
+ return <%=genFeature.getSafeName()%> != null && <%=genFeature.getSafeName()%>.isProxy() ? <%=genFeature.getNonEObjectInternalTypeCast()%>eResolveProxy((<%=genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject")%>)<%=genFeature.getSafeName()%>) : <%=genFeature.getSafeName()%>;
+ <%} else if (genFeature.hasDelegateFeature()) { GenFeature delegateFeature = genFeature.getDelegateFeature(); // AAAA%>
+ <%if (genFeature.isFeatureMapType()) {%>
+ <%if (delegateFeature.isWrappedFeatureMapType()) {%>
+ return create<%=genFeature.getImportedType()%>(get<%=delegateFeature.getAccessorName()%>(), getType(), INTERNAL_<%=genFeature.getUpperName()%>);
+ <%} else {%>
+ return (<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")%>)((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")%>)get<%=delegateFeature.getAccessorName()%>()).list(<%=genFeature.getQualifiedFeatureAccessor()%>);
+ <%}%>
+ <%} else if (genFeature.isListType()) {%>
+ <%if (delegateFeature.isWrappedFeatureMapType()) {%>
+ return get<%=genFeature.getImportedType()%>(get<%=delegateFeature.getAccessorName()%>(), getType(), INTERNAL_<%=genFeature.getUpperName()%>);
+ <%} else {%>
+ return ((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")%>)get<%=delegateFeature.getAccessorName()%>()).list(<%=genFeature.getQualifiedFeatureAccessor()%>);
+ <%}%>
+ <%} else {%>
+ <%if (delegateFeature.isWrappedFeatureMapType()) {%>
+ return <%if (genFeature.isPrimitiveType()) {%>(<%}%>(<%=genFeature.getObjectType()%>)get(get<%=delegateFeature.getAccessorName()%>(), getType(), INTERNAL_<%=genFeature.getUpperName()%>)<%if (genFeature.isPrimitiveType()) {%>).<%=genFeature.getPrimitiveValueFunction()%>()<%}%>;
+ <%} else {%>
+ return <%if (genFeature.isPrimitiveType()) {%>(<%}%>(<%=genFeature.getObjectType()%>)get(get<%=delegateFeature.getAccessorName()%>(), getType(), INTERNAL_<%=genFeature.getUpperName()%>)<%if (genFeature.isPrimitiveType()) {%>).<%=genFeature.getPrimitiveValueFunction()%>()<%}%>;
+ <%}%>
+ <%}%>
+ <%} else {%>
+<%@ include file="Class/getGenFeature.TODO.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ // TODO: implement this method to return the '<%=genFeature.getFormattedName()%>' <%=genFeature.getFeatureKind()%>
+ // Ensure that you remove @generated or mark it @generated NOT
+ throw new UnsupportedOperationException();
+<%@ end %><%//Class/getGenFeature.todo.override.javajetinc%>
+ <%}%>
+ <%}%>
+ }
+<%}%>
+<%@ end %><%//Class/getGenFeature.override.javajetinc%>
+ <%}%>
+ <%if (isImplementation && !genModel.isReflectiveDelegation() && genFeature.isBasicGet()) {%>
+<%@ include file="Class/basicGetGenFeature.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public <%=genFeature.getImportedType()%> basicGet<%=genFeature.getAccessorName()%>()
+ {
+<%@ include file="Class/basicGetGenFeature.pre.insert.javajetinc" fail="silent" %>
+ <%if (genFeature.isContainer()) {%>
+ if (eContainerFeatureID != <%=genFeature.getUpperName()%>) return null;
+ return (<%=genFeature.getImportedType()%>)eInternalContainer();
+ <%} else if (!genFeature.isVolatile()) {%>
+ <%if (genModel.isVirtualDelegation()) {%>
+ return (<%=genFeature.getImportedType()%>)eVirtualGet(<%=genFeature.getUpperName()%>);
+ <%} else {%>
+ return <%=genFeature.getSafeName()%>;
+ <%}%>
+ <%} else if (genFeature.hasDelegateFeature()) { GenFeature delegateFeature = genFeature.getDelegateFeature(); //BBBB%>
+ <%if (delegateFeature.isWrappedFeatureMapType()) {%>
+ return (<%=genFeature.getImportedType()%>)get(get<%=delegateFeature.getAccessorName()%>(), getType(), INTERNAL_<%=genFeature.getUpperName()%>);
+ <%} else {%>
+ return (<%=genFeature.getImportedType()%>)get<%=delegateFeature.getAccessorName()%>().get(<%=genFeature.getQualifiedFeatureAccessor()%>, false);
+ <%}%>
+ <%} else {%>
+<%@ include file="Class/basicGetGenFeature.TODO.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ // TODO: implement this method to return the '<%=genFeature.getFormattedName()%>' <%=genFeature.getFeatureKind()%>
+ // -> do not perform proxy resolution
+ // Ensure that you remove @generated or mark it @generated NOT
+ throw new UnsupportedOperationException();
+<%@ end %><%//Class/basicGetGenFeature.todo.override.javajetinc%>
+ <%}%>
+ }
+
+<%@ end %><%//Class/basicGetGenFeature.override.javajetinc%>
+ <%}%>
+ <%if (isImplementation && !genModel.isReflectiveDelegation() && genFeature.isBasicSet()) {%>
+<%@ include file="Class/basicSetGenFeature.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeContext basicSet<%=genFeature.getAccessorName()%>(<%=genFeature.getImportedInternalType()%> new<%=genFeature.getCapName()%>, ChangeContext changeContext)
+ {
+ <%if (!genFeature.isVolatile()) {%>
+<%@ include file="Class/basicSetGenFeature.pre.insert.javajetinc" fail="silent" %>
+ <%if (genModel.isVirtualDelegation()) {%>
+ Object old<%=genFeature.getCapName()%> = eVirtualSet(<%=genFeature.getUpperName()%>, new<%=genFeature.getCapName()%>);
+ <%} else {%>
+ <%=genFeature.getImportedType()%> old<%=genFeature.getCapName()%> = <%=genFeature.getSafeName()%>;
+ <%=genFeature.getSafeName()%> = new<%=genFeature.getCapName()%>;
+ <%}%>
+ <%if (genFeature.isUnsettable()) {%>
+ <%if (genModel.isVirtualDelegation()) {%>
+ boolean isSetChange = old<%=genFeature.getCapName()%> == EVIRTUAL_NO_VALUE;
+ <%} else if (genClass.isESetFlag(genFeature)) {%>
+ boolean old<%=genFeature.getCapName()%>_set_ = (<%=genClass.getESetFlagsField(genFeature)%> & <%=genFeature.getUpperName()%>_ESETFLAG) != 0;
+ <%=genClass.getESetFlagsField(genFeature)%> |= <%=genFeature.getUpperName()%>_ESETFLAG;
+ <%} else {%>
+ boolean old<%=genFeature.getCapName()%>_set_ = <%=genFeature.getUncapName()%>_set_;
+ <%=genFeature.getUncapName()%>_set_ = true;
+ <%}%>
+ <%}%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ if (isNotifying())
+ {
+ <%if (genFeature.isUnsettable()) {%>
+ addNotification(this, ChangeKind.SET, <%=genFeature.getUpperName()%>, <%if (genModel.isVirtualDelegation()) {%>isSetChange ? null : old<%=genFeature.getCapName()%><%} else {%>old<%=genFeature.getCapName()%><%}%>, new<%=genFeature.getCapName()%>, <%if (genModel.isVirtualDelegation()) {%>isSetChange<%} else {%>!old<%=genFeature.getCapName()%>_set_<%}%>, changeContext);
+ <%} else {%>
+ addNotification(this, ChangeKind.SET, <%=genFeature.getUpperName()%>, <%if (genModel.isVirtualDelegation()) {%>old<%=genFeature.getCapName()%> == EVIRTUAL_NO_VALUE ? null : old<%=genFeature.getCapName()%><%} else {%>old<%=genFeature.getCapName()%><%}%>, new<%=genFeature.getCapName()%>, changeContext);
+ <%}%>
+ }
+ <%}%>
+<%@ include file="Class/basicSetGenFeature.post.insert.javajetinc" fail="silent" %>
+ return changeContext;
+ <%} else if (genFeature.hasDelegateFeature()) { GenFeature delegateFeature = genFeature.getDelegateFeature(); //CCCC%>
+ <%if (delegateFeature.isWrappedFeatureMapType()) {%>
+ return basicAdd(get<%=delegateFeature.getAccessorName()%>(), getType(), INTERNAL_<%=genFeature.getUpperName()%>, new<%=genFeature.getCapName()%>, changeContext);
+ <%} else {%>
+ return basicAdd(get<%=delegateFeature.getAccessorName()%>(), getType(), INTERNAL_<%=genFeature.getUpperName()%>, new<%=genFeature.getCapName()%>, changeContext);
+ <%}%>
+ <%} else {%>
+<%@ include file="Class/basicSetGenFeature.TODO.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ // TODO: implement this method to set the contained '<%=genFeature.getFormattedName()%>' <%=genFeature.getFeatureKind()%>
+ // -> this method is automatically invoked to keep the containment relationship in synch
+ // -> do not modify other features
+ // -> return changeContext, after adding any generated Notification to it (if it is null, a NotificationChain object must be created first)
+ // Ensure that you remove @generated or mark it @generated NOT
+ throw new UnsupportedOperationException();
+<%@ end %><%//Class/basicSetGenFeature.todo.override.javajetinc%>
+ <%}%>
+ }
+
+<%@ end %><%//Class/basicSetGenFeature.override.javajetinc%>
+ <%}%>
+ <%if (genFeature.isSet() && (isImplementation || !genFeature.isSuppressedSetVisibility())) {%>
+<%@ include file="Class/setGenFeature.override.javajetinc" fail="alternative" %>
+<%@ start %>
+<%if (isInterface) { %>
+ /**
+ * Sets the value of the '{@link <%=genClass.getQualifiedInterfaceName()%>#<%=genFeature.getGetAccessor()%> <em><%=genFeature.getFormattedName()%></em>}' <%=genFeature.getFeatureKind()%>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em><%=genFeature.getFormattedName()%></em>' <%=genFeature.getFeatureKind()%>.
+ <%if (genFeature.isEnumType()) {%>
+ * @see <%=genFeature.getTypeGenEnum().getQualifiedName()%>
+ <%}%>
+ <%if (genFeature.isUnsettable()) {%>
+ <%if (!genFeature.isSuppressedIsSetVisibility()) {%>
+ * @see #isSet<%=genFeature.getAccessorName()%>()
+ <%}%>
+ <%if (!genFeature.isSuppressedUnsetVisibility()) {%>
+ * @see #unset<%=genFeature.getAccessorName()%>()
+ <%}%>
+ <%}%>
+ * @see #<%=genFeature.getGetAccessor()%>()
+ * @generated
+ */
+<%} else {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+<%}%>
+<%if (!isImplementation) { %>
+ void set<%=genFeature.getAccessorName()%>(<%=genFeature.getImportedType()%> value);
+
+<%} else {%>
+ public void set<%=genFeature.getAccessorName()%>(<%=genFeature.getImportedType()%> new<%=genFeature.getCapName()%>)
+ {
+<%@ include file="Class/setGenFeature.pre.insert.javajetinc" fail="alternative" %>
+ <%if (genModel.isReflectiveDelegation()) {%>
+ _set_(<%=genFeature.getQualifiedFeatureAccessor()%>, <%if (genFeature.isPrimitiveType()) {%>new <%=genFeature.getObjectType()%>(<%}%>new<%=genFeature.getCapName()%><%if (genFeature.isPrimitiveType()) {%>)<%}%>);
+ <%} else if (!genFeature.isVolatile()) {%>
+ <%if (genFeature.isContainer()) { GenFeature reverseFeature = genFeature.getReverse(); GenClass targetClass = reverseFeature.getGenClass();%>
+ if (new<%=genFeature.getCapName()%> != eInternalContainer() || (eContainerFeatureID != <%=genFeature.getUpperName()%> && new<%=genFeature.getCapName()%> != null))
+ {
+ if (<%=genModel.getImportedName("org.eclipse.emf.ecore.util.EcoreUtil")%>.isAncestor(this, <%=genFeature.getEObjectCast()%>new<%=genFeature.getCapName()%>))
+ throw new <%=genModel.getImportedName("java.lang.IllegalArgumentException")%>("Recursive containment not allowed for " + toString());<%=genModel.getNonNLS()%>
+ ChangeContext changeContext = null;
+ if (eInternalContainer() != null)
+ changeContext = eBasicRemoveFromContainer(changeContext);
+ if (new<%=genFeature.getCapName()%> != null)
+ changeContext = ((<%=genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject")%>)new<%=genFeature.getCapName()%>).eInverseAdd(this, <%=targetClass.getQualifiedFeatureID(reverseFeature)%>, <%=targetClass.getImportedInterfaceName()%>.class, changeContext);
+ changeContext = eBasicSetContainer((<%=genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject")%>)new<%=genFeature.getCapName()%>, <%=genFeature.getUpperName()%>, changeContext);
+ if (changeContext != null) dispatch(changeContext);
+ }
+ <%if (!genModel.isSuppressNotification()) {%>
+ else if (isNotifying())
+ notify(ChangeKind.SET, <%=genFeature.getUpperName()%>, new<%=genFeature.getCapName()%>, new<%=genFeature.getCapName()%>);
+ <%}%>
+ <%} else if (genFeature.isBidirectional() || genFeature.isEffectiveContains()) {%>
+ <%if (genModel.isVirtualDelegation()) {%>
+ <%=genFeature.getImportedType()%> <%=genFeature.getSafeName()%> = (<%=genFeature.getImportedType()%>)eVirtualGet(<%=genFeature.getUpperName()%>);
+ <%}%>
+ if (new<%=genFeature.getCapName()%> != <%=genFeature.getSafeName()%>)
+ {
+ ChangeContext changeContext = null;
+ if (<%=genFeature.getSafeName()%> != null)
+ <%if (!genFeature.isBidirectional()) {%>
+ changeContext = inverseRemove(<%=genFeature.getSafeName()%>, this, OPPOSITE_FEATURE_BASE - <%=genFeature.getUpperName()%>, null, changeContext);
+ if (new<%=genFeature.getCapName()%> != null)
+ changeContext = inverseAdd(new<%=genFeature.getCapName()%>, this, OPPOSITE_FEATURE_BASE - <%=genFeature.getUpperName()%>, null, changeContext);
+ <%} else { GenFeature reverseFeature = genFeature.getReverse(); GenClass targetClass = reverseFeature.getGenClass();%>
+ changeContext = inverseRemove(<%=genFeature.getSafeName()%>, this, <%=targetClass.getQualifiedFeatureID(reverseFeature)%>, <%=targetClass.getImportedInterfaceName()%>.class, changeContext);
+ if (new<%=genFeature.getCapName()%> != null)
+ changeContext = inverseAdd(new<%=genFeature.getCapName()%>, this, <%=targetClass.getQualifiedFeatureID(reverseFeature)%>, <%=targetClass.getImportedInterfaceName()%>.class, changeContext);
+ <%}%>
+ changeContext = basicSet<%=genFeature.getAccessorName()%>(<%=genFeature.getInternalTypeCast()%>new<%=genFeature.getCapName()%>, changeContext);
+ if (changeContext != null) dispatch(changeContext);
+ }
+ <%if (genFeature.isUnsettable()) {%>
+ else
+ {
+ <%if (genModel.isVirtualDelegation()) {%>
+ boolean old<%=genFeature.getCapName()%>_set_ = eVirtualIsSet(<%=genFeature.getUpperName()%>);
+ <%} else if (genClass.isESetFlag(genFeature)) {%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ boolean old<%=genFeature.getCapName()%>_set_ = (<%=genClass.getESetFlagsField(genFeature)%> & <%=genFeature.getUpperName()%>_ESETFLAG) != 0;
+ <%}%>
+ <%=genClass.getESetFlagsField(genFeature)%> |= <%=genFeature.getUpperName()%>_ESETFLAG;
+ <%} else {%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ boolean old<%=genFeature.getCapName()%>_set_ = <%=genFeature.getUncapName()%>_set_;
+ <%}%>
+ <%=genFeature.getUncapName()%>_set_ = true;
+ <%}%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ if (isNotifying())
+ notify(ChangeKind.SET, <%=genFeature.getUpperName()%>, new<%=genFeature.getCapName()%>, new<%=genFeature.getCapName()%>, !old<%=genFeature.getCapName()%>_set_);
+ <%}%>
+ }
+ <%} else {%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ else if (isNotifying())
+ notify(ChangeKind.SET, <%=genFeature.getUpperName()%>, new<%=genFeature.getCapName()%>, new<%=genFeature.getCapName()%>);
+ <%}%>
+ <%}%>
+ <%} else {%>
+ <%if (genClass.isFlag(genFeature)) {%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ <%=genFeature.getImportedType()%> old<%=genFeature.getCapName()%> = (<%=genClass.getFlagsField(genFeature)%> & <%=genFeature.getUpperName()%>_EFLAG) != 0;
+ <%}%>
+ if (new<%=genFeature.getCapName()%>) <%=genClass.getFlagsField(genFeature)%> |= <%=genFeature.getUpperName()%>_EFLAG; else <%=genClass.getFlagsField(genFeature)%> &= ~<%=genFeature.getUpperName()%>_EFLAG;
+ <%} else {%>
+ <%if (!genModel.isVirtualDelegation() || genFeature.isPrimitiveType()) {%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ <%=genFeature.getImportedType()%> old<%=genFeature.getCapName()%> = <%=genFeature.getSafeName()%>;
+ <%}%>
+ <%}%>
+ <%if (genFeature.isEnumType()) {%>
+ <%if (genModel.isVirtualDelegation()) {%>
+ <%=genFeature.getImportedType()%> <%=genFeature.getSafeName()%> = new<%=genFeature.getCapName()%> == null ? <%=genFeature.getUpperName()%>_DEFAULT_ : new<%=genFeature.getCapName()%>;
+ <%} else {%>
+ <%=genFeature.getSafeName()%> = new<%=genFeature.getCapName()%> == null ? <%=genFeature.getUpperName()%>_DEFAULT_ : new<%=genFeature.getCapName()%>;
+ <%}%>
+ <%} else {%>
+ <%if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {%>
+ <%=genFeature.getImportedType()%> <%=genFeature.getSafeName()%> = <%=genFeature.getInternalTypeCast()%>new<%=genFeature.getCapName()%>;
+ <%} else {%>
+ <%=genFeature.getSafeName()%> = <%=genFeature.getInternalTypeCast()%>new<%=genFeature.getCapName()%>;
+ <%}%>
+ <%}%>
+ <%if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {%>
+ Object old<%=genFeature.getCapName()%> = eVirtualSet(<%=genFeature.getUpperName()%>, <%=genFeature.getSafeName()%>);
+ <%}%>
+ <%}%>
+ <%if (genFeature.isUnsettable()) {%>
+ <%if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {%>
+ boolean isSetChange = old<%=genFeature.getCapName()%> == EVIRTUAL_NO_VALUE;
+ <%} else if (genClass.isESetFlag(genFeature)) {%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ boolean old<%=genFeature.getCapName()%>_set_ = (<%=genClass.getESetFlagsField(genFeature)%> & <%=genFeature.getUpperName()%>_ESETFLAG) != 0;
+ <%}%>
+ <%=genClass.getESetFlagsField(genFeature)%> |= <%=genFeature.getUpperName()%>_ESETFLAG;
+ <%} else {%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ boolean old<%=genFeature.getCapName()%>_set_ = <%=genFeature.getUncapName()%>_set_;
+ <%}%>
+ <%=genFeature.getUncapName()%>_set_ = true;
+ <%}%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ if (isNotifying())
+ notify(ChangeKind.SET, <%=genFeature.getUpperName()%>, <%if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {%>isSetChange ? <%if (genFeature.isReferenceType()) {%>null<%} else {%><%=genFeature.getUpperName()%>_DEFAULT_<%}%> : old<%=genFeature.getCapName()%><%} else {%>old<%=genFeature.getCapName()%><%}%>, <%if (genClass.isFlag(genFeature)) {%>new<%=genFeature.getCapName()%><%} else {%><%=genFeature.getSafeName()%><%}%>, <%if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {%>isSetChange<%} else {%>!old<%=genFeature.getCapName()%>_set_<%}%>);
+ <%}%>
+ <%} else {%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ if (isNotifying())
+ notify(ChangeKind.SET, <%=genFeature.getUpperName()%>, <%if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {%>old<%=genFeature.getCapName()%> == EVIRTUAL_NO_VALUE ? <%if (genFeature.isReferenceType()) {%>null<%} else {%><%=genFeature.getUpperName()%>_DEFAULT_<%}%> : old<%=genFeature.getCapName()%><%} else {%>old<%=genFeature.getCapName()%><%}%>, <%if (genClass.isFlag(genFeature)) {%>new<%=genFeature.getCapName()%><%} else {%><%=genFeature.getSafeName()%><%}%>);
+ <%}%>
+ <%}%>
+ <%}%>
+<%@ include file="Class/setGenFeature.post.insert.javajetinc" fail="silent" %>
+ <%} else if (genFeature.hasDelegateFeature()) { GenFeature delegateFeature = genFeature.getDelegateFeature(); // DDDD%>
+ <%if (delegateFeature.isWrappedFeatureMapType()) {%>
+ set(get<%=delegateFeature.getAccessorName()%>(), getType(), INTERNAL_<%=genFeature.getUpperName()%>, <%if (genFeature.isPrimitiveType()){%> new <%=genFeature.getObjectType()%>(<%}%>new<%=genFeature.getCapName()%><%if (genFeature.isPrimitiveType()){%>)<%}%>);
+ <%} else {%>
+ ((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")%>.Internal)get<%=delegateFeature.getAccessorName()%>()).set(<%=genFeature.getQualifiedFeatureAccessor()%>, <%if (genFeature.isPrimitiveType()) {%>new <%=genFeature.getObjectType()%>(<%}%>new<%=genFeature.getCapName()%><%if (genFeature.isPrimitiveType()){%>)<%}%>);
+ <%}%>
+ <%} else {%>
+<%@ include file="Class/setGenFeature.TODO.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ // TODO: implement this method to set the '<%=genFeature.getFormattedName()%>' <%=genFeature.getFeatureKind()%>
+ // Ensure that you remove @generated or mark it @generated NOT
+ throw new UnsupportedOperationException();
+<%@ end %><%//Class/setGenFeature.todo.override.javajetinc%>
+ <%}%>
+ }
+
+<%}%>
+<%@ end %><%//Class/setGenFeature.override.javajetinc%>
+ <%}%>
+ <%if (isImplementation && !genModel.isReflectiveDelegation() && genFeature.isBasicUnset()) {%>
+<%@ include file="Class/basicUnsetGenFeature.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeContext basicUnset<%=genFeature.getAccessorName()%>(ChangeContext changeContext)
+ {
+ <%if (!genFeature.isVolatile()) {%>
+ <%if (genModel.isVirtualDelegation()) {%>
+ Object old<%=genFeature.getCapName()%> = eVirtualUnset(<%=genFeature.getUpperName()%>);
+ <%} else {%>
+ <%=genFeature.getImportedType()%> old<%=genFeature.getCapName()%> = <%=genFeature.getSafeName()%>;
+ <%=genFeature.getSafeName()%> = null;
+ <%}%>
+ <%if (genModel.isVirtualDelegation()) {%>
+ boolean isSetChange = old<%=genFeature.getCapName()%> != EVIRTUAL_NO_VALUE;
+ <%} else if (genClass.isESetFlag(genFeature)) {%>
+ boolean old<%=genFeature.getCapName()%>_set_ = (<%=genClass.getESetFlagsField(genFeature)%> & <%=genFeature.getUpperName()%>_ESETFLAG) != 0;
+ <%=genClass.getESetFlagsField(genFeature)%> &= ~<%=genFeature.getUpperName()%>_ESETFLAG;
+ <%} else {%>
+ boolean old<%=genFeature.getCapName()%>_set_ = <%=genFeature.getUncapName()%>_set_;
+ <%=genFeature.getUncapName()%>_set_ = false;
+ <%}%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ if (isNotifying())
+ {
+ <%if (genFeature.isUnsettable()) {%>
+ addNotification(this, ChangeKind.UNSET, <%=genFeature.getUpperName()%>, <%if (genModel.isVirtualDelegation()) {%>isSetChange ? null : old<%=genFeature.getCapName()%><%} else {%>old<%=genFeature.getCapName()%><%}%>, null, <%if (genModel.isVirtualDelegation()) {%>isSetChange<%} else {%>!old<%=genFeature.getCapName()%>_set_<%}%>, changeContext);
+ <%} else {%>
+ addNotification(this, ChangeKind.UNSET, <%=genFeature.getUpperName()%>, <%if (genModel.isVirtualDelegation()) {%>old<%=genFeature.getCapName()%> == EVIRTUAL_NO_VALUE ? null : old<%=genFeature.getCapName()%><%} else {%>old<%=genFeature.getCapName()%><%}%>, null, changeContext);
+ <%}%>
+ }
+ <%}%>
+ return changeContext;
+ <%} else {%>
+<%@ include file="Class/basicUnsetGenFeature.TODO.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ // TODO: implement this method to unset the contained '<%=genFeature.getFormattedName()%>' <%=genFeature.getFeatureKind()%>
+ // -> this method is automatically invoked to keep the containment relationship in synch
+ // -> do not modify other features
+ // -> return changeContext, after adding any generated Notification to it (if it is null, a NotificationChain object must be created first)
+ // Ensure that you remove @generated or mark it @generated NOT
+ throw new UnsupportedOperationException();
+<%@ end %><%//Class/basicUnsetGenFeature.todo.override.javajetinc%>
+ <%}%>
+ }
+
+<%@ end %><%//Class.basicUnsetGenFeature.override.javajetinc%>
+ <%}%>
+ <%if (genFeature.isUnset() && (isImplementation || !genFeature.isSuppressedUnsetVisibility())) {%>
+<%@ include file="Class/unsetGenFeature.override.javajetinc" fail="alternative" %>
+<%@ start %>
+<%if (isInterface) {%>
+ /**
+ * Unsets the value of the '{@link <%=genClass.getQualifiedInterfaceName()%>#<%=genFeature.getGetAccessor()%> <em><%=genFeature.getFormattedName()%></em>}' <%=genFeature.getFeatureKind()%>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ <%if (!genFeature.isSuppressedIsSetVisibility()) {%>
+ * @see #isSet<%=genFeature.getAccessorName()%>()
+ <%}%>
+ * @see #<%=genFeature.getGetAccessor()%>()
+ <%if (!genFeature.isListType() && !genFeature.isSuppressedSetVisibility()) {%>
+ * @see #set<%=genFeature.getAccessorName()%>(<%=genFeature.getImportedType()%>)
+ <%}%>
+ * @generated
+ */
+<%} else {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+<%}%>
+<%if (!isImplementation) {%>
+ void unset<%=genFeature.getAccessorName()%>();
+
+<%} else {%>
+ public void unset<%=genFeature.getAccessorName()%>()
+ {
+ <%if (genModel.isReflectiveDelegation()) {%>
+ unset(<%=genFeature.getQualifiedFeatureAccessor()%>);
+ <%} else if (!genFeature.isVolatile()) {%>
+ <%if (genFeature.isListType()) {%>
+ ((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.InternalEList")%>.Unsettable)get<%=genFeature.getAccessorName()%>()).unset();
+ <%} else if (genFeature.isBidirectional() || genFeature.isEffectiveContains()) {%>
+ <%if (genModel.isVirtualDelegation()) {%>
+ <%=genFeature.getImportedType()%> <%=genFeature.getSafeName()%> = (<%=genFeature.getImportedType()%>)eVirtualGet(<%=genFeature.getUpperName()%>);
+ <%}%>
+ if (<%=genFeature.getSafeName()%> != null)
+ {
+ ChangeContext changeContext = null;
+ <%if (!genFeature.isBidirectional()) {%>
+ changeContext = inverseRemove(<%=genFeature.getSafeName()%>, this, EOPPOSITE_FEATURE_BASE - <%=genFeature.getUpperName()%>, null, changeContext);
+ <%} else { GenFeature reverseFeature = genFeature.getReverse(); GenClass targetClass = reverseFeature.getGenClass();%>
+ changeContext = inverseRemove(<%=genFeature.getSafeName()%>, this, <%=targetClass.getQualifiedFeatureID(reverseFeature)%>, <%=targetClass.getImportedInterfaceName()%>.class, changeContext);
+ <%}%>
+ changeContext = basicUnset<%=genFeature.getAccessorName()%>(changeContext);
+ if (changeContext != null) dispatch(changeContext);
+ }
+ else
+ {
+ <%if (genModel.isVirtualDelegation()) {%>
+ boolean old<%=genFeature.getCapName()%>_set_ = eVirtualIsSet(<%=genFeature.getUpperName()%>);
+ <%} else if (genClass.isESetFlag(genFeature)) {%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ boolean old<%=genFeature.getCapName()%>_set_ = (<%=genClass.getESetFlagsField(genFeature)%> & <%=genFeature.getUpperName()%>_ESETFLAG) != 0;
+ <%}%>
+ <%=genClass.getESetFlagsField(genFeature)%> &= ~<%=genFeature.getUpperName()%>_ESETFLAG;
+ <%} else {%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ boolean old<%=genFeature.getCapName()%>_set_ = <%=genFeature.getUncapName()%>_set_;
+ <%}%>
+ <%=genFeature.getUncapName()%>_set_ = false;
+ <%}%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ if (isNotifying())
+ notify(ChangeKind.UNSET, <%=genFeature.getUpperName()%>, null, null, old<%=genFeature.getCapName()%>_set_);
+ <%}%>
+ }
+ <%} else {%>
+ <%if (genClass.isFlag(genFeature)) {%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ <%=genFeature.getImportedType()%> old<%=genFeature.getCapName()%> = (<%=genClass.getFlagsField(genFeature)%> & <%=genFeature.getUpperName()%>_EFLAG) != 0;
+ <%}%>
+ <%} else if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {%>
+ Object old<%=genFeature.getCapName()%> = eVirtualUnset(<%=genFeature.getUpperName()%>);
+ <%} else {%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ <%=genFeature.getImportedType()%> old<%=genFeature.getCapName()%> = <%=genFeature.getSafeName()%>;
+ <%}%>
+ <%}%>
+ <%if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {%>
+ boolean isSetChange = old<%=genFeature.getCapName()%> != EVIRTUAL_NO_VALUE;
+ <%} else if (genClass.isESetFlag(genFeature)) {%>
+ boolean old<%=genFeature.getCapName()%>_set_ = (<%=genClass.getESetFlagsField(genFeature)%> & <%=genFeature.getUpperName()%>_ESETFLAG) != 0;
+ <%} else {%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ boolean old<%=genFeature.getCapName()%>_set_ = <%=genFeature.getUncapName()%>_set_;
+ <%}%>
+ <%}%>
+ <%if (genFeature.isReferenceType()) {%>
+ <%=genFeature.getSafeName()%> = null;
+ <%if (!genModel.isVirtualDelegation()) {%>
+ <%if (genClass.isESetFlag(genFeature)) {%>
+ <%=genClass.getESetFlagsField(genFeature)%> &= ~<%=genFeature.getUpperName()%>_ESETFLAG;
+ <%} else {%>
+ <%=genFeature.getUncapName()%>_set_ = false;
+ <%}%>
+ <%}%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ if (isNotifying())
+ notify(ChangeKind.UNSET, <%=genFeature.getUpperName()%>, <%if (genModel.isVirtualDelegation()) {%>isSetChange ? old<%=genFeature.getCapName()%> : null<%} else {%>old<%=genFeature.getCapName()%><%}%>, null, <%if (genModel.isVirtualDelegation()) {%>isSetChange<%} else {%>old<%=genFeature.getCapName()%>_set_<%}%>);
+ <%}%>
+ <%} else {%>
+ <%if (genClass.isFlag(genFeature)) {%>
+ if (<%=genFeature.getUpperName()%>_DEFAULT_) <%=genClass.getFlagsField(genFeature)%> |= <%=genFeature.getUpperName()%>_EFLAG; else <%=genClass.getFlagsField(genFeature)%> &= ~<%=genFeature.getUpperName()%>_EFLAG;
+ <%} else if (!genModel.isVirtualDelegation() || genFeature.isPrimitiveType()) {%>
+ <%=genFeature.getSafeName()%> = <%=genFeature.getUpperName()%>_DEFAULT_;
+ <%}%>
+ <%if (!genModel.isVirtualDelegation() || genFeature.isPrimitiveType()) {%>
+ <%if (genClass.isESetFlag(genFeature)) {%>
+ <%=genClass.getESetFlagsField(genFeature)%> &= ~<%=genFeature.getUpperName()%>_ESETFLAG;
+ <%} else {%>
+ <%=genFeature.getUncapName()%>_set_ = false;
+ <%}%>
+ <%}%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ if (isNotifying())
+ notify(ChangeKind.UNSET, <%=genFeature.getUpperName()%>, <%if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {%>isSetChange ? old<%=genFeature.getCapName()%> : <%=genFeature.getUpperName()%>_DEFAULT_<%} else {%>old<%=genFeature.getCapName()%><%}%>, <%=genFeature.getUpperName()%>_DEFAULT_, <%if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {%>isSetChange<%} else {%>old<%=genFeature.getCapName()%>_set_<%}%>);
+ <%}%>
+ <%}%>
+ <%}%>
+ <%} else if (genFeature.hasDelegateFeature()) { GenFeature delegateFeature = genFeature.getDelegateFeature(); //EEEE%>
+ <%if (delegateFeature.isWrappedFeatureMapType()) {%>
+ unset(get<%=delegateFeature.getAccessorName()%>(), getType(), INTERNAL_<%=genFeature.getUpperName()%>);
+ <%} else {%>
+ unset<%=genFeature.getImportedType()%>(get<%=delegateFeature.getAccessorName()%>());
+ <%}%>
+ <%} else {%>
+<%@ include file="Class/unsetGenFeature.TODO.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ // TODO: implement this method to unset the '<%=genFeature.getFormattedName()%>' <%=genFeature.getFeatureKind()%>
+ // Ensure that you remove @generated or mark it @generated NOT
+ throw new UnsupportedOperationException();
+<%@ end %><%//Class/unsetGenFeature.todo.override.javajetinc%>
+ <%}%>
+ }
+
+<%}%>
+<%@ end %><%//Class/unsetGenFeature.override.javajetinc%>
+ <%}%>
+ <%if (genFeature.isIsSet() && (isImplementation || !genFeature.isSuppressedIsSetVisibility())) {%>
+<%@ include file="Class/isSetGenFeature.override.javajetinc" fail="alternative" %>
+<%@ start %>
+<%if (isInterface) {%>
+ /**
+ * Returns whether the value of the '{@link <%=genClass.getQualifiedInterfaceName()%>#<%=genFeature.getGetAccessor()%> <em><%=genFeature.getFormattedName()%></em>}' <%=genFeature.getFeatureKind()%> is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em><%=genFeature.getFormattedName()%></em>' <%=genFeature.getFeatureKind()%> is set.
+ <%if (genFeature.isChangeable() && !genFeature.isSuppressedUnsetVisibility()) {%>
+ * @see #unset<%=genFeature.getAccessorName()%>()
+ <%}%>
+ * @see #<%=genFeature.getGetAccessor()%>()
+ <%if (!genFeature.isListType() && genFeature.isChangeable() && !genFeature.isSuppressedSetVisibility()) {%>
+ * @see #set<%=genFeature.getAccessorName()%>(<%=genFeature.getImportedType()%>)
+ <%}%>
+ * @generated
+ */
+<%} else {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+<%}%>
+<%if (!isImplementation) {%>
+ boolean isSet<%=genFeature.getAccessorName()%>();
+
+<%} else {%>
+ public boolean isSet<%=genFeature.getAccessorName()%>()
+ {
+ <%if (genModel.isReflectiveDelegation()) {%>
+ return isSet(<%=genFeature.getQualifiedFeatureAccessor()%>);
+ <%} else if (!genFeature.isVolatile()) {%>
+ <%if (genFeature.isListType()) {%>
+ <%if (genModel.isVirtualDelegation()) {%>
+ <%=genFeature.getImportedType()%> <%=genFeature.getSafeName()%> = (<%=genFeature.getImportedType()%>)eVirtualGet(<%=genFeature.getUpperName()%>);
+ <%}%>
+ return <%=genFeature.getSafeName()%> != null && ((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.InternalEList")%>.Unsettable)<%=genFeature.getSafeName()%>).isSet();
+ <%} else {%>
+ <%if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {%>
+ return eVirtualIsSet(<%=genFeature.getUpperName()%>);
+ <%} else if (genClass.isESetFlag(genFeature)) {%>
+ return (<%=genClass.getESetFlagsField(genFeature)%> & <%=genFeature.getUpperName()%>_ESETFLAG) != 0;
+ <%} else {%>
+ return <%=genFeature.getUncapName()%>_set_;
+ <%}%>
+ <%}%>
+ <%} else if (genFeature.hasDelegateFeature()) { GenFeature delegateFeature = genFeature.getDelegateFeature(); //FFFF%>
+ <%if (delegateFeature.isWrappedFeatureMapType()) {%>
+ return isSet(get<%=delegateFeature.getAccessorName()%>(), getType(), INTERNAL_<%=genFeature.getUpperName()%>);
+ <%} else {%>
+ return !((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")%>.Internal)get<%=delegateFeature.getAccessorName()%>()).isEmpty(<%=genFeature.getQualifiedFeatureAccessor()%>);
+ <%}%>
+ <%} else {%>
+<%@ include file="Class/isSetGenFeature.TODO.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ // TODO: implement this method to return whether the '<%=genFeature.getFormattedName()%>' <%=genFeature.getFeatureKind()%> is set
+ // Ensure that you remove @generated or mark it @generated NOT
+ throw new UnsupportedOperationException();
+<%@ end %><%//Class/isSetGenFeature.todo.override.javajetinc%>
+ <%}%>
+ }
+
+<%}%>
+<%@ end %><%//Class/isSetGenFeature.override.javajetinc%>
+ <%}%>
+<%@ include file="Class/genFeature.insert.javajetinc" fail="silent" %>
+<%@ end %><%//Class/genFeature.override.javajetinc%>
+<%}// end output getter and setter interfaces or impls%>
+<%for (Iterator i= (isImplementation ? genClass.getImplementedGenOperations() : genClass.getDeclaredGenOperations()).iterator(); i.hasNext();) { GenOperation genOperation = (GenOperation)i.next();%>
+<%@ include file="Class/genOperation.override.javajetinc" fail="alternative" %>
+<%@ start %>
+<%if (isInterface) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ <%if (genOperation.hasDocumentation()) {%>
+ * <!-- begin-model-doc -->
+ * <%=genOperation.getDocumentation(genModel.getIndentation(stringBuffer))%>
+ * <!-- end-model-doc -->
+ <%}%>
+ <%if (!genModel.isSuppressEMFModelTags()) { boolean first = true; for (StringTokenizer stringTokenizer = new StringTokenizer(genOperation.getModelInfo(), "\n\r"); stringTokenizer.hasMoreTokens(); ) { String modelInfo = stringTokenizer.nextToken(); if (first) { first = false;%>
+ * @model <%=modelInfo%>
+ <%} else {%>
+ * <%=modelInfo%>
+ <%}} if (first) {%>
+ * @model
+ <%}}%>
+ * @generated
+ */
+<%} else {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+<%}%>
+<%if (!isImplementation) {%>
+ <%=genOperation.getImportedType()%> <%=genOperation.getName()%>(<%=genOperation.getParameters()%>)<%=genOperation.getThrows()%>;
+
+<%} else {%>
+ public <%=genOperation.getImportedType()%> <%=genOperation.getName()%>(<%=genOperation.getParameters()%>)<%=genOperation.getThrows()%>
+ {
+ <%if (genOperation.hasBody()) {%>
+ <%=genOperation.getBody(genModel.getIndentation(stringBuffer))%>
+ <%} else if (genOperation.isInvariant()) {GenClass opClass = genOperation.getGenClass(); String diagnostics = ((GenParameter)genOperation.getGenParameters().get(0)).getName(); String context = ((GenParameter)genOperation.getGenParameters().get(1)).getName();%>
+ // TODO: implement this method
+ // -> specify the condition that violates the invariant
+ // -> verify the details of the diagnostic, including severity and message
+ // Ensure that you remove @generated or mark it @generated NOT
+ if (false)
+ {
+ if (<%=diagnostics%> != null)
+ {
+ <%=diagnostics%>.add
+ (new <%=genModel.getImportedName("org.eclipse.emf.common.util.BasicDiagnostic")%>
+ (<%=genModel.getImportedName("org.eclipse.emf.common.util.Diagnostic")%>.ERROR,
+ <%=opClass.getGenPackage().getImportedValidatorClassName()%>.DIAGNOSTIC_SOURCE,
+ <%=opClass.getGenPackage().getImportedValidatorClassName()%>.<%=opClass.getOperationID(genOperation)%>,
+ <%=genModel.getImportedName("org.eclipse.emf.ecore.plugin.EcorePlugin")%>.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "<%=genOperation.getName()%>", <%=genModel.getImportedName("org.eclipse.emf.ecore.util.EObjectValidator")%>.getObjectLabel(this, <%=context%>) }),<%=genModel.getNonNLS()%><%=genModel.getNonNLS(2)%>
+ new Object [] { this }));
+ }
+ return false;
+ }
+ return true;
+ <%} else {%>
+<%@ include file="Class/implementedGenOperation.TODO.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ // TODO: implement this method
+ // Ensure that you remove @generated or mark it @generated NOT
+ throw new UnsupportedOperationException();
+<%@ end %><%//Class/implementedGenOperation.todo.override.javajetinc%>
+ <%}%>
+ }
+
+<%}%>
+<%@ include file="Class/genOperation.insert.javajetinc" fail="silent" %>
+<%@ end %><%//Class/implementedGenOperation.override.javajetinc%>
+<%}//for%>
+<%if (isImplementation && !genModel.isReflectiveDelegation() && genClass.implementsAny(genClass.getEInverseAddGenFeatures())) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeContext eInverseAdd(<%=genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject")%> otherEnd, int propertyIndex, ChangeContext changeContext)
+ {
+ switch (propertyIndex)
+ {
+<%for (Iterator i=genClass.getEInverseAddGenFeatures().iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();%>
+ <%if (!genModel.isMinimalReflectiveMethods() || genClass.getImplementedGenFeatures().contains(genFeature)) {%>
+ case <%=genFeature.getUpperName()%>:
+ <%if (genFeature.isListType()) {%>
+ <%if (genFeature.isMapType() && genFeature.isEffectiveSuppressEMFTypes()) {%>
+ return ((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.InternalEList")%>)((<%=genModel.getImportedName("org.eclipse.emf.common.util.EMap")%>.InternalMapView)<%=genFeature.getGetAccessor()%>()).eMap()).basicAdd(otherEnd, changeContext);
+ <%} else {%>
+ return ((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.InternalEList")%>)<%=genFeature.getGetAccessor()%>()).basicAdd(otherEnd, changeContext);
+ <%}%>
+ <%} else if (genFeature.isContainer()) {%>
+ if (eInternalContainer() != null)
+ changeContext = eBasicRemoveFromContainer(changeContext);
+ return eBasicSetContainer(otherEnd, <%=genFeature.getUpperName()%>, changeContext);
+ <%} else {%>
+ <%if (genClass.getImplementingGenModel(genFeature).isVirtualDelegation()) {%>
+ <%=genFeature.getImportedType()%> <%=genFeature.getSafeName()%> = (<%=genFeature.getImportedType()%>)eVirtualGet(<%=genFeature.getUpperName()%>);
+ <%}%>
+ if (<%=genFeature.getSafeName()%> != null)
+ <%if (genFeature.isEffectiveContains()) {%>
+ changeContext = ((<%=genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject")%>)<%=genFeature.getSafeName()%>).inverseRemove(this, EOPPOSITE_FEATURE_BASE - <%=genFeature.getUpperName()%>, null, changeContext);
+ <%} else { GenFeature reverseFeature = genFeature.getReverse(); GenClass targetClass = reverseFeature.getGenClass();%>
+ changeContext = ((<%=genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject")%>)<%=genFeature.getSafeName()%>).inverseRemove(this, <%=targetClass.getQualifiedFeatureID(reverseFeature)%>, <%=targetClass.getImportedInterfaceName()%>.class, changeContext);
+ <%}%>
+ return basicSet<%=genFeature.getAccessorName()%>((<%=genFeature.getImportedType()%>)otherEnd, changeContext);
+ <%}%>
+ <%}%>
+<%}%>
+ }
+<%if (genModel.isMinimalReflectiveMethods()) {%>
+ return super.eInverseAdd(otherEnd, propertyIndex, changeContext);
+<%} else {%>
+ return eDynamicInverseAdd(otherEnd, propertyIndex, changeContext);
+<%}%>
+ }
+
+<%}%>
+<%if (isImplementation && !genModel.isReflectiveDelegation() && genClass.implementsAny(genClass.getEInverseRemoveGenFeatures())) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeContext inverseRemove(<%=genModel.getImportedName("java.lang.Object")%> otherEnd, int propertyIndex, ChangeContext changeContext)
+ {
+ switch (propertyIndex)
+ {
+<%for (Iterator i=genClass.getEInverseRemoveGenFeatures().iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();%>
+ <%if (!genModel.isMinimalReflectiveMethods() || genClass.getImplementedGenFeatures().contains(genFeature)) {%>
+ case <%=genFeature.getUpperName()%>:
+ <%if (genFeature.isListType()) {%>
+ <%if (genFeature.isMapType() && genFeature.isEffectiveSuppressEMFTypes()) {%>
+ return ((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.InternalEList")%>)((<%=genModel.getImportedName("org.eclipse.emf.common.util.EMap")%>.InternalMapView)<%=genFeature.getGetAccessor()%>()).eMap()).basicRemove(otherEnd, changeContext);
+ <%} else if (genFeature.isWrappedFeatureMapType()) {%>
+ return removeFrom<%=genFeature.getImportedType()%>(<%=genFeature.getGetAccessor()%>(), otherEnd, changeContext);
+ <%} else {%>
+ return removeFromList(<%=genFeature.getGetAccessor()%>(), otherEnd, changeContext);
+ <%}%>
+ <%} else if (genFeature.isContainer()) {%>
+ return eBasicSetContainer(null, <%=genFeature.getUpperName()%>, changeContext);
+ <%} else if (genFeature.isUnsettable()) {%>
+ return basicUnset<%=genFeature.getAccessorName()%>(changeContext);
+ <%} else {%>
+ return basicSet<%=genFeature.getAccessorName()%>(null, changeContext);
+ <%}%>
+ <%}%>
+<%}%>
+ }
+<%if (genModel.isMinimalReflectiveMethods()) {%>
+ return super.inverseRemove(otherEnd, propertyIndex, changeContext);
+<%} else {%>
+ return eDynamicInverseRemove(otherEnd, propertyIndex, changeContext);
+<%}%>
+ }
+
+<%}%>
+<%if (isImplementation && !genModel.isReflectiveDelegation() && genClass.implementsAny(genClass.getEBasicRemoveFromContainerGenFeatures())) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeContext eBasicRemoveFromContainerFeature(ChangeContext changeContext)
+ {
+ switch (eContainerFeatureID)
+ {
+<%for (Iterator i=genClass.getEBasicRemoveFromContainerGenFeatures().iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();%>
+ <%GenFeature reverseFeature = genFeature.getReverse(); GenClass targetClass = reverseFeature.getGenClass();%>
+ <%if (!genModel.isMinimalReflectiveMethods() || genClass.getImplementedGenFeatures().contains(genFeature)) {%>
+ case <%=genFeature.getUpperName()%>:
+ return eInternalContainer().inverseRemove(this, <%=targetClass.getQualifiedFeatureID(reverseFeature)%>, <%=targetClass.getImportedInterfaceName()%>.class, changeContext);
+ <%}%>
+<%}%>
+ }
+<%if (genModel.isMinimalReflectiveMethods()) {%>
+ return super.eBasicRemoveFromContainerFeature(changeContext);
+<%} else {%>
+ return eDynamicBasicRemoveFromContainer(changeContext);
+<%}%>
+ }
+
+<%}%>
+<%if (isImplementation && !genModel.isReflectiveDelegation() && !genClass.getImplementedGenFeatures().isEmpty()) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object get(int propertyIndex, boolean resolve)
+ {
+ switch (propertyIndex)
+ {
+<%for (Iterator i=genClass.getAllGenFeatures().iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();%>
+ <%if (!genModel.isMinimalReflectiveMethods() || genClass.getImplementedGenFeatures().contains(genFeature)) {%>
+ case <%=genFeature.getUpperName()%>:
+ <%if (genFeature.isPrimitiveType()) {%>
+ <%if (genFeature.isBooleanType()) {%>
+ return <%=genFeature.getGetAccessor()%>() ? Boolean.TRUE : Boolean.FALSE;
+ <%} else {%>
+ return new <%=genFeature.getObjectType()%>(<%=genFeature.getGetAccessor()%>());
+ <%}%>
+ <%} else if (genFeature.isResolveProxies() && !genFeature.isListType()) {%>
+ if (resolve) return <%=genFeature.getGetAccessor()%>();
+ return basicGet<%=genFeature.getAccessorName()%>();
+ <%} else if (genFeature.isMapType()) {%>
+ <%if (genFeature.isEffectiveSuppressEMFTypes()) {%>
+ if (coreType) return ((<%=genModel.getImportedName("org.eclipse.emf.common.util.EMap")%>.InternalMapView)<%=genFeature.getGetAccessor()%>()).eMap();
+ else return <%=genFeature.getGetAccessor()%>();
+ <%} else {%>
+ if (coreType) return <%=genFeature.getGetAccessor()%>();
+ else return <%=genFeature.getGetAccessor()%>().map();
+ <%}%>
+ <%} else if (genFeature.isWrappedFeatureMapType()) {%>
+ // XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view
+ //if (coreType)
+ return <%=genFeature.getGetAccessor()%>();
+ <%} else if (genFeature.isFeatureMapType()) {%>
+ if (coreType) return <%=genFeature.getGetAccessor()%>();
+ return ((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")%>.Internal)<%=genFeature.getGetAccessor()%>()).getWrapper();
+ <%} else {%>
+ return <%=genFeature.getGetAccessor()%>();
+ <%}%>
+ <%}%>
+<%}%>
+ }
+<%if (genModel.isMinimalReflectiveMethods()) {%>
+ return super.get(propertyIndex, resolve);
+<%} else {%>
+ return eDynamicGet(propertyIndex, resolve, coreType);
+<%}%>
+ }
+
+<%}%>
+<%if (isImplementation && !genModel.isReflectiveDelegation() && genClass.implementsAny(genClass.getESetGenFeatures())) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void set(int propertyIndex, Object newValue)
+ {
+ switch (propertyIndex)
+ {
+<%for (Iterator i=genClass.getESetGenFeatures().iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();%>
+ <%if (!genModel.isMinimalReflectiveMethods() || genClass.getImplementedGenFeatures().contains(genFeature)) {%>
+ case <%=genFeature.getUpperName()%>:
+ <%if (genFeature.isListType()) {%>
+ <%if (genFeature.isWrappedFeatureMapType()) {%>
+ set<%=genFeature.getImportedType()%>(<%=genFeature.getGetAccessor()%>(), newValue);
+ <%} else if (genFeature.isFeatureMapType()) {%>
+ ((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")%>.Internal)<%=genFeature.getGetAccessor()%>()).set(newValue);
+ <%} else if (genFeature.isMapType()) {%>
+ <%if (genFeature.isEffectiveSuppressEMFTypes()) {%>
+ ((<%=genModel.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")%>.Setting)((<%=genModel.getImportedName("org.eclipse.emf.common.util.EMap")%>.InternalMapView)<%=genFeature.getGetAccessor()%>()).eMap()).set(newValue);
+ <%} else {%>
+ ((<%=genModel.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")%>.Setting)<%=genFeature.getGetAccessor()%>()).set(newValue);
+ <%}%>
+ <%} else {%>
+ <%=genFeature.getGetAccessor()%>().clear();
+ <%=genFeature.getGetAccessor()%>().addAll((<%=genModel.getImportedName("java.util.Collection")%>)newValue);
+ <%}%>
+ <%} else if (genFeature.isPrimitiveType()) {%>
+ set<%=genFeature.getAccessorName()%>(((<%=genFeature.getObjectType()%>)newValue).<%=genFeature.getPrimitiveValueFunction()%>());
+ <%} else {%>
+ set<%=genFeature.getAccessorName()%>((<%=genFeature.getImportedType()%>)newValue);
+ <%}%>
+ return;
+ <%}%>
+<%}%>
+ }
+<%if (genModel.isMinimalReflectiveMethods()) {%>
+ super.set(propertyIndex, newValue);
+<%} else {%>
+ eDynamicSet(propertyIndex, newValue);
+<%}%>
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unset(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+<%for (Iterator i=genClass.getESetGenFeatures().iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();%>
+ <%if (!genModel.isMinimalReflectiveMethods() || genClass.getImplementedGenFeatures().contains(genFeature)) {%>
+ case <%=genFeature.getUpperName()%>:
+ <%if (genFeature.isListType() && !genFeature.isUnsettable()) {%>
+ <%if (genFeature.isWrappedFeatureMapType()) {%>
+ unset<%=genFeature.getImportedType()%>(<%=genFeature.getGetAccessor()%>());
+ <%} else {%>
+ <%=genFeature.getGetAccessor()%>().clear();
+ <%}%>
+ <%} else if (genFeature.isUnsettable()) {%>
+ unset<%=genFeature.getAccessorName()%>();
+ <%} else if (genFeature.isReferenceType()) {%>
+ set<%=genFeature.getAccessorName()%>((<%=genFeature.getImportedType()%>)null);
+ <%} else {%>
+ set<%=genFeature.getAccessorName()%>(<%=genFeature.getUpperName()%>_DEFAULT_);
+ <%}%>
+ return;
+ <%}%>
+<%}%>
+ }
+<%if (genModel.isMinimalReflectiveMethods()) {%>
+ super.unset(propertyIndex);
+<%} else {%>
+ eDynamicUnset(propertyIndex);
+<%}%>
+ }
+
+<%}%>
+<%if (isImplementation && !genModel.isReflectiveDelegation() && !genClass.getImplementedGenFeatures().isEmpty()) {%>
+<%@ include file="Class/eIsSet.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSet(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+<%for (Iterator i=genClass.getAllGenFeatures().iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();%>
+ <%if (!genModel.isMinimalReflectiveMethods() || genClass.getImplementedGenFeatures().contains(genFeature)) {%>
+ case <%=genFeature.getUpperName()%>:
+ <%if (genFeature.isListType() && !genFeature.isUnsettable()) {%>
+ <%if (genFeature.isWrappedFeatureMapType()) {%>
+ <%if (genFeature.isVolatile()) {%>
+ return !is<%=genFeature.getImportedType()%>Empty(<%=genFeature.getGetAccessor()%>());
+ <%} else {%>
+ return <%=genFeature.getSafeName()%> != null && !is<%=genFeature.getImportedType()%>Empty(<%=genFeature.getGetAccessor()%>());
+ <%}%>
+ <%} else {%>
+ <%if (genClass.isField(genFeature)) {%>
+ return <%=genFeature.getSafeName()%> != null && !<%=genFeature.getSafeName()%>.isEmpty();
+ <%} else {%>
+ <%if (genFeature.isField() && genClass.getImplementingGenModel(genFeature).isVirtualDelegation()) {%>
+ <%=genFeature.getImportedType()%> <%=genFeature.getSafeName()%> = (<%=genFeature.getImportedType()%>)eVirtualGet(<%=genFeature.getUpperName()%>);
+ return <%=genFeature.getSafeName()%> != null && !<%=genFeature.getSafeName()%>.isEmpty();
+ <%} else {%>
+ return !<%=genFeature.getGetAccessor()%>().isEmpty();
+ <%}%>
+ <%}%>
+ <%}%>
+ <%} else if (genFeature.isUnsettable()) {%>
+ return isSet<%=genFeature.getAccessorName()%>();
+ <%} else if (genFeature.isResolveProxies()) {%>
+ <%if (genClass.isField(genFeature)) {%>
+ return <%=genFeature.getSafeName()%> != null;
+ <%} else {%>
+ <%if (genFeature.isField() && genClass.getImplementingGenModel(genFeature).isVirtualDelegation()) {%>
+ return eVirtualGet(<%=genFeature.getUpperName()%>) != null;
+ <%} else {%>
+ return basicGet<%=genFeature.getAccessorName()%>() != null;
+ <%}%>
+ <%}%>
+ <%} else if (genFeature.isReferenceType()) {%>
+ <%if (genClass.isField(genFeature)) {%>
+ return <%=genFeature.getSafeName()%> != null;
+ <%} else {%>
+ <%if (genFeature.isField() && genClass.getImplementingGenModel(genFeature).isVirtualDelegation()) {%>
+ return eVirtualGet(<%=genFeature.getUpperName()%>) != null;
+ <%} else {%>
+ return <%=genFeature.getGetAccessor()%>() != null;
+ <%}%>
+ <%}%>
+ <%} else if (genFeature.isPrimitiveType() || genFeature.isEnumType()) {%>
+ <%if (genClass.isField(genFeature)) {%>
+ <%if (genClass.isFlag(genFeature)) {%>
+ return ((<%=genClass.getFlagsField(genFeature)%> & <%=genFeature.getUpperName()%>_EFLAG) != 0) != <%=genFeature.getUpperName()%>_DEFAULT_;
+ <%} else {%>
+ return <%=genFeature.getSafeName()%> != <%=genFeature.getUpperName()%>_DEFAULT_;
+ <%}%>
+ <%} else {%>
+ <%if (genFeature.isEnumType() && genFeature.isField() && genClass.getImplementingGenModel(genFeature).isVirtualDelegation()) {%>
+ return eVirtualGet(<%=genFeature.getUpperName()%>, <%=genFeature.getUpperName()%>_DEFAULT_) != <%=genFeature.getUpperName()%>_DEFAULT_;
+ <%} else {%>
+ return <%=genFeature.getGetAccessor()%>() != <%=genFeature.getUpperName()%>_DEFAULT_;
+ <%}%>
+ <%}%>
+ <%} else {//datatype%>
+ <%if (genClass.isField(genFeature)) {%>
+ return <%=genFeature.getUpperName()%>_DEFAULT_ == null ? <%=genFeature.getSafeName()%> != null : !<%=genFeature.getUpperName()%>_DEFAULT_.equals(<%=genFeature.getSafeName()%>);
+ <%} else {%>
+ <%if (genFeature.isField() && genClass.getImplementingGenModel(genFeature).isVirtualDelegation()) {%>
+ <%=genFeature.getImportedType()%> <%=genFeature.getSafeName()%> = (<%=genFeature.getImportedType()%>)eVirtualGet(<%=genFeature.getUpperName()%>, <%=genFeature.getUpperName()%>_DEFAULT_);
+ return <%=genFeature.getUpperName()%>_DEFAULT_ == null ? <%=genFeature.getSafeName()%> != null : !<%=genFeature.getUpperName()%>_DEFAULT_.equals(<%=genFeature.getSafeName()%>);
+ <%} else {%>
+ return <%=genFeature.getUpperName()%>_DEFAULT_ == null ? <%=genFeature.getGetAccessor()%>() != null : !<%=genFeature.getUpperName()%>_DEFAULT_.equals(<%=genFeature.getGetAccessor()%>());
+ <%}%>
+ <%}%>
+ <%}%>
+ <%}%>
+<%}%>
+ }
+<%if (genModel.isMinimalReflectiveMethods()) {%>
+ return super.isSet(propertyIndex);
+<%} else {%>
+ return eDynamicIsSet(propertyIndex);
+<%}%>
+ }
+
+<%@ end %><%//Class/eIsSet.override.javajetinc%>
+<%}%>
+<%if (isImplementation && !genClass.getMixinGenFeatures().isEmpty()) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass)
+ {
+ <%for (Iterator m=genClass.getMixinGenClasses().iterator(); m.hasNext();) { GenClass mixinGenClass = (GenClass)m.next(); %>
+ if (baseClass == <%=mixinGenClass.getImportedInterfaceName()%>.class)
+ {
+ switch (derivedFeatureID)
+ {
+ <%for (Iterator f=mixinGenClass.getGenFeatures().iterator(); f.hasNext();) { GenFeature genFeature = (GenFeature)f.next(); %>
+ case <%=genFeature.getUpperName()%>: return <%=mixinGenClass.getQualifiedFeatureID(genFeature)%>;
+ <%}%>
+ default: return -1;
+ }
+ }
+ <%}%>
+ return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass)
+ {
+ <%for (Iterator m=genClass.getMixinGenClasses().iterator(); m.hasNext();) { GenClass mixinGenClass = (GenClass)m.next(); %>
+ if (baseClass == <%=mixinGenClass.getImportedInterfaceName()%>.class)
+ {
+ switch (baseFeatureID)
+ {
+ <%for (Iterator f=mixinGenClass.getGenFeatures().iterator(); f.hasNext();) { GenFeature genFeature = (GenFeature)f.next(); %>
+ case <%=mixinGenClass.getQualifiedFeatureID(genFeature)%>: return <%=genFeature.getUpperName()%>;
+ <%}%>
+ default: return -1;
+ }
+ }
+ <%}%>
+ return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
+ }
+
+<%}%>
+<%if (isImplementation && genModel.isVirtualDelegation()) { String eVirtualValuesField = genClass.getEVirtualValuesField();%>
+ <%if (eVirtualValuesField != null) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Object[] eVirtualValues()
+ {
+ return <%=eVirtualValuesField%>;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void setVirtualValues(Object[] newValues)
+ {
+ <%=eVirtualValuesField%> = newValues;
+ }
+
+ <%}%>
+ <%{ List eVirtualIndexBitFields = genClass.getEVirtualIndexBitFields(new ArrayList());%>
+ <%if (!eVirtualIndexBitFields.isEmpty()) { List allEVirtualIndexBitFields = genClass.getAllEVirtualIndexBitFields(new ArrayList());%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected int eVirtualIndexBits(int offset)
+ {
+ switch (offset)
+ {
+ <%for (int i = 0; i < allEVirtualIndexBitFields.size(); i++) {%>
+ case <%=i%> :
+ return <%=allEVirtualIndexBitFields.get(i)%>;
+ <%}%>
+ default :
+ throw new IndexOutOfBoundsException();
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void setVirtualIndexBits(int offset, int newIndexBits)
+ {
+ switch (offset)
+ {
+ <%for (int i = 0; i < allEVirtualIndexBitFields.size(); i++) {%>
+ case <%=i%> :
+ <%=allEVirtualIndexBitFields.get(i)%> = newIndexBits;
+ break;
+ <%}%>
+ default :
+ throw new IndexOutOfBoundsException();
+ }
+ }
+
+ <%}%>
+ <%}%>
+<%}%>
+<%if (isImplementation && !genModel.isReflectiveDelegation() && !genClass.getToStringGenFeatures().isEmpty()) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString()
+ {
+ if (isProxy(this)) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ <%{ boolean first = true;%>
+ <%for (Iterator i=genClass.getToStringGenFeatures().iterator(); i.hasNext(); ) { GenFeature genFeature = (GenFeature)i.next();%>
+ <%if (first) { first = false;%>
+ result.append(" (<%=genFeature.getName()%>: ");<%=genModel.getNonNLS()%>
+ <%} else {%>
+ result.append(", <%=genFeature.getName()%>: ");<%=genModel.getNonNLS()%>
+ <%}%>
+ <%if (genFeature.isUnsettable() && !genFeature.isListType()) {%>
+ <%if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {%>
+ if (eVirtualIsSet(<%=genFeature.getUpperName()%>)) result.append(eVirtualGet(<%=genFeature.getUpperName()%>)); else result.append("<unset>");<%=genModel.getNonNLS()%>
+ <%} else {%>
+ <%if (genClass.isFlag(genFeature)) {%>
+ if (<%if (genClass.isESetFlag(genFeature)) {%>(<%=genClass.getESetFlagsField(genFeature)%> & <%=genFeature.getUpperName()%>_ESETFLAG) != 0<%} else {%><%=genFeature.getUncapName()%>_set_<%}%>) result.append((<%=genClass.getFlagsField(genFeature)%> & <%=genFeature.getUpperName()%>_EFLAG) != 0); else result.append("<unset>");<%=genModel.getNonNLS()%>
+ <%} else {%>
+ if (<%if (genClass.isESetFlag(genFeature)) {%>(<%=genClass.getESetFlagsField(genFeature)%> & <%=genFeature.getUpperName()%>_ESETFLAG) != 0<%} else {%><%=genFeature.getUncapName()%>_set_<%}%>) result.append(<%=genFeature.getSafeName()%>); else result.append("<unset>");<%=genModel.getNonNLS()%>
+ <%}%>
+ <%}%>
+ <%} else {%>
+ <%if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {%>
+ result.append(eVirtualGet(<%=genFeature.getUpperName()%><%if (!genFeature.isListType() && !genFeature.isReferenceType()){%>, <%=genFeature.getUpperName()%>_DEFAULT_<%}%>));
+ <%} else {%>
+ <%if (genClass.isFlag(genFeature)) {%>
+ result.append((<%=genClass.getFlagsField(genFeature)%> & <%=genFeature.getUpperName()%>_EFLAG) != 0);
+ <%} else {%>
+ result.append(<%=genFeature.getSafeName()%>);
+ <%}%>
+ <%}%>
+ <%}%>
+ <%}%>
+ <%}%>
+ result.append(')');
+ return result.toString();
+ }
+
+<%}%>
+<%if (isImplementation && genClass.isMapEntry()) { GenFeature keyFeature = genClass.getMapEntryKeyFeature(); GenFeature valueFeature = genClass.getMapEntryValueFeature();%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected int hash = -1;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public int getHash()
+ {
+ if (hash == -1)
+ {
+ Object theKey = getKey();
+ hash = (theKey == null ? 0 : theKey.hashCode());
+ }
+ return hash;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setHash(int hash)
+ {
+ this.hash = hash;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object getKey()
+ {
+ <%if (keyFeature.isPrimitiveType()) {%>
+ return new <%=keyFeature.getObjectType()%>(getTypedKey());
+ <%} else {%>
+ return getTypedKey();
+ <%}%>
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setKey(Object key)
+ {
+ <%if (keyFeature.isListType()) {%>
+ getTypedKey().addAll((<%=genModel.getImportedName("java.util.Collection")%>)key);
+ <%} else if (keyFeature.isPrimitiveType()) {%>
+ setTypedKey(((<%=keyFeature.getObjectType()%>)key).<%=keyFeature.getPrimitiveValueFunction()%>());
+ <%} else {%>
+ setTypedKey((<%=keyFeature.getImportedType()%>)key);
+ <%}%>
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object getValue()
+ {
+ <%if (valueFeature.isPrimitiveType()) {%>
+ return new <%=valueFeature.getObjectType()%>(getTypedValue());
+ <%} else {%>
+ return getTypedValue();
+ <%}%>
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object setValue(Object value)
+ {
+ Object oldValue = getValue();
+ <%if (valueFeature.isListType()) {%>
+ getTypedValue().clear();
+ getTypedValue().addAll((<%=genModel.getImportedName("java.util.Collection")%>)value);
+ <%} else if (valueFeature.isPrimitiveType()) {%>
+ setTypedValue(((<%=valueFeature.getObjectType()%>)value).<%=valueFeature.getPrimitiveValueFunction()%>());
+ <%} else {%>
+ setTypedValue((<%=valueFeature.getImportedType()%>)value);
+ <%}%>
+ return oldValue;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public <%=genModel.getImportedName("org.eclipse.emf.common.util.EMap")%> getEMap()
+ {
+ <%=genModel.getImportedName("org.eclipse.emf.ecore.EObject")%> container = eContainer();
+ return container == null ? null : (<%=genModel.getImportedName("org.eclipse.emf.common.util.EMap")%>)container.get(eContainmentFeature());
+ }
+<%}%>
+<%@ include file="Class/insert.javajetinc" fail="silent" %>
+} //<%=isInterface ? " " + genClass.getInterfaceName() : genClass.getClassName()%>
+<%// TODO fix the space above%>
+<%genModel.emitSortedImports();%>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/templates/models/SDOFactoryClass.javajet b/sdo-java/tags/1.0-incubator-M3/sdo/tools/templates/models/SDOFactoryClass.javajet
new file mode 100644
index 0000000000..5a0db1135f
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/templates/models/SDOFactoryClass.javajet
@@ -0,0 +1,640 @@
+<%@ jet package="org.apache.tuscany.sdo.generate.templates.model" skeleton="generator.skeleton" imports="org.apache.tuscany.sdo.generate.util.* java.util.* org.eclipse.emf.codegen.ecore.genmodel.* org.eclipse.emf.ecore.* org.eclipse.emf.codegen.ecore.genmodel.impl.Literals org.eclipse.emf.ecore.util.* org.eclipse.emf.codegen.util.CodeGenUtil" class="SDOFactoryClass" version="$Id: SDOFactoryClass.javajet,v 1.23 2005/12/10 13:31:02 emerks Exp $" %>
+<%
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+%>
+<%GenPackage genPackage = (GenPackage)((Object[])argument)[0]; GenModel genModel=genPackage.getGenModel();%>
+<%boolean isInterface = Boolean.TRUE.equals(((Object[])argument)[1]); boolean isImplementation = Boolean.TRUE.equals(((Object[])argument)[2]);%>
+<%String factoryPatternVersion = "1.1";%>
+<%String publicStaticFinalFlag = isImplementation ? "public static final " : "";%>
+<%@ include file="../Header.javajetinc"%>
+<%if (isInterface || genModel.isSuppressInterfaces()) {%>
+package <%=genPackage.getReflectionPackageName()%>;
+<%} else {%>
+package <%=genPackage.getClassPackageName()%>;
+<%}%>
+
+import commonj.sdo.helper.HelperContext;
+<%if (!isInterface || genModel.isSuppressInterfaces()) {%>
+import org.apache.tuscany.sdo.helper.TypeHelperImpl;
+<%}%>
+
+<%if (isImplementation) {%>
+<%if (!genPackage.hasJavaLangConflict() && !genPackage.hasInterfaceImplConflict() && !genPackage.getClassPackageName().equals(genPackage.getInterfacePackageName())) genModel.addImport(genPackage.getInterfacePackageName() + ".*");%>
+<%}%>
+<%genModel.markImportLocation(stringBuffer);%>
+
+<%if (isInterface) {%>
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Factory</b> for the model.
+ * It provides a create method for each non-abstract class of the model.
+ * <!-- end-user-doc -->
+<%if (!genModel.isSuppressEMFMetaData()) {%>
+ * @see <%=genPackage.getQualifiedPackageInterfaceName()%>
+<%}%>
+<%if (genModel.isSuppressInterfaces()) {%>
+ * patternVersion=<%=factoryPatternVersion%>;<%=SDOGenUtil.printArguments(genPackage, genModel) %>
+<%}%>
+ * @generated
+ */
+<%} else {%>
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Factory</b>.
+ * Generator information:
+ * patternVersion=<%=factoryPatternVersion%>;<%=SDOGenUtil.printArguments(genPackage, genModel) %>
+ * <!-- end-user-doc -->
+ * @generated
+ */
+<%}%>
+<%if (isImplementation) {%>
+public class <%=genPackage.getFactoryClassName()%> extends <%=genModel.getImportedName("org.apache.tuscany.sdo.impl.FactoryBase")%><%if (!genModel.isSuppressInterfaces()) {%> implements <%=genPackage.getImportedFactoryInterfaceName()%><%}%>
+<%} else {%>
+public interface <%=genPackage.getFactoryInterfaceName()%><%if (!genModel.isSuppressEMFMetaData()) {%> extends <%=genModel.getImportedName("org.eclipse.emf.ecore.EFactory")%><%}%>
+<%}%>
+{
+<%if (genModel.getCopyrightText() != null) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%=publicStaticFinalFlag%><%=genModel.getImportedName("java.lang.String")%> copyright = "<%=genModel.getCopyrightText()%>";<%=genModel.getNonNLS()%>
+
+<%}%>
+
+<%if (isInterface && genModel.isSuppressEMFMetaData()) {%>
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%=publicStaticFinalFlag%><%=genPackage.getFactoryInterfaceName()%> INSTANCE = <%=genPackage.getQualifiedFactoryClassName()%>.init();
+
+<%} else if (isInterface && !genModel.isSuppressInterfaces()) {%>
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%=publicStaticFinalFlag%><%=genPackage.getFactoryInterfaceName()%> eINSTANCE = <%=genPackage.getQualifiedFactoryClassName()%>.init();
+
+<%}%>
+<%if (isImplementation) {%>
+ /**
+ * The package namespace URI.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%=publicStaticFinalFlag%><%=genModel.getImportedName("java.lang.String")%> NAMESPACE_URI = "<%=genPackage.getNSURI()%>";<%=genModel.getNonNLS()%>
+
+ /**
+ * The package namespace name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%=publicStaticFinalFlag%><%=genModel.getImportedName("java.lang.String")%> NAMESPACE_PREFIX = "<%=genPackage.getNSName()%>";<%=genModel.getNonNLS()%>
+
+ /**
+ * The version of the generator pattern used to generate this class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%=publicStaticFinalFlag%><%=genModel.getImportedName("java.lang.String")%> PATTERN_VERSION = "<%=factoryPatternVersion%>";
+
+<%int genIndex = 1;
+for (Iterator i=genPackage.getOrderedGenClassifiers().iterator(); i.hasNext();) { GenClassifier genClassifier = (GenClassifier)i.next();%>
+ <%if (!genPackage.getClassifierID(genClassifier).equals("DOCUMENT_ROOT")) { %>
+ <%=publicStaticFinalFlag%>int <%=genPackage.getClassifierID(genClassifier)%> = <%=genIndex%>;
+<%genIndex++;%>
+<% } }%>
+
+<%String factoryType = genModel.isSuppressEMFMetaData() ? genPackage.getFactoryClassName() : genPackage.getImportedFactoryInterfaceName();%>
+ /**
+ * Creates an instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public <%=genPackage.getFactoryClassName()%>()
+ {
+ super(NAMESPACE_URI, NAMESPACE_PREFIX, "<%=genPackage.getReflectionPackageName()%>");
+ }
+
+ /**
+ * Registers the Factory instance so that it is available within the supplied scope.
+ * @argument scope a HelperContext instance that will make the types supported by this Factory available.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void register(HelperContext scope) {
+ if(scope == null) {
+ throw new IllegalArgumentException("Scope can not be null");
+ }
+ TypeHelperImpl th = (TypeHelperImpl)scope.getTypeHelper();
+ th.getExtendedMetaData().putPackage(NAMESPACE_URI, this);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public <%=genModel.getImportedName("commonj.sdo.DataObject")%> create(int typeNumber)
+ {
+ switch (typeNumber)
+ {
+<%for (Iterator i=genPackage.getGenClasses().iterator(); i.hasNext();) { GenClass genClass = (GenClass)i.next();%>
+<%if (!genClass.isAbstract() && !genClass.isDynamic()) {%>
+ case <%=genClass.getClassifierID()%>: return (<%=genModel.getImportedName("commonj.sdo.DataObject")%>)create<%=genClass.getName()%>();
+<%}%>
+<%}%>
+ default:
+ return super.create(typeNumber);
+ }
+ }
+
+<%if (!genPackage.getAllGenDataTypes().isEmpty()) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object createFromString(int typeNumber, String initialValue)
+ {
+ switch (typeNumber)
+ {
+<%for (Iterator i=genPackage.getAllGenDataTypes().iterator(); i.hasNext();) { GenDataType genDataType = (GenDataType)i.next();%>
+ <%if (genDataType.isSerializable()) {%>
+ case <%=genDataType.getClassifierID()%>:
+ return create<%=genDataType.getName()%>FromString(initialValue);
+ <%}%>
+<%}%>
+ default:
+ throw new IllegalArgumentException("The type number '" + typeNumber + "' is not a valid datatype");<%=genModel.getNonNLS()%><%=genModel.getNonNLS(2)%>
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String convertToString(int typeNumber, Object instanceValue)
+ {
+ switch (typeNumber)
+ {
+<%for (Iterator i=genPackage.getAllGenDataTypes().iterator(); i.hasNext();) { GenDataType genDataType = (GenDataType)i.next();%>
+ <%if (genDataType.isSerializable()) {%>
+ case <%=genDataType.getClassifierID()%>:
+ return convert<%=genDataType.getName()%>ToString(instanceValue);
+ <%}%>
+<%}%>
+ default:
+ throw new IllegalArgumentException("The type number '" + typeNumber + "' is not a valid datatype");<%=genModel.getNonNLS()%><%=genModel.getNonNLS(2)%>
+ }
+ }
+<%}%>
+<%for (Iterator i=genPackage.getGenClasses().iterator(); i.hasNext();) { GenClass genClass = (GenClass)i.next();%>
+ <%if (!genClass.isAbstract() && !genClass.isDynamic()) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public <%=genClass.getImportedInterfaceName()%> create<%=genClass.getName()%>()
+ {
+ <%if (genClass.isDynamic()) {%>
+ <%=genClass.getImportedInterfaceName()%> <%=genClass.getSafeUncapName()%> = <%=genClass.getCastFromEObject()%>super.create(<%=genClass.getQualifiedClassifierAccessor()%>);
+ <%} else {%>
+ <%=genClass.getImportedClassName()%> <%=genClass.getSafeUncapName()%> = new <%=genClass.getImportedClassName()%>()<%if (genModel.isSuppressInterfaces() && !genPackage.getReflectionPackageName().equals(genPackage.getInterfacePackageName())) {%>{}<%}%>;
+ <%}%>
+ return <%=genClass.getSafeUncapName()%>;
+ }
+ <%}%>
+<%}%>
+
+ // Following creates and initializes SDO metadata for the supported types.
+<%for (Iterator i=genPackage.getOrderedGenClassifiers().iterator(); i.hasNext();) { GenClassifier genClassifier = (GenClassifier)i.next();%>
+ <%if (!genPackage.getClassifierID(genClassifier).equals("DOCUMENT_ROOT")) { %>
+ protected <%=genModel.getImportedName("commonj.sdo.Type")%> <%=genClassifier.getSafeUncapName()%>Type = null;
+
+ public <%=genModel.getImportedName("commonj.sdo.Type")%> get<%=genClassifier.getClassifierAccessorName()%>()
+ {
+ return <%=genClassifier.getSafeUncapName()%>Type;
+ }
+
+<%} }%>
+
+ private static boolean isInited = false;
+
+ public static <%=factoryType%> init()
+ {
+ if (isInited) return (<%=factoryType%>)FactoryBase.getStaticFactory(<%=factoryType%>.NAMESPACE_URI);
+ <%=factoryType%> the<%=factoryType%> = new <%=factoryType%>();
+ isInited = true;
+
+ // Initialize simple dependencies
+ <%for (Iterator p=genPackage.getPackageSimpleDependencies().iterator(); p.hasNext();) { GenPackage dep = (GenPackage)p.next();%>
+ <%=genModel.getImportedName("org.apache.tuscany.sdo.util.SDOUtil")%>.registerStaticTypes(<%=dep.getImportedFactoryInterfaceName()%>.class);
+ <%}%>
+
+ // Create package meta-data objects
+ the<%=factoryType%>.createMetaData();
+
+ // Initialize created meta-data
+ the<%=factoryType%>.initializeMetaData();
+
+ // Mark meta-data to indicate it can't be changed
+ //the<%=factoryType%>.freeze(); //FB do we need to freeze / should we freeze ????
+
+ return the<%=factoryType%>;
+ }
+
+ private boolean isCreated = false;
+
+ public void createMetaData()
+ {
+ if (isCreated) return;
+ isCreated = true;
+ <%if (!genPackage.getGenClasses().isEmpty()) {%>
+
+ // Create types and their properties
+ <%for (Iterator c=genPackage.getGenClasses().iterator(); c.hasNext();) { GenClass genClass = (GenClass)c.next();%>
+ <%if (!genClass.isDynamic()) {%>
+ <%=genClass.getSafeUncapName()%>Type = createType(false, <%=genPackage.getClassifierID(genClass)%>);
+ <%for (Iterator j=genClass.getGenFeatures().iterator(); j.hasNext();) { GenFeature genFeature = (GenFeature)j.next();%>
+ createProperty(<%=!genFeature.isReferenceType()%>, <%=genClass.getSafeUncapName()%>Type,<%=genClass.getClassName()%>.INTERNAL_<%=genFeature.getUpperName()%>);
+ <%}%>
+ <%}%>
+ <%}%>
+ <%}%>
+ <%if (!genPackage.getGenDataTypes().isEmpty()) {%>
+
+ // Create data types
+ <%for (Iterator d=genPackage.getGenDataTypes().iterator(); d.hasNext();) { GenDataType genDataType = (GenDataType)d.next();%>
+ <%=genDataType.getSafeUncapName()%>Type = createType(true, <%=genPackage.getClassifierID(genDataType)%> );
+ <%}%>
+ <%}%>
+ }
+
+ private boolean isInitialized = false;
+
+ public void initializeMetaData()
+ {
+ if (isInitialized) return;
+ isInitialized = true;
+ <%if (!genPackage.getPackageInitializationDependencies().isEmpty()) {%>
+
+ // Obtain other dependent packages
+ <%for (Iterator p=genPackage.getPackageInitializationDependencies().iterator(); p.hasNext();) { GenPackage dep = (GenPackage)p.next();%>
+ <%=dep.getImportedFactoryClassName()%> <%=genPackage.getPackageInstanceVariable(dep)%> = (<%=dep.getImportedFactoryClassName()%>)FactoryBase.getStaticFactory(<%=dep.getImportedFactoryClassName()%>.NAMESPACE_URI);
+ <%}%>
+ <%}%>
+ <%List annotationSources = genPackage.getAnnotationSources();%>
+ <%annotationSources.remove(ExtendedMetaData.ANNOTATION_URI);%>
+ <%=genModel.getImportedName("commonj.sdo.Property")%> property = null;
+
+ // Add supertypes to types
+ <%for (Iterator c=genPackage.getGenClasses().iterator(); c.hasNext();) { GenClass genClass = (GenClass)c.next();%>
+ <%for (Iterator b=genClass.getBaseGenClasses().iterator(); b.hasNext();) { GenClass baseGenClass = (GenClass)b.next();%>
+ addSuperType(<%=genClass.getSafeUncapName()%>Type, <%=baseGenClass.getSafeUncapName()%>Type);
+ <%}%>
+ <%}%>
+
+ // Initialize types and properties
+ <%for (Iterator i=genPackage.getGenClasses().iterator(); i.hasNext();) { GenClass genClass = (GenClass)i.next();%>
+ <%if (!genClass.isDynamic()) {%>
+ initializeType(<%=genClass.getSafeUncapName()%>Type, <%=genClass.getImportedInterfaceName()%>.class, "<%=genClass.getName()%>", <%=genClass.isAbstract()%>);
+ <%for (Iterator sources = annotationSources.iterator(); sources.hasNext();) { String annotationSource = (String)sources.next();%>
+ <%EAnnotation classAnnotation = genClass.getEcoreClassifier().getEAnnotation(annotationSource);%>
+ <%if (classAnnotation != null) { %>
+ <%for (Iterator k = classAnnotation.getDetails().iterator(); k.hasNext();) { Map.Entry detail = (Map.Entry)k.next(); String key = Literals.toStringLiteral((String)detail.getKey(), genModel); String value = Literals.toStringLiteral((String)detail.getValue(), genModel);%>
+ setInstanceProperty (<%=genClass.getSafeUncapName()%>Type, "<%=annotationSource%>", <%=key%>, <%=value%><%=genModel.getNonNLS(key + value)%>);
+ <%}%>
+ <%}%>
+ <%}%>
+ <%for (Iterator j=genClass.getGenFeatures().iterator(); j.hasNext();) {GenFeature genFeature = (GenFeature)j.next();%>
+ <%String type = genFeature.getType().equals("commonj.sdo.Sequence") ? "getSequence()" : genPackage.getPackageInstanceVariable(genFeature.getTypeGenPackage()) + ".get" + genFeature.getTypeClassifierAccessorName() + "()";%>
+ property = getProperty(<%=genClass.getSafeUncapName()%>Type, <%=genClass.getClassName()%>.INTERNAL_<%=genFeature.getUpperName()%>);
+ <%if (genFeature.isReferenceType()) { GenFeature reverseGenFeature = genFeature.getReverse();%>
+ <%String reverse = reverseGenFeature == null ? "null" : genPackage.getPackageInstanceVariable(reverseGenFeature.getGenPackage()) + ".get" + reverseGenFeature.getFeatureAccessorName() + "()";%>
+ initializeProperty(property, <%=type%>, "<%=genFeature.getName()%>", <%=genFeature.getDefaultValue()%>, <%=genFeature.getLowerBound()%>, <%=genFeature.getUpperBound()%>, <%=genFeature.getContainerClass()%>, <%=genFeature.getChangeableFlag().equals("IS_CHANGEABLE") ? "false" : "true"%>, <%=genFeature.getUnsettableFlag().equals("IS_UNSETTABLE") ? "true": "false"%>, <%=genFeature.getDerivedFlag().equals("IS_DERIVED") ? "true" : "false"%>, <%=genFeature.getContainmentFlag().equals("IS_COMPOSITE")? "true": "false"%> , <%=reverse%>);
+ <%}else{%>
+ initializeProperty(property, <%=type%>, "<%=genFeature.getName()%>", <%=genFeature.getDefaultValue()%>, <%=genFeature.getLowerBound()%>, <%=genFeature.getUpperBound()%>, <%=genFeature.getContainerClass()%>, <%=genFeature.getChangeableFlag().equals("IS_CHANGEABLE") ? "false" : "true"%>, <%=genFeature.getUnsettableFlag().equals("IS_UNSETTABLE") ? "true": "false"%>, <%=genFeature.getDerivedFlag().equals("IS_DERIVED") ? "true" : "false"%>);
+ <%}%>
+ <%for (Iterator sources = annotationSources.iterator(); sources.hasNext();) { String annotationSource = (String)sources.next();%>
+ <%EAnnotation featureAnnotation = genFeature.getEcoreFeature().getEAnnotation(annotationSource);%>
+ <%if (featureAnnotation != null) { %>
+ <%for (Iterator k = featureAnnotation.getDetails().iterator(); k.hasNext();) { Map.Entry detail = (Map.Entry)k.next(); String key = Literals.toStringLiteral((String)detail.getKey(), genModel); String value = Literals.toStringLiteral((String)detail.getValue(), genModel);%>
+ setInstanceProperty (property, "<%=annotationSource%>", <%=key%>, <%=value%><%=genModel.getNonNLS(key + value)%>);
+ <%}%>
+ <%}%>
+ <%}%>
+
+ <%}%>
+ <%}%>
+ <%}%>
+ <%if (!genPackage.getGenDataTypes().isEmpty()) {%>
+ // Initialize data types
+ <%for (Iterator d=genPackage.getGenDataTypes().iterator(); d.hasNext();) { GenDataType genDataType = (GenDataType)d.next();%>
+ initializeType(<%=genDataType.getSafeUncapName()%>Type, <%=genDataType.getImportedInstanceClassName()%>.class, "<%=genDataType.getName()%>", <%=genDataType.getSerializableFlag().equals("IS_SERIALIZABLE") ? "true" : "false"%>, <%=genDataType.getGeneratedInstanceClassFlag().equals("IS_GENERATED_INSTANCE_CLASS") ? "true" : "false" %>);<%=genModel.getNonNLS()%>
+ <%for (Iterator sources = annotationSources.iterator(); sources.hasNext();) { String annotationSource = (String)sources.next();%>
+ <%EAnnotation dataTypeAnnotation = genDataType.getEcoreDataType().getEAnnotation(annotationSource);%>
+ <%if (dataTypeAnnotation != null) { %>
+ <%for (Iterator k = dataTypeAnnotation.getDetails().iterator(); k.hasNext();) { Map.Entry detail = (Map.Entry)k.next(); String key = Literals.toStringLiteral((String)detail.getKey(), genModel); String value = Literals.toStringLiteral((String)detail.getValue(), genModel);%>
+ setInstanceProperty (<%=genDataType.getSafeUncapName()%>Type, "<%=annotationSource%>", <%=key%>, <%=value%><%=genModel.getNonNLS(key + value)%>);
+ <%}%>
+ <%}%>
+ <%}%>
+
+ <%}%>
+ <%}%>
+ createXSDMetaData(<%=SDOGenUtil.getDependentFactoryArgumentList(genPackage, false)%>);
+ }
+
+ protected void createXSDMetaData(<%=SDOGenUtil.getDependentFactoryArgumentList(genPackage, true)%>)
+ {
+ super.initXSD();
+
+ <%=genModel.getImportedName("commonj.sdo.Property")%> property = null;
+
+ <%String extendedMetaDataSource = ExtendedMetaData.ANNOTATION_URI;%>
+ <%EAnnotation packageAnnotation = genPackage.getEcorePackage().getEAnnotation(extendedMetaDataSource);%>
+ <%if (packageAnnotation != null){ %>
+ addXSDMapping
+ (new String[]
+ {
+ <%for (Iterator k = packageAnnotation.getDetails().iterator(); k.hasNext();) { Map.Entry detail = (Map.Entry)k.next(); String key = Literals.toStringLiteral((String)detail.getKey(), genModel); String value = Literals.toStringLiteral((String)detail.getValue(), genModel);%>
+ <%=key%>, <%=value%><%=k.hasNext() ? "," : ""%><%=genModel.getNonNLS(key + value)%>
+ <%}%>
+ });
+
+ <%}%>
+
+ <%for (Iterator i=genPackage.getGenClassifiers().iterator(); i.hasNext();) { GenClassifier genClassifier = (GenClassifier)i.next(); EAnnotation classAnnotation = genClassifier.getEcoreClassifier().getEAnnotation(extendedMetaDataSource);%>
+ <%if (classAnnotation != null && !genClassifier.getName().equals("DocumentRoot")) {%>
+ addXSDMapping
+ (<%=genClassifier.getSafeUncapName()%>Type,
+ new String[]
+ {
+ <%for (Iterator k = classAnnotation.getDetails().iterator(); k.hasNext();) { Map.Entry detail = (Map.Entry)k.next(); String key = Literals.toStringLiteral((String)detail.getKey(), genModel); String value = Literals.toStringLiteral((String)detail.getValue(), genModel);%>
+ <%=key%>, <%=value%><%=k.hasNext() ? "," : ""%><%=genModel.getNonNLS(key + value)%>
+ <%}%>
+ });
+
+ <%}%>
+ <%if (genClassifier instanceof GenClass) { GenClass genClass = (GenClass) genClassifier;%>
+ <%for (Iterator j=genClass.getGenFeatures().iterator(); j.hasNext();) { GenFeature genFeature = (GenFeature)j.next(); %>
+ <%EAnnotation featureAnnotation = genFeature.getEcoreFeature().getEAnnotation(extendedMetaDataSource);%>
+ <%if (genClass.getName().equals("DocumentRoot")) { %>
+ <%if (!(genFeature.getName().equals("mixed") || genFeature.getName().equals("xMLNSPrefixMap") || genFeature.getName().equals("xSISchemaLocation"))) { %>
+ property = createGlobalProperty
+ ("<%=genFeature.getName()%>",
+ <%=genPackage.getPackageInstanceVariable(genFeature.getTypeGenPackage())%>.get<%=genFeature.getTypeClassifierAccessorName()%>(),
+ new String[]
+ {
+ <%for (Iterator k = featureAnnotation.getDetails().iterator(); k.hasNext();) { Map.Entry detail = (Map.Entry)k.next(); String key = Literals.toStringLiteral((String)detail.getKey(), genModel); String value = Literals.toStringLiteral((String)detail.getValue(), genModel);%>
+ <%=key%>, <%=value%><%=k.hasNext() ? "," : ""%><%=genModel.getNonNLS(key + value)%>
+ <%}%>
+ <%if (!genFeature.isReferenceType()) {%>
+ },
+ IS_ATTRIBUTE);
+ <%} else {%>
+ });
+ <%}%>
+
+ <%for (Iterator sources = genPackage.getAnnotationSources().iterator(); sources.hasNext();) { String annotationSource = (String)sources.next(); %>
+ <%if (!annotationSource.equals(extendedMetaDataSource)) {%>
+ <%EAnnotation globalAnnotation = genFeature.getEcoreFeature().getEAnnotation(annotationSource);%>
+ <%if (globalAnnotation != null) {%>
+ <%for (Iterator k = globalAnnotation.getDetails().iterator(); k.hasNext();) { Map.Entry detail = (Map.Entry)k.next(); String key = Literals.toStringLiteral((String)detail.getKey(), genModel); String value = Literals.toStringLiteral((String)detail.getValue(), genModel);%>
+ setInstanceProperty
+ (property,
+ "<%=annotationSource%>",
+ <%=key%>, <%=value%><%=genModel.getNonNLS(key + value)%>);
+ <%}%>
+
+ <%}%>
+ <%}%>
+ <%}%>
+ <%}%>
+ <%} else {%>
+ addXSDMapping
+ (getProperty(<%=genClassifier.getSafeUncapName()%>Type, <%=genClass.getClassName()%>.INTERNAL_<%=genFeature.getUpperName()%>),
+ new String[]
+ {
+ <%for (Iterator k = featureAnnotation.getDetails().iterator(); k.hasNext();) { Map.Entry detail = (Map.Entry)k.next(); String key = Literals.toStringLiteral((String)detail.getKey(), genModel); String value = Literals.toStringLiteral((String)detail.getValue(), genModel);%>
+ <%=key%>, <%=value%><%=k.hasNext() ? "," : ""%><%=genModel.getNonNLS(key + value)%>
+ <%}%>
+ });
+
+ <%}%>
+ <%}%>
+ <%}%>
+ <%}%>
+ }
+
+<%for (Iterator i=genPackage.getAllGenDataTypes().iterator(); i.hasNext();) { GenDataType genDataType = (GenDataType)i.next();%>
+ <%if (genDataType.isSerializable()) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public <%=genDataType.getObjectInstanceClassName()%> create<%=genDataType.getName()%>FromString(String initialValue)
+ {
+ <%if (genDataType instanceof GenEnum) {%>
+ <%=((GenEnum)genDataType).getImportedInstanceClassName()%> result = <%=((GenEnum)genDataType).getImportedInstanceClassName()%>.get(initialValue);
+ if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + type.getName() + "'");<%=genModel.getNonNLS()%><%=genModel.getNonNLS(2)%><%=genModel.getNonNLS(3)%>
+ return result;
+ <%} else if (genDataType.getBaseType() != null) { GenDataType genBaseType = genDataType.getBaseType(); %>
+ <%if (genBaseType.getGenPackage() == genPackage) {%>
+ return (<%=genDataType.getObjectInstanceClassName()%>)create<%=genBaseType.getName()%>FromString(initialValue);
+ <%} else {%>
+ return (<%=genDataType.getObjectInstanceClassName()%>)<%=SDOGenUtil.getFactoryImpl(genBaseType.getGenPackage())%>.create<%=genBaseType.getName()%>FromString(initialValue);
+ <%}%>
+ <%} else if (genDataType.getItemType() != null) { GenDataType genItemType = genDataType.getItemType(); %>
+ if (initialValue == null) return null;
+ <%=genModel.getImportedName("java.util.List")%> result = new <%=genModel.getImportedName("java.util.ArrayList")%>();
+ for (<%=genModel.getImportedName("java.util.StringTokenizer")%> stringTokenizer = new <%=genModel.getImportedName("java.util.StringTokenizer")%>(initialValue); stringTokenizer.hasMoreTokens(); )
+ {
+ String item = stringTokenizer.nextToken();
+ <%if (genItemType.getGenPackage() == genPackage) {%>
+ result.add(create<%=genItemType.getName()%>FromString(item));
+ <%} else {%>
+ result.add(<%=SDOGenUtil.getFactoryImpl(genItemType.getGenPackage())%>.create<%=genItemType.getName()%>FromString(item));
+ <%}%>
+ }
+ return result;
+ <%} else if (!genDataType.getMemberTypes().isEmpty()) {%>
+ if (initialValue == null) return null;
+ <%=genDataType.getObjectInstanceClassName()%> result = null;
+ RuntimeException exception = null;
+ <%for (Iterator j = genDataType.getMemberTypes().iterator(); j.hasNext(); ) { GenDataType genMemberType = (GenDataType)j.next();%>
+ try
+ {
+ <%if (genMemberType.getGenPackage() == genPackage) {%>
+ result = (<%=genDataType.getObjectInstanceClassName()%>)create<%=genMemberType.getName()%>FromString(initialValue);
+ <%} else {%>
+ result = (<%=genDataType.getObjectInstanceClassName()%>)<%=SDOGenUtil.getFactoryImpl(genMemberType.getGenPackage())%>.create<%=genMemberType.getName()%>FromString(initialValue);
+ <%}%>
+ if (result != null/* && Diagnostician.INSTANCE.validate(type, result, null, null)*/)
+ {
+ return result;
+ }
+ }
+ catch (RuntimeException e)
+ {
+ exception = e;
+ }
+ <%}%>
+ if (result != null || exception == null) return result;
+
+ throw exception;
+ <%} else if (genDataType.isArrayType()) {%>
+ // TODO: implement this method
+ // Ensure that you remove @generated or mark it @generated NOT
+ throw new <%=genModel.getImportedName("java.lang.UnsupportedOperationException")%>();
+ <%} else {%>
+ return (<%=genDataType.getObjectInstanceClassName()%>)super.createFromString(<%=genDataType.getClassifierID()%>, initialValue);
+ <%}%>
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String convert<%=genDataType.getName()%>ToString(Object instanceValue)
+ {
+ <%if (genDataType instanceof GenEnum) {%>
+ return instanceValue == null ? null : instanceValue.toString();
+ <%} else if (genDataType.getBaseType() != null) { GenDataType genBaseType = genDataType.getBaseType(); %>
+ <%if (genBaseType.getGenPackage() == genPackage) {%>
+ return convert<%=genBaseType.getName()%>ToString(instanceValue);
+ <%} else {%>
+ return <%=SDOGenUtil.getFactoryImpl(genBaseType.getGenPackage())%>.convert<%=genBaseType.getName()%>ToString(instanceValue);
+ <%}%>
+ <%} else if (genDataType.getItemType() != null) { GenDataType genItemType = genDataType.getItemType(); %>
+ if (instanceValue == null) return null;
+ <%=genModel.getImportedName("java.util.List")%> list = (<%=genModel.getImportedName("java.util.List")%>)instanceValue;
+ if (list.isEmpty()) return "";
+ <%=genModel.getImportedName("java.lang.StringBuffer")%> result = new <%=genModel.getImportedName("java.lang.StringBuffer")%>();
+ for (<%=genModel.getImportedName("java.util.Iterator")%> i = list.iterator(); i.hasNext(); )
+ {
+ <%if (genItemType.getGenPackage() == genPackage) {%>
+ result.append(convert<%=genItemType.getName()%>ToString(i.next()));
+ <%} else {%>
+ result.append(<%=SDOGenUtil.getFactoryImpl(genItemType.getGenPackage())%>.convert<%=genItemType.getName()%>ToString(i.next()));
+ <%}%>
+ result.append(' ');
+ }
+ return result.substring(0, result.length() - 1);
+ <%} else if (!genDataType.getMemberTypes().isEmpty()) {%>
+ if (instanceValue == null) return null;
+ <%for (Iterator j = genDataType.getMemberTypes().iterator(); j.hasNext(); ) { GenDataType genMemberType = (GenDataType)j.next();%>
+ if (<%=SDOGenUtil.getQualifiedTypeAccessor(genMemberType)%>.isInstance(instanceValue))
+ {
+ try
+ {
+ <%if (genMemberType.getGenPackage() == genPackage) {%>
+ String value = convert<%=genMemberType.getName()%>ToString(instanceValue);
+ <%} else {%>
+ String value = <%=SDOGenUtil.getFactoryImpl(genMemberType.getGenPackage())%>.convert<%=genMemberType.getName()%>ToString(instanceValue);
+ <%}%>
+ if (value != null) return value;
+ }
+ catch (Exception e)
+ {
+ }
+ }
+ <%}%>
+ throw new IllegalArgumentException("Invalid value: '"+instanceValue+"' for datatype :<%=genDataType.getName()%>");
+ <%} else if (genDataType.isArrayType()) {%>
+ // TODO: implement this method
+ // Ensure that you remove @generated or mark it @generated NOT
+ throw new <%=genModel.getImportedName("java.lang.UnsupportedOperationException")%>();
+ <%} else {%>
+ return super.convertToString(<%=genDataType.getClassifierID()%>, instanceValue);
+ <%}%>
+ }
+
+ <%}%>
+<%}%>
+<%} else {%>
+ <%for (Iterator i=genPackage.getGenClasses().iterator(); i.hasNext();) { GenClass genClass = (GenClass)i.next();%>
+ <%if (genClass.hasFactoryInterfaceCreateMethod()) {%>
+ /**
+ * Returns a new object of class '<em><%=genClass.getFormattedName()%></em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em><%=genClass.getFormattedName()%></em>'.
+ * @generated
+ */
+ <%=genClass.getImportedInterfaceName()%> create<%=genClass.getName()%>();
+
+ <%}%>
+ <%}%>
+ /**
+ * Registers the types supported by this Factory within the supplied scope.argument
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param scope an instance of HelperContext used to manage the scoping of types.
+ * @generated
+ */
+ public void register(HelperContext scope);
+
+ <%if (genPackage.isDataTypeConverters()) {%>
+ <%for (Iterator i=genPackage.getAllGenDataTypes().iterator(); i.hasNext();) { GenDataType genDataType = (GenDataType)i.next();%>
+ <%if (genDataType.isSerializable()) {%>
+ /**
+ * Returns an instance of data type '<em><%=genDataType.getFormattedName()%></em>' corresponding the given literal.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param literal a literal of the data type.
+ * @return a new instance value of the data type.
+ * @generated
+ */
+ <%=genDataType.getImportedInstanceClassName()%> create<%=genDataType.getName()%>(String literal);
+
+ /**
+ * Returns a literal representation of an instance of data type '<em><%=genDataType.getFormattedName()%></em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param instanceValue an instance value of the data type.
+ * @return a literal representation of the instance value.
+ * @generated
+ */
+ String convert<%=genDataType.getName()%>(<%=genDataType.getImportedInstanceClassName()%> instanceValue);
+
+ <%}%>
+ <%}%>
+ <%}%>
+<%}%>
+} //<%=isInterface ? genPackage.getFactoryInterfaceName() : genPackage.getFactoryClassName()%>
+<%genModel.emitSortedImports();%>
diff --git a/sdo-java/tags/1.0-incubator-M3/sdo/tools/templates/models/generator.skeleton b/sdo-java/tags/1.0-incubator-M3/sdo/tools/templates/models/generator.skeleton
new file mode 100644
index 0000000000..5c123c01fd
--- /dev/null
+++ b/sdo-java/tags/1.0-incubator-M3/sdo/tools/templates/models/generator.skeleton
@@ -0,0 +1,25 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+ public class CLASS
+ {
+ public String generate(Object argument)
+ {
+ return "";
+ }
+ } \ No newline at end of file