diff options
author | dims <dims@13f79535-47bb-0310-9956-ffa450edef68> | 2008-06-17 00:23:01 +0000 |
---|---|---|
committer | dims <dims@13f79535-47bb-0310-9956-ffa450edef68> | 2008-06-17 00:23:01 +0000 |
commit | bdd0a41aed7edf21ec2a65cfa17a86af2ef8c48a (patch) | |
tree | 38a92061c0793434c4be189f1d70c3458b6bc41d /branches/sdo-1.1-incubating/impl/src/test/java/com |
Move Tuscany from Incubator to top level.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@668359 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sdo-1.1-incubating/impl/src/test/java/com')
14 files changed, 6457 insertions, 0 deletions
diff --git a/branches/sdo-1.1-incubating/impl/src/test/java/com/example/ExpectedException/ExpectedExceptionFactory.java b/branches/sdo-1.1-incubating/impl/src/test/java/com/example/ExpectedException/ExpectedExceptionFactory.java new file mode 100644 index 0000000000..938c4b25d2 --- /dev/null +++ b/branches/sdo-1.1-incubating/impl/src/test/java/com/example/ExpectedException/ExpectedExceptionFactory.java @@ -0,0 +1,70 @@ +/** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package com.example.ExpectedException; + +import commonj.sdo.helper.HelperContext; + + +/** + * <!-- begin-user-doc --> + * The <b>Factory</b> for the model. + * It provides a create method for each non-abstract class of the model. + * <!-- end-user-doc --> + * @generated + */ +public interface ExpectedExceptionFactory +{ + + /** + * The singleton instance of the factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + ExpectedExceptionFactory INSTANCE = com.example.ExpectedException.impl.ExpectedExceptionFactoryImpl.init(); + + /** + * Returns a new object of class '<em>Type</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return a new object of class '<em>Type</em>'. + * @generated + */ + ExpectedExceptionType createExpectedExceptionType(); + + /** + * Returns a new object of class '<em>Sequence Read Only Type</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return a new object of class '<em>Sequence Read Only Type</em>'. + * @generated + */ + SequenceReadOnlyType createSequenceReadOnlyType(); + + /** + * Registers the types supported by this Factory within the supplied scope.argument + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param scope an instance of HelperContext used to manage the scoping of types. + * @generated + */ + public void register(HelperContext scope); + +} //ExpectedExceptionFactory diff --git a/branches/sdo-1.1-incubating/impl/src/test/java/com/example/ExpectedException/ExpectedExceptionType.java b/branches/sdo-1.1-incubating/impl/src/test/java/com/example/ExpectedException/ExpectedExceptionType.java new file mode 100644 index 0000000000..80159443dc --- /dev/null +++ b/branches/sdo-1.1-incubating/impl/src/test/java/com/example/ExpectedException/ExpectedExceptionType.java @@ -0,0 +1,786 @@ +/** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package com.example.ExpectedException; + +import java.io.Serializable; + +import java.math.BigDecimal; +import java.math.BigInteger; + +import java.util.List; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Type</b></em>'. + * <!-- end-user-doc --> + * + * <p> + * The following features are supported: + * <ul> + * <li>{@link com.example.ExpectedException.ExpectedExceptionType#getStringVal <em>String Val</em>}</li> + * <li>{@link com.example.ExpectedException.ExpectedExceptionType#isBooleanVal <em>Boolean Val</em>}</li> + * <li>{@link com.example.ExpectedException.ExpectedExceptionType#getByteVal <em>Byte Val</em>}</li> + * <li>{@link com.example.ExpectedException.ExpectedExceptionType#getDecimalVal <em>Decimal Val</em>}</li> + * <li>{@link com.example.ExpectedException.ExpectedExceptionType#getIntVal <em>Int Val</em>}</li> + * <li>{@link com.example.ExpectedException.ExpectedExceptionType#getFloatVal <em>Float Val</em>}</li> + * <li>{@link com.example.ExpectedException.ExpectedExceptionType#getDoubleVal <em>Double Val</em>}</li> + * <li>{@link com.example.ExpectedException.ExpectedExceptionType#getDateVal <em>Date Val</em>}</li> + * <li>{@link com.example.ExpectedException.ExpectedExceptionType#getShortVal <em>Short Val</em>}</li> + * <li>{@link com.example.ExpectedException.ExpectedExceptionType#getLongVal <em>Long Val</em>}</li> + * <li>{@link com.example.ExpectedException.ExpectedExceptionType#getListVal <em>List Val</em>}</li> + * <li>{@link com.example.ExpectedException.ExpectedExceptionType#getBytesVal <em>Bytes Val</em>}</li> + * <li>{@link com.example.ExpectedException.ExpectedExceptionType#getIntegerVal <em>Integer Val</em>}</li> + * <li>{@link com.example.ExpectedException.ExpectedExceptionType#getCharVal <em>Char Val</em>}</li> + * <li>{@link com.example.ExpectedException.ExpectedExceptionType#getReadOnlyVal <em>Read Only Val</em>}</li> + * <li>{@link com.example.ExpectedException.ExpectedExceptionType#getReadOnlyListVal <em>Read Only List Val</em>}</li> + * </ul> + * </p> + * + * @extends Serializable + * @generated + */ +public interface ExpectedExceptionType extends Serializable +{ + /** + * Returns the value of the '<em><b>String Val</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>String Val</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>String Val</em>' attribute. + * @see #isSetStringVal() + * @see #unsetStringVal() + * @see #setStringVal(String) + * @generated + */ + String getStringVal(); + + /** + * Sets the value of the '{@link com.example.ExpectedException.ExpectedExceptionType#getStringVal <em>String Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>String Val</em>' attribute. + * @see #isSetStringVal() + * @see #unsetStringVal() + * @see #getStringVal() + * @generated + */ + void setStringVal(String value); + + /** + * Unsets the value of the '{@link com.example.ExpectedException.ExpectedExceptionType#getStringVal <em>String Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #isSetStringVal() + * @see #getStringVal() + * @see #setStringVal(String) + * @generated + */ + void unsetStringVal(); + + /** + * Returns whether the value of the '{@link com.example.ExpectedException.ExpectedExceptionType#getStringVal <em>String Val</em>}' attribute is set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return whether the value of the '<em>String Val</em>' attribute is set. + * @see #unsetStringVal() + * @see #getStringVal() + * @see #setStringVal(String) + * @generated + */ + boolean isSetStringVal(); + + /** + * Returns the value of the '<em><b>Boolean Val</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Boolean Val</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Boolean Val</em>' attribute. + * @see #isSetBooleanVal() + * @see #unsetBooleanVal() + * @see #setBooleanVal(boolean) + * @generated + */ + boolean isBooleanVal(); + + /** + * Sets the value of the '{@link com.example.ExpectedException.ExpectedExceptionType#isBooleanVal <em>Boolean Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Boolean Val</em>' attribute. + * @see #isSetBooleanVal() + * @see #unsetBooleanVal() + * @see #isBooleanVal() + * @generated + */ + void setBooleanVal(boolean value); + + /** + * Unsets the value of the '{@link com.example.ExpectedException.ExpectedExceptionType#isBooleanVal <em>Boolean Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #isSetBooleanVal() + * @see #isBooleanVal() + * @see #setBooleanVal(boolean) + * @generated + */ + void unsetBooleanVal(); + + /** + * Returns whether the value of the '{@link com.example.ExpectedException.ExpectedExceptionType#isBooleanVal <em>Boolean Val</em>}' attribute is set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return whether the value of the '<em>Boolean Val</em>' attribute is set. + * @see #unsetBooleanVal() + * @see #isBooleanVal() + * @see #setBooleanVal(boolean) + * @generated + */ + boolean isSetBooleanVal(); + + /** + * Returns the value of the '<em><b>Byte Val</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Byte Val</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Byte Val</em>' attribute. + * @see #isSetByteVal() + * @see #unsetByteVal() + * @see #setByteVal(byte) + * @generated + */ + byte getByteVal(); + + /** + * Sets the value of the '{@link com.example.ExpectedException.ExpectedExceptionType#getByteVal <em>Byte Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Byte Val</em>' attribute. + * @see #isSetByteVal() + * @see #unsetByteVal() + * @see #getByteVal() + * @generated + */ + void setByteVal(byte value); + + /** + * Unsets the value of the '{@link com.example.ExpectedException.ExpectedExceptionType#getByteVal <em>Byte Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #isSetByteVal() + * @see #getByteVal() + * @see #setByteVal(byte) + * @generated + */ + void unsetByteVal(); + + /** + * Returns whether the value of the '{@link com.example.ExpectedException.ExpectedExceptionType#getByteVal <em>Byte Val</em>}' attribute is set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return whether the value of the '<em>Byte Val</em>' attribute is set. + * @see #unsetByteVal() + * @see #getByteVal() + * @see #setByteVal(byte) + * @generated + */ + boolean isSetByteVal(); + + /** + * Returns the value of the '<em><b>Decimal Val</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Decimal Val</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Decimal Val</em>' attribute. + * @see #isSetDecimalVal() + * @see #unsetDecimalVal() + * @see #setDecimalVal(BigDecimal) + * @generated + */ + BigDecimal getDecimalVal(); + + /** + * Sets the value of the '{@link com.example.ExpectedException.ExpectedExceptionType#getDecimalVal <em>Decimal Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Decimal Val</em>' attribute. + * @see #isSetDecimalVal() + * @see #unsetDecimalVal() + * @see #getDecimalVal() + * @generated + */ + void setDecimalVal(BigDecimal value); + + /** + * Unsets the value of the '{@link com.example.ExpectedException.ExpectedExceptionType#getDecimalVal <em>Decimal Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #isSetDecimalVal() + * @see #getDecimalVal() + * @see #setDecimalVal(BigDecimal) + * @generated + */ + void unsetDecimalVal(); + + /** + * Returns whether the value of the '{@link com.example.ExpectedException.ExpectedExceptionType#getDecimalVal <em>Decimal Val</em>}' attribute is set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return whether the value of the '<em>Decimal Val</em>' attribute is set. + * @see #unsetDecimalVal() + * @see #getDecimalVal() + * @see #setDecimalVal(BigDecimal) + * @generated + */ + boolean isSetDecimalVal(); + + /** + * Returns the value of the '<em><b>Int Val</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Int Val</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Int Val</em>' attribute. + * @see #isSetIntVal() + * @see #unsetIntVal() + * @see #setIntVal(int) + * @generated + */ + int getIntVal(); + + /** + * Sets the value of the '{@link com.example.ExpectedException.ExpectedExceptionType#getIntVal <em>Int Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Int Val</em>' attribute. + * @see #isSetIntVal() + * @see #unsetIntVal() + * @see #getIntVal() + * @generated + */ + void setIntVal(int value); + + /** + * Unsets the value of the '{@link com.example.ExpectedException.ExpectedExceptionType#getIntVal <em>Int Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #isSetIntVal() + * @see #getIntVal() + * @see #setIntVal(int) + * @generated + */ + void unsetIntVal(); + + /** + * Returns whether the value of the '{@link com.example.ExpectedException.ExpectedExceptionType#getIntVal <em>Int Val</em>}' attribute is set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return whether the value of the '<em>Int Val</em>' attribute is set. + * @see #unsetIntVal() + * @see #getIntVal() + * @see #setIntVal(int) + * @generated + */ + boolean isSetIntVal(); + + /** + * Returns the value of the '<em><b>Float Val</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Float Val</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Float Val</em>' attribute. + * @see #isSetFloatVal() + * @see #unsetFloatVal() + * @see #setFloatVal(float) + * @generated + */ + float getFloatVal(); + + /** + * Sets the value of the '{@link com.example.ExpectedException.ExpectedExceptionType#getFloatVal <em>Float Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Float Val</em>' attribute. + * @see #isSetFloatVal() + * @see #unsetFloatVal() + * @see #getFloatVal() + * @generated + */ + void setFloatVal(float value); + + /** + * Unsets the value of the '{@link com.example.ExpectedException.ExpectedExceptionType#getFloatVal <em>Float Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #isSetFloatVal() + * @see #getFloatVal() + * @see #setFloatVal(float) + * @generated + */ + void unsetFloatVal(); + + /** + * Returns whether the value of the '{@link com.example.ExpectedException.ExpectedExceptionType#getFloatVal <em>Float Val</em>}' attribute is set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return whether the value of the '<em>Float Val</em>' attribute is set. + * @see #unsetFloatVal() + * @see #getFloatVal() + * @see #setFloatVal(float) + * @generated + */ + boolean isSetFloatVal(); + + /** + * Returns the value of the '<em><b>Double Val</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Double Val</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Double Val</em>' attribute. + * @see #isSetDoubleVal() + * @see #unsetDoubleVal() + * @see #setDoubleVal(double) + * @generated + */ + double getDoubleVal(); + + /** + * Sets the value of the '{@link com.example.ExpectedException.ExpectedExceptionType#getDoubleVal <em>Double Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Double Val</em>' attribute. + * @see #isSetDoubleVal() + * @see #unsetDoubleVal() + * @see #getDoubleVal() + * @generated + */ + void setDoubleVal(double value); + + /** + * Unsets the value of the '{@link com.example.ExpectedException.ExpectedExceptionType#getDoubleVal <em>Double Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #isSetDoubleVal() + * @see #getDoubleVal() + * @see #setDoubleVal(double) + * @generated + */ + void unsetDoubleVal(); + + /** + * Returns whether the value of the '{@link com.example.ExpectedException.ExpectedExceptionType#getDoubleVal <em>Double Val</em>}' attribute is set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return whether the value of the '<em>Double Val</em>' attribute is set. + * @see #unsetDoubleVal() + * @see #getDoubleVal() + * @see #setDoubleVal(double) + * @generated + */ + boolean isSetDoubleVal(); + + /** + * Returns the value of the '<em><b>Date Val</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Date Val</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Date Val</em>' attribute. + * @see #isSetDateVal() + * @see #unsetDateVal() + * @see #setDateVal(String) + * @generated + */ + String getDateVal(); + + /** + * Sets the value of the '{@link com.example.ExpectedException.ExpectedExceptionType#getDateVal <em>Date Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Date Val</em>' attribute. + * @see #isSetDateVal() + * @see #unsetDateVal() + * @see #getDateVal() + * @generated + */ + void setDateVal(String value); + + /** + * Unsets the value of the '{@link com.example.ExpectedException.ExpectedExceptionType#getDateVal <em>Date Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #isSetDateVal() + * @see #getDateVal() + * @see #setDateVal(String) + * @generated + */ + void unsetDateVal(); + + /** + * Returns whether the value of the '{@link com.example.ExpectedException.ExpectedExceptionType#getDateVal <em>Date Val</em>}' attribute is set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return whether the value of the '<em>Date Val</em>' attribute is set. + * @see #unsetDateVal() + * @see #getDateVal() + * @see #setDateVal(String) + * @generated + */ + boolean isSetDateVal(); + + /** + * Returns the value of the '<em><b>Short Val</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Short Val</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Short Val</em>' attribute. + * @see #isSetShortVal() + * @see #unsetShortVal() + * @see #setShortVal(short) + * @generated + */ + short getShortVal(); + + /** + * Sets the value of the '{@link com.example.ExpectedException.ExpectedExceptionType#getShortVal <em>Short Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Short Val</em>' attribute. + * @see #isSetShortVal() + * @see #unsetShortVal() + * @see #getShortVal() + * @generated + */ + void setShortVal(short value); + + /** + * Unsets the value of the '{@link com.example.ExpectedException.ExpectedExceptionType#getShortVal <em>Short Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #isSetShortVal() + * @see #getShortVal() + * @see #setShortVal(short) + * @generated + */ + void unsetShortVal(); + + /** + * Returns whether the value of the '{@link com.example.ExpectedException.ExpectedExceptionType#getShortVal <em>Short Val</em>}' attribute is set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return whether the value of the '<em>Short Val</em>' attribute is set. + * @see #unsetShortVal() + * @see #getShortVal() + * @see #setShortVal(short) + * @generated + */ + boolean isSetShortVal(); + + /** + * Returns the value of the '<em><b>Long Val</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Long Val</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Long Val</em>' attribute. + * @see #isSetLongVal() + * @see #unsetLongVal() + * @see #setLongVal(long) + * @generated + */ + long getLongVal(); + + /** + * Sets the value of the '{@link com.example.ExpectedException.ExpectedExceptionType#getLongVal <em>Long Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Long Val</em>' attribute. + * @see #isSetLongVal() + * @see #unsetLongVal() + * @see #getLongVal() + * @generated + */ + void setLongVal(long value); + + /** + * Unsets the value of the '{@link com.example.ExpectedException.ExpectedExceptionType#getLongVal <em>Long Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #isSetLongVal() + * @see #getLongVal() + * @see #setLongVal(long) + * @generated + */ + void unsetLongVal(); + + /** + * Returns whether the value of the '{@link com.example.ExpectedException.ExpectedExceptionType#getLongVal <em>Long Val</em>}' attribute is set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return whether the value of the '<em>Long Val</em>' attribute is set. + * @see #unsetLongVal() + * @see #getLongVal() + * @see #setLongVal(long) + * @generated + */ + boolean isSetLongVal(); + + /** + * Returns the value of the '<em><b>List Val</b></em>' attribute list. + * The list contents are of type {@link java.lang.String}. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>List Val</em>' attribute list isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>List Val</em>' attribute list. + * @generated + */ + List getListVal(); + + /** + * Returns the value of the '<em><b>Bytes Val</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Bytes Val</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Bytes Val</em>' attribute. + * @see #isSetBytesVal() + * @see #unsetBytesVal() + * @see #setBytesVal(byte[]) + * @generated + */ + byte[] getBytesVal(); + + /** + * Sets the value of the '{@link com.example.ExpectedException.ExpectedExceptionType#getBytesVal <em>Bytes Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Bytes Val</em>' attribute. + * @see #isSetBytesVal() + * @see #unsetBytesVal() + * @see #getBytesVal() + * @generated + */ + void setBytesVal(byte[] value); + + /** + * Unsets the value of the '{@link com.example.ExpectedException.ExpectedExceptionType#getBytesVal <em>Bytes Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #isSetBytesVal() + * @see #getBytesVal() + * @see #setBytesVal(byte[]) + * @generated + */ + void unsetBytesVal(); + + /** + * Returns whether the value of the '{@link com.example.ExpectedException.ExpectedExceptionType#getBytesVal <em>Bytes Val</em>}' attribute is set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return whether the value of the '<em>Bytes Val</em>' attribute is set. + * @see #unsetBytesVal() + * @see #getBytesVal() + * @see #setBytesVal(byte[]) + * @generated + */ + boolean isSetBytesVal(); + + /** + * Returns the value of the '<em><b>Integer Val</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Integer Val</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Integer Val</em>' attribute. + * @see #isSetIntegerVal() + * @see #unsetIntegerVal() + * @see #setIntegerVal(BigInteger) + * @generated + */ + BigInteger getIntegerVal(); + + /** + * Sets the value of the '{@link com.example.ExpectedException.ExpectedExceptionType#getIntegerVal <em>Integer Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Integer Val</em>' attribute. + * @see #isSetIntegerVal() + * @see #unsetIntegerVal() + * @see #getIntegerVal() + * @generated + */ + void setIntegerVal(BigInteger value); + + /** + * Unsets the value of the '{@link com.example.ExpectedException.ExpectedExceptionType#getIntegerVal <em>Integer Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #isSetIntegerVal() + * @see #getIntegerVal() + * @see #setIntegerVal(BigInteger) + * @generated + */ + void unsetIntegerVal(); + + /** + * Returns whether the value of the '{@link com.example.ExpectedException.ExpectedExceptionType#getIntegerVal <em>Integer Val</em>}' attribute is set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return whether the value of the '<em>Integer Val</em>' attribute is set. + * @see #unsetIntegerVal() + * @see #getIntegerVal() + * @see #setIntegerVal(BigInteger) + * @generated + */ + boolean isSetIntegerVal(); + + /** + * Returns the value of the '<em><b>Char Val</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Char Val</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Char Val</em>' attribute. + * @see #isSetCharVal() + * @see #unsetCharVal() + * @see #setCharVal(String) + * @generated + */ + String getCharVal(); + + /** + * Sets the value of the '{@link com.example.ExpectedException.ExpectedExceptionType#getCharVal <em>Char Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Char Val</em>' attribute. + * @see #isSetCharVal() + * @see #unsetCharVal() + * @see #getCharVal() + * @generated + */ + void setCharVal(String value); + + /** + * Unsets the value of the '{@link com.example.ExpectedException.ExpectedExceptionType#getCharVal <em>Char Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #isSetCharVal() + * @see #getCharVal() + * @see #setCharVal(String) + * @generated + */ + void unsetCharVal(); + + /** + * Returns whether the value of the '{@link com.example.ExpectedException.ExpectedExceptionType#getCharVal <em>Char Val</em>}' attribute is set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return whether the value of the '<em>Char Val</em>' attribute is set. + * @see #unsetCharVal() + * @see #getCharVal() + * @see #setCharVal(String) + * @generated + */ + boolean isSetCharVal(); + + /** + * Returns the value of the '<em><b>Read Only Val</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Read Only Val</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Read Only Val</em>' attribute. + * @see #isSetReadOnlyVal() + * @generated + */ + String getReadOnlyVal(); + + /** + * Returns whether the value of the '{@link com.example.ExpectedException.ExpectedExceptionType#getReadOnlyVal <em>Read Only Val</em>}' attribute is set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return whether the value of the '<em>Read Only Val</em>' attribute is set. + * @see #getReadOnlyVal() + * @generated + */ + boolean isSetReadOnlyVal(); + + /** + * Returns the value of the '<em><b>Read Only List Val</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Read Only List Val</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Read Only List Val</em>' attribute. + * @see #isSetReadOnlyListVal() + * @generated + */ + String getReadOnlyListVal(); + + /** + * Returns whether the value of the '{@link com.example.ExpectedException.ExpectedExceptionType#getReadOnlyListVal <em>Read Only List Val</em>}' attribute is set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return whether the value of the '<em>Read Only List Val</em>' attribute is set. + * @see #getReadOnlyListVal() + * @generated + */ + boolean isSetReadOnlyListVal(); + +} // ExpectedExceptionType diff --git a/branches/sdo-1.1-incubating/impl/src/test/java/com/example/ExpectedException/SequenceReadOnlyType.java b/branches/sdo-1.1-incubating/impl/src/test/java/com/example/ExpectedException/SequenceReadOnlyType.java new file mode 100644 index 0000000000..a87511df28 --- /dev/null +++ b/branches/sdo-1.1-incubating/impl/src/test/java/com/example/ExpectedException/SequenceReadOnlyType.java @@ -0,0 +1,158 @@ +/** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package com.example.ExpectedException; + +import commonj.sdo.Sequence; + +import java.io.Serializable; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Sequence Read Only Type</b></em>'. + * <!-- end-user-doc --> + * + * <p> + * The following features are supported: + * <ul> + * <li>{@link com.example.ExpectedException.SequenceReadOnlyType#getMixed <em>Mixed</em>}</li> + * <li>{@link com.example.ExpectedException.SequenceReadOnlyType#getReadOnlyVal <em>Read Only Val</em>}</li> + * <li>{@link com.example.ExpectedException.SequenceReadOnlyType#getReadOnlyListVal <em>Read Only List Val</em>}</li> + * <li>{@link com.example.ExpectedException.SequenceReadOnlyType#getUniqueName <em>Unique Name</em>}</li> + * </ul> + * </p> + * + * @extends Serializable + * @generated + */ +public interface SequenceReadOnlyType extends Serializable +{ + /** + * Returns the value of the '<em><b>Mixed</b></em>' attribute list. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Mixed</em>' attribute list isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Mixed</em>' attribute list. + * @generated + */ + Sequence getMixed(); + + /** + * Returns the value of the '<em><b>Read Only Val</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Read Only Val</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Read Only Val</em>' attribute. + * @see #isSetReadOnlyVal() + * @generated + */ + String getReadOnlyVal(); + + /** + * Returns whether the value of the '{@link com.example.ExpectedException.SequenceReadOnlyType#getReadOnlyVal <em>Read Only Val</em>}' attribute is set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return whether the value of the '<em>Read Only Val</em>' attribute is set. + * @see #getReadOnlyVal() + * @generated + */ + boolean isSetReadOnlyVal(); + + /** + * Returns the value of the '<em><b>Read Only List Val</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Read Only List Val</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Read Only List Val</em>' attribute. + * @see #isSetReadOnlyListVal() + * @generated + */ + String getReadOnlyListVal(); + + /** + * Returns whether the value of the '{@link com.example.ExpectedException.SequenceReadOnlyType#getReadOnlyListVal <em>Read Only List Val</em>}' attribute is set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return whether the value of the '<em>Read Only List Val</em>' attribute is set. + * @see #getReadOnlyListVal() + * @generated + */ + boolean isSetReadOnlyListVal(); + + /** + * Returns the value of the '<em><b>Unique Name</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Unique Name</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Unique Name</em>' attribute. + * @see #isSetUniqueName() + * @see #unsetUniqueName() + * @see #setUniqueName(String) + * @generated + */ + String getUniqueName(); + + /** + * Sets the value of the '{@link com.example.ExpectedException.SequenceReadOnlyType#getUniqueName <em>Unique Name</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Unique Name</em>' attribute. + * @see #isSetUniqueName() + * @see #unsetUniqueName() + * @see #getUniqueName() + * @generated + */ + void setUniqueName(String value); + + /** + * Unsets the value of the '{@link com.example.ExpectedException.SequenceReadOnlyType#getUniqueName <em>Unique Name</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #isSetUniqueName() + * @see #getUniqueName() + * @see #setUniqueName(String) + * @generated + */ + void unsetUniqueName(); + + /** + * Returns whether the value of the '{@link com.example.ExpectedException.SequenceReadOnlyType#getUniqueName <em>Unique Name</em>}' attribute is set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return whether the value of the '<em>Unique Name</em>' attribute is set. + * @see #unsetUniqueName() + * @see #getUniqueName() + * @see #setUniqueName(String) + * @generated + */ + boolean isSetUniqueName(); + +} // SequenceReadOnlyType diff --git a/branches/sdo-1.1-incubating/impl/src/test/java/com/example/ExpectedException/impl/ExpectedExceptionFactoryImpl.java b/branches/sdo-1.1-incubating/impl/src/test/java/com/example/ExpectedException/impl/ExpectedExceptionFactoryImpl.java new file mode 100644 index 0000000000..68280749c4 --- /dev/null +++ b/branches/sdo-1.1-incubating/impl/src/test/java/com/example/ExpectedException/impl/ExpectedExceptionFactoryImpl.java @@ -0,0 +1,579 @@ +/** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT 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.ExpectedException.impl; + +import commonj.sdo.helper.HelperContext; +import org.apache.tuscany.sdo.helper.TypeHelperImpl; + +import com.example.ExpectedException.*; + +import commonj.sdo.DataObject; +import commonj.sdo.Property; +import commonj.sdo.Type; + +import org.apache.tuscany.sdo.SDOFactory; + +import org.apache.tuscany.sdo.impl.FactoryBase; + +import org.apache.tuscany.sdo.model.ModelFactory; + +import org.apache.tuscany.sdo.model.impl.ModelFactoryImpl; + +import org.apache.tuscany.sdo.model.internal.InternalFactory; + +import org.apache.tuscany.sdo.util.SDOUtil; + +/** + * <!-- begin-user-doc --> + * An implementation of the model <b>Factory</b>. + * Generator information: + * patternVersion=1.2; -prefix ExpectedException + * <!-- end-user-doc --> + * @generated + */ +public class ExpectedExceptionFactoryImpl extends FactoryBase implements ExpectedExceptionFactory +{ + + /** + * The package namespace URI. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static final String NAMESPACE_URI = "http://example.com/ExpectedException"; + + /** + * The package namespace name. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static final String NAMESPACE_PREFIX = "expect"; + + /** + * The version of the generator pattern used to generate this class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static final String PATTERN_VERSION = "1.2"; + + public static final int EXPECTED_EXCEPTION_TYPE = 1; + public static final int SEQUENCE_READ_ONLY_TYPE = 2; + public static final int CHAR = 3; + + /** + * Creates an instance of the factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public ExpectedExceptionFactoryImpl() + { + super(NAMESPACE_URI, NAMESPACE_PREFIX, "com.sdo.test.ExpectedException"); + } + + /** + * Registers the Factory instance so that it is available within the supplied scope. + * @argument scope a HelperContext instance that will make the types supported by this Factory available. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void register(HelperContext scope) { + if(scope == null) { + throw new IllegalArgumentException("Scope can not be null"); + } + TypeHelperImpl th = (TypeHelperImpl)scope.getTypeHelper(); + th.getExtendedMetaData().putPackage(NAMESPACE_URI, this); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public DataObject create(int typeNumber) + { + switch (typeNumber) + { + case EXPECTED_EXCEPTION_TYPE: return (DataObject)createExpectedExceptionType(); + case SEQUENCE_READ_ONLY_TYPE: return (DataObject)createSequenceReadOnlyType(); + default: + return super.create(typeNumber); + } + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public Object createFromString(int typeNumber, String initialValue) + { + switch (typeNumber) + { + case CHAR: + return createcharFromString(initialValue); + default: + throw new IllegalArgumentException("The type number '" + typeNumber + "' is not a valid datatype"); + } + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String convertToString(int typeNumber, Object instanceValue) + { + switch (typeNumber) + { + case CHAR: + return convertcharToString(instanceValue); + default: + throw new IllegalArgumentException("The type number '" + typeNumber + "' is not a valid datatype"); + } + } + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public ExpectedExceptionType createExpectedExceptionType() + { + ExpectedExceptionTypeImpl expectedExceptionType = new ExpectedExceptionTypeImpl(); + return expectedExceptionType; + } + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public SequenceReadOnlyType createSequenceReadOnlyType() + { + SequenceReadOnlyTypeImpl sequenceReadOnlyType = new SequenceReadOnlyTypeImpl(); + return sequenceReadOnlyType; + } + + // Following creates and initializes SDO metadata for the supported types. + protected Type expectedExceptionTypeType = null; + + public Type getExpectedExceptionType() + { + return expectedExceptionTypeType; + } + + protected Type sequenceReadOnlyTypeType = null; + + public Type getSequenceReadOnlyType() + { + return sequenceReadOnlyTypeType; + } + + protected Type char_Type = null; + + public Type getchar() + { + return char_Type; + } + + + private static boolean isInited = false; + + public static ExpectedExceptionFactoryImpl init() + { + if (isInited) return (ExpectedExceptionFactoryImpl)FactoryBase.getStaticFactory(ExpectedExceptionFactoryImpl.NAMESPACE_URI); + ExpectedExceptionFactoryImpl theExpectedExceptionFactoryImpl = new ExpectedExceptionFactoryImpl(); + isInited = true; + + // Initialize dependencies + SDOUtil.registerStaticTypes(SDOFactory.class); + SDOUtil.registerStaticTypes(ModelFactory.class); + SDOUtil.registerStaticTypes(InternalFactory.class); + + // Create package meta-data objects + theExpectedExceptionFactoryImpl.createMetaData(); + + // Initialize created meta-data + theExpectedExceptionFactoryImpl.initializeMetaData(); + + // Mark meta-data to indicate it can't be changed + //theExpectedExceptionFactoryImpl.freeze(); //FB do we need to freeze / should we freeze ???? + + return theExpectedExceptionFactoryImpl; + } + + private boolean isCreated = false; + + public void createMetaData() + { + if (isCreated) return; + isCreated = true; + + // Create types and their properties + expectedExceptionTypeType = createType(false, EXPECTED_EXCEPTION_TYPE); + createProperty(true, expectedExceptionTypeType,ExpectedExceptionTypeImpl.INTERNAL_STRING_VAL); + createProperty(true, expectedExceptionTypeType,ExpectedExceptionTypeImpl.INTERNAL_BOOLEAN_VAL); + createProperty(true, expectedExceptionTypeType,ExpectedExceptionTypeImpl.INTERNAL_BYTE_VAL); + createProperty(true, expectedExceptionTypeType,ExpectedExceptionTypeImpl.INTERNAL_DECIMAL_VAL); + createProperty(true, expectedExceptionTypeType,ExpectedExceptionTypeImpl.INTERNAL_INT_VAL); + createProperty(true, expectedExceptionTypeType,ExpectedExceptionTypeImpl.INTERNAL_FLOAT_VAL); + createProperty(true, expectedExceptionTypeType,ExpectedExceptionTypeImpl.INTERNAL_DOUBLE_VAL); + createProperty(true, expectedExceptionTypeType,ExpectedExceptionTypeImpl.INTERNAL_DATE_VAL); + createProperty(true, expectedExceptionTypeType,ExpectedExceptionTypeImpl.INTERNAL_SHORT_VAL); + createProperty(true, expectedExceptionTypeType,ExpectedExceptionTypeImpl.INTERNAL_LONG_VAL); + createProperty(true, expectedExceptionTypeType,ExpectedExceptionTypeImpl.INTERNAL_LIST_VAL); + createProperty(true, expectedExceptionTypeType,ExpectedExceptionTypeImpl.INTERNAL_BYTES_VAL); + createProperty(true, expectedExceptionTypeType,ExpectedExceptionTypeImpl.INTERNAL_INTEGER_VAL); + createProperty(true, expectedExceptionTypeType,ExpectedExceptionTypeImpl.INTERNAL_CHAR_VAL); + createProperty(true, expectedExceptionTypeType,ExpectedExceptionTypeImpl.INTERNAL_READ_ONLY_VAL); + createProperty(true, expectedExceptionTypeType,ExpectedExceptionTypeImpl.INTERNAL_READ_ONLY_LIST_VAL); + sequenceReadOnlyTypeType = createType(false, SEQUENCE_READ_ONLY_TYPE); + createProperty(true, sequenceReadOnlyTypeType,SequenceReadOnlyTypeImpl.INTERNAL_MIXED); + createProperty(true, sequenceReadOnlyTypeType,SequenceReadOnlyTypeImpl.INTERNAL_READ_ONLY_VAL); + createProperty(true, sequenceReadOnlyTypeType,SequenceReadOnlyTypeImpl.INTERNAL_READ_ONLY_LIST_VAL); + createProperty(true, sequenceReadOnlyTypeType,SequenceReadOnlyTypeImpl.INTERNAL_UNIQUE_NAME); + + // Create data types + char_Type = createType(true, CHAR ); + } + + private boolean isInitialized = false; + + public void initializeMetaData() + { + if (isInitialized) return; + isInitialized = true; + + // Obtain other dependent packages + ModelFactoryImpl theModelPackageImpl = (ModelFactoryImpl)FactoryBase.getStaticFactory(ModelFactoryImpl.NAMESPACE_URI); + Property property = null; + + // Add supertypes to types + + // Initialize types and properties + initializeType(expectedExceptionTypeType, ExpectedExceptionType.class, "ExpectedExceptionType", false); + property = getLocalProperty(expectedExceptionTypeType, 0); + initializeProperty(property, theModelPackageImpl.getString(), "stringVal", null, 1, 1, ExpectedExceptionType.class, false, true, false); + + property = getLocalProperty(expectedExceptionTypeType, 1); + initializeProperty(property, theModelPackageImpl.getBoolean(), "booleanVal", null, 1, 1, ExpectedExceptionType.class, false, true, false); + + property = getLocalProperty(expectedExceptionTypeType, 2); + initializeProperty(property, theModelPackageImpl.getByte(), "byteVal", null, 1, 1, ExpectedExceptionType.class, false, true, false); + + property = getLocalProperty(expectedExceptionTypeType, 3); + initializeProperty(property, theModelPackageImpl.getDecimal(), "decimalVal", null, 1, 1, ExpectedExceptionType.class, false, true, false); + + property = getLocalProperty(expectedExceptionTypeType, 4); + initializeProperty(property, theModelPackageImpl.getInt(), "intVal", null, 1, 1, ExpectedExceptionType.class, false, true, false); + + property = getLocalProperty(expectedExceptionTypeType, 5); + initializeProperty(property, theModelPackageImpl.getFloat(), "floatVal", null, 1, 1, ExpectedExceptionType.class, false, true, false); + + property = getLocalProperty(expectedExceptionTypeType, 6); + initializeProperty(property, theModelPackageImpl.getDouble(), "doubleVal", null, 1, 1, ExpectedExceptionType.class, false, true, false); + + property = getLocalProperty(expectedExceptionTypeType, 7); + initializeProperty(property, theModelPackageImpl.getDateTime(), "dateVal", null, 1, 1, ExpectedExceptionType.class, false, true, false); + + property = getLocalProperty(expectedExceptionTypeType, 8); + initializeProperty(property, theModelPackageImpl.getShort(), "shortVal", null, 1, 1, ExpectedExceptionType.class, false, true, false); + + property = getLocalProperty(expectedExceptionTypeType, 9); + initializeProperty(property, theModelPackageImpl.getLong(), "longVal", null, 1, 1, ExpectedExceptionType.class, false, true, false); + + property = getLocalProperty(expectedExceptionTypeType, 10); + initializeProperty(property, theModelPackageImpl.getString(), "listVal", null, 0, -1, ExpectedExceptionType.class, false, false, false); + + property = getLocalProperty(expectedExceptionTypeType, 11); + initializeProperty(property, theModelPackageImpl.getBytes(), "bytesVal", null, 1, 1, ExpectedExceptionType.class, false, true, false); + + property = getLocalProperty(expectedExceptionTypeType, 12); + initializeProperty(property, theModelPackageImpl.getInteger(), "integerVal", null, 1, 1, ExpectedExceptionType.class, false, true, false); + + property = getLocalProperty(expectedExceptionTypeType, 13); + initializeProperty(property, this.getchar(), "charVal", null, 1, 1, ExpectedExceptionType.class, false, true, false); + + property = getLocalProperty(expectedExceptionTypeType, 14); + initializeProperty(property, theModelPackageImpl.getString(), "readOnlyVal", null, 1, 1, ExpectedExceptionType.class, true, true, false); + setInstanceProperty (property, "commonj.sdo/xml", "readOnly", "true"); + + property = getLocalProperty(expectedExceptionTypeType, 15); + initializeProperty(property, theModelPackageImpl.getString(), "readOnlyListVal", null, 1, 1, ExpectedExceptionType.class, true, true, false); + setInstanceProperty (property, "commonj.sdo/xml", "readOnly", "true"); + + initializeType(sequenceReadOnlyTypeType, SequenceReadOnlyType.class, "SequenceReadOnlyType", false); + property = getLocalProperty(sequenceReadOnlyTypeType, 0); + initializeProperty(property, getSequence(), "mixed", null, 0, -1, SequenceReadOnlyType.class, false, false, false); + + property = getLocalProperty(sequenceReadOnlyTypeType, 1); + initializeProperty(property, theModelPackageImpl.getString(), "readOnlyVal", null, 1, 1, SequenceReadOnlyType.class, true, true, true); + setInstanceProperty (property, "commonj.sdo/xml", "readOnly", "true"); + + property = getLocalProperty(sequenceReadOnlyTypeType, 2); + initializeProperty(property, theModelPackageImpl.getString(), "readOnlyListVal", null, 1, 1, SequenceReadOnlyType.class, true, true, true); + setInstanceProperty (property, "commonj.sdo/xml", "readOnly", "true"); + + property = getLocalProperty(sequenceReadOnlyTypeType, 3); + initializeProperty(property, theModelPackageImpl.getString(), "uniqueName", null, 1, 1, SequenceReadOnlyType.class, false, true, true); + + // Initialize data types + initializeType(char_Type, String.class, "char", true, false); + + createXSDMetaData(theModelPackageImpl); + } + + protected void createXSDMetaData(ModelFactoryImpl theModelPackageImpl) + { + super.initXSD(); + + Property property = null; + + + property = createGlobalProperty + ("expectedExceptionsElem", + this.getExpectedExceptionType(), + new String[] + { + "kind", "element", + "name", "expectedExceptionsElem", + "namespace", "##targetNamespace" + }); + + property = createGlobalProperty + ("sequencedReadOnlyElem", + this.getSequenceReadOnlyType(), + new String[] + { + "kind", "element", + "name", "sequencedReadOnlyElem", + "namespace", "##targetNamespace" + }); + + addXSDMapping + (expectedExceptionTypeType, + new String[] + { + "name", "ExpectedExceptionType", + "kind", "elementOnly" + }); + + addXSDMapping + (getProperty(expectedExceptionTypeType, ExpectedExceptionTypeImpl.INTERNAL_STRING_VAL), + new String[] + { + "kind", "element", + "name", "stringVal" + }); + + addXSDMapping + (getProperty(expectedExceptionTypeType, ExpectedExceptionTypeImpl.INTERNAL_BOOLEAN_VAL), + new String[] + { + "kind", "element", + "name", "booleanVal" + }); + + addXSDMapping + (getProperty(expectedExceptionTypeType, ExpectedExceptionTypeImpl.INTERNAL_BYTE_VAL), + new String[] + { + "kind", "element", + "name", "byteVal" + }); + + addXSDMapping + (getProperty(expectedExceptionTypeType, ExpectedExceptionTypeImpl.INTERNAL_DECIMAL_VAL), + new String[] + { + "kind", "element", + "name", "decimalVal" + }); + + addXSDMapping + (getProperty(expectedExceptionTypeType, ExpectedExceptionTypeImpl.INTERNAL_INT_VAL), + new String[] + { + "kind", "element", + "name", "intVal" + }); + + addXSDMapping + (getProperty(expectedExceptionTypeType, ExpectedExceptionTypeImpl.INTERNAL_FLOAT_VAL), + new String[] + { + "kind", "element", + "name", "floatVal" + }); + + addXSDMapping + (getProperty(expectedExceptionTypeType, ExpectedExceptionTypeImpl.INTERNAL_DOUBLE_VAL), + new String[] + { + "kind", "element", + "name", "doubleVal" + }); + + addXSDMapping + (getProperty(expectedExceptionTypeType, ExpectedExceptionTypeImpl.INTERNAL_DATE_VAL), + new String[] + { + "kind", "element", + "name", "dateVal" + }); + + addXSDMapping + (getProperty(expectedExceptionTypeType, ExpectedExceptionTypeImpl.INTERNAL_SHORT_VAL), + new String[] + { + "kind", "element", + "name", "shortVal" + }); + + addXSDMapping + (getProperty(expectedExceptionTypeType, ExpectedExceptionTypeImpl.INTERNAL_LONG_VAL), + new String[] + { + "kind", "element", + "name", "longVal" + }); + + addXSDMapping + (getProperty(expectedExceptionTypeType, ExpectedExceptionTypeImpl.INTERNAL_LIST_VAL), + new String[] + { + "kind", "element", + "name", "listVal" + }); + + addXSDMapping + (getProperty(expectedExceptionTypeType, ExpectedExceptionTypeImpl.INTERNAL_BYTES_VAL), + new String[] + { + "kind", "element", + "name", "bytesVal" + }); + + addXSDMapping + (getProperty(expectedExceptionTypeType, ExpectedExceptionTypeImpl.INTERNAL_INTEGER_VAL), + new String[] + { + "kind", "element", + "name", "integerVal" + }); + + addXSDMapping + (getProperty(expectedExceptionTypeType, ExpectedExceptionTypeImpl.INTERNAL_CHAR_VAL), + new String[] + { + "kind", "element", + "name", "charVal" + }); + + addXSDMapping + (getProperty(expectedExceptionTypeType, ExpectedExceptionTypeImpl.INTERNAL_READ_ONLY_VAL), + new String[] + { + "kind", "element", + "name", "readOnlyVal" + }); + + addXSDMapping + (getProperty(expectedExceptionTypeType, ExpectedExceptionTypeImpl.INTERNAL_READ_ONLY_LIST_VAL), + new String[] + { + "kind", "element", + "name", "readOnlyListVal" + }); + + addXSDMapping + (sequenceReadOnlyTypeType, + new String[] + { + "name", "SequenceReadOnlyType", + "kind", "mixed" + }); + + addXSDMapping + (getProperty(sequenceReadOnlyTypeType, SequenceReadOnlyTypeImpl.INTERNAL_MIXED), + new String[] + { + "kind", "elementWildcard", + "name", ":mixed" + }); + + addXSDMapping + (getProperty(sequenceReadOnlyTypeType, SequenceReadOnlyTypeImpl.INTERNAL_READ_ONLY_VAL), + new String[] + { + "kind", "element", + "name", "readOnlyVal" + }); + + addXSDMapping + (getProperty(sequenceReadOnlyTypeType, SequenceReadOnlyTypeImpl.INTERNAL_READ_ONLY_LIST_VAL), + new String[] + { + "kind", "element", + "name", "readOnlyListVal" + }); + + addXSDMapping + (getProperty(sequenceReadOnlyTypeType, SequenceReadOnlyTypeImpl.INTERNAL_UNIQUE_NAME), + new String[] + { + "kind", "element", + "name", "uniqueName" + }); + + addXSDMapping + (char_Type, + new String[] + { + "name", "char", + "baseType", "commonj.sdo#String", + "length", "1" + }); + + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String createcharFromString(String initialValue) + { + return (String)((ModelFactoryImpl)ModelFactory.INSTANCE).createStringFromString(initialValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String convertcharToString(Object instanceValue) + { + return ((ModelFactoryImpl)ModelFactory.INSTANCE).convertStringToString(instanceValue); + } + +} //ExpectedExceptionFactoryImpl diff --git a/branches/sdo-1.1-incubating/impl/src/test/java/com/example/ExpectedException/impl/ExpectedExceptionTypeImpl.java b/branches/sdo-1.1-incubating/impl/src/test/java/com/example/ExpectedException/impl/ExpectedExceptionTypeImpl.java new file mode 100644 index 0000000000..df7bdbd66e --- /dev/null +++ b/branches/sdo-1.1-incubating/impl/src/test/java/com/example/ExpectedException/impl/ExpectedExceptionTypeImpl.java @@ -0,0 +1,1682 @@ +/** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT 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.ExpectedException.impl; + +import com.example.ExpectedException.ExpectedExceptionFactory; +import com.example.ExpectedException.ExpectedExceptionType; + +import commonj.sdo.Type; + +import java.math.BigDecimal; +import java.math.BigInteger; + +import java.util.Collection; +import java.util.List; + +import org.apache.tuscany.sdo.impl.DataObjectBase; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Type</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * <ul> + * <li>{@link com.example.ExpectedException.impl.ExpectedExceptionTypeImpl#getStringVal <em>String Val</em>}</li> + * <li>{@link com.example.ExpectedException.impl.ExpectedExceptionTypeImpl#isBooleanVal <em>Boolean Val</em>}</li> + * <li>{@link com.example.ExpectedException.impl.ExpectedExceptionTypeImpl#getByteVal <em>Byte Val</em>}</li> + * <li>{@link com.example.ExpectedException.impl.ExpectedExceptionTypeImpl#getDecimalVal <em>Decimal Val</em>}</li> + * <li>{@link com.example.ExpectedException.impl.ExpectedExceptionTypeImpl#getIntVal <em>Int Val</em>}</li> + * <li>{@link com.example.ExpectedException.impl.ExpectedExceptionTypeImpl#getFloatVal <em>Float Val</em>}</li> + * <li>{@link com.example.ExpectedException.impl.ExpectedExceptionTypeImpl#getDoubleVal <em>Double Val</em>}</li> + * <li>{@link com.example.ExpectedException.impl.ExpectedExceptionTypeImpl#getDateVal <em>Date Val</em>}</li> + * <li>{@link com.example.ExpectedException.impl.ExpectedExceptionTypeImpl#getShortVal <em>Short Val</em>}</li> + * <li>{@link com.example.ExpectedException.impl.ExpectedExceptionTypeImpl#getLongVal <em>Long Val</em>}</li> + * <li>{@link com.example.ExpectedException.impl.ExpectedExceptionTypeImpl#getListVal <em>List Val</em>}</li> + * <li>{@link com.example.ExpectedException.impl.ExpectedExceptionTypeImpl#getBytesVal <em>Bytes Val</em>}</li> + * <li>{@link com.example.ExpectedException.impl.ExpectedExceptionTypeImpl#getIntegerVal <em>Integer Val</em>}</li> + * <li>{@link com.example.ExpectedException.impl.ExpectedExceptionTypeImpl#getCharVal <em>Char Val</em>}</li> + * <li>{@link com.example.ExpectedException.impl.ExpectedExceptionTypeImpl#getReadOnlyVal <em>Read Only Val</em>}</li> + * <li>{@link com.example.ExpectedException.impl.ExpectedExceptionTypeImpl#getReadOnlyListVal <em>Read Only List Val</em>}</li> + * </ul> + * </p> + * + * @generated + */ +public class ExpectedExceptionTypeImpl extends DataObjectBase implements ExpectedExceptionType +{ + + public final static int STRING_VAL = 0; + + public final static int BOOLEAN_VAL = 1; + + public final static int BYTE_VAL = 2; + + public final static int DECIMAL_VAL = 3; + + public final static int INT_VAL = 4; + + public final static int FLOAT_VAL = 5; + + public final static int DOUBLE_VAL = 6; + + public final static int DATE_VAL = 7; + + public final static int SHORT_VAL = 8; + + public final static int LONG_VAL = 9; + + public final static int LIST_VAL = 10; + + public final static int BYTES_VAL = 11; + + public final static int INTEGER_VAL = 12; + + public final static int CHAR_VAL = 13; + + public final static int READ_ONLY_VAL = 14; + + public final static int READ_ONLY_LIST_VAL = 15; + + public final static int SDO_PROPERTY_COUNT = 16; + + public final static int EXTENDED_PROPERTY_COUNT = 0; + + + /** + * The internal feature id for the '<em><b>String Val</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public final static int INTERNAL_STRING_VAL = 0; + + /** + * The internal feature id for the '<em><b>Boolean Val</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public final static int INTERNAL_BOOLEAN_VAL = 1; + + /** + * The internal feature id for the '<em><b>Byte Val</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public final static int INTERNAL_BYTE_VAL = 2; + + /** + * The internal feature id for the '<em><b>Decimal Val</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public final static int INTERNAL_DECIMAL_VAL = 3; + + /** + * The internal feature id for the '<em><b>Int Val</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public final static int INTERNAL_INT_VAL = 4; + + /** + * The internal feature id for the '<em><b>Float Val</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public final static int INTERNAL_FLOAT_VAL = 5; + + /** + * The internal feature id for the '<em><b>Double Val</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public final static int INTERNAL_DOUBLE_VAL = 6; + + /** + * The internal feature id for the '<em><b>Date Val</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public final static int INTERNAL_DATE_VAL = 7; + + /** + * The internal feature id for the '<em><b>Short Val</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public final static int INTERNAL_SHORT_VAL = 8; + + /** + * The internal feature id for the '<em><b>Long Val</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public final static int INTERNAL_LONG_VAL = 9; + + /** + * The internal feature id for the '<em><b>List Val</b></em>' attribute list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public final static int INTERNAL_LIST_VAL = 10; + + /** + * The internal feature id for the '<em><b>Bytes Val</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public final static int INTERNAL_BYTES_VAL = 11; + + /** + * The internal feature id for the '<em><b>Integer Val</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public final static int INTERNAL_INTEGER_VAL = 12; + + /** + * The internal feature id for the '<em><b>Char Val</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public final static int INTERNAL_CHAR_VAL = 13; + + /** + * The internal feature id for the '<em><b>Read Only Val</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public final static int INTERNAL_READ_ONLY_VAL = 14; + + /** + * The internal feature id for the '<em><b>Read Only List Val</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public final static int INTERNAL_READ_ONLY_LIST_VAL = 15; + + /** + * The number of properties for this type. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public final static int INTERNAL_PROPERTY_COUNT = 16; + + protected int internalConvertIndex(int internalIndex) + { + switch (internalIndex) + { + case INTERNAL_STRING_VAL: return STRING_VAL; + case INTERNAL_BOOLEAN_VAL: return BOOLEAN_VAL; + case INTERNAL_BYTE_VAL: return BYTE_VAL; + case INTERNAL_DECIMAL_VAL: return DECIMAL_VAL; + case INTERNAL_INT_VAL: return INT_VAL; + case INTERNAL_FLOAT_VAL: return FLOAT_VAL; + case INTERNAL_DOUBLE_VAL: return DOUBLE_VAL; + case INTERNAL_DATE_VAL: return DATE_VAL; + case INTERNAL_SHORT_VAL: return SHORT_VAL; + case INTERNAL_LONG_VAL: return LONG_VAL; + case INTERNAL_LIST_VAL: return LIST_VAL; + case INTERNAL_BYTES_VAL: return BYTES_VAL; + case INTERNAL_INTEGER_VAL: return INTEGER_VAL; + case INTERNAL_CHAR_VAL: return CHAR_VAL; + case INTERNAL_READ_ONLY_VAL: return READ_ONLY_VAL; + case INTERNAL_READ_ONLY_LIST_VAL: return READ_ONLY_LIST_VAL; + } + return super.internalConvertIndex(internalIndex); + } + + + /** + * The default value of the '{@link #getStringVal() <em>String Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getStringVal() + * @generated + * @ordered + */ + protected static final String STRING_VAL_DEFAULT_ = null; + + /** + * The cached value of the '{@link #getStringVal() <em>String Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getStringVal() + * @generated + * @ordered + */ + protected String stringVal = STRING_VAL_DEFAULT_; + + /** + * This is true if the String Val attribute has been set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + protected boolean stringVal_set_ = false; + + /** + * The default value of the '{@link #isBooleanVal() <em>Boolean Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #isBooleanVal() + * @generated + * @ordered + */ + protected static final boolean BOOLEAN_VAL_DEFAULT_ = false; + + /** + * The cached value of the '{@link #isBooleanVal() <em>Boolean Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #isBooleanVal() + * @generated + * @ordered + */ + protected boolean booleanVal = BOOLEAN_VAL_DEFAULT_; + + /** + * This is true if the Boolean Val attribute has been set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + protected boolean booleanVal_set_ = false; + + /** + * The default value of the '{@link #getByteVal() <em>Byte Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getByteVal() + * @generated + * @ordered + */ + protected static final byte BYTE_VAL_DEFAULT_ = 0; + + /** + * The cached value of the '{@link #getByteVal() <em>Byte Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getByteVal() + * @generated + * @ordered + */ + protected byte byteVal = BYTE_VAL_DEFAULT_; + + /** + * This is true if the Byte Val attribute has been set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + protected boolean byteVal_set_ = false; + + /** + * The default value of the '{@link #getDecimalVal() <em>Decimal Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getDecimalVal() + * @generated + * @ordered + */ + protected static final BigDecimal DECIMAL_VAL_DEFAULT_ = null; + + /** + * The cached value of the '{@link #getDecimalVal() <em>Decimal Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getDecimalVal() + * @generated + * @ordered + */ + protected BigDecimal decimalVal = DECIMAL_VAL_DEFAULT_; + + /** + * This is true if the Decimal Val attribute has been set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + protected boolean decimalVal_set_ = false; + + /** + * The default value of the '{@link #getIntVal() <em>Int Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getIntVal() + * @generated + * @ordered + */ + protected static final int INT_VAL_DEFAULT_ = 0; + + /** + * The cached value of the '{@link #getIntVal() <em>Int Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getIntVal() + * @generated + * @ordered + */ + protected int intVal = INT_VAL_DEFAULT_; + + /** + * This is true if the Int Val attribute has been set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + protected boolean intVal_set_ = false; + + /** + * The default value of the '{@link #getFloatVal() <em>Float Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getFloatVal() + * @generated + * @ordered + */ + protected static final float FLOAT_VAL_DEFAULT_ = 0.0F; + + /** + * The cached value of the '{@link #getFloatVal() <em>Float Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getFloatVal() + * @generated + * @ordered + */ + protected float floatVal = FLOAT_VAL_DEFAULT_; + + /** + * This is true if the Float Val attribute has been set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + protected boolean floatVal_set_ = false; + + /** + * The default value of the '{@link #getDoubleVal() <em>Double Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getDoubleVal() + * @generated + * @ordered + */ + protected static final double DOUBLE_VAL_DEFAULT_ = 0.0; + + /** + * The cached value of the '{@link #getDoubleVal() <em>Double Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getDoubleVal() + * @generated + * @ordered + */ + protected double doubleVal = DOUBLE_VAL_DEFAULT_; + + /** + * This is true if the Double Val attribute has been set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + protected boolean doubleVal_set_ = false; + + /** + * The default value of the '{@link #getDateVal() <em>Date Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getDateVal() + * @generated + * @ordered + */ + protected static final String DATE_VAL_DEFAULT_ = null; + + /** + * The cached value of the '{@link #getDateVal() <em>Date Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getDateVal() + * @generated + * @ordered + */ + protected String dateVal = DATE_VAL_DEFAULT_; + + /** + * This is true if the Date Val attribute has been set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + protected boolean dateVal_set_ = false; + + /** + * The default value of the '{@link #getShortVal() <em>Short Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getShortVal() + * @generated + * @ordered + */ + protected static final short SHORT_VAL_DEFAULT_ = 0; + + /** + * The cached value of the '{@link #getShortVal() <em>Short Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getShortVal() + * @generated + * @ordered + */ + protected short shortVal = SHORT_VAL_DEFAULT_; + + /** + * This is true if the Short Val attribute has been set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + protected boolean shortVal_set_ = false; + + /** + * The default value of the '{@link #getLongVal() <em>Long Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getLongVal() + * @generated + * @ordered + */ + protected static final long LONG_VAL_DEFAULT_ = 0L; + + /** + * The cached value of the '{@link #getLongVal() <em>Long Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getLongVal() + * @generated + * @ordered + */ + protected long longVal = LONG_VAL_DEFAULT_; + + /** + * This is true if the Long Val attribute has been set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + protected boolean longVal_set_ = false; + + /** + * The cached value of the '{@link #getListVal() <em>List Val</em>}' attribute list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getListVal() + * @generated + * @ordered + */ + + protected List listVal = null; + + /** + * The default value of the '{@link #getBytesVal() <em>Bytes Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getBytesVal() + * @generated + * @ordered + */ + protected static final byte[] BYTES_VAL_DEFAULT_ = null; + + /** + * The cached value of the '{@link #getBytesVal() <em>Bytes Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getBytesVal() + * @generated + * @ordered + */ + protected byte[] bytesVal = BYTES_VAL_DEFAULT_; + + /** + * This is true if the Bytes Val attribute has been set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + protected boolean bytesVal_set_ = false; + + /** + * The default value of the '{@link #getIntegerVal() <em>Integer Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getIntegerVal() + * @generated + * @ordered + */ + protected static final BigInteger INTEGER_VAL_DEFAULT_ = null; + + /** + * The cached value of the '{@link #getIntegerVal() <em>Integer Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getIntegerVal() + * @generated + * @ordered + */ + protected BigInteger integerVal = INTEGER_VAL_DEFAULT_; + + /** + * This is true if the Integer Val attribute has been set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + protected boolean integerVal_set_ = false; + + /** + * The default value of the '{@link #getCharVal() <em>Char Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getCharVal() + * @generated + * @ordered + */ + protected static final String CHAR_VAL_DEFAULT_ = null; + + /** + * The cached value of the '{@link #getCharVal() <em>Char Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getCharVal() + * @generated + * @ordered + */ + protected String charVal = CHAR_VAL_DEFAULT_; + + /** + * This is true if the Char Val attribute has been set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + protected boolean charVal_set_ = false; + + /** + * The default value of the '{@link #getReadOnlyVal() <em>Read Only Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getReadOnlyVal() + * @generated + * @ordered + */ + protected static final String READ_ONLY_VAL_DEFAULT_ = null; + + /** + * The cached value of the '{@link #getReadOnlyVal() <em>Read Only Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getReadOnlyVal() + * @generated + * @ordered + */ + protected String readOnlyVal = READ_ONLY_VAL_DEFAULT_; + + /** + * This is true if the Read Only Val attribute has been set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + protected boolean readOnlyVal_set_ = false; + + /** + * The default value of the '{@link #getReadOnlyListVal() <em>Read Only List Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getReadOnlyListVal() + * @generated + * @ordered + */ + protected static final String READ_ONLY_LIST_VAL_DEFAULT_ = null; + + /** + * The cached value of the '{@link #getReadOnlyListVal() <em>Read Only List Val</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getReadOnlyListVal() + * @generated + * @ordered + */ + protected String readOnlyListVal = READ_ONLY_LIST_VAL_DEFAULT_; + + /** + * This is true if the Read Only List Val attribute has been set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + protected boolean readOnlyListVal_set_ = false; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public ExpectedExceptionTypeImpl() + { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public Type getStaticType() + { + return ((ExpectedExceptionFactoryImpl)ExpectedExceptionFactory.INSTANCE).getExpectedExceptionType(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String getStringVal() + { + return stringVal; + } + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setStringVal(String newStringVal) + { + String oldStringVal = stringVal; + stringVal = newStringVal; + boolean oldStringVal_set_ = stringVal_set_; + stringVal_set_ = true; + if (isNotifying()) + notify(ChangeKind.SET, STRING_VAL, oldStringVal, stringVal, !oldStringVal_set_); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void unsetStringVal() + { + String oldStringVal = stringVal; + boolean oldStringVal_set_ = stringVal_set_; + stringVal = STRING_VAL_DEFAULT_; + stringVal_set_ = false; + if (isNotifying()) + notify(ChangeKind.UNSET, STRING_VAL, oldStringVal, STRING_VAL_DEFAULT_, oldStringVal_set_); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean isSetStringVal() + { + return stringVal_set_; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean isBooleanVal() + { + return booleanVal; + } + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setBooleanVal(boolean newBooleanVal) + { + boolean oldBooleanVal = booleanVal; + booleanVal = newBooleanVal; + boolean oldBooleanVal_set_ = booleanVal_set_; + booleanVal_set_ = true; + if (isNotifying()) + notify(ChangeKind.SET, BOOLEAN_VAL, oldBooleanVal, booleanVal, !oldBooleanVal_set_); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void unsetBooleanVal() + { + boolean oldBooleanVal = booleanVal; + boolean oldBooleanVal_set_ = booleanVal_set_; + booleanVal = BOOLEAN_VAL_DEFAULT_; + booleanVal_set_ = false; + if (isNotifying()) + notify(ChangeKind.UNSET, BOOLEAN_VAL, oldBooleanVal, BOOLEAN_VAL_DEFAULT_, oldBooleanVal_set_); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean isSetBooleanVal() + { + return booleanVal_set_; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public byte getByteVal() + { + return byteVal; + } + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setByteVal(byte newByteVal) + { + byte oldByteVal = byteVal; + byteVal = newByteVal; + boolean oldByteVal_set_ = byteVal_set_; + byteVal_set_ = true; + if (isNotifying()) + notify(ChangeKind.SET, BYTE_VAL, oldByteVal, byteVal, !oldByteVal_set_); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void unsetByteVal() + { + byte oldByteVal = byteVal; + boolean oldByteVal_set_ = byteVal_set_; + byteVal = BYTE_VAL_DEFAULT_; + byteVal_set_ = false; + if (isNotifying()) + notify(ChangeKind.UNSET, BYTE_VAL, oldByteVal, BYTE_VAL_DEFAULT_, oldByteVal_set_); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean isSetByteVal() + { + return byteVal_set_; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public BigDecimal getDecimalVal() + { + return decimalVal; + } + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setDecimalVal(BigDecimal newDecimalVal) + { + BigDecimal oldDecimalVal = decimalVal; + decimalVal = newDecimalVal; + boolean oldDecimalVal_set_ = decimalVal_set_; + decimalVal_set_ = true; + if (isNotifying()) + notify(ChangeKind.SET, DECIMAL_VAL, oldDecimalVal, decimalVal, !oldDecimalVal_set_); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void unsetDecimalVal() + { + BigDecimal oldDecimalVal = decimalVal; + boolean oldDecimalVal_set_ = decimalVal_set_; + decimalVal = DECIMAL_VAL_DEFAULT_; + decimalVal_set_ = false; + if (isNotifying()) + notify(ChangeKind.UNSET, DECIMAL_VAL, oldDecimalVal, DECIMAL_VAL_DEFAULT_, oldDecimalVal_set_); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean isSetDecimalVal() + { + return decimalVal_set_; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public int getIntVal() + { + return intVal; + } + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setIntVal(int newIntVal) + { + int oldIntVal = intVal; + intVal = newIntVal; + boolean oldIntVal_set_ = intVal_set_; + intVal_set_ = true; + if (isNotifying()) + notify(ChangeKind.SET, INT_VAL, oldIntVal, intVal, !oldIntVal_set_); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void unsetIntVal() + { + int oldIntVal = intVal; + boolean oldIntVal_set_ = intVal_set_; + intVal = INT_VAL_DEFAULT_; + intVal_set_ = false; + if (isNotifying()) + notify(ChangeKind.UNSET, INT_VAL, oldIntVal, INT_VAL_DEFAULT_, oldIntVal_set_); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean isSetIntVal() + { + return intVal_set_; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public float getFloatVal() + { + return floatVal; + } + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setFloatVal(float newFloatVal) + { + float oldFloatVal = floatVal; + floatVal = newFloatVal; + boolean oldFloatVal_set_ = floatVal_set_; + floatVal_set_ = true; + if (isNotifying()) + notify(ChangeKind.SET, FLOAT_VAL, oldFloatVal, floatVal, !oldFloatVal_set_); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void unsetFloatVal() + { + float oldFloatVal = floatVal; + boolean oldFloatVal_set_ = floatVal_set_; + floatVal = FLOAT_VAL_DEFAULT_; + floatVal_set_ = false; + if (isNotifying()) + notify(ChangeKind.UNSET, FLOAT_VAL, oldFloatVal, FLOAT_VAL_DEFAULT_, oldFloatVal_set_); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean isSetFloatVal() + { + return floatVal_set_; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public double getDoubleVal() + { + return doubleVal; + } + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setDoubleVal(double newDoubleVal) + { + double oldDoubleVal = doubleVal; + doubleVal = newDoubleVal; + boolean oldDoubleVal_set_ = doubleVal_set_; + doubleVal_set_ = true; + if (isNotifying()) + notify(ChangeKind.SET, DOUBLE_VAL, oldDoubleVal, doubleVal, !oldDoubleVal_set_); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void unsetDoubleVal() + { + double oldDoubleVal = doubleVal; + boolean oldDoubleVal_set_ = doubleVal_set_; + doubleVal = DOUBLE_VAL_DEFAULT_; + doubleVal_set_ = false; + if (isNotifying()) + notify(ChangeKind.UNSET, DOUBLE_VAL, oldDoubleVal, DOUBLE_VAL_DEFAULT_, oldDoubleVal_set_); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean isSetDoubleVal() + { + return doubleVal_set_; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String getDateVal() + { + return dateVal; + } + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setDateVal(String newDateVal) + { + String oldDateVal = dateVal; + dateVal = newDateVal; + boolean oldDateVal_set_ = dateVal_set_; + dateVal_set_ = true; + if (isNotifying()) + notify(ChangeKind.SET, DATE_VAL, oldDateVal, dateVal, !oldDateVal_set_); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void unsetDateVal() + { + String oldDateVal = dateVal; + boolean oldDateVal_set_ = dateVal_set_; + dateVal = DATE_VAL_DEFAULT_; + dateVal_set_ = false; + if (isNotifying()) + notify(ChangeKind.UNSET, DATE_VAL, oldDateVal, DATE_VAL_DEFAULT_, oldDateVal_set_); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean isSetDateVal() + { + return dateVal_set_; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public short getShortVal() + { + return shortVal; + } + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setShortVal(short newShortVal) + { + short oldShortVal = shortVal; + shortVal = newShortVal; + boolean oldShortVal_set_ = shortVal_set_; + shortVal_set_ = true; + if (isNotifying()) + notify(ChangeKind.SET, SHORT_VAL, oldShortVal, shortVal, !oldShortVal_set_); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void unsetShortVal() + { + short oldShortVal = shortVal; + boolean oldShortVal_set_ = shortVal_set_; + shortVal = SHORT_VAL_DEFAULT_; + shortVal_set_ = false; + if (isNotifying()) + notify(ChangeKind.UNSET, SHORT_VAL, oldShortVal, SHORT_VAL_DEFAULT_, oldShortVal_set_); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean isSetShortVal() + { + return shortVal_set_; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public long getLongVal() + { + return longVal; + } + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setLongVal(long newLongVal) + { + long oldLongVal = longVal; + longVal = newLongVal; + boolean oldLongVal_set_ = longVal_set_; + longVal_set_ = true; + if (isNotifying()) + notify(ChangeKind.SET, LONG_VAL, oldLongVal, longVal, !oldLongVal_set_); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void unsetLongVal() + { + long oldLongVal = longVal; + boolean oldLongVal_set_ = longVal_set_; + longVal = LONG_VAL_DEFAULT_; + longVal_set_ = false; + if (isNotifying()) + notify(ChangeKind.UNSET, LONG_VAL, oldLongVal, LONG_VAL_DEFAULT_, oldLongVal_set_); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean isSetLongVal() + { + return longVal_set_; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public List getListVal() + { + if (listVal == null) + { + listVal = createPropertyList(ListKind.DATATYPE, String.class, LIST_VAL, 0); + } + return listVal; + } + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public byte[] getBytesVal() + { + return bytesVal; + } + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setBytesVal(byte[] newBytesVal) + { + byte[] oldBytesVal = bytesVal; + bytesVal = newBytesVal; + boolean oldBytesVal_set_ = bytesVal_set_; + bytesVal_set_ = true; + if (isNotifying()) + notify(ChangeKind.SET, BYTES_VAL, oldBytesVal, bytesVal, !oldBytesVal_set_); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void unsetBytesVal() + { + byte[] oldBytesVal = bytesVal; + boolean oldBytesVal_set_ = bytesVal_set_; + bytesVal = BYTES_VAL_DEFAULT_; + bytesVal_set_ = false; + if (isNotifying()) + notify(ChangeKind.UNSET, BYTES_VAL, oldBytesVal, BYTES_VAL_DEFAULT_, oldBytesVal_set_); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean isSetBytesVal() + { + return bytesVal_set_; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public BigInteger getIntegerVal() + { + return integerVal; + } + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setIntegerVal(BigInteger newIntegerVal) + { + BigInteger oldIntegerVal = integerVal; + integerVal = newIntegerVal; + boolean oldIntegerVal_set_ = integerVal_set_; + integerVal_set_ = true; + if (isNotifying()) + notify(ChangeKind.SET, INTEGER_VAL, oldIntegerVal, integerVal, !oldIntegerVal_set_); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void unsetIntegerVal() + { + BigInteger oldIntegerVal = integerVal; + boolean oldIntegerVal_set_ = integerVal_set_; + integerVal = INTEGER_VAL_DEFAULT_; + integerVal_set_ = false; + if (isNotifying()) + notify(ChangeKind.UNSET, INTEGER_VAL, oldIntegerVal, INTEGER_VAL_DEFAULT_, oldIntegerVal_set_); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean isSetIntegerVal() + { + return integerVal_set_; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String getCharVal() + { + return charVal; + } + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setCharVal(String newCharVal) + { + String oldCharVal = charVal; + charVal = newCharVal; + boolean oldCharVal_set_ = charVal_set_; + charVal_set_ = true; + if (isNotifying()) + notify(ChangeKind.SET, CHAR_VAL, oldCharVal, charVal, !oldCharVal_set_); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void unsetCharVal() + { + String oldCharVal = charVal; + boolean oldCharVal_set_ = charVal_set_; + charVal = CHAR_VAL_DEFAULT_; + charVal_set_ = false; + if (isNotifying()) + notify(ChangeKind.UNSET, CHAR_VAL, oldCharVal, CHAR_VAL_DEFAULT_, oldCharVal_set_); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean isSetCharVal() + { + return charVal_set_; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String getReadOnlyVal() + { + return readOnlyVal; + } + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean isSetReadOnlyVal() + { + return readOnlyVal_set_; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String getReadOnlyListVal() + { + return readOnlyListVal; + } + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean isSetReadOnlyListVal() + { + return readOnlyListVal_set_; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public Object get(int propertyIndex, boolean resolve) + { + switch (propertyIndex) + { + case STRING_VAL: + return getStringVal(); + case BOOLEAN_VAL: + return isBooleanVal() ? Boolean.TRUE : Boolean.FALSE; + case BYTE_VAL: + return new Byte(getByteVal()); + case DECIMAL_VAL: + return getDecimalVal(); + case INT_VAL: + return new Integer(getIntVal()); + case FLOAT_VAL: + return new Float(getFloatVal()); + case DOUBLE_VAL: + return new Double(getDoubleVal()); + case DATE_VAL: + return getDateVal(); + case SHORT_VAL: + return new Short(getShortVal()); + case LONG_VAL: + return new Long(getLongVal()); + case LIST_VAL: + return getListVal(); + case BYTES_VAL: + return getBytesVal(); + case INTEGER_VAL: + return getIntegerVal(); + case CHAR_VAL: + return getCharVal(); + case READ_ONLY_VAL: + return getReadOnlyVal(); + case READ_ONLY_LIST_VAL: + return getReadOnlyListVal(); + } + return super.get(propertyIndex, resolve); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void set(int propertyIndex, Object newValue) + { + switch (propertyIndex) + { + case STRING_VAL: + setStringVal((String)newValue); + return; + case BOOLEAN_VAL: + setBooleanVal(((Boolean)newValue).booleanValue()); + return; + case BYTE_VAL: + setByteVal(((Byte)newValue).byteValue()); + return; + case DECIMAL_VAL: + setDecimalVal((BigDecimal)newValue); + return; + case INT_VAL: + setIntVal(((Integer)newValue).intValue()); + return; + case FLOAT_VAL: + setFloatVal(((Float)newValue).floatValue()); + return; + case DOUBLE_VAL: + setDoubleVal(((Double)newValue).doubleValue()); + return; + case DATE_VAL: + setDateVal((String)newValue); + return; + case SHORT_VAL: + setShortVal(((Short)newValue).shortValue()); + return; + case LONG_VAL: + setLongVal(((Long)newValue).longValue()); + return; + case LIST_VAL: + getListVal().clear(); + getListVal().addAll((Collection)newValue); + return; + case BYTES_VAL: + setBytesVal((byte[])newValue); + return; + case INTEGER_VAL: + setIntegerVal((BigInteger)newValue); + return; + case CHAR_VAL: + setCharVal((String)newValue); + return; + } + super.set(propertyIndex, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void unset(int propertyIndex) + { + switch (propertyIndex) + { + case STRING_VAL: + unsetStringVal(); + return; + case BOOLEAN_VAL: + unsetBooleanVal(); + return; + case BYTE_VAL: + unsetByteVal(); + return; + case DECIMAL_VAL: + unsetDecimalVal(); + return; + case INT_VAL: + unsetIntVal(); + return; + case FLOAT_VAL: + unsetFloatVal(); + return; + case DOUBLE_VAL: + unsetDoubleVal(); + return; + case DATE_VAL: + unsetDateVal(); + return; + case SHORT_VAL: + unsetShortVal(); + return; + case LONG_VAL: + unsetLongVal(); + return; + case LIST_VAL: + getListVal().clear(); + return; + case BYTES_VAL: + unsetBytesVal(); + return; + case INTEGER_VAL: + unsetIntegerVal(); + return; + case CHAR_VAL: + unsetCharVal(); + return; + } + super.unset(propertyIndex); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean isSet(int propertyIndex) + { + switch (propertyIndex) + { + case STRING_VAL: + return isSetStringVal(); + case BOOLEAN_VAL: + return isSetBooleanVal(); + case BYTE_VAL: + return isSetByteVal(); + case DECIMAL_VAL: + return isSetDecimalVal(); + case INT_VAL: + return isSetIntVal(); + case FLOAT_VAL: + return isSetFloatVal(); + case DOUBLE_VAL: + return isSetDoubleVal(); + case DATE_VAL: + return isSetDateVal(); + case SHORT_VAL: + return isSetShortVal(); + case LONG_VAL: + return isSetLongVal(); + case LIST_VAL: + return listVal != null && !listVal.isEmpty(); + case BYTES_VAL: + return isSetBytesVal(); + case INTEGER_VAL: + return isSetIntegerVal(); + case CHAR_VAL: + return isSetCharVal(); + case READ_ONLY_VAL: + return isSetReadOnlyVal(); + case READ_ONLY_LIST_VAL: + return isSetReadOnlyListVal(); + } + return super.isSet(propertyIndex); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String toString() + { + if (isProxy(this)) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (stringVal: "); + if (stringVal_set_) result.append(stringVal); else result.append("<unset>"); + result.append(", booleanVal: "); + if (booleanVal_set_) result.append(booleanVal); else result.append("<unset>"); + result.append(", byteVal: "); + if (byteVal_set_) result.append(byteVal); else result.append("<unset>"); + result.append(", decimalVal: "); + if (decimalVal_set_) result.append(decimalVal); else result.append("<unset>"); + result.append(", intVal: "); + if (intVal_set_) result.append(intVal); else result.append("<unset>"); + result.append(", floatVal: "); + if (floatVal_set_) result.append(floatVal); else result.append("<unset>"); + result.append(", doubleVal: "); + if (doubleVal_set_) result.append(doubleVal); else result.append("<unset>"); + result.append(", dateVal: "); + if (dateVal_set_) result.append(dateVal); else result.append("<unset>"); + result.append(", shortVal: "); + if (shortVal_set_) result.append(shortVal); else result.append("<unset>"); + result.append(", longVal: "); + if (longVal_set_) result.append(longVal); else result.append("<unset>"); + result.append(", listVal: "); + result.append(listVal); + result.append(", bytesVal: "); + if (bytesVal_set_) result.append(bytesVal); else result.append("<unset>"); + result.append(", integerVal: "); + if (integerVal_set_) result.append(integerVal); else result.append("<unset>"); + result.append(", charVal: "); + if (charVal_set_) result.append(charVal); else result.append("<unset>"); + result.append(", readOnlyVal: "); + if (readOnlyVal_set_) result.append(readOnlyVal); else result.append("<unset>"); + result.append(", readOnlyListVal: "); + if (readOnlyListVal_set_) result.append(readOnlyListVal); else result.append("<unset>"); + result.append(')'); + return result.toString(); + } + +} //ExpectedExceptionTypeImpl diff --git a/branches/sdo-1.1-incubating/impl/src/test/java/com/example/ExpectedException/impl/SequenceReadOnlyTypeImpl.java b/branches/sdo-1.1-incubating/impl/src/test/java/com/example/ExpectedException/impl/SequenceReadOnlyTypeImpl.java new file mode 100644 index 0000000000..048cb439db --- /dev/null +++ b/branches/sdo-1.1-incubating/impl/src/test/java/com/example/ExpectedException/impl/SequenceReadOnlyTypeImpl.java @@ -0,0 +1,354 @@ +/** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT 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.ExpectedException.impl; + +import com.example.ExpectedException.ExpectedExceptionFactory; +import com.example.ExpectedException.SequenceReadOnlyType; + +import commonj.sdo.Sequence; +import commonj.sdo.Type; + +import org.apache.tuscany.sdo.impl.DataObjectBase; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Sequence Read Only Type</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * <ul> + * <li>{@link com.example.ExpectedException.impl.SequenceReadOnlyTypeImpl#getMixed <em>Mixed</em>}</li> + * <li>{@link com.example.ExpectedException.impl.SequenceReadOnlyTypeImpl#getReadOnlyVal <em>Read Only Val</em>}</li> + * <li>{@link com.example.ExpectedException.impl.SequenceReadOnlyTypeImpl#getReadOnlyListVal <em>Read Only List Val</em>}</li> + * <li>{@link com.example.ExpectedException.impl.SequenceReadOnlyTypeImpl#getUniqueName <em>Unique Name</em>}</li> + * </ul> + * </p> + * + * @generated + */ +public class SequenceReadOnlyTypeImpl extends DataObjectBase implements SequenceReadOnlyType +{ + + public final static int MIXED = -1; + + public final static int READ_ONLY_VAL = 0; + + public final static int READ_ONLY_LIST_VAL = 1; + + public final static int UNIQUE_NAME = 2; + + public final static int SDO_PROPERTY_COUNT = 3; + + public final static int EXTENDED_PROPERTY_COUNT = -1; + + + /** + * The internal feature id for the '<em><b>Mixed</b></em>' attribute list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public final static int INTERNAL_MIXED = 0; + + /** + * The internal feature id for the '<em><b>Read Only Val</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public final static int INTERNAL_READ_ONLY_VAL = 1; + + /** + * The internal feature id for the '<em><b>Read Only List Val</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public final static int INTERNAL_READ_ONLY_LIST_VAL = 2; + + /** + * The internal feature id for the '<em><b>Unique Name</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public final static int INTERNAL_UNIQUE_NAME = 3; + + /** + * The number of properties for this type. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public final static int INTERNAL_PROPERTY_COUNT = 4; + + protected int internalConvertIndex(int internalIndex) + { + switch (internalIndex) + { + case INTERNAL_MIXED: return MIXED; + case INTERNAL_READ_ONLY_VAL: return READ_ONLY_VAL; + case INTERNAL_READ_ONLY_LIST_VAL: return READ_ONLY_LIST_VAL; + case INTERNAL_UNIQUE_NAME: return UNIQUE_NAME; + } + return super.internalConvertIndex(internalIndex); + } + + + /** + * The cached value of the '{@link #getMixed() <em>Mixed</em>}' attribute list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getMixed() + * @generated + * @ordered + */ + + protected Sequence mixed = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public SequenceReadOnlyTypeImpl() + { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public Type getStaticType() + { + return ((ExpectedExceptionFactoryImpl)ExpectedExceptionFactory.INSTANCE).getSequenceReadOnlyType(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public Sequence getMixed() + { + if (mixed == null) + { + mixed = createSequence(INTERNAL_MIXED); + } + return mixed; + } + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String getReadOnlyVal() + { + return (String)get(getMixed(), getType(), INTERNAL_READ_ONLY_VAL); + } + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean isSetReadOnlyVal() + { + return isSet(getMixed(), getType(), INTERNAL_READ_ONLY_VAL); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String getReadOnlyListVal() + { + return (String)get(getMixed(), getType(), INTERNAL_READ_ONLY_LIST_VAL); + } + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean isSetReadOnlyListVal() + { + return isSet(getMixed(), getType(), INTERNAL_READ_ONLY_LIST_VAL); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String getUniqueName() + { + return (String)get(getMixed(), getType(), INTERNAL_UNIQUE_NAME); + } + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setUniqueName(String newUniqueName) + { + set(getMixed(), getType(), INTERNAL_UNIQUE_NAME, newUniqueName); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void unsetUniqueName() + { + unset(getMixed(), getType(), INTERNAL_UNIQUE_NAME); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean isSetUniqueName() + { + return isSet(getMixed(), getType(), INTERNAL_UNIQUE_NAME); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public ChangeContext inverseRemove(Object otherEnd, int propertyIndex, ChangeContext changeContext) + { + switch (propertyIndex) + { + case MIXED: + return removeFromSequence(getMixed(), otherEnd, changeContext); + } + return super.inverseRemove(otherEnd, propertyIndex, changeContext); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public Object get(int propertyIndex, boolean resolve) + { + switch (propertyIndex) + { + case MIXED: + // XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view + //if (coreType) + return getMixed(); + case READ_ONLY_VAL: + return getReadOnlyVal(); + case READ_ONLY_LIST_VAL: + return getReadOnlyListVal(); + case UNIQUE_NAME: + return getUniqueName(); + } + return super.get(propertyIndex, resolve); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void set(int propertyIndex, Object newValue) + { + switch (propertyIndex) + { + case MIXED: + setSequence(getMixed(), newValue); + return; + case UNIQUE_NAME: + setUniqueName((String)newValue); + return; + } + super.set(propertyIndex, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void unset(int propertyIndex) + { + switch (propertyIndex) + { + case MIXED: + unsetSequence(getMixed()); + return; + case UNIQUE_NAME: + unsetUniqueName(); + return; + } + super.unset(propertyIndex); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean isSet(int propertyIndex) + { + switch (propertyIndex) + { + case MIXED: + return mixed != null && !isSequenceEmpty(getMixed()); + case READ_ONLY_VAL: + return isSetReadOnlyVal(); + case READ_ONLY_LIST_VAL: + return isSetReadOnlyListVal(); + case UNIQUE_NAME: + return isSetUniqueName(); + } + return super.isSet(propertyIndex); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String toString() + { + if (isProxy(this)) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (mixed: "); + result.append(mixed); + result.append(')'); + return result.toString(); + } + +} //SequenceReadOnlyTypeImpl diff --git a/branches/sdo-1.1-incubating/impl/src/test/java/com/example/simple/Quote.java b/branches/sdo-1.1-incubating/impl/src/test/java/com/example/simple/Quote.java new file mode 100644 index 0000000000..48dcf96d64 --- /dev/null +++ b/branches/sdo-1.1-incubating/impl/src/test/java/com/example/simple/Quote.java @@ -0,0 +1,475 @@ +/** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package com.example.simple; + +import java.io.Serializable; + +import java.math.BigDecimal; + +import java.util.List; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Quote</b></em>'. + * <!-- end-user-doc --> + * + * <p> + * The following features are supported: + * <ul> + * <li>{@link com.example.simple.Quote#getSymbol <em>Symbol</em>}</li> + * <li>{@link com.example.simple.Quote#getCompanyName <em>Company Name</em>}</li> + * <li>{@link com.example.simple.Quote#getPrice <em>Price</em>}</li> + * <li>{@link com.example.simple.Quote#getOpen1 <em>Open1</em>}</li> + * <li>{@link com.example.simple.Quote#getHigh <em>High</em>}</li> + * <li>{@link com.example.simple.Quote#getLow <em>Low</em>}</li> + * <li>{@link com.example.simple.Quote#getVolume <em>Volume</em>}</li> + * <li>{@link com.example.simple.Quote#getChange1 <em>Change1</em>}</li> + * <li>{@link com.example.simple.Quote#getQuotes <em>Quotes</em>}</li> + * </ul> + * </p> + * + * @extends Serializable + * @generated + */ +public interface Quote extends Serializable +{ + /** + * Returns the value of the '<em><b>Symbol</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Symbol</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Symbol</em>' attribute. + * @see #isSetSymbol() + * @see #unsetSymbol() + * @see #setSymbol(String) + * @generated + */ + String getSymbol(); + + /** + * Sets the value of the '{@link com.example.simple.Quote#getSymbol <em>Symbol</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Symbol</em>' attribute. + * @see #isSetSymbol() + * @see #unsetSymbol() + * @see #getSymbol() + * @generated + */ + void setSymbol(String value); + + /** + * Unsets the value of the '{@link com.example.simple.Quote#getSymbol <em>Symbol</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #isSetSymbol() + * @see #getSymbol() + * @see #setSymbol(String) + * @generated + */ + void unsetSymbol(); + + /** + * Returns whether the value of the '{@link com.example.simple.Quote#getSymbol <em>Symbol</em>}' attribute is set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return whether the value of the '<em>Symbol</em>' attribute is set. + * @see #unsetSymbol() + * @see #getSymbol() + * @see #setSymbol(String) + * @generated + */ + boolean isSetSymbol(); + + /** + * Returns the value of the '<em><b>Company Name</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Company Name</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Company Name</em>' attribute. + * @see #isSetCompanyName() + * @see #unsetCompanyName() + * @see #setCompanyName(String) + * @generated + */ + String getCompanyName(); + + /** + * Sets the value of the '{@link com.example.simple.Quote#getCompanyName <em>Company Name</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Company Name</em>' attribute. + * @see #isSetCompanyName() + * @see #unsetCompanyName() + * @see #getCompanyName() + * @generated + */ + void setCompanyName(String value); + + /** + * Unsets the value of the '{@link com.example.simple.Quote#getCompanyName <em>Company Name</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #isSetCompanyName() + * @see #getCompanyName() + * @see #setCompanyName(String) + * @generated + */ + void unsetCompanyName(); + + /** + * Returns whether the value of the '{@link com.example.simple.Quote#getCompanyName <em>Company Name</em>}' attribute is set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return whether the value of the '<em>Company Name</em>' attribute is set. + * @see #unsetCompanyName() + * @see #getCompanyName() + * @see #setCompanyName(String) + * @generated + */ + boolean isSetCompanyName(); + + /** + * Returns the value of the '<em><b>Price</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Price</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Price</em>' attribute. + * @see #isSetPrice() + * @see #unsetPrice() + * @see #setPrice(BigDecimal) + * @generated + */ + BigDecimal getPrice(); + + /** + * Sets the value of the '{@link com.example.simple.Quote#getPrice <em>Price</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Price</em>' attribute. + * @see #isSetPrice() + * @see #unsetPrice() + * @see #getPrice() + * @generated + */ + void setPrice(BigDecimal value); + + /** + * Unsets the value of the '{@link com.example.simple.Quote#getPrice <em>Price</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #isSetPrice() + * @see #getPrice() + * @see #setPrice(BigDecimal) + * @generated + */ + void unsetPrice(); + + /** + * Returns whether the value of the '{@link com.example.simple.Quote#getPrice <em>Price</em>}' attribute is set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return whether the value of the '<em>Price</em>' attribute is set. + * @see #unsetPrice() + * @see #getPrice() + * @see #setPrice(BigDecimal) + * @generated + */ + boolean isSetPrice(); + + /** + * Returns the value of the '<em><b>Open1</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Open1</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Open1</em>' attribute. + * @see #isSetOpen1() + * @see #unsetOpen1() + * @see #setOpen1(BigDecimal) + * @generated + */ + BigDecimal getOpen1(); + + /** + * Sets the value of the '{@link com.example.simple.Quote#getOpen1 <em>Open1</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Open1</em>' attribute. + * @see #isSetOpen1() + * @see #unsetOpen1() + * @see #getOpen1() + * @generated + */ + void setOpen1(BigDecimal value); + + /** + * Unsets the value of the '{@link com.example.simple.Quote#getOpen1 <em>Open1</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #isSetOpen1() + * @see #getOpen1() + * @see #setOpen1(BigDecimal) + * @generated + */ + void unsetOpen1(); + + /** + * Returns whether the value of the '{@link com.example.simple.Quote#getOpen1 <em>Open1</em>}' attribute is set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return whether the value of the '<em>Open1</em>' attribute is set. + * @see #unsetOpen1() + * @see #getOpen1() + * @see #setOpen1(BigDecimal) + * @generated + */ + boolean isSetOpen1(); + + /** + * Returns the value of the '<em><b>High</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>High</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>High</em>' attribute. + * @see #isSetHigh() + * @see #unsetHigh() + * @see #setHigh(BigDecimal) + * @generated + */ + BigDecimal getHigh(); + + /** + * Sets the value of the '{@link com.example.simple.Quote#getHigh <em>High</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>High</em>' attribute. + * @see #isSetHigh() + * @see #unsetHigh() + * @see #getHigh() + * @generated + */ + void setHigh(BigDecimal value); + + /** + * Unsets the value of the '{@link com.example.simple.Quote#getHigh <em>High</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #isSetHigh() + * @see #getHigh() + * @see #setHigh(BigDecimal) + * @generated + */ + void unsetHigh(); + + /** + * Returns whether the value of the '{@link com.example.simple.Quote#getHigh <em>High</em>}' attribute is set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return whether the value of the '<em>High</em>' attribute is set. + * @see #unsetHigh() + * @see #getHigh() + * @see #setHigh(BigDecimal) + * @generated + */ + boolean isSetHigh(); + + /** + * Returns the value of the '<em><b>Low</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Low</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Low</em>' attribute. + * @see #isSetLow() + * @see #unsetLow() + * @see #setLow(BigDecimal) + * @generated + */ + BigDecimal getLow(); + + /** + * Sets the value of the '{@link com.example.simple.Quote#getLow <em>Low</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Low</em>' attribute. + * @see #isSetLow() + * @see #unsetLow() + * @see #getLow() + * @generated + */ + void setLow(BigDecimal value); + + /** + * Unsets the value of the '{@link com.example.simple.Quote#getLow <em>Low</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #isSetLow() + * @see #getLow() + * @see #setLow(BigDecimal) + * @generated + */ + void unsetLow(); + + /** + * Returns whether the value of the '{@link com.example.simple.Quote#getLow <em>Low</em>}' attribute is set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return whether the value of the '<em>Low</em>' attribute is set. + * @see #unsetLow() + * @see #getLow() + * @see #setLow(BigDecimal) + * @generated + */ + boolean isSetLow(); + + /** + * Returns the value of the '<em><b>Volume</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Volume</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Volume</em>' attribute. + * @see #isSetVolume() + * @see #unsetVolume() + * @see #setVolume(double) + * @generated + */ + double getVolume(); + + /** + * Sets the value of the '{@link com.example.simple.Quote#getVolume <em>Volume</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Volume</em>' attribute. + * @see #isSetVolume() + * @see #unsetVolume() + * @see #getVolume() + * @generated + */ + void setVolume(double value); + + /** + * Unsets the value of the '{@link com.example.simple.Quote#getVolume <em>Volume</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #isSetVolume() + * @see #getVolume() + * @see #setVolume(double) + * @generated + */ + void unsetVolume(); + + /** + * Returns whether the value of the '{@link com.example.simple.Quote#getVolume <em>Volume</em>}' attribute is set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return whether the value of the '<em>Volume</em>' attribute is set. + * @see #unsetVolume() + * @see #getVolume() + * @see #setVolume(double) + * @generated + */ + boolean isSetVolume(); + + /** + * Returns the value of the '<em><b>Change1</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Change1</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Change1</em>' attribute. + * @see #isSetChange1() + * @see #unsetChange1() + * @see #setChange1(double) + * @generated + */ + double getChange1(); + + /** + * Sets the value of the '{@link com.example.simple.Quote#getChange1 <em>Change1</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Change1</em>' attribute. + * @see #isSetChange1() + * @see #unsetChange1() + * @see #getChange1() + * @generated + */ + void setChange1(double value); + + /** + * Unsets the value of the '{@link com.example.simple.Quote#getChange1 <em>Change1</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #isSetChange1() + * @see #getChange1() + * @see #setChange1(double) + * @generated + */ + void unsetChange1(); + + /** + * Returns whether the value of the '{@link com.example.simple.Quote#getChange1 <em>Change1</em>}' attribute is set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return whether the value of the '<em>Change1</em>' attribute is set. + * @see #unsetChange1() + * @see #getChange1() + * @see #setChange1(double) + * @generated + */ + boolean isSetChange1(); + + /** + * Returns the value of the '<em><b>Quotes</b></em>' containment reference list. + * The list contents are of type {@link com.example.simple.Quote}. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Quotes</em>' containment reference list isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Quotes</em>' containment reference list. + * @generated + */ + List getQuotes(); + +} // Quote diff --git a/branches/sdo-1.1-incubating/impl/src/test/java/com/example/simple/SimpleFactory.java b/branches/sdo-1.1-incubating/impl/src/test/java/com/example/simple/SimpleFactory.java new file mode 100644 index 0000000000..98dc01d69a --- /dev/null +++ b/branches/sdo-1.1-incubating/impl/src/test/java/com/example/simple/SimpleFactory.java @@ -0,0 +1,61 @@ +/** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package com.example.simple; + +import commonj.sdo.helper.HelperContext; + + +/** + * <!-- begin-user-doc --> + * The <b>Factory</b> for the model. + * It provides a create method for each non-abstract class of the model. + * <!-- end-user-doc --> + * @generated + */ +public interface SimpleFactory +{ + + /** + * The singleton instance of the factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + SimpleFactory INSTANCE = com.example.simple.impl.SimpleFactoryImpl.init(); + + /** + * Returns a new object of class '<em>Quote</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return a new object of class '<em>Quote</em>'. + * @generated + */ + Quote createQuote(); + + /** + * Registers the types supported by this Factory within the supplied scope.argument + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param scope an instance of HelperContext used to manage the scoping of types. + * @generated + */ + public void register(HelperContext scope); + +} //SimpleFactory diff --git a/branches/sdo-1.1-incubating/impl/src/test/java/com/example/simple/impl/QuoteImpl.java b/branches/sdo-1.1-incubating/impl/src/test/java/com/example/simple/impl/QuoteImpl.java new file mode 100644 index 0000000000..39af3bbdb2 --- /dev/null +++ b/branches/sdo-1.1-incubating/impl/src/test/java/com/example/simple/impl/QuoteImpl.java @@ -0,0 +1,1045 @@ +/** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package com.example.simple.impl; + +import com.example.simple.Quote; +import com.example.simple.SimpleFactory; + +import commonj.sdo.Type; + +import java.math.BigDecimal; + +import java.util.Collection; +import java.util.List; + +import org.apache.tuscany.sdo.impl.DataObjectBase; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Quote</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * <ul> + * <li>{@link com.example.simple.impl.QuoteImpl#getSymbol <em>Symbol</em>}</li> + * <li>{@link com.example.simple.impl.QuoteImpl#getCompanyName <em>Company Name</em>}</li> + * <li>{@link com.example.simple.impl.QuoteImpl#getPrice <em>Price</em>}</li> + * <li>{@link com.example.simple.impl.QuoteImpl#getOpen1 <em>Open1</em>}</li> + * <li>{@link com.example.simple.impl.QuoteImpl#getHigh <em>High</em>}</li> + * <li>{@link com.example.simple.impl.QuoteImpl#getLow <em>Low</em>}</li> + * <li>{@link com.example.simple.impl.QuoteImpl#getVolume <em>Volume</em>}</li> + * <li>{@link com.example.simple.impl.QuoteImpl#getChange1 <em>Change1</em>}</li> + * <li>{@link com.example.simple.impl.QuoteImpl#getQuotes <em>Quotes</em>}</li> + * </ul> + * </p> + * + * @generated + */ +public class QuoteImpl extends DataObjectBase implements Quote +{ + + public final static int SYMBOL = 0; + + public final static int COMPANY_NAME = 1; + + public final static int PRICE = 2; + + public final static int OPEN1 = 3; + + public final static int HIGH = 4; + + public final static int LOW = 5; + + public final static int VOLUME = 6; + + public final static int CHANGE1 = 7; + + public final static int QUOTES = 8; + + public final static int SDO_PROPERTY_COUNT = 9; + + public final static int EXTENDED_PROPERTY_COUNT = 0; + + + /** + * The internal feature id for the '<em><b>Symbol</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public final static int INTERNAL_SYMBOL = 0; + + /** + * The internal feature id for the '<em><b>Company Name</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public final static int INTERNAL_COMPANY_NAME = 1; + + /** + * The internal feature id for the '<em><b>Price</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public final static int INTERNAL_PRICE = 2; + + /** + * The internal feature id for the '<em><b>Open1</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public final static int INTERNAL_OPEN1 = 3; + + /** + * The internal feature id for the '<em><b>High</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public final static int INTERNAL_HIGH = 4; + + /** + * The internal feature id for the '<em><b>Low</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public final static int INTERNAL_LOW = 5; + + /** + * The internal feature id for the '<em><b>Volume</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public final static int INTERNAL_VOLUME = 6; + + /** + * The internal feature id for the '<em><b>Change1</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public final static int INTERNAL_CHANGE1 = 7; + + /** + * The internal feature id for the '<em><b>Quotes</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public final static int INTERNAL_QUOTES = 8; + + /** + * The number of properties for this type. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public final static int INTERNAL_PROPERTY_COUNT = 9; + + protected int internalConvertIndex(int internalIndex) + { + switch (internalIndex) + { + case INTERNAL_SYMBOL: return SYMBOL; + case INTERNAL_COMPANY_NAME: return COMPANY_NAME; + case INTERNAL_PRICE: return PRICE; + case INTERNAL_OPEN1: return OPEN1; + case INTERNAL_HIGH: return HIGH; + case INTERNAL_LOW: return LOW; + case INTERNAL_VOLUME: return VOLUME; + case INTERNAL_CHANGE1: return CHANGE1; + case INTERNAL_QUOTES: return QUOTES; + } + return super.internalConvertIndex(internalIndex); + } + + + /** + * The default value of the '{@link #getSymbol() <em>Symbol</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getSymbol() + * @generated + * @ordered + */ + protected static final String SYMBOL_DEFAULT_ = null; + + /** + * The cached value of the '{@link #getSymbol() <em>Symbol</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getSymbol() + * @generated + * @ordered + */ + protected String symbol = SYMBOL_DEFAULT_; + + /** + * This is true if the Symbol attribute has been set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + protected boolean symbol_set_ = false; + + /** + * The default value of the '{@link #getCompanyName() <em>Company Name</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getCompanyName() + * @generated + * @ordered + */ + protected static final String COMPANY_NAME_DEFAULT_ = null; + + /** + * The cached value of the '{@link #getCompanyName() <em>Company Name</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getCompanyName() + * @generated + * @ordered + */ + protected String companyName = COMPANY_NAME_DEFAULT_; + + /** + * This is true if the Company Name attribute has been set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + protected boolean companyName_set_ = false; + + /** + * The default value of the '{@link #getPrice() <em>Price</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getPrice() + * @generated + * @ordered + */ + protected static final BigDecimal PRICE_DEFAULT_ = null; + + /** + * The cached value of the '{@link #getPrice() <em>Price</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getPrice() + * @generated + * @ordered + */ + protected BigDecimal price = PRICE_DEFAULT_; + + /** + * This is true if the Price attribute has been set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + protected boolean price_set_ = false; + + /** + * The default value of the '{@link #getOpen1() <em>Open1</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getOpen1() + * @generated + * @ordered + */ + protected static final BigDecimal OPEN1_DEFAULT_ = null; + + /** + * The cached value of the '{@link #getOpen1() <em>Open1</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getOpen1() + * @generated + * @ordered + */ + protected BigDecimal open1 = OPEN1_DEFAULT_; + + /** + * This is true if the Open1 attribute has been set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + protected boolean open1_set_ = false; + + /** + * The default value of the '{@link #getHigh() <em>High</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getHigh() + * @generated + * @ordered + */ + protected static final BigDecimal HIGH_DEFAULT_ = null; + + /** + * The cached value of the '{@link #getHigh() <em>High</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getHigh() + * @generated + * @ordered + */ + protected BigDecimal high = HIGH_DEFAULT_; + + /** + * This is true if the High attribute has been set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + protected boolean high_set_ = false; + + /** + * The default value of the '{@link #getLow() <em>Low</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getLow() + * @generated + * @ordered + */ + protected static final BigDecimal LOW_DEFAULT_ = null; + + /** + * The cached value of the '{@link #getLow() <em>Low</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getLow() + * @generated + * @ordered + */ + protected BigDecimal low = LOW_DEFAULT_; + + /** + * This is true if the Low attribute has been set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + protected boolean low_set_ = false; + + /** + * The default value of the '{@link #getVolume() <em>Volume</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getVolume() + * @generated + * @ordered + */ + protected static final double VOLUME_DEFAULT_ = 0.0; + + /** + * The cached value of the '{@link #getVolume() <em>Volume</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getVolume() + * @generated + * @ordered + */ + protected double volume = VOLUME_DEFAULT_; + + /** + * This is true if the Volume attribute has been set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + protected boolean volume_set_ = false; + + /** + * The default value of the '{@link #getChange1() <em>Change1</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getChange1() + * @generated + * @ordered + */ + protected static final double CHANGE1_DEFAULT_ = 0.0; + + /** + * The cached value of the '{@link #getChange1() <em>Change1</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getChange1() + * @generated + * @ordered + */ + protected double change1 = CHANGE1_DEFAULT_; + + /** + * This is true if the Change1 attribute has been set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + protected boolean change1_set_ = false; + + /** + * The cached value of the '{@link #getQuotes() <em>Quotes</em>}' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getQuotes() + * @generated + * @ordered + */ + + protected List quotes = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public QuoteImpl() + { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public Type getStaticType() + { + return ((SimpleFactoryImpl)SimpleFactory.INSTANCE).getQuote(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String getSymbol() + { + return symbol; + } + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setSymbol(String newSymbol) + { + String oldSymbol = symbol; + symbol = newSymbol; + boolean oldSymbol_set_ = symbol_set_; + symbol_set_ = true; + if (isNotifying()) + notify(ChangeKind.SET, SYMBOL, oldSymbol, symbol, !oldSymbol_set_); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void unsetSymbol() + { + String oldSymbol = symbol; + boolean oldSymbol_set_ = symbol_set_; + symbol = SYMBOL_DEFAULT_; + symbol_set_ = false; + if (isNotifying()) + notify(ChangeKind.UNSET, SYMBOL, oldSymbol, SYMBOL_DEFAULT_, oldSymbol_set_); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean isSetSymbol() + { + return symbol_set_; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String getCompanyName() + { + return companyName; + } + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setCompanyName(String newCompanyName) + { + String oldCompanyName = companyName; + companyName = newCompanyName; + boolean oldCompanyName_set_ = companyName_set_; + companyName_set_ = true; + if (isNotifying()) + notify(ChangeKind.SET, COMPANY_NAME, oldCompanyName, companyName, !oldCompanyName_set_); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void unsetCompanyName() + { + String oldCompanyName = companyName; + boolean oldCompanyName_set_ = companyName_set_; + companyName = COMPANY_NAME_DEFAULT_; + companyName_set_ = false; + if (isNotifying()) + notify(ChangeKind.UNSET, COMPANY_NAME, oldCompanyName, COMPANY_NAME_DEFAULT_, oldCompanyName_set_); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean isSetCompanyName() + { + return companyName_set_; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public BigDecimal getPrice() + { + return price; + } + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setPrice(BigDecimal newPrice) + { + BigDecimal oldPrice = price; + price = newPrice; + boolean oldPrice_set_ = price_set_; + price_set_ = true; + if (isNotifying()) + notify(ChangeKind.SET, PRICE, oldPrice, price, !oldPrice_set_); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void unsetPrice() + { + BigDecimal oldPrice = price; + boolean oldPrice_set_ = price_set_; + price = PRICE_DEFAULT_; + price_set_ = false; + if (isNotifying()) + notify(ChangeKind.UNSET, PRICE, oldPrice, PRICE_DEFAULT_, oldPrice_set_); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean isSetPrice() + { + return price_set_; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public BigDecimal getOpen1() + { + return open1; + } + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setOpen1(BigDecimal newOpen1) + { + BigDecimal oldOpen1 = open1; + open1 = newOpen1; + boolean oldOpen1_set_ = open1_set_; + open1_set_ = true; + if (isNotifying()) + notify(ChangeKind.SET, OPEN1, oldOpen1, open1, !oldOpen1_set_); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void unsetOpen1() + { + BigDecimal oldOpen1 = open1; + boolean oldOpen1_set_ = open1_set_; + open1 = OPEN1_DEFAULT_; + open1_set_ = false; + if (isNotifying()) + notify(ChangeKind.UNSET, OPEN1, oldOpen1, OPEN1_DEFAULT_, oldOpen1_set_); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean isSetOpen1() + { + return open1_set_; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public BigDecimal getHigh() + { + return high; + } + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setHigh(BigDecimal newHigh) + { + BigDecimal oldHigh = high; + high = newHigh; + boolean oldHigh_set_ = high_set_; + high_set_ = true; + if (isNotifying()) + notify(ChangeKind.SET, HIGH, oldHigh, high, !oldHigh_set_); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void unsetHigh() + { + BigDecimal oldHigh = high; + boolean oldHigh_set_ = high_set_; + high = HIGH_DEFAULT_; + high_set_ = false; + if (isNotifying()) + notify(ChangeKind.UNSET, HIGH, oldHigh, HIGH_DEFAULT_, oldHigh_set_); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean isSetHigh() + { + return high_set_; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public BigDecimal getLow() + { + return low; + } + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setLow(BigDecimal newLow) + { + BigDecimal oldLow = low; + low = newLow; + boolean oldLow_set_ = low_set_; + low_set_ = true; + if (isNotifying()) + notify(ChangeKind.SET, LOW, oldLow, low, !oldLow_set_); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void unsetLow() + { + BigDecimal oldLow = low; + boolean oldLow_set_ = low_set_; + low = LOW_DEFAULT_; + low_set_ = false; + if (isNotifying()) + notify(ChangeKind.UNSET, LOW, oldLow, LOW_DEFAULT_, oldLow_set_); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean isSetLow() + { + return low_set_; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public double getVolume() + { + return volume; + } + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setVolume(double newVolume) + { + double oldVolume = volume; + volume = newVolume; + boolean oldVolume_set_ = volume_set_; + volume_set_ = true; + if (isNotifying()) + notify(ChangeKind.SET, VOLUME, oldVolume, volume, !oldVolume_set_); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void unsetVolume() + { + double oldVolume = volume; + boolean oldVolume_set_ = volume_set_; + volume = VOLUME_DEFAULT_; + volume_set_ = false; + if (isNotifying()) + notify(ChangeKind.UNSET, VOLUME, oldVolume, VOLUME_DEFAULT_, oldVolume_set_); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean isSetVolume() + { + return volume_set_; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public double getChange1() + { + return change1; + } + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setChange1(double newChange1) + { + double oldChange1 = change1; + change1 = newChange1; + boolean oldChange1_set_ = change1_set_; + change1_set_ = true; + if (isNotifying()) + notify(ChangeKind.SET, CHANGE1, oldChange1, change1, !oldChange1_set_); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void unsetChange1() + { + double oldChange1 = change1; + boolean oldChange1_set_ = change1_set_; + change1 = CHANGE1_DEFAULT_; + change1_set_ = false; + if (isNotifying()) + notify(ChangeKind.UNSET, CHANGE1, oldChange1, CHANGE1_DEFAULT_, oldChange1_set_); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean isSetChange1() + { + return change1_set_; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public List getQuotes() + { + if (quotes == null) + { + quotes = createPropertyList(ListKind.CONTAINMENT, Quote.class, QUOTES, 0); + } + return quotes; + } + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public ChangeContext inverseRemove(Object otherEnd, int propertyIndex, ChangeContext changeContext) + { + switch (propertyIndex) + { + case QUOTES: + return removeFromList(getQuotes(), otherEnd, changeContext); + } + return super.inverseRemove(otherEnd, propertyIndex, changeContext); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public Object get(int propertyIndex, boolean resolve) + { + switch (propertyIndex) + { + case SYMBOL: + return getSymbol(); + case COMPANY_NAME: + return getCompanyName(); + case PRICE: + return getPrice(); + case OPEN1: + return getOpen1(); + case HIGH: + return getHigh(); + case LOW: + return getLow(); + case VOLUME: + return new Double(getVolume()); + case CHANGE1: + return new Double(getChange1()); + case QUOTES: + return getQuotes(); + } + return super.get(propertyIndex, resolve); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void set(int propertyIndex, Object newValue) + { + switch (propertyIndex) + { + case SYMBOL: + setSymbol((String)newValue); + return; + case COMPANY_NAME: + setCompanyName((String)newValue); + return; + case PRICE: + setPrice((BigDecimal)newValue); + return; + case OPEN1: + setOpen1((BigDecimal)newValue); + return; + case HIGH: + setHigh((BigDecimal)newValue); + return; + case LOW: + setLow((BigDecimal)newValue); + return; + case VOLUME: + setVolume(((Double)newValue).doubleValue()); + return; + case CHANGE1: + setChange1(((Double)newValue).doubleValue()); + return; + case QUOTES: + getQuotes().clear(); + getQuotes().addAll((Collection)newValue); + return; + } + super.set(propertyIndex, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void unset(int propertyIndex) + { + switch (propertyIndex) + { + case SYMBOL: + unsetSymbol(); + return; + case COMPANY_NAME: + unsetCompanyName(); + return; + case PRICE: + unsetPrice(); + return; + case OPEN1: + unsetOpen1(); + return; + case HIGH: + unsetHigh(); + return; + case LOW: + unsetLow(); + return; + case VOLUME: + unsetVolume(); + return; + case CHANGE1: + unsetChange1(); + return; + case QUOTES: + getQuotes().clear(); + return; + } + super.unset(propertyIndex); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean isSet(int propertyIndex) + { + switch (propertyIndex) + { + case SYMBOL: + return isSetSymbol(); + case COMPANY_NAME: + return isSetCompanyName(); + case PRICE: + return isSetPrice(); + case OPEN1: + return isSetOpen1(); + case HIGH: + return isSetHigh(); + case LOW: + return isSetLow(); + case VOLUME: + return isSetVolume(); + case CHANGE1: + return isSetChange1(); + case QUOTES: + return quotes != null && !quotes.isEmpty(); + } + return super.isSet(propertyIndex); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String toString() + { + if (isProxy(this)) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (symbol: "); + if (symbol_set_) result.append(symbol); else result.append("<unset>"); + result.append(", companyName: "); + if (companyName_set_) result.append(companyName); else result.append("<unset>"); + result.append(", price: "); + if (price_set_) result.append(price); else result.append("<unset>"); + result.append(", open1: "); + if (open1_set_) result.append(open1); else result.append("<unset>"); + result.append(", high: "); + if (high_set_) result.append(high); else result.append("<unset>"); + result.append(", low: "); + if (low_set_) result.append(low); else result.append("<unset>"); + result.append(", volume: "); + if (volume_set_) result.append(volume); else result.append("<unset>"); + result.append(", change1: "); + if (change1_set_) result.append(change1); else result.append("<unset>"); + result.append(')'); + return result.toString(); + } + +} //QuoteImpl diff --git a/branches/sdo-1.1-incubating/impl/src/test/java/com/example/simple/impl/SimpleFactoryImpl.java b/branches/sdo-1.1-incubating/impl/src/test/java/com/example/simple/impl/SimpleFactoryImpl.java new file mode 100644 index 0000000000..51099d70a7 --- /dev/null +++ b/branches/sdo-1.1-incubating/impl/src/test/java/com/example/simple/impl/SimpleFactoryImpl.java @@ -0,0 +1,330 @@ +/** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package com.example.simple.impl; + +import commonj.sdo.helper.HelperContext; +import org.apache.tuscany.sdo.helper.TypeHelperImpl; + +import com.example.simple.*; + +import commonj.sdo.DataObject; +import commonj.sdo.Property; +import commonj.sdo.Type; + +import org.apache.tuscany.sdo.SDOFactory; + +import org.apache.tuscany.sdo.impl.FactoryBase; + +import org.apache.tuscany.sdo.model.ModelFactory; + +import org.apache.tuscany.sdo.model.impl.ModelFactoryImpl; + +import org.apache.tuscany.sdo.model.internal.InternalFactory; + +import org.apache.tuscany.sdo.util.SDOUtil; + +/** + * <!-- begin-user-doc --> + * An implementation of the model <b>Factory</b>. + * Generator information: + * patternVersion=1.2; + * <!-- end-user-doc --> + * @generated + */ +public class SimpleFactoryImpl extends FactoryBase implements SimpleFactory +{ + + /** + * The package namespace URI. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static final String NAMESPACE_URI = "http://www.example.com/simple"; + + /** + * The package namespace name. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static final String NAMESPACE_PREFIX = "simple"; + + /** + * The version of the generator pattern used to generate this class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static final String PATTERN_VERSION = "1.2"; + + public static final int QUOTE = 1; + + /** + * Creates an instance of the factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public SimpleFactoryImpl() + { + super(NAMESPACE_URI, NAMESPACE_PREFIX, "com.example.simple"); + } + + /** + * Registers the Factory instance so that it is available within the supplied scope. + * @argument scope a HelperContext instance that will make the types supported by this Factory available. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void register(HelperContext scope) { + if(scope == null) { + throw new IllegalArgumentException("Scope can not be null"); + } + TypeHelperImpl th = (TypeHelperImpl)scope.getTypeHelper(); + th.getExtendedMetaData().putPackage(NAMESPACE_URI, this); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public DataObject create(int typeNumber) + { + switch (typeNumber) + { + case QUOTE: return (DataObject)createQuote(); + default: + return super.create(typeNumber); + } + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public Quote createQuote() + { + QuoteImpl quote = new QuoteImpl(); + return quote; + } + + // Following creates and initializes SDO metadata for the supported types. + protected Type quoteType = null; + + public Type getQuote() + { + return quoteType; + } + + + private static boolean isInited = false; + + public static SimpleFactoryImpl init() + { + if (isInited) return (SimpleFactoryImpl)FactoryBase.getStaticFactory(SimpleFactoryImpl.NAMESPACE_URI); + SimpleFactoryImpl theSimpleFactoryImpl = new SimpleFactoryImpl(); + isInited = true; + + // Initialize dependencies + SDOUtil.registerStaticTypes(SDOFactory.class); + SDOUtil.registerStaticTypes(ModelFactory.class); + SDOUtil.registerStaticTypes(InternalFactory.class); + + // Create package meta-data objects + theSimpleFactoryImpl.createMetaData(); + + // Initialize created meta-data + theSimpleFactoryImpl.initializeMetaData(); + + // Mark meta-data to indicate it can't be changed + //theSimpleFactoryImpl.freeze(); //FB do we need to freeze / should we freeze ???? + + return theSimpleFactoryImpl; + } + + private boolean isCreated = false; + + public void createMetaData() + { + if (isCreated) return; + isCreated = true; + + // Create types and their properties + quoteType = createType(false, QUOTE); + createProperty(true, quoteType,QuoteImpl.INTERNAL_SYMBOL); + createProperty(true, quoteType,QuoteImpl.INTERNAL_COMPANY_NAME); + createProperty(true, quoteType,QuoteImpl.INTERNAL_PRICE); + createProperty(true, quoteType,QuoteImpl.INTERNAL_OPEN1); + createProperty(true, quoteType,QuoteImpl.INTERNAL_HIGH); + createProperty(true, quoteType,QuoteImpl.INTERNAL_LOW); + createProperty(true, quoteType,QuoteImpl.INTERNAL_VOLUME); + createProperty(true, quoteType,QuoteImpl.INTERNAL_CHANGE1); + createProperty(false, quoteType,QuoteImpl.INTERNAL_QUOTES); + } + + private boolean isInitialized = false; + + public void initializeMetaData() + { + if (isInitialized) return; + isInitialized = true; + + // Obtain other dependent packages + ModelFactoryImpl theModelPackageImpl = (ModelFactoryImpl)FactoryBase.getStaticFactory(ModelFactoryImpl.NAMESPACE_URI); + Property property = null; + + // Add supertypes to types + + // Initialize types and properties + initializeType(quoteType, Quote.class, "Quote", false); + property = getLocalProperty(quoteType, 0); + initializeProperty(property, theModelPackageImpl.getString(), "symbol", null, 1, 1, Quote.class, false, true, false); + + property = getLocalProperty(quoteType, 1); + initializeProperty(property, theModelPackageImpl.getString(), "companyName", null, 1, 1, Quote.class, false, true, false); + + property = getLocalProperty(quoteType, 2); + initializeProperty(property, theModelPackageImpl.getDecimal(), "price", null, 1, 1, Quote.class, false, true, false); + + property = getLocalProperty(quoteType, 3); + initializeProperty(property, theModelPackageImpl.getDecimal(), "open1", null, 1, 1, Quote.class, false, true, false); + + property = getLocalProperty(quoteType, 4); + initializeProperty(property, theModelPackageImpl.getDecimal(), "high", null, 1, 1, Quote.class, false, true, false); + + property = getLocalProperty(quoteType, 5); + initializeProperty(property, theModelPackageImpl.getDecimal(), "low", null, 1, 1, Quote.class, false, true, false); + + property = getLocalProperty(quoteType, 6); + initializeProperty(property, theModelPackageImpl.getDouble(), "volume", null, 1, 1, Quote.class, false, true, false); + + property = getLocalProperty(quoteType, 7); + initializeProperty(property, theModelPackageImpl.getDouble(), "change1", null, 1, 1, Quote.class, false, true, false); + + property = getLocalProperty(quoteType, 8); + initializeProperty(property, this.getQuote(), "quotes", null, 0, -1, Quote.class, false, false, false, true , null); + + createXSDMetaData(theModelPackageImpl); + } + + protected void createXSDMetaData(ModelFactoryImpl theModelPackageImpl) + { + super.initXSD(); + + Property property = null; + + + property = createGlobalProperty + ("stockQuote", + this.getQuote(), + new String[] + { + "kind", "element", + "name", "stockQuote", + "namespace", "##targetNamespace" + }); + + addXSDMapping + (quoteType, + new String[] + { + "name", "Quote", + "kind", "elementOnly" + }); + + addXSDMapping + (getProperty(quoteType, QuoteImpl.INTERNAL_SYMBOL), + new String[] + { + "kind", "element", + "name", "symbol" + }); + + addXSDMapping + (getProperty(quoteType, QuoteImpl.INTERNAL_COMPANY_NAME), + new String[] + { + "kind", "element", + "name", "companyName" + }); + + addXSDMapping + (getProperty(quoteType, QuoteImpl.INTERNAL_PRICE), + new String[] + { + "kind", "element", + "name", "price" + }); + + addXSDMapping + (getProperty(quoteType, QuoteImpl.INTERNAL_OPEN1), + new String[] + { + "kind", "element", + "name", "open1" + }); + + addXSDMapping + (getProperty(quoteType, QuoteImpl.INTERNAL_HIGH), + new String[] + { + "kind", "element", + "name", "high" + }); + + addXSDMapping + (getProperty(quoteType, QuoteImpl.INTERNAL_LOW), + new String[] + { + "kind", "element", + "name", "low" + }); + + addXSDMapping + (getProperty(quoteType, QuoteImpl.INTERNAL_VOLUME), + new String[] + { + "kind", "element", + "name", "volume" + }); + + addXSDMapping + (getProperty(quoteType, QuoteImpl.INTERNAL_CHANGE1), + new String[] + { + "kind", "element", + "name", "change1" + }); + + addXSDMapping + (getProperty(quoteType, QuoteImpl.INTERNAL_QUOTES), + new String[] + { + "kind", "element", + "name", "quotes" + }); + + } + +} //SimpleFactoryImpl diff --git a/branches/sdo-1.1-incubating/impl/src/test/java/com/example/test/Containment/ContainmentFactory.java b/branches/sdo-1.1-incubating/impl/src/test/java/com/example/test/Containment/ContainmentFactory.java new file mode 100644 index 0000000000..c8ee9a96c8 --- /dev/null +++ b/branches/sdo-1.1-incubating/impl/src/test/java/com/example/test/Containment/ContainmentFactory.java @@ -0,0 +1,61 @@ +/** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package com.example.test.Containment; + +import commonj.sdo.helper.HelperContext; + + +/** + * <!-- begin-user-doc --> + * The <b>Factory</b> for the model. + * It provides a create method for each non-abstract class of the model. + * <!-- end-user-doc --> + * @generated + */ +public interface ContainmentFactory +{ + + /** + * The singleton instance of the factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + ContainmentFactory INSTANCE = com.example.test.Containment.impl.ContainmentFactoryImpl.init(); + + /** + * Returns a new object of class '<em>Test</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return a new object of class '<em>Test</em>'. + * @generated + */ + ContainmentTest createContainmentTest(); + + /** + * Registers the types supported by this Factory within the supplied scope.argument + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param scope an instance of HelperContext used to manage the scoping of types. + * @generated + */ + public void register(HelperContext scope); + +} //ContainmentFactory diff --git a/branches/sdo-1.1-incubating/impl/src/test/java/com/example/test/Containment/ContainmentTest.java b/branches/sdo-1.1-incubating/impl/src/test/java/com/example/test/Containment/ContainmentTest.java new file mode 100644 index 0000000000..64734b8862 --- /dev/null +++ b/branches/sdo-1.1-incubating/impl/src/test/java/com/example/test/Containment/ContainmentTest.java @@ -0,0 +1,177 @@ +/** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT 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.test.Containment; + +import commonj.sdo.Sequence; + +import java.io.Serializable; + +import java.util.List; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Test</b></em>'. + * <!-- end-user-doc --> + * + * <p> + * The following features are supported: + * <ul> + * <li>{@link com.example.test.Containment.ContainmentTest#getMixed <em>Mixed</em>}</li> + * <li>{@link com.example.test.Containment.ContainmentTest#getName <em>Name</em>}</li> + * <li>{@link com.example.test.Containment.ContainmentTest#getContain <em>Contain</em>}</li> + * <li>{@link com.example.test.Containment.ContainmentTest#getContainMany <em>Contain Many</em>}</li> + * </ul> + * </p> + * + * @extends Serializable + * @generated + */ +public interface ContainmentTest extends Serializable +{ + /** + * Returns the value of the '<em><b>Mixed</b></em>' attribute list. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Mixed</em>' attribute list isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Mixed</em>' attribute list. + * @generated + */ + Sequence getMixed(); + + /** + * Returns the value of the '<em><b>Name</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Name</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Name</em>' attribute. + * @see #isSetName() + * @see #unsetName() + * @see #setName(String) + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link com.example.test.Containment.ContainmentTest#getName <em>Name</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Name</em>' attribute. + * @see #isSetName() + * @see #unsetName() + * @see #getName() + * @generated + */ + void setName(String value); + + /** + * Unsets the value of the '{@link com.example.test.Containment.ContainmentTest#getName <em>Name</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #isSetName() + * @see #getName() + * @see #setName(String) + * @generated + */ + void unsetName(); + + /** + * Returns whether the value of the '{@link com.example.test.Containment.ContainmentTest#getName <em>Name</em>}' attribute is set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return whether the value of the '<em>Name</em>' attribute is set. + * @see #unsetName() + * @see #getName() + * @see #setName(String) + * @generated + */ + boolean isSetName(); + + /** + * Returns the value of the '<em><b>Contain</b></em>' containment reference. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Contain</em>' containment reference isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Contain</em>' containment reference. + * @see #isSetContain() + * @see #unsetContain() + * @see #setContain(ContainmentTest) + * @generated + */ + ContainmentTest getContain(); + + /** + * Sets the value of the '{@link com.example.test.Containment.ContainmentTest#getContain <em>Contain</em>}' containment reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Contain</em>' containment reference. + * @see #isSetContain() + * @see #unsetContain() + * @see #getContain() + * @generated + */ + void setContain(ContainmentTest value); + + /** + * Unsets the value of the '{@link com.example.test.Containment.ContainmentTest#getContain <em>Contain</em>}' containment reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #isSetContain() + * @see #getContain() + * @see #setContain(ContainmentTest) + * @generated + */ + void unsetContain(); + + /** + * Returns whether the value of the '{@link com.example.test.Containment.ContainmentTest#getContain <em>Contain</em>}' containment reference is set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return whether the value of the '<em>Contain</em>' containment reference is set. + * @see #unsetContain() + * @see #getContain() + * @see #setContain(ContainmentTest) + * @generated + */ + boolean isSetContain(); + + /** + * Returns the value of the '<em><b>Contain Many</b></em>' containment reference list. + * The list contents are of type {@link com.example.test.Containment.ContainmentTest}. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Contain Many</em>' containment reference list isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Contain Many</em>' containment reference list. + * @generated + */ + List getContainMany(); + +} // ContainmentTest diff --git a/branches/sdo-1.1-incubating/impl/src/test/java/com/example/test/Containment/impl/ContainmentFactoryImpl.java b/branches/sdo-1.1-incubating/impl/src/test/java/com/example/test/Containment/impl/ContainmentFactoryImpl.java new file mode 100644 index 0000000000..9f51d02590 --- /dev/null +++ b/branches/sdo-1.1-incubating/impl/src/test/java/com/example/test/Containment/impl/ContainmentFactoryImpl.java @@ -0,0 +1,270 @@ +/** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package com.example.test.Containment.impl; + +import commonj.sdo.helper.HelperContext; +import org.apache.tuscany.sdo.helper.TypeHelperImpl; + +import com.example.test.Containment.*; + +import commonj.sdo.DataObject; +import commonj.sdo.Property; +import commonj.sdo.Type; + +import org.apache.tuscany.sdo.SDOFactory; + +import org.apache.tuscany.sdo.impl.FactoryBase; + +import org.apache.tuscany.sdo.model.ModelFactory; + +import org.apache.tuscany.sdo.model.impl.ModelFactoryImpl; + +import org.apache.tuscany.sdo.model.internal.InternalFactory; + +import org.apache.tuscany.sdo.util.SDOUtil; + +/** + * <!-- begin-user-doc --> + * An implementation of the model <b>Factory</b>. + * Generator information: + * patternVersion=1.2; -prefix Containment + * <!-- end-user-doc --> + * @generated + */ +public class ContainmentFactoryImpl extends FactoryBase implements ContainmentFactory +{ + + /** + * The package namespace URI. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static final String NAMESPACE_URI = "http://www.example.com/ContainmentTest"; + + /** + * The package namespace name. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static final String NAMESPACE_PREFIX = "contain"; + + /** + * The version of the generator pattern used to generate this class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static final String PATTERN_VERSION = "1.2"; + + public static final int CONTAINMENT_TEST = 1; + + /** + * Creates an instance of the factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public ContainmentFactoryImpl() + { + super(NAMESPACE_URI, NAMESPACE_PREFIX, "com.example.test.Containment"); + } + + /** + * Registers the Factory instance so that it is available within the supplied scope. + * @argument scope a HelperContext instance that will make the types supported by this Factory available. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void register(HelperContext scope) { + if(scope == null) { + throw new IllegalArgumentException("Scope can not be null"); + } + TypeHelperImpl th = (TypeHelperImpl)scope.getTypeHelper(); + th.getExtendedMetaData().putPackage(NAMESPACE_URI, this); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public DataObject create(int typeNumber) + { + switch (typeNumber) + { + case CONTAINMENT_TEST: return (DataObject)createContainmentTest(); + default: + return super.create(typeNumber); + } + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public ContainmentTest createContainmentTest() + { + ContainmentTestImpl containmentTest = new ContainmentTestImpl(); + return containmentTest; + } + + // Following creates and initializes SDO metadata for the supported types. + protected Type containmentTestType = null; + + public Type getContainmentTest() + { + return containmentTestType; + } + + + private static boolean isInited = false; + + public static ContainmentFactoryImpl init() + { + if (isInited) return (ContainmentFactoryImpl)FactoryBase.getStaticFactory(ContainmentFactoryImpl.NAMESPACE_URI); + ContainmentFactoryImpl theContainmentFactoryImpl = new ContainmentFactoryImpl(); + isInited = true; + + // Initialize dependencies + SDOUtil.registerStaticTypes(SDOFactory.class); + SDOUtil.registerStaticTypes(ModelFactory.class); + SDOUtil.registerStaticTypes(InternalFactory.class); + + // Create package meta-data objects + theContainmentFactoryImpl.createMetaData(); + + // Initialize created meta-data + theContainmentFactoryImpl.initializeMetaData(); + + // Mark meta-data to indicate it can't be changed + //theContainmentFactoryImpl.freeze(); //FB do we need to freeze / should we freeze ???? + + return theContainmentFactoryImpl; + } + + private boolean isCreated = false; + + public void createMetaData() + { + if (isCreated) return; + isCreated = true; + + // Create types and their properties + containmentTestType = createType(false, CONTAINMENT_TEST); + createProperty(true, containmentTestType,ContainmentTestImpl.INTERNAL_MIXED); + createProperty(true, containmentTestType,ContainmentTestImpl.INTERNAL_NAME); + createProperty(false, containmentTestType,ContainmentTestImpl.INTERNAL_CONTAIN); + createProperty(false, containmentTestType,ContainmentTestImpl.INTERNAL_CONTAIN_MANY); + } + + private boolean isInitialized = false; + + public void initializeMetaData() + { + if (isInitialized) return; + isInitialized = true; + + // Obtain other dependent packages + ModelFactoryImpl theModelPackageImpl = (ModelFactoryImpl)FactoryBase.getStaticFactory(ModelFactoryImpl.NAMESPACE_URI); + Property property = null; + + // Add supertypes to types + + // Initialize types and properties + initializeType(containmentTestType, ContainmentTest.class, "ContainmentTest", false); + property = getLocalProperty(containmentTestType, 0); + initializeProperty(property, getSequence(), "mixed", null, 0, -1, ContainmentTest.class, false, false, false); + + property = getLocalProperty(containmentTestType, 1); + initializeProperty(property, theModelPackageImpl.getString(), "Name", null, 1, 1, ContainmentTest.class, false, true, true); + + property = getLocalProperty(containmentTestType, 2); + initializeProperty(property, this.getContainmentTest(), "Contain", null, 1, 1, ContainmentTest.class, false, true, true, true , null); + + property = getLocalProperty(containmentTestType, 3); + initializeProperty(property, this.getContainmentTest(), "ContainMany", null, 0, -1, ContainmentTest.class, false, false, true, true , null); + + createXSDMetaData(theModelPackageImpl); + } + + protected void createXSDMetaData(ModelFactoryImpl theModelPackageImpl) + { + super.initXSD(); + + Property property = null; + + + addXSDMapping + (containmentTestType, + new String[] + { + "name", "ContainmentTest", + "kind", "mixed" + }); + + addXSDMapping + (getProperty(containmentTestType, ContainmentTestImpl.INTERNAL_MIXED), + new String[] + { + "kind", "elementWildcard", + "name", ":mixed" + }); + + addXSDMapping + (getProperty(containmentTestType, ContainmentTestImpl.INTERNAL_NAME), + new String[] + { + "kind", "element", + "name", "Name" + }); + + addXSDMapping + (getProperty(containmentTestType, ContainmentTestImpl.INTERNAL_CONTAIN), + new String[] + { + "kind", "element", + "name", "Contain" + }); + + addXSDMapping + (getProperty(containmentTestType, ContainmentTestImpl.INTERNAL_CONTAIN_MANY), + new String[] + { + "kind", "element", + "name", "ContainMany" + }); + + property = createGlobalProperty + ("containTestInstance", + this.getContainmentTest(), + new String[] + { + "kind", "element", + "name", "containTestInstance", + "namespace", "##targetNamespace" + }); + + } + +} //ContainmentFactoryImpl diff --git a/branches/sdo-1.1-incubating/impl/src/test/java/com/example/test/Containment/impl/ContainmentTestImpl.java b/branches/sdo-1.1-incubating/impl/src/test/java/com/example/test/Containment/impl/ContainmentTestImpl.java new file mode 100644 index 0000000000..14d4678d2d --- /dev/null +++ b/branches/sdo-1.1-incubating/impl/src/test/java/com/example/test/Containment/impl/ContainmentTestImpl.java @@ -0,0 +1,409 @@ +/** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT 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.test.Containment.impl; + +import com.example.test.Containment.ContainmentFactory; +import com.example.test.Containment.ContainmentTest; + +import commonj.sdo.Sequence; +import commonj.sdo.Type; + +import java.util.Collection; +import java.util.List; + +import org.apache.tuscany.sdo.impl.DataObjectBase; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Test</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * <ul> + * <li>{@link com.example.test.Containment.impl.ContainmentTestImpl#getMixed <em>Mixed</em>}</li> + * <li>{@link com.example.test.Containment.impl.ContainmentTestImpl#getName <em>Name</em>}</li> + * <li>{@link com.example.test.Containment.impl.ContainmentTestImpl#getContain <em>Contain</em>}</li> + * <li>{@link com.example.test.Containment.impl.ContainmentTestImpl#getContainMany <em>Contain Many</em>}</li> + * </ul> + * </p> + * + * @generated + */ +public class ContainmentTestImpl extends DataObjectBase implements ContainmentTest +{ + + public final static int MIXED = -1; + + public final static int NAME = 0; + + public final static int CONTAIN = 1; + + public final static int CONTAIN_MANY = 2; + + public final static int SDO_PROPERTY_COUNT = 3; + + public final static int EXTENDED_PROPERTY_COUNT = -1; + + + /** + * The internal feature id for the '<em><b>Mixed</b></em>' attribute list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public final static int INTERNAL_MIXED = 0; + + /** + * The internal feature id for the '<em><b>Name</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public final static int INTERNAL_NAME = 1; + + /** + * The internal feature id for the '<em><b>Contain</b></em>' containment reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public final static int INTERNAL_CONTAIN = 2; + + /** + * The internal feature id for the '<em><b>Contain Many</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public final static int INTERNAL_CONTAIN_MANY = 3; + + /** + * The number of properties for this type. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public final static int INTERNAL_PROPERTY_COUNT = 4; + + protected int internalConvertIndex(int internalIndex) + { + switch (internalIndex) + { + case INTERNAL_MIXED: return MIXED; + case INTERNAL_NAME: return NAME; + case INTERNAL_CONTAIN: return CONTAIN; + case INTERNAL_CONTAIN_MANY: return CONTAIN_MANY; + } + return super.internalConvertIndex(internalIndex); + } + + + /** + * The cached value of the '{@link #getMixed() <em>Mixed</em>}' attribute list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getMixed() + * @generated + * @ordered + */ + + protected Sequence mixed = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public ContainmentTestImpl() + { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public Type getStaticType() + { + return ((ContainmentFactoryImpl)ContainmentFactory.INSTANCE).getContainmentTest(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public Sequence getMixed() + { + if (mixed == null) + { + mixed = createSequence(INTERNAL_MIXED); + } + return mixed; + } + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String getName() + { + return (String)get(getMixed(), getType(), INTERNAL_NAME); + } + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setName(String newName) + { + set(getMixed(), getType(), INTERNAL_NAME, newName); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void unsetName() + { + unset(getMixed(), getType(), INTERNAL_NAME); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean isSetName() + { + return isSet(getMixed(), getType(), INTERNAL_NAME); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public ContainmentTest getContain() + { + return (ContainmentTest)get(getMixed(), getType(), INTERNAL_CONTAIN); + } + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public ChangeContext basicSetContain(ContainmentTest newContain, ChangeContext changeContext) + { + return basicAdd(getMixed(), getType(), INTERNAL_CONTAIN, newContain, changeContext); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setContain(ContainmentTest newContain) + { + set(getMixed(), getType(), INTERNAL_CONTAIN, newContain); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public ChangeContext basicUnsetContain(ChangeContext changeContext) + { + // TODO: implement this method to unset the contained 'Contain' containment reference + // -> this method is automatically invoked to keep the containment relationship in synch + // -> do not modify other features + // -> return changeContext, after adding any generated Notification to it (if it is null, a NotificationChain object must be created first) + // Ensure that you remove @generated or mark it @generated NOT + throw new UnsupportedOperationException(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void unsetContain() + { + unset(getMixed(), getType(), INTERNAL_CONTAIN); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean isSetContain() + { + return isSet(getMixed(), getType(), INTERNAL_CONTAIN); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public List getContainMany() + { + return getList(getMixed(), getType(), INTERNAL_CONTAIN_MANY); + } + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public ChangeContext inverseRemove(Object otherEnd, int propertyIndex, ChangeContext changeContext) + { + switch (propertyIndex) + { + case MIXED: + return removeFromSequence(getMixed(), otherEnd, changeContext); + case CONTAIN: + return basicUnsetContain(changeContext); + case CONTAIN_MANY: + return removeFromList(getContainMany(), otherEnd, changeContext); + } + return super.inverseRemove(otherEnd, propertyIndex, changeContext); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public Object get(int propertyIndex, boolean resolve) + { + switch (propertyIndex) + { + case MIXED: + // XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view + //if (coreType) + return getMixed(); + case NAME: + return getName(); + case CONTAIN: + return getContain(); + case CONTAIN_MANY: + return getContainMany(); + } + return super.get(propertyIndex, resolve); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void set(int propertyIndex, Object newValue) + { + switch (propertyIndex) + { + case MIXED: + setSequence(getMixed(), newValue); + return; + case NAME: + setName((String)newValue); + return; + case CONTAIN: + setContain((ContainmentTest)newValue); + return; + case CONTAIN_MANY: + getContainMany().clear(); + getContainMany().addAll((Collection)newValue); + return; + } + super.set(propertyIndex, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void unset(int propertyIndex) + { + switch (propertyIndex) + { + case MIXED: + unsetSequence(getMixed()); + return; + case NAME: + unsetName(); + return; + case CONTAIN: + unsetContain(); + return; + case CONTAIN_MANY: + getContainMany().clear(); + return; + } + super.unset(propertyIndex); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean isSet(int propertyIndex) + { + switch (propertyIndex) + { + case MIXED: + return mixed != null && !isSequenceEmpty(getMixed()); + case NAME: + return isSetName(); + case CONTAIN: + return isSetContain(); + case CONTAIN_MANY: + return !getContainMany().isEmpty(); + } + return super.isSet(propertyIndex); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String toString() + { + if (isProxy(this)) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (mixed: "); + result.append(mixed); + result.append(')'); + return result.toString(); + } + +} //ContainmentTestImpl |