From 76e9f96ca7f494088fe3af5a46ad0d153e961008 Mon Sep 17 00:00:00 2001 From: lresende Date: Wed, 11 Nov 2009 23:11:40 +0000 Subject: Moving 1.x branches git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@835139 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/com/example/sequences/MixedQuote.java | 323 ++++++++ .../example/sequences/MixedRepeatingChoice.java | 96 +++ .../com/example/sequences/RepeatingChoice.java | 82 ++ .../com/example/sequences/SequencesFactory.java | 83 ++ .../test/java/com/example/sequences/TwoRCs.java | 151 ++++ .../java/com/example/sequences/TwoRCsMixed.java | 165 ++++ .../com/example/sequences/impl/MixedQuoteImpl.java | 657 +++++++++++++++ .../sequences/impl/MixedRepeatingChoiceImpl.java | 299 +++++++ .../sequences/impl/RepeatingChoiceImpl.java | 265 ++++++ .../sequences/impl/SequencesFactoryImpl.java | 692 ++++++++++++++++ .../com/example/sequences/impl/TwoRCsImpl.java | 449 ++++++++++ .../example/sequences/impl/TwoRCsMixedImpl.java | 447 ++++++++++ .../src/test/java/com/example/simple/Quote.java | 307 +++++++ .../java/com/example/simple/SimpleFactory.java | 46 ++ .../java/com/example/simple/impl/QuoteImpl.java | 712 ++++++++++++++++ .../com/example/simple/impl/SimpleFactoryImpl.java | 138 ++++ .../com/example/simple/impl/SimplePackageImpl.java | 908 +++++++++++++++++++++ .../apache/tuscany/sdo/test/SimpleStaticTest.java | 64 ++ .../tuscany/sdo/test/StaticSequenceNoEmfTest.java | 249 ++++++ .../java/org/apache/tuscany/sdo/test/TestUtil.java | 282 +++++++ .../java/sdo/tools/src/test/resources/enum.xsd | 47 ++ .../resources/mixedRepeatingChoiceTestResult.xml | 22 + .../src/test/resources/mixedStaticTestResult.xml | 31 + .../tools/src/test/resources/repeatingChoice.xsd | 29 + .../test/resources/repeatingChoiceTestResult.xml | 22 + .../sdo/tools/src/test/resources/sequences.xsd | 97 +++ .../java/sdo/tools/src/test/resources/simple.xsd | 38 + .../twoRepeatingChoicesMixedTestResult.xml | 25 + .../resources/twoRepeatingChoicesTestResult.xml | 25 + 29 files changed, 6751 insertions(+) create mode 100644 sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/MixedQuote.java create mode 100644 sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/MixedRepeatingChoice.java create mode 100644 sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/RepeatingChoice.java create mode 100644 sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/SequencesFactory.java create mode 100644 sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/TwoRCs.java create mode 100644 sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/TwoRCsMixed.java create mode 100644 sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/impl/MixedQuoteImpl.java create mode 100644 sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/impl/MixedRepeatingChoiceImpl.java create mode 100644 sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/impl/RepeatingChoiceImpl.java create mode 100644 sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/impl/SequencesFactoryImpl.java create mode 100644 sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/impl/TwoRCsImpl.java create mode 100644 sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/impl/TwoRCsMixedImpl.java create mode 100644 sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/simple/Quote.java create mode 100644 sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/simple/SimpleFactory.java create mode 100644 sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/simple/impl/QuoteImpl.java create mode 100644 sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/simple/impl/SimpleFactoryImpl.java create mode 100644 sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/simple/impl/SimplePackageImpl.java create mode 100644 sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/SimpleStaticTest.java create mode 100644 sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/StaticSequenceNoEmfTest.java create mode 100644 sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/TestUtil.java create mode 100644 sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/resources/enum.xsd create mode 100644 sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/resources/mixedRepeatingChoiceTestResult.xml create mode 100644 sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/resources/mixedStaticTestResult.xml create mode 100644 sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/resources/repeatingChoice.xsd create mode 100644 sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/resources/repeatingChoiceTestResult.xml create mode 100644 sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/resources/sequences.xsd create mode 100644 sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/resources/simple.xsd create mode 100644 sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/resources/twoRepeatingChoicesMixedTestResult.xml create mode 100644 sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/resources/twoRepeatingChoicesTestResult.xml (limited to 'sca-java-1.x/branches/java-M1/java/sdo/tools/src/test') diff --git a/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/MixedQuote.java b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/MixedQuote.java new file mode 100644 index 0000000000..8ec83abfdb --- /dev/null +++ b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/MixedQuote.java @@ -0,0 +1,323 @@ +/** + * + * Copyright 2005 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.example.sequences; + +import commonj.sdo.Sequence; + +import java.math.BigDecimal; + +import java.util.List; + +/** + * + * A representation of the model object 'Mixed Quote'. + * + * + *

+ * The following features are supported: + *

+ *

+ * + * @generated + */ +public interface MixedQuote +{ + /** + * Returns the value of the 'Mixed' attribute list. + * + *

+ * If the meaning of the 'Mixed' attribute list isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Mixed' attribute list. + * @generated + */ + Sequence getMixed(); + + /** + * Returns the value of the 'Symbol' attribute. + * + *

+ * If the meaning of the 'Symbol' attribute isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Symbol' attribute. + * @see #setSymbol(String) + * @generated + */ + String getSymbol(); + + /** + * Sets the value of the '{@link com.example.sequences.MixedQuote#getSymbol Symbol}' attribute. + * + * + * @param value the new value of the 'Symbol' attribute. + * @see #getSymbol() + * @generated + */ + void setSymbol(String value); + + /** + * Returns the value of the 'Company Name' attribute. + * + *

+ * If the meaning of the 'Company Name' attribute isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Company Name' attribute. + * @see #setCompanyName(String) + * @generated + */ + String getCompanyName(); + + /** + * Sets the value of the '{@link com.example.sequences.MixedQuote#getCompanyName Company Name}' attribute. + * + * + * @param value the new value of the 'Company Name' attribute. + * @see #getCompanyName() + * @generated + */ + void setCompanyName(String value); + + /** + * Returns the value of the 'Price' attribute. + * + *

+ * If the meaning of the 'Price' attribute isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Price' attribute. + * @see #setPrice(BigDecimal) + * @generated + */ + BigDecimal getPrice(); + + /** + * Sets the value of the '{@link com.example.sequences.MixedQuote#getPrice Price}' attribute. + * + * + * @param value the new value of the 'Price' attribute. + * @see #getPrice() + * @generated + */ + void setPrice(BigDecimal value); + + /** + * Returns the value of the 'Open1' attribute. + * + *

+ * If the meaning of the 'Open1' attribute isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Open1' attribute. + * @see #setOpen1(BigDecimal) + * @generated + */ + BigDecimal getOpen1(); + + /** + * Sets the value of the '{@link com.example.sequences.MixedQuote#getOpen1 Open1}' attribute. + * + * + * @param value the new value of the 'Open1' attribute. + * @see #getOpen1() + * @generated + */ + void setOpen1(BigDecimal value); + + /** + * Returns the value of the 'High' attribute. + * + *

+ * If the meaning of the 'High' attribute isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'High' attribute. + * @see #setHigh(BigDecimal) + * @generated + */ + BigDecimal getHigh(); + + /** + * Sets the value of the '{@link com.example.sequences.MixedQuote#getHigh High}' attribute. + * + * + * @param value the new value of the 'High' attribute. + * @see #getHigh() + * @generated + */ + void setHigh(BigDecimal value); + + /** + * Returns the value of the 'Low' attribute. + * + *

+ * If the meaning of the 'Low' attribute isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Low' attribute. + * @see #setLow(BigDecimal) + * @generated + */ + BigDecimal getLow(); + + /** + * Sets the value of the '{@link com.example.sequences.MixedQuote#getLow Low}' attribute. + * + * + * @param value the new value of the 'Low' attribute. + * @see #getLow() + * @generated + */ + void setLow(BigDecimal value); + + /** + * Returns the value of the 'Volume' attribute. + * + *

+ * If the meaning of the 'Volume' attribute isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Volume' attribute. + * @see #isSetVolume() + * @see #unsetVolume() + * @see #setVolume(double) + * @generated + */ + double getVolume(); + + /** + * Sets the value of the '{@link com.example.sequences.MixedQuote#getVolume Volume}' attribute. + * + * + * @param value the new value of the 'Volume' attribute. + * @see #isSetVolume() + * @see #unsetVolume() + * @see #getVolume() + * @generated + */ + void setVolume(double value); + + /** + * Unsets the value of the '{@link com.example.sequences.MixedQuote#getVolume Volume}' attribute. + * + * + * @see #isSetVolume() + * @see #getVolume() + * @see #setVolume(double) + * @generated + */ + void unsetVolume(); + + /** + * Returns whether the value of the '{@link com.example.sequences.MixedQuote#getVolume Volume}' attribute is set. + * + * + * @return whether the value of the 'Volume' attribute is set. + * @see #unsetVolume() + * @see #getVolume() + * @see #setVolume(double) + * @generated + */ + boolean isSetVolume(); + + /** + * Returns the value of the 'Change1' attribute. + * + *

+ * If the meaning of the 'Change1' attribute isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Change1' attribute. + * @see #isSetChange1() + * @see #unsetChange1() + * @see #setChange1(double) + * @generated + */ + double getChange1(); + + /** + * Sets the value of the '{@link com.example.sequences.MixedQuote#getChange1 Change1}' attribute. + * + * + * @param value the new value of the 'Change1' attribute. + * @see #isSetChange1() + * @see #unsetChange1() + * @see #getChange1() + * @generated + */ + void setChange1(double value); + + /** + * Unsets the value of the '{@link com.example.sequences.MixedQuote#getChange1 Change1}' attribute. + * + * + * @see #isSetChange1() + * @see #getChange1() + * @see #setChange1(double) + * @generated + */ + void unsetChange1(); + + /** + * Returns whether the value of the '{@link com.example.sequences.MixedQuote#getChange1 Change1}' attribute is set. + * + * + * @return whether the value of the 'Change1' attribute is set. + * @see #unsetChange1() + * @see #getChange1() + * @see #setChange1(double) + * @generated + */ + boolean isSetChange1(); + + /** + * Returns the value of the 'Quotes' containment reference list. + * The list contents are of type {@link com.example.sequences.MixedQuote}. + * + *

+ * If the meaning of the 'Quotes' containment reference list isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Quotes' containment reference list. + * @generated + */ + List getQuotes(); + +} // MixedQuote diff --git a/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/MixedRepeatingChoice.java b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/MixedRepeatingChoice.java new file mode 100644 index 0000000000..f92285c048 --- /dev/null +++ b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/MixedRepeatingChoice.java @@ -0,0 +1,96 @@ +/** + * + * Copyright 2005 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.example.sequences; + +import commonj.sdo.Sequence; + +import java.util.List; + +/** + * + * A representation of the model object 'Mixed Repeating Choice'. + * + * + *

+ * The following features are supported: + *

+ *

+ * + * @generated + */ +public interface MixedRepeatingChoice +{ + /** + * Returns the value of the 'Mixed' attribute list. + * + *

+ * If the meaning of the 'Mixed' attribute list isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Mixed' attribute list. + * @generated + */ + Sequence getMixed(); + + /** + * Returns the value of the 'Group' attribute list. + * + *

+ * If the meaning of the 'Group' attribute list isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Group' attribute list. + * @generated + */ + Sequence getGroup(); + + /** + * Returns the value of the 'A' attribute list. + * The list contents are of type {@link java.lang.String}. + * + *

+ * If the meaning of the 'A' attribute list isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'A' attribute list. + * @generated + */ + List getA(); + + /** + * Returns the value of the 'B' attribute list. + * The list contents are of type {@link java.lang.Integer}. + * + *

+ * If the meaning of the 'B' attribute list isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'B' attribute list. + * @generated + */ + List getB(); + +} // MixedRepeatingChoice diff --git a/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/RepeatingChoice.java b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/RepeatingChoice.java new file mode 100644 index 0000000000..ab5b144e09 --- /dev/null +++ b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/RepeatingChoice.java @@ -0,0 +1,82 @@ +/** + * + * Copyright 2005 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.example.sequences; + +import commonj.sdo.Sequence; + +import java.util.List; + +/** + * + * A representation of the model object 'Repeating Choice'. + * + * + *

+ * The following features are supported: + *

+ *

+ * + * @generated + */ +public interface RepeatingChoice +{ + /** + * Returns the value of the 'Group' attribute list. + * + *

+ * If the meaning of the 'Group' attribute list isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Group' attribute list. + * @generated + */ + Sequence getGroup(); + + /** + * Returns the value of the 'A' attribute list. + * The list contents are of type {@link java.lang.String}. + * + *

+ * If the meaning of the 'A' attribute list isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'A' attribute list. + * @generated + */ + List getA(); + + /** + * Returns the value of the 'B' attribute list. + * The list contents are of type {@link java.lang.Integer}. + * + *

+ * If the meaning of the 'B' attribute list isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'B' attribute list. + * @generated + */ + List getB(); + +} // RepeatingChoice diff --git a/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/SequencesFactory.java b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/SequencesFactory.java new file mode 100644 index 0000000000..c73310b5b5 --- /dev/null +++ b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/SequencesFactory.java @@ -0,0 +1,83 @@ +/** + * + * Copyright 2005 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.example.sequences; + + +/** + * + * The Factory for the model. + * It provides a create method for each non-abstract class of the model. + * + * @generated + */ +public interface SequencesFactory +{ + + /** + * The singleton instance of the factory. + * + * + * @generated + */ + SequencesFactory INSTANCE = com.example.sequences.impl.SequencesFactoryImpl.init(); + + /** + * Returns a new object of class 'Mixed Quote'. + * + * + * @return a new object of class 'Mixed Quote'. + * @generated + */ + MixedQuote createMixedQuote(); + + /** + * Returns a new object of class 'Mixed Repeating Choice'. + * + * + * @return a new object of class 'Mixed Repeating Choice'. + * @generated + */ + MixedRepeatingChoice createMixedRepeatingChoice(); + + /** + * Returns a new object of class 'Repeating Choice'. + * + * + * @return a new object of class 'Repeating Choice'. + * @generated + */ + RepeatingChoice createRepeatingChoice(); + + /** + * Returns a new object of class 'Two RCs'. + * + * + * @return a new object of class 'Two RCs'. + * @generated + */ + TwoRCs createTwoRCs(); + + /** + * Returns a new object of class 'Two RCs Mixed'. + * + * + * @return a new object of class 'Two RCs Mixed'. + * @generated + */ + TwoRCsMixed createTwoRCsMixed(); + +} //SequencesFactory diff --git a/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/TwoRCs.java b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/TwoRCs.java new file mode 100644 index 0000000000..9615d2a0ef --- /dev/null +++ b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/TwoRCs.java @@ -0,0 +1,151 @@ +/** + * + * Copyright 2005 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.example.sequences; + +import commonj.sdo.Sequence; + +import java.util.List; + +/** + * + * A representation of the model object 'Two RCs'. + * + * + *

+ * The following features are supported: + *

+ *

+ * + * @generated + */ +public interface TwoRCs +{ + /** + * Returns the value of the 'Group' attribute list. + * + *

+ * If the meaning of the 'Group' attribute list isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Group' attribute list. + * @generated + */ + Sequence getGroup(); + + /** + * Returns the value of the 'A' attribute list. + * The list contents are of type {@link java.lang.String}. + * + *

+ * If the meaning of the 'A' attribute list isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'A' attribute list. + * @generated + */ + List getA(); + + /** + * Returns the value of the 'B' attribute list. + * The list contents are of type {@link java.lang.Integer}. + * + *

+ * If the meaning of the 'B' attribute list isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'B' attribute list. + * @generated + */ + List getB(); + + /** + * Returns the value of the 'Split' attribute. + * + *

+ * If the meaning of the 'Split' attribute isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Split' attribute. + * @see #setSplit(String) + * @generated + */ + String getSplit(); + + /** + * Sets the value of the '{@link com.example.sequences.TwoRCs#getSplit Split}' attribute. + * + * + * @param value the new value of the 'Split' attribute. + * @see #getSplit() + * @generated + */ + void setSplit(String value); + + /** + * Returns the value of the 'Group1' attribute list. + * + *

+ * If the meaning of the 'Group1' attribute list isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Group1' attribute list. + * @generated + */ + Sequence getGroup1(); + + /** + * Returns the value of the 'Y' attribute list. + * The list contents are of type {@link java.lang.String}. + * + *

+ * If the meaning of the 'Y' attribute list isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Y' attribute list. + * @generated + */ + List getY(); + + /** + * Returns the value of the 'Z' attribute list. + * The list contents are of type {@link java.lang.Integer}. + * + *

+ * If the meaning of the 'Z' attribute list isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Z' attribute list. + * @generated + */ + List getZ(); + +} // TwoRCs diff --git a/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/TwoRCsMixed.java b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/TwoRCsMixed.java new file mode 100644 index 0000000000..0325e2cd9c --- /dev/null +++ b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/TwoRCsMixed.java @@ -0,0 +1,165 @@ +/** + * + * Copyright 2005 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.example.sequences; + +import commonj.sdo.Sequence; + +import java.util.List; + +/** + * + * A representation of the model object 'Two RCs Mixed'. + * + * + *

