tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kelvingood...@apache.org
Subject svn commit: r509526 [2/2] - in /incubator/tuscany/java/sdo: impl/src/test/java/com/example/simple/ impl/src/test/java/com/example/simple/impl/ impl/src/test/java/org/apache/tuscany/sdo/codegen/ impl/src/test/java/org/apache/tuscany/sdo/test/ tools/src/...
Date Tue, 20 Feb 2007 12:06:53 GMT
Modified: incubator/tuscany/java/sdo/tools/src/test/java/com/example/sequences/impl/SequencesFactoryImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/tools/src/test/java/com/example/sequences/impl/SequencesFactoryImpl.java?view=diff&rev=509526&r1=509525&r2=509526
==============================================================================
--- incubator/tuscany/java/sdo/tools/src/test/java/com/example/sequences/impl/SequencesFactoryImpl.java (original)
+++ incubator/tuscany/java/sdo/tools/src/test/java/com/example/sequences/impl/SequencesFactoryImpl.java Tue Feb 20 04:06:51 2007
@@ -19,63 +19,67 @@
  */
 package com.example.sequences.impl;
 
+import commonj.sdo.helper.HelperContext;
+import org.apache.tuscany.sdo.helper.TypeHelperImpl;
+
+import com.example.sequences.*;
+
+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.util.SDOUtil;
 
