You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by fr...@apache.org on 2007/03/01 01:33:42 UTC
svn commit: r513084 [2/2] - in
/incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo:
impl/ model/ model/impl/
Modified: incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/TypeImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/TypeImpl.java?view=diff&rev=513084&r1=513083&r2=513084
==============================================================================
--- incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/TypeImpl.java (original)
+++ incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/TypeImpl.java Wed Feb 28 16:33:41 2007
@@ -6,19 +6,18 @@
*/
package org.apache.tuscany.sdo.model.impl;
-import commonj.sdo.Sequence;
-
import java.util.Collection;
import java.util.List;
import org.apache.tuscany.sdo.impl.DataObjectBase;
-
import org.apache.tuscany.sdo.model.ModelFactory;
import org.apache.tuscany.sdo.model.Property;
import org.apache.tuscany.sdo.model.Type;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.util.BasicExtendedMetaData;
+import commonj.sdo.Sequence;
+
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Type</b></em>'.
@@ -44,114 +43,161 @@
*/
public class TypeImpl extends DataObjectBase implements Type
{
+
+ public final static int BASE_TYPE = 0;
+
+ public final static int PROPERTY = 1;
+
+ public final static int ALIAS_NAME = 2;
+
+ public final static int ANY = -1;
+
+ public final static int NAME = 3;
+
+ public final static int URI = 4;
+
+ public final static int DATA_TYPE = 5;
+
+ public final static int OPEN = 6;
+
+ public final static int SEQUENCED = 7;
+
+ public final static int ABSTRACT = 8;
+
+ public final static int ANY_ATTRIBUTE = -2;
+
+ public final static int SDO_PROPERTY_COUNT = 9;
+
+ public final static int EXTENDED_PROPERTY_COUNT = -2;
+
+
/**
- * The feature id for the '<em><b>Base Type</b></em>' reference list.
+ * The internal feature id for the '<em><b>Base Type</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
- */
- public final static int BASE_TYPE = 0;
+ */
+ public final static int INTERNAL_BASE_TYPE = 0;
/**
- * The feature id for the '<em><b>Property</b></em>' containment reference list.
+ * The internal feature id for the '<em><b>Property</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
- */
- public final static int PROPERTY = 1;
+ */
+ public final static int INTERNAL_PROPERTY = 1;
/**
- * The feature id for the '<em><b>Alias Name</b></em>' attribute list.
+ * The internal feature id for the '<em><b>Alias Name</b></em>' attribute list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
- */
- public final static int ALIAS_NAME = 2;
+ */
+ public final static int INTERNAL_ALIAS_NAME = 2;
/**
- * The feature id for the '<em><b>Any</b></em>' attribute list.
+ * The internal feature id for the '<em><b>Any</b></em>' attribute list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
- */
- public final static int ANY = 3;
+ */
+ public final static int INTERNAL_ANY = 3;
/**
- * The feature id for the '<em><b>Name</b></em>' attribute.
+ * The internal feature id for the '<em><b>Name</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
- */
- public final static int NAME = 4;
+ */
+ public final static int INTERNAL_NAME = 4;
/**
- * The feature id for the '<em><b>Uri</b></em>' attribute.
+ * The internal feature id for the '<em><b>Uri</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
- */
- public final static int URI = 5;
+ */
+ public final static int INTERNAL_URI = 5;
/**
- * The feature id for the '<em><b>Data Type</b></em>' attribute.
+ * The internal feature id for the '<em><b>Data Type</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
- */
- public final static int DATA_TYPE = 6;
+ */
+ public final static int INTERNAL_DATA_TYPE = 6;
/**
- * The feature id for the '<em><b>Open</b></em>' attribute.
+ * The internal feature id for the '<em><b>Open</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
- */
- public final static int OPEN = 7;
+ */
+ public final static int INTERNAL_OPEN = 7;
/**
- * The feature id for the '<em><b>Sequenced</b></em>' attribute.
+ * The internal feature id for the '<em><b>Sequenced</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
- */
- public final static int SEQUENCED = 8;
+ */
+ public final static int INTERNAL_SEQUENCED = 8;
/**
- * The feature id for the '<em><b>Abstract</b></em>' attribute.
+ * The internal feature id for the '<em><b>Abstract</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
- */
- public final static int ABSTRACT = 9;
+ */
+ public final static int INTERNAL_ABSTRACT = 9;
/**
- * The feature id for the '<em><b>Any Attribute</b></em>' attribute list.
+ * The internal feature id for the '<em><b>Any Attribute</b></em>' attribute list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
- */
- public final static int ANY_ATTRIBUTE = 10;
+ */
+ public final static int INTERNAL_ANY_ATTRIBUTE = 10;
/**
- * This represents the number of properties for this type.
+ * The number of properties for this type.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
-
- public final static int SDO_PROPERTY_COUNT = 11;
+ public final static int INTERNAL_PROPERTY_COUNT = 11;
+
+ protected int internalConvertIndex(int internalIndex)
+ {
+ switch (internalIndex)
+ {
+ case INTERNAL_BASE_TYPE: return BASE_TYPE;
+ case INTERNAL_PROPERTY: return PROPERTY;
+ case INTERNAL_ALIAS_NAME: return ALIAS_NAME;
+ case INTERNAL_ANY: return ANY;
+ case INTERNAL_NAME: return NAME;
+ case INTERNAL_URI: return URI;
+ case INTERNAL_DATA_TYPE: return DATA_TYPE;
+ case INTERNAL_OPEN: return OPEN;
+ case INTERNAL_SEQUENCED: return SEQUENCED;
+ case INTERNAL_ABSTRACT: return ABSTRACT;
+ case INTERNAL_ANY_ATTRIBUTE: return ANY_ATTRIBUTE;
+ }
+ return super.internalConvertIndex(internalIndex);
+ }
+
/**
* The cached value of the '{@link #getBaseType() <em>Base Type</em>}' reference list.
@@ -218,6 +264,15 @@
protected String name = NAME_DEFAULT_;
/**
+ * This is true if the Name attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean name_set_ = false;
+
+ /**
* The default value of the '{@link #getUri() <em>Uri</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -238,6 +293,15 @@
protected String uri = URI_DEFAULT_;
/**
+ * This is true if the Uri attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean uri_set_ = false;
+
+ /**
* The default value of the '{@link #isDataType() <em>Data Type</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -432,7 +496,7 @@
{
if (any == null)
{
- any = createSequence(ANY);
+ any = createSequence(INTERNAL_ANY);
}
return any;
}
@@ -454,8 +518,35 @@
{
String oldName = name;
name = newName;
+ boolean oldName_set_ = name_set_;
+ name_set_ = true;
if (isNotifying())
- notify(ChangeKind.SET, NAME, oldName, name);
+ notify(ChangeKind.SET, NAME, oldName, name, !oldName_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetName()
+ {
+ String oldName = name;
+ boolean oldName_set_ = name_set_;
+ name = NAME_DEFAULT_;
+ name_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, NAME, oldName, NAME_DEFAULT_, oldName_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetName()
+ {
+ return name_set_;
}
/**
@@ -476,8 +567,35 @@
{
String oldUri = uri;
uri = newUri;
+ boolean oldUri_set_ = uri_set_;
+ uri_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, URI, oldUri, uri, !oldUri_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetUri()
+ {
+ String oldUri = uri;
+ boolean oldUri_set_ = uri_set_;
+ uri = URI_DEFAULT_;
+ uri_set_ = false;
if (isNotifying())
- notify(ChangeKind.SET, URI, oldUri, uri);
+ notify(ChangeKind.UNSET, URI, oldUri, URI_DEFAULT_, oldUri_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetUri()
+ {
+ return uri_set_;
}
/**
@@ -685,7 +803,7 @@
{
if (anyAttribute == null)
{
- anyAttribute = createSequence(ANY_ATTRIBUTE);
+ anyAttribute = createSequence(INTERNAL_ANY_ATTRIBUTE);
}
return anyAttribute;
}
@@ -818,10 +936,10 @@
unsetSequence(getAny());
return;
case NAME:
- setName(NAME_DEFAULT_);
+ unsetName();
return;
case URI:
- setUri(URI_DEFAULT_);
+ unsetUri();
return;
case DATA_TYPE:
unsetDataType();
@@ -860,9 +978,9 @@
case ANY:
return any != null && !isSequenceEmpty(getAny());
case NAME:
- return NAME_DEFAULT_ == null ? name != null : !NAME_DEFAULT_.equals(name);
+ return isSetName();
case URI:
- return URI_DEFAULT_ == null ? uri != null : !URI_DEFAULT_.equals(uri);
+ return isSetUri();
case DATA_TYPE:
return isSetDataType();
case OPEN:
@@ -892,9 +1010,9 @@
result.append(", any: ");
result.append(any);
result.append(", name: ");
- result.append(name);
+ if (name_set_) result.append(name); else result.append("<unset>");
result.append(", uri: ");
- result.append(uri);
+ if (uri_set_) result.append(uri); else result.append("<unset>");
result.append(", dataType: ");
if (dataType_set_) result.append(dataType); else result.append("<unset>");
result.append(", open: ");
Modified: incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/TypesImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/TypesImpl.java?view=diff&rev=513084&r1=513083&r2=513084
==============================================================================
--- incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/TypesImpl.java (original)
+++ incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/TypesImpl.java Wed Feb 28 16:33:41 2007
@@ -31,24 +31,41 @@
*/
public class TypesImpl extends DataObjectBase implements Types
{
+
+ public final static int TYPE = 0;
+
+ public final static int SDO_PROPERTY_COUNT = 1;
+
+ public final static int EXTENDED_PROPERTY_COUNT = 0;
+
+
/**
- * The feature id for the '<em><b>Type</b></em>' containment reference list.
+ * The internal feature id for the '<em><b>Type</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
- */
- public final static int TYPE = 0;
+ */
+ public final static int INTERNAL_TYPE = 0;
/**
- * This represents the number of properties for this type.
+ * The number of properties for this type.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
-
- public final static int SDO_PROPERTY_COUNT = 1;
+ public final static int INTERNAL_PROPERTY_COUNT = 1;
+
+ protected int internalConvertIndex(int internalIndex)
+ {
+ switch (internalIndex)
+ {
+ case INTERNAL_TYPE: return TYPE;
+ }
+ return super.internalConvertIndex(internalIndex);
+ }
+
/**
* The cached value of the '{@link #getType_() <em>Type</em>}' containment reference list.
@@ -176,5 +193,5 @@
{
return getType_();
}
-
+
} //TypesImpl
Modified: incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/XSDTypeImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/XSDTypeImpl.java?view=diff&rev=513084&r1=513083&r2=513084
==============================================================================
--- incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/XSDTypeImpl.java (original)
+++ incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/impl/XSDTypeImpl.java Wed Feb 28 16:33:41 2007
@@ -29,24 +29,41 @@
*/
public class XSDTypeImpl extends DataObjectBase implements XSDType
{
+
+ public final static int ANY = -1;
+
+ public final static int SDO_PROPERTY_COUNT = 0;
+
+ public final static int EXTENDED_PROPERTY_COUNT = -1;
+
+
/**
- * The feature id for the '<em><b>Any</b></em>' attribute list.
+ * The internal feature id for the '<em><b>Any</b></em>' attribute list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
- */
- public final static int ANY = 0;
+ */
+ public final static int INTERNAL_ANY = 0;
/**
- * This represents the number of properties for this type.
+ * The number of properties for this type.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
-
- public final static int SDO_PROPERTY_COUNT = 1;
+ public final static int INTERNAL_PROPERTY_COUNT = 1;
+
+ protected int internalConvertIndex(int internalIndex)
+ {
+ switch (internalIndex)
+ {
+ case INTERNAL_ANY: return ANY;
+ }
+ return super.internalConvertIndex(internalIndex);
+ }
+
/**
* The cached value of the '{@link #getAny() <em>Any</em>}' attribute list.
@@ -88,7 +105,7 @@
{
if (any == null)
{
- any = createSequence(ANY);
+ any = createSequence(INTERNAL_ANY);
}
return any;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org