You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by fr...@apache.org on 2006/12/08 01:31:44 UTC
svn commit: r483757 [1/3] - in /incubator/tuscany/java:
sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/
sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/
sdo/impl/src/main/java/org/apache/tuscany/sdo/model/
sdo/impl/src/main/java/org/apache/tus...
Author: frankb
Date: Thu Dec 7 16:31:39 2006
New Revision: 483757
URL: http://svn.apache.org/viewvc?view=rev&rev=483757
Log:
Part of TUSCANY-153 - CS serialization TBD
Removed:
incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/ChangeSummaryType.java
incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/ChangeSummaryTypeImpl.java
Modified:
incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/SDOXSDEcoreBuilder.java
incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/TypeHelperImpl.java
incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/XSDHelperImpl.java
incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/ChangeSummaryImpl.java
incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/ClassImpl.java
incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DataObjectBase.java
incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DataObjectImpl.java
incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DynamicDataObjectImpl.java
incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/BaseDataGraphType.java
incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/ModelFactory.java
incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/Type.java
incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/Types.java
incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/BaseDataGraphTypeImpl.java
incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/DataGraphTypeImpl.java
incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/DataObjectImpl.java
incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/ModelFactoryImpl.java
incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/ModelsTypeImpl.java
incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/PropertyImpl.java
incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/TextTypeImpl.java
incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/TypeImpl.java
incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/TypesImpl.java
incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/XSDTypeImpl.java
incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/java/impl/JavaFactoryImpl.java
incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/DataObjectUtil.java
incubator/tuscany/java/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/JavaGenerator.java
incubator/tuscany/java/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/XSD2JavaGenerator.java
incubator/tuscany/java/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/templates/model/SDOClass.java
incubator/tuscany/java/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/util/SDOGenUtil.java
incubator/tuscany/java/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/ChangeSummaryGenTestCase.java
incubator/tuscany/java/sdo/tools/src/test/java/org/example/simple/cs/QuoteBase.java
incubator/tuscany/java/sdo/tools/src/test/java/org/example/simple/cs/impl/CSFactoryImpl.java
incubator/tuscany/java/sdo/tools/src/test/java/org/example/simple/cs/impl/QuoteBaseImpl.java
incubator/tuscany/java/sdo/tools/src/test/java/org/example/simple/cs/impl/QuoteImpl.java
incubator/tuscany/java/sdo/tools/templates/models/SDOClass.javajet
incubator/tuscany/java/spec/sdo-api/src/main/resources/xml/datagraph.xsd
Modified: incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/SDOXSDEcoreBuilder.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/SDOXSDEcoreBuilder.java?view=diff&rev=483757&r1=483756&r2=483757
==============================================================================
--- incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/SDOXSDEcoreBuilder.java (original)
+++ incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/SDOXSDEcoreBuilder.java Thu Dec 7 16:31:39 2006
@@ -26,7 +26,6 @@
import org.apache.tuscany.sdo.SDOExtendedMetaData;
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.URI;
import org.eclipse.emf.ecore.EClass;
@@ -40,9 +39,7 @@
import org.eclipse.xsd.XSDComponent;
import org.eclipse.xsd.XSDConcreteComponent;
import org.eclipse.xsd.XSDFeature;
-import org.eclipse.xsd.XSDImport;
import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDSchema;
import org.eclipse.xsd.XSDSimpleTypeDefinition;
import org.eclipse.xsd.XSDTypeDefinition;
import org.eclipse.xsd.ecore.XSDEcoreBuilder;
@@ -58,7 +55,6 @@
*/
public class SDOXSDEcoreBuilder extends XSDEcoreBuilder
{
-
public SDOXSDEcoreBuilder(ExtendedMetaData extendedMetaData)
{
super(extendedMetaData);
@@ -81,8 +77,6 @@
getBuiltInEClassifier(
xsdTypeDefinition.getURI(),
xsdTypeDefinition.getName());
- } else if (ModelFactoryImpl.NAMESPACE_URI.equals(xsdTypeDefinition.getTargetNamespace())) {
- eClassifier = ((ModelFactoryImpl)ModelFactory.INSTANCE).getEClassifier(xsdTypeDefinition.getName());
} else {
eClassifier = super.getEClassifier(xsdTypeDefinition);
}
@@ -112,6 +106,11 @@
}
public EClass computeEClass(XSDComplexTypeDefinition 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);
String aliasNames = getEcoreAttribute(xsdComplexTypeDefinition.getElement(), "aliasName");
if (aliasNames != null) {
@@ -121,6 +120,11 @@
}
protected EClassifier computeEClassifier(XSDTypeDefinition 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");
@@ -134,6 +138,11 @@
}
protected EDataType computeEDataType(XSDSimpleTypeDefinition 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);
String aliasNames = getEcoreAttribute(xsdSimpleTypeDefinition.getElement(), "aliasName");
if (aliasNames != null) {
@@ -461,26 +470,4 @@
return qualifiedPackageName.toString().toLowerCase(); //make sure it's lower case .. we can't work with Axis if not.
}
-
- public void generate(XSDSchema xsdSchema) {
- // permits schemas to be valid by having an import of sdoModel.xsd without
- // that import causing masking of the singleton instance of the generated model
- if(!ModelFactoryImpl.NAMESPACE_URI.equals(xsdSchema.getTargetNamespace())) {
- List contents = xsdSchema.getContents();
- List commonjImports = new ArrayList();
- for (Iterator i = contents.iterator(); i.hasNext(); )
- {
- Object content = i.next();
- if (content instanceof XSDImport)
- {
- XSDImport xsdImport = (XSDImport)content;
- if (ModelFactoryImpl.NAMESPACE_URI.equals(xsdImport.getNamespace())) {
- commonjImports.add(xsdImport);
- }
- }
- }
- contents.removeAll(commonjImports);
- super.generate(xsdSchema);
- }
- }
}
Modified: incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/TypeHelperImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/TypeHelperImpl.java?view=diff&rev=483757&r1=483756&r2=483757
==============================================================================
--- incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/TypeHelperImpl.java (original)
+++ incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/TypeHelperImpl.java Thu Dec 7 16:31:39 2006
@@ -21,13 +21,14 @@
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.impl.ModelFactoryImpl;
-import org.apache.tuscany.sdo.model.java.impl.JavaFactoryImpl;
+import org.apache.tuscany.sdo.model.ModelFactory;
+import org.apache.tuscany.sdo.model.java.JavaFactory;
import org.apache.tuscany.sdo.util.SDOUtil;
-import org.apache.tuscany.sdo.util.metadata.impl.MetadataFactoryImpl;
import org.eclipse.emf.ecore.EClassifier;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.util.ExtendedMetaData;
@@ -49,6 +50,19 @@
{
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);
+ //TODO builtInModels.add(XMLFactory.INSTANCE);
+ }
+ return TypeHelperImpl.builtInModels;
+ }
+
public ExtendedMetaData getExtendedMetaData()
{
return extendedMetaData;
@@ -59,9 +73,9 @@
this.extendedMetaData = extendedMetaData;
// Register the standard (predefined) SDO types
- ModelFactoryImpl.init(); //FB
- JavaFactoryImpl.init(); //FB
- MetadataFactoryImpl.init(); //FB
+ 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)
@@ -300,5 +314,6 @@
{
//FB TBD ... in the future we will allow elements or attributes - see SDOUtil.createProperty()
return (Property)extendedMetaData.getElement(uri, propertyName);
- }
+ }
+
}
Modified: incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/XSDHelperImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/XSDHelperImpl.java?view=diff&rev=483757&r1=483756&r2=483757
==============================================================================
--- incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/XSDHelperImpl.java (original)
+++ incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/helper/XSDHelperImpl.java Thu Dec 7 16:31:39 2006
@@ -73,15 +73,25 @@
private ExtendedMetaData extendedMetaData;
- public XSDHelperImpl(ExtendedMetaData extendedMetaData)
+ public XSDHelperImpl(ExtendedMetaData extendedMetaData, String redefineBuiltIn)
{
this.extendedMetaData = extendedMetaData;
ecoreBuilder = new SDOXSDEcoreBuilder(extendedMetaData);
+
+ // 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(TypeHelper typeHelper)
{
- this(((TypeHelperImpl)typeHelper).extendedMetaData);
+ this(((TypeHelperImpl)typeHelper).extendedMetaData, null);
}
public String getLocalName(Type type)
@@ -186,7 +196,7 @@
XSDSchema schema = (XSDSchema)schemaIter.next();
EPackage ePackage = extendedMetaData.getPackage(schema.getTargetNamespace());
- if (ePackage == null) //FB Comment out this line to regenerate sdoModel.xsd
+ if (ePackage == null || TypeHelperImpl.getBuiltInModels().contains(ePackage))
{
Collection originalEPackages = new HashSet(ecoreBuilder.getTargetNamespaceToEPackageMap().values());
ecoreBuilder.generate(schema);
@@ -209,7 +219,7 @@
}
catch (Exception e)
{
- //e.printStackTrace();
+ e.printStackTrace();
throw new IllegalArgumentException(e.getMessage());
}
}
Modified: incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/ChangeSummaryImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/ChangeSummaryImpl.java?view=diff&rev=483757&r1=483756&r2=483757
==============================================================================
--- incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/ChangeSummaryImpl.java (original)
+++ incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/ChangeSummaryImpl.java Thu Dec 7 16:31:39 2006
@@ -87,7 +87,8 @@
* @ordered
*/
protected DataGraph eDataGraph = null;
- // TODO T-153 protected DataObject eDataObject = null;
+
+ protected DataObject dataObject = null;
protected ChangeRecorder changeRecorder = null;
protected EList cachedObjectsToDetach = null;
@@ -133,16 +134,6 @@
return eDataGraph;
}
-// TODO T-153 /**
-// * <!-- begin-user-doc -->
-// * <!-- end-user-doc -->
-// * handcrafted but could be generated
-// */
-// public DataObject getEDataObject()
-// {
-// return eDataObject;
-// }
-
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -159,23 +150,6 @@
}
return msgs;
}
-//TODO T-153
-// /**
-// * <!-- begin-user-doc -->
-// * <!-- end-user-doc -->
-// * handcrafted but could be genereated
-// */
-// public NotificationChain basicSetEDataObject(DataObject newEDataObject, NotificationChain msgs)
-// {
-// DataObject oldEDataObject = eDataObject;
-// eDataObject = newEDataObject;
-// if (eNotificationRequired())
-// {
-// ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SDOPackage.CHANGE_SUMMARY__EDATA_OBJECT, oldEDataObject, newEDataObject);
-// if (msgs == null) msgs = notification; else msgs.add(notification);
-// }
-// return msgs;
-// }
/**
* <!-- begin-user-doc -->
@@ -198,31 +172,16 @@
eNotify(new ENotificationImpl(this, Notification.SET, SDOPackage.CHANGE_SUMMARY__EDATA_GRAPH, newEDataGraph, newEDataGraph));
}
-//TODO T-153
-// /**
-// * <!-- begin-user-doc -->
-// * <!-- end-user-doc -->
-// * handcrafted but could be generated
-// */
-// public void setEDataObject(DataObject newEDataObject)
-// {
-// if (newEDataObject != eDataObject)
-// {
-// NotificationChain msgs = null;
-// // TODO kg - not sure if we need this if the DataObject carries the CS in a setting?
-// // if not then perhaps the inverse remove should still be carried out somehow
-// //if (eDataObject != null)
-// // msgs = ((InternalEObject)eDataObject).eInverseRemove(this, SDOPackage.DATA_OBJECT__ECHANGE_SUMMARY, DataObject.class, msgs);
-// //if (newEDataObject != null)
-// // msgs = ((InternalEObject)newEDataObject).eInverseAdd(this, SDOPackage.DATA_OBJECT__ECHANGE_SUMMARY, DataObject.class, msgs);
-// msgs = basicSetEDataObject(newEDataObject, msgs);
-// if (msgs != null) msgs.dispatch();
-// }
-// else if (eNotificationRequired())
-// eNotify(new ENotificationImpl(this, Notification.SET, SDOPackage.CHANGE_SUMMARY__EDATA_OBJECT, newEDataObject, newEDataObject));
-// }
+ public DataObject getDataObject()
+ {
+ return dataObject;
+ }
+
+ public void setDataObject(DataObject newDataObject)
+ {
+ dataObject = newDataObject;
+ }
-
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -250,15 +209,18 @@
*/
private void beginRecording() {
changeRecorder = new SDOChangeRecorder();
-// TODO T-153
-// if(getEDataGraph() != null) {
- changeRecorder.beginRecording(Collections.singleton(((DataGraphImpl)getEDataGraph()).getRootResource()));
-// } else if (getEDataObject() != null) {
-// changeRecorder.beginRecording(Collections.singleton(getEDataObject()));
-// } else {
-// // TODO kg - work out if this can ever occur, and if so then handle better
-// throw new IllegalStateException("Change Summary not attached to a DataObject or DataGraph");
-// }
+ 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");
+ }
}
/**
@@ -296,12 +258,6 @@
if (eDataGraph != null)
msgs = ((InternalEObject)eDataGraph).eInverseRemove(this, SDOPackage.DATA_GRAPH__ECHANGE_SUMMARY, DataGraph.class, msgs);
return basicSetEDataGraph((DataGraph)otherEnd, msgs);
-// TODO T-153
-// case SDOPackage.CHANGE_SUMMARY__EDATA_OBJECT:
-// // FIXME how does this inverse remove work? We don't have a SDOPackage.DATA_OBJECT__ECHANGE_SUMMARY
-// //if (eDataObject != null)
-// // msgs = ((InternalEObject)eDataObject).eInverseRemove(this, SDOPackage.DATA_OBJECT__ECHANGE_SUMMARY, DataGraph.class, msgs);
-// return basicSetEDataObject((DataObject)otherEnd, msgs);
default:
return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
}
@@ -330,9 +286,6 @@
return ((InternalEList)getResourceChanges()).basicRemove(otherEnd, msgs);
case SDOPackage.CHANGE_SUMMARY__EDATA_GRAPH:
return basicSetEDataGraph(null, msgs);
-// TODO T-153
-// case SDOPackage.CHANGE_SUMMARY__EDATA_OBJECT:
-// return basicSetEDataObject(null, msgs);
default:
return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
}
@@ -393,10 +346,6 @@
case SDOPackage.CHANGE_SUMMARY__EDATA_GRAPH:
setEDataGraph((DataGraph)newValue);
return;
-// TODO T-153
-// case SDOPackage.CHANGE_SUMMARY__EDATA_OBJECT:
-// setEDataObject((DataObject)newValue);
-// return;
}
eDynamicSet(featureID, newValue);
}
@@ -425,10 +374,6 @@
case SDOPackage.CHANGE_SUMMARY__EDATA_GRAPH:
setEDataGraph((DataGraph)null);
return;
-// TODO T-153
-// case SDOPackage.CHANGE_SUMMARY__EDATA_OBJECT:
-// setEDataObject((DataObject)null);
-// return;
}
eDynamicUnset(featureID);
}
@@ -452,9 +397,6 @@
return resourceChanges != null && !resourceChanges.isEmpty();
case SDOPackage.CHANGE_SUMMARY__EDATA_GRAPH:
return eDataGraph != null;
-// TODO T-153
-// case SDOPackage.CHANGE_SUMMARY__EDATA_OBJECT:
-// return eDataObject != null;
}
return eDynamicIsSet(featureID);
}
@@ -715,17 +657,6 @@
}
-//TODO T-153
-// /**
-// * <!-- begin-user-doc -->
-// * <!-- end-user-doc -->
-// * handcrafted but could be generated
-// */
-// public DataObject getDataObject()
-// {
-// return getEDataObject();
-// }
-
protected Set deletedObjects;
protected void preApply(boolean reverse)
@@ -771,17 +702,14 @@
*/
public DataObject getRootObject()
{
- DataGraph dataGraph = getDataGraph();
- if (dataGraph != null)
+ if (eDataGraph != null)
+ {
+ return eDataGraph.getRootObject();
+ }
+ if (dataObject != null)
{
- return dataGraph.getRootObject();
+ return dataObject;
}
-// TODO T-153
-// // TODO: create a test to exercise this path
-// DataObject dataObject = getDataObject();
-// if(dataObject != null) {
-// return dataObject;
-// }
return null;
}
Modified: incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/ClassImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/ClassImpl.java?view=diff&rev=483757&r1=483756&r2=483757
==============================================================================
--- incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/ClassImpl.java (original)
+++ incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/ClassImpl.java Thu Dec 7 16:31:39 2006
@@ -49,9 +49,8 @@
*/
public class ClassImpl extends EClassImpl implements Type, org.apache.tuscany.sdo.model.Type/*, DataObject*/
{
- private static final Property cspCacheUnitialized = SDOFactory.eINSTANCE.createAttribute();
- private Property changeSummaryPropertyCache = cspCacheUnitialized;
-
+ private static final Property UNINITIALIZED_CSPC = SDOFactory.eINSTANCE.createAttribute();
+ private Property changeSummaryPropertyCache = UNINITIALIZED_CSPC;
/**
* <!-- begin-user-doc -->
@@ -292,33 +291,21 @@
return getURI();
}
-//TODO T-153
- /**
- *
- */
public Property getChangeSummaryProperty() {
-
-
- // TODO make sure to take account of dynamic types, where the state might go from
- // not having a cs to having a cs
- if(changeSummaryPropertyCache == cspCacheUnitialized) {
- // check for a property of type ChangeSummaryType and give special treatment
+ if (changeSummaryPropertyCache == UNINITIALIZED_CSPC) {
changeSummaryPropertyCache = null;
- Iterator props = getProperties().iterator();
-
- Type csType = (Type)((ModelFactoryImpl)ModelFactory.INSTANCE).getChangeSummaryType();
- while(props.hasNext()) {
+
+ // 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()) {
- if(changeSummaryPropertyCache == null) {
- changeSummaryPropertyCache = p;
- } else {
- throw new IllegalStateException("Only one Property of type ChangeSummaryType is permitted in a Type");
- }
+ changeSummaryPropertyCache = p;
+ break;
}
}
}
-
+
return changeSummaryPropertyCache;
}
Modified: incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DataObjectBase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DataObjectBase.java?view=diff&rev=483757&r1=483756&r2=483757
==============================================================================
--- incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DataObjectBase.java (original)
+++ incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DataObjectBase.java Thu Dec 7 16:31:39 2006
@@ -22,6 +22,7 @@
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;
@@ -106,13 +107,19 @@
return new BasicSequence((FeatureMap.Internal)((FeatureMap.Internal.Wrapper)sequence).featureMap().list(((EClass)type).getEStructuralFeature(propertyIndex)));
}
- /*
- * get the value of the type's property at propertyIndex via the sequence
- * @param seq
- * @param type
- * @param propertyIndex
- * @return
- */
+ 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);
}
Modified: incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DataObjectImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DataObjectImpl.java?view=diff&rev=483757&r1=483756&r2=483757
==============================================================================
--- incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DataObjectImpl.java (original)
+++ incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DataObjectImpl.java Thu Dec 7 16:31:39 2006
@@ -30,7 +30,6 @@
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.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EAttribute;
@@ -39,7 +38,6 @@
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.impl.ENotificationImpl;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.util.BasicExtendedMetaData;
import org.eclipse.emf.ecore.util.EContentsEList;
@@ -1316,45 +1314,6 @@
{
return DataObjectUtil.getChangeSummary(this);
}
-
-//TODO T-153
-// public ChangeSummary getEChangeSummary() {
-// Property p = DataObjectUtil.getChangeSummaryProperty(this);
-// return (ChangeSummary)eGet((EStructuralFeature)p);
-// }
-//
-// public NotificationChain basicSetEChangeSummary(ChangeSummary newEChangeSummary, NotificationChain msgs)
-// {
-// ChangeSummary oldEChangeSummary = getEChangeSummary();
-// Property p = DataObjectUtil.getChangeSummaryProperty(this);
-// eSet((EStructuralFeature)p, newEChangeSummary);
-// if (eNotificationRequired())
-// {
-// // FBCHECK Do I need any of this notification stuff - I think FB said "no"
-// // FIXME how would I do this when there isnt a SDOPackage.DATA_OBJECT__ECHANGE_SUMMARY
-// // ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SDOPackage.DATA_OBJECT__ECHANGE_SUMMARY, oldEChangeSummary, newEChangeSummary);
-// // if (msgs == null) msgs = notification; else msgs.add(notification);
-// }
-// return msgs;
-// }
-//
-// public void setEChangeSummary(ChangeSummary newEChangeSummary) {
-// ChangeSummary eChangeSummary = getEChangeSummary();
-// if (newEChangeSummary != eChangeSummary)
-// {
-// NotificationChain msgs = null;
-// if (eChangeSummary != null)
-// msgs = ((InternalEObject)eChangeSummary).eInverseRemove(this, SDOPackage.CHANGE_SUMMARY__EDATA_OBJECT, ChangeSummary.class, msgs);
-// if (newEChangeSummary != null)
-// msgs = ((InternalEObject)newEChangeSummary).eInverseAdd(this, SDOPackage.CHANGE_SUMMARY__EDATA_OBJECT, ChangeSummary.class, msgs);
-// msgs = basicSetEChangeSummary(newEChangeSummary, msgs);
-// if (msgs != null) msgs.dispatch();
-// }
-// else if (eNotificationRequired()) {
-// // FIXME - define SDOPackage.DATA_OBJECT__ECHANGE_SUMMARY or fix logic
-// // eNotify(new ENotificationImpl(this, Notification.SET, SDOPackage.DATA_OBJECT__ECHANGE_SUMMARY, newEChangeSummary, newEChangeSummary));
-// }
-// }
/**
* <!-- begin-user-doc -->
Modified: incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DynamicDataObjectImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DynamicDataObjectImpl.java?view=diff&rev=483757&r1=483756&r2=483757
==============================================================================
--- incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DynamicDataObjectImpl.java (original)
+++ incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/impl/DynamicDataObjectImpl.java Thu Dec 7 16:31:39 2006
@@ -63,6 +63,13 @@
{
super();
eSetClass(eClass);
+ Property csp = ((ClassImpl)eClass).getChangeSummaryProperty();
+ if (csp != null)
+ {
+ ChangeSummaryImpl changeSummary = (ChangeSummaryImpl)SDOFactory.eINSTANCE.createChangeSummary();
+ set(csp, changeSummary);
+ changeSummary.setDataObject(this);
+ }
}
/**
@@ -194,17 +201,7 @@
public EObject basicCreate(EClass eClass)
{
-// TODO T-153
-// TODO TUSCANY-153 decide if i need this eager initialization
-// Property csp = ((ClassImpl)eClass).getChangeSummaryProperty();
-// if(csp == null) {
- return new DynamicDataObjectImpl(eClass);
-// } else {
-// DynamicDataObjectImpl result = new DynamicDataObjectImpl(eClass);
-// result.set(csp, SDOFactory.eINSTANCE.createChangeSummary());
-// return result;
-// }
-
+ return new DynamicDataObjectImpl(eClass);
}
}
Modified: incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/BaseDataGraphType.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/BaseDataGraphType.java?view=diff&rev=483757&r1=483756&r2=483757
==============================================================================
--- incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/BaseDataGraphType.java (original)
+++ incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/BaseDataGraphType.java Thu Dec 7 16:31:39 2006
@@ -6,6 +6,7 @@
*/
package org.apache.tuscany.sdo.model;
+import commonj.sdo.ChangeSummary;
import commonj.sdo.Sequence;
import java.io.Serializable;
@@ -20,7 +21,7 @@
* <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#getChangeSummary <em>Change Summary</em>}</li>
* <li>{@link org.apache.tuscany.sdo.model.BaseDataGraphType#getAnyAttribute <em>Any Attribute</em>}</li>
* </ul>
* </p>
@@ -79,28 +80,28 @@
void setXsd(XSDType value);
/**
- * Returns the value of the '<em><b>Change Summary</b></em>' containment reference.
+ * 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>' containment reference isn't clear,
+ * 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>' containment reference.
- * @see #setChangeSummary(ChangeSummaryType)
+ * @return the value of the '<em>Change Summary</em>' attribute.
+ * @see #setChangeSummary(ChangeSummary)
* @generated
*/
- ChangeSummaryType getChangeSummary_();
+ ChangeSummary getChangeSummary();
/**
- * Sets the value of the '{@link org.apache.tuscany.sdo.model.BaseDataGraphType#getChangeSummary_ <em>Change Summary</em>}' containment reference.
+ * 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>' containment reference.
- * @see #getChangeSummary_()
+ * @param value the new value of the '<em>Change Summary</em>' attribute.
+ * @see #getChangeSummary()
* @generated
*/
- void setChangeSummary(ChangeSummaryType value);
+ void setChangeSummary(ChangeSummary value);
/**
* Returns the value of the '<em><b>Any Attribute</b></em>' attribute list.
Modified: incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/ModelFactory.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/ModelFactory.java?view=diff&rev=483757&r1=483756&r2=483757
==============================================================================
--- incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/ModelFactory.java (original)
+++ incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/ModelFactory.java Thu Dec 7 16:31:39 2006
@@ -26,15 +26,6 @@
ModelFactory INSTANCE = org.apache.tuscany.sdo.model.impl.ModelFactoryImpl.init();
/**
- * Returns a new object of class '<em>Change Summary Type</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>Change Summary Type</em>'.
- * @generated
- */
- ChangeSummaryType createChangeSummaryType();
-
- /**
* Returns a new object of class '<em>Data Graph Type</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
Modified: incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/Type.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/Type.java?view=diff&rev=483757&r1=483756&r2=483757
==============================================================================
--- incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/Type.java (original)
+++ incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/Type.java Thu Dec 7 16:31:39 2006
@@ -358,7 +358,7 @@
* @generated
*/
Sequence getAnyAttribute();
-
+
String getInstanceClassName();
} // Type
Modified: incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/Types.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/Types.java?view=diff&rev=483757&r1=483756&r2=483757
==============================================================================
--- incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/Types.java (original)
+++ incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/Types.java Thu Dec 7 16:31:39 2006
@@ -40,7 +40,7 @@
* @generated
*/
List getType_();
-
+
List getTypeList();
} // Types
Modified: incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/BaseDataGraphTypeImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/BaseDataGraphTypeImpl.java?view=diff&rev=483757&r1=483756&r2=483757
==============================================================================
--- incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/BaseDataGraphTypeImpl.java (original)
+++ incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/BaseDataGraphTypeImpl.java Thu Dec 7 16:31:39 2006
@@ -6,13 +6,13 @@
*/
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.ChangeSummaryType;
import org.apache.tuscany.sdo.model.ModelFactory;
import org.apache.tuscany.sdo.model.ModelsType;
import org.apache.tuscany.sdo.model.XSDType;
@@ -26,7 +26,7 @@
* <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#getChangeSummary <em>Change Summary</em>}</li>
* <li>{@link org.apache.tuscany.sdo.model.impl.BaseDataGraphTypeImpl#getAnyAttribute <em>Any Attribute</em>}</li>
* </ul>
* </p>
@@ -54,7 +54,7 @@
public final static int XSD = 1;
/**
- * The feature id for the '<em><b>Change Summary</b></em>' containment reference.
+ * The feature id for the '<em><b>Change Summary</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -104,16 +104,25 @@
protected XSDType xsd = null;
/**
- * The cached value of the '{@link #getChangeSummary_() <em>Change Summary</em>}' containment reference.
+ * The default value of the '{@link #getChangeSummary() <em>Change Summary</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @see #getChangeSummary_()
+ * @see #getChangeSummary()
* @generated
* @ordered
*/
-
- protected ChangeSummaryType changeSummary = null;
-
+ 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_;
+
/**
* The cached value of the '{@link #getAnyAttribute() <em>Any Attribute</em>}' attribute list.
* <!-- begin-user-doc -->
@@ -130,9 +139,10 @@
* <!-- end-user-doc -->
* @generated
*/
- protected BaseDataGraphTypeImpl()
+ public BaseDataGraphTypeImpl()
{
super();
+ createChangeSummary(CHANGE_SUMMARY);
}
/**
@@ -242,7 +252,7 @@
* <!-- end-user-doc -->
* @generated
*/
- public ChangeSummaryType getChangeSummary_()
+ public ChangeSummary getChangeSummary()
{
return changeSummary;
}
@@ -251,36 +261,12 @@
* <!-- end-user-doc -->
* @generated
*/
- public ChangeContext basicSetChangeSummary(ChangeSummaryType newChangeSummary, ChangeContext changeContext)
+ public void setChangeSummary(ChangeSummary newChangeSummary)
{
- ChangeSummaryType oldChangeSummary = changeSummary;
+ ChangeSummary oldChangeSummary = changeSummary;
changeSummary = newChangeSummary;
if (isNotifying())
- {
- addNotification(this, ChangeKind.SET, CHANGE_SUMMARY, oldChangeSummary, newChangeSummary, changeContext);
- }
- return changeContext;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setChangeSummary(ChangeSummaryType newChangeSummary)
- {
- if (newChangeSummary != changeSummary)
- {
- ChangeContext changeContext = null;
- if (changeSummary != null)
- changeContext = inverseRemove(changeSummary, this, OPPOSITE_FEATURE_BASE - CHANGE_SUMMARY, null, changeContext);
- if (newChangeSummary != null)
- changeContext = inverseAdd(newChangeSummary, this, OPPOSITE_FEATURE_BASE - CHANGE_SUMMARY, null, changeContext);
- changeContext = basicSetChangeSummary(newChangeSummary, changeContext);
- if (changeContext != null) dispatch(changeContext);
- }
- else if (isNotifying())
- notify(ChangeKind.SET, CHANGE_SUMMARY, newChangeSummary, newChangeSummary);
+ notify(ChangeKind.SET, CHANGE_SUMMARY, oldChangeSummary, changeSummary);
}
/**
@@ -309,8 +295,6 @@
return basicSetModels(null, changeContext);
case XSD:
return basicSetXsd(null, changeContext);
- case CHANGE_SUMMARY:
- return basicSetChangeSummary(null, changeContext);
case ANY_ATTRIBUTE:
return removeFromSequence(getAnyAttribute(), otherEnd, changeContext);
}
@@ -331,7 +315,7 @@
case XSD:
return getXsd();
case CHANGE_SUMMARY:
- return getChangeSummary_();
+ 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)
@@ -356,7 +340,7 @@
setXsd((XSDType)newValue);
return;
case CHANGE_SUMMARY:
- setChangeSummary((ChangeSummaryType)newValue);
+ setChangeSummary((ChangeSummary)newValue);
return;
case ANY_ATTRIBUTE:
setSequence(getAnyAttribute(), newValue);
@@ -381,7 +365,7 @@
setXsd((XSDType)null);
return;
case CHANGE_SUMMARY:
- setChangeSummary((ChangeSummaryType)null);
+ setChangeSummary(CHANGE_SUMMARY_DEFAULT_);
return;
case ANY_ATTRIBUTE:
unsetSequence(getAnyAttribute());
@@ -404,7 +388,7 @@
case XSD:
return xsd != null;
case CHANGE_SUMMARY:
- return changeSummary != null;
+ return CHANGE_SUMMARY_DEFAULT_ == null ? changeSummary != null : !CHANGE_SUMMARY_DEFAULT_.equals(changeSummary);
case ANY_ATTRIBUTE:
return anyAttribute != null && !isSequenceEmpty(getAnyAttribute());
}
@@ -421,7 +405,9 @@
if (isProxy(this)) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
- result.append(" (anyAttribute: ");
+ result.append(" (changeSummary: ");
+ result.append(changeSummary);
+ result.append(", anyAttribute: ");
result.append(anyAttribute);
result.append(')');
return result.toString();
Modified: incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/DataGraphTypeImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/DataGraphTypeImpl.java?view=diff&rev=483757&r1=483756&r2=483757
==============================================================================
--- incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/DataGraphTypeImpl.java (original)
+++ incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/DataGraphTypeImpl.java Thu Dec 7 16:31:39 2006
@@ -46,7 +46,7 @@
public final static int XSD = BaseDataGraphTypeImpl.XSD;
/**
- * The feature id for the '<em><b>Change Summary</b></em>' containment reference.
+ * The feature id for the '<em><b>Change Summary</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -98,7 +98,7 @@
* <!-- end-user-doc -->
* @generated
*/
- protected DataGraphTypeImpl()
+ public DataGraphTypeImpl()
{
super();
}
Modified: incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/DataObjectImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/DataObjectImpl.java?view=diff&rev=483757&r1=483756&r2=483757
==============================================================================
--- incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/DataObjectImpl.java (original)
+++ incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/DataObjectImpl.java Thu Dec 7 16:31:39 2006
@@ -39,7 +39,7 @@
* <!-- end-user-doc -->
* @generated
*/
- protected DataObjectImpl()
+ public DataObjectImpl()
{
super();
}
Modified: incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/ModelFactoryImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/ModelFactoryImpl.java?view=diff&rev=483757&r1=483756&r2=483757
==============================================================================
--- incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/ModelFactoryImpl.java (original)
+++ incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/ModelFactoryImpl.java Thu Dec 7 16:31:39 2006
@@ -6,6 +6,7 @@
*/
package org.apache.tuscany.sdo.model.impl;
+import commonj.sdo.ChangeSummary;
import commonj.sdo.DataObject;
import commonj.sdo.helper.DataHelper;
@@ -32,10 +33,8 @@
* 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:
- * 0. TEMPORARY Kludge: comment out the following line in the XSDHelperImpl.define() method:
- * //if (ePackage == null) //FB Comment out this line to regenerate sdoModel.xsd
* 1. Regenerate the model into a temporary directory:
- * XSD2JavaGenerator -targetDirectory <temp-dir> -javaPackage org.apache.tuscany.sdo.model <sdo-api-dir>/src/main/resources/xml/sdoModel.xsd
+ * 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_();
@@ -70,22 +69,22 @@
* <!-- end-user-doc -->
* @generated
*/
- public static final String NAMESPACE_PREFIX = "sdo"; //FB generated as "commonj"
+ public static final String NAMESPACE_PREFIX = "sdo"; //FB generated as "commonj"
public static final int BASE_DATA_GRAPH_TYPE = 1;
- public static final int CHANGE_SUMMARY_TYPE = 2;
- public static final int DATA_GRAPH_TYPE = 3;
- public static final int DATA_OBJECT = 4;
- public static final int MODELS_TYPE = 5;
- public static final int PROPERTY = 6;
- public static final int TEXT_TYPE = 7;
- public static final int TYPE = 8;
- public static final int TYPES = 9;
- public static final int XSD_TYPE = 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 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 BOOLEAN = 10;
+ public static final int BOOLEAN_OBJECT = 11;
+ public static final int BYTE = 12;
+ public static final int BYTE_OBJECT = 13;
+ public static final int BYTES = 14;
+ public static final int CHANGE_SUMMARY_TYPE = 15;
public static final int CHARACTER = 16;
public static final int CHARACTER_OBJECT = 17;
public static final int DATE = 18;
@@ -135,7 +134,6 @@
{
switch (typeNumber)
{
- case CHANGE_SUMMARY_TYPE: return (DataObject)createChangeSummaryType();
case DATA_GRAPH_TYPE: return (DataObject)createDataGraphType();
case MODELS_TYPE: return (DataObject)createModelsType();
case PROPERTY: return (DataObject)createProperty();
@@ -166,6 +164,8 @@
return createByteObjectFromString(initialValue);
case BYTES:
return createBytesFromString(initialValue);
+ case CHANGE_SUMMARY_TYPE:
+ return createChangeSummaryTypeFromString(initialValue);
case CHARACTER:
return createCharacterFromString(initialValue);
case CHARACTER_OBJECT:
@@ -246,6 +246,8 @@
return convertByteObjectToString(instanceValue);
case BYTES:
return convertBytesToString(instanceValue);
+ case CHANGE_SUMMARY_TYPE:
+ return convertChangeSummaryTypeToString(instanceValue);
case CHARACTER:
return convertCharacterToString(instanceValue);
case CHARACTER_OBJECT:
@@ -311,16 +313,6 @@
* <!-- end-user-doc -->
* @generated
*/
- public ChangeSummaryType createChangeSummaryType()
- {
- ChangeSummaryTypeImpl changeSummaryType = new ChangeSummaryTypeImpl();
- return changeSummaryType;
- }
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
public DataGraphType createDataGraphType()
{
DataGraphTypeImpl dataGraphType = new DataGraphTypeImpl();
@@ -385,13 +377,6 @@
return baseDataGraphTypeType;
}
- protected commonj.sdo.Type changeSummaryTypeType = null;
-
- public commonj.sdo.Type getChangeSummaryType()
- {
- return changeSummaryTypeType;
- }
-
protected commonj.sdo.Type dataGraphTypeType = null;
public commonj.sdo.Type getDataGraphType()
@@ -483,6 +468,13 @@
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()
@@ -711,24 +703,18 @@
if (isCreated) return;
isCreated = true;
+ // Create types and their properties
baseDataGraphTypeType = createType(false, BASE_DATA_GRAPH_TYPE);
createProperty(false, baseDataGraphTypeType, BaseDataGraphTypeImpl.MODELS);
createProperty(false, baseDataGraphTypeType, BaseDataGraphTypeImpl.XSD);
- createProperty(false, baseDataGraphTypeType, BaseDataGraphTypeImpl.CHANGE_SUMMARY);
+ createProperty(true, baseDataGraphTypeType, BaseDataGraphTypeImpl.CHANGE_SUMMARY);
createProperty(true, baseDataGraphTypeType, BaseDataGraphTypeImpl.ANY_ATTRIBUTE);
- changeSummaryTypeType = createType(false, CHANGE_SUMMARY_TYPE);
- createProperty(true, changeSummaryTypeType, ChangeSummaryTypeImpl.ANY);
- createProperty(true, changeSummaryTypeType, ChangeSummaryTypeImpl.CREATE);
- createProperty(true, changeSummaryTypeType, ChangeSummaryTypeImpl.DELETE);
- createProperty(true, changeSummaryTypeType, ChangeSummaryTypeImpl.LOGGING);
-
dataGraphTypeType = createType(false, DATA_GRAPH_TYPE);
createProperty(true, dataGraphTypeType, DataGraphTypeImpl.ANY);
dataObjectType = createType(false, DATA_OBJECT);
-
modelsTypeType = createType(false, MODELS_TYPE);
createProperty(true, modelsTypeType, ModelsTypeImpl.ANY);
@@ -766,11 +752,14 @@
xsdTypeType = createType(false, XSD_TYPE);
createProperty(true, xsdTypeType, XSDTypeImpl.ANY);
+
+ // Create data types
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 );
@@ -809,136 +798,91 @@
isInitialized = true;
commonj.sdo.Property property = null;
- // Add supertypes to classes
+ // Add supertypes to types
addSuperType(dataGraphTypeType, baseDataGraphTypeType);
- // Initialize classes and features; add operations and parameters
+ // Initialize types and properties
initializeType(baseDataGraphTypeType, BaseDataGraphType.class, "BaseDataGraphType", true);
-
property = (commonj.sdo.Property)baseDataGraphTypeType.getProperties().get(BaseDataGraphTypeImpl.MODELS);
- initializeProperty(property, getModelsType(), "models", null, 0, 1, BaseDataGraphType.class, false, false, false, true, null);
-
+ initializeProperty(property, this.getModelsType(), "models", null, 0, 1, BaseDataGraphType.class, false, false, false, true, null);
property = (commonj.sdo.Property)baseDataGraphTypeType.getProperties().get(BaseDataGraphTypeImpl.XSD);
- initializeProperty(property, getXSDType(), "xsd", null, 0, 1, BaseDataGraphType.class, false, false, false, true, null);
-
+ initializeProperty(property, this.getXSDType(), "xsd", null, 0, 1, BaseDataGraphType.class, false, false, false, true, null);
property = (commonj.sdo.Property)baseDataGraphTypeType.getProperties().get(BaseDataGraphTypeImpl.CHANGE_SUMMARY);
- initializeProperty(property, this.getChangeSummaryType(), "changeSummary", null, 0, 1, BaseDataGraphType.class, false, false, false, true, null);
-
+ initializeProperty(property, this.getChangeSummaryType(), "changeSummary", null, 0, 1, BaseDataGraphType.class, false, false, false);
property = (commonj.sdo.Property)baseDataGraphTypeType.getProperties().get(BaseDataGraphTypeImpl.ANY_ATTRIBUTE);
initializeProperty(property, getSequence(), "anyAttribute", null, 0, -1, BaseDataGraphType.class, false, false, false);
- initializeType(changeSummaryTypeType, ChangeSummaryType.class, "ChangeSummaryType");
-
- property = (commonj.sdo.Property)changeSummaryTypeType.getProperties().get(ChangeSummaryTypeImpl.ANY);
- initializeProperty(property, getSequence(), "any", null, 0, -1, ChangeSummaryType.class, false, false, false);
-
- property = (commonj.sdo.Property)changeSummaryTypeType.getProperties().get(ChangeSummaryTypeImpl.CREATE);
- initializeProperty(property, this.getString(), "create", null, 0, 1, ChangeSummaryType.class, false, false, false);
-
- property = (commonj.sdo.Property)changeSummaryTypeType.getProperties().get(ChangeSummaryTypeImpl.DELETE);
- initializeProperty(property, this.getString(), "delete", null, 0, 1, ChangeSummaryType.class, false, false, false);
-
- property = (commonj.sdo.Property)changeSummaryTypeType.getProperties().get(ChangeSummaryTypeImpl.LOGGING);
- initializeProperty(property, this.getBoolean(), "logging", null, 0, 1, ChangeSummaryType.class, false, true, false);
-
- initializeType(dataGraphTypeType, DataGraphType.class, "DataGraphType");
-
+ initializeType(dataGraphTypeType, DataGraphType.class, "DataGraphType", false);
property = (commonj.sdo.Property)dataGraphTypeType.getProperties().get(DataGraphTypeImpl.ANY);
initializeProperty(property, getSequence(), "any", null, 0, 1, DataGraphType.class, false, false, false);
- initializeType(dataObjectType, DataObject.class, "DataObject", true);
-
- initializeType(modelsTypeType, ModelsType.class, "ModelsType");
+ initializeType(dataObjectType, org.apache.tuscany.sdo.model.DataObject.class, "DataObject", true);
+ initializeType(modelsTypeType, ModelsType.class, "ModelsType", false);
property = (commonj.sdo.Property)modelsTypeType.getProperties().get(ModelsTypeImpl.ANY);
initializeProperty(property, getSequence(), "any", null, 0, -1, ModelsType.class, false, false, false);
- initializeType(propertyType, Property.class, "Property");
-
+ initializeType(propertyType, Property.class, "Property", false);
property = (commonj.sdo.Property)propertyType.getProperties().get(PropertyImpl.ALIAS_NAME);
initializeProperty(property, this.getString(), "aliasName", null, 0, -1, Property.class, false, false, false);
-
property = (commonj.sdo.Property)propertyType.getProperties().get(PropertyImpl.ANY);
initializeProperty(property, getSequence(), "any", null, 0, -1, Property.class, false, false, false);
-
property = (commonj.sdo.Property)propertyType.getProperties().get(PropertyImpl.NAME);
initializeProperty(property, this.getString(), "name", null, 0, 1, Property.class, false, false, false);
-
property = (commonj.sdo.Property)propertyType.getProperties().get(PropertyImpl.MANY);
initializeProperty(property, this.getBoolean(), "many", null, 0, 1, Property.class, false, true, false);
-
property = (commonj.sdo.Property)propertyType.getProperties().get(PropertyImpl.CONTAINMENT);
initializeProperty(property, this.getBoolean(), "containment", null, 0, 1, Property.class, false, true, false);
-
property = (commonj.sdo.Property)propertyType.getProperties().get(PropertyImpl.DEFAULT);
initializeProperty(property, this.getString(), "default", null, 0, 1, Property.class, false, false, false);
-
property = (commonj.sdo.Property)propertyType.getProperties().get(PropertyImpl.READ_ONLY);
initializeProperty(property, this.getBoolean(), "readOnly", null, 0, 1, Property.class, false, true, false);
-
property = (commonj.sdo.Property)propertyType.getProperties().get(PropertyImpl.TYPE);
- initializeProperty(property, this.getType(), "type", null, 0, 1, Property.class, false, false, false, false , null);
+ initializeProperty(property, this.getType(), "type", null, 0, 1, Property.class, false, false, false, false, null);
setInstanceProperty (property, "commonj.sdo/xml", "propertyType", "sdo:Type");
-
property = (commonj.sdo.Property)propertyType.getProperties().get(PropertyImpl.OPPOSITE);
- initializeProperty(property, this.getProperty(), "opposite", null, 0, 1, Property.class, false, false, false, false , null);
+ initializeProperty(property, this.getProperty(), "opposite", null, 0, 1, Property.class, false, false, false, false, null);
setInstanceProperty (property, "commonj.sdo/xml", "propertyType", "sdo:Property");
-
property = (commonj.sdo.Property)propertyType.getProperties().get(PropertyImpl.NULLABLE);
initializeProperty(property, this.getBoolean(), "nullable", null, 0, 1, Property.class, false, true, false);
-
property = (commonj.sdo.Property)propertyType.getProperties().get(PropertyImpl.ANY_ATTRIBUTE);
initializeProperty(property, getSequence(), "anyAttribute", null, 0, -1, Property.class, false, false, false);
initializeType(textTypeType, TextType.class, "TextType", true);
-
property = (commonj.sdo.Property)textTypeType.getProperties().get(TextTypeImpl.TEXT);
initializeProperty(property, this.getString(), "text", null, 0, -1, TextType.class, false, false, false);
- initializeType(typeType, Type.class, "Type");
-
+ initializeType(typeType, Type.class, "Type", false);
property = (commonj.sdo.Property)typeType.getProperties().get(TypeImpl.BASE_TYPE);
- initializeProperty(property, this.getType(), "baseType", null, 0, -1, Type.class, false, false, false, false , null);
+ initializeProperty(property, this.getType(), "baseType", null, 0, -1, Type.class, false, false, false, false, null);
setInstanceProperty (property, "commonj.sdo/xml", "propertyType", "sdo:Type");
-
property = (commonj.sdo.Property)typeType.getProperties().get(TypeImpl.PROPERTY);
- initializeProperty(property, this.getProperty(), "property", null, 0, -1, Type.class, false, false, false, true , null);
-
+ initializeProperty(property, this.getProperty(), "property", null, 0, -1, Type.class, false, false, false, true, null);
property = (commonj.sdo.Property)typeType.getProperties().get(TypeImpl.ALIAS_NAME);
initializeProperty(property, this.getString(), "aliasName", null, 0, -1, Type.class, false, false, false);
-
property = (commonj.sdo.Property)typeType.getProperties().get(TypeImpl.ANY);
initializeProperty(property, getSequence(), "any", null, 0, -1, Type.class, false, false, false);
-
property = (commonj.sdo.Property)typeType.getProperties().get(TypeImpl.NAME);
initializeProperty(property, this.getString(), "name", null, 0, 1, Type.class, false, false, false);
setInstanceProperty (property, "commonj.sdo/xml", "dataType", "sdo:String");
-
property = (commonj.sdo.Property)typeType.getProperties().get(TypeImpl.URI);
initializeProperty(property, this.getURI(), "uri", null, 0, 1, Type.class, false, false, false);
-
property = (commonj.sdo.Property)typeType.getProperties().get(TypeImpl.DATA_TYPE);
initializeProperty(property, this.getBoolean(), "dataType", null, 0, 1, Type.class, false, true, false);
-
property = (commonj.sdo.Property)typeType.getProperties().get(TypeImpl.OPEN);
initializeProperty(property, this.getBoolean(), "open", null, 0, 1, Type.class, false, true, false);
-
property = (commonj.sdo.Property)typeType.getProperties().get(TypeImpl.SEQUENCED);
initializeProperty(property, this.getBoolean(), "sequenced", null, 0, 1, Type.class, false, true, false);
-
property = (commonj.sdo.Property)typeType.getProperties().get(TypeImpl.ABSTRACT);
initializeProperty(property, this.getBoolean(), "abstract", null, 0, 1, Type.class, false, true, false);
-
property = (commonj.sdo.Property)typeType.getProperties().get(TypeImpl.ANY_ATTRIBUTE);
initializeProperty(property, getSequence(), "anyAttribute", null, 0, -1, Type.class, false, false, false);
- initializeType(typesType, Types.class, "Types");
-
+ initializeType(typesType, Types.class, "Types", false);
property = (commonj.sdo.Property)typesType.getProperties().get(TypesImpl.TYPE);
- initializeProperty(property, this.getType(), "type", null, 0, -1, Types.class, false, false, false, true , null);
-
- initializeType(xsdTypeType, XSDType.class, "XSDType");
+ initializeProperty(property, this.getType(), "type", null, 0, -1, Types.class, false, false, false, true, null);
+ initializeType(xsdTypeType, XSDType.class, "XSDType", false);
property = (commonj.sdo.Property)xsdTypeType.getProperties().get(XSDTypeImpl.ANY);
initializeProperty(property, getSequence(), "any", null, 0, -1, XSDType.class, false, false, false);
@@ -956,6 +900,9 @@
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");
@@ -1034,10 +981,10 @@
initializeType(yearMonthDayType, String.class, "YearMonthDay", true, false);
setInstanceProperty (yearMonthDayType, "commonj.sdo/java", "instanceClass", "java.lang.String");
- initXSD();
+ createXSDMetaData();
}
- protected void initXSD()
+ protected void createXSDMetaData()
{
super.initXSD();
@@ -1086,48 +1033,6 @@
});
addXSDMapping
- (changeSummaryTypeType,
- new String[]
- {
- "name", "ChangeSummaryType",
- "kind", "elementOnly"
- });
-
- addXSDMapping
- ((commonj.sdo.Property)changeSummaryTypeType.getProperties().get(ChangeSummaryTypeImpl.ANY),
- new String[]
- {
- "kind", "elementWildcard",
- "wildcards", "##any",
- "name", ":0",
- "processing", "lax"
- });
-
- addXSDMapping
- ((commonj.sdo.Property)changeSummaryTypeType.getProperties().get(ChangeSummaryTypeImpl.CREATE),
- new String[]
- {
- "kind", "attribute",
- "name", "create"
- });
-
- addXSDMapping
- ((commonj.sdo.Property)changeSummaryTypeType.getProperties().get(ChangeSummaryTypeImpl.DELETE),
- new String[]
- {
- "kind", "attribute",
- "name", "delete"
- });
-
- addXSDMapping
- ((commonj.sdo.Property)changeSummaryTypeType.getProperties().get(ChangeSummaryTypeImpl.LOGGING),
- new String[]
- {
- "kind", "attribute",
- "name", "logging"
- });
-
- addXSDMapping
(dataGraphTypeType,
new String[]
{
@@ -1527,6 +1432,13 @@
});
addXSDMapping
+ (changeSummaryTypeType,
+ new String[]
+ {
+ "name", "ChangeSummaryType"
+ });
+
+ addXSDMapping
(characterType,
new String[]
{
@@ -1832,6 +1744,26 @@
} 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 ...";
}
/**
Modified: incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/ModelsTypeImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/ModelsTypeImpl.java?view=diff&rev=483757&r1=483756&r2=483757
==============================================================================
--- incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/ModelsTypeImpl.java (original)
+++ incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/ModelsTypeImpl.java Thu Dec 7 16:31:39 2006
@@ -64,7 +64,7 @@
* <!-- end-user-doc -->
* @generated
*/
- protected ModelsTypeImpl()
+ public ModelsTypeImpl()
{
super();
}
Modified: incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/PropertyImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/PropertyImpl.java?view=diff&rev=483757&r1=483756&r2=483757
==============================================================================
--- incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/PropertyImpl.java (original)
+++ incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/PropertyImpl.java Thu Dec 7 16:31:39 2006
@@ -367,7 +367,7 @@
* <!-- end-user-doc -->
* @generated
*/
- protected PropertyImpl()
+ public PropertyImpl()
{
super();
}
Modified: incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/TextTypeImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/TextTypeImpl.java?view=diff&rev=483757&r1=483756&r2=483757
==============================================================================
--- incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/TextTypeImpl.java (original)
+++ incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/TextTypeImpl.java Thu Dec 7 16:31:39 2006
@@ -66,7 +66,7 @@
* <!-- end-user-doc -->
* @generated
*/
- protected TextTypeImpl()
+ public TextTypeImpl()
{
super();
}
Modified: incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/TypeImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/TypeImpl.java?view=diff&rev=483757&r1=483756&r2=483757
==============================================================================
--- incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/TypeImpl.java (original)
+++ incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/TypeImpl.java Thu Dec 7 16:31:39 2006
@@ -369,7 +369,7 @@
* <!-- end-user-doc -->
* @generated
*/
- protected TypeImpl()
+ public TypeImpl()
{
super();
}
Modified: incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/TypesImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/TypesImpl.java?view=diff&rev=483757&r1=483756&r2=483757
==============================================================================
--- incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/TypesImpl.java (original)
+++ incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/TypesImpl.java Thu Dec 7 16:31:39 2006
@@ -66,7 +66,7 @@
* <!-- end-user-doc -->
* @generated
*/
- protected TypesImpl()
+ public TypesImpl()
{
super();
}
Modified: incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/XSDTypeImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/XSDTypeImpl.java?view=diff&rev=483757&r1=483756&r2=483757
==============================================================================
--- incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/XSDTypeImpl.java (original)
+++ incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/XSDTypeImpl.java Thu Dec 7 16:31:39 2006
@@ -64,7 +64,7 @@
* <!-- end-user-doc -->
* @generated
*/
- protected XSDTypeImpl()
+ public XSDTypeImpl()
{
super();
}
Modified: incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/java/impl/JavaFactoryImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/java/impl/JavaFactoryImpl.java?view=diff&rev=483757&r1=483756&r2=483757
==============================================================================
--- incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/java/impl/JavaFactoryImpl.java (original)
+++ incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/java/impl/JavaFactoryImpl.java Thu Dec 7 16:31:39 2006
@@ -26,7 +26,7 @@
* 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 -targetDirectory <temp-dir> -javaPackage org.apache.tuscany.sdo.model.java <sdo-api-dir>/src/main/resources/xml/sdoJava.xsd
+ * XSD2JavaGenerator -generateBuiltIn commonj.sdo/java -targetDirectory <temp-dir> -javaPackage org.apache.tuscany.sdo.model.java <sdo-api-dir>/src/main/resources/xml/sdoJava.xsd
* 3. Change the value of the NAMESPACE_PREFIX to "sdoJava"
* public static final String NAMESPACE_PREFIX = "sdoJava"; //FB generated as "java"
* 4. Delete all the createXXXFromString() and convertXXXToString() methods in the newly generated JavaFactoryImpl and
Modified: incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/DataObjectUtil.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/DataObjectUtil.java?view=diff&rev=483757&r1=483756&r2=483757
==============================================================================
--- incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/DataObjectUtil.java (original)
+++ incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/DataObjectUtil.java Thu Dec 7 16:31:39 2006
@@ -690,42 +690,16 @@
{
return dataGraph.getChangeSummary();
}
-// TODO T-153
-// return getDataObjectsChangeSummary(dataObject);
+ 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;
}
-
-//TODO T-153
-// public static Property getChangeSummaryProperty(DataObject dataObject)
-// {
-// return ((ClassImpl)dataObject.getType()).getChangeSummaryProperty();
-// }
-//
-// /**
-// * @param dataObject
-// * @return
-// */
-// private static ChangeSummary getDataObjectsChangeSummary(DataObject dataObject) {
-//
-// if(dataObject == null) {
-// // terminate the recursion up the containment path
-// return null;
-// }
-//
-// Property csp = getChangeSummaryProperty(dataObject);
-//
-// if(csp != null) {
-// ChangeSummary cs = (ChangeSummary)dataObject.get(csp);
-// if(cs == null) {
-// cs = SDOFactory.eINSTANCE.createChangeSummary();
-// ((DataObjectImpl)dataObject).setEChangeSummary(cs);
-// }
-// return cs;
-// }
-//
-// // if it fails to find a CS then continue the search up the containment path
-// return getDataObjectsChangeSummary(dataObject.getContainer());
-// }
public static void unset(DataObject dataObject, String path)
{
Modified: incubator/tuscany/java/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/JavaGenerator.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/JavaGenerator.java?view=diff&rev=483757&r1=483756&r2=483757
==============================================================================
--- incubator/tuscany/java/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/JavaGenerator.java (original)
+++ incubator/tuscany/java/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/JavaGenerator.java Thu Dec 7 16:31:39 2006
@@ -295,7 +295,7 @@
DataObjectUtil.initRuntime();
EPackage.Registry packageRegistry = new EPackageRegistryImpl(EPackage.Registry.INSTANCE);
ExtendedMetaData extendedMetaData = new BasicExtendedMetaData(packageRegistry);
- XSDHelper xsdHelper = new XSDHelperImpl(extendedMetaData);
+ XSDHelper xsdHelper = new XSDHelperImpl(extendedMetaData, null);
try
{
Modified: incubator/tuscany/java/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/XSD2JavaGenerator.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/XSD2JavaGenerator.java?view=diff&rev=483757&r1=483756&r2=483757
==============================================================================
--- incubator/tuscany/java/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/XSD2JavaGenerator.java (original)
+++ incubator/tuscany/java/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/XSD2JavaGenerator.java Thu Dec 7 16:31:39 2006
@@ -55,7 +55,7 @@
* -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:
@@ -80,6 +80,7 @@
}
protected String schemaNamespace = null;
+ protected String generateBuiltIn = null;
protected int handleArgument(String args[], int index)
{
@@ -87,6 +88,11 @@
{
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);
@@ -98,15 +104,20 @@
protected void run(String args[])
{
String xsdFileName = args[inputIndex];
- generateFromXMLSchema(xsdFileName, schemaNamespace, targetDirectory, javaPackage, prefix, genOptions);
+ 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);
+ XSDHelper xsdHelper = new XSDHelperImpl(extendedMetaData, regenerateBuiltIn);
try
{
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org