-import com.example.sequences.MixedQuote;
-import com.example.sequences.MixedRepeatingChoice;
-import com.example.sequences.RepeatingChoice;
-import com.example.sequences.SequencesFactory;
-import com.example.sequences.TwoRCs;
-import com.example.sequences.TwoRCsMixed;
-import commonj.sdo.DataObject;
-import commonj.sdo.Property;
-import commonj.sdo.Type;
+import org.apache.tuscany.sdo.util.SDOUtil;
 
 /**
  * <!-- begin-user-doc -->
  * An implementation of the model <b>Factory</b>.
+ * Generator information:
+ * patternVersion=1.0; -prefix Sequences
  * <!-- end-user-doc -->
  * @generated
  */
 public class SequencesFactoryImpl extends FactoryBase implements SequencesFactory
 {
 
-/**
- * The package namespace URI.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-public static final String NAMESPACE_URI = "http://www.example.com/sequences";
-
-/**
- * The package namespace name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-public static final String NAMESPACE_PREFIX = "sequences";
-
+  /**
+   * The package namespace URI.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public static final String NAMESPACE_URI = "http://www.example.com/sequences";
 
-public static final int MIXED_QUOTE = 1;
-public static final int MIXED_REPEATING_CHOICE = 2;
-public static final int REPEATING_CHOICE = 3;
-public static final int TWO_RCS = 4;
-public static final int TWO_RCS_MIXED = 5;
-  
-  
   /**
-   * Creates the default factory implementation.
+   * The package namespace name.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
    */
+  public static final String NAMESPACE_PREFIX = "seq";
 
   /**
+   * The version of the generator pattern used to generate this class.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   */
+  public static final String PATTERN_VERSION = "1.0";
+  
+  public static final int MIXED_QUOTE = 1;	
+  public static final int MIXED_REPEATING_CHOICE = 2;	
+  public static final int REPEATING_CHOICE = 3;	
+  public static final int TWO_RCS = 4;	
+  public static final int TWO_RCS_MIXED = 5;
+  
+  /**
    * Creates an instance of the factory.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -83,7 +87,22 @@
    */
   public SequencesFactoryImpl()
   {
-    super(NAMESPACE_URI, NAMESPACE_PREFIX);
+    super(NAMESPACE_URI, NAMESPACE_PREFIX, "com.example.sequences");
+  }
+
+  /**
+   * 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);
   }
   
   /**
@@ -95,22 +114,16 @@
   {
     switch (typeNumber)
     {
-      // TODO make sure we're supposed to ingore DOCUMENT_ROOT
       case MIXED_QUOTE: return (DataObject)createMixedQuote();
-      // TODO make sure we're supposed to ingore DOCUMENT_ROOT
       case MIXED_REPEATING_CHOICE: return (DataObject)createMixedRepeatingChoice();
-      // TODO make sure we're supposed to ingore DOCUMENT_ROOT
       case REPEATING_CHOICE: return (DataObject)createRepeatingChoice();
-      // TODO make sure we're supposed to ingore DOCUMENT_ROOT
       case TWO_RCS: return (DataObject)createTwoRCs();
-      // TODO make sure we're supposed to ingore DOCUMENT_ROOT
       case TWO_RCS_MIXED: return (DataObject)createTwoRCsMixed();
       default:
         return super.create(typeNumber);
     }
   }
 
-
   /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -121,15 +134,6 @@
     MixedQuoteImpl mixedQuote = new MixedQuoteImpl();
     return mixedQuote;
   }
-  
-  // Following creates and initializes SDO metadata for the supported types.
-  protected Type mixedQuoteType = null;
-  
-  public Type getMixedQuote()
-  {
-    // TODO - kdk - verify how to generate quoteType...mixedQuoteType?
-    return mixedQuoteType;
-    }
   /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -140,15 +144,6 @@
     MixedRepeatingChoiceImpl mixedRepeatingChoice = new MixedRepeatingChoiceImpl();
     return mixedRepeatingChoice;
   }
-  
-  // Following creates and initializes SDO metadata for the supported types.
-  protected Type mixedRepeatingChoiceType = null;
-  
-  public Type getMixedRepeatingChoice()
-  {
-    // TODO - kdk - verify how to generate quoteType...mixedRepeatingChoiceType?
-    return mixedRepeatingChoiceType;
-    }
   /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -159,15 +154,6 @@
     RepeatingChoiceImpl repeatingChoice = new RepeatingChoiceImpl();
     return repeatingChoice;
   }
-  
-  // Following creates and initializes SDO metadata for the supported types.
-  protected Type repeatingChoiceType = null;
-  
-  public Type getRepeatingChoice()
-  {
-    // TODO - kdk - verify how to generate quoteType...repeatingChoiceType?
-    return repeatingChoiceType;
-    }
   /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -178,15 +164,6 @@
     TwoRCsImpl twoRCs = new TwoRCsImpl();
     return twoRCs;
   }
-  
-  // Following creates and initializes SDO metadata for the supported types.
-  protected Type twoRCsType = null;
-  
-  public Type getTwoRCs()
-  {
-    // TODO - kdk - verify how to generate quoteType...twoRCsType?
-    return twoRCsType;
-    }
   /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -198,37 +175,65 @@
     return twoRCsMixed;
   }
   
-  // Following creates and initializes SDO metadata for the supported types.
+  // Following creates and initializes SDO metadata for the supported types.			
+  protected Type mixedQuoteType = null;
+
+  public Type getMixedQuote()
+  {
+    return mixedQuoteType;
+  }
+    
+  protected Type mixedRepeatingChoiceType = null;
+
+  public Type getMixedRepeatingChoice()
+  {
+    return mixedRepeatingChoiceType;
+  }
+    
+  protected Type repeatingChoiceType = null;
+
+  public Type getRepeatingChoice()
+  {
+    return repeatingChoiceType;
+  }
+    
+  protected Type twoRCsType = null;
+
+  public Type getTwoRCs()
+  {
+    return twoRCsType;
+  }
+    
   protected Type twoRCsMixedType = null;
-  
+
   public Type getTwoRCsMixed()
   {
-    // TODO - kdk - verify how to generate quoteType...twoRCsMixedType?
     return twoRCsMixedType;
-    }
+  }
+  
 
   private static boolean isInited = false;
-  
+
   public static SequencesFactoryImpl init()
   {
-    	if (isInited) return (SequencesFactoryImpl)FactoryBase.getStaticFactory(SequencesFactoryImpl.NAMESPACE_URI);
-    	SequencesFactoryImpl theSequencesFactoryImpl = new SequencesFactoryImpl();
-    	isInited = true;
-
-    	// Initialize simple dependencies
-    	SDOUtil.registerStaticTypes(SDOFactory.class);
-    	SDOUtil.registerStaticTypes(ModelFactory.class);
-    	
-    	// Create package meta-data objects
-    	theSequencesFactoryImpl.createMetaData();
+    if (isInited) return (SequencesFactoryImpl)FactoryBase.getStaticFactory(SequencesFactoryImpl.NAMESPACE_URI);
+    SequencesFactoryImpl theSequencesFactoryImpl = new SequencesFactoryImpl();
+    isInited = true;
+
+    // Initialize simple dependencies
+    SDOUtil.registerStaticTypes(SDOFactory.class);
+    SDOUtil.registerStaticTypes(ModelFactory.class);
+
+    // Create package meta-data objects
+    theSequencesFactoryImpl.createMetaData();
 
-    	// Initialize created meta-data
-    	theSequencesFactoryImpl.initializeMetaData();
+    // Initialize created meta-data
+    theSequencesFactoryImpl.initializeMetaData();
 
-    	// Mark meta-data to indicate it can't be changed
-    	//theSequencesFactoryImpl.freeze(); //FB do we need to freeze / should we freeze ????
+    // Mark meta-data to indicate it can't be changed
+    //theSequencesFactoryImpl.freeze(); //FB do we need to freeze / should we freeze ????
 
-    	return theSequencesFactoryImpl;
+    return theSequencesFactoryImpl;
   }
   
   private boolean isCreated = false;
@@ -236,9 +241,9 @@
   public void createMetaData()
   {
     if (isCreated) return;
-    isCreated = true;
-  
-  
+    isCreated = true;	
+
+    // Create types and their properties
     mixedQuoteType = createType(false, MIXED_QUOTE);
     createProperty(true, mixedQuoteType, MixedQuoteImpl.MIXED);
     createProperty(true, mixedQuoteType, MixedQuoteImpl.SYMBOL);
@@ -250,18 +255,18 @@
     createProperty(true, mixedQuoteType, MixedQuoteImpl.VOLUME);
     createProperty(true, mixedQuoteType, MixedQuoteImpl.CHANGE1);
     createProperty(false, mixedQuoteType, MixedQuoteImpl.QUOTES);
-  
+
     mixedRepeatingChoiceType = createType(false, MIXED_REPEATING_CHOICE);
     createProperty(true, mixedRepeatingChoiceType, MixedRepeatingChoiceImpl.MIXED);
     createProperty(true, mixedRepeatingChoiceType, MixedRepeatingChoiceImpl.GROUP);
     createProperty(true, mixedRepeatingChoiceType, MixedRepeatingChoiceImpl.A);
     createProperty(true, mixedRepeatingChoiceType, MixedRepeatingChoiceImpl.B);
-  
+
     repeatingChoiceType = createType(false, REPEATING_CHOICE);
     createProperty(true, repeatingChoiceType, RepeatingChoiceImpl.GROUP);
     createProperty(true, repeatingChoiceType, RepeatingChoiceImpl.A);
     createProperty(true, repeatingChoiceType, RepeatingChoiceImpl.B);
-  
+
     twoRCsType = createType(false, TWO_RCS);
     createProperty(true, twoRCsType, TwoRCsImpl.GROUP);
     createProperty(true, twoRCsType, TwoRCsImpl.A);
@@ -270,7 +275,7 @@
     createProperty(true, twoRCsType, TwoRCsImpl.GROUP1);
     createProperty(true, twoRCsType, TwoRCsImpl.Y);
     createProperty(true, twoRCsType, TwoRCsImpl.Z);
-  
+
     twoRCsMixedType = createType(false, TWO_RCS_MIXED);
     createProperty(true, twoRCsMixedType, TwoRCsMixedImpl.MIXED);
     createProperty(true, twoRCsMixedType, TwoRCsMixedImpl.GROUP);
@@ -281,6 +286,7 @@
     createProperty(true, twoRCsMixedType, TwoRCsMixedImpl.Y);
     createProperty(true, twoRCsMixedType, TwoRCsMixedImpl.Z);
   }
+  
   private boolean isInitialized = false;
 
   public void initializeMetaData()
@@ -290,418 +296,452 @@
 
     // Obtain other dependent packages
     ModelFactoryImpl theModelPackageImpl = (ModelFactoryImpl)FactoryBase.getStaticFactory(ModelFactoryImpl.NAMESPACE_URI);
+    Property property = null;
 
-    // Add supertypes to classes
-    // Initialize classes and features; add operations and parameters
-    
-    initializeType(mixedQuoteType, MixedQuote.class, "MixedQuote");
-    initializeProperty((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.MIXED), getSequence(), "mixed", null, 0, -1, MixedQuote.class, false, false, false);
-    initializeProperty((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.SYMBOL), theModelPackageImpl.getString(), "symbol", null, 1, 1, MixedQuote.class, false, false, true);
-    initializeProperty((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.COMPANY_NAME), theModelPackageImpl.getString(), "companyName", null, 1, 1, MixedQuote.class, false, false, true);
-    initializeProperty((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.PRICE), theModelPackageImpl.getDecimal(), "price", null, 1, 1, MixedQuote.class, false, false, true);
-    initializeProperty((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.OPEN1), theModelPackageImpl.getDecimal(), "open1", null, 1, 1, MixedQuote.class, false, false, true);
-    initializeProperty((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.HIGH), theModelPackageImpl.getDecimal(), "high", null, 1, 1, MixedQuote.class, false, false, true);
-    initializeProperty((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.LOW), theModelPackageImpl.getDecimal(), "low", null, 1, 1, MixedQuote.class, false, false, true);
-    initializeProperty((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.VOLUME), theModelPackageImpl.getDouble(), "volume", null, 1, 1, MixedQuote.class, false, true, true);
-    initializeProperty((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.CHANGE1), theModelPackageImpl.getDouble(), "change1", null, 1, 1, MixedQuote.class, false, true, true);
-    initializeProperty((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.QUOTES), this.getMixedQuote(), "quotes", null, 0, -1, MixedQuote.class, false, false, true, true , null);
-    
-    initializeType(mixedRepeatingChoiceType, MixedRepeatingChoice.class, "MixedRepeatingChoice");
-    initializeProperty((Property)mixedRepeatingChoiceType.getProperties().get(MixedRepeatingChoiceImpl.MIXED), getSequence(), "mixed", null, 0, -1, MixedRepeatingChoice.class, false, false, false);
-    initializeProperty((Property)mixedRepeatingChoiceType.getProperties().get(MixedRepeatingChoiceImpl.GROUP), getSequence(), "group", null, 0, -1, MixedRepeatingChoice.class, false, false, true);
-    initializeProperty((Property)mixedRepeatingChoiceType.getProperties().get(MixedRepeatingChoiceImpl.A), theModelPackageImpl.getString(), "a", null, 0, -1, MixedRepeatingChoice.class, false, false, true);
-    initializeProperty((Property)mixedRepeatingChoiceType.getProperties().get(MixedRepeatingChoiceImpl.B), theModelPackageImpl.getInt(), "b", null, 0, -1, MixedRepeatingChoice.class, false, false, true);
-    
-    initializeType(repeatingChoiceType, RepeatingChoice.class, "RepeatingChoice");
-    initializeProperty((Property)repeatingChoiceType.getProperties().get(RepeatingChoiceImpl.GROUP), getSequence(), "group", null, 0, -1, RepeatingChoice.class, false, false, false);
-    initializeProperty((Property)repeatingChoiceType.getProperties().get(RepeatingChoiceImpl.A), theModelPackageImpl.getString(), "a", null, 0, -1, RepeatingChoice.class, false, false, true);
-    initializeProperty((Property)repeatingChoiceType.getProperties().get(RepeatingChoiceImpl.B), theModelPackageImpl.getInt(), "b", null, 0, -1, RepeatingChoice.class, false, false, true);
-    
-    initializeType(twoRCsType, TwoRCs.class, "TwoRCs");
-    initializeProperty((Property)twoRCsType.getProperties().get(TwoRCsImpl.GROUP), getSequence(), "group", null, 0, -1, TwoRCs.class, false, false, false);
-    initializeProperty((Property)twoRCsType.getProperties().get(TwoRCsImpl.A), theModelPackageImpl.getString(), "a", null, 0, -1, TwoRCs.class, false, false, true);
-    initializeProperty((Property)twoRCsType.getProperties().get(TwoRCsImpl.B), theModelPackageImpl.getInt(), "b", null, 0, -1, TwoRCs.class, false, false, true);
-    initializeProperty((Property)twoRCsType.getProperties().get(TwoRCsImpl.SPLIT), theModelPackageImpl.getString(), "split", null, 1, 1, TwoRCs.class, false, false, false);
-    initializeProperty((Property)twoRCsType.getProperties().get(TwoRCsImpl.GROUP1), getSequence(), "group1", null, 0, -1, TwoRCs.class, false, false, false);
-    initializeProperty((Property)twoRCsType.getProperties().get(TwoRCsImpl.Y), theModelPackageImpl.getString(), "y", null, 0, -1, TwoRCs.class, false, false, true);
-    initializeProperty((Property)twoRCsType.getProperties().get(TwoRCsImpl.Z), theModelPackageImpl.getInt(), "z", null, 0, -1, TwoRCs.class, false, false, true);
-    
-    initializeType(twoRCsMixedType, TwoRCsMixed.class, "TwoRCsMixed");
-    initializeProperty((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.MIXED), getSequence(), "mixed", null, 0, -1, TwoRCsMixed.class, false, false, false);
-    initializeProperty((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.GROUP), getSequence(), "group", null, 0, -1, TwoRCsMixed.class, false, false, true);
-    initializeProperty((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.A), theModelPackageImpl.getString(), "a", null, 0, -1, TwoRCsMixed.class, false, false, true);
-    initializeProperty((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.B), theModelPackageImpl.getInt(), "b", null, 0, -1, TwoRCsMixed.class, false, false, true);
-    initializeProperty((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.SPLIT), theModelPackageImpl.getString(), "split", null, 1, 1, TwoRCsMixed.class, false, false, true);
-    initializeProperty((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.GROUP1), getSequence(), "group1", null, 0, -1, TwoRCsMixed.class, false, false, true);
-    initializeProperty((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.Y), theModelPackageImpl.getString(), "y", null, 0, -1, TwoRCsMixed.class, false, false, true);
-    initializeProperty((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.Z), theModelPackageImpl.getInt(), "z", null, 0, -1, TwoRCsMixed.class, false, false, true);initXSD();
+    // Add supertypes to types
+
+    // Initialize types and properties
+    initializeType(mixedQuoteType, MixedQuote.class, "MixedQuote", false);
+    property = (Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.MIXED);
+    initializeProperty(property, getSequence(), "mixed", null, 0, -1, MixedQuote.class, false, false, false);
+    property = (Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.SYMBOL);
+    initializeProperty(property, theModelPackageImpl.getString(), "symbol", null, 1, 1, MixedQuote.class, false, false, true);
+    property = (Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.COMPANY_NAME);
+    initializeProperty(property, theModelPackageImpl.getString(), "companyName", null, 1, 1, MixedQuote.class, false, false, true);
+    property = (Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.PRICE);
+    initializeProperty(property, theModelPackageImpl.getDecimal(), "price", null, 1, 1, MixedQuote.class, false, false, true);
+    property = (Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.OPEN1);
+    initializeProperty(property, theModelPackageImpl.getDecimal(), "open1", null, 1, 1, MixedQuote.class, false, false, true);
+    property = (Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.HIGH);
+    initializeProperty(property, theModelPackageImpl.getDecimal(), "high", null, 1, 1, MixedQuote.class, false, false, true);
+    property = (Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.LOW);
+    initializeProperty(property, theModelPackageImpl.getDecimal(), "low", null, 1, 1, MixedQuote.class, false, false, true);
+    property = (Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.VOLUME);
+    initializeProperty(property, theModelPackageImpl.getDouble(), "volume", null, 1, 1, MixedQuote.class, false, true, true);
+    property = (Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.CHANGE1);
+    initializeProperty(property, theModelPackageImpl.getDouble(), "change1", null, 1, 1, MixedQuote.class, false, true, true);
+    property = (Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.QUOTES);
+    initializeProperty(property, this.getMixedQuote(), "quotes", null, 0, -1, MixedQuote.class, false, false, true, true, null);
+
+    initializeType(mixedRepeatingChoiceType, MixedRepeatingChoice.class, "MixedRepeatingChoice", false);
+    property = (Property)mixedRepeatingChoiceType.getProperties().get(MixedRepeatingChoiceImpl.MIXED);
+    initializeProperty(property, getSequence(), "mixed", null, 0, -1, MixedRepeatingChoice.class, false, false, false);
+    property = (Property)mixedRepeatingChoiceType.getProperties().get(MixedRepeatingChoiceImpl.GROUP);
+    initializeProperty(property, getSequence(), "group", null, 0, -1, MixedRepeatingChoice.class, false, false, true);
+    property = (Property)mixedRepeatingChoiceType.getProperties().get(MixedRepeatingChoiceImpl.A);
+    initializeProperty(property, theModelPackageImpl.getString(), "a", null, 0, -1, MixedRepeatingChoice.class, false, false, true);
+    property = (Property)mixedRepeatingChoiceType.getProperties().get(MixedRepeatingChoiceImpl.B);
+    initializeProperty(property, theModelPackageImpl.getInt(), "b", null, 0, -1, MixedRepeatingChoice.class, false, false, true);
+
+    initializeType(repeatingChoiceType, RepeatingChoice.class, "RepeatingChoice", false);
+    property = (Property)repeatingChoiceType.getProperties().get(RepeatingChoiceImpl.GROUP);
+    initializeProperty(property, getSequence(), "group", null, 0, -1, RepeatingChoice.class, false, false, false);
+    property = (Property)repeatingChoiceType.getProperties().get(RepeatingChoiceImpl.A);
+    initializeProperty(property, theModelPackageImpl.getString(), "a", null, 0, -1, RepeatingChoice.class, false, false, true);
+    property = (Property)repeatingChoiceType.getProperties().get(RepeatingChoiceImpl.B);
+    initializeProperty(property, theModelPackageImpl.getInt(), "b", null, 0, -1, RepeatingChoice.class, false, false, true);
+
+    initializeType(twoRCsType, TwoRCs.class, "TwoRCs", false);
+    property = (Property)twoRCsType.getProperties().get(TwoRCsImpl.GROUP);
+    initializeProperty(property, getSequence(), "group", null, 0, -1, TwoRCs.class, false, false, false);
+    property = (Property)twoRCsType.getProperties().get(TwoRCsImpl.A);
+    initializeProperty(property, theModelPackageImpl.getString(), "a", null, 0, -1, TwoRCs.class, false, false, true);
+    property = (Property)twoRCsType.getProperties().get(TwoRCsImpl.B);
+    initializeProperty(property, theModelPackageImpl.getInt(), "b", null, 0, -1, TwoRCs.class, false, false, true);
+    property = (Property)twoRCsType.getProperties().get(TwoRCsImpl.SPLIT);
+    initializeProperty(property, theModelPackageImpl.getString(), "split", null, 1, 1, TwoRCs.class, false, false, false);
+    property = (Property)twoRCsType.getProperties().get(TwoRCsImpl.GROUP1);
+    initializeProperty(property, getSequence(), "group1", null, 0, -1, TwoRCs.class, false, false, false);
+    property = (Property)twoRCsType.getProperties().get(TwoRCsImpl.Y);
+    initializeProperty(property, theModelPackageImpl.getString(), "y", null, 0, -1, TwoRCs.class, false, false, true);
+    property = (Property)twoRCsType.getProperties().get(TwoRCsImpl.Z);
+    initializeProperty(property, theModelPackageImpl.getInt(), "z", null, 0, -1, TwoRCs.class, false, false, true);
+
+    initializeType(twoRCsMixedType, TwoRCsMixed.class, "TwoRCsMixed", false);
+    property = (Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.MIXED);
+    initializeProperty(property, getSequence(), "mixed", null, 0, -1, TwoRCsMixed.class, false, false, false);
+    property = (Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.GROUP);
+    initializeProperty(property, getSequence(), "group", null, 0, -1, TwoRCsMixed.class, false, false, true);
+    property = (Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.A);
+    initializeProperty(property, theModelPackageImpl.getString(), "a", null, 0, -1, TwoRCsMixed.class, false, false, true);
+    property = (Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.B);
+    initializeProperty(property, theModelPackageImpl.getInt(), "b", null, 0, -1, TwoRCsMixed.class, false, false, true);
+    property = (Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.SPLIT);
+    initializeProperty(property, theModelPackageImpl.getString(), "split", null, 1, 1, TwoRCsMixed.class, false, false, true);
+    property = (Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.GROUP1);
+    initializeProperty(property, getSequence(), "group1", null, 0, -1, TwoRCsMixed.class, false, false, true);
+    property = (Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.Y);
+    initializeProperty(property, theModelPackageImpl.getString(), "y", null, 0, -1, TwoRCsMixed.class, false, false, true);
+    property = (Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.Z);
+    initializeProperty(property, theModelPackageImpl.getInt(), "z", null, 0, -1, TwoRCsMixed.class, false, false, true);
+
+    createXSDMetaData(theModelPackageImpl);
   }
-  
-  protected void initXSD()
+    
+  protected void createXSDMetaData(ModelFactoryImpl theModelPackageImpl)
   {
     super.initXSD();
-    // TODO - kdk - is the order right?  should kind, elementOnly be first
-    addXSDMapping
-    (mixedQuoteType,
-    new String[] 
-    {
-    "name", "MixedQuote",
-    "kind", "mixed"
-    });
-    addXSDMapping
-    ((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.MIXED),
-    new String[]
-    {
-    "kind", "elementWildcard",
-    "name", "mixed"
-    });
-  
-    addXSDMapping
-    ((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.SYMBOL),
-    new String[]
-    {
-    "kind", "element",
-    "name", "symbol"
-    });
-  
-    addXSDMapping
-    ((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.COMPANY_NAME),
-    new String[]
-    {
-    "kind", "element",
-    "name", "companyName"
-    });
-  
-    addXSDMapping
-    ((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.PRICE),
-    new String[]
-    {
-    "kind", "element",
-    "name", "price"
-    });
-  
-    addXSDMapping
-    ((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.OPEN1),
-    new String[]
-    {
-    "kind", "element",
-    "name", "open1"
-    });
-  
-    addXSDMapping
-    ((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.HIGH),
-    new String[]
-    {
-    "kind", "element",
-    "name", "high"
-    });
-  
-    addXSDMapping
-    ((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.LOW),
-    new String[]
-    {
-    "kind", "element",
-    "name", "low"
-    });
-  
-    addXSDMapping
-    ((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.VOLUME),
-    new String[]
-    {
-    "kind", "element",
-    "name", "volume"
-    });
-  
-    addXSDMapping
-    ((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.CHANGE1),
-    new String[]
-    {
-    "kind", "element",
-    "name", "change1"
-    });
-  
-    addXSDMapping
-    ((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.QUOTES),
-    new String[]
-    {
-    "kind", "element",
-    "name", "quotes"
-    });
-  
-    // TODO - kdk - is the order right?  should kind, elementOnly be first
-    addXSDMapping
-    (mixedRepeatingChoiceType,
-    new String[] 
-    {
-    "name", "MixedRepeatingChoice",
-    "kind", "mixed"
-    });
-    addXSDMapping
-    ((Property)mixedRepeatingChoiceType.getProperties().get(MixedRepeatingChoiceImpl.MIXED),
-    new String[]
-    {
-    "kind", "elementWildcard",
-    "name", "mixed"
-    });
-  
-    addXSDMapping
-    ((Property)mixedRepeatingChoiceType.getProperties().get(MixedRepeatingChoiceImpl.GROUP),
-    new String[]
-    {
-    "kind", "group",
-    "name", "group:1"
-    });
-  
-    addXSDMapping
-    ((Property)mixedRepeatingChoiceType.getProperties().get(MixedRepeatingChoiceImpl.A),
-    new String[]
-    {
-    "kind", "element",
-    "name", "a",
-    "group", "#group:1"
-    });
-  
-    addXSDMapping
-    ((Property)mixedRepeatingChoiceType.getProperties().get(MixedRepeatingChoiceImpl.B),
-    new String[]
-    {
-    "kind", "element",
-    "name", "b",
-    "group", "#group:1"
-    });
-  
-    // TODO - kdk - is the order right?  should kind, elementOnly be first
-    addXSDMapping
-    (repeatingChoiceType,
-    new String[] 
-    {
-    "name", "RepeatingChoice",
-    "kind", "elementOnly"
-    });
-    addXSDMapping
-    ((Property)repeatingChoiceType.getProperties().get(RepeatingChoiceImpl.GROUP),
-    new String[]
-    {
-    "kind", "group",
-    "name", "group:0"
-    });
-  
-    addXSDMapping
-    ((Property)repeatingChoiceType.getProperties().get(RepeatingChoiceImpl.A),
-    new String[]
-    {
-    "kind", "element",
-    "name", "a",
-    "group", "#group:0"
-    });
-  
-    addXSDMapping
-    ((Property)repeatingChoiceType.getProperties().get(RepeatingChoiceImpl.B),
-    new String[]
-    {
-    "kind", "element",
-    "name", "b",
-    "group", "#group:0"
-    });
-  
-    // TODO - kdk - is the order right?  should kind, elementOnly be first
-    addXSDMapping
-    (twoRCsType,
-    new String[] 
-    {
-    "name", "TwoRCs",
-    "kind", "elementOnly"
-    });
-    addXSDMapping
-    ((Property)twoRCsType.getProperties().get(TwoRCsImpl.GROUP),
-    new String[]
-    {
-    "kind", "group",
-    "name", "group:0"
-    });
-  
-    addXSDMapping
-    ((Property)twoRCsType.getProperties().get(TwoRCsImpl.A),
-    new String[]
-    {
-    "kind", "element",
-    "name", "a",
-    "group", "#group:0"
-    });
-  
-    addXSDMapping
-    ((Property)twoRCsType.getProperties().get(TwoRCsImpl.B),
-    new String[]
-    {
-    "kind", "element",
-    "name", "b",
-    "group", "#group:0"
-    });
-  
-    addXSDMapping
-    ((Property)twoRCsType.getProperties().get(TwoRCsImpl.SPLIT),
-    new String[]
-    {
-    "kind", "element",
-    "name", "split"
-    });
-  
-    addXSDMapping
-    ((Property)twoRCsType.getProperties().get(TwoRCsImpl.GROUP1),
-    new String[]
-    {
-    "kind", "group",
-    "name", "group:4"
-    });
-  
-    addXSDMapping
-    ((Property)twoRCsType.getProperties().get(TwoRCsImpl.Y),
-    new String[]
-    {
-    "kind", "element",
-    "name", "y",
-    "group", "#group:4"
-    });
-  
-    addXSDMapping
-    ((Property)twoRCsType.getProperties().get(TwoRCsImpl.Z),
-    new String[]
-    {
-    "kind", "element",
-    "name", "z",
-    "group", "#group:4"
-    });
-  
-    // TODO - kdk - is the order right?  should kind, elementOnly be first
-    addXSDMapping
-    (twoRCsMixedType,
-    new String[] 
-    {
-    "name", "TwoRCsMixed",
-    "kind", "mixed"
-    });
-    addXSDMapping
-    ((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.MIXED),
-    new String[]
-    {
-    "kind", "elementWildcard",
-    "name", "mixed"
-    });
-  
-    addXSDMapping
-    ((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.GROUP),
-    new String[]
-    {
-    "kind", "group",
-    "name", "group:1"
-    });
-  
-    addXSDMapping
-    ((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.A),
-    new String[]
-    {
-    "kind", "element",
-    "name", "a",
-    "group", "#group:1"
-    });
-  
-    addXSDMapping
-    ((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.B),
-    new String[]
-    {
-    "kind", "element",
-    "name", "b",
-    "group", "#group:1"
-    });
-  
-    addXSDMapping
-    ((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.SPLIT),
-    new String[]
-    {
-    "kind", "element",
-    "name", "split"
-    });
-  
-    addXSDMapping
-    ((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.GROUP1),
-    new String[]
-    {
-    "kind", "group",
-    "name", "group:5"
-    });
-  
-    addXSDMapping
-    ((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.Y),
-    new String[]
-    {
-    "kind", "element",
-    "name", "y",
-    "group", "#group:5"
-    });
-  
-    addXSDMapping
-    ((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.Z),
-    new String[]
-    {
-    "kind", "element",
-    "name", "z",
-    "group", "#group:5"
-    });
-  
+    
+    Property property = null;
+    
+    property = createGlobalProperty
+      ("mixedStockQuote",
+      this.getMixedQuote(),
+       new String[]
+       {
+       "kind", "element",
+       "name", "mixedStockQuote",
+       "namespace", "##targetNamespace"
+       });
+                
+    property = createGlobalProperty
+      ("mrc",
+      this.getMixedRepeatingChoice(),
+       new String[]
+       {
+       "kind", "element",
+       "name", "mrc",
+       "namespace", "##targetNamespace"
+       });
+                
+    property = createGlobalProperty
+      ("mrc2",
+      this.getTwoRCsMixed(),
+       new String[]
+       {
+       "kind", "element",
+       "name", "mrc2",
+       "namespace", "##targetNamespace"
+       });
+                
+    property = createGlobalProperty
+      ("rc",
+      this.getRepeatingChoice(),
+       new String[]
+       {
+       "kind", "element",
+       "name", "rc",
+       "namespace", "##targetNamespace"
+       });
+                
+    property = createGlobalProperty
+      ("rc2",
+      this.getTwoRCs(),
+       new String[]
+       {
+       "kind", "element",
+       "name", "rc2",
+       "namespace", "##targetNamespace"
+       });
+                
+    addXSDMapping
+      (mixedQuoteType,
+       new String[] 
+       {
+       "name", "MixedQuote",
+       "kind", "mixed"
+       });
+
+    addXSDMapping
+      ((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.MIXED),
+       new String[]
+       {
+       "kind", "elementWildcard",
+       "name", ":mixed"
+       });
+
+    addXSDMapping
+      ((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.SYMBOL),
+       new String[]
+       {
+       "kind", "element",
+       "name", "symbol"
+       });
+
+    addXSDMapping
+      ((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.COMPANY_NAME),
+       new String[]
+       {
+       "kind", "element",
+       "name", "companyName"
+       });
+
+    addXSDMapping
+      ((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.PRICE),
+       new String[]
+       {
+       "kind", "element",
+       "name", "price"
+       });
+
+    addXSDMapping
+      ((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.OPEN1),
+       new String[]
+       {
+       "kind", "element",
+       "name", "open1"
+       });
+
+    addXSDMapping
+      ((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.HIGH),
+       new String[]
+       {
+       "kind", "element",
+       "name", "high"
+       });
+
+    addXSDMapping
+      ((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.LOW),
+       new String[]
+       {
+       "kind", "element",
+       "name", "low"
+       });
+
+    addXSDMapping
+      ((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.VOLUME),
+       new String[]
+       {
+       "kind", "element",
+       "name", "volume"
+       });
+
+    addXSDMapping
+      ((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.CHANGE1),
+       new String[]
+       {
+       "kind", "element",
+       "name", "change1"
+       });
+
+    addXSDMapping
+      ((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.QUOTES),
+       new String[]
+       {
+       "kind", "element",
+       "name", "quotes"
+       });
+
+    addXSDMapping
+      (mixedRepeatingChoiceType,
+       new String[] 
+       {
+       "name", "MixedRepeatingChoice",
+       "kind", "mixed"
+       });
+
+    addXSDMapping
+      ((Property)mixedRepeatingChoiceType.getProperties().get(MixedRepeatingChoiceImpl.MIXED),
+       new String[]
+       {
+       "kind", "elementWildcard",
+       "name", ":mixed"
+       });
+
+    addXSDMapping
+      ((Property)mixedRepeatingChoiceType.getProperties().get(MixedRepeatingChoiceImpl.GROUP),
+       new String[]
+       {
+       "kind", "group",
+       "name", "group:1"
+       });
+
+    addXSDMapping
+      ((Property)mixedRepeatingChoiceType.getProperties().get(MixedRepeatingChoiceImpl.A),
+       new String[]
+       {
+       "kind", "element",
+       "name", "a",
+       "group", "#group:1"
+       });
+
+    addXSDMapping
+      ((Property)mixedRepeatingChoiceType.getProperties().get(MixedRepeatingChoiceImpl.B),
+       new String[]
+       {
+       "kind", "element",
+       "name", "b",
+       "group", "#group:1"
+       });
+
+    addXSDMapping
+      (repeatingChoiceType,
+       new String[] 
+       {
+       "name", "RepeatingChoice",
+       "kind", "elementOnly"
+       });
+
+    addXSDMapping
+      ((Property)repeatingChoiceType.getProperties().get(RepeatingChoiceImpl.GROUP),
+       new String[]
+       {
+       "kind", "group",
+       "name", "group:0"
+       });
+
+    addXSDMapping
+      ((Property)repeatingChoiceType.getProperties().get(RepeatingChoiceImpl.A),
+       new String[]
+       {
+       "kind", "element",
+       "name", "a",
+       "group", "#group:0"
+       });
+
+    addXSDMapping
+      ((Property)repeatingChoiceType.getProperties().get(RepeatingChoiceImpl.B),
+       new String[]
+       {
+       "kind", "element",
+       "name", "b",
+       "group", "#group:0"
+       });
+
+    addXSDMapping
+      (twoRCsType,
+       new String[] 
+       {
+       "name", "TwoRCs",
+       "kind", "elementOnly"
+       });
+
+    addXSDMapping
+      ((Property)twoRCsType.getProperties().get(TwoRCsImpl.GROUP),
+       new String[]
+       {
+       "kind", "group",
+       "name", "group:0"
+       });
+
+    addXSDMapping
+      ((Property)twoRCsType.getProperties().get(TwoRCsImpl.A),
+       new String[]
+       {
+       "kind", "element",
+       "name", "a",
+       "group", "#group:0"
+       });
+
+    addXSDMapping
+      ((Property)twoRCsType.getProperties().get(TwoRCsImpl.B),
+       new String[]
+       {
+       "kind", "element",
+       "name", "b",
+       "group", "#group:0"
+       });
+
+    addXSDMapping
+      ((Property)twoRCsType.getProperties().get(TwoRCsImpl.SPLIT),
+       new String[]
+       {
+       "kind", "element",
+       "name", "split"
+       });
+
+    addXSDMapping
+      ((Property)twoRCsType.getProperties().get(TwoRCsImpl.GROUP1),
+       new String[]
+       {
+       "kind", "group",
+       "name", "group:4"
+       });
+
+    addXSDMapping
+      ((Property)twoRCsType.getProperties().get(TwoRCsImpl.Y),
+       new String[]
+       {
+       "kind", "element",
+       "name", "y",
+       "group", "#group:4"
+       });
+
+    addXSDMapping
+      ((Property)twoRCsType.getProperties().get(TwoRCsImpl.Z),
+       new String[]
+       {
+       "kind", "element",
+       "name", "z",
+       "group", "#group:4"
+       });
+
+    addXSDMapping
+      (twoRCsMixedType,
+       new String[] 
+       {
+       "name", "TwoRCsMixed",
+       "kind", "mixed"
+       });
+
+    addXSDMapping
+      ((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.MIXED),
+       new String[]
+       {
+       "kind", "elementWildcard",
+       "name", ":mixed"
+       });
+
+    addXSDMapping
+      ((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.GROUP),
+       new String[]
+       {
+       "kind", "group",
+       "name", "group:1"
+       });
+
+    addXSDMapping
+      ((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.A),
+       new String[]
+       {
+       "kind", "element",
+       "name", "a",
+       "group", "#group:1"
+       });
+
+    addXSDMapping
+      ((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.B),
+       new String[]
+       {
+       "kind", "element",
+       "name", "b",
+       "group", "#group:1"
+       });
+
+    addXSDMapping
+      ((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.SPLIT),
+       new String[]
+       {
+       "kind", "element",
+       "name", "split"
+       });
+
+    addXSDMapping
+      ((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.GROUP1),
+       new String[]
+       {
+       "kind", "group",
+       "name", "group:5"
+       });
+
+    addXSDMapping
+      ((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.Y),
+       new String[]
+       {
+       "kind", "element",
+       "name", "y",
+       "group", "#group:5"
+       });
+
+    addXSDMapping
+      ((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.Z),
+       new String[]
+       {
+       "kind", "element",
+       "name", "z",
+       "group", "#group:5"
+       });
 
-    // TODO - kdk - how do I filter out mixed, xMLNSPrefixMap, and xSISchemaLocation without hardcoding it
-    // TODO - kdk - can I hardcode ##targetNamespace?
-  
-    createGlobalProperty
-    ("mixedStockQuote", 
-    this.getMixedQuote(),
-    new String[] 
-    {
-    "kind", "element",
-    "name", "mixedStockQuote",
-    "namespace", "##targetNamespace"
-    });  
-  
-    createGlobalProperty
-    ("mrc", 
-    this.getMixedRepeatingChoice(),
-    new String[] 
-    {
-    "kind", "element",
-    "name", "mrc",
-    "namespace", "##targetNamespace"
-    });  
-  
-    createGlobalProperty
-    ("mrc2", 
-    this.getTwoRCsMixed(),
-    new String[] 
-    {
-    "kind", "element",
-    "name", "mrc2",
-    "namespace", "##targetNamespace"
-    });  
-  
-    createGlobalProperty
-    ("rc", 
-    this.getRepeatingChoice(),
-    new String[] 
-    {
-    "kind", "element",
-    "name", "rc",
-    "namespace", "##targetNamespace"
-    });  
-  
-    createGlobalProperty
-    ("rc2", 
-    this.getTwoRCs(),
-    new String[] 
-    {
-    "kind", "element",
-    "name", "rc2",
-    "namespace", "##targetNamespace"
-    });  
-  
   }
-
+  
 } //SequencesFactoryImpl

Modified: incubator/tuscany/java/sdo/tools/src/test/java/com/example/sequences/impl/TwoRCsImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/tools/src/test/java/com/example/sequences/impl/TwoRCsImpl.java?view=diff&rev=509526&r1=509525&r2=509526
==============================================================================
--- incubator/tuscany/java/sdo/tools/src/test/java/com/example/sequences/impl/TwoRCsImpl.java (original)
+++ incubator/tuscany/java/sdo/tools/src/test/java/com/example/sequences/impl/TwoRCsImpl.java Tue Feb 20 04:06:51 2007
@@ -19,20 +19,17 @@
  */
 package com.example.sequences.impl;
 
+import com.example.sequences.SequencesFactory;
 import com.example.sequences.TwoRCs;
 
 import commonj.sdo.Sequence;
 import commonj.sdo.Type;
 
-import commonj.sdo.helper.TypeHelper;
-
 import java.util.Collection;
 import java.util.List;
 
 import org.apache.tuscany.sdo.impl.DataObjectBase;
 
-import org.apache.tuscany.sdo.util.BasicSequence;
-
 /**
  * <!-- begin-user-doc -->
  * An implementation of the model object '<em><b>Two RCs</b></em>'.
@@ -60,29 +57,16 @@
    * <!-- end-user-doc -->
    * @generated
    * @ordered
-   */
+   */	 
   public final static int GROUP = 0;
 
   /**
-   * The cached value of the '{@link #getGroup() <em>Group</em>}' attribute list.
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @see #getGroup()
-   * @generated
-   * @ordered
-   */
-  
-  // How to get BasicSequence from Sequence?
-  
-  protected BasicSequence group = null;
-  
-  /**
    * The feature id for the '<em><b>A</b></em>' attribute list.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
    * @ordered
-   */
+   */	 
   public final static int A = 1;
 
   /**
@@ -91,7 +75,7 @@
    * <!-- end-user-doc -->
    * @generated
    * @ordered
-   */
+   */	 
   public final static int B = 2;
 
   /**
@@ -100,75 +84,94 @@
    * <!-- end-user-doc -->
    * @generated
    * @ordered
-   */
+   */	 
   public final static int SPLIT = 3;
 
   /**
-   * The default value of the '{@link #getSplit() <em>Split</em>}' attribute.
+   * The feature id for the '<em><b>Group1</b></em>' attribute list.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
-   * @see #getSplit()
    * @generated
    * @ordered
-   */
-  protected static final String SPLIT_DEFAULT_ = null;
+   */	 
+  public final static int GROUP1 = 4;
 
   /**
-   * The cached value of the '{@link #getSplit() <em>Split</em>}' attribute.
+   * The feature id for the '<em><b>Y</b></em>' attribute list.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
-   * @see #getSplit()
    * @generated
    * @ordered
-   */
-  protected String split = SPLIT_DEFAULT_;
+   */	 
+  public final static int Y = 5;
 
   /**
-   * The feature id for the '<em><b>Group1</b></em>' attribute list.
+   * The feature id for the '<em><b>Z</b></em>' attribute list.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
    * @ordered
-   */
-  public final static int GROUP1 = 4;
+   */	 
+  public final static int Z = 6;
 
   /**
-   * The cached value of the '{@link #getGroup1() <em>Group1</em>}' attribute list.
+   * This represents the number of properties for this type.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
-   * @see #getGroup1()
    * @generated
    * @ordered
    */
   
-  // How to get BasicSequence from Sequence?
+  public final static int SDO_PROPERTY_COUNT = 7;
+
+  /**
+   * The cached value of the '{@link #getGroup() <em>Group</em>}' attribute list.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @see #getGroup()
+   * @generated
+   * @ordered
+   */
   
-  protected BasicSequence group1 = null;
+  protected Sequence group = null;
   
   /**
-   * The feature id for the '<em><b>Y</b></em>' attribute list.
+   * The default value of the '{@link #getSplit() <em>Split</em>}' attribute.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
+   * @see #getSplit()
    * @generated
    * @ordered
    */
-  public final static int Y = 5;
+  protected static final String SPLIT_DEFAULT_ = null;
 
   /**
-   * The feature id for the '<em><b>Z</b></em>' attribute list.
+   * The cached value of the '{@link #getSplit() <em>Split</em>}' attribute.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
+   * @see #getSplit()
    * @generated
    * @ordered
    */
-  public final static int Z = 6;
+  protected String split = SPLIT_DEFAULT_;
 
   /**
+   * The cached value of the '{@link #getGroup1() <em>Group1</em>}' attribute list.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @see #getGroup1()
+   * @generated
+   * @ordered
+   */
+  
+  protected Sequence group1 = null;
+  
+  /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
    */
-  protected TwoRCsImpl()
+  public TwoRCsImpl()
   {
     super();
   }
@@ -180,7 +183,7 @@
    */
   public Type getType()
   {
-    return TypeHelper.INSTANCE.getType(TwoRCs.class); //TBD Generate a more efficient implementation
+    return ((SequencesFactoryImpl)SequencesFactory.INSTANCE).getTwoRCs();
   }
 
   /**
@@ -192,12 +195,10 @@
   {
     if (group == null)
     {
-        		group = createSequence(GROUP);
-        	
+      group = createSequence(GROUP);
     }
     return group;
   }
-
   /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -208,7 +209,6 @@
           return getList(getGroup(), getType(), A);
 
   }
-
   /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -219,7 +219,6 @@
           return getList(getGroup(), getType(), B);
 
   }
-
   /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -229,7 +228,6 @@
   {
     return split;
   }
-
   /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -252,12 +250,10 @@
   {
     if (group1 == null)
     {
-        		group1 = createSequence(GROUP1);
-        	
+      group1 = createSequence(GROUP1);
     }
     return group1;
   }
-
   /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -268,7 +264,6 @@
           return getList(getGroup1(), getType(), Y);
 
   }
-
   /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -279,7 +274,6 @@
           return getList(getGroup1(), getType(), Z);
 
   }
-
   /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -290,9 +284,9 @@
     switch (propertyIndex)
     {
       case GROUP:
-      			return removeFromSequence(getGroup(), otherEnd, changeContext);
+        return removeFromSequence(getGroup(), otherEnd, changeContext);
       case GROUP1:
-      			return removeFromSequence(getGroup1(), otherEnd, changeContext);
+        return removeFromSequence(getGroup1(), otherEnd, changeContext);
     }
     return super.inverseRemove(otherEnd, propertyIndex, changeContext);
   }
@@ -308,7 +302,7 @@
     {
       case GROUP:
         // XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view
-        		//if (coreType) 
+        //if (coreType) 
         return getGroup();
       case A:
         return getA();
@@ -318,7 +312,7 @@
         return getSplit();
       case GROUP1:
         // XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view
-        		//if (coreType) 
+        //if (coreType) 
         return getGroup1();
       case Y:
         return getY();
@@ -376,7 +370,7 @@
     switch (propertyIndex)
     {
       case GROUP:
-      			unsetSequence(getGroup());
+        unsetSequence(getGroup());
         return;
       case A:
         getA().clear();
@@ -388,7 +382,7 @@
         setSplit(SPLIT_DEFAULT_);
         return;
       case GROUP1:
-      			unsetSequence(getGroup1());
+        unsetSequence(getGroup1());
         return;
       case Y:
         getY().clear();
@@ -410,7 +404,6 @@
     switch (propertyIndex)
     {
       case GROUP:
-        		// KDK - should this be !isSequenceEmpty?
         return group != null && !isSequenceEmpty(getGroup());
       case A:
         return !getA().isEmpty();
@@ -419,7 +412,6 @@
       case SPLIT:
         return SPLIT_DEFAULT_ == null ? split != null : !SPLIT_DEFAULT_.equals(split);
       case GROUP1:
-        		// KDK - should this be !isSequenceEmpty?
         return group1 != null && !isSequenceEmpty(getGroup1());
       case Y:
         return !getY().isEmpty();
@@ -436,7 +428,7 @@
    */
   public String toString()
   {
-    if (isProxy()) return super.toString();
+    if (isProxy(this)) return super.toString();
 
     StringBuffer result = new StringBuffer(super.toString());
     result.append(" (group: ");

Modified: incubator/tuscany/java/sdo/tools/src/test/java/com/example/sequences/impl/TwoRCsMixedImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/tools/src/test/java/com/example/sequences/impl/TwoRCsMixedImpl.java?view=diff&rev=509526&r1=509525&r2=509526
==============================================================================
--- incubator/tuscany/java/sdo/tools/src/test/java/com/example/sequences/impl/TwoRCsMixedImpl.java (original)
+++ incubator/tuscany/java/sdo/tools/src/test/java/com/example/sequences/impl/TwoRCsMixedImpl.java Tue Feb 20 04:06:51 2007
@@ -19,20 +19,17 @@
  */
 package com.example.sequences.impl;
 
+import com.example.sequences.SequencesFactory;
 import com.example.sequences.TwoRCsMixed;
 
 import commonj.sdo.Sequence;
 import commonj.sdo.Type;
 
-import commonj.sdo.helper.TypeHelper;
-
 import java.util.Collection;
 import java.util.List;
 
 import org.apache.tuscany.sdo.impl.DataObjectBase;
 
-import org.apache.tuscany.sdo.util.BasicSequence;
-
 /**
  * <!-- begin-user-doc -->
  * An implementation of the model object '<em><b>Two RCs Mixed</b></em>'.
@@ -61,29 +58,16 @@
    * <!-- end-user-doc -->
    * @generated
    * @ordered
-   */
+   */	 
   public final static int MIXED = 0;
 
   /**
-   * The cached value of the '{@link #getMixed() <em>Mixed</em>}' attribute list.
-   * <!-- begin-user-doc -->
-   * <!-- end-user-doc -->
-   * @see #getMixed()
-   * @generated
-   * @ordered
-   */
-  
-  // How to get BasicSequence from Sequence?
-  
-  protected BasicSequence mixed = null;
-  
-  /**
    * The feature id for the '<em><b>Group</b></em>' attribute list.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
    * @ordered
-   */
+   */	 
   public final static int GROUP = 1;
 
   /**
@@ -92,7 +76,7 @@
    * <!-- end-user-doc -->
    * @generated
    * @ordered
-   */
+   */	 
   public final static int A = 2;
 
   /**
@@ -101,7 +85,7 @@
    * <!-- end-user-doc -->
    * @generated
    * @ordered
-   */
+   */	 
   public final static int B = 3;
 
   /**
@@ -110,52 +94,73 @@
    * <!-- end-user-doc -->
    * @generated
    * @ordered
-   */
+   */	 
   public final static int SPLIT = 4;
 
   /**
-   * The default value of the '{@link #getSplit() <em>Split</em>}' attribute.
+   * The feature id for the '<em><b>Group1</b></em>' attribute list.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
-   * @see #getSplit()
    * @generated
    * @ordered
-   */
-  protected static final String SPLIT_DEFAULT_ = null;
+   */	 
+  public final static int GROUP1 = 5;
 
   /**
-   * The feature id for the '<em><b>Group1</b></em>' attribute list.
+   * The feature id for the '<em><b>Y</b></em>' attribute list.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
    * @ordered
-   */
-  public final static int GROUP1 = 5;
+   */	 
+  public final static int Y = 6;
 
   /**
-   * The feature id for the '<em><b>Y</b></em>' attribute list.
+   * The feature id for the '<em><b>Z</b></em>' attribute list.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @generated
+   * @ordered
+   */	 
+  public final static int Z = 7;
+
+  /**
+   * This represents the number of properties for this type.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
    * @ordered
    */
-  public final static int Y = 6;
+  
+  public final static int SDO_PROPERTY_COUNT = 8;
 
   /**
-   * The feature id for the '<em><b>Z</b></em>' attribute list.
+   * The cached value of the '{@link #getMixed() <em>Mixed</em>}' attribute list.
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
+   * @see #getMixed()
    * @generated
    * @ordered
    */
-  public final static int Z = 7;
+  
+  protected Sequence mixed = null;
+  
+  /**
+   * The default value of the '{@link #getSplit() <em>Split</em>}' attribute.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @see #getSplit()
+   * @generated
+   * @ordered
+   */
+  protected static final String SPLIT_DEFAULT_ = null;
 
   /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
    * @generated
    */
-  protected TwoRCsMixedImpl()
+  public TwoRCsMixedImpl()
   {
     super();
   }
@@ -167,7 +172,7 @@
    */
   public Type getType()
   {
-    return TypeHelper.INSTANCE.getType(TwoRCsMixed.class); //TBD Generate a more efficient implementation
+    return ((SequencesFactoryImpl)SequencesFactory.INSTANCE).getTwoRCsMixed();
   }
 
   /**
@@ -179,12 +184,10 @@
   {
     if (mixed == null)
     {
-        		mixed = createSequence(MIXED);
-        	
+      mixed = createSequence(MIXED);
     }
     return mixed;
   }
-
   /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -194,7 +197,6 @@
   {
     return createSequence(getMixed(), getType(), GROUP);
   }
-
   /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -205,7 +207,6 @@
           return getList(getGroup(), getType(), A);
 
   }
-
   /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -216,7 +217,6 @@
           return getList(getGroup(), getType(), B);
 
   }
-
   /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -226,7 +226,6 @@
   {
     return (String)get(getMixed(), getType(), SPLIT);
   }
-
   /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -234,7 +233,7 @@
    */
   public void setSplit(String newSplit)
   {
-        set(getMixed(), getType(), SPLIT, newSplit);
+    set(getMixed(), getType(), SPLIT, newSplit);
   }
 
   /**
@@ -246,7 +245,6 @@
   {
     return createSequence(getMixed(), getType(), GROUP1);
   }
-
   /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -257,7 +255,6 @@
           return getList(getGroup1(), getType(), Y);
 
   }
-
   /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -268,7 +265,6 @@
           return getList(getGroup1(), getType(), Z);
 
   }
-
   /**
    * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
@@ -279,11 +275,11 @@
     switch (propertyIndex)
     {
       case MIXED:
-      			return removeFromSequence(getMixed(), otherEnd, changeContext);
+        return removeFromSequence(getMixed(), otherEnd, changeContext);
       case GROUP:
-      			return removeFromSequence(getGroup(), otherEnd, changeContext);
+        return removeFromSequence(getGroup(), otherEnd, changeContext);
       case GROUP1:
-      			return removeFromSequence(getGroup1(), otherEnd, changeContext);
+        return removeFromSequence(getGroup1(), otherEnd, changeContext);
     }
     return super.inverseRemove(otherEnd, propertyIndex, changeContext);
   }
@@ -299,11 +295,11 @@
     {
       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) 
+        //if (coreType) 
         return getMixed();
       case GROUP:
         // XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view
-        		//if (coreType) 
+        //if (coreType) 
         return getGroup();
       case A:
         return getA();
@@ -313,7 +309,7 @@
         return getSplit();
       case GROUP1:
         // XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view
-        		//if (coreType) 
+        //if (coreType) 
         return getGroup1();
       case Y:
         return getY();
@@ -374,10 +370,10 @@
     switch (propertyIndex)
     {
       case MIXED:
-      			unsetSequence(getMixed());
+        unsetSequence(getMixed());
         return;
       case GROUP:
-      			unsetSequence(getGroup());
+        unsetSequence(getGroup());
         return;
       case A:
         getA().clear();
@@ -389,7 +385,7 @@
         setSplit(SPLIT_DEFAULT_);
         return;
       case GROUP1:
-      			unsetSequence(getGroup1());
+        unsetSequence(getGroup1());
         return;
       case Y:
         getY().clear();
@@ -411,10 +407,9 @@
     switch (propertyIndex)
     {
       case MIXED:
-        		// KDK - should this be !isSequenceEmpty?
         return mixed != null && !isSequenceEmpty(getMixed());
       case GROUP:
-        		return !isSequenceEmpty(getGroup());
+        return !isSequenceEmpty(getGroup());
       case A:
         return !getA().isEmpty();
       case B:
@@ -422,7 +417,7 @@
       case SPLIT:
         return SPLIT_DEFAULT_ == null ? getSplit() != null : !SPLIT_DEFAULT_.equals(getSplit());
       case GROUP1:
-        		return !isSequenceEmpty(getGroup1());
+        return !isSequenceEmpty(getGroup1());
       case Y:
         return !getY().isEmpty();
       case Z:
@@ -438,7 +433,7 @@
    */
   public String toString()
   {
-    if (isProxy()) return super.toString();
+    if (isProxy(this)) return super.toString();
 
     StringBuffer result = new StringBuffer(super.toString());
     result.append(" (mixed: ");

Modified: incubator/tuscany/java/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/AllTests.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/AllTests.java?view=diff&rev=509526&r1=509525&r2=509526
==============================================================================
--- incubator/tuscany/java/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/AllTests.java (original)
+++ incubator/tuscany/java/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/AllTests.java Tue Feb 20 04:06:51 2007
@@ -1,3 +1,23 @@
+/**
+ *
+ *  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 org.apache.tuscany.sdo.test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
@@ -9,11 +29,9 @@
 
         TestSuite suite = new TestSuite();
       
-        // suite.addTestSuite(ChangeSummaryOnDataObjectTestCase.class);
         suite.addTestSuite(ChangeSummaryGenTestCase.class);
         suite.addTestSuite(GenPatternsTestCase.class);
-        //suite.addTestSuite(org.apache.tuscany.sdo.test.StaticSequenceNoEmfTestCase.class);
-
+        suite.addTestSuite(SimpleStaticTestCase.class);
 
         return suite;
     }

Copied: incubator/tuscany/java/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/SimpleStaticTestCase.java (from r509506, incubator/tuscany/java/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/SimpleStaticTest.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/SimpleStaticTestCase.java?view=diff&rev=509526&p1=incubator/tuscany/java/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/SimpleStaticTest.java&r1=509506&p2=incubator/tuscany/java/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/SimpleStaticTestCase.java&r2=509526
==============================================================================
--- incubator/tuscany/java/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/SimpleStaticTest.java (original)
+++ incubator/tuscany/java/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/SimpleStaticTestCase.java Tue Feb 20 04:06:51 2007
@@ -21,6 +21,8 @@
 
 import java.math.BigDecimal;
 
+import junit.framework.TestCase;
+
 import org.apache.tuscany.sdo.util.SDOUtil;
 
 import com.example.simple.Quote;
@@ -28,20 +30,23 @@
 import com.example.simple.impl.SimpleFactoryImpl;
 
 import commonj.sdo.DataObject;
+import commonj.sdo.helper.HelperContext;
 import commonj.sdo.helper.XMLHelper;
 
 
-public class SimpleStaticTest
+public class SimpleStaticTestCase extends TestCase
 {
+  
+  HelperContext scope;
   /**
    * Simple Static SDO 2 test.
    */
-  public static void main(String[] args)
+  public void testSimpleStatic()
   {
     try
     {
-      SDOUtil.registerStaticTypes(SimpleFactory.class);
-      System.out.println(((SimpleFactoryImpl)SimpleFactory.INSTANCE).PATTERN_VERSION);
+      SimpleFactory.INSTANCE.register(scope);
+      // System.out.println(SimpleFactoryImpl.PATTERN_VERSION);
       
       //Quote quote = (Quote)DataFactory.INSTANCE.create(Quote.class);
       Quote quote = SimpleFactory.INSTANCE.createQuote();
@@ -60,11 +65,22 @@
       quote.getQuotes().add(child);
       child.setPrice(new BigDecimal("2000.0"));
 
-      XMLHelper.INSTANCE.save((DataObject)quote, "http://www.example.com/simple", "stockQuote", System.out);
+      // scope.getXMLHelper().save((DataObject)quote, "http://www.example.com/simple", "stockQuote", System.out);
     }
     catch (Exception e)
     {
       e.printStackTrace();
     }
   }
+
+  protected void setUp() throws Exception {
+    scope = SDOUtil.createHelperContext();
+    super.setUp();
+  }
+  
+  protected void tearDown() throws Exception {
+  	super.tearDown();
+  }
+
+  
 }



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


Mime
View raw message