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 05:51:51 UTC

svn commit: r513138 - in /incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model: java/ java/impl/ xml/ xml/impl/

Author: frankb
Date: Wed Feb 28 20:51:51 2007
New Revision: 513138

URL: http://svn.apache.org/viewvc?view=rev&rev=513138
Log:
sdoJava.xsd and sdoXML.xsd also should have been regened for TUSCANY-521

Modified:
    incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/java/JavaFactory.java
    incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/java/JavaInfo.java
    incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/java/impl/JavaFactoryImpl.java
    incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/java/impl/JavaInfoImpl.java
    incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/xml/XMLFactory.java
    incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/xml/XMLInfo.java
    incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/xml/impl/XMLFactoryImpl.java
    incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/xml/impl/XMLInfoImpl.java

Modified: incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/java/JavaFactory.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/java/JavaFactory.java?view=diff&rev=513138&r1=513137&r2=513138
==============================================================================
--- incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/java/JavaFactory.java (original)
+++ incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/java/JavaFactory.java Wed Feb 28 20:51:51 2007
@@ -6,6 +6,8 @@
  */
 package org.apache.tuscany.sdo.model.java;
 
+import commonj.sdo.helper.HelperContext;
+
 
 /**
  * <!-- begin-user-doc -->
@@ -34,4 +36,13 @@
    */
   JavaInfo createJavaInfo();
 
+  /**
+   * 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);
+   
 } //JavaFactory

Modified: incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/java/JavaInfo.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/java/JavaInfo.java?view=diff&rev=513138&r1=513137&r2=513138
==============================================================================
--- incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/java/JavaInfo.java (original)
+++ incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/java/JavaInfo.java Wed Feb 28 20:51:51 2007
@@ -34,6 +34,8 @@
    * </p>
    * <!-- end-user-doc -->
    * @return the value of the '<em>Java Class</em>' attribute.
+   * @see #isSetJavaClass()
+   * @see #unsetJavaClass()
    * @see #setJavaClass(String)
    * @generated
    */
@@ -44,9 +46,34 @@
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @param value the new value of the '<em>Java Class</em>' attribute.
+   * @see #isSetJavaClass()
+   * @see #unsetJavaClass()
    * @see #getJavaClass()
    * @generated
    */
   void setJavaClass(String value);
+
+  /**
+   * Unsets the value of the '{@link org.apache.tuscany.sdo.model.java.JavaInfo#getJavaClass <em>Java Class</em>}' attribute.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @see #isSetJavaClass()
+   * @see #getJavaClass()
+   * @see #setJavaClass(String)
+   * @generated
+   */
+  void unsetJavaClass();
+
+  /**
+   * Returns whether the value of the '{@link org.apache.tuscany.sdo.model.java.JavaInfo#getJavaClass <em>Java Class</em>}' attribute is set.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @return whether the value of the '<em>Java Class</em>' attribute is set.
+   * @see #unsetJavaClass()
+   * @see #getJavaClass()
+   * @see #setJavaClass(String)
+   * @generated
+   */
+  boolean isSetJavaClass();
 
 } // JavaInfo

Modified: incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/java/impl/JavaFactoryImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/java/impl/JavaFactoryImpl.java?view=diff&rev=513138&r1=513137&r2=513138
==============================================================================
--- incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/java/impl/JavaFactoryImpl.java (original)
+++ incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/java/impl/JavaFactoryImpl.java Wed Feb 28 20:51:51 2007
@@ -6,20 +6,27 @@
  */
 package org.apache.tuscany.sdo.model.java.impl;
 
+import commonj.sdo.helper.HelperContext;
+import org.apache.tuscany.sdo.helper.TypeHelperImpl;
+
+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.java.JavaFactory;
-import org.apache.tuscany.sdo.model.java.JavaInfo;
+
+import org.apache.tuscany.sdo.model.java.*;
+
 import org.apache.tuscany.sdo.util.SDOUtil;
 import org.eclipse.emf.ecore.xml.type.XMLTypeFactory;
 import org.eclipse.emf.ecore.xml.type.util.XMLTypeUtil;
 