+ * The following features are supported: + *

+ *

+ * + * @generated + */ +public interface TwoRCsMixed +{ + /** + * Returns the value of the 'Mixed' attribute list. + * + *

+ * If the meaning of the 'Mixed' attribute list isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Mixed' attribute list. + * @generated + */ + Sequence getMixed(); + + /** + * Returns the value of the 'Group' attribute list. + * + *

+ * If the meaning of the 'Group' attribute list isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Group' attribute list. + * @generated + */ + Sequence getGroup(); + + /** + * Returns the value of the 'A' attribute list. + * The list contents are of type {@link java.lang.String}. + * + *

+ * If the meaning of the 'A' attribute list isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'A' attribute list. + * @generated + */ + List getA(); + + /** + * Returns the value of the 'B' attribute list. + * The list contents are of type {@link java.lang.Integer}. + * + *

+ * If the meaning of the 'B' attribute list isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'B' attribute list. + * @generated + */ + List getB(); + + /** + * Returns the value of the 'Split' attribute. + * + *

+ * If the meaning of the 'Split' attribute isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Split' attribute. + * @see #setSplit(String) + * @generated + */ + String getSplit(); + + /** + * Sets the value of the '{@link com.example.sequences.TwoRCsMixed#getSplit Split}' attribute. + * + * + * @param value the new value of the 'Split' attribute. + * @see #getSplit() + * @generated + */ + void setSplit(String value); + + /** + * Returns the value of the 'Group1' attribute list. + * + *

+ * If the meaning of the 'Group1' attribute list isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Group1' attribute list. + * @generated + */ + Sequence getGroup1(); + + /** + * Returns the value of the 'Y' attribute list. + * The list contents are of type {@link java.lang.String}. + * + *

+ * If the meaning of the 'Y' attribute list isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Y' attribute list. + * @generated + */ + List getY(); + + /** + * Returns the value of the 'Z' attribute list. + * The list contents are of type {@link java.lang.Integer}. + * + *

+ * If the meaning of the 'Z' attribute list isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Z' attribute list. + * @generated + */ + List getZ(); + +} // TwoRCsMixed diff --git a/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/impl/MixedQuoteImpl.java b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/impl/MixedQuoteImpl.java new file mode 100644 index 0000000000..b3381cda76 --- /dev/null +++ b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/impl/MixedQuoteImpl.java @@ -0,0 +1,657 @@ +/** + * + * Copyright 2005 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.example.sequences.impl; + +import com.example.sequences.MixedQuote; + +import commonj.sdo.Sequence; +import commonj.sdo.Type; + +import commonj.sdo.helper.TypeHelper; + +import java.math.BigDecimal; + +import java.util.Collection; +import java.util.List; + +import org.apache.tuscany.sdo.impl.DataObjectBase; + +import org.apache.tuscany.sdo.util.BasicSequence; + +/** + * + * An implementation of the model object 'Mixed Quote'. + * + *

+ * The following features are implemented: + *

+ *

