You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by ke...@apache.org on 2006/12/21 13:39:45 UTC
svn commit: r489339 [4/4] - 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/
impl/src/main/java/org/apache/tuscany/sd...
Added: incubator/tuscany/java/sdo/tools/src/test/java/com/example/simple/cs/impl/QuoteImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/tools/src/test/java/com/example/simple/cs/impl/QuoteImpl.java?view=auto&rev=489339
==============================================================================
--- incubator/tuscany/java/sdo/tools/src/test/java/com/example/simple/cs/impl/QuoteImpl.java (added)
+++ incubator/tuscany/java/sdo/tools/src/test/java/com/example/simple/cs/impl/QuoteImpl.java Thu Dec 21 04:39:44 2006
@@ -0,0 +1,775 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package com.example.simple.cs.impl;
+
+import com.example.simple.cs.CSFactory;
+import com.example.simple.cs.Quote;
+
+import commonj.sdo.Type;
+
+import java.math.BigDecimal;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.tuscany.sdo.impl.DataObjectBase;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Quote</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link com.example.simple.cs.impl.QuoteImpl#getSymbol <em>Symbol</em>}</li>
+ * <li>{@link com.example.simple.cs.impl.QuoteImpl#getCompanyName <em>Company Name</em>}</li>
+ * <li>{@link com.example.simple.cs.impl.QuoteImpl#getPrice <em>Price</em>}</li>
+ * <li>{@link com.example.simple.cs.impl.QuoteImpl#getOpen1 <em>Open1</em>}</li>
+ * <li>{@link com.example.simple.cs.impl.QuoteImpl#getHigh <em>High</em>}</li>
+ * <li>{@link com.example.simple.cs.impl.QuoteImpl#getLow <em>Low</em>}</li>
+ * <li>{@link com.example.simple.cs.impl.QuoteImpl#getVolume <em>Volume</em>}</li>
+ * <li>{@link com.example.simple.cs.impl.QuoteImpl#getChange1 <em>Change1</em>}</li>
+ * <li>{@link com.example.simple.cs.impl.QuoteImpl#getQuotes <em>Quotes</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class QuoteImpl extends DataObjectBase implements Quote
+{
+ /**
+ * The feature id for the '<em><b>Symbol</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int SYMBOL = 0;
+
+ /**
+ * The feature id for the '<em><b>Company Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int COMPANY_NAME = 1;
+
+ /**
+ * The feature id for the '<em><b>Price</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int PRICE = 2;
+
+ /**
+ * The feature id for the '<em><b>Open1</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int OPEN1 = 3;
+
+ /**
+ * The feature id for the '<em><b>High</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int HIGH = 4;
+
+ /**
+ * The feature id for the '<em><b>Low</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int LOW = 5;
+
+ /**
+ * The feature id for the '<em><b>Volume</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int VOLUME = 6;
+
+ /**
+ * The feature id for the '<em><b>Change1</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int CHANGE1 = 7;
+
+ /**
+ * The feature id for the '<em><b>Quotes</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int QUOTES = 8;
+
+ /**
+ * This represents the number of properties for this type.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+
+ public final static int SDO_PROPERTY_COUNT = 9;
+
+ /**
+ * The default value of the '{@link #getSymbol() <em>Symbol</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getSymbol()
+ * @generated
+ * @ordered
+ */
+ protected static final String SYMBOL_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getSymbol() <em>Symbol</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getSymbol()
+ * @generated
+ * @ordered
+ */
+ protected String symbol = SYMBOL_DEFAULT_;
+
+ /**
+ * The default value of the '{@link #getCompanyName() <em>Company Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getCompanyName()
+ * @generated
+ * @ordered
+ */
+ protected static final String COMPANY_NAME_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getCompanyName() <em>Company Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getCompanyName()
+ * @generated
+ * @ordered
+ */
+ protected String companyName = COMPANY_NAME_DEFAULT_;
+
+ /**
+ * The default value of the '{@link #getPrice() <em>Price</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getPrice()
+ * @generated
+ * @ordered
+ */
+ protected static final BigDecimal PRICE_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getPrice() <em>Price</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getPrice()
+ * @generated
+ * @ordered
+ */
+ protected BigDecimal price = PRICE_DEFAULT_;
+
+ /**
+ * The default value of the '{@link #getOpen1() <em>Open1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getOpen1()
+ * @generated
+ * @ordered
+ */
+ protected static final BigDecimal OPEN1_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getOpen1() <em>Open1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getOpen1()
+ * @generated
+ * @ordered
+ */
+ protected BigDecimal open1 = OPEN1_DEFAULT_;
+
+ /**
+ * The default value of the '{@link #getHigh() <em>High</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getHigh()
+ * @generated
+ * @ordered
+ */
+ protected static final BigDecimal HIGH_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getHigh() <em>High</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getHigh()
+ * @generated
+ * @ordered
+ */
+ protected BigDecimal high = HIGH_DEFAULT_;
+
+ /**
+ * The default value of the '{@link #getLow() <em>Low</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getLow()
+ * @generated
+ * @ordered
+ */
+ protected static final BigDecimal LOW_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getLow() <em>Low</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getLow()
+ * @generated
+ * @ordered
+ */
+ protected BigDecimal low = LOW_DEFAULT_;
+
+ /**
+ * The default value of the '{@link #getVolume() <em>Volume</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getVolume()
+ * @generated
+ * @ordered
+ */
+ protected static final double VOLUME_DEFAULT_ = 0.0;
+
+ /**
+ * The cached value of the '{@link #getVolume() <em>Volume</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getVolume()
+ * @generated
+ * @ordered
+ */
+ protected double volume = VOLUME_DEFAULT_;
+
+ /**
+ * This is true if the Volume attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean volume_set_ = false;
+
+ /**
+ * The default value of the '{@link #getChange1() <em>Change1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getChange1()
+ * @generated
+ * @ordered
+ */
+ protected static final double CHANGE1_DEFAULT_ = 0.0;
+
+ /**
+ * The cached value of the '{@link #getChange1() <em>Change1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getChange1()
+ * @generated
+ * @ordered
+ */
+ protected double change1 = CHANGE1_DEFAULT_;
+
+ /**
+ * This is true if the Change1 attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean change1_set_ = false;
+
+ /**
+ * The cached value of the '{@link #getQuotes() <em>Quotes</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getQuotes()
+ * @generated
+ * @ordered
+ */
+
+ protected List quotes = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public QuoteImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Type getType()
+ {
+ return ((CSFactoryImpl)CSFactory.INSTANCE).getQuote();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getSymbol()
+ {
+ return symbol;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setSymbol(String newSymbol)
+ {
+ String oldSymbol = symbol;
+ symbol = newSymbol;
+ if (isNotifying())
+ notify(ChangeKind.SET, SYMBOL, oldSymbol, symbol);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getCompanyName()
+ {
+ return companyName;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setCompanyName(String newCompanyName)
+ {
+ String oldCompanyName = companyName;
+ companyName = newCompanyName;
+ if (isNotifying())
+ notify(ChangeKind.SET, COMPANY_NAME, oldCompanyName, companyName);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public BigDecimal getPrice()
+ {
+ return price;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setPrice(BigDecimal newPrice)
+ {
+ BigDecimal oldPrice = price;
+ price = newPrice;
+ if (isNotifying())
+ notify(ChangeKind.SET, PRICE, oldPrice, price);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public BigDecimal getOpen1()
+ {
+ return open1;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setOpen1(BigDecimal newOpen1)
+ {
+ BigDecimal oldOpen1 = open1;
+ open1 = newOpen1;
+ if (isNotifying())
+ notify(ChangeKind.SET, OPEN1, oldOpen1, open1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public BigDecimal getHigh()
+ {
+ return high;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setHigh(BigDecimal newHigh)
+ {
+ BigDecimal oldHigh = high;
+ high = newHigh;
+ if (isNotifying())
+ notify(ChangeKind.SET, HIGH, oldHigh, high);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public BigDecimal getLow()
+ {
+ return low;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setLow(BigDecimal newLow)
+ {
+ BigDecimal oldLow = low;
+ low = newLow;
+ if (isNotifying())
+ notify(ChangeKind.SET, LOW, oldLow, low);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public double getVolume()
+ {
+ return volume;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setVolume(double newVolume)
+ {
+ double oldVolume = volume;
+ volume = newVolume;
+ boolean oldVolume_set_ = volume_set_;
+ volume_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, VOLUME, oldVolume, volume, !oldVolume_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetVolume()
+ {
+ double oldVolume = volume;
+ boolean oldVolume_set_ = volume_set_;
+ volume = VOLUME_DEFAULT_;
+ volume_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, VOLUME, oldVolume, VOLUME_DEFAULT_, oldVolume_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetVolume()
+ {
+ return volume_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public double getChange1()
+ {
+ return change1;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setChange1(double newChange1)
+ {
+ double oldChange1 = change1;
+ change1 = newChange1;
+ boolean oldChange1_set_ = change1_set_;
+ change1_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, CHANGE1, oldChange1, change1, !oldChange1_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetChange1()
+ {
+ double oldChange1 = change1;
+ boolean oldChange1_set_ = change1_set_;
+ change1 = CHANGE1_DEFAULT_;
+ change1_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, CHANGE1, oldChange1, CHANGE1_DEFAULT_, oldChange1_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetChange1()
+ {
+ return change1_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public List getQuotes()
+ {
+ if (quotes == null)
+ {
+ quotes = createPropertyList(ListKind.CONTAINMENT, Quote.class, QUOTES);
+ }
+ return quotes;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeContext inverseRemove(Object otherEnd, int propertyIndex, ChangeContext changeContext)
+ {
+ switch (propertyIndex)
+ {
+ case QUOTES:
+ return removeFromList(getQuotes(), otherEnd, changeContext);
+ }
+ return super.inverseRemove(otherEnd, propertyIndex, changeContext);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object get(int propertyIndex, boolean resolve)
+ {
+ switch (propertyIndex)
+ {
+ case SYMBOL:
+ return getSymbol();
+ case COMPANY_NAME:
+ return getCompanyName();
+ case PRICE:
+ return getPrice();
+ case OPEN1:
+ return getOpen1();
+ case HIGH:
+ return getHigh();
+ case LOW:
+ return getLow();
+ case VOLUME:
+ return new Double(getVolume());
+ case CHANGE1:
+ return new Double(getChange1());
+ case QUOTES:
+ return getQuotes();
+ }
+ return super.get(propertyIndex, resolve);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void set(int propertyIndex, Object newValue)
+ {
+ switch (propertyIndex)
+ {
+ case SYMBOL:
+ setSymbol((String)newValue);
+ return;
+ case COMPANY_NAME:
+ setCompanyName((String)newValue);
+ return;
+ case PRICE:
+ setPrice((BigDecimal)newValue);
+ return;
+ case OPEN1:
+ setOpen1((BigDecimal)newValue);
+ return;
+ case HIGH:
+ setHigh((BigDecimal)newValue);
+ return;
+ case LOW:
+ setLow((BigDecimal)newValue);
+ return;
+ case VOLUME:
+ setVolume(((Double)newValue).doubleValue());
+ return;
+ case CHANGE1:
+ setChange1(((Double)newValue).doubleValue());
+ return;
+ case QUOTES:
+ getQuotes().clear();
+ getQuotes().addAll((Collection)newValue);
+ return;
+ }
+ super.set(propertyIndex, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unset(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case SYMBOL:
+ setSymbol(SYMBOL_DEFAULT_);
+ return;
+ case COMPANY_NAME:
+ setCompanyName(COMPANY_NAME_DEFAULT_);
+ return;
+ case PRICE:
+ setPrice(PRICE_DEFAULT_);
+ return;
+ case OPEN1:
+ setOpen1(OPEN1_DEFAULT_);
+ return;
+ case HIGH:
+ setHigh(HIGH_DEFAULT_);
+ return;
+ case LOW:
+ setLow(LOW_DEFAULT_);
+ return;
+ case VOLUME:
+ unsetVolume();
+ return;
+ case CHANGE1:
+ unsetChange1();
+ return;
+ case QUOTES:
+ getQuotes().clear();
+ return;
+ }
+ super.unset(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSet(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case SYMBOL:
+ return SYMBOL_DEFAULT_ == null ? symbol != null : !SYMBOL_DEFAULT_.equals(symbol);
+ case COMPANY_NAME:
+ return COMPANY_NAME_DEFAULT_ == null ? companyName != null : !COMPANY_NAME_DEFAULT_.equals(companyName);
+ case PRICE:
+ return PRICE_DEFAULT_ == null ? price != null : !PRICE_DEFAULT_.equals(price);
+ case OPEN1:
+ return OPEN1_DEFAULT_ == null ? open1 != null : !OPEN1_DEFAULT_.equals(open1);
+ case HIGH:
+ return HIGH_DEFAULT_ == null ? high != null : !HIGH_DEFAULT_.equals(high);
+ case LOW:
+ return LOW_DEFAULT_ == null ? low != null : !LOW_DEFAULT_.equals(low);
+ case VOLUME:
+ return isSetVolume();
+ case CHANGE1:
+ return isSetChange1();
+ case QUOTES:
+ return quotes != null && !quotes.isEmpty();
+ }
+ return super.isSet(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString()
+ {
+ if (isProxy(this)) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (symbol: ");
+ result.append(symbol);
+ result.append(", companyName: ");
+ result.append(companyName);
+ result.append(", price: ");
+ result.append(price);
+ result.append(", open1: ");
+ result.append(open1);
+ result.append(", high: ");
+ result.append(high);
+ result.append(", low: ");
+ result.append(low);
+ result.append(", volume: ");
+ if (volume_set_) result.append(volume); else result.append("<unset>");
+ result.append(", change1: ");
+ if (change1_set_) result.append(change1); else result.append("<unset>");
+ result.append(')');
+ return result.toString();
+ }
+
+} //QuoteImpl
Propchange: incubator/tuscany/java/sdo/tools/src/test/java/com/example/simple/cs/impl/QuoteImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sdo/tools/src/test/java/com/example/simple/cs/impl/QuoteImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: incubator/tuscany/java/sdo/tools/src/test/java/com/example/simple/impl/QuoteImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/tools/src/test/java/com/example/simple/impl/QuoteImpl.java?view=diff&rev=489339&r1=489338&r2=489339
==============================================================================
--- incubator/tuscany/java/sdo/tools/src/test/java/com/example/simple/impl/QuoteImpl.java (original)
+++ incubator/tuscany/java/sdo/tools/src/test/java/com/example/simple/impl/QuoteImpl.java Thu Dec 21 04:39:44 2006
@@ -1,45 +1,22 @@
/**
+ * <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 com.example.simple.impl;
import com.example.simple.Quote;
+import com.example.simple.SimpleFactory;
+
+import commonj.sdo.Type;
import java.math.BigDecimal;
import java.util.Collection;
import java.util.List;
-import org.apache.tuscany.sdo.impl.DataObjectImpl;
-
-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.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
+import org.apache.tuscany.sdo.impl.DataObjectBase;
/**
* <!-- begin-user-doc -->
@@ -62,9 +39,100 @@
*
* @generated
*/
-public class QuoteImpl extends DataObjectImpl implements Quote
+public class QuoteImpl extends DataObjectBase implements Quote
{
/**
+ * The feature id for the '<em><b>Symbol</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int SYMBOL = 0;
+
+ /**
+ * The feature id for the '<em><b>Company Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int COMPANY_NAME = 1;
+
+ /**
+ * The feature id for the '<em><b>Price</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int PRICE = 2;
+
+ /**
+ * The feature id for the '<em><b>Open1</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int OPEN1 = 3;
+
+ /**
+ * The feature id for the '<em><b>High</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int HIGH = 4;
+
+ /**
+ * The feature id for the '<em><b>Low</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int LOW = 5;
+
+ /**
+ * The feature id for the '<em><b>Volume</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int VOLUME = 6;
+
+ /**
+ * The feature id for the '<em><b>Change1</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int CHANGE1 = 7;
+
+ /**
+ * The feature id for the '<em><b>Quotes</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int QUOTES = 8;
+
+ /**
+ * This represents the number of properties for this type.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+
+ public final static int SDO_PROPERTY_COUNT = 9;
+
+ /**
* The default value of the '{@link #getSymbol() <em>Symbol</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -72,7 +140,7 @@
* @generated
* @ordered
*/
- protected static final String SYMBOL_EDEFAULT = null;
+ protected static final String SYMBOL_DEFAULT_ = null;
/**
* The cached value of the '{@link #getSymbol() <em>Symbol</em>}' attribute.
@@ -82,7 +150,7 @@
* @generated
* @ordered
*/
- protected String symbol = SYMBOL_EDEFAULT;
+ protected String symbol = SYMBOL_DEFAULT_;
/**
* The default value of the '{@link #getCompanyName() <em>Company Name</em>}' attribute.
@@ -92,7 +160,7 @@
* @generated
* @ordered
*/
- protected static final String COMPANY_NAME_EDEFAULT = null;
+ protected static final String COMPANY_NAME_DEFAULT_ = null;
/**
* The cached value of the '{@link #getCompanyName() <em>Company Name</em>}' attribute.
@@ -102,7 +170,7 @@
* @generated
* @ordered
*/
- protected String companyName = COMPANY_NAME_EDEFAULT;
+ protected String companyName = COMPANY_NAME_DEFAULT_;
/**
* The default value of the '{@link #getPrice() <em>Price</em>}' attribute.
@@ -112,7 +180,7 @@
* @generated
* @ordered
*/
- protected static final BigDecimal PRICE_EDEFAULT = null;
+ protected static final BigDecimal PRICE_DEFAULT_ = null;
/**
* The cached value of the '{@link #getPrice() <em>Price</em>}' attribute.
@@ -122,7 +190,7 @@
* @generated
* @ordered
*/
- protected BigDecimal price = PRICE_EDEFAULT;
+ protected BigDecimal price = PRICE_DEFAULT_;
/**
* The default value of the '{@link #getOpen1() <em>Open1</em>}' attribute.
@@ -132,7 +200,7 @@
* @generated
* @ordered
*/
- protected static final BigDecimal OPEN1_EDEFAULT = null;
+ protected static final BigDecimal OPEN1_DEFAULT_ = null;
/**
* The cached value of the '{@link #getOpen1() <em>Open1</em>}' attribute.
@@ -142,7 +210,7 @@
* @generated
* @ordered
*/
- protected BigDecimal open1 = OPEN1_EDEFAULT;
+ protected BigDecimal open1 = OPEN1_DEFAULT_;
/**
* The default value of the '{@link #getHigh() <em>High</em>}' attribute.
@@ -152,7 +220,7 @@
* @generated
* @ordered
*/
- protected static final BigDecimal HIGH_EDEFAULT = null;
+ protected static final BigDecimal HIGH_DEFAULT_ = null;
/**
* The cached value of the '{@link #getHigh() <em>High</em>}' attribute.
@@ -162,7 +230,7 @@
* @generated
* @ordered
*/
- protected BigDecimal high = HIGH_EDEFAULT;
+ protected BigDecimal high = HIGH_DEFAULT_;
/**
* The default value of the '{@link #getLow() <em>Low</em>}' attribute.
@@ -172,7 +240,7 @@
* @generated
* @ordered
*/
- protected static final BigDecimal LOW_EDEFAULT = null;
+ protected static final BigDecimal LOW_DEFAULT_ = null;
/**
* The cached value of the '{@link #getLow() <em>Low</em>}' attribute.
@@ -182,7 +250,7 @@
* @generated
* @ordered
*/
- protected BigDecimal low = LOW_EDEFAULT;
+ protected BigDecimal low = LOW_DEFAULT_;
/**
* The default value of the '{@link #getVolume() <em>Volume</em>}' attribute.
@@ -192,7 +260,7 @@
* @generated
* @ordered
*/
- protected static final double VOLUME_EDEFAULT = 0.0;
+ protected static final double VOLUME_DEFAULT_ = 0.0;
/**
* The cached value of the '{@link #getVolume() <em>Volume</em>}' attribute.
@@ -202,7 +270,7 @@
* @generated
* @ordered
*/
- protected double volume = VOLUME_EDEFAULT;
+ protected double volume = VOLUME_DEFAULT_;
/**
* This is true if the Volume attribute has been set.
@@ -211,7 +279,7 @@
* @generated
* @ordered
*/
- protected boolean volumeESet = false;
+ protected boolean volume_set_ = false;
/**
* The default value of the '{@link #getChange1() <em>Change1</em>}' attribute.
@@ -221,7 +289,7 @@
* @generated
* @ordered
*/
- protected static final double CHANGE1_EDEFAULT = 0.0;
+ protected static final double CHANGE1_DEFAULT_ = 0.0;
/**
* The cached value of the '{@link #getChange1() <em>Change1</em>}' attribute.
@@ -231,7 +299,7 @@
* @generated
* @ordered
*/
- protected double change1 = CHANGE1_EDEFAULT;
+ protected double change1 = CHANGE1_DEFAULT_;
/**
* This is true if the Change1 attribute has been set.
@@ -240,7 +308,7 @@
* @generated
* @ordered
*/
- protected boolean change1ESet = false;
+ protected boolean change1_set_ = false;
/**
* The cached value of the '{@link #getQuotes() <em>Quotes</em>}' containment reference list.
@@ -250,14 +318,15 @@
* @generated
* @ordered
*/
- protected EList quotes = null;
-
+
+ protected List quotes = null;
+
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
- protected QuoteImpl()
+ public QuoteImpl()
{
super();
}
@@ -267,9 +336,9 @@
* <!-- end-user-doc -->
* @generated
*/
- protected EClass eStaticClass()
+ public Type getType()
{
- return SimplePackageImpl.Literals.QUOTE;
+ return ((SimpleFactoryImpl)SimpleFactory.INSTANCE).getQuote();
}
/**
@@ -281,7 +350,6 @@
{
return symbol;
}
-
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -291,8 +359,8 @@
{
String oldSymbol = symbol;
symbol = newSymbol;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, SimplePackageImpl.QUOTE__SYMBOL, oldSymbol, symbol));
+ if (isNotifying())
+ notify(ChangeKind.SET, SYMBOL, oldSymbol, symbol);
}
/**
@@ -304,7 +372,6 @@
{
return companyName;
}
-
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -314,8 +381,8 @@
{
String oldCompanyName = companyName;
companyName = newCompanyName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, SimplePackageImpl.QUOTE__COMPANY_NAME, oldCompanyName, companyName));
+ if (isNotifying())
+ notify(ChangeKind.SET, COMPANY_NAME, oldCompanyName, companyName);
}
/**
@@ -327,7 +394,6 @@
{
return price;
}
-
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -337,8 +403,8 @@
{
BigDecimal oldPrice = price;
price = newPrice;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, SimplePackageImpl.QUOTE__PRICE, oldPrice, price));
+ if (isNotifying())
+ notify(ChangeKind.SET, PRICE, oldPrice, price);
}
/**
@@ -350,7 +416,6 @@
{
return open1;
}
-
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -360,8 +425,8 @@
{
BigDecimal oldOpen1 = open1;
open1 = newOpen1;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, SimplePackageImpl.QUOTE__OPEN1, oldOpen1, open1));
+ if (isNotifying())
+ notify(ChangeKind.SET, OPEN1, oldOpen1, open1);
}
/**
@@ -373,7 +438,6 @@
{
return high;
}
-
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -383,8 +447,8 @@
{
BigDecimal oldHigh = high;
high = newHigh;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, SimplePackageImpl.QUOTE__HIGH, oldHigh, high));
+ if (isNotifying())
+ notify(ChangeKind.SET, HIGH, oldHigh, high);
}
/**
@@ -396,7 +460,6 @@
{
return low;
}
-
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -406,8 +469,8 @@
{
BigDecimal oldLow = low;
low = newLow;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, SimplePackageImpl.QUOTE__LOW, oldLow, low));
+ if (isNotifying())
+ notify(ChangeKind.SET, LOW, oldLow, low);
}
/**
@@ -419,7 +482,6 @@
{
return volume;
}
-
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -429,10 +491,10 @@
{
double oldVolume = volume;
volume = newVolume;
- boolean oldVolumeESet = volumeESet;
- volumeESet = true;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, SimplePackageImpl.QUOTE__VOLUME, oldVolume, volume, !oldVolumeESet));
+ boolean oldVolume_set_ = volume_set_;
+ volume_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, VOLUME, oldVolume, volume, !oldVolume_set_);
}
/**
@@ -443,11 +505,11 @@
public void unsetVolume()
{
double oldVolume = volume;
- boolean oldVolumeESet = volumeESet;
- volume = VOLUME_EDEFAULT;
- volumeESet = false;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.UNSET, SimplePackageImpl.QUOTE__VOLUME, oldVolume, VOLUME_EDEFAULT, oldVolumeESet));
+ boolean oldVolume_set_ = volume_set_;
+ volume = VOLUME_DEFAULT_;
+ volume_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, VOLUME, oldVolume, VOLUME_DEFAULT_, oldVolume_set_);
}
/**
@@ -457,7 +519,7 @@
*/
public boolean isSetVolume()
{
- return volumeESet;
+ return volume_set_;
}
/**
@@ -469,7 +531,6 @@
{
return change1;
}
-
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -479,10 +540,10 @@
{
double oldChange1 = change1;
change1 = newChange1;
- boolean oldChange1ESet = change1ESet;
- change1ESet = true;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, SimplePackageImpl.QUOTE__CHANGE1, oldChange1, change1, !oldChange1ESet));
+ boolean oldChange1_set_ = change1_set_;
+ change1_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, CHANGE1, oldChange1, change1, !oldChange1_set_);
}
/**
@@ -493,11 +554,11 @@
public void unsetChange1()
{
double oldChange1 = change1;
- boolean oldChange1ESet = change1ESet;
- change1 = CHANGE1_EDEFAULT;
- change1ESet = false;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.UNSET, SimplePackageImpl.QUOTE__CHANGE1, oldChange1, CHANGE1_EDEFAULT, oldChange1ESet));
+ boolean oldChange1_set_ = change1_set_;
+ change1 = CHANGE1_DEFAULT_;
+ change1_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, CHANGE1, oldChange1, CHANGE1_DEFAULT_, oldChange1_set_);
}
/**
@@ -507,7 +568,7 @@
*/
public boolean isSetChange1()
{
- return change1ESet;
+ return change1_set_;
}
/**
@@ -519,24 +580,23 @@
{
if (quotes == null)
{
- quotes = new EObjectContainmentEList(Quote.class, this, SimplePackageImpl.QUOTE__QUOTES);
+ quotes = createPropertyList(ListKind.CONTAINMENT, Quote.class, QUOTES);
}
return quotes;
}
-
/**
* <!-- 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 SimplePackageImpl.QUOTE__QUOTES:
- return ((InternalEList)getQuotes()).basicRemove(otherEnd, msgs);
+ case QUOTES:
+ return removeFromList(getQuotes(), otherEnd, changeContext);
}
- return super.eInverseRemove(otherEnd, featureID, msgs);
+ return super.inverseRemove(otherEnd, propertyIndex, changeContext);
}
/**
@@ -544,30 +604,30 @@
* <!-- 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 SimplePackageImpl.QUOTE__SYMBOL:
+ case SYMBOL:
return getSymbol();
- case SimplePackageImpl.QUOTE__COMPANY_NAME:
+ case COMPANY_NAME:
return getCompanyName();
- case SimplePackageImpl.QUOTE__PRICE:
+ case PRICE:
return getPrice();
- case SimplePackageImpl.QUOTE__OPEN1:
+ case OPEN1:
return getOpen1();
- case SimplePackageImpl.QUOTE__HIGH:
+ case HIGH:
return getHigh();
- case SimplePackageImpl.QUOTE__LOW:
+ case LOW:
return getLow();
- case SimplePackageImpl.QUOTE__VOLUME:
+ case VOLUME:
return new Double(getVolume());
- case SimplePackageImpl.QUOTE__CHANGE1:
+ case CHANGE1:
return new Double(getChange1());
- case SimplePackageImpl.QUOTE__QUOTES:
+ case QUOTES:
return getQuotes();
}
- return super.eGet(featureID, resolve, coreType);
+ return super.get(propertyIndex, resolve);
}
/**
@@ -575,40 +635,40 @@
* <!-- end-user-doc -->
* @generated
*/
- public void eSet(int featureID, Object newValue)
+ public void set(int propertyIndex, Object newValue)
{
- switch (featureID)
+ switch (propertyIndex)
{
- case SimplePackageImpl.QUOTE__SYMBOL:
+ case SYMBOL:
setSymbol((String)newValue);
return;
- case SimplePackageImpl.QUOTE__COMPANY_NAME:
+ case COMPANY_NAME:
setCompanyName((String)newValue);
return;
- case SimplePackageImpl.QUOTE__PRICE:
+ case PRICE:
setPrice((BigDecimal)newValue);
return;
- case SimplePackageImpl.QUOTE__OPEN1:
+ case OPEN1:
setOpen1((BigDecimal)newValue);
return;
- case SimplePackageImpl.QUOTE__HIGH:
+ case HIGH:
setHigh((BigDecimal)newValue);
return;
- case SimplePackageImpl.QUOTE__LOW:
+ case LOW:
setLow((BigDecimal)newValue);
return;
- case SimplePackageImpl.QUOTE__VOLUME:
+ case VOLUME:
setVolume(((Double)newValue).doubleValue());
return;
- case SimplePackageImpl.QUOTE__CHANGE1:
+ case CHANGE1:
setChange1(((Double)newValue).doubleValue());
return;
- case SimplePackageImpl.QUOTE__QUOTES:
+ case QUOTES:
getQuotes().clear();
getQuotes().addAll((Collection)newValue);
return;
}
- super.eSet(featureID, newValue);
+ super.set(propertyIndex, newValue);
}
/**
@@ -616,39 +676,39 @@
* <!-- end-user-doc -->
* @generated
*/
- public void eUnset(int featureID)
+ public void unset(int propertyIndex)
{
- switch (featureID)
+ switch (propertyIndex)
{
- case SimplePackageImpl.QUOTE__SYMBOL:
- setSymbol(SYMBOL_EDEFAULT);
+ case SYMBOL:
+ setSymbol(SYMBOL_DEFAULT_);
return;
- case SimplePackageImpl.QUOTE__COMPANY_NAME:
- setCompanyName(COMPANY_NAME_EDEFAULT);
+ case COMPANY_NAME:
+ setCompanyName(COMPANY_NAME_DEFAULT_);
return;
- case SimplePackageImpl.QUOTE__PRICE:
- setPrice(PRICE_EDEFAULT);
+ case PRICE:
+ setPrice(PRICE_DEFAULT_);
return;
- case SimplePackageImpl.QUOTE__OPEN1:
- setOpen1(OPEN1_EDEFAULT);
+ case OPEN1:
+ setOpen1(OPEN1_DEFAULT_);
return;
- case SimplePackageImpl.QUOTE__HIGH:
- setHigh(HIGH_EDEFAULT);
+ case HIGH:
+ setHigh(HIGH_DEFAULT_);
return;
- case SimplePackageImpl.QUOTE__LOW:
- setLow(LOW_EDEFAULT);
+ case LOW:
+ setLow(LOW_DEFAULT_);
return;
- case SimplePackageImpl.QUOTE__VOLUME:
+ case VOLUME:
unsetVolume();
return;
- case SimplePackageImpl.QUOTE__CHANGE1:
+ case CHANGE1:
unsetChange1();
return;
- case SimplePackageImpl.QUOTE__QUOTES:
+ case QUOTES:
getQuotes().clear();
return;
}
- super.eUnset(featureID);
+ super.unset(propertyIndex);
}
/**
@@ -656,30 +716,30 @@
* <!-- end-user-doc -->
* @generated
*/
- public boolean eIsSet(int featureID)
+ public boolean isSet(int propertyIndex)
{
- switch (featureID)
+ switch (propertyIndex)
{
- case SimplePackageImpl.QUOTE__SYMBOL:
- return SYMBOL_EDEFAULT == null ? symbol != null : !SYMBOL_EDEFAULT.equals(symbol);
- case SimplePackageImpl.QUOTE__COMPANY_NAME:
- return COMPANY_NAME_EDEFAULT == null ? companyName != null : !COMPANY_NAME_EDEFAULT.equals(companyName);
- case SimplePackageImpl.QUOTE__PRICE:
- return PRICE_EDEFAULT == null ? price != null : !PRICE_EDEFAULT.equals(price);
- case SimplePackageImpl.QUOTE__OPEN1:
- return OPEN1_EDEFAULT == null ? open1 != null : !OPEN1_EDEFAULT.equals(open1);
- case SimplePackageImpl.QUOTE__HIGH:
- return HIGH_EDEFAULT == null ? high != null : !HIGH_EDEFAULT.equals(high);
- case SimplePackageImpl.QUOTE__LOW:
- return LOW_EDEFAULT == null ? low != null : !LOW_EDEFAULT.equals(low);
- case SimplePackageImpl.QUOTE__VOLUME:
+ case SYMBOL:
+ return SYMBOL_DEFAULT_ == null ? symbol != null : !SYMBOL_DEFAULT_.equals(symbol);
+ case COMPANY_NAME:
+ return COMPANY_NAME_DEFAULT_ == null ? companyName != null : !COMPANY_NAME_DEFAULT_.equals(companyName);
+ case PRICE:
+ return PRICE_DEFAULT_ == null ? price != null : !PRICE_DEFAULT_.equals(price);
+ case OPEN1:
+ return OPEN1_DEFAULT_ == null ? open1 != null : !OPEN1_DEFAULT_.equals(open1);
+ case HIGH:
+ return HIGH_DEFAULT_ == null ? high != null : !HIGH_DEFAULT_.equals(high);
+ case LOW:
+ return LOW_DEFAULT_ == null ? low != null : !LOW_DEFAULT_.equals(low);
+ case VOLUME:
return isSetVolume();
- case SimplePackageImpl.QUOTE__CHANGE1:
+ case CHANGE1:
return isSetChange1();
- case SimplePackageImpl.QUOTE__QUOTES:
+ case QUOTES:
return quotes != null && !quotes.isEmpty();
}
- return super.eIsSet(featureID);
+ return super.isSet(propertyIndex);
}
/**
@@ -689,7 +749,7 @@
*/
public String toString()
{
- if (eIsProxy()) return super.toString();
+ if (isProxy(this)) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (symbol: ");
@@ -705,9 +765,9 @@
result.append(", low: ");
result.append(low);
result.append(", volume: ");
- if (volumeESet) result.append(volume); else result.append("<unset>");
+ if (volume_set_) result.append(volume); else result.append("<unset>");
result.append(", change1: ");
- if (change1ESet) result.append(change1); else result.append("<unset>");
+ if (change1_set_) result.append(change1); else result.append("<unset>");
result.append(')');
return result.toString();
}
Modified: incubator/tuscany/java/sdo/tools/src/test/java/com/example/simple/impl/SimpleFactoryImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/tools/src/test/java/com/example/simple/impl/SimpleFactoryImpl.java?view=diff&rev=489339&r1=489338&r2=489339
==============================================================================
--- incubator/tuscany/java/sdo/tools/src/test/java/com/example/simple/impl/SimpleFactoryImpl.java (original)
+++ incubator/tuscany/java/sdo/tools/src/test/java/com/example/simple/impl/SimpleFactoryImpl.java Thu Dec 21 04:39:44 2006
@@ -1,74 +1,68 @@
/**
+ * <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 com.example.simple.impl;
+import commonj.sdo.helper.HelperContext;
+import org.apache.tuscany.sdo.helper.TypeHelperImpl;
+
import com.example.simple.*;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+
+import org.apache.tuscany.sdo.SDOFactory;
-import org.eclipse.emf.ecore.impl.EFactoryImpl;
+import org.apache.tuscany.sdo.impl.FactoryBase;
-import org.eclipse.emf.ecore.plugin.EcorePlugin;
+import org.apache.tuscany.sdo.model.ModelFactory;
+
+import org.apache.tuscany.sdo.model.impl.ModelFactoryImpl;
+
+import org.apache.tuscany.sdo.util.SDOUtil;
/**
* <!-- begin-user-doc -->
* An implementation of the model <b>Factory</b>.
+ * Generator information:
+ * patternVersion=1.0;
* <!-- end-user-doc -->
* @generated
*/
-public class SimpleFactoryImpl extends EFactoryImpl implements SimpleFactory
+public class SimpleFactoryImpl extends FactoryBase implements SimpleFactory
{
+
/**
- * The singleton instance of the factory.
+ * The package namespace URI.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
- public static final SimpleFactoryImpl eINSTANCE = init();
+ public static final String NAMESPACE_URI = "http://www.example.com/simple";
/**
- * Creates the default factory implementation.
+ * The package namespace name.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
- public static SimpleFactoryImpl init()
- {
- try
- {
- SimpleFactoryImpl theSimpleFactory = (SimpleFactoryImpl)EPackage.Registry.INSTANCE.getEFactory("http://www.example.com/simple");
- if (theSimpleFactory != null)
- {
- return theSimpleFactory;
- }
- }
- catch (Exception exception)
- {
- EcorePlugin.INSTANCE.log(exception);
- }
- return new SimpleFactoryImpl();
- }
+ public static final String NAMESPACE_PREFIX = "simple";
/**
+ * The version of the generator pattern used to generate this class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String PATTERN_VERSION = "1.0";
+
+ public static final int QUOTE = 1;
+
+ /**
* Creates an instance of the factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -76,34 +70,37 @@
*/
public SimpleFactoryImpl()
{
- super();
+ super(NAMESPACE_URI, NAMESPACE_PREFIX, "com.example.simple");
}
/**
+ * Registers the Factory instance so that it is available within the supplied scope.
+ * @argument scope a HelperContext instance that will make the types supported by this Factory available.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
- */
- public EObject create(EClass eClass)
- {
- switch (eClass.getClassifierID())
- {
- case SimplePackageImpl.DOCUMENT_ROOT: return (EObject)createDocumentRoot();
- case SimplePackageImpl.QUOTE: return (EObject)createQuote();
- default:
- throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
- }
+ */
+ public void register(HelperContext scope) {
+ if(scope == null) {
+ throw new IllegalArgumentException("Scope can not be null");
+ }
+ TypeHelperImpl th = (TypeHelperImpl)scope.getTypeHelper();
+ th.getExtendedMetaData().putPackage(NAMESPACE_URI, this);
}
-
+
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
- public EObject createDocumentRoot()
+ public DataObject create(int typeNumber)
{
- EObject documentRoot = super.create(SimplePackageImpl.Literals.DOCUMENT_ROOT);
- return documentRoot;
+ switch (typeNumber)
+ {
+ case QUOTE: return (DataObject)createQuote();
+ default:
+ return super.create(typeNumber);
+ }
}
/**
@@ -116,26 +113,193 @@
QuoteImpl quote = new QuoteImpl();
return quote;
}
+
+ // Following creates and initializes SDO metadata for the supported types.
+ protected Type quoteType = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public SimplePackageImpl getSimplePackageImpl()
+ public Type getQuote()
{
- return (SimplePackageImpl)getEPackage();
+ return quoteType;
}
+
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @deprecated
- * @generated
- */
- public static SimplePackageImpl getPackage()
+ private static boolean isInited = false;
+
+ public static SimpleFactoryImpl init()
+ {
+ if (isInited) return (SimpleFactoryImpl)FactoryBase.getStaticFactory(SimpleFactoryImpl.NAMESPACE_URI);
+ SimpleFactoryImpl theSimpleFactoryImpl = new SimpleFactoryImpl();
+ isInited = true;
+
+ // Initialize simple dependencies
+ SDOUtil.registerStaticTypes(SDOFactory.class);
+ SDOUtil.registerStaticTypes(ModelFactory.class);
+
+ // Create package meta-data objects
+ theSimpleFactoryImpl.createMetaData();
+
+ // Initialize created meta-data
+ theSimpleFactoryImpl.initializeMetaData();
+
+ // Mark meta-data to indicate it can't be changed
+ //theSimpleFactoryImpl.freeze(); //FB do we need to freeze / should we freeze ????
+
+ return theSimpleFactoryImpl;
+ }
+
+ private boolean isCreated = false;
+
+ public void createMetaData()
+ {
+ if (isCreated) return;
+ isCreated = true;
+
+ // Create types and their properties
+ quoteType = createType(false, QUOTE);
+ createProperty(true, quoteType, QuoteImpl.SYMBOL);
+ createProperty(true, quoteType, QuoteImpl.COMPANY_NAME);
+ createProperty(true, quoteType, QuoteImpl.PRICE);
+ createProperty(true, quoteType, QuoteImpl.OPEN1);
+ createProperty(true, quoteType, QuoteImpl.HIGH);
+ createProperty(true, quoteType, QuoteImpl.LOW);
+ createProperty(true, quoteType, QuoteImpl.VOLUME);
+ createProperty(true, quoteType, QuoteImpl.CHANGE1);
+ createProperty(false, quoteType, QuoteImpl.QUOTES);
+ }
+
+ private boolean isInitialized = false;
+
+ public void initializeMetaData()
{
- return SimplePackageImpl.eINSTANCE;
+ if (isInitialized) return;
+ isInitialized = true;
+
+ // Obtain other dependent packages
+ ModelFactoryImpl theModelPackageImpl = (ModelFactoryImpl)FactoryBase.getStaticFactory(ModelFactoryImpl.NAMESPACE_URI);
+ Property property = null;
+
+ // Add supertypes to types
+
+ // Initialize types and properties
+ initializeType(quoteType, Quote.class, "Quote", false);
+ property = (Property)quoteType.getProperties().get(QuoteImpl.SYMBOL);
+ initializeProperty(property, theModelPackageImpl.getString(), "symbol", null, 1, 1, Quote.class, false, false, false);
+ property = (Property)quoteType.getProperties().get(QuoteImpl.COMPANY_NAME);
+ initializeProperty(property, theModelPackageImpl.getString(), "companyName", null, 1, 1, Quote.class, false, false, false);
+ property = (Property)quoteType.getProperties().get(QuoteImpl.PRICE);
+ initializeProperty(property, theModelPackageImpl.getDecimal(), "price", null, 1, 1, Quote.class, false, false, false);
+ property = (Property)quoteType.getProperties().get(QuoteImpl.OPEN1);
+ initializeProperty(property, theModelPackageImpl.getDecimal(), "open1", null, 1, 1, Quote.class, false, false, false);
+ property = (Property)quoteType.getProperties().get(QuoteImpl.HIGH);
+ initializeProperty(property, theModelPackageImpl.getDecimal(), "high", null, 1, 1, Quote.class, false, false, false);
+ property = (Property)quoteType.getProperties().get(QuoteImpl.LOW);
+ initializeProperty(property, theModelPackageImpl.getDecimal(), "low", null, 1, 1, Quote.class, false, false, false);
+ property = (Property)quoteType.getProperties().get(QuoteImpl.VOLUME);
+ initializeProperty(property, theModelPackageImpl.getDouble(), "volume", null, 1, 1, Quote.class, false, true, false);
+ property = (Property)quoteType.getProperties().get(QuoteImpl.CHANGE1);
+ initializeProperty(property, theModelPackageImpl.getDouble(), "change1", null, 1, 1, Quote.class, false, true, false);
+ property = (Property)quoteType.getProperties().get(QuoteImpl.QUOTES);
+ initializeProperty(property, this.getQuote(), "quotes", null, 0, -1, Quote.class, false, false, false, true, null);
+
+ createXSDMetaData(theModelPackageImpl);
}
+
+ protected void createXSDMetaData(ModelFactoryImpl theModelPackageImpl)
+ {
+ super.initXSD();
+
+ Property property = null;
+
+ property = createGlobalProperty
+ ("stockQuote",
+ this.getQuote(),
+ new String[]
+ {
+ "kind", "element",
+ "name", "stockQuote",
+ "namespace", "##targetNamespace"
+ });
+
+ addXSDMapping
+ (quoteType,
+ new String[]
+ {
+ "name", "Quote",
+ "kind", "elementOnly"
+ });
+
+ addXSDMapping
+ ((Property)quoteType.getProperties().get(QuoteImpl.SYMBOL),
+ new String[]
+ {
+ "kind", "element",
+ "name", "symbol"
+ });
+
+ addXSDMapping
+ ((Property)quoteType.getProperties().get(QuoteImpl.COMPANY_NAME),
+ new String[]
+ {
+ "kind", "element",
+ "name", "companyName"
+ });
+
+ addXSDMapping
+ ((Property)quoteType.getProperties().get(QuoteImpl.PRICE),
+ new String[]
+ {
+ "kind", "element",
+ "name", "price"
+ });
+
+ addXSDMapping
+ ((Property)quoteType.getProperties().get(QuoteImpl.OPEN1),
+ new String[]
+ {
+ "kind", "element",
+ "name", "open1"
+ });
+
+ addXSDMapping
+ ((Property)quoteType.getProperties().get(QuoteImpl.HIGH),
+ new String[]
+ {
+ "kind", "element",
+ "name", "high"
+ });
+
+ addXSDMapping
+ ((Property)quoteType.getProperties().get(QuoteImpl.LOW),
+ new String[]
+ {
+ "kind", "element",
+ "name", "low"
+ });
+
+ addXSDMapping
+ ((Property)quoteType.getProperties().get(QuoteImpl.VOLUME),
+ new String[]
+ {
+ "kind", "element",
+ "name", "volume"
+ });
+
+ addXSDMapping
+ ((Property)quoteType.getProperties().get(QuoteImpl.CHANGE1),
+ new String[]
+ {
+ "kind", "element",
+ "name", "change1"
+ });
+
+ addXSDMapping
+ ((Property)quoteType.getProperties().get(QuoteImpl.QUOTES),
+ new String[]
+ {
+ "kind", "element",
+ "name", "quotes"
+ });
+ }
+
} //SimpleFactoryImpl
Modified: incubator/tuscany/java/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/ChangeSummaryGenTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/ChangeSummaryGenTestCase.java?view=diff&rev=489339&r1=489338&r2=489339
==============================================================================
--- incubator/tuscany/java/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/ChangeSummaryGenTestCase.java (original)
+++ incubator/tuscany/java/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/ChangeSummaryGenTestCase.java Thu Dec 21 04:39:44 2006
@@ -23,13 +23,11 @@
import junit.framework.TestCase;
-import org.example.simple.cs.CSFactory;
-import org.example.simple.cs.Quote;
-import org.example.simple.cs.QuoteBase;
-
+import com.example.simple.cs.CSFactory;
+import com.example.simple.cs.Quote;
+import com.example.simple.cs.QuoteBase;
import commonj.sdo.ChangeSummary;
import commonj.sdo.DataObject;
-import commonj.sdo.helper.XMLHelper;
public class ChangeSummaryGenTestCase extends TestCase {
Modified: incubator/tuscany/java/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/SimpleStaticTest.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/SimpleStaticTest.java?view=diff&rev=489339&r1=489338&r2=489339
==============================================================================
--- incubator/tuscany/java/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/SimpleStaticTest.java (original)
+++ incubator/tuscany/java/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/SimpleStaticTest.java Thu Dec 21 04:39:44 2006
@@ -25,6 +25,8 @@
import com.example.simple.Quote;
import com.example.simple.SimpleFactory;
+import com.example.simple.impl.SimpleFactoryImpl;
+
import commonj.sdo.DataObject;
import commonj.sdo.helper.XMLHelper;
@@ -39,6 +41,7 @@
try
{
SDOUtil.registerStaticTypes(SimpleFactory.class);
+ System.out.println(((SimpleFactoryImpl)SimpleFactory.INSTANCE).PATTERN_VERSION);
//Quote quote = (Quote)DataFactory.INSTANCE.create(Quote.class);
Quote quote = SimpleFactory.INSTANCE.createQuote();
Modified: incubator/tuscany/java/sdo/tools/templates/models/SDOFactoryClass.javajet
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/tools/templates/models/SDOFactoryClass.javajet?view=diff&rev=489339&r1=489338&r2=489339
==============================================================================
--- incubator/tuscany/java/sdo/tools/templates/models/SDOFactoryClass.javajet (original)
+++ incubator/tuscany/java/sdo/tools/templates/models/SDOFactoryClass.javajet Thu Dec 21 04:39:44 2006
@@ -1,4 +1,4 @@
-<%@ jet package="org.apache.tuscany.sdo.generate.templates.model" skeleton="generator.skeleton" imports="org.apache.tuscany.sdo.generate.util.* java.util.* org.eclipse.emf.codegen.ecore.genmodel.* org.eclipse.emf.ecore.* org.eclipse.emf.codegen.ecore.genmodel.impl.Literals org.eclipse.emf.ecore.util.*" class="SDOFactoryClass" version="$Id: SDOFactoryClass.javajet,v 1.23 2005/12/10 13:31:02 emerks Exp $" %>
+<%@ jet package="org.apache.tuscany.sdo.generate.templates.model" skeleton="generator.skeleton" imports="org.apache.tuscany.sdo.generate.util.* java.util.* org.eclipse.emf.codegen.ecore.genmodel.* org.eclipse.emf.ecore.* org.eclipse.emf.codegen.ecore.genmodel.impl.Literals org.eclipse.emf.ecore.util.* org.eclipse.emf.codegen.util.CodeGenUtil" class="SDOFactoryClass" version="$Id: SDOFactoryClass.javajet,v 1.23 2005/12/10 13:31:02 emerks Exp $" %>
<%
/**
*
@@ -22,6 +22,7 @@
%>
<%GenPackage genPackage = (GenPackage)((Object[])argument)[0]; GenModel genModel=genPackage.getGenModel();%>
<%boolean isInterface = Boolean.TRUE.equals(((Object[])argument)[1]); boolean isImplementation = Boolean.TRUE.equals(((Object[])argument)[2]);%>
+<%String factoryPatternVersion = "1.0";%>
<%String publicStaticFinalFlag = isImplementation ? "public static final " : "";%>
<%@ include file="../Header.javajetinc"%>
<%if (isInterface || genModel.isSuppressInterfaces()) {%>
@@ -30,6 +31,11 @@
package <%=genPackage.getClassPackageName()%>;
<%}%>
+import commonj.sdo.helper.HelperContext;
+<%if (!isInterface || genModel.isSuppressInterfaces()) {%>
+import org.apache.tuscany.sdo.helper.TypeHelperImpl;
+<%}%>
+
<%if (isImplementation) {%>
<%if (!genPackage.hasJavaLangConflict() && !genPackage.hasInterfaceImplConflict() && !genPackage.getClassPackageName().equals(genPackage.getInterfacePackageName())) genModel.addImport(genPackage.getInterfacePackageName() + ".*");%>
<%}%>
@@ -44,12 +50,17 @@
<%if (!genModel.isSuppressEMFMetaData()) {%>
* @see <%=genPackage.getQualifiedPackageInterfaceName()%>
<%}%>
+<%if (genModel.isSuppressInterfaces()) {%>
+ * patternVersion=<%=factoryPatternVersion%>;<%=SDOGenUtil.printArguments(genPackage, genModel) %>
+<%}%>
* @generated
*/
<%} else {%>
/**
* <!-- begin-user-doc -->
* An implementation of the model <b>Factory</b>.
+ * Generator information:
+ * patternVersion=<%=factoryPatternVersion%>;<%=SDOGenUtil.printArguments(genPackage, genModel) %>
* <!-- end-user-doc -->
* @generated
*/
@@ -105,6 +116,15 @@
* @generated
*/
<%=publicStaticFinalFlag%><%=genModel.getImportedName("java.lang.String")%> NAMESPACE_PREFIX = "<%=genPackage.getNSName()%>";<%=genModel.getNonNLS()%>
+
+ /**
+ * The version of the generator pattern used to generate this class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%=publicStaticFinalFlag%><%=genModel.getImportedName("java.lang.String")%> PATTERN_VERSION = "<%=factoryPatternVersion%>";
+
<%int genIndex = 1;
for (Iterator i=genPackage.getOrderedGenClassifiers().iterator(); i.hasNext();) { GenClassifier genClassifier = (GenClassifier)i.next();%>
<%if (!genPackage.getClassifierID(genClassifier).equals("DOCUMENT_ROOT")) { %>
@@ -123,6 +143,21 @@
{
super(NAMESPACE_URI, NAMESPACE_PREFIX, "<%=genPackage.getReflectionPackageName()%>");
}
+
+ /**
+ * Registers the Factory instance so that it is available within the supplied scope.
+ * @argument scope a HelperContext instance that will make the types supported by this Factory available.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void register(HelperContext scope) {
+ if(scope == null) {
+ throw new IllegalArgumentException("Scope can not be null");
+ }
+ TypeHelperImpl th = (TypeHelperImpl)scope.getTypeHelper();
+ th.getExtendedMetaData().putPackage(NAMESPACE_URI, this);
+ }
/**
* <!-- begin-user-doc -->
@@ -567,6 +602,15 @@
<%}%>
<%}%>
+ /**
+ * Registers the types supported by this Factory within the supplied scope.argument
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param scope an instance of HelperContext used to manage the scoping of types.
+ * @generated
+ */
+ public void register(HelperContext scope);
+
<%if (genPackage.isDataTypeConverters()) {%>
<%for (Iterator i=genPackage.getAllGenDataTypes().iterator(); i.hasNext();) { GenDataType genDataType = (GenDataType)i.next();%>
<%if (genDataType.isSerializable()) {%>
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org