-import commonj.sdo.DataObject;
-import commonj.sdo.Property;
-import commonj.sdo.Type;
-
 /**
  * <!-- begin-user-doc -->
  * An implementation of the commonj.sdo/java model factory.
@@ -27,11 +34,9 @@
  * Until the SDO code generator supports name conflicts and regen/merge, follow the following steps to regenerate this model:
  *   1. Regenerate the model into a temporary directory:
  *         XSD2JavaGenerator -generateBuiltIn commonj.sdo/java -targetDirectory <temp-dir> -javaPackage org.apache.tuscany.sdo.model.java <sdo-api-dir>/src/main/resources/xml/sdoJava.xsd
- *   3. Change the value of the NAMESPACE_PREFIX to "sdoJava"
- *           public static final String NAMESPACE_PREFIX = "sdoJava"; //FB generated as "java"
- *   4. Delete all the createXXXFromString() and convertXXXToString() methods in the newly generated JavaFactoryImpl and
+ *   2. Delete all the createXXXFromString() and convertXXXToString() methods in the newly generated JavaFactoryImpl and
  *      replace them with the ones from this file.
- *   5. Move this JavaDoc comment into the newly generated JavaFactoryImpl class.
+ *   3. Move this JavaDoc comment into the newly generated JavaFactoryImpl class.
  * <!-- end-user-doc -->
  * @generated
  */
@@ -52,7 +57,16 @@
    * <!-- end-user-doc -->
    * @generated
    */
-  public static final String NAMESPACE_PREFIX = "sdoJava"; //FB generated as "java"
+  public static final String NAMESPACE_PREFIX = "sdoJava";
+
+  /**
+   * 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.1";
+  
   public static final int JAVA_INFO = 1;	
   public static final int BOOLEAN_OBJECT = 2;	
   public static final int BYTE_OBJECT = 3;	
@@ -73,6 +87,21 @@
   {
     super(NAMESPACE_URI, NAMESPACE_PREFIX, "org.apache.tuscany.sdo.model.java");
   }
+
+  /**
+   * 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 -->
@@ -255,9 +284,11 @@
     if (isCreated) return;
     isCreated = true;	
 
+    // Create types and their properties
+          javaInfoType = createType(false, JAVA_INFO);
+    createProperty(true, javaInfoType,JavaInfoImpl.INTERNAL_JAVA_CLASS); 
 
-    javaInfoType = createType(false, JAVA_INFO);
-    createProperty(true, javaInfoType, JavaInfoImpl.JAVA_CLASS);
+    // Create data types
     booleanObjectType = createType(true, BOOLEAN_OBJECT );
     byteObjectType = createType(true, BYTE_OBJECT );
     characterObjectType = createType(true, CHARACTER_OBJECT );
@@ -279,13 +310,12 @@
     ModelFactoryImpl theModelPackageImpl = (ModelFactoryImpl)FactoryBase.getStaticFactory(ModelFactoryImpl.NAMESPACE_URI);
     Property property = null;
 
-    // Add supertypes to classes
-
-    // Initialize classes and features; add operations and parameters
-    initializeType(javaInfoType, JavaInfo.class, "JavaInfo");
+    // Add supertypes to types
 
-    property = (Property)javaInfoType.getProperties().get(JavaInfoImpl.JAVA_CLASS);
-    initializeProperty(property, theModelPackageImpl.getString(), "javaClass", null, 0, 1, JavaInfo.class, false, false, false);
+    // Initialize types and properties
+    initializeType(javaInfoType, JavaInfo.class, "JavaInfo", false);
+    property = getProperty(javaInfoType, JavaInfoImpl.INTERNAL_JAVA_CLASS);
+    initializeProperty(property, theModelPackageImpl.getString(), "javaClass", null, 0, 1, JavaInfo.class, false, true, false);
 
     // Initialize data types
     initializeType(booleanObjectType, Boolean.class, "BooleanObject", true, false);
@@ -321,6 +351,7 @@
     
     Property property = null;
     
+
     property = createGlobalProperty
       ("extendedInstanceClass",
       theModelPackageImpl.getString(),
@@ -385,7 +416,7 @@
        });
 
     addXSDMapping
-      ((Property)javaInfoType.getProperties().get(JavaInfoImpl.JAVA_CLASS),
+      (getProperty(javaInfoType, JavaInfoImpl.INTERNAL_JAVA_CLASS),
        new String[]
        {
        "kind", "attribute",

Modified: incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/java/impl/JavaInfoImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/java/impl/JavaInfoImpl.java?view=diff&rev=513138&r1=513137&r2=513138
==============================================================================
--- incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/java/impl/JavaInfoImpl.java (original)
+++ incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/java/impl/JavaInfoImpl.java Wed Feb 28 20:51:51 2007
@@ -28,24 +28,41 @@
  */
 public class JavaInfoImpl extends DataObjectBase implements JavaInfo
 {
+
+  public final static int JAVA_CLASS = 0;
+
+  public final static int SDO_PROPERTY_COUNT = 1;
+
+  public final static int EXTENDED_PROPERTY_COUNT = 0;
+
+
   /**
-   * The feature id for the '<em><b>Java Class</b></em>' attribute.
+   * The internal feature id for the '<em><b>Java Class</b></em>' attribute.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
    * @ordered
-   */	 
-  public final static int JAVA_CLASS = 0;
+   */ 
+  public final static int INTERNAL_JAVA_CLASS = 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_JAVA_CLASS: return JAVA_CLASS;
+    }
+    return super.internalConvertIndex(internalIndex);
+  }
+
 
   /**
    * The default value of the '{@link #getJavaClass() <em>Java Class</em>}' attribute.
@@ -68,11 +85,20 @@
   protected String javaClass = JAVA_CLASS_DEFAULT_;
 
   /**
+   * This is true if the Java Class attribute has been set.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   * @ordered
+   */
+  protected boolean javaClass_set_ = false;
+
+  /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
    */
