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/11/20 23:16:02 UTC
svn commit: r477364 [6/8] - in /incubator/tuscany/java/sdo:
impl/src/main/java/org/apache/tuscany/sdo/helper/
impl/src/main/java/org/apache/tuscany/sdo/impl/
impl/src/main/java/org/apache/tuscany/sdo/model/
impl/src/main/java/org/apache/tuscany/sdo/mod...
Modified: incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/SDOMetaDataGroupImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/SDOMetaDataGroupImpl.java?view=diff&rev=477364&r1=477363&r2=477364
==============================================================================
--- incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/SDOMetaDataGroupImpl.java (original)
+++ incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/SDOMetaDataGroupImpl.java Mon Nov 20 14:16:00 2006
@@ -1,50 +1,23 @@
/**
+ * <copyright>
+ * </copyright>
*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
+ * $Id$
*/
package org.apache.tuscany.sdo.util.metadata.impl;
-import java.io.InputStream;
-import java.net.URL;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
+import commonj.sdo.Type;
+
import java.util.Collection;
-import java.util.Iterator;
import java.util.List;
-import org.apache.tuscany.sdo.impl.DataObjectImpl;
-import org.apache.tuscany.sdo.model.Types;
-import org.apache.tuscany.sdo.util.SDOUtil;
+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;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-
-import commonj.sdo.helper.TypeHelper;
-import commonj.sdo.helper.XMLDocument;
-import commonj.sdo.helper.XMLHelper;
-import commonj.sdo.helper.XSDHelper;
/**
* <!-- begin-user-doc -->
@@ -61,72 +34,45 @@
*
* @generated
*/
-public class SDOMetaDataGroupImpl extends DataObjectImpl implements SDOMetaDataGroup
+public class SDOMetaDataGroupImpl extends DataObjectBase implements SDOMetaDataGroup
{
- public void register(TypeHelper typeHelper)
- {
- try
- {
- ClassLoader classLoader = (ClassLoader)AccessController.doPrivileged(new PrivilegedAction()
- {
- public Object run()
- {
- return Thread.currentThread().getContextClassLoader();
- }
- });
- register(typeHelper, classLoader);
- }
- catch (SecurityException e)
- {
- }
- }
+ /**
+ * 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;
- public void register(TypeHelper typeHelper, ClassLoader classLoader)
- {
- try
- {
- for (Iterator iter = getJavaMetaData().iterator(); iter.hasNext();)
- {
- JavaMetaData metadata = (JavaMetaData)iter.next();
- String factoryInterface = metadata.getFactoryInterface();
- if (factoryInterface != null)
- {
- Class factoryInterfaceClass = classLoader.loadClass(factoryInterface);
- SDOUtil.registerStaticTypes(factoryInterfaceClass);
- }
- else
- {
- String typeInterface = metadata.getTypeInterface();
- Class typeInterfaceClass = classLoader.loadClass(typeInterface);
- // TODO: introspect and register the type
- }
- }
-
- XSDHelper xsdHelper = SDOUtil.createXSDHelper(typeHelper);
- for (Iterator iter = getXsdMetaData().iterator(); iter.hasNext();)
- {
- XSDMetaData metadata = (XSDMetaData)iter.next();
- URL url = getClass().getResource(metadata.getLocation());
- InputStream inputStream = url.openStream();
- xsdHelper.define(inputStream, url.toString());
- }
-
- XMLHelper xmlHelper = SDOUtil.createXMLHelper(typeHelper);
- for (Iterator iter = getTypeMetaData().iterator(); iter.hasNext();)
- {
- TypeMetaData metadata = (TypeMetaData)iter.next();
- URL url = getClass().getResource(metadata.getLocation());
- InputStream inputStream = url.openStream();
- XMLDocument xmlDocument = xmlHelper.load(inputStream);
- Types types = (Types)xmlDocument.getRootObject();
- typeHelper.define(types.getTypeList());
- }
- }
- catch (Exception e)
- {
- }
- }
+ /**
+ * 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 -->
@@ -135,8 +81,9 @@
* @generated
* @ordered
*/
- protected EList javaMetaData = null;
-
+
+ protected List javaMetaData = null;
+
/**
* The cached value of the '{@link #getXsdMetaData() <em>Xsd Meta Data</em>}' containment reference list.
* <!-- begin-user-doc -->
@@ -145,8 +92,9 @@
* @generated
* @ordered
*/
- protected EList xsdMetaData = null;
-
+
+ protected List xsdMetaData = null;
+
/**
* The cached value of the '{@link #getTypeMetaData() <em>Type Meta Data</em>}' containment reference list.
* <!-- begin-user-doc -->
@@ -155,8 +103,9 @@
* @generated
* @ordered
*/
- protected EList typeMetaData = null;
-
+
+ protected List typeMetaData = null;
+
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -172,9 +121,9 @@
* <!-- end-user-doc -->
* @generated
*/
- protected EClass eStaticClass()
+ public Type getType()
{
- return MetadataPackageImpl.Literals.SDO_META_DATA_GROUP;
+ return ((MetadataFactoryImpl)MetadataFactory.INSTANCE).getSDOMetaDataGroup();
}
/**
@@ -186,11 +135,10 @@
{
if (javaMetaData == null)
{
- javaMetaData = new EObjectContainmentEList(JavaMetaData.class, this, MetadataPackageImpl.SDO_META_DATA_GROUP__JAVA_META_DATA);
+ javaMetaData = createPropertyList(ListKind.CONTAINMENT, JavaMetaData.class, JAVA_META_DATA);
}
return javaMetaData;
}
-
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -200,11 +148,10 @@
{
if (xsdMetaData == null)
{
- xsdMetaData = new EObjectContainmentEList(XSDMetaData.class, this, MetadataPackageImpl.SDO_META_DATA_GROUP__XSD_META_DATA);
+ xsdMetaData = createPropertyList(ListKind.CONTAINMENT, XSDMetaData.class, XSD_META_DATA);
}
return xsdMetaData;
}
-
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -214,28 +161,27 @@
{
if (typeMetaData == null)
{
- typeMetaData = new EObjectContainmentEList(TypeMetaData.class, this, MetadataPackageImpl.SDO_META_DATA_GROUP__TYPE_META_DATA);
+ typeMetaData = createPropertyList(ListKind.CONTAINMENT, TypeMetaData.class, TYPE_META_DATA);
}
return typeMetaData;
}
-
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
+ public ChangeContext inverseRemove(Object otherEnd, int propertyIndex, ChangeContext changeContext)
{
- switch (featureID)
+ switch (propertyIndex)
{
- case MetadataPackageImpl.SDO_META_DATA_GROUP__JAVA_META_DATA:
- return ((InternalEList)getJavaMetaData()).basicRemove(otherEnd, msgs);
- case MetadataPackageImpl.SDO_META_DATA_GROUP__XSD_META_DATA:
- return ((InternalEList)getXsdMetaData()).basicRemove(otherEnd, msgs);
- case MetadataPackageImpl.SDO_META_DATA_GROUP__TYPE_META_DATA:
- return ((InternalEList)getTypeMetaData()).basicRemove(otherEnd, msgs);
+ 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.eInverseRemove(otherEnd, featureID, msgs);
+ return super.inverseRemove(otherEnd, propertyIndex, changeContext);
}
/**
@@ -243,18 +189,18 @@
* <!-- end-user-doc -->
* @generated
*/
- public Object eGet(int featureID, boolean resolve, boolean coreType)
+ public Object get(int propertyIndex, boolean resolve)
{
- switch (featureID)
+ switch (propertyIndex)
{
- case MetadataPackageImpl.SDO_META_DATA_GROUP__JAVA_META_DATA:
+ case JAVA_META_DATA:
return getJavaMetaData();
- case MetadataPackageImpl.SDO_META_DATA_GROUP__XSD_META_DATA:
+ case XSD_META_DATA:
return getXsdMetaData();
- case MetadataPackageImpl.SDO_META_DATA_GROUP__TYPE_META_DATA:
+ case TYPE_META_DATA:
return getTypeMetaData();
}
- return super.eGet(featureID, resolve, coreType);
+ return super.get(propertyIndex, resolve);
}
/**
@@ -262,24 +208,24 @@
* <!-- end-user-doc -->
* @generated
*/
- public void eSet(int featureID, Object newValue)
+ public void set(int propertyIndex, Object newValue)
{
- switch (featureID)
+ switch (propertyIndex)
{
- case MetadataPackageImpl.SDO_META_DATA_GROUP__JAVA_META_DATA:
+ case JAVA_META_DATA:
getJavaMetaData().clear();
getJavaMetaData().addAll((Collection)newValue);
return;
- case MetadataPackageImpl.SDO_META_DATA_GROUP__XSD_META_DATA:
+ case XSD_META_DATA:
getXsdMetaData().clear();
getXsdMetaData().addAll((Collection)newValue);
return;
- case MetadataPackageImpl.SDO_META_DATA_GROUP__TYPE_META_DATA:
+ case TYPE_META_DATA:
getTypeMetaData().clear();
getTypeMetaData().addAll((Collection)newValue);
return;
}
- super.eSet(featureID, newValue);
+ super.set(propertyIndex, newValue);
}
/**
@@ -287,21 +233,21 @@
* <!-- end-user-doc -->
* @generated
*/
- public void eUnset(int featureID)
+ public void unset(int propertyIndex)
{
- switch (featureID)
+ switch (propertyIndex)
{
- case MetadataPackageImpl.SDO_META_DATA_GROUP__JAVA_META_DATA:
+ case JAVA_META_DATA:
getJavaMetaData().clear();
return;
- case MetadataPackageImpl.SDO_META_DATA_GROUP__XSD_META_DATA:
+ case XSD_META_DATA:
getXsdMetaData().clear();
return;
- case MetadataPackageImpl.SDO_META_DATA_GROUP__TYPE_META_DATA:
+ case TYPE_META_DATA:
getTypeMetaData().clear();
return;
}
- super.eUnset(featureID);
+ super.unset(propertyIndex);
}
/**
@@ -309,18 +255,18 @@
* <!-- end-user-doc -->
* @generated
*/
- public boolean eIsSet(int featureID)
+ public boolean isSet(int propertyIndex)
{
- switch (featureID)
+ switch (propertyIndex)
{
- case MetadataPackageImpl.SDO_META_DATA_GROUP__JAVA_META_DATA:
+ case JAVA_META_DATA:
return javaMetaData != null && !javaMetaData.isEmpty();
- case MetadataPackageImpl.SDO_META_DATA_GROUP__XSD_META_DATA:
+ case XSD_META_DATA:
return xsdMetaData != null && !xsdMetaData.isEmpty();
- case MetadataPackageImpl.SDO_META_DATA_GROUP__TYPE_META_DATA:
+ case TYPE_META_DATA:
return typeMetaData != null && !typeMetaData.isEmpty();
}
- return super.eIsSet(featureID);
+ return super.isSet(propertyIndex);
}
} //SDOMetaDataGroupImpl
Modified: incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/TypeMetaDataImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/TypeMetaDataImpl.java?view=diff&rev=477364&r1=477363&r2=477364
==============================================================================
--- incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/TypeMetaDataImpl.java (original)
+++ incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/TypeMetaDataImpl.java Mon Nov 20 14:16:00 2006
@@ -1,33 +1,17 @@
/**
+ * <copyright>
+ * </copyright>
*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
+ * $Id$
*/
package org.apache.tuscany.sdo.util.metadata.impl;
-import org.apache.tuscany.sdo.impl.DataObjectImpl;
-
-import org.apache.tuscany.sdo.util.metadata.TypeMetaData;
-
-import org.eclipse.emf.common.notify.Notification;
+import commonj.sdo.Type;
-import org.eclipse.emf.ecore.EClass;
+import org.apache.tuscany.sdo.impl.DataObjectBase;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.apache.tuscany.sdo.util.metadata.MetadataFactory;
+import org.apache.tuscany.sdo.util.metadata.TypeMetaData;
/**
* <!-- begin-user-doc -->
@@ -42,9 +26,28 @@
*
* @generated
*/
-public class TypeMetaDataImpl extends DataObjectImpl implements TypeMetaData
+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 -->
@@ -52,7 +55,7 @@
* @generated
* @ordered
*/
- protected static final String LOCATION_EDEFAULT = null;
+ protected static final String LOCATION_DEFAULT_ = null;
/**
* The cached value of the '{@link #getLocation() <em>Location</em>}' attribute.
@@ -62,7 +65,7 @@
* @generated
* @ordered
*/
- protected String location = LOCATION_EDEFAULT;
+ protected String location = LOCATION_DEFAULT_;
/**
* <!-- begin-user-doc -->
@@ -79,9 +82,9 @@
* <!-- end-user-doc -->
* @generated
*/
- protected EClass eStaticClass()
+ public Type getType()
{
- return MetadataPackageImpl.Literals.TYPE_META_DATA;
+ return ((MetadataFactoryImpl)MetadataFactory.INSTANCE).getTypeMetaData();
}
/**
@@ -93,7 +96,6 @@
{
return location;
}
-
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -103,8 +105,8 @@
{
String oldLocation = location;
location = newLocation;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, MetadataPackageImpl.TYPE_META_DATA__LOCATION, oldLocation, location));
+ if (isNotifying())
+ notify(ChangeKind.SET, LOCATION, oldLocation, location);
}
/**
@@ -112,14 +114,14 @@
* <!-- end-user-doc -->
* @generated
*/
- public Object eGet(int featureID, boolean resolve, boolean coreType)
+ public Object get(int propertyIndex, boolean resolve)
{
- switch (featureID)
+ switch (propertyIndex)
{
- case MetadataPackageImpl.TYPE_META_DATA__LOCATION:
+ case LOCATION:
return getLocation();
}
- return super.eGet(featureID, resolve, coreType);
+ return super.get(propertyIndex, resolve);
}
/**
@@ -127,15 +129,15 @@
* <!-- end-user-doc -->
* @generated
*/
- public void eSet(int featureID, Object newValue)
+ public void set(int propertyIndex, Object newValue)
{
- switch (featureID)
+ switch (propertyIndex)
{
- case MetadataPackageImpl.TYPE_META_DATA__LOCATION:
+ case LOCATION:
setLocation((String)newValue);
return;
}
- super.eSet(featureID, newValue);
+ super.set(propertyIndex, newValue);
}
/**
@@ -143,15 +145,15 @@
* <!-- end-user-doc -->
* @generated
*/
- public void eUnset(int featureID)
+ public void unset(int propertyIndex)
{
- switch (featureID)
+ switch (propertyIndex)
{
- case MetadataPackageImpl.TYPE_META_DATA__LOCATION:
- setLocation(LOCATION_EDEFAULT);
+ case LOCATION:
+ setLocation(LOCATION_DEFAULT_);
return;
}
- super.eUnset(featureID);
+ super.unset(propertyIndex);
}
/**
@@ -159,14 +161,14 @@
* <!-- end-user-doc -->
* @generated
*/
- public boolean eIsSet(int featureID)
+ public boolean isSet(int propertyIndex)
{
- switch (featureID)
+ switch (propertyIndex)
{
- case MetadataPackageImpl.TYPE_META_DATA__LOCATION:
- return LOCATION_EDEFAULT == null ? location != null : !LOCATION_EDEFAULT.equals(location);
+ case LOCATION:
+ return LOCATION_DEFAULT_ == null ? location != null : !LOCATION_DEFAULT_.equals(location);
}
- return super.eIsSet(featureID);
+ return super.isSet(propertyIndex);
}
/**
@@ -176,7 +178,7 @@
*/
public String toString()
{
- if (eIsProxy()) return super.toString();
+ if (isProxy(this)) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (location: ");
Modified: incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/XSDMetaDataImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/XSDMetaDataImpl.java?view=diff&rev=477364&r1=477363&r2=477364
==============================================================================
--- incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/XSDMetaDataImpl.java (original)
+++ incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/metadata/impl/XSDMetaDataImpl.java Mon Nov 20 14:16:00 2006
@@ -1,33 +1,17 @@
/**
+ * <copyright>
+ * </copyright>
*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
+ * $Id$
*/
package org.apache.tuscany.sdo.util.metadata.impl;
-import org.apache.tuscany.sdo.impl.DataObjectImpl;
-
-import org.apache.tuscany.sdo.util.metadata.XSDMetaData;
-
-import org.eclipse.emf.common.notify.Notification;
+import commonj.sdo.Type;
-import org.eclipse.emf.ecore.EClass;
+import org.apache.tuscany.sdo.impl.DataObjectBase;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.apache.tuscany.sdo.util.metadata.MetadataFactory;
+import org.apache.tuscany.sdo.util.metadata.XSDMetaData;
/**
* <!-- begin-user-doc -->
@@ -42,9 +26,28 @@
*
* @generated
*/
-public class XSDMetaDataImpl extends DataObjectImpl implements XSDMetaData
+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 -->
@@ -52,7 +55,7 @@
* @generated
* @ordered
*/
- protected static final String LOCATION_EDEFAULT = null;
+ protected static final String LOCATION_DEFAULT_ = null;
/**
* The cached value of the '{@link #getLocation() <em>Location</em>}' attribute.
@@ -62,7 +65,7 @@
* @generated
* @ordered
*/
- protected String location = LOCATION_EDEFAULT;
+ protected String location = LOCATION_DEFAULT_;
/**
* <!-- begin-user-doc -->
@@ -79,9 +82,9 @@
* <!-- end-user-doc -->
* @generated
*/
- protected EClass eStaticClass()
+ public Type getType()
{
- return MetadataPackageImpl.Literals.XSD_META_DATA;
+ return ((MetadataFactoryImpl)MetadataFactory.INSTANCE).getXSDMetaData();
}
/**
@@ -93,7 +96,6 @@
{
return location;
}
-
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -103,8 +105,8 @@
{
String oldLocation = location;
location = newLocation;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, MetadataPackageImpl.XSD_META_DATA__LOCATION, oldLocation, location));
+ if (isNotifying())
+ notify(ChangeKind.SET, LOCATION, oldLocation, location);
}
/**
@@ -112,14 +114,14 @@
* <!-- end-user-doc -->
* @generated
*/
- public Object eGet(int featureID, boolean resolve, boolean coreType)
+ public Object get(int propertyIndex, boolean resolve)
{
- switch (featureID)
+ switch (propertyIndex)
{
- case MetadataPackageImpl.XSD_META_DATA__LOCATION:
+ case LOCATION:
return getLocation();
}
- return super.eGet(featureID, resolve, coreType);
+ return super.get(propertyIndex, resolve);
}
/**
@@ -127,15 +129,15 @@
* <!-- end-user-doc -->
* @generated
*/
- public void eSet(int featureID, Object newValue)
+ public void set(int propertyIndex, Object newValue)
{
- switch (featureID)
+ switch (propertyIndex)
{
- case MetadataPackageImpl.XSD_META_DATA__LOCATION:
+ case LOCATION:
setLocation((String)newValue);
return;
}
- super.eSet(featureID, newValue);
+ super.set(propertyIndex, newValue);
}
/**
@@ -143,15 +145,15 @@
* <!-- end-user-doc -->
* @generated
*/
- public void eUnset(int featureID)
+ public void unset(int propertyIndex)
{
- switch (featureID)
+ switch (propertyIndex)
{
- case MetadataPackageImpl.XSD_META_DATA__LOCATION:
- setLocation(LOCATION_EDEFAULT);
+ case LOCATION:
+ setLocation(LOCATION_DEFAULT_);
return;
}
- super.eUnset(featureID);
+ super.unset(propertyIndex);
}
/**
@@ -159,14 +161,14 @@
* <!-- end-user-doc -->
* @generated
*/
- public boolean eIsSet(int featureID)
+ public boolean isSet(int propertyIndex)
{
- switch (featureID)
+ switch (propertyIndex)
{
- case MetadataPackageImpl.XSD_META_DATA__LOCATION:
- return LOCATION_EDEFAULT == null ? location != null : !LOCATION_EDEFAULT.equals(location);
+ case LOCATION:
+ return LOCATION_DEFAULT_ == null ? location != null : !LOCATION_DEFAULT_.equals(location);
}
- return super.eIsSet(featureID);
+ return super.isSet(propertyIndex);
}
/**
@@ -176,7 +178,7 @@
*/
public String toString()
{
- if (eIsProxy()) return super.toString();
+ if (isProxy(this)) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (location: ");
Modified: incubator/tuscany/java/sdo/plugin/src/main/java/org/apache/tuscany/sdo/plugin/GeneratorMojo.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/plugin/src/main/java/org/apache/tuscany/sdo/plugin/GeneratorMojo.java?view=diff&rev=477364&r1=477363&r2=477364
==============================================================================
--- incubator/tuscany/java/sdo/plugin/src/main/java/org/apache/tuscany/sdo/plugin/GeneratorMojo.java (original)
+++ incubator/tuscany/java/sdo/plugin/src/main/java/org/apache/tuscany/sdo/plugin/GeneratorMojo.java Mon Nov 20 14:16:00 2006
@@ -133,13 +133,6 @@
private List mojos;
/**
- * With this option, generated code will not have EMF references.
- *
- * @parameter
- */
- private Boolean useEMFPatterns;
-
- /**
* With this option, generated interfaces will extend commonj.sdo.DataObject.
*
* @parameter
@@ -187,9 +180,6 @@
// if (null == sf.getCompilerSourceRoots()) {
// sf.setCompilerSourceRoots(compileSourceRoots);
// }
- if (null == sf.isUseEMFPatterns()) {
- sf.setUseEMFPatterns(useEMFPatterns);
- }
if (null == sf.isInterfaceDataObject()) {
sf.setInterfaceDataObject(interfaceDataObject);
}
@@ -214,7 +204,6 @@
schemaFiles[i].setGenerateLoader(generateLoader);
schemaFiles[i].setGenerateSwitch(generateSwitch);
schemaFiles[i].setNoContainment(noContainment);
- schemaFiles[i].setUseEMFPatterns(useEMFPatterns);
schemaFiles[i].setInterfaceDataObject(interfaceDataObject);
schemaFiles[i].setNoInterfaces(noInterfaces);
schemaFiles[i].setNoNotification(noNotification);
@@ -230,7 +219,6 @@
schemaFiles[0].setGenerateLoader(generateLoader);
schemaFiles[0].setGenerateSwitch(generateSwitch);
schemaFiles[0].setNoContainment(noContainment);
- schemaFiles[0].setUseEMFPatterns(useEMFPatterns);
schemaFiles[0].setInterfaceDataObject(interfaceDataObject);
schemaFiles[0].setNoInterfaces(noInterfaces);
schemaFiles[0].setNoNotification(noNotification);
@@ -265,9 +253,6 @@
}
if (schemaFiles[i].isGenerateSwitch() != null && schemaFiles[i].isGenerateSwitch().booleanValue()) {
genOptions |= JavaGenerator.OPTION_GENERATE_SWITCH;
- }
- if (schemaFiles[i].isUseEMFPatterns() != null && schemaFiles[i].isUseEMFPatterns().booleanValue()) {
- genOptions |= JavaGenerator.OPTION_USE_EMF_PATTERNS;
}
if (schemaFiles[i].isInterfaceDataObject() != null
&& schemaFiles[i].isInterfaceDataObject().booleanValue()) {
Modified: incubator/tuscany/java/sdo/plugin/src/main/java/org/apache/tuscany/sdo/plugin/SchemaFileOption.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/plugin/src/main/java/org/apache/tuscany/sdo/plugin/SchemaFileOption.java?view=diff&rev=477364&r1=477363&r2=477364
==============================================================================
--- incubator/tuscany/java/sdo/plugin/src/main/java/org/apache/tuscany/sdo/plugin/SchemaFileOption.java (original)
+++ incubator/tuscany/java/sdo/plugin/src/main/java/org/apache/tuscany/sdo/plugin/SchemaFileOption.java Mon Nov 20 14:16:00 2006
@@ -93,13 +93,6 @@
private Boolean generateSwitch;
/**
- * With this option, generated code will not have EMF references.
- *
- * @parameter
- */
- private Boolean useEMFPatterns;
-
- /**
* With this option, generated interfaces will extend commonj.sdo.DataObject.
*
* @parameter
@@ -141,14 +134,6 @@
this.noContainment = noContainment;
}
- public Boolean isUseEMFPatterns() {
- return useEMFPatterns;
- }
-
- public void setUseEMFPatterns(Boolean useEMFPatterns) {
- this.useEMFPatterns = useEMFPatterns;
- }
-
public Boolean isNoInterfaces() {
return noInterfaces;
}
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=477364&r1=477363&r2=477364
==============================================================================
--- 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 Mon Nov 20 14:16:00 2006
@@ -34,7 +34,7 @@
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.impl.ModelPackageImpl;
+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;
@@ -79,7 +79,6 @@
* [ -arrayAccessors ]
* [ -generateLoader ]
* [ -noUnsettable ]
- * [ -useEMFPatterns ]
* [ -interfaceDataObject ]
*
* Basic options:
@@ -104,11 +103,7 @@
* 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.
* -noEMF
- * Deprecated option. It is the default now. Use -useEMFPatterns to turn off.
- * -useEMFPatterns
- * This option is used to generate static classes that use the old style EMF generator patterns. Using
- * this option introduces EMF dependencies in the generated code, but is likely to be less buggy and
- * have somewhat better performance than the new EMF-less default generator patterns.
+ * Deprecated option. It is the default now.
* -interfaceDataObject
* This option is used to generate static interfaces that extend commonj.sdo.DataObject
*
@@ -170,7 +165,6 @@
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_USE_EMF_PATTERNS=0x200;
public static int OPTION_INTERFACE_DO=0x400;
static
@@ -275,13 +269,9 @@
}
else if (args[index].equalsIgnoreCase("-noEMF"))
{
- System.out.println("Warning: -noEMF is deprecated. It is the default now. Use -useEMFPatterns to turn off.");
+ System.out.println("Warning: -noEMF is deprecated. It is the default now.");
//genOptions |= OPTION_NO_EMF;
}
- else if (args[index].equalsIgnoreCase("-useEMFPatterns"))
- {
- genOptions |= OPTION_USE_EMF_PATTERNS;
- }
else if (args[index].equalsIgnoreCase("-interfaceDataObject"))
{
genOptions |= OPTION_INTERFACE_DO;
@@ -371,7 +361,7 @@
if (genModel == null) return; // nothing to generate
usedGenPackages.add(createGenPackage(SDOPackageImpl.eINSTANCE, "org.apache.tuscany", "SDO", 0, resourceSet));
- usedGenPackages.add(createGenPackage(ModelPackageImpl.eINSTANCE, "org.apache.tuscany.sdo", "Model", 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
@@ -448,7 +438,7 @@
Generator generator = new Generator();
- if ((genOptions & OPTION_USE_EMF_PATTERNS) == 0)
+ //if ((genOptions & OPTION_USE_EMF_PATTERNS) == 0)
{
generator.getAdapterFactoryDescriptorRegistry().addDescriptor
(GenModelPackage.eNS_URI, SDOGenModelGeneratorAdapterFactory.DESCRIPTOR);
@@ -523,7 +513,7 @@
genModel.setSuppressUnsettable(true);
}
- if ((genOptions & OPTION_USE_EMF_PATTERNS) == 0)
+ //if ((genOptions & OPTION_USE_EMF_PATTERNS) == 0)
{
genModel.setRootExtendsClass("org.apache.tuscany.sdo.impl.DataObjectBase");
}
@@ -633,7 +623,6 @@
System.out.println(" [ -arrayAccessors ]");
System.out.println(" [ -generateLoader ]");
System.out.println(" [ -noUnsettable ]");
- System.out.println(" [ -useEMFPatterns ]");
System.out.println(" [ -interfaceDataObject ]");
System.out.println(" <xsd-file> | <wsdl-file>");
System.out.println("");
Modified: incubator/tuscany/java/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/templates/model/SDOClass.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/templates/model/SDOClass.java?view=diff&rev=477364&r1=477363&r2=477364
==============================================================================
--- incubator/tuscany/java/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/templates/model/SDOClass.java (original)
+++ incubator/tuscany/java/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/templates/model/SDOClass.java Mon Nov 20 14:16:00 2006
@@ -135,7 +135,7 @@
protected final String TEXT_117 = " ";
protected final String TEXT_118 = " 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_119 = "_set_ = false;" + NL;
- protected final String TEXT_120 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
+ protected final String TEXT_120 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
protected final String TEXT_121 = "()" + NL + "\t{" + NL + "\t\tsuper();";
protected final String TEXT_122 = NL + "\t\t";
protected final String TEXT_123 = " |= ";
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org