+ * + * @generated + */ +public class MixedQuoteImpl extends DataObjectBase implements MixedQuote +{ + /** + * The feature id for the 'Mixed' attribute list. + * + * + * @generated + * @ordered + */ + public final static int MIXED = 0; + + /** + * The cached value of the '{@link #getMixed() Mixed}' attribute list. + * + * + * @see #getMixed() + * @generated + * @ordered + */ + + // How to get BasicSequence from Sequence? + + protected BasicSequence mixed = null; + + /** + * The feature id for the 'Symbol' attribute. + * + * + * @generated + * @ordered + */ + public final static int SYMBOL = 1; + + /** + * The default value of the '{@link #getSymbol() Symbol}' attribute. + * + * + * @see #getSymbol() + * @generated + * @ordered + */ + protected static final String SYMBOL_DEFAULT_ = null; + + /** + * The feature id for the 'Company Name' attribute. + * + * + * @generated + * @ordered + */ + public final static int COMPANY_NAME = 2; + + /** + * The default value of the '{@link #getCompanyName() Company Name}' attribute. + * + * + * @see #getCompanyName() + * @generated + * @ordered + */ + protected static final String COMPANY_NAME_DEFAULT_ = null; + + /** + * The feature id for the 'Price' attribute. + * + * + * @generated + * @ordered + */ + public final static int PRICE = 3; + + /** + * The default value of the '{@link #getPrice() Price}' attribute. + * + * + * @see #getPrice() + * @generated + * @ordered + */ + protected static final BigDecimal PRICE_DEFAULT_ = null; + + /** + * The feature id for the 'Open1' attribute. + * + * + * @generated + * @ordered + */ + public final static int OPEN1 = 4; + + /** + * The default value of the '{@link #getOpen1() Open1}' attribute. + * + * + * @see #getOpen1() + * @generated + * @ordered + */ + protected static final BigDecimal OPEN1_DEFAULT_ = null; + + /** + * The feature id for the 'High' attribute. + * + * + * @generated + * @ordered + */ + public final static int HIGH = 5; + + /** + * The default value of the '{@link #getHigh() High}' attribute. + * + * + * @see #getHigh() + * @generated + * @ordered + */ + protected static final BigDecimal HIGH_DEFAULT_ = null; + + /** + * The feature id for the 'Low' attribute. + * + * + * @generated + * @ordered + */ + public final static int LOW = 6; + + /** + * The default value of the '{@link #getLow() Low}' attribute. + * + * + * @see #getLow() + * @generated + * @ordered + */ + protected static final BigDecimal LOW_DEFAULT_ = null; + + /** + * The feature id for the 'Volume' attribute. + * + * + * @generated + * @ordered + */ + public final static int VOLUME = 7; + + /** + * The feature id for the 'Change1' attribute. + * + * + * @generated + * @ordered + */ + public final static int CHANGE1 = 8; + + /** + * The feature id for the 'Quotes' containment reference list. + * + * + * @generated + * @ordered + */ + public final static int QUOTES = 9; + + /** + * + * + * @generated + */ + protected MixedQuoteImpl() + { + super(); + } + + /** + * + * + * @generated + */ + public Type getType() + { + return TypeHelper.INSTANCE.getType(MixedQuote.class); //TBD Generate a more efficient implementation + } + + /** + * + * + * @generated + */ + public Sequence getMixed() + { + if (mixed == null) + { + mixed = createSequence(MIXED); + + } + return mixed; + } + + /** + * + * + * @generated + */ + public String getSymbol() + { + return (String)get(getMixed(), getType(), SYMBOL); + } + + /** + * + * + * @generated + */ + public void setSymbol(String newSymbol) + { + set(getMixed(), getType(), SYMBOL, newSymbol); + } + + /** + * + * + * @generated + */ + public String getCompanyName() + { + return (String)get(getMixed(), getType(), COMPANY_NAME); + } + + /** + * + * + * @generated + */ + public void setCompanyName(String newCompanyName) + { + set(getMixed(), getType(), COMPANY_NAME, newCompanyName); + } + + /** + * + * + * @generated + */ + public BigDecimal getPrice() + { + return (BigDecimal)get(getMixed(), getType(), PRICE); + } + + /** + * + * + * @generated + */ + public void setPrice(BigDecimal newPrice) + { + set(getMixed(), getType(), PRICE, newPrice); + } + + /** + * + * + * @generated + */ + public BigDecimal getOpen1() + { + return (BigDecimal)get(getMixed(), getType(), OPEN1); + } + + /** + * + * + * @generated + */ + public void setOpen1(BigDecimal newOpen1) + { + set(getMixed(), getType(), OPEN1, newOpen1); + } + + /** + * + * + * @generated + */ + public BigDecimal getHigh() + { + return (BigDecimal)get(getMixed(), getType(), HIGH); + } + + /** + * + * + * @generated + */ + public void setHigh(BigDecimal newHigh) + { + set(getMixed(), getType(), HIGH, newHigh); + } + + /** + * + * + * @generated + */ + public BigDecimal getLow() + { + return (BigDecimal)get(getMixed(), getType(), LOW); + } + + /** + * + * + * @generated + */ + public void setLow(BigDecimal newLow) + { + set(getMixed(), getType(), LOW, newLow); + } + + /** + * + * + * @generated + */ + public double getVolume() + { + return ((Double)get(getMixed(), getType(), VOLUME)).doubleValue(); + } + + /** + * + * + * @generated + */ + public void setVolume(double newVolume) + { + set(getMixed(), getType(), VOLUME, new Double(newVolume)); + } + + /** + * + * + * @generated + */ + public void unsetVolume() + { + unset(getMixed(), getType(), VOLUME); + } + + /** + * + * + * @generated + */ + public boolean isSetVolume() + { + return isSet(getMixed(), getType(), VOLUME); + } + + /** + * + * + * @generated + */ + public double getChange1() + { + return ((Double)get(getMixed(), getType(), CHANGE1)).doubleValue(); + } + + /** + * + * + * @generated + */ + public void setChange1(double newChange1) + { + set(getMixed(), getType(), CHANGE1, new Double(newChange1)); + } + + /** + * + * + * @generated + */ + public void unsetChange1() + { + unset(getMixed(), getType(), CHANGE1); + } + + /** + * + * + * @generated + */ + public boolean isSetChange1() + { + return isSet(getMixed(), getType(), CHANGE1); + } + + /** + * + * + * @generated + */ + public List getQuotes() + { + return getList(getMixed(), getType(), QUOTES); + + } + + /** + * + * + * @generated + */ + public ChangeContext inverseRemove(Object otherEnd, int propertyIndex, ChangeContext changeContext) + { + switch (propertyIndex) + { + case MIXED: + return removeFromSequence(getMixed(), otherEnd, changeContext); + case QUOTES: + return removeFromList(getQuotes(), otherEnd, changeContext); + } + return super.inverseRemove(otherEnd, propertyIndex, changeContext); + } + + /** + * + * + * @generated + */ + public Object get(int propertyIndex, boolean resolve) + { + switch (propertyIndex) + { + case MIXED: + // XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view + //if (coreType) + return getMixed(); + case SYMBOL: + return getSymbol(); + case COMPANY_NAME: + return getCompanyName(); + case PRICE: + return getPrice(); + case OPEN1: + return getOpen1(); + case HIGH: + return getHigh(); + case LOW: + return getLow(); + case VOLUME: + return new Double(getVolume()); + case CHANGE1: + return new Double(getChange1()); + case QUOTES: + return getQuotes(); + } + return super.get(propertyIndex, resolve); + } + + /** + * + * + * @generated + */ + public void set(int propertyIndex, Object newValue) + { + switch (propertyIndex) + { + case MIXED: + setSequence(getMixed(), newValue); + return; + case SYMBOL: + setSymbol((String)newValue); + return; + case COMPANY_NAME: + setCompanyName((String)newValue); + return; + case PRICE: + setPrice((BigDecimal)newValue); + return; + case OPEN1: + setOpen1((BigDecimal)newValue); + return; + case HIGH: + setHigh((BigDecimal)newValue); + return; + case LOW: + setLow((BigDecimal)newValue); + return; + case VOLUME: + setVolume(((Double)newValue).doubleValue()); + return; + case CHANGE1: + setChange1(((Double)newValue).doubleValue()); + return; + case QUOTES: + getQuotes().clear(); + getQuotes().addAll((Collection)newValue); + return; + } + super.set(propertyIndex, newValue); + } + + /** + * + * + * @generated + */ + public void unset(int propertyIndex) + { + switch (propertyIndex) + { + case MIXED: + unsetSequence(getMixed()); + return; + 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); + } + + /** + * + * + * @generated + */ + public boolean isSet(int propertyIndex) + { + switch (propertyIndex) + { + case MIXED: + // KDK - should this be !isSequenceEmpty? + return mixed != null && !isSequenceEmpty(getMixed()); + case SYMBOL: + return SYMBOL_DEFAULT_ == null ? getSymbol() != null : !SYMBOL_DEFAULT_.equals(getSymbol()); + case COMPANY_NAME: + return COMPANY_NAME_DEFAULT_ == null ? getCompanyName() != null : !COMPANY_NAME_DEFAULT_.equals(getCompanyName()); + case PRICE: + return PRICE_DEFAULT_ == null ? getPrice() != null : !PRICE_DEFAULT_.equals(getPrice()); + case OPEN1: + return OPEN1_DEFAULT_ == null ? getOpen1() != null : !OPEN1_DEFAULT_.equals(getOpen1()); + case HIGH: + return HIGH_DEFAULT_ == null ? getHigh() != null : !HIGH_DEFAULT_.equals(getHigh()); + case LOW: + return LOW_DEFAULT_ == null ? getLow() != null : !LOW_DEFAULT_.equals(getLow()); + case VOLUME: + return isSetVolume(); + case CHANGE1: + return isSetChange1(); + case QUOTES: + return !getQuotes().isEmpty(); + } + return super.isSet(propertyIndex); + } + + /** + * + * + * @generated + */ + public String toString() + { + if (isProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (mixed: "); + result.append(mixed); + result.append(')'); + return result.toString(); + } + +} //MixedQuoteImpl diff --git a/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/impl/MixedRepeatingChoiceImpl.java b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/impl/MixedRepeatingChoiceImpl.java new file mode 100644 index 0000000000..7e49e448f8 --- /dev/null +++ b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/impl/MixedRepeatingChoiceImpl.java @@ -0,0 +1,299 @@ +/** + * + * Copyright 2005 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.example.sequences.impl; + +import com.example.sequences.MixedRepeatingChoice; + +import commonj.sdo.Sequence; +import commonj.sdo.Type; + +import commonj.sdo.helper.TypeHelper; + +import java.util.Collection; +import java.util.List; + +import org.apache.tuscany.sdo.impl.DataObjectBase; + +import org.apache.tuscany.sdo.util.BasicSequence; + +/** + * + * An implementation of the model object 'Mixed Repeating Choice'. + * + *

+ * The following features are implemented: + *

+ *

+ * + * @generated + */ +public class MixedRepeatingChoiceImpl extends DataObjectBase implements MixedRepeatingChoice +{ + /** + * The feature id for the 'Mixed' attribute list. + * + * + * @generated + * @ordered + */ + public final static int MIXED = 0; + + /** + * The cached value of the '{@link #getMixed() Mixed}' attribute list. + * + * + * @see #getMixed() + * @generated + * @ordered + */ + + // How to get BasicSequence from Sequence? + + protected BasicSequence mixed = null; + + /** + * The feature id for the 'Group' attribute list. + * + * + * @generated + * @ordered + */ + public final static int GROUP = 1; + + /** + * The feature id for the 'A' attribute list. + * + * + * @generated + * @ordered + */ + public final static int A = 2; + + /** + * The feature id for the 'B' attribute list. + * + * + * @generated + * @ordered + */ + public final static int B = 3; + + /** + * + * + * @generated + */ + protected MixedRepeatingChoiceImpl() + { + super(); + } + + /** + * + * + * @generated + */ + public Type getType() + { + return TypeHelper.INSTANCE.getType(MixedRepeatingChoice.class); //TBD Generate a more efficient implementation + } + + /** + * + * + * @generated + */ + public Sequence getMixed() + { + if (mixed == null) + { + mixed = createSequence(MIXED); + + } + return mixed; + } + + /** + * + * + * @generated + */ + public Sequence getGroup() + { + return createSequence(getMixed(), getType(), GROUP); + } + + /** + * + * + * @generated + */ + public List getA() + { + return getList(getGroup(), getType(), A); + + } + + /** + * + * + * @generated + */ + public List getB() + { + return getList(getGroup(), getType(), B); + + } + + /** + * + * + * @generated + */ + public ChangeContext inverseRemove(Object otherEnd, int propertyIndex, ChangeContext changeContext) + { + switch (propertyIndex) + { + case MIXED: + return removeFromSequence(getMixed(), otherEnd, changeContext); + case GROUP: + return removeFromSequence(getGroup(), otherEnd, changeContext); + } + return super.inverseRemove(otherEnd, propertyIndex, changeContext); + } + + /** + * + * + * @generated + */ + public Object get(int propertyIndex, boolean resolve) + { + switch (propertyIndex) + { + case MIXED: + // XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view + //if (coreType) + return getMixed(); + case GROUP: + // XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view + //if (coreType) + return getGroup(); + case A: + return getA(); + case B: + return getB(); + } + return super.get(propertyIndex, resolve); + } + + /** + * + * + * @generated + */ + public void set(int propertyIndex, Object newValue) + { + switch (propertyIndex) + { + case MIXED: + setSequence(getMixed(), newValue); + return; + case GROUP: + setSequence(getGroup(), newValue); + return; + case A: + getA().clear(); + getA().addAll((Collection)newValue); + return; + case B: + getB().clear(); + getB().addAll((Collection)newValue); + return; + } + super.set(propertyIndex, newValue); + } + + /** + * + * + * @generated + */ + public void unset(int propertyIndex) + { + switch (propertyIndex) + { + case MIXED: + unsetSequence(getMixed()); + return; + case GROUP: + unsetSequence(getGroup()); + return; + case A: + getA().clear(); + return; + case B: + getB().clear(); + return; + } + super.unset(propertyIndex); + } + + /** + * + * + * @generated + */ + public boolean isSet(int propertyIndex) + { + switch (propertyIndex) + { + case MIXED: + // KDK - should this be !isSequenceEmpty? + return mixed != null && !isSequenceEmpty(getMixed()); + case GROUP: + return !isSequenceEmpty(getGroup()); + case A: + return !getA().isEmpty(); + case B: + return !getB().isEmpty(); + } + return super.isSet(propertyIndex); + } + + /** + * + * + * @generated + */ + public String toString() + { + if (isProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (mixed: "); + result.append(mixed); + result.append(')'); + return result.toString(); + } + +} //MixedRepeatingChoiceImpl diff --git a/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/impl/RepeatingChoiceImpl.java b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/impl/RepeatingChoiceImpl.java new file mode 100644 index 0000000000..f4bc2c301f --- /dev/null +++ b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/impl/RepeatingChoiceImpl.java @@ -0,0 +1,265 @@ +/** + * + * Copyright 2005 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.example.sequences.impl; + +import com.example.sequences.RepeatingChoice; + +import commonj.sdo.Sequence; +import commonj.sdo.Type; + +import commonj.sdo.helper.TypeHelper; + +import java.util.Collection; +import java.util.List; + +import org.apache.tuscany.sdo.impl.DataObjectBase; + +import org.apache.tuscany.sdo.util.BasicSequence; + +/** + * + * An implementation of the model object 'Repeating Choice'. + * + *

+ * The following features are implemented: + *

+ *

+ * + * @generated + */ +public class RepeatingChoiceImpl extends DataObjectBase implements RepeatingChoice +{ + /** + * The feature id for the 'Group' attribute list. + * + * + * @generated + * @ordered + */ + public final static int GROUP = 0; + + /** + * The cached value of the '{@link #getGroup() Group}' attribute list. + * + * + * @see #getGroup() + * @generated + * @ordered + */ + + // How to get BasicSequence from Sequence? + + protected BasicSequence group = null; + + /** + * The feature id for the 'A' attribute list. + * + * + * @generated + * @ordered + */ + public final static int A = 1; + + /** + * The feature id for the 'B' attribute list. + * + * + * @generated + * @ordered + */ + public final static int B = 2; + + /** + * + * + * @generated + */ + protected RepeatingChoiceImpl() + { + super(); + } + + /** + * + * + * @generated + */ + public Type getType() + { + return TypeHelper.INSTANCE.getType(RepeatingChoice.class); //TBD Generate a more efficient implementation + } + + /** + * + * + * @generated + */ + public Sequence getGroup() + { + if (group == null) + { + group = createSequence(GROUP); + + } + return group; + } + + /** + * + * + * @generated + */ + public List getA() + { + return getList(getGroup(), getType(), A); + + } + + /** + * + * + * @generated + */ + public List getB() + { + return getList(getGroup(), getType(), B); + + } + + /** + * + * + * @generated + */ + public ChangeContext inverseRemove(Object otherEnd, int propertyIndex, ChangeContext changeContext) + { + switch (propertyIndex) + { + case GROUP: + return removeFromSequence(getGroup(), otherEnd, changeContext); + } + return super.inverseRemove(otherEnd, propertyIndex, changeContext); + } + + /** + * + * + * @generated + */ + public Object get(int propertyIndex, boolean resolve) + { + switch (propertyIndex) + { + case GROUP: + // XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view + //if (coreType) + return getGroup(); + case A: + return getA(); + case B: + return getB(); + } + return super.get(propertyIndex, resolve); + } + + /** + * + * + * @generated + */ + public void set(int propertyIndex, Object newValue) + { + switch (propertyIndex) + { + case GROUP: + setSequence(getGroup(), newValue); + return; + case A: + getA().clear(); + getA().addAll((Collection)newValue); + return; + case B: + getB().clear(); + getB().addAll((Collection)newValue); + return; + } + super.set(propertyIndex, newValue); + } + + /** + * + * + * @generated + */ + public void unset(int propertyIndex) + { + switch (propertyIndex) + { + case GROUP: + unsetSequence(getGroup()); + return; + case A: + getA().clear(); + return; + case B: + getB().clear(); + return; + } + super.unset(propertyIndex); + } + + /** + * + * + * @generated + */ + public boolean isSet(int propertyIndex) + { + switch (propertyIndex) + { + case GROUP: + // KDK - should this be !isSequenceEmpty? + return group != null && !isSequenceEmpty(getGroup()); + case A: + return !getA().isEmpty(); + case B: + return !getB().isEmpty(); + } + return super.isSet(propertyIndex); + } + + /** + * + * + * @generated + */ + public String toString() + { + if (isProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (group: "); + result.append(group); + result.append(')'); + return result.toString(); + } + +} //RepeatingChoiceImpl diff --git a/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/impl/SequencesFactoryImpl.java b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/impl/SequencesFactoryImpl.java new file mode 100644 index 0000000000..0cef7a04d1 --- /dev/null +++ b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/impl/SequencesFactoryImpl.java @@ -0,0 +1,692 @@ +/** + * + * Copyright 2005 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.example.sequences.impl; + +import org.apache.tuscany.sdo.impl.FactoryBase; +import org.apache.tuscany.sdo.impl.SDOFactoryImpl; +import org.apache.tuscany.sdo.model.impl.ModelFactoryImpl; +import org.apache.tuscany.sdo.model.impl.ModelPackageImpl; +import org.apache.tuscany.sdo.util.SDOUtil; + +import com.example.sequences.MixedQuote; +import com.example.sequences.MixedRepeatingChoice; +import com.example.sequences.RepeatingChoice; +import com.example.sequences.SequencesFactory; +import com.example.sequences.TwoRCs; +import com.example.sequences.TwoRCsMixed; +import commonj.sdo.DataObject; +import commonj.sdo.Property; +import commonj.sdo.Type; + +/** + * + * An implementation of the model Factory. + * + * @generated + */ +public class SequencesFactoryImpl extends FactoryBase implements SequencesFactory +{ + +/** + * The package namespace URI. + * + * + * @generated + */ +public static final String NAMESPACE_URI = "http://www.example.com/sequences"; + +/** + * The package namespace name. + * + * + * @generated + */ +public static final String NAMESPACE_PREFIX = "sequences"; + + +public static final int MIXED_QUOTE = 1; +public static final int MIXED_REPEATING_CHOICE = 2; +public static final int REPEATING_CHOICE = 3; +public static final int TWO_RCS = 4; +public static final int TWO_RCS_MIXED = 5; + + + /** + * Creates the default factory implementation. + * + * + * @generated + */ + + /** + * Creates an instance of the factory. + * + * + * @generated + */ + public SequencesFactoryImpl() + { + super(NAMESPACE_URI, NAMESPACE_PREFIX); + } + + /** + * + * + * @generated + */ + public DataObject create(int typeNumber) + { + switch (typeNumber) + { + // TODO make sure we're supposed to ingore DOCUMENT_ROOT + case MIXED_QUOTE: return (DataObject)createMixedQuote(); + // TODO make sure we're supposed to ingore DOCUMENT_ROOT + case MIXED_REPEATING_CHOICE: return (DataObject)createMixedRepeatingChoice(); + // TODO make sure we're supposed to ingore DOCUMENT_ROOT + case REPEATING_CHOICE: return (DataObject)createRepeatingChoice(); + // TODO make sure we're supposed to ingore DOCUMENT_ROOT + case TWO_RCS: return (DataObject)createTwoRCs(); + // TODO make sure we're supposed to ingore DOCUMENT_ROOT + case TWO_RCS_MIXED: return (DataObject)createTwoRCsMixed(); + default: + return super.create(typeNumber); + } + } + + + /** + * + * + * @generated + */ + public MixedQuote createMixedQuote() + { + MixedQuoteImpl mixedQuote = new MixedQuoteImpl(); + return mixedQuote; + } + + // Following creates and initializes SDO metadata for the supported types. + protected Type mixedQuoteType = null; + + public Type getMixedQuote() + { + // TODO - kdk - verify how to generate quoteType...mixedQuoteType? + return mixedQuoteType; + } + /** + * + * + * @generated + */ + public MixedRepeatingChoice createMixedRepeatingChoice() + { + MixedRepeatingChoiceImpl mixedRepeatingChoice = new MixedRepeatingChoiceImpl(); + return mixedRepeatingChoice; + } + + // Following creates and initializes SDO metadata for the supported types. + protected Type mixedRepeatingChoiceType = null; + + public Type getMixedRepeatingChoice() + { + // TODO - kdk - verify how to generate quoteType...mixedRepeatingChoiceType? + return mixedRepeatingChoiceType; + } + /** + * + * + * @generated + */ + public RepeatingChoice createRepeatingChoice() + { + RepeatingChoiceImpl repeatingChoice = new RepeatingChoiceImpl(); + return repeatingChoice; + } + + // Following creates and initializes SDO metadata for the supported types. + protected Type repeatingChoiceType = null; + + public Type getRepeatingChoice() + { + // TODO - kdk - verify how to generate quoteType...repeatingChoiceType? + return repeatingChoiceType; + } + /** + * + * + * @generated + */ + public TwoRCs createTwoRCs() + { + TwoRCsImpl twoRCs = new TwoRCsImpl(); + return twoRCs; + } + + // Following creates and initializes SDO metadata for the supported types. + protected Type twoRCsType = null; + + public Type getTwoRCs() + { + // TODO - kdk - verify how to generate quoteType...twoRCsType? + return twoRCsType; + } + /** + * + * + * @generated + */ + public TwoRCsMixed createTwoRCsMixed() + { + TwoRCsMixedImpl twoRCsMixed = new TwoRCsMixedImpl(); + return twoRCsMixed; + } + + // Following creates and initializes SDO metadata for the supported types. + protected Type twoRCsMixedType = null; + + public Type getTwoRCsMixed() + { + // TODO - kdk - verify how to generate quoteType...twoRCsMixedType? + return twoRCsMixedType; + } + + private static boolean isInited = false; + + public static SequencesFactoryImpl init() + { + if (isInited) return (SequencesFactoryImpl)FactoryBase.getStaticFactory(SequencesFactoryImpl.NAMESPACE_URI); + SequencesFactoryImpl theSequencesFactoryImpl = new SequencesFactoryImpl(); + isInited = true; + + // Initialize simple dependencies + SDOUtil.registerStaticTypes(SDOFactoryImpl.class); + SDOUtil.registerStaticTypes(ModelPackageImpl.class); + + // Create package meta-data objects + theSequencesFactoryImpl.createMetaData(); + + // Initialize created meta-data + theSequencesFactoryImpl.initializeMetaData(); + + // Mark meta-data to indicate it can't be changed + //theSequencesFactoryImpl.freeze(); //FB do we need to freeze / should we freeze ???? + + return theSequencesFactoryImpl; + } + + private boolean isCreated = false; + + public void createMetaData() + { + if (isCreated) return; + isCreated = true; + + + mixedQuoteType = createType(false, MIXED_QUOTE); + createProperty(true, mixedQuoteType, MixedQuoteImpl.MIXED); + createProperty(true, mixedQuoteType, MixedQuoteImpl.SYMBOL); + createProperty(true, mixedQuoteType, MixedQuoteImpl.COMPANY_NAME); + createProperty(true, mixedQuoteType, MixedQuoteImpl.PRICE); + createProperty(true, mixedQuoteType, MixedQuoteImpl.OPEN1); + createProperty(true, mixedQuoteType, MixedQuoteImpl.HIGH); + createProperty(true, mixedQuoteType, MixedQuoteImpl.LOW); + createProperty(true, mixedQuoteType, MixedQuoteImpl.VOLUME); + createProperty(true, mixedQuoteType, MixedQuoteImpl.CHANGE1); + createProperty(false, mixedQuoteType, MixedQuoteImpl.QUOTES); + + mixedRepeatingChoiceType = createType(false, MIXED_REPEATING_CHOICE); + createProperty(true, mixedRepeatingChoiceType, MixedRepeatingChoiceImpl.MIXED); + createProperty(true, mixedRepeatingChoiceType, MixedRepeatingChoiceImpl.GROUP); + createProperty(true, mixedRepeatingChoiceType, MixedRepeatingChoiceImpl.A); + createProperty(true, mixedRepeatingChoiceType, MixedRepeatingChoiceImpl.B); + + repeatingChoiceType = createType(false, REPEATING_CHOICE); + createProperty(true, repeatingChoiceType, RepeatingChoiceImpl.GROUP); + createProperty(true, repeatingChoiceType, RepeatingChoiceImpl.A); + createProperty(true, repeatingChoiceType, RepeatingChoiceImpl.B); + + twoRCsType = createType(false, TWO_RCS); + createProperty(true, twoRCsType, TwoRCsImpl.GROUP); + createProperty(true, twoRCsType, TwoRCsImpl.A); + createProperty(true, twoRCsType, TwoRCsImpl.B); + createProperty(true, twoRCsType, TwoRCsImpl.SPLIT); + createProperty(true, twoRCsType, TwoRCsImpl.GROUP1); + createProperty(true, twoRCsType, TwoRCsImpl.Y); + createProperty(true, twoRCsType, TwoRCsImpl.Z); + + twoRCsMixedType = createType(false, TWO_RCS_MIXED); + createProperty(true, twoRCsMixedType, TwoRCsMixedImpl.MIXED); + createProperty(true, twoRCsMixedType, TwoRCsMixedImpl.GROUP); + createProperty(true, twoRCsMixedType, TwoRCsMixedImpl.A); + createProperty(true, twoRCsMixedType, TwoRCsMixedImpl.B); + createProperty(true, twoRCsMixedType, TwoRCsMixedImpl.SPLIT); + createProperty(true, twoRCsMixedType, TwoRCsMixedImpl.GROUP1); + createProperty(true, twoRCsMixedType, TwoRCsMixedImpl.Y); + createProperty(true, twoRCsMixedType, TwoRCsMixedImpl.Z); + } + private boolean isInitialized = false; + + public void initializeMetaData() + { + if (isInitialized) return; + isInitialized = true; + + // Obtain other dependent packages + ModelFactoryImpl theModelPackageImpl = (ModelFactoryImpl)FactoryBase.getStaticFactory(ModelFactoryImpl.NAMESPACE_URI); + + // Add supertypes to classes + // Initialize classes and features; add operations and parameters + + initializeType(mixedQuoteType, MixedQuote.class, "MixedQuote"); + initializeProperty((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.MIXED), getSequence(), "mixed", null, 0, -1, MixedQuote.class, false, false, false); + initializeProperty((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.SYMBOL), theModelPackageImpl.getString(), "symbol", null, 1, 1, MixedQuote.class, false, false, true); + initializeProperty((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.COMPANY_NAME), theModelPackageImpl.getString(), "companyName", null, 1, 1, MixedQuote.class, false, false, true); + initializeProperty((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.PRICE), theModelPackageImpl.getDecimal(), "price", null, 1, 1, MixedQuote.class, false, false, true); + initializeProperty((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.OPEN1), theModelPackageImpl.getDecimal(), "open1", null, 1, 1, MixedQuote.class, false, false, true); + initializeProperty((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.HIGH), theModelPackageImpl.getDecimal(), "high", null, 1, 1, MixedQuote.class, false, false, true); + initializeProperty((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.LOW), theModelPackageImpl.getDecimal(), "low", null, 1, 1, MixedQuote.class, false, false, true); + initializeProperty((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.VOLUME), theModelPackageImpl.getDouble(), "volume", null, 1, 1, MixedQuote.class, false, true, true); + initializeProperty((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.CHANGE1), theModelPackageImpl.getDouble(), "change1", null, 1, 1, MixedQuote.class, false, true, true); + initializeProperty((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.QUOTES), this.getMixedQuote(), "quotes", null, 0, -1, MixedQuote.class, false, false, true, true , null); + + initializeType(mixedRepeatingChoiceType, MixedRepeatingChoice.class, "MixedRepeatingChoice"); + initializeProperty((Property)mixedRepeatingChoiceType.getProperties().get(MixedRepeatingChoiceImpl.MIXED), getSequence(), "mixed", null, 0, -1, MixedRepeatingChoice.class, false, false, false); + initializeProperty((Property)mixedRepeatingChoiceType.getProperties().get(MixedRepeatingChoiceImpl.GROUP), getSequence(), "group", null, 0, -1, MixedRepeatingChoice.class, false, false, true); + initializeProperty((Property)mixedRepeatingChoiceType.getProperties().get(MixedRepeatingChoiceImpl.A), theModelPackageImpl.getString(), "a", null, 0, -1, MixedRepeatingChoice.class, false, false, true); + initializeProperty((Property)mixedRepeatingChoiceType.getProperties().get(MixedRepeatingChoiceImpl.B), theModelPackageImpl.getInt(), "b", null, 0, -1, MixedRepeatingChoice.class, false, false, true); + + initializeType(repeatingChoiceType, RepeatingChoice.class, "RepeatingChoice"); + initializeProperty((Property)repeatingChoiceType.getProperties().get(RepeatingChoiceImpl.GROUP), getSequence(), "group", null, 0, -1, RepeatingChoice.class, false, false, false); + initializeProperty((Property)repeatingChoiceType.getProperties().get(RepeatingChoiceImpl.A), theModelPackageImpl.getString(), "a", null, 0, -1, RepeatingChoice.class, false, false, true); + initializeProperty((Property)repeatingChoiceType.getProperties().get(RepeatingChoiceImpl.B), theModelPackageImpl.getInt(), "b", null, 0, -1, RepeatingChoice.class, false, false, true); + + initializeType(twoRCsType, TwoRCs.class, "TwoRCs"); + initializeProperty((Property)twoRCsType.getProperties().get(TwoRCsImpl.GROUP), getSequence(), "group", null, 0, -1, TwoRCs.class, false, false, false); + initializeProperty((Property)twoRCsType.getProperties().get(TwoRCsImpl.A), theModelPackageImpl.getString(), "a", null, 0, -1, TwoRCs.class, false, false, true); + initializeProperty((Property)twoRCsType.getProperties().get(TwoRCsImpl.B), theModelPackageImpl.getInt(), "b", null, 0, -1, TwoRCs.class, false, false, true); + initializeProperty((Property)twoRCsType.getProperties().get(TwoRCsImpl.SPLIT), theModelPackageImpl.getString(), "split", null, 1, 1, TwoRCs.class, false, false, false); + initializeProperty((Property)twoRCsType.getProperties().get(TwoRCsImpl.GROUP1), getSequence(), "group1", null, 0, -1, TwoRCs.class, false, false, false); + initializeProperty((Property)twoRCsType.getProperties().get(TwoRCsImpl.Y), theModelPackageImpl.getString(), "y", null, 0, -1, TwoRCs.class, false, false, true); + initializeProperty((Property)twoRCsType.getProperties().get(TwoRCsImpl.Z), theModelPackageImpl.getInt(), "z", null, 0, -1, TwoRCs.class, false, false, true); + + initializeType(twoRCsMixedType, TwoRCsMixed.class, "TwoRCsMixed"); + initializeProperty((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.MIXED), getSequence(), "mixed", null, 0, -1, TwoRCsMixed.class, false, false, false); + initializeProperty((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.GROUP), getSequence(), "group", null, 0, -1, TwoRCsMixed.class, false, false, true); + initializeProperty((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.A), theModelPackageImpl.getString(), "a", null, 0, -1, TwoRCsMixed.class, false, false, true); + initializeProperty((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.B), theModelPackageImpl.getInt(), "b", null, 0, -1, TwoRCsMixed.class, false, false, true); + initializeProperty((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.SPLIT), theModelPackageImpl.getString(), "split", null, 1, 1, TwoRCsMixed.class, false, false, true); + initializeProperty((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.GROUP1), getSequence(), "group1", null, 0, -1, TwoRCsMixed.class, false, false, true); + initializeProperty((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.Y), theModelPackageImpl.getString(), "y", null, 0, -1, TwoRCsMixed.class, false, false, true); + initializeProperty((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.Z), theModelPackageImpl.getInt(), "z", null, 0, -1, TwoRCsMixed.class, false, false, true);createXSDMetaData(); + } + + protected void createXSDMetaData() + { + super.createXSDMetaData(); + // TODO - kdk - is the order right? should kind, elementOnly be first + addXSDMapping + (mixedQuoteType, + new String[] + { + "name", "MixedQuote", + "kind", "elementOnly" + }); + addXSDMapping + ((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.MIXED), + new String[] + { + "kind", "element", + "name", "mixed" + }); + + addXSDMapping + ((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.SYMBOL), + new String[] + { + "kind", "element", + "name", "symbol" + }); + + addXSDMapping + ((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.COMPANY_NAME), + new String[] + { + "kind", "element", + "name", "companyName" + }); + + addXSDMapping + ((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.PRICE), + new String[] + { + "kind", "element", + "name", "price" + }); + + addXSDMapping + ((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.OPEN1), + new String[] + { + "kind", "element", + "name", "open1" + }); + + addXSDMapping + ((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.HIGH), + new String[] + { + "kind", "element", + "name", "high" + }); + + addXSDMapping + ((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.LOW), + new String[] + { + "kind", "element", + "name", "low" + }); + + addXSDMapping + ((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.VOLUME), + new String[] + { + "kind", "element", + "name", "volume" + }); + + addXSDMapping + ((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.CHANGE1), + new String[] + { + "kind", "element", + "name", "change1" + }); + + addXSDMapping + ((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.QUOTES), + new String[] + { + "kind", "element", + "name", "quotes" + }); + + // TODO - kdk - is the order right? should kind, elementOnly be first + addXSDMapping + (mixedRepeatingChoiceType, + new String[] + { + "name", "MixedRepeatingChoice", + "kind", "elementOnly" + }); + addXSDMapping + ((Property)mixedRepeatingChoiceType.getProperties().get(MixedRepeatingChoiceImpl.MIXED), + new String[] + { + "kind", "element", + "name", "mixed" + }); + + addXSDMapping + ((Property)mixedRepeatingChoiceType.getProperties().get(MixedRepeatingChoiceImpl.GROUP), + new String[] + { + "kind", "element", + "name", "group" + }); + + addXSDMapping + ((Property)mixedRepeatingChoiceType.getProperties().get(MixedRepeatingChoiceImpl.A), + new String[] + { + "kind", "element", + "name", "a" + }); + + addXSDMapping + ((Property)mixedRepeatingChoiceType.getProperties().get(MixedRepeatingChoiceImpl.B), + new String[] + { + "kind", "element", + "name", "b" + }); + + // TODO - kdk - is the order right? should kind, elementOnly be first + addXSDMapping + (repeatingChoiceType, + new String[] + { + "name", "RepeatingChoice", + "kind", "elementOnly" + }); + addXSDMapping + ((Property)repeatingChoiceType.getProperties().get(RepeatingChoiceImpl.GROUP), + new String[] + { + "kind", "element", + "name", "group" + }); + + addXSDMapping + ((Property)repeatingChoiceType.getProperties().get(RepeatingChoiceImpl.A), + new String[] + { + "kind", "element", + "name", "a" + }); + + addXSDMapping + ((Property)repeatingChoiceType.getProperties().get(RepeatingChoiceImpl.B), + new String[] + { + "kind", "element", + "name", "b" + }); + + // TODO - kdk - is the order right? should kind, elementOnly be first + addXSDMapping + (twoRCsType, + new String[] + { + "name", "TwoRCs", + "kind", "elementOnly" + }); + addXSDMapping + ((Property)twoRCsType.getProperties().get(TwoRCsImpl.GROUP), + new String[] + { + "kind", "element", + "name", "group" + }); + + addXSDMapping + ((Property)twoRCsType.getProperties().get(TwoRCsImpl.A), + new String[] + { + "kind", "element", + "name", "a" + }); + + addXSDMapping + ((Property)twoRCsType.getProperties().get(TwoRCsImpl.B), + new String[] + { + "kind", "element", + "name", "b" + }); + + addXSDMapping + ((Property)twoRCsType.getProperties().get(TwoRCsImpl.SPLIT), + new String[] + { + "kind", "element", + "name", "split" + }); + + addXSDMapping + ((Property)twoRCsType.getProperties().get(TwoRCsImpl.GROUP1), + new String[] + { + "kind", "element", + "name", "group1" + }); + + addXSDMapping + ((Property)twoRCsType.getProperties().get(TwoRCsImpl.Y), + new String[] + { + "kind", "element", + "name", "y" + }); + + addXSDMapping + ((Property)twoRCsType.getProperties().get(TwoRCsImpl.Z), + new String[] + { + "kind", "element", + "name", "z" + }); + + // TODO - kdk - is the order right? should kind, elementOnly be first + addXSDMapping + (twoRCsMixedType, + new String[] + { + "name", "TwoRCsMixed", + "kind", "elementOnly" + }); + addXSDMapping + ((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.MIXED), + new String[] + { + "kind", "element", + "name", "mixed" + }); + + addXSDMapping + ((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.GROUP), + new String[] + { + "kind", "element", + "name", "group" + }); + + addXSDMapping + ((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.A), + new String[] + { + "kind", "element", + "name", "a" + }); + + addXSDMapping + ((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.B), + new String[] + { + "kind", "element", + "name", "b" + }); + + addXSDMapping + ((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.SPLIT), + new String[] + { + "kind", "element", + "name", "split" + }); + + addXSDMapping + ((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.GROUP1), + new String[] + { + "kind", "element", + "name", "group1" + }); + + addXSDMapping + ((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.Y), + new String[] + { + "kind", "element", + "name", "y" + }); + + addXSDMapping + ((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.Z), + new String[] + { + "kind", "element", + "name", "z" + }); + + + // TODO - kdk - how do I filter out mixed, xMLNSPrefixMap, and xSISchemaLocation without hardcoding it + // TODO - kdk - can I hardcode ##targetNamespace? + + createGlobalProperty + ("mixedStockQuote", + this.getMixedQuote(), + new String[] + { + "kind", "element", + "name", "mixedStockQuote", + "namespace", "##targetNamespace" + }); + + createGlobalProperty + ("mrc", + this.getMixedRepeatingChoice(), + new String[] + { + "kind", "element", + "name", "mrc", + "namespace", "##targetNamespace" + }); + + createGlobalProperty + ("mrc2", + this.getTwoRCsMixed(), + new String[] + { + "kind", "element", + "name", "mrc2", + "namespace", "##targetNamespace" + }); + + createGlobalProperty + ("rc", + this.getRepeatingChoice(), + new String[] + { + "kind", "element", + "name", "rc", + "namespace", "##targetNamespace" + }); + + createGlobalProperty + ("rc2", + this.getTwoRCs(), + new String[] + { + "kind", "element", + "name", "rc2", + "namespace", "##targetNamespace" + }); + + } + +} //SequencesFactoryImpl diff --git a/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/impl/TwoRCsImpl.java b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/impl/TwoRCsImpl.java new file mode 100644 index 0000000000..c29eae934d --- /dev/null +++ b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/impl/TwoRCsImpl.java @@ -0,0 +1,449 @@ +/** + * + * Copyright 2005 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.example.sequences.impl; + +import com.example.sequences.TwoRCs; + +import commonj.sdo.Sequence; +import commonj.sdo.Type; + +import commonj.sdo.helper.TypeHelper; + +import java.util.Collection; +import java.util.List; + +import org.apache.tuscany.sdo.impl.DataObjectBase; + +import org.apache.tuscany.sdo.util.BasicSequence; + +/** + * + * An implementation of the model object 'Two RCs'. + * + *

+ * The following features are implemented: + *

+ *

+ * + * @generated + */ +public class TwoRCsImpl extends DataObjectBase implements TwoRCs +{ + /** + * The feature id for the 'Group' attribute list. + * + * + * @generated + * @ordered + */ + public final static int GROUP = 0; + + /** + * The cached value of the '{@link #getGroup() Group}' attribute list. + * + * + * @see #getGroup() + * @generated + * @ordered + */ + + // How to get BasicSequence from Sequence? + + protected BasicSequence group = null; + + /** + * The feature id for the 'A' attribute list. + * + * + * @generated + * @ordered + */ + public final static int A = 1; + + /** + * The feature id for the 'B' attribute list. + * + * + * @generated + * @ordered + */ + public final static int B = 2; + + /** + * The feature id for the 'Split' attribute. + * + * + * @generated + * @ordered + */ + public final static int SPLIT = 3; + + /** + * The default value of the '{@link #getSplit() Split}' attribute. + * + * + * @see #getSplit() + * @generated + * @ordered + */ + protected static final String SPLIT_DEFAULT_ = null; + + /** + * The cached value of the '{@link #getSplit() Split}' attribute. + * + * + * @see #getSplit() + * @generated + * @ordered + */ + protected String split = SPLIT_DEFAULT_; + + /** + * The feature id for the 'Group1' attribute list. + * + * + * @generated + * @ordered + */ + public final static int GROUP1 = 4; + + /** + * The cached value of the '{@link #getGroup1() Group1}' attribute list. + * + * + * @see #getGroup1() + * @generated + * @ordered + */ + + // How to get BasicSequence from Sequence? + + protected BasicSequence group1 = null; + + /** + * The feature id for the 'Y' attribute list. + * + * + * @generated + * @ordered + */ + public final static int Y = 5; + + /** + * The feature id for the 'Z' attribute list. + * + * + * @generated + * @ordered + */ + public final static int Z = 6; + + /** + * + * + * @generated + */ + protected TwoRCsImpl() + { + super(); + } + + /** + * + * + * @generated + */ + public Type getType() + { + return TypeHelper.INSTANCE.getType(TwoRCs.class); //TBD Generate a more efficient implementation + } + + /** + * + * + * @generated + */ + public Sequence getGroup() + { + if (group == null) + { + group = createSequence(GROUP); + + } + return group; + } + + /** + * + * + * @generated + */ + public List getA() + { + return getList(getGroup(), getType(), A); + + } + + /** + * + * + * @generated + */ + public List getB() + { + return getList(getGroup(), getType(), B); + + } + + /** + * + * + * @generated + */ + public String getSplit() + { + return split; + } + + /** + * + * + * @generated + */ + public void setSplit(String newSplit) + { + String oldSplit = split; + split = newSplit; + if (isNotifying()) + notify(ChangeKind.SET, SPLIT, oldSplit, split); + } + + /** + * + * + * @generated + */ + public Sequence getGroup1() + { + if (group1 == null) + { + group1 = createSequence(GROUP1); + + } + return group1; + } + + /** + * + * + * @generated + */ + public List getY() + { + return getList(getGroup1(), getType(), Y); + + } + + /** + * + * + * @generated + */ + public List getZ() + { + return getList(getGroup1(), getType(), Z); + + } + + /** + * + * + * @generated + */ + public ChangeContext inverseRemove(Object otherEnd, int propertyIndex, ChangeContext changeContext) + { + switch (propertyIndex) + { + case GROUP: + return removeFromSequence(getGroup(), otherEnd, changeContext); + case GROUP1: + return removeFromSequence(getGroup1(), otherEnd, changeContext); + } + return super.inverseRemove(otherEnd, propertyIndex, changeContext); + } + + /** + * + * + * @generated + */ + public Object get(int propertyIndex, boolean resolve) + { + switch (propertyIndex) + { + case GROUP: + // XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view + //if (coreType) + return getGroup(); + case A: + return getA(); + case B: + return getB(); + case SPLIT: + return getSplit(); + case GROUP1: + // XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view + //if (coreType) + return getGroup1(); + case Y: + return getY(); + case Z: + return getZ(); + } + return super.get(propertyIndex, resolve); + } + + /** + * + * + * @generated + */ + public void set(int propertyIndex, Object newValue) + { + switch (propertyIndex) + { + case GROUP: + setSequence(getGroup(), newValue); + return; + case A: + getA().clear(); + getA().addAll((Collection)newValue); + return; + case B: + getB().clear(); + getB().addAll((Collection)newValue); + return; + case SPLIT: + setSplit((String)newValue); + return; + case GROUP1: + setSequence(getGroup1(), newValue); + return; + case Y: + getY().clear(); + getY().addAll((Collection)newValue); + return; + case Z: + getZ().clear(); + getZ().addAll((Collection)newValue); + return; + } + super.set(propertyIndex, newValue); + } + + /** + * + * + * @generated + */ + public void unset(int propertyIndex) + { + switch (propertyIndex) + { + case GROUP: + unsetSequence(getGroup()); + return; + case A: + getA().clear(); + return; + case B: + getB().clear(); + return; + case SPLIT: + setSplit(SPLIT_DEFAULT_); + return; + case GROUP1: + unsetSequence(getGroup1()); + return; + case Y: + getY().clear(); + return; + case Z: + getZ().clear(); + return; + } + super.unset(propertyIndex); + } + + /** + * + * + * @generated + */ + public boolean isSet(int propertyIndex) + { + switch (propertyIndex) + { + case GROUP: + // KDK - should this be !isSequenceEmpty? + return group != null && !isSequenceEmpty(getGroup()); + case A: + return !getA().isEmpty(); + case B: + return !getB().isEmpty(); + case SPLIT: + return SPLIT_DEFAULT_ == null ? split != null : !SPLIT_DEFAULT_.equals(split); + case GROUP1: + // KDK - should this be !isSequenceEmpty? + return group1 != null && !isSequenceEmpty(getGroup1()); + case Y: + return !getY().isEmpty(); + case Z: + return !getZ().isEmpty(); + } + return super.isSet(propertyIndex); + } + + /** + * + * + * @generated + */ + public String toString() + { + if (isProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (group: "); + result.append(group); + result.append(", split: "); + result.append(split); + result.append(", group1: "); + result.append(group1); + result.append(')'); + return result.toString(); + } + +} //TwoRCsImpl diff --git a/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/impl/TwoRCsMixedImpl.java b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/impl/TwoRCsMixedImpl.java new file mode 100644 index 0000000000..a8c3186088 --- /dev/null +++ b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/sequences/impl/TwoRCsMixedImpl.java @@ -0,0 +1,447 @@ +/** + * + * Copyright 2005 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.example.sequences.impl; + +import com.example.sequences.TwoRCsMixed; + +import commonj.sdo.Sequence; +import commonj.sdo.Type; + +import commonj.sdo.helper.TypeHelper; + +import java.util.Collection; +import java.util.List; + +import org.apache.tuscany.sdo.impl.DataObjectBase; + +import org.apache.tuscany.sdo.util.BasicSequence; + +/** + * + * An implementation of the model object 'Two RCs Mixed'. + * + *

+ * The following features are implemented: + *

+ *

+ * + * @generated + */ +public class TwoRCsMixedImpl extends DataObjectBase implements TwoRCsMixed +{ + /** + * The feature id for the 'Mixed' attribute list. + * + * + * @generated + * @ordered + */ + public final static int MIXED = 0; + + /** + * The cached value of the '{@link #getMixed() Mixed}' attribute list. + * + * + * @see #getMixed() + * @generated + * @ordered + */ + + // How to get BasicSequence from Sequence? + + protected BasicSequence mixed = null; + + /** + * The feature id for the 'Group' attribute list. + * + * + * @generated + * @ordered + */ + public final static int GROUP = 1; + + /** + * The feature id for the 'A' attribute list. + * + * + * @generated + * @ordered + */ + public final static int A = 2; + + /** + * The feature id for the 'B' attribute list. + * + * + * @generated + * @ordered + */ + public final static int B = 3; + + /** + * The feature id for the 'Split' attribute. + * + * + * @generated + * @ordered + */ + public final static int SPLIT = 4; + + /** + * The default value of the '{@link #getSplit() Split}' attribute. + * + * + * @see #getSplit() + * @generated + * @ordered + */ + protected static final String SPLIT_DEFAULT_ = null; + + /** + * The feature id for the 'Group1' attribute list. + * + * + * @generated + * @ordered + */ + public final static int GROUP1 = 5; + + /** + * The feature id for the 'Y' attribute list. + * + * + * @generated + * @ordered + */ + public final static int Y = 6; + + /** + * The feature id for the 'Z' attribute list. + * + * + * @generated + * @ordered + */ + public final static int Z = 7; + + /** + * + * + * @generated + */ + protected TwoRCsMixedImpl() + { + super(); + } + + /** + * + * + * @generated + */ + public Type getType() + { + return TypeHelper.INSTANCE.getType(TwoRCsMixed.class); //TBD Generate a more efficient implementation + } + + /** + * + * + * @generated + */ + public Sequence getMixed() + { + if (mixed == null) + { + mixed = createSequence(MIXED); + + } + return mixed; + } + + /** + * + * + * @generated + */ + public Sequence getGroup() + { + return createSequence(getMixed(), getType(), GROUP); + } + + /** + * + * + * @generated + */ + public List getA() + { + return getList(getGroup(), getType(), A); + + } + + /** + * + * + * @generated + */ + public List getB() + { + return getList(getGroup(), getType(), B); + + } + + /** + * + * + * @generated + */ + public String getSplit() + { + return (String)get(getMixed(), getType(), SPLIT); + } + + /** + * + * + * @generated + */ + public void setSplit(String newSplit) + { + set(getMixed(), getType(), SPLIT, newSplit); + } + + /** + * + * + * @generated + */ + public Sequence getGroup1() + { + return createSequence(getMixed(), getType(), GROUP1); + } + + /** + * + * + * @generated + */ + public List getY() + { + return getList(getGroup1(), getType(), Y); + + } + + /** + * + * + * @generated + */ + public List getZ() + { + return getList(getGroup1(), getType(), Z); + + } + + /** + * + * + * @generated + */ + public ChangeContext inverseRemove(Object otherEnd, int propertyIndex, ChangeContext changeContext) + { + switch (propertyIndex) + { + case MIXED: + return removeFromSequence(getMixed(), otherEnd, changeContext); + case GROUP: + return removeFromSequence(getGroup(), otherEnd, changeContext); + case GROUP1: + return removeFromSequence(getGroup1(), otherEnd, changeContext); + } + return super.inverseRemove(otherEnd, propertyIndex, changeContext); + } + + /** + * + * + * @generated + */ + public Object get(int propertyIndex, boolean resolve) + { + switch (propertyIndex) + { + case MIXED: + // XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view + //if (coreType) + return getMixed(); + case GROUP: + // XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view + //if (coreType) + return getGroup(); + case A: + return getA(); + case B: + return getB(); + case SPLIT: + return getSplit(); + case GROUP1: + // XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view + //if (coreType) + return getGroup1(); + case Y: + return getY(); + case Z: + return getZ(); + } + return super.get(propertyIndex, resolve); + } + + /** + * + * + * @generated + */ + public void set(int propertyIndex, Object newValue) + { + switch (propertyIndex) + { + case MIXED: + setSequence(getMixed(), newValue); + return; + case GROUP: + setSequence(getGroup(), newValue); + return; + case A: + getA().clear(); + getA().addAll((Collection)newValue); + return; + case B: + getB().clear(); + getB().addAll((Collection)newValue); + return; + case SPLIT: + setSplit((String)newValue); + return; + case GROUP1: + setSequence(getGroup1(), newValue); + return; + case Y: + getY().clear(); + getY().addAll((Collection)newValue); + return; + case Z: + getZ().clear(); + getZ().addAll((Collection)newValue); + return; + } + super.set(propertyIndex, newValue); + } + + /** + * + * + * @generated + */ + public void unset(int propertyIndex) + { + switch (propertyIndex) + { + case MIXED: + unsetSequence(getMixed()); + return; + case GROUP: + unsetSequence(getGroup()); + return; + case A: + getA().clear(); + return; + case B: + getB().clear(); + return; + case SPLIT: + setSplit(SPLIT_DEFAULT_); + return; + case GROUP1: + unsetSequence(getGroup1()); + return; + case Y: + getY().clear(); + return; + case Z: + getZ().clear(); + return; + } + super.unset(propertyIndex); + } + + /** + * + * + * @generated + */ + public boolean isSet(int propertyIndex) + { + switch (propertyIndex) + { + case MIXED: + // KDK - should this be !isSequenceEmpty? + return mixed != null && !isSequenceEmpty(getMixed()); + case GROUP: + return !isSequenceEmpty(getGroup()); + case A: + return !getA().isEmpty(); + case B: + return !getB().isEmpty(); + case SPLIT: + return SPLIT_DEFAULT_ == null ? getSplit() != null : !SPLIT_DEFAULT_.equals(getSplit()); + case GROUP1: + return !isSequenceEmpty(getGroup1()); + case Y: + return !getY().isEmpty(); + case Z: + return !getZ().isEmpty(); + } + return super.isSet(propertyIndex); + } + + /** + * + * + * @generated + */ + public String toString() + { + if (isProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (mixed: "); + result.append(mixed); + result.append(')'); + return result.toString(); + } + +} //TwoRCsMixedImpl diff --git a/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/simple/Quote.java b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/simple/Quote.java new file mode 100644 index 0000000000..57b12ef331 --- /dev/null +++ b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/simple/Quote.java @@ -0,0 +1,307 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.example.simple; + +import java.math.BigDecimal; + +import java.util.List; + +/** + * + * A representation of the model object 'Quote'. + * + * + *

+ * The following features are supported: + *

+ *

+ * + * @generated + */ +public interface Quote +{ + /** + * Returns the value of the 'Symbol' attribute. + * + *

+ * If the meaning of the 'Symbol' attribute isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Symbol' attribute. + * @see #setSymbol(String) + * @generated + */ + String getSymbol(); + + /** + * Sets the value of the '{@link com.example.simple.Quote#getSymbol Symbol}' attribute. + * + * + * @param value the new value of the 'Symbol' attribute. + * @see #getSymbol() + * @generated + */ + void setSymbol(String value); + + /** + * Returns the value of the 'Company Name' attribute. + * + *

+ * If the meaning of the 'Company Name' attribute isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Company Name' attribute. + * @see #setCompanyName(String) + * @generated + */ + String getCompanyName(); + + /** + * Sets the value of the '{@link com.example.simple.Quote#getCompanyName Company Name}' attribute. + * + * + * @param value the new value of the 'Company Name' attribute. + * @see #getCompanyName() + * @generated + */ + void setCompanyName(String value); + + /** + * Returns the value of the 'Price' attribute. + * + *

+ * If the meaning of the 'Price' attribute isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Price' attribute. + * @see #setPrice(BigDecimal) + * @generated + */ + BigDecimal getPrice(); + + /** + * Sets the value of the '{@link com.example.simple.Quote#getPrice Price}' attribute. + * + * + * @param value the new value of the 'Price' attribute. + * @see #getPrice() + * @generated + */ + void setPrice(BigDecimal value); + + /** + * Returns the value of the 'Open1' attribute. + * + *

+ * If the meaning of the 'Open1' attribute isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Open1' attribute. + * @see #setOpen1(BigDecimal) + * @generated + */ + BigDecimal getOpen1(); + + /** + * Sets the value of the '{@link com.example.simple.Quote#getOpen1 Open1}' attribute. + * + * + * @param value the new value of the 'Open1' attribute. + * @see #getOpen1() + * @generated + */ + void setOpen1(BigDecimal value); + + /** + * Returns the value of the 'High' attribute. + * + *

+ * If the meaning of the 'High' attribute isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'High' attribute. + * @see #setHigh(BigDecimal) + * @generated + */ + BigDecimal getHigh(); + + /** + * Sets the value of the '{@link com.example.simple.Quote#getHigh High}' attribute. + * + * + * @param value the new value of the 'High' attribute. + * @see #getHigh() + * @generated + */ + void setHigh(BigDecimal value); + + /** + * Returns the value of the 'Low' attribute. + * + *

+ * If the meaning of the 'Low' attribute isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Low' attribute. + * @see #setLow(BigDecimal) + * @generated + */ + BigDecimal getLow(); + + /** + * Sets the value of the '{@link com.example.simple.Quote#getLow Low}' attribute. + * + * + * @param value the new value of the 'Low' attribute. + * @see #getLow() + * @generated + */ + void setLow(BigDecimal value); + + /** + * Returns the value of the 'Volume' attribute. + * + *

+ * If the meaning of the 'Volume' attribute isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Volume' attribute. + * @see #isSetVolume() + * @see #unsetVolume() + * @see #setVolume(double) + * @generated + */ + double getVolume(); + + /** + * Sets the value of the '{@link com.example.simple.Quote#getVolume Volume}' attribute. + * + * + * @param value the new value of the 'Volume' attribute. + * @see #isSetVolume() + * @see #unsetVolume() + * @see #getVolume() + * @generated + */ + void setVolume(double value); + + /** + * Unsets the value of the '{@link com.example.simple.Quote#getVolume Volume}' attribute. + * + * + * @see #isSetVolume() + * @see #getVolume() + * @see #setVolume(double) + * @generated + */ + void unsetVolume(); + + /** + * Returns whether the value of the '{@link com.example.simple.Quote#getVolume Volume}' attribute is set. + * + * + * @return whether the value of the 'Volume' attribute is set. + * @see #unsetVolume() + * @see #getVolume() + * @see #setVolume(double) + * @generated + */ + boolean isSetVolume(); + + /** + * Returns the value of the 'Change1' attribute. + * + *

+ * If the meaning of the 'Change1' attribute isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Change1' attribute. + * @see #isSetChange1() + * @see #unsetChange1() + * @see #setChange1(double) + * @generated + */ + double getChange1(); + + /** + * Sets the value of the '{@link com.example.simple.Quote#getChange1 Change1}' attribute. + * + * + * @param value the new value of the 'Change1' attribute. + * @see #isSetChange1() + * @see #unsetChange1() + * @see #getChange1() + * @generated + */ + void setChange1(double value); + + /** + * Unsets the value of the '{@link com.example.simple.Quote#getChange1 Change1}' attribute. + * + * + * @see #isSetChange1() + * @see #getChange1() + * @see #setChange1(double) + * @generated + */ + void unsetChange1(); + + /** + * Returns whether the value of the '{@link com.example.simple.Quote#getChange1 Change1}' attribute is set. + * + * + * @return whether the value of the 'Change1' attribute is set. + * @see #unsetChange1() + * @see #getChange1() + * @see #setChange1(double) + * @generated + */ + boolean isSetChange1(); + + /** + * Returns the value of the 'Quotes' containment reference list. + * The list contents are of type {@link com.example.simple.Quote}. + * + *

+ * If the meaning of the 'Quotes' containment reference list isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Quotes' containment reference list. + * @generated + */ + List getQuotes(); + +} // Quote diff --git a/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/simple/SimpleFactory.java b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/simple/SimpleFactory.java new file mode 100644 index 0000000000..9203976521 --- /dev/null +++ b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/simple/SimpleFactory.java @@ -0,0 +1,46 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.example.simple; + + +/** + * + * The Factory for the model. + * It provides a create method for each non-abstract class of the model. + * + * @generated + */ +public interface SimpleFactory +{ + /** + * The singleton instance of the factory. + * + * + * @generated + */ + SimpleFactory INSTANCE = com.example.simple.impl.SimpleFactoryImpl.eINSTANCE; + + /** + * Returns a new object of class 'Quote'. + * + * + * @return a new object of class 'Quote'. + * @generated + */ + Quote createQuote(); + +} //SimpleFactory diff --git a/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/simple/impl/QuoteImpl.java b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/simple/impl/QuoteImpl.java new file mode 100644 index 0000000000..5b407dd311 --- /dev/null +++ b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/simple/impl/QuoteImpl.java @@ -0,0 +1,712 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.example.simple.impl; + +import com.example.simple.Quote; + +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; + +/** + * + * An implementation of the model object 'Quote'. + * + *

+ * The following features are implemented: + *

+ *

+ * + * @generated + */ +public class QuoteImpl extends DataObjectImpl implements Quote +{ + /** + * The default value of the '{@link #getSymbol() Symbol}' attribute. + * + * + * @see #getSymbol() + * @generated + * @ordered + */ + protected static final String SYMBOL_EDEFAULT = null; + + /** + * The cached value of the '{@link #getSymbol() Symbol}' attribute. + * + * + * @see #getSymbol() + * @generated + * @ordered + */ + protected String symbol = SYMBOL_EDEFAULT; + + /** + * The default value of the '{@link #getCompanyName() Company Name}' attribute. + * + * + * @see #getCompanyName() + * @generated + * @ordered + */ + protected static final String COMPANY_NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getCompanyName() Company Name}' attribute. + * + * + * @see #getCompanyName() + * @generated + * @ordered + */ + protected String companyName = COMPANY_NAME_EDEFAULT; + + /** + * The default value of the '{@link #getPrice() Price}' attribute. + * + * + * @see #getPrice() + * @generated + * @ordered + */ + protected static final BigDecimal PRICE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getPrice() Price}' attribute. + * + * + * @see #getPrice() + * @generated + * @ordered + */ + protected BigDecimal price = PRICE_EDEFAULT; + + /** + * The default value of the '{@link #getOpen1() Open1}' attribute. + * + * + * @see #getOpen1() + * @generated + * @ordered + */ + protected static final BigDecimal OPEN1_EDEFAULT = null; + + /** + * The cached value of the '{@link #getOpen1() Open1}' attribute. + * + * + * @see #getOpen1() + * @generated + * @ordered + */ + protected BigDecimal open1 = OPEN1_EDEFAULT; + + /** + * The default value of the '{@link #getHigh() High}' attribute. + * + * + * @see #getHigh() + * @generated + * @ordered + */ + protected static final BigDecimal HIGH_EDEFAULT = null; + + /** + * The cached value of the '{@link #getHigh() High}' attribute. + * + * + * @see #getHigh() + * @generated + * @ordered + */ + protected BigDecimal high = HIGH_EDEFAULT; + + /** + * The default value of the '{@link #getLow() Low}' attribute. + * + * + * @see #getLow() + * @generated + * @ordered + */ + protected static final BigDecimal LOW_EDEFAULT = null; + + /** + * The cached value of the '{@link #getLow() Low}' attribute. + * + * + * @see #getLow() + * @generated + * @ordered + */ + protected BigDecimal low = LOW_EDEFAULT; + + /** + * The default value of the '{@link #getVolume() Volume}' attribute. + * + * + * @see #getVolume() + * @generated + * @ordered + */ + protected static final double VOLUME_EDEFAULT = 0.0; + + /** + * The cached value of the '{@link #getVolume() Volume}' attribute. + * + * + * @see #getVolume() + * @generated + * @ordered + */ + protected double volume = VOLUME_EDEFAULT; + + /** + * This is true if the Volume attribute has been set. + * + * + * @generated + * @ordered + */ + protected boolean volumeESet = false; + + /** + * The default value of the '{@link #getChange1() Change1}' attribute. + * + * + * @see #getChange1() + * @generated + * @ordered + */ + protected static final double CHANGE1_EDEFAULT = 0.0; + + /** + * The cached value of the '{@link #getChange1() Change1}' attribute. + * + * + * @see #getChange1() + * @generated + * @ordered + */ + protected double change1 = CHANGE1_EDEFAULT; + + /** + * This is true if the Change1 attribute has been set. + * + * + * @generated + * @ordered + */ + protected boolean change1ESet = false; + + /** + * The cached value of the '{@link #getQuotes() Quotes}' containment reference list. + * + * + * @see #getQuotes() + * @generated + * @ordered + */ + protected EList quotes = null; + + /** + * + * + * @generated + */ + protected QuoteImpl() + { + super(); + } + + /** + * + * + * @generated + */ + protected EClass eStaticClass() + { + return SimplePackageImpl.Literals.QUOTE; + } + + /** + * + * + * @generated + */ + public String getSymbol() + { + return symbol; + } + + /** + * + * + * @generated + */ + public void setSymbol(String newSymbol) + { + String oldSymbol = symbol; + symbol = newSymbol; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, SimplePackageImpl.QUOTE__SYMBOL, oldSymbol, symbol)); + } + + /** + * + * + * @generated + */ + public String getCompanyName() + { + return companyName; + } + + /** + * + * + * @generated + */ + public void setCompanyName(String newCompanyName) + { + String oldCompanyName = companyName; + companyName = newCompanyName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, SimplePackageImpl.QUOTE__COMPANY_NAME, oldCompanyName, companyName)); + } + + /** + * + * + * @generated + */ + public BigDecimal getPrice() + { + return price; + } + + /** + * + * + * @generated + */ + public void setPrice(BigDecimal newPrice) + { + BigDecimal oldPrice = price; + price = newPrice; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, SimplePackageImpl.QUOTE__PRICE, oldPrice, price)); + } + + /** + * + * + * @generated + */ + public BigDecimal getOpen1() + { + return open1; + } + + /** + * + * + * @generated + */ + public void setOpen1(BigDecimal newOpen1) + { + BigDecimal oldOpen1 = open1; + open1 = newOpen1; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, SimplePackageImpl.QUOTE__OPEN1, oldOpen1, open1)); + } + + /** + * + * + * @generated + */ + public BigDecimal getHigh() + { + return high; + } + + /** + * + * + * @generated + */ + public void setHigh(BigDecimal newHigh) + { + BigDecimal oldHigh = high; + high = newHigh; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, SimplePackageImpl.QUOTE__HIGH, oldHigh, high)); + } + + /** + * + * + * @generated + */ + public BigDecimal getLow() + { + return low; + } + + /** + * + * + * @generated + */ + public void setLow(BigDecimal newLow) + { + BigDecimal oldLow = low; + low = newLow; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, SimplePackageImpl.QUOTE__LOW, oldLow, low)); + } + + /** + * + * + * @generated + */ + public double getVolume() + { + return volume; + } + + /** + * + * + * @generated + */ + public void setVolume(double newVolume) + { + double oldVolume = volume; + volume = newVolume; + boolean oldVolumeESet = volumeESet; + volumeESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, SimplePackageImpl.QUOTE__VOLUME, oldVolume, volume, !oldVolumeESet)); + } + + /** + * + * + * @generated + */ + 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)); + } + + /** + * + * + * @generated + */ + public boolean isSetVolume() + { + return volumeESet; + } + + /** + * + * + * @generated + */ + public double getChange1() + { + return change1; + } + + /** + * + * + * @generated + */ + public void setChange1(double newChange1) + { + double oldChange1 = change1; + change1 = newChange1; + boolean oldChange1ESet = change1ESet; + change1ESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, SimplePackageImpl.QUOTE__CHANGE1, oldChange1, change1, !oldChange1ESet)); + } + + /** + * + * + * @generated + */ + 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)); + } + + /** + * + * + * @generated + */ + public boolean isSetChange1() + { + return change1ESet; + } + + /** + * + * + * @generated + */ + public List getQuotes() + { + if (quotes == null) + { + quotes = new EObjectContainmentEList(Quote.class, this, SimplePackageImpl.QUOTE__QUOTES); + } + return quotes; + } + + /** + * + * + * @generated + */ + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) + { + switch (featureID) + { + case SimplePackageImpl.QUOTE__QUOTES: + return ((InternalEList)getQuotes()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + public Object eGet(int featureID, boolean resolve, boolean coreType) + { + switch (featureID) + { + case SimplePackageImpl.QUOTE__SYMBOL: + return getSymbol(); + case SimplePackageImpl.QUOTE__COMPANY_NAME: + return getCompanyName(); + case SimplePackageImpl.QUOTE__PRICE: + return getPrice(); + case SimplePackageImpl.QUOTE__OPEN1: + return getOpen1(); + case SimplePackageImpl.QUOTE__HIGH: + return getHigh(); + case SimplePackageImpl.QUOTE__LOW: + return getLow(); + case SimplePackageImpl.QUOTE__VOLUME: + return new Double(getVolume()); + case SimplePackageImpl.QUOTE__CHANGE1: + return new Double(getChange1()); + case SimplePackageImpl.QUOTE__QUOTES: + return getQuotes(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + public void eSet(int featureID, Object newValue) + { + switch (featureID) + { + case SimplePackageImpl.QUOTE__SYMBOL: + setSymbol((String)newValue); + return; + case SimplePackageImpl.QUOTE__COMPANY_NAME: + setCompanyName((String)newValue); + return; + case SimplePackageImpl.QUOTE__PRICE: + setPrice((BigDecimal)newValue); + return; + case SimplePackageImpl.QUOTE__OPEN1: + setOpen1((BigDecimal)newValue); + return; + case SimplePackageImpl.QUOTE__HIGH: + setHigh((BigDecimal)newValue); + return; + case SimplePackageImpl.QUOTE__LOW: + setLow((BigDecimal)newValue); + return; + case SimplePackageImpl.QUOTE__VOLUME: + setVolume(((Double)newValue).doubleValue()); + return; + case SimplePackageImpl.QUOTE__CHANGE1: + setChange1(((Double)newValue).doubleValue()); + return; + case SimplePackageImpl.QUOTE__QUOTES: + getQuotes().clear(); + getQuotes().addAll((Collection)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + public void eUnset(int featureID) + { + switch (featureID) + { + case SimplePackageImpl.QUOTE__SYMBOL: + setSymbol(SYMBOL_EDEFAULT); + return; + case SimplePackageImpl.QUOTE__COMPANY_NAME: + setCompanyName(COMPANY_NAME_EDEFAULT); + return; + case SimplePackageImpl.QUOTE__PRICE: + setPrice(PRICE_EDEFAULT); + return; + case SimplePackageImpl.QUOTE__OPEN1: + setOpen1(OPEN1_EDEFAULT); + return; + case SimplePackageImpl.QUOTE__HIGH: + setHigh(HIGH_EDEFAULT); + return; + case SimplePackageImpl.QUOTE__LOW: + setLow(LOW_EDEFAULT); + return; + case SimplePackageImpl.QUOTE__VOLUME: + unsetVolume(); + return; + case SimplePackageImpl.QUOTE__CHANGE1: + unsetChange1(); + return; + case SimplePackageImpl.QUOTE__QUOTES: + getQuotes().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + public boolean eIsSet(int featureID) + { + switch (featureID) + { + 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: + return isSetVolume(); + case SimplePackageImpl.QUOTE__CHANGE1: + return isSetChange1(); + case SimplePackageImpl.QUOTE__QUOTES: + return quotes != null && !quotes.isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + public String toString() + { + if (eIsProxy()) 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 (volumeESet) result.append(volume); else result.append(""); + result.append(", change1: "); + if (change1ESet) result.append(change1); else result.append(""); + result.append(')'); + return result.toString(); + } + +} //QuoteImpl diff --git a/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/simple/impl/SimpleFactoryImpl.java b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/simple/impl/SimpleFactoryImpl.java new file mode 100644 index 0000000000..06b0e3891e --- /dev/null +++ b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/simple/impl/SimpleFactoryImpl.java @@ -0,0 +1,138 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.example.simple.impl; + +import com.example.simple.*; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.impl.EFactoryImpl; + +import org.eclipse.emf.ecore.plugin.EcorePlugin; + +/** + * + * An implementation of the model Factory. + * + * @generated + */ +public class SimpleFactoryImpl extends EFactoryImpl implements SimpleFactory +{ + /** + * The singleton instance of the factory. + * + * + * @generated + */ + public static final SimpleFactoryImpl eINSTANCE = init(); + + /** + * Creates the default factory implementation. + * + * + * @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(); + } + + /** + * Creates an instance of the factory. + * + * + * @generated + */ + public SimpleFactoryImpl() + { + super(); + } + + /** + * + * + * @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"); + } + } + + /** + * + * + * @generated + */ + public EObject createDocumentRoot() + { + EObject documentRoot = super.create(SimplePackageImpl.Literals.DOCUMENT_ROOT); + return documentRoot; + } + + /** + * + * + * @generated + */ + public Quote createQuote() + { + QuoteImpl quote = new QuoteImpl(); + return quote; + } + + /** + * + * + * @generated + */ + public SimplePackageImpl getSimplePackageImpl() + { + return (SimplePackageImpl)getEPackage(); + } + + /** + * + * + * @deprecated + * @generated + */ + public static SimplePackageImpl getPackage() + { + return SimplePackageImpl.eINSTANCE; + } + +} //SimpleFactoryImpl diff --git a/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/simple/impl/SimplePackageImpl.java b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/simple/impl/SimplePackageImpl.java new file mode 100644 index 0000000000..e8fe40c24d --- /dev/null +++ b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/com/example/simple/impl/SimplePackageImpl.java @@ -0,0 +1,908 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.example.simple.impl; + +import com.example.simple.Quote; +import com.example.simple.SimpleFactory; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EFactory; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; + +import org.eclipse.emf.ecore.impl.EPackageImpl; + +import org.eclipse.emf.ecore.xml.type.XMLTypePackage; + +/** + * + * The Package for the model. + * It contains accessors for the meta objects to represent + *
    + *
  • each class,
  • + *
  • each feature of each class,
  • + *
  • each enum,
  • + *
  • and each data type
  • + *
+ * + * @see com.example.simple.SimpleFactory + * @generated + */ +public class SimplePackageImpl extends EPackageImpl +{ + /** + * The package name. + * + * + * @generated + */ + public static final String eNAME = "simple"; + + /** + * The package namespace URI. + * + * + * @generated + */ + public static final String eNS_URI = "http://www.example.com/simple"; + + /** + * The package namespace name. + * + * + * @generated + */ + public static final String eNS_PREFIX = "simple"; + + /** + * The singleton instance of the package. + * + * + * @generated + */ + public static final SimplePackageImpl eINSTANCE = com.example.simple.impl.SimplePackageImpl.init(); + + /** + * The meta object id for the '{@link com.example.simple.impl.DocumentRootImpl Document Root}' class. + * + * + * @see com.example.simple.impl.DocumentRootImpl + * @see com.example.simple.impl.SimplePackageImpl#getDocumentRoot() + * @generated + */ + public static final int DOCUMENT_ROOT = 0; + + /** + * The feature id for the 'Mixed' attribute list. + * + * + * @generated + * @ordered + */ + public static final int DOCUMENT_ROOT__MIXED = 0; + + /** + * The feature id for the 'XMLNS Prefix Map' map. + * + * + * @generated + * @ordered + */ + public static final int DOCUMENT_ROOT__XMLNS_PREFIX_MAP = 1; + + /** + * The feature id for the 'XSI Schema Location' map. + * + * + * @generated + * @ordered + */ + public static final int DOCUMENT_ROOT__XSI_SCHEMA_LOCATION = 2; + + /** + * The feature id for the 'Stock Quote' containment reference. + * + * + * @generated + * @ordered + */ + public static final int DOCUMENT_ROOT__STOCK_QUOTE = 3; + + /** + * The number of structural features of the 'Document Root' class. + * + * + * @generated + * @ordered + */ + public static final int DOCUMENT_ROOT_FEATURE_COUNT = 4; + + /** + * The meta object id for the '{@link com.example.simple.impl.QuoteImpl Quote}' class. + * + * + * @see com.example.simple.impl.QuoteImpl + * @see com.example.simple.impl.SimplePackageImpl#getQuote() + * @generated + */ + public static final int QUOTE = 1; + + /** + * The feature id for the 'Symbol' attribute. + * + * + * @generated + * @ordered + */ + public static final int QUOTE__SYMBOL = 0; + + /** + * The feature id for the 'Company Name' attribute. + * + * + * @generated + * @ordered + */ + public static final int QUOTE__COMPANY_NAME = 1; + + /** + * The feature id for the 'Price' attribute. + * + * + * @generated + * @ordered + */ + public static final int QUOTE__PRICE = 2; + + /** + * The feature id for the 'Open1' attribute. + * + * + * @generated + * @ordered + */ + public static final int QUOTE__OPEN1 = 3; + + /** + * The feature id for the 'High' attribute. + * + * + * @generated + * @ordered + */ + public static final int QUOTE__HIGH = 4; + + /** + * The feature id for the 'Low' attribute. + * + * + * @generated + * @ordered + */ + public static final int QUOTE__LOW = 5; + + /** + * The feature id for the 'Volume' attribute. + * + * + * @generated + * @ordered + */ + public static final int QUOTE__VOLUME = 6; + + /** + * The feature id for the 'Change1' attribute. + * + * + * @generated + * @ordered + */ + public static final int QUOTE__CHANGE1 = 7; + + /** + * The feature id for the 'Quotes' containment reference list. + * + * + * @generated + * @ordered + */ + public static final int QUOTE__QUOTES = 8; + + /** + * The number of structural features of the 'Quote' class. + * + * + * @generated + * @ordered + */ + public static final int QUOTE_FEATURE_COUNT = 9; + + /** + * + * + * @generated + */ + private EClass documentRootEClass = null; + + /** + * + * + * @generated + */ + private EClass quoteEClass = null; + + /** + * Creates an instance of the model Package, registered with + * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package + * package URI value. + *

Note: the correct way to create the package is via the static + * factory method {@link #init init()}, which also performs + * initialization of the package, or returns the registered package, + * if one already exists. + * + * + * @see org.eclipse.emf.ecore.EPackage.Registry + * @see com.example.simple.impl.SimplePackageImpl#eNS_URI + * @see #init() + * @generated + */ + private SimplePackageImpl() + { + super(eNS_URI, ((EFactory)SimpleFactory.INSTANCE)); + } + + /** + * + * + * @generated + */ + private static boolean isInited = false; + + /** + * Creates, registers, and initializes the Package for this + * model, and for any others upon which it depends. Simple + * dependencies are satisfied by calling this method on all + * dependent packages before doing anything else. This method drives + * initialization for interdependent packages directly, in parallel + * with this package, itself. + *

Of this package and its interdependencies, all packages which + * have not yet been registered by their URI values are first created + * and registered. The packages are then initialized in two steps: + * meta-model objects for all of the packages are created before any + * are initialized, since one package's meta-model objects may refer to + * those of another. + *

Invocation of this method will not affect any packages that have + * already been initialized. + * + * + * @see #eNS_URI + * @see #createPackageContents() + * @see #initializePackageContents() + * @generated + */ + public static SimplePackageImpl init() + { + if (isInited) return (SimplePackageImpl)EPackage.Registry.INSTANCE.getEPackage(SimplePackageImpl.eNS_URI); + + // Obtain or create and register package + SimplePackageImpl theSimplePackageImpl = (SimplePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof SimplePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new SimplePackageImpl()); + + isInited = true; + + // Initialize simple dependencies + XMLTypePackage.eINSTANCE.eClass(); + + // Create package meta-data objects + theSimplePackageImpl.createPackageContents(); + + // Initialize created meta-data + theSimplePackageImpl.initializePackageContents(); + + // Mark meta-data to indicate it can't be changed + theSimplePackageImpl.freeze(); + + return theSimplePackageImpl; + } + + + /** + * Returns the meta object for class '{@link org.eclipse.emf.ecore.EObject Document Root}'. + * + * + * @return the meta object for class 'Document Root'. + * @see org.eclipse.emf.ecore.EObject + * @generated + */ + public EClass getDocumentRoot() + { + return documentRootEClass; + } + + /** + * Returns the meta object for the attribute list '{@link org.eclipse.emf.ecore.EObject#getMixed Mixed}'. + * + * + * @return the meta object for the attribute list 'Mixed'. + * @see org.eclipse.emf.ecore.EObject#getMixed() + * @see #getDocumentRoot() + * @generated + */ + public EAttribute getDocumentRoot_Mixed() + { + return (EAttribute)documentRootEClass.getEStructuralFeatures().get(0); + } + + /** + * Returns the meta object for the map '{@link org.eclipse.emf.ecore.EObject#getXMLNSPrefixMap XMLNS Prefix Map}'. + * + * + * @return the meta object for the map 'XMLNS Prefix Map'. + * @see org.eclipse.emf.ecore.EObject#getXMLNSPrefixMap() + * @see #getDocumentRoot() + * @generated + */ + public EReference getDocumentRoot_XMLNSPrefixMap() + { + return (EReference)documentRootEClass.getEStructuralFeatures().get(1); + } + + /** + * Returns the meta object for the map '{@link org.eclipse.emf.ecore.EObject#getXSISchemaLocation XSI Schema Location}'. + * + * + * @return the meta object for the map 'XSI Schema Location'. + * @see org.eclipse.emf.ecore.EObject#getXSISchemaLocation() + * @see #getDocumentRoot() + * @generated + */ + public EReference getDocumentRoot_XSISchemaLocation() + { + return (EReference)documentRootEClass.getEStructuralFeatures().get(2); + } + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.emf.ecore.EObject#getStockQuote Stock Quote}'. + * + * + * @return the meta object for the containment reference 'Stock Quote'. + * @see org.eclipse.emf.ecore.EObject#getStockQuote() + * @see #getDocumentRoot() + * @generated + */ + public EReference getDocumentRoot_StockQuote() + { + return (EReference)documentRootEClass.getEStructuralFeatures().get(3); + } + + /** + * Returns the meta object for class '{@link com.example.simple.Quote Quote}'. + * + * + * @return the meta object for class 'Quote'. + * @see com.example.simple.Quote + * @generated + */ + public EClass getQuote() + { + return quoteEClass; + } + + /** + * Returns the meta object for the attribute '{@link com.example.simple.Quote#getSymbol Symbol}'. + * + * + * @return the meta object for the attribute 'Symbol'. + * @see com.example.simple.Quote#getSymbol() + * @see #getQuote() + * @generated + */ + public EAttribute getQuote_Symbol() + { + return (EAttribute)quoteEClass.getEStructuralFeatures().get(0); + } + + /** + * Returns the meta object for the attribute '{@link com.example.simple.Quote#getCompanyName Company Name}'. + * + * + * @return the meta object for the attribute 'Company Name'. + * @see com.example.simple.Quote#getCompanyName() + * @see #getQuote() + * @generated + */ + public EAttribute getQuote_CompanyName() + { + return (EAttribute)quoteEClass.getEStructuralFeatures().get(1); + } + + /** + * Returns the meta object for the attribute '{@link com.example.simple.Quote#getPrice Price}'. + * + * + * @return the meta object for the attribute 'Price'. + * @see com.example.simple.Quote#getPrice() + * @see #getQuote() + * @generated + */ + public EAttribute getQuote_Price() + { + return (EAttribute)quoteEClass.getEStructuralFeatures().get(2); + } + + /** + * Returns the meta object for the attribute '{@link com.example.simple.Quote#getOpen1 Open1}'. + * + * + * @return the meta object for the attribute 'Open1'. + * @see com.example.simple.Quote#getOpen1() + * @see #getQuote() + * @generated + */ + public EAttribute getQuote_Open1() + { + return (EAttribute)quoteEClass.getEStructuralFeatures().get(3); + } + + /** + * Returns the meta object for the attribute '{@link com.example.simple.Quote#getHigh High}'. + * + * + * @return the meta object for the attribute 'High'. + * @see com.example.simple.Quote#getHigh() + * @see #getQuote() + * @generated + */ + public EAttribute getQuote_High() + { + return (EAttribute)quoteEClass.getEStructuralFeatures().get(4); + } + + /** + * Returns the meta object for the attribute '{@link com.example.simple.Quote#getLow Low}'. + * + * + * @return the meta object for the attribute 'Low'. + * @see com.example.simple.Quote#getLow() + * @see #getQuote() + * @generated + */ + public EAttribute getQuote_Low() + { + return (EAttribute)quoteEClass.getEStructuralFeatures().get(5); + } + + /** + * Returns the meta object for the attribute '{@link com.example.simple.Quote#getVolume Volume}'. + * + * + * @return the meta object for the attribute 'Volume'. + * @see com.example.simple.Quote#getVolume() + * @see #getQuote() + * @generated + */ + public EAttribute getQuote_Volume() + { + return (EAttribute)quoteEClass.getEStructuralFeatures().get(6); + } + + /** + * Returns the meta object for the attribute '{@link com.example.simple.Quote#getChange1 Change1}'. + * + * + * @return the meta object for the attribute 'Change1'. + * @see com.example.simple.Quote#getChange1() + * @see #getQuote() + * @generated + */ + public EAttribute getQuote_Change1() + { + return (EAttribute)quoteEClass.getEStructuralFeatures().get(7); + } + + /** + * Returns the meta object for the containment reference list '{@link com.example.simple.Quote#getQuotes Quotes}'. + * + * + * @return the meta object for the containment reference list 'Quotes'. + * @see com.example.simple.Quote#getQuotes() + * @see #getQuote() + * @generated + */ + public EReference getQuote_Quotes() + { + return (EReference)quoteEClass.getEStructuralFeatures().get(8); + } + + /** + * Returns the factory that creates the instances of the model. + * + * + * @return the factory that creates the instances of the model. + * @generated + */ + public SimpleFactory getSimpleFactory() + { + return (SimpleFactory)getEFactoryInstance(); + } + + /** + * + * + * @generated + */ + private boolean isCreated = false; + + /** + * Creates the meta-model objects for the package. This method is + * guarded to have no affect on any invocation but its first. + * + * + * @generated + */ + public void createPackageContents() + { + if (isCreated) return; + isCreated = true; + + // Create classes and their features + documentRootEClass = createEClass(DOCUMENT_ROOT); + createEAttribute(documentRootEClass, DOCUMENT_ROOT__MIXED); + createEReference(documentRootEClass, DOCUMENT_ROOT__XMLNS_PREFIX_MAP); + createEReference(documentRootEClass, DOCUMENT_ROOT__XSI_SCHEMA_LOCATION); + createEReference(documentRootEClass, DOCUMENT_ROOT__STOCK_QUOTE); + + quoteEClass = createEClass(QUOTE); + createEAttribute(quoteEClass, QUOTE__SYMBOL); + createEAttribute(quoteEClass, QUOTE__COMPANY_NAME); + createEAttribute(quoteEClass, QUOTE__PRICE); + createEAttribute(quoteEClass, QUOTE__OPEN1); + createEAttribute(quoteEClass, QUOTE__HIGH); + createEAttribute(quoteEClass, QUOTE__LOW); + createEAttribute(quoteEClass, QUOTE__VOLUME); + createEAttribute(quoteEClass, QUOTE__CHANGE1); + createEReference(quoteEClass, QUOTE__QUOTES); + } + + /** + * + * + * @generated + */ + private boolean isInitialized = false; + + /** + * Complete the initialization of the package and its meta-model. This + * method is guarded to have no affect on any invocation but its first. + * + * + * @generated + */ + public void initializePackageContents() + { + if (isInitialized) return; + isInitialized = true; + + // Initialize package + setName(eNAME); + setNsPrefix(eNS_PREFIX); + setNsURI(eNS_URI); + + // Obtain other dependent packages + XMLTypePackage theXMLTypePackage = (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI); + + // Add supertypes to classes + + // Initialize classes and features; add operations and parameters + initEClass(documentRootEClass, null, "DocumentRoot", !IS_ABSTRACT, !IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getDocumentRoot_Mixed(), ecorePackage.getEFeatureMapEntry(), "mixed", null, 0, -1, null, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_XMLNSPrefixMap(), ecorePackage.getEStringToStringMapEntry(), null, "xMLNSPrefixMap", null, 0, -1, null, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_XSISchemaLocation(), ecorePackage.getEStringToStringMapEntry(), null, "xSISchemaLocation", null, 0, -1, null, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getDocumentRoot_StockQuote(), this.getQuote(), null, "stockQuote", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + + initEClass(quoteEClass, Quote.class, "Quote", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getQuote_Symbol(), theXMLTypePackage.getString(), "symbol", null, 1, 1, Quote.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getQuote_CompanyName(), theXMLTypePackage.getString(), "companyName", null, 1, 1, Quote.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getQuote_Price(), theXMLTypePackage.getDecimal(), "price", null, 1, 1, Quote.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getQuote_Open1(), theXMLTypePackage.getDecimal(), "open1", null, 1, 1, Quote.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getQuote_High(), theXMLTypePackage.getDecimal(), "high", null, 1, 1, Quote.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getQuote_Low(), theXMLTypePackage.getDecimal(), "low", null, 1, 1, Quote.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getQuote_Volume(), theXMLTypePackage.getDouble(), "volume", null, 1, 1, Quote.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getQuote_Change1(), theXMLTypePackage.getDouble(), "change1", null, 1, 1, Quote.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getQuote_Quotes(), this.getQuote(), null, "quotes", null, 0, -1, Quote.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + // Create resource + createResource(eNS_URI); + + // Create annotations + // http:///org/eclipse/emf/ecore/util/ExtendedMetaData + createExtendedMetaDataAnnotations(); + } + + /** + * Initializes the annotations for http:///org/eclipse/emf/ecore/util/ExtendedMetaData. + * + * + * @generated + */ + protected void createExtendedMetaDataAnnotations() + { + String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData"; + addAnnotation + (documentRootEClass, + source, + new String[] + { + "name", "", + "kind", "mixed" + }); + addAnnotation + (getDocumentRoot_Mixed(), + source, + new String[] + { + "kind", "elementWildcard", + "name", ":mixed" + }); + addAnnotation + (getDocumentRoot_XMLNSPrefixMap(), + source, + new String[] + { + "kind", "attribute", + "name", "xmlns:prefix" + }); + addAnnotation + (getDocumentRoot_XSISchemaLocation(), + source, + new String[] + { + "kind", "attribute", + "name", "xsi:schemaLocation" + }); + addAnnotation + (getDocumentRoot_StockQuote(), + source, + new String[] + { + "kind", "element", + "name", "stockQuote", + "namespace", "##targetNamespace" + }); + addAnnotation + (quoteEClass, + source, + new String[] + { + "name", "Quote", + "kind", "elementOnly" + }); + addAnnotation + (getQuote_Symbol(), + source, + new String[] + { + "kind", "element", + "name", "symbol" + }); + addAnnotation + (getQuote_CompanyName(), + source, + new String[] + { + "kind", "element", + "name", "companyName" + }); + addAnnotation + (getQuote_Price(), + source, + new String[] + { + "kind", "element", + "name", "price" + }); + addAnnotation + (getQuote_Open1(), + source, + new String[] + { + "kind", "element", + "name", "open1" + }); + addAnnotation + (getQuote_High(), + source, + new String[] + { + "kind", "element", + "name", "high" + }); + addAnnotation + (getQuote_Low(), + source, + new String[] + { + "kind", "element", + "name", "low" + }); + addAnnotation + (getQuote_Volume(), + source, + new String[] + { + "kind", "element", + "name", "volume" + }); + addAnnotation + (getQuote_Change1(), + source, + new String[] + { + "kind", "element", + "name", "change1" + }); + addAnnotation + (getQuote_Quotes(), + source, + new String[] + { + "kind", "element", + "name", "quotes" + }); + } + + /** + * + * Defines literals for the meta objects that represent + *

    + *
  • each class,
  • + *
  • each feature of each class,
  • + *
  • each enum,
  • + *
  • and each data type
  • + *
+ * + * @generated + */ + public interface Literals + { + /** + * The meta object literal for the '{@link com.example.simple.impl.DocumentRootImpl Document Root}' class. + * + * + * @see com.example.simple.impl.DocumentRootImpl + * @see com.example.simple.impl.SimplePackageImpl#getDocumentRoot() + * @generated + */ + public static final EClass DOCUMENT_ROOT = eINSTANCE.getDocumentRoot(); + + /** + * The meta object literal for the 'Mixed' attribute list feature. + * + * + * @generated + */ + public static final EAttribute DOCUMENT_ROOT__MIXED = eINSTANCE.getDocumentRoot_Mixed(); + + /** + * The meta object literal for the 'XMLNS Prefix Map' map feature. + * + * + * @generated + */ + public static final EReference DOCUMENT_ROOT__XMLNS_PREFIX_MAP = eINSTANCE.getDocumentRoot_XMLNSPrefixMap(); + + /** + * The meta object literal for the 'XSI Schema Location' map feature. + * + * + * @generated + */ + public static final EReference DOCUMENT_ROOT__XSI_SCHEMA_LOCATION = eINSTANCE.getDocumentRoot_XSISchemaLocation(); + + /** + * The meta object literal for the 'Stock Quote' containment reference feature. + * + * + * @generated + */ + public static final EReference DOCUMENT_ROOT__STOCK_QUOTE = eINSTANCE.getDocumentRoot_StockQuote(); + + /** + * The meta object literal for the '{@link com.example.simple.impl.QuoteImpl Quote}' class. + * + * + * @see com.example.simple.impl.QuoteImpl + * @see com.example.simple.impl.SimplePackageImpl#getQuote() + * @generated + */ + public static final EClass QUOTE = eINSTANCE.getQuote(); + + /** + * The meta object literal for the 'Symbol' attribute feature. + * + * + * @generated + */ + public static final EAttribute QUOTE__SYMBOL = eINSTANCE.getQuote_Symbol(); + + /** + * The meta object literal for the 'Company Name' attribute feature. + * + * + * @generated + */ + public static final EAttribute QUOTE__COMPANY_NAME = eINSTANCE.getQuote_CompanyName(); + + /** + * The meta object literal for the 'Price' attribute feature. + * + * + * @generated + */ + public static final EAttribute QUOTE__PRICE = eINSTANCE.getQuote_Price(); + + /** + * The meta object literal for the 'Open1' attribute feature. + * + * + * @generated + */ + public static final EAttribute QUOTE__OPEN1 = eINSTANCE.getQuote_Open1(); + + /** + * The meta object literal for the 'High' attribute feature. + * + * + * @generated + */ + public static final EAttribute QUOTE__HIGH = eINSTANCE.getQuote_High(); + + /** + * The meta object literal for the 'Low' attribute feature. + * + * + * @generated + */ + public static final EAttribute QUOTE__LOW = eINSTANCE.getQuote_Low(); + + /** + * The meta object literal for the 'Volume' attribute feature. + * + * + * @generated + */ + public static final EAttribute QUOTE__VOLUME = eINSTANCE.getQuote_Volume(); + + /** + * The meta object literal for the 'Change1' attribute feature. + * + * + * @generated + */ + public static final EAttribute QUOTE__CHANGE1 = eINSTANCE.getQuote_Change1(); + + /** + * The meta object literal for the 'Quotes' containment reference list feature. + * + * + * @generated + */ + public static final EReference QUOTE__QUOTES = eINSTANCE.getQuote_Quotes(); + + } + +} //SimplePackageImpl diff --git a/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/SimpleStaticTest.java b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/SimpleStaticTest.java new file mode 100644 index 0000000000..520cf707e7 --- /dev/null +++ b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/SimpleStaticTest.java @@ -0,0 +1,64 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.tuscany.sdo.test; + +import java.math.BigDecimal; + +import org.apache.tuscany.sdo.util.SDOUtil; + +import com.example.simple.Quote; +import com.example.simple.SimpleFactory; +import commonj.sdo.DataObject; +import commonj.sdo.helper.XMLHelper; + + +public class SimpleStaticTest +{ + /** + * Simple Static SDO 2 test. + */ + public static void main(String[] args) + { + try + { + SDOUtil.registerStaticTypes(SimpleFactory.class); + + //Quote quote = (Quote)DataFactory.INSTANCE.create(Quote.class); + Quote quote = SimpleFactory.INSTANCE.createQuote(); + + quote.setSymbol("fbnt"); + quote.setCompanyName("FlyByNightTechnology"); + quote.setPrice(new BigDecimal("1000.0")); + quote.setOpen1(new BigDecimal("1000.0")); + quote.setHigh(new BigDecimal("1000.0")); + quote.setLow(new BigDecimal("1000.0")); + quote.setVolume(1000); + quote.setChange1(1000); + + //Quote child = (Quote)((DataObject)quote).createDataObject(8); + Quote child = SimpleFactory.INSTANCE.createQuote(); + quote.getQuotes().add(child); + child.setPrice(new BigDecimal("2000.0")); + + XMLHelper.INSTANCE.save((DataObject)quote, "http://www.example.com/simple", "stockQuote", System.out); + } + catch (Exception e) + { + e.printStackTrace(); + } + } +} diff --git a/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/StaticSequenceNoEmfTest.java b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/StaticSequenceNoEmfTest.java new file mode 100644 index 0000000000..ef6544bdb8 --- /dev/null +++ b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/StaticSequenceNoEmfTest.java @@ -0,0 +1,249 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.tuscany.sdo.test; + + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.List; + +import junit.framework.TestCase; + +import org.apache.tuscany.sdo.util.SDOUtil; + +import com.example.sequences.MixedQuote; +import com.example.sequences.MixedRepeatingChoice; +import com.example.sequences.RepeatingChoice; +import com.example.sequences.SequencesFactory; +import com.example.sequences.TwoRCs; +import com.example.sequences.TwoRCsMixed; +import commonj.sdo.DataObject; +import commonj.sdo.Sequence; +import commonj.sdo.Type; +import commonj.sdo.helper.XMLHelper; + + +public class StaticSequenceNoEmfTest extends TestCase { + private final String TEST_NAMESPACE = "http://www.example.com/sequences"; + private final String MQ_TEST_DATA = "/mixedStaticTestResult.xml"; + private final String RC_TEST_DATA = "/repeatingChoiceTestResult.xml"; + private final String MRC_TEST_DATA = "/mixedRepeatingChoiceTestResult.xml"; + private final String RC2_TEST_DATA = "/twoRepeatingChoicesTestResult.xml"; + private final String RC2M_TEST_DATA = "/twoRepeatingChoicesMixedTestResult.xml"; + + /** + * Sequenced type SDO 2 test. + */ + public void testMixedQuoteType() throws IOException { + MixedQuote quote = SequencesFactory.INSTANCE.createMixedQuote(); + + Type t = ((DataObject)quote).getType(); + List ps = t.getProperties(); + + + Sequence sequence = quote.getMixed(); + + sequence.add("\n "); + + quote.setSymbol("fbnt"); + + sequence.add("\n "); + + quote.setCompanyName("FlyByNightTechnology"); + + sequence.add("\n some text\n "); + + List quotes = quote.getQuotes(); + MixedQuote child = SequencesFactory.INSTANCE.createMixedQuote(); + quotes.add(child); + + child.setPrice(new BigDecimal("2000.0")); + + sequence.add("\n more text\n "); + + sequence.add("price", new BigDecimal("1000.0")); + + sequence.add("\n"); + + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + XMLHelper.INSTANCE.save((DataObject)quote, TEST_NAMESPACE, "mixedStockQuote", baos); + assertTrue(baos.toString(), TestUtil.equalXmlFiles(new ByteArrayInputStream(baos.toByteArray()), getClass().getResource(MQ_TEST_DATA))); + } + + public void testRepeatingChoice() throws IOException + { + RepeatingChoice rc = SequencesFactory.INSTANCE.createRepeatingChoice(); + + List as = rc.getA(); + List bs = rc.getB(); + + bs.add(new Integer(1)); + as.add("foo"); + as.add("bar"); + bs.add(new Integer(2)); + + + + + Sequence group = rc.getGroup(); + assertEquals(group.size(), 4); + assertEquals(rc.getA().size(), 2); + assertEquals(rc.getB().size(),2); + + assertEquals(group.getValue(0), new Integer(1)); + assertEquals(group.getValue(1), "foo"); + assertEquals(group.getValue(2), "bar"); + assertEquals(group.getValue(3), new Integer(2)); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + + XMLHelper.INSTANCE.save((DataObject)rc, TEST_NAMESPACE, "rc", baos); + assertTrue(baos.toString(), TestUtil.equalXmlFiles(new ByteArrayInputStream(baos.toByteArray()), getClass().getResource(RC_TEST_DATA))); + } + + public void testMixedRepeatingChoice() throws Exception { + MixedRepeatingChoice mrc = SequencesFactory.INSTANCE.createMixedRepeatingChoice(); + + List as = mrc.getA(); + List bs = mrc.getB(); + + + bs.add(new Integer(1)); + as.add("foo"); + Sequence mixed = mrc.getMixed(); + mixed.add("some mixed text"); + as.add("bar"); + bs.add(new Integer(2)); + + // FIXME reintroduce check + // assertEquals(4, mrc.getGroup().size()); + assertEquals(5, mrc.getMixed().size()); + assertEquals(2, mrc.getA().size()); + assertEquals(2, mrc.getB().size(),2); + + + + assertEquals(mixed.getValue(0), new Integer(1)); + assertEquals(mixed.getValue(1), "foo"); + assertEquals(mixed.getValue(3), "bar"); + assertEquals(mixed.getValue(4), new Integer(2)); + + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + + + XMLHelper.INSTANCE.save((DataObject)mrc, TEST_NAMESPACE, "mrc", baos); + assertTrue(baos.toString(), TestUtil.equalXmlFiles(new ByteArrayInputStream(baos.toByteArray()), getClass().getResource(MRC_TEST_DATA))); + } + + public void test2RepeatingChoices() throws Exception { + TwoRCs rc2 = SequencesFactory.INSTANCE.createTwoRCs(); + + List as = rc2.getA(); + List bs = rc2.getB(); + List ys = rc2.getY(); + List zs = rc2.getZ(); + + zs.add(new Integer(99)); + bs.add(new Integer(1)); + ys.add("fred"); + as.add("foo"); + as.add("bar"); + bs.add(new Integer(2)); + rc2.setSplit("banana"); + + + Sequence group = rc2.getGroup(); + assertEquals(group.size(), 4); + assertEquals(rc2.getA().size(), 2); + assertEquals(rc2.getB().size(),2); + + Sequence group1 = rc2.getGroup1(); + assertEquals(group1.size(), 2); + assertEquals(rc2.getY().size(), 1); + assertEquals(rc2.getZ().size(),1); + + assertEquals(group.getValue(0), new Integer(1)); + assertEquals(group.getValue(1), "foo"); + assertEquals(group.getValue(2), "bar"); + assertEquals(group.getValue(3), new Integer(2)); + assertEquals(group1.getValue(0), new Integer(99)); + assertEquals(group1.getValue(1), "fred"); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + + + XMLHelper.INSTANCE.save((DataObject)rc2, TEST_NAMESPACE, "rc2", baos); + assertTrue(baos.toString(), TestUtil.equalXmlFiles(new ByteArrayInputStream(baos.toByteArray()), getClass().getResource(RC2_TEST_DATA))); + } + + protected void setUp() throws Exception { + super.setUp(); + SDOUtil.registerStaticTypes(SequencesFactory.class); + } + + protected void tearDown() throws Exception { + super.tearDown(); + } + + public void test2RepeatingChoicesMixed() throws Exception { + TwoRCsMixed rc2m = SequencesFactory.INSTANCE.createTwoRCsMixed(); + + List as = rc2m.getA(); + List bs = rc2m.getB(); + List ys = rc2m.getY(); + List zs = rc2m.getZ(); + Sequence mixed = rc2m.getMixed(); + + bs.add(new Integer(1)); + mixed.add("where will this appear?"); + as.add("foo"); + as.add("bar"); + bs.add(new Integer(2)); + rc2m.setSplit("pea"); + zs.add(new Integer(99)); + ys.add("fred"); + + + assertEquals(8, mixed.size()); + + Sequence group = rc2m.getGroup(); + // FIXME reintroduce test assertEquals(4, group.size()); + assertEquals(rc2m.getA().size(), 2); + assertEquals(rc2m.getB().size(),2); + + Sequence group1 = rc2m.getGroup1(); + // FIXME ditto assertEquals(group1.size(), 2); + assertEquals(rc2m.getY().size(), 1); + assertEquals(rc2m.getZ().size(),1); + + int i = 0; + assertEquals(mixed.getValue(i++), new Integer(1)); + assertEquals(mixed.getValue(i++), "where will this appear?"); + assertEquals(mixed.getValue(i++), "foo"); + assertEquals(mixed.getValue(i++), "bar"); + assertEquals(mixed.getValue(i++), new Integer(2)); + assertEquals(mixed.getValue(i++), "pea"); + assertEquals(mixed.getValue(i++), new Integer(99)); + assertEquals(mixed.getValue(i++), "fred"); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + + XMLHelper.INSTANCE.save((DataObject)rc2m, TEST_NAMESPACE, "rc2m", baos); + assertTrue(baos.toString(), TestUtil.equalXmlFiles(new ByteArrayInputStream(baos.toByteArray()), getClass().getResource(RC2M_TEST_DATA))); + } + + +} diff --git a/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/TestUtil.java b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/TestUtil.java new file mode 100644 index 0000000000..c5bc850e16 --- /dev/null +++ b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/TestUtil.java @@ -0,0 +1,282 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.tuscany.sdo.test; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.util.ArrayList; +import java.util.List; + +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.FactoryConfigurationError; +import javax.xml.parsers.ParserConfigurationException; + +import org.w3c.dom.Document; +import org.w3c.dom.DocumentType; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.SAXException; + +public class TestUtil +{ + private static void getAllNodes(NodeList nodeList, List nodes) + { + int length = nodeList.getLength(); + if (length == 0) + { + return; + } + + for (int i=0; i + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/resources/mixedRepeatingChoiceTestResult.xml b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/resources/mixedRepeatingChoiceTestResult.xml new file mode 100644 index 0000000000..6564fe6112 --- /dev/null +++ b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/resources/mixedRepeatingChoiceTestResult.xml @@ -0,0 +1,22 @@ + + + + 1 + foo +some mixed text bar + 2 + diff --git a/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/resources/mixedStaticTestResult.xml b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/resources/mixedStaticTestResult.xml new file mode 100644 index 0000000000..f68e456a0e --- /dev/null +++ b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/resources/mixedStaticTestResult.xml @@ -0,0 +1,31 @@ + + + + + fbnt + + FlyByNightTechnology + + some text + + 2000.0 + + + more text + 1000.0 + + diff --git a/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/resources/repeatingChoice.xsd b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/resources/repeatingChoice.xsd new file mode 100644 index 0000000000..b7aef69735 --- /dev/null +++ b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/resources/repeatingChoice.xsd @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/resources/repeatingChoiceTestResult.xml b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/resources/repeatingChoiceTestResult.xml new file mode 100644 index 0000000000..1b2281f7d3 --- /dev/null +++ b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/resources/repeatingChoiceTestResult.xml @@ -0,0 +1,22 @@ + + + + 1 + foo + bar + 2 + diff --git a/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/resources/sequences.xsd b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/resources/sequences.xsd new file mode 100644 index 0000000000..6e70ad528c --- /dev/null +++ b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/resources/sequences.xsd @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/resources/simple.xsd b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/resources/simple.xsd new file mode 100644 index 0000000000..37b1773859 --- /dev/null +++ b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/resources/simple.xsd @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/resources/twoRepeatingChoicesMixedTestResult.xml b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/resources/twoRepeatingChoicesMixedTestResult.xml new file mode 100644 index 0000000000..2a53982a8f --- /dev/null +++ b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/resources/twoRepeatingChoicesMixedTestResult.xml @@ -0,0 +1,25 @@ + + + + 1 +where will this appear? foo + bar + 2 + pea + 99 + fred + diff --git a/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/resources/twoRepeatingChoicesTestResult.xml b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/resources/twoRepeatingChoicesTestResult.xml new file mode 100644 index 0000000000..2679d973c5 --- /dev/null +++ b/sca-java-1.x/branches/java-M1/java/sdo/tools/src/test/resources/twoRepeatingChoicesTestResult.xml @@ -0,0 +1,25 @@ + + + + 1 + foo + bar + 2 + banana + 99 + fred + -- cgit v1.2.3