-  protected JavaInfoImpl()
+  public JavaInfoImpl()
   {
     super();
   }
@@ -105,8 +131,35 @@
   {
     String oldJavaClass = javaClass;
     javaClass = newJavaClass;
+    boolean oldJavaClass_set_ = javaClass_set_;
+    javaClass_set_ = true;
+    if (isNotifying())
+      notify(ChangeKind.SET, JAVA_CLASS, oldJavaClass, javaClass, !oldJavaClass_set_);
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public void unsetJavaClass()
+  {
+    String oldJavaClass = javaClass;
+    boolean oldJavaClass_set_ = javaClass_set_;
+    javaClass = JAVA_CLASS_DEFAULT_;
+    javaClass_set_ = false;
     if (isNotifying())
-      notify(ChangeKind.SET, JAVA_CLASS, oldJavaClass, javaClass);
+      notify(ChangeKind.UNSET, JAVA_CLASS, oldJavaClass, JAVA_CLASS_DEFAULT_, oldJavaClass_set_);
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public boolean isSetJavaClass()
+  {
+    return javaClass_set_;
   }
 
   /**
@@ -150,7 +203,7 @@
     switch (propertyIndex)
     {
       case JAVA_CLASS:
-        setJavaClass(JAVA_CLASS_DEFAULT_);
+        unsetJavaClass();
         return;
     }
     super.unset(propertyIndex);
@@ -166,7 +219,7 @@
     switch (propertyIndex)
     {
       case JAVA_CLASS:
-        return JAVA_CLASS_DEFAULT_ == null ? javaClass != null : !JAVA_CLASS_DEFAULT_.equals(javaClass);
+        return isSetJavaClass();
     }
     return super.isSet(propertyIndex);
   }
@@ -182,7 +235,7 @@
 
     StringBuffer result = new StringBuffer(super.toString());
     result.append(" (javaClass: ");
-    result.append(javaClass);
+    if (javaClass_set_) result.append(javaClass); else result.append("<unset>");
     result.append(')');
     return result.toString();
   }

Modified: incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/xml/XMLFactory.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/xml/XMLFactory.java?view=diff&rev=513138&r1=513137&r2=513138
==============================================================================
--- incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/xml/XMLFactory.java (original)
+++ incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/xml/XMLFactory.java Wed Feb 28 20:51:51 2007
@@ -6,6 +6,8 @@
  */
 package org.apache.tuscany.sdo.model.xml;
 
+import commonj.sdo.helper.HelperContext;
+
 
 /**
  * <!-- begin-user-doc -->
@@ -26,12 +28,21 @@
   XMLFactory INSTANCE = org.apache.tuscany.sdo.model.xml.impl.XMLFactoryImpl.init();
 
   /**
-   * Returns a new object of class '<em>XML Info</em>'.
+   * Returns a new object of class '<em>Info</em>'.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
-   * @return a new object of class '<em>XML Info</em>'.
+   * @return a new object of class '<em>Info</em>'.
    * @generated
    */
   XMLInfo createXMLInfo();
 
-} //XmlFactory
+  /**
+   * 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);
+   
+} //XMLFactory

Modified: incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/xml/XMLInfo.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/xml/XMLInfo.java?view=diff&rev=513138&r1=513137&r2=513138
==============================================================================
--- incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/xml/XMLInfo.java (original)
+++ incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/xml/XMLInfo.java Wed Feb 28 20:51:51 2007
@@ -10,13 +10,13 @@
 
 /**
  * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>XML Info</b></em>'.
+ * A representation of the model object '<em><b>Info</b></em>'.
  * <!-- end-user-doc -->
  *
  * <p>
  * The following features are supported:
  * <ul>
- *   <li>{@link org.apache.tuscany.sdo.model.xml.XMLInfo#getXmlElement <em>Xml Element</em>}</li>
+ *   <li>{@link org.apache.tuscany.sdo.model.xml.XMLInfo#isXmlElement <em>Xml Element</em>}</li>
  * </ul>
  * </p>
  *
@@ -34,19 +34,46 @@
    * </p>
    * <!-- end-user-doc -->
    * @return the value of the '<em>Xml Element</em>' attribute.
-   * @see #setXmlElement(Object)
+   * @see #isSetXmlElement()
+   * @see #unsetXmlElement()
+   * @see #setXmlElement(boolean)
    * @generated
    */
-  Object getXmlElement();
+  boolean isXmlElement();
 
   /**
-   * Sets the value of the '{@link org.apache.tuscany.sdo.model.xml.XMLInfo#getXmlElement <em>Xml Element</em>}' attribute.
+   * Sets the value of the '{@link org.apache.tuscany.sdo.model.xml.XMLInfo#isXmlElement <em>Xml Element</em>}' attribute.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @param value the new value of the '<em>Xml Element</em>' attribute.
-   * @see #getXmlElement()
+   * @see #isSetXmlElement()
+   * @see #unsetXmlElement()
+   * @see #isXmlElement()
    * @generated
    */
-  void setXmlElement(Object value);
+  void setXmlElement(boolean value);
+
+  /**
+   * Unsets the value of the '{@link org.apache.tuscany.sdo.model.xml.XMLInfo#isXmlElement <em>Xml Element</em>}' attribute.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @see #isSetXmlElement()
+   * @see #isXmlElement()
+   * @see #setXmlElement(boolean)
+   * @generated
+   */
+  void unsetXmlElement();
+
+  /**
+   * Returns whether the value of the '{@link org.apache.tuscany.sdo.model.xml.XMLInfo#isXmlElement <em>Xml Element</em>}' attribute is set.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @return whether the value of the '<em>Xml Element</em>' attribute is set.
+   * @see #unsetXmlElement()
+   * @see #isXmlElement()
+   * @see #setXmlElement(boolean)
+   * @generated
+   */
+  boolean isSetXmlElement();
 
 } // XMLInfo

Modified: incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/xml/impl/XMLFactoryImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/xml/impl/XMLFactoryImpl.java?view=diff&rev=513138&r1=513137&r2=513138
==============================================================================
--- incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/xml/impl/XMLFactoryImpl.java (original)
+++ incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/xml/impl/XMLFactoryImpl.java Wed Feb 28 20:51:51 2007
@@ -6,6 +6,9 @@
  */
 package org.apache.tuscany.sdo.model.xml.impl;
 
+import commonj.sdo.helper.HelperContext;
+import org.apache.tuscany.sdo.helper.TypeHelperImpl;
+
 import commonj.sdo.DataObject;
 import commonj.sdo.Property;
 import commonj.sdo.Type;
@@ -29,9 +32,7 @@
  * Until the SDO code generator supports name conflicts and regen/merge, follow the following steps to regenerate this model:
  *   1. Regenerate the model into a temporary directory:
  *         XSD2JavaGenerator -generateBuiltIn commonj.sdo/xml -prefix XML -targetDirectory <temp-dir> -javaPackage org.apache.tuscany.sdo.model.xml <sdo-api-dir>/src/main/resources/xml/sdoXML.xsd
- *   2. Change the value of the NAMESPACE_PREFIX to "sdoXML"
- *           public static final String NAMESPACE_PREFIX = "sdoXML"; //YZ generated as "_xml"
- *   3. Move this JavaDoc comment into the newly generated XMLFactoryImpl class.
+ *   2. Move this JavaDoc comment into the newly generated XMLFactoryImpl class.
  * <!-- end-user-doc -->
  * @generated
  */
@@ -52,10 +53,19 @@
    * <!-- end-user-doc -->
    * @generated
    */
-  public static final String NAMESPACE_PREFIX = "sdoXML"; //YZ generated as "_xml";
-  public static final int XML_INFO = 1;
+  public static final String NAMESPACE_PREFIX = "sdoXML";
 
   /**
+   * 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.1";
+  
+  public static final int XML_INFO = 1;
+  
+  /**
    * Creates an instance of the factory.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -67,6 +77,21 @@
   }
 
   /**
+   * 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
@@ -91,22 +116,22 @@
     XMLInfoImpl xmlInfo = new XMLInfoImpl();
     return xmlInfo;
   }
-
-  // Following creates and initializes SDO metadata for the supported types.
+  
+  // Following creates and initializes SDO metadata for the supported types.			
   protected Type xmlInfoType = null;
 
   public Type getXMLInfo()
   {
     return xmlInfoType;
   }
-
+  
 
   private static boolean isInited = false;
 
   public static XMLFactoryImpl init()
   {
     if (isInited) return (XMLFactoryImpl)FactoryBase.getStaticFactory(XMLFactoryImpl.NAMESPACE_URI);
-    XMLFactoryImpl theXmlFactoryImpl = new XMLFactoryImpl();
+    XMLFactoryImpl theXMLFactoryImpl = new XMLFactoryImpl();
     isInited = true;
 
     // Initialize simple dependencies
@@ -114,29 +139,29 @@
     SDOUtil.registerStaticTypes(ModelFactory.class);
 
     // Create package meta-data objects
-    theXmlFactoryImpl.createMetaData();
+    theXMLFactoryImpl.createMetaData();
 
     // Initialize created meta-data
-    theXmlFactoryImpl.initializeMetaData();
+    theXMLFactoryImpl.initializeMetaData();
 
     // Mark meta-data to indicate it can't be changed
-    //theXmlFactoryImpl.freeze(); //FB do we need to freeze / should we freeze ????
+    //theXMLFactoryImpl.freeze(); //FB do we need to freeze / should we freeze ????
 
-    return theXmlFactoryImpl;
+    return theXMLFactoryImpl;
   }
-
+  
   private boolean isCreated = false;
 
   public void createMetaData()
   {
     if (isCreated) return;
-    isCreated = true;
+    isCreated = true;	
 
     // Create types and their properties
-    xmlInfoType = createType(false, XML_INFO);
-    createProperty(true, xmlInfoType, XMLInfoImpl.XML_ELEMENT);
+          xmlInfoType = createType(false, XML_INFO);
+    createProperty(true, xmlInfoType,XMLInfoImpl.INTERNAL_XML_ELEMENT); 
   }
-
+  
   private boolean isInitialized = false;
 
   public void initializeMetaData()
@@ -152,17 +177,18 @@
 
     // Initialize types and properties
     initializeType(xmlInfoType, XMLInfo.class, "XMLInfo", false);
-    property = (Property)xmlInfoType.getProperties().get(XMLInfoImpl.XML_ELEMENT);
-    initializeProperty(property, theModelPackageImpl.getObject(), "xmlElement", null, 0, 1, XMLInfo.class, false, false, false);
+    property = getProperty(xmlInfoType, XMLInfoImpl.INTERNAL_XML_ELEMENT);
+    initializeProperty(property, theModelPackageImpl.getBoolean(), "xmlElement", null, 0, 1, XMLInfo.class, false, true, false);
 
     createXSDMetaData(theModelPackageImpl);
   }
-
+    
   protected void createXSDMetaData(ModelFactoryImpl theModelPackageImpl)
   {
     super.initXSD();
-
+    
     Property property = null;
+    
 
     property = createGlobalProperty
       ("aliasName",
@@ -174,7 +200,7 @@
        "namespace", "##targetNamespace"
        },
        IS_ATTRIBUTE);
-
+                
     property = createGlobalProperty
       ("dataType",
       theModelPackageImpl.getURI(),
@@ -185,7 +211,7 @@
        "namespace", "##targetNamespace"
        },
        IS_ATTRIBUTE);
-
+                
     property = createGlobalProperty
       ("many",
       theModelPackageImpl.getBoolean(),
@@ -196,7 +222,7 @@
        "namespace", "##targetNamespace"
        },
        IS_ATTRIBUTE);
-
+                
     property = createGlobalProperty
       ("name",
       theModelPackageImpl.getString(),
@@ -207,7 +233,7 @@
        "namespace", "##targetNamespace"
        },
        IS_ATTRIBUTE);
-
+                
     property = createGlobalProperty
       ("oppositeProperty",
       theModelPackageImpl.getString(),
@@ -218,7 +244,7 @@
        "namespace", "##targetNamespace"
        },
        IS_ATTRIBUTE);
-
+                
     property = createGlobalProperty
       ("propertyType",
       theModelPackageImpl.getURI(),
@@ -229,7 +255,7 @@
        "namespace", "##targetNamespace"
        },
        IS_ATTRIBUTE);
-
+                
     property = createGlobalProperty
       ("readOnly",
       theModelPackageImpl.getBoolean(),
@@ -240,7 +266,7 @@
        "namespace", "##targetNamespace"
        },
        IS_ATTRIBUTE);
-
+                
     property = createGlobalProperty
       ("sequence",
       theModelPackageImpl.getBoolean(),
@@ -251,7 +277,7 @@
        "namespace", "##targetNamespace"
        },
        IS_ATTRIBUTE);
-
+                
     property = createGlobalProperty
       ("string",
       theModelPackageImpl.getBoolean(),
@@ -262,10 +288,10 @@
        "namespace", "##targetNamespace"
        },
        IS_ATTRIBUTE);
-
+                
     property = createGlobalProperty
       ("xmlElement",
-      theModelPackageImpl.getObject(),
+      theModelPackageImpl.getBoolean(),
        new String[]
        {
        "kind", "attribute",
@@ -273,17 +299,17 @@
        "namespace", "##targetNamespace"
        },
        IS_ATTRIBUTE);
-
+                
     addXSDMapping
       (xmlInfoType,
-       new String[]
+       new String[] 
        {
        "name", "XMLInfo",
        "kind", "empty"
        });
 
     addXSDMapping
-      ((Property)xmlInfoType.getProperties().get(XMLInfoImpl.XML_ELEMENT),
+      (getProperty(xmlInfoType, XMLInfoImpl.INTERNAL_XML_ELEMENT),
        new String[]
        {
        "kind", "attribute",
@@ -291,5 +317,5 @@
        });
 
   }
-
-} //XmlFactoryImpl
\ No newline at end of file
+    
+} //XMLFactoryImpl

Modified: incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/xml/impl/XMLInfoImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/xml/impl/XMLInfoImpl.java?view=diff&rev=513138&r1=513137&r2=513138
==============================================================================
--- incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/xml/impl/XMLInfoImpl.java (original)
+++ incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/model/xml/impl/XMLInfoImpl.java Wed Feb 28 20:51:51 2007
@@ -10,17 +10,17 @@
 
 import org.apache.tuscany.sdo.impl.DataObjectBase;
 
-import org.apache.tuscany.sdo.model.xml.XMLInfo;
 import org.apache.tuscany.sdo.model.xml.XMLFactory;
+import org.apache.tuscany.sdo.model.xml.XMLInfo;
 
 /**
  * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>XML Info</b></em>'.
+ * An implementation of the model object '<em><b>Info</b></em>'.
  * <!-- end-user-doc -->
  * <p>
  * The following features are implemented:
  * <ul>
- *   <li>{@link org.apache.tuscany.sdo.model.xml.impl.XMLInfoImpl#getXmlElement <em>Xml Element</em>}</li>
+ *   <li>{@link org.apache.tuscany.sdo.model.xml.impl.XMLInfoImpl#isXmlElement <em>Xml Element</em>}</li>
  * </ul>
  * </p>
  *
@@ -28,44 +28,70 @@
  */
 public class XMLInfoImpl extends DataObjectBase implements XMLInfo
 {
+
+  public final static int XML_ELEMENT = 0;
+
+  public final static int SDO_PROPERTY_COUNT = 1;
+
+  public final static int EXTENDED_PROPERTY_COUNT = 0;
+
+
   /**
-   * The feature id for the '<em><b>Xml Element</b></em>' attribute.
+   * The internal feature id for the '<em><b>Xml Element</b></em>' attribute.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
    * @ordered
-   */	 
-  public final static int XML_ELEMENT = 0;
+   */ 
+  public final static int INTERNAL_XML_ELEMENT = 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_XML_ELEMENT: return XML_ELEMENT;
+    }
+    return super.internalConvertIndex(internalIndex);
+  }
+
 
   /**
-   * The default value of the '{@link #getXmlElement() <em>Xml Element</em>}' attribute.
+   * The default value of the '{@link #isXmlElement() <em>Xml Element</em>}' attribute.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
-   * @see #getXmlElement()
+   * @see #isXmlElement()
    * @generated
    * @ordered
    */
-  protected static final Object XML_ELEMENT_DEFAULT_ = null;
+  protected static final boolean XML_ELEMENT_DEFAULT_ = false;
 
   /**
-   * The cached value of the '{@link #getXmlElement() <em>Xml Element</em>}' attribute.
+   * The cached value of the '{@link #isXmlElement() <em>Xml Element</em>}' attribute.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
-   * @see #getXmlElement()
+   * @see #isXmlElement()
    * @generated
    * @ordered
    */
-  protected Object xmlElement = XML_ELEMENT_DEFAULT_;
+  protected boolean xmlElement = XML_ELEMENT_DEFAULT_;
+
+  /**
+   * This is true if the Xml Element attribute has been set.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   * @ordered
+   */
+  protected boolean xmlElement_set_ = false;
 
   /**
    * <!-- begin-user-doc -->
@@ -92,7 +118,7 @@
    * <!-- end-user-doc -->
    * @generated
    */
-  public Object getXmlElement()
+  public boolean isXmlElement()
   {
     return xmlElement;
   }
@@ -101,12 +127,39 @@
    * <!-- end-user-doc -->
    * @generated
    */
-  public void setXmlElement(Object newXmlElement)
+  public void setXmlElement(boolean newXmlElement)
   {
-    Object oldXmlElement = xmlElement;
+    boolean oldXmlElement = xmlElement;
     xmlElement = newXmlElement;
+    boolean oldXmlElement_set_ = xmlElement_set_;
+    xmlElement_set_ = true;
+    if (isNotifying())
+      notify(ChangeKind.SET, XML_ELEMENT, oldXmlElement, xmlElement, !oldXmlElement_set_);
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public void unsetXmlElement()
+  {
+    boolean oldXmlElement = xmlElement;
+    boolean oldXmlElement_set_ = xmlElement_set_;
+    xmlElement = XML_ELEMENT_DEFAULT_;
+    xmlElement_set_ = false;
     if (isNotifying())
-      notify(ChangeKind.SET, XML_ELEMENT, oldXmlElement, xmlElement);
+      notify(ChangeKind.UNSET, XML_ELEMENT, oldXmlElement, XML_ELEMENT_DEFAULT_, oldXmlElement_set_);
+  }
+
+  /**
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public boolean isSetXmlElement()
+  {
+    return xmlElement_set_;
   }
 
   /**
@@ -119,7 +172,7 @@
     switch (propertyIndex)
     {
       case XML_ELEMENT:
-        return getXmlElement();
+        return isXmlElement() ? Boolean.TRUE : Boolean.FALSE;
     }
     return super.get(propertyIndex, resolve);
   }
@@ -134,7 +187,7 @@
     switch (propertyIndex)
     {
       case XML_ELEMENT:
-        setXmlElement((Object)newValue);
+        setXmlElement(((Boolean)newValue).booleanValue());
         return;
     }
     super.set(propertyIndex, newValue);
@@ -150,7 +203,7 @@
     switch (propertyIndex)
     {
       case XML_ELEMENT:
-        setXmlElement(XML_ELEMENT_DEFAULT_);
+        unsetXmlElement();
         return;
     }
     super.unset(propertyIndex);
@@ -166,7 +219,7 @@
     switch (propertyIndex)
     {
       case XML_ELEMENT:
-        return XML_ELEMENT_DEFAULT_ == null ? xmlElement != null : !XML_ELEMENT_DEFAULT_.equals(xmlElement);
+        return isSetXmlElement();
     }
     return super.isSet(propertyIndex);
   }
@@ -182,7 +235,7 @@
 
     StringBuffer result = new StringBuffer(super.toString());
     result.append(" (xmlElement: ");
-    result.append(xmlElement);
+    if (xmlElement_set_) result.append(xmlElement); else result.append("<unset>");
     result.append(')');
     return result.toString();
   }



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org