summaryrefslogtreecommitdiffstats
path: root/branches/sdo-java-M2/sdo/tools
diff options
context:
space:
mode:
Diffstat (limited to 'branches/sdo-java-M2/sdo/tools')
-rw-r--r--branches/sdo-java-M2/sdo/tools/pom.xml84
-rw-r--r--branches/sdo-java-M2/sdo/tools/readme.htm44
-rw-r--r--branches/sdo-java-M2/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/Interface2JavaGenerator.java245
-rw-r--r--branches/sdo-java-M2/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/JavaGenerator.java636
-rw-r--r--branches/sdo-java-M2/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/XSD2JavaGenerator.java183
-rw-r--r--branches/sdo-java-M2/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/adapter/SDOGenClassGeneratorAdapter.java46
-rw-r--r--branches/sdo-java-M2/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/adapter/SDOGenModelGeneratorAdapterFactory.java54
-rw-r--r--branches/sdo-java-M2/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/adapter/SDOGenPackageGeneratorAdapter.java52
-rw-r--r--branches/sdo-java-M2/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/templates/model/SDOClass.java4142
-rw-r--r--branches/sdo-java-M2/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/templates/model/SDOFactoryClass.java1706
-rw-r--r--branches/sdo-java-M2/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/util/SDOGenUtil.java33
-rw-r--r--branches/sdo-java-M2/sdo/tools/src/main/java/org/eclipse/jdt/core/formatter/CodeFormatter.java27
-rw-r--r--branches/sdo-java-M2/sdo/tools/src/main/resources/META-INF/LICENSE.txt1277
-rw-r--r--branches/sdo-java-M2/sdo/tools/src/main/resources/META-INF/NOTICE29
-rw-r--r--branches/sdo-java-M2/sdo/tools/src/main/resources/META-INF/README.txt35
-rw-r--r--branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/MixedQuote.java326
-rw-r--r--branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/MixedRepeatingChoice.java99
-rw-r--r--branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/RepeatingChoice.java85
-rw-r--r--branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/SequencesFactory.java86
-rw-r--r--branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/TwoRCs.java154
-rw-r--r--branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/TwoRCsMixed.java168
-rw-r--r--branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/impl/MixedQuoteImpl.java660
-rw-r--r--branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/impl/MixedRepeatingChoiceImpl.java302
-rw-r--r--branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/impl/RepeatingChoiceImpl.java268
-rw-r--r--branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/impl/SequencesFactoryImpl.java695
-rw-r--r--branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/impl/TwoRCsImpl.java452
-rw-r--r--branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/impl/TwoRCsMixedImpl.java450
-rw-r--r--branches/sdo-java-M2/sdo/tools/src/test/java/com/example/simple/Quote.java310
-rw-r--r--branches/sdo-java-M2/sdo/tools/src/test/java/com/example/simple/SimpleFactory.java49
-rw-r--r--branches/sdo-java-M2/sdo/tools/src/test/java/com/example/simple/impl/QuoteImpl.java715
-rw-r--r--branches/sdo-java-M2/sdo/tools/src/test/java/com/example/simple/impl/SimpleFactoryImpl.java141
-rw-r--r--branches/sdo-java-M2/sdo/tools/src/test/java/com/example/simple/impl/SimplePackageImpl.java911
-rw-r--r--branches/sdo-java-M2/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/SimpleStaticTest.java67
-rw-r--r--branches/sdo-java-M2/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/StaticSequenceNoEmfTestCase.java252
-rw-r--r--branches/sdo-java-M2/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/TestUtil.java288
-rw-r--r--branches/sdo-java-M2/sdo/tools/src/test/resources/enum.xsd50
-rw-r--r--branches/sdo-java-M2/sdo/tools/src/test/resources/mixedRepeatingChoiceTestResult.xml25
-rw-r--r--branches/sdo-java-M2/sdo/tools/src/test/resources/mixedStaticTestResult.xml34
-rw-r--r--branches/sdo-java-M2/sdo/tools/src/test/resources/repeatingChoice.xsd33
-rw-r--r--branches/sdo-java-M2/sdo/tools/src/test/resources/repeatingChoiceTestResult.xml25
-rw-r--r--branches/sdo-java-M2/sdo/tools/src/test/resources/sequences.xsd100
-rw-r--r--branches/sdo-java-M2/sdo/tools/src/test/resources/simple.xsd41
-rw-r--r--branches/sdo-java-M2/sdo/tools/src/test/resources/twoRepeatingChoicesMixedTestResult.xml28
-rw-r--r--branches/sdo-java-M2/sdo/tools/src/test/resources/twoRepeatingChoicesTestResult.xml28
-rw-r--r--branches/sdo-java-M2/sdo/tools/templates/Header.javajetinc6
-rw-r--r--branches/sdo-java-M2/sdo/tools/templates/models/SDOClass.javajet1844
-rw-r--r--branches/sdo-java-M2/sdo/tools/templates/models/SDOFactoryClass.javajet830
47 files changed, 18115 insertions, 0 deletions
diff --git a/branches/sdo-java-M2/sdo/tools/pom.xml b/branches/sdo-java-M2/sdo/tools/pom.xml
new file mode 100644
index 0000000000..4c0467928d
--- /dev/null
+++ b/branches/sdo-java-M2/sdo/tools/pom.xml
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+<project>
+ <parent>
+ <groupId>org.apache.tuscany.sdo</groupId>
+ <artifactId>tuscany-sdo</artifactId>
+ <version>1.0-incubator-M2</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>tuscany-sdo-tools</artifactId>
+ <name>Tuscany SDO Tools</name>
+ <description>SDO Tools.</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sdo</groupId>
+ <artifactId>tuscany-sdo-impl</artifactId>
+ <version>${pom.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.emf</groupId>
+ <artifactId>codegen</artifactId>
+ <version>${emfVersion}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.emf</groupId>
+ <artifactId>codegen-ecore</artifactId>
+ <version>${emfVersion}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </dependency>
+ </dependencies>
+
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <!-- <overview>${basedir}/src/main/java/org/apache/tuscany/sdo/overview.html</overview> -->
+ <version>2.0</version>
+ </configuration>
+ <!-- <executions>
+ <execution>
+ <id>package</id>
+ <phase>package</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions> -->
+ </plugin>
+
+ </plugins>
+ </build>
+
+
+</project>
diff --git a/branches/sdo-java-M2/sdo/tools/readme.htm b/branches/sdo-java-M2/sdo/tools/readme.htm
new file mode 100644
index 0000000000..693d14baa5
--- /dev/null
+++ b/branches/sdo-java-M2/sdo/tools/readme.htm
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+ <!--
+ 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.
+ -->
+
+<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
+<meta content="text/css" http-equiv="Content-Style-Type"><title>Tuscany SDO Tools</title>
+
+<style type="text/css" media="all">
+@import url("../../css/maven-base.css");
+@import url("../../css/maven-theme.css");
+@import url("../../css/site.css");
+</style>
+<link rel="stylesheet" href="./css/print.css" type="text/css" media="print"></head>
+
+<body>
+<h2>Tuscany SDO Tools</h2>
+<h3>Building SDO Tools</h3>
+
+To build the Tuscany SDO Java Generator tools, perform the following steps
+<ul>
+<li> Ensure that the environment variable JAVA_HOME is set to point to an installation of Java 5 (Java 1.5.0_6 works) </li>
+<li> Run the command "mvn" </li>
+</ul>
+<b>Note:</b> only the Interface2JavaGenerator class requires Java 5. You can build the XSD2JavaGenerator tool using a Java 1.4 JDK by removing the Interface2JavaGenerator.java file before running the "mvn" command.
+
+</body></html>
diff --git a/branches/sdo-java-M2/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/Interface2JavaGenerator.java b/branches/sdo-java-M2/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/Interface2JavaGenerator.java
new file mode 100644
index 0000000000..837a3504f2
--- /dev/null
+++ b/branches/sdo-java-M2/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/Interface2JavaGenerator.java
@@ -0,0 +1,245 @@
+/**
+ *
+ * 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.generate;
+
+import java.lang.reflect.Method;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.tuscany.sdo.util.DataObjectUtil;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EcoreFactory;
+import org.eclipse.emf.ecore.impl.EPackageRegistryImpl;
+
+import commonj.sdo.helper.TypeHelper;
+
+public class Interface2JavaGenerator extends JavaGenerator
+{
+ /**
+ * Generate static SDOs from Java interfaces
+ *
+ * Usage arguments: see JavaGenerator
+ *
+ * [ -targetDirectory <target-root-directory> ]
+ * [ -javaPackage <java-package-name> ]
+ * [ -namespace <xsd-namespace> ]
+ * [ other options ... ]
+ * interface-names
+ *
+ * Options:
+ *
+ * -namespace
+ * Set the namespaceURI of the generated SDO Types to the specified value.
+ *
+ * NOTE: see the base class JavaGenerator for other options.
+ *
+ * Example:
+ *
+ * generate somepackage.InterfaceA somepackage.InterfaceB
+ *
+ */
+ public static void main(String args[])
+ {
+ try
+ {
+ JavaGenerator generator = new Interface2JavaGenerator();
+ generator.processArguments(args);
+ generator.run(args);
+ }
+ catch (IllegalArgumentException e)
+ {
+ printUsage();
+ }
+ }
+
+ protected String namespace = null;
+
+ protected int handleArgument(String args[], int index)
+ {
+ if (args[index].equalsIgnoreCase("-namespace"))
+ {
+ namespace = args[++index];
+ }
+ else
+ {
+ return super.handleArgument(args, index);
+ }
+
+ return index + 1;
+ }
+
+ protected void run(String args[])
+ {
+ List javaInterfaces=new ArrayList();
+
+ for (int index = inputIndex; index < args.length; ++index)
+ {
+ javaInterfaces.add(args[index]);
+ }
+
+ ClassLoader classLoader=JavaGenerator.class.getClassLoader();
+ generateFromJavaInterfaces(classLoader, javaInterfaces, namespace, targetDirectory, javaPackage, prefix, genOptions);
+ }
+
+ public static void generateFromJavaInterfaces(ClassLoader classLoader, List javaInterfaces, String packageURI, String targetDirectory, String javaPackage, String prefix, int genOptions)
+ {
+ try
+ {
+ // Initialize the SDO runtime
+ DataObjectUtil.initRuntime();
+ EPackage.Registry packageRegistry = new EPackageRegistryImpl(EPackage.Registry.INSTANCE);
+
+ // Create an EPackage for the generated SDO
+ if (packageURI == null)
+ packageURI = "http://" + javaPackage;
+ EPackage implEPackage = EcoreFactory.eINSTANCE.createEPackage();
+ implEPackage.setNsURI(packageURI);
+ String shortName = shortName(packageURI);
+ implEPackage.setName(shortName);
+ implEPackage.setNsPrefix(shortName.toLowerCase());
+ packageRegistry.put(packageURI, implEPackage);
+
+ // Create EClasses for all the given Java interfaces
+ Map eClasses = new HashMap();
+ for (Iterator iter = javaInterfaces.iterator(); iter.hasNext();)
+ {
+ String interfaceName = (String)iter.next();
+ Class instanceClass = Class.forName(interfaceName, true, classLoader);
+
+ EClass implEClass = EcoreFactory.eINSTANCE.createEClass();
+ String className = shortName(instanceClass.getName());
+ implEClass.setName(className);
+ implEClass.setInstanceClass(instanceClass);
+
+ eClasses.put(instanceClass, implEClass);
+ implEPackage.getEClassifiers().add(implEClass);
+ }
+
+ // Populate the EClasses with EAttributes and EReferences for their properties
+ for (Iterator iter = implEPackage.getEClassifiers().iterator(); iter.hasNext();)
+ {
+ EClass implEClass = (EClass)iter.next();
+ Class instanceClass = implEClass.getInstanceClass();
+ Method[] methods = instanceClass.getMethods();
+ for (int m = 0; m < methods.length; m++)
+ {
+ Method method = methods[m];
+ String propertyName = null;
+ if (method.getName().startsWith("get"))
+ propertyName = method.getName().substring(3);
+ else if (method.getName().startsWith("is"))
+ propertyName = method.getName().substring(2);
+
+ if (propertyName != null)
+ {
+ if (propertyName.length() > 1)
+ propertyName = propertyName.substring(0, 1).toLowerCase() + propertyName.substring(1);
+
+ Class propertyClass = method.getReturnType();
+ EClass propertyEClass = (EClass)eClasses.get(propertyClass);
+
+ if (propertyEClass != null)
+ {
+ // The property is another SDO, create an EReference to represent the property
+ EReference reference = EcoreFactory.eINSTANCE.createEReference();
+ reference.setName(propertyName);
+ reference.setContainment(true);
+ reference.setEType(propertyEClass);
+ implEClass.getEStructuralFeatures().add(reference);
+
+ }
+ else
+ {
+ // The property is a List<T> and T is an SDO, created a 0..many EReference to represent the property
+ if (propertyClass == List.class)
+ {
+ Type genericType = method.getGenericReturnType();
+ if (genericType instanceof ParameterizedType)
+ {
+ ParameterizedType parameterizedType = (ParameterizedType)genericType;
+ Type[] targs = parameterizedType.getActualTypeArguments();
+ if (targs.length != 0 && eClasses.containsKey(targs[0]))
+ {
+ propertyEClass = (EClass)eClasses.get(targs[0]);
+ if (propertyEClass != null)
+ {
+ EReference reference = EcoreFactory.eINSTANCE.createEReference();
+ reference.setName(propertyName);
+ reference.setContainment(true);
+ reference.setEType(propertyEClass);
+ reference.setUpperBound(-1);
+ implEClass.getEStructuralFeatures().add(reference);
+ }
+ }
+ }
+ continue;
+ }
+
+ // The property is a regular Java type / not an SDO, create an EAttribute to represent it
+ EAttribute attribute = EcoreFactory.eINSTANCE.createEAttribute();
+ attribute.setName(propertyName);
+ EDataType dataType = (EDataType)TypeHelper.INSTANCE.getType(propertyClass);
+ attribute.setEType(dataType);
+ implEClass.getEStructuralFeatures().add(attribute);
+ }
+ }
+ }
+ }
+
+ generatePackages(packageRegistry.values(), packageURI, shortName, targetDirectory, javaPackage, prefix, genOptions);
+ }
+ catch (ClassNotFoundException e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ protected static void printUsage()
+ {
+ System.out.println("Usage arguments:");
+ System.out.println(" [ -targetDirectory <target-root-directory> ]");
+ System.out.println(" [ -javaPackage <java-package-name> ]");
+ System.out.println(" [ -namespace <xsd-namespace> ]");
+ System.out.println(" [ -prefix <prefix-string> ]");
+ System.out.println(" [ -sparsePattern | -storePattern ]");
+ System.out.println(" [ -noInterfaces ]");
+ System.out.println(" [ -noContainment ]");
+ System.out.println(" [ -noNotification ]");
+ System.out.println(" [ -arrayAccessors ]");
+ System.out.println(" [ -generateLoader ]");
+ System.out.println(" [ -noUnsettable ]");
+ System.out.println(" [ -noEMF ]");
+ System.out.println(" interface-names");
+ System.out.println("");
+ System.out.println("For example:");
+ System.out.println("");
+ System.out.println(" generate somepackage.InterfaceA somepackage.InterfaceB");
+ }
+
+}
diff --git a/branches/sdo-java-M2/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/JavaGenerator.java b/branches/sdo-java-M2/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/JavaGenerator.java
new file mode 100644
index 0000000000..80030bf3d0
--- /dev/null
+++ b/branches/sdo-java-M2/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/JavaGenerator.java
@@ -0,0 +1,636 @@
+/**
+ *
+ * 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.generate;
+
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.StringTokenizer;
+
+import org.apache.tuscany.sdo.generate.adapter.SDOGenModelGeneratorAdapterFactory;
+import org.apache.tuscany.sdo.helper.XSDHelperImpl;
+import org.apache.tuscany.sdo.impl.SDOPackageImpl;
+import org.apache.tuscany.sdo.model.impl.ModelPackageImpl;
+import org.apache.tuscany.sdo.util.DataObjectUtil;
+import org.eclipse.emf.codegen.ecore.generator.Generator;
+import org.eclipse.emf.codegen.ecore.generator.GeneratorAdapterFactory;
+import org.eclipse.emf.codegen.ecore.genmodel.GenClass;
+import org.eclipse.emf.codegen.ecore.genmodel.GenDelegationKind;
+import org.eclipse.emf.codegen.ecore.genmodel.GenModel;
+import org.eclipse.emf.codegen.ecore.genmodel.GenModelFactory;
+import org.eclipse.emf.codegen.ecore.genmodel.GenModelPackage;
+import org.eclipse.emf.codegen.ecore.genmodel.GenPackage;
+import org.eclipse.emf.codegen.ecore.genmodel.GenResourceKind;
+import org.eclipse.emf.codegen.ecore.genmodel.generator.GenBaseGeneratorAdapter;
+import org.eclipse.emf.codegen.ecore.genmodel.generator.GenModelGeneratorAdapterFactory;
+import org.eclipse.emf.codegen.util.CodeGenUtil;
+import org.eclipse.emf.common.util.BasicMonitor;
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.impl.EPackageRegistryImpl;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.util.BasicExtendedMetaData;
+import org.eclipse.emf.ecore.util.Diagnostician;
+import org.eclipse.emf.ecore.util.ExtendedMetaData;
+import org.eclipse.xsd.XSDSchema;
+
+import commonj.sdo.helper.XSDHelper;
+
+/**
+ * Abstract base class for static SDO code generators. See XSD2JavaGenerator and Interface2JavaGenerator for
+ * concrete generator commands.
+ *
+ * Supports the following command line options:
+ *
+ * [ -targetDirectory <target-root-directory> ]
+ * [ -javaPackage <java-package-name> ]
+ * [ -prefix <prefix-string> ]
+ * [ -sparsePattern | -storePattern ]
+ * [ -noInterfaces ]
+ * [ -noContainment ]
+ * [ -noNotification ]
+ * [ -arrayAccessors ]
+ * [ -generateLoader ]
+ * [ -noUnsettable ]
+ * [ -noEMF ]
+ * [ -interfaceDataObject ]
+ *
+ * Basic options:
+ *
+ * -targetDirectory
+ * Generates the Java source code in the specified directory. By default, the code is generated
+ * in the same directory as the input xsd or wsdl file.
+ * -javaPackage
+ * Overrides the Java package for the generated classes. By default the package name is derived
+ * from the targetNamespace of the XML schema being generated. For example, if the targetNamespace is
+ * "http://www.example.com/simple", the default package will be "com.example.simple".
+ * -prefix
+ * Specifies the prefix string to use for naming the generated factory. For example "-prefix Foo" will
+ * result in a factory interface with the name "FooFactory".
+ * -sparsePattern
+ * For SDO metamodels that have classes with many properties of which only a few are typically set at
+ * runtime, this option can be used to produce a space-optimized implementation (at the expense of speed).
+ * -storePattern
+ * This option can be used to generate static classes that work with a Store-based DataObject
+ * implementation. It changes the generator pattern to generate accessors which delegate to the
+ * reflective methods (as opposed to the other way around) and changes the DataObject base class
+ * to org.apache.tuscany.sdo.impl.StoreDataObjectImpl. Note that this option generates classes that
+ * require a Store implementation to be provided before they can be run.
+ * -noEMF
+ * This option is used to generate static classes that have no references to EMF classes. This
+ * feature is currently being implemented and is in a preliminary state.
+ * -interfaceDataObject
+ * This option is used to generate static interfaces that extend commonj.sdo.DataObject
+ *
+ * The following options can be used to increase performance, but with some loss of SDO functionality:
+ *
+ * -noInterfaces
+ * By default, each DataObject generates both a Java interface and a corresponding implementation
+ * class. If an SDO metamodel does not use multiple inheritance (which is always the case for
+ * XML Schema derived models), then this option can be used to eliminate the interface and to generate
+ * only an implementation class.
+ *
+ * Following are planned but not supported yet:
+ *
+ * -noNotification
+ * This option eliminates all change notification overhead in the generated classes. Changes to
+ * DataObjects generated using this option cannot be recorded, and consequently the classes cannot
+ * be used with an SDO ChangeSummary or DataGraph.
+ * -noContainment
+ * Turns off container management for containment properties. DataObject.getContainer() will always
+ * return null for data objects generated with this option, even if a containment reference is set.
+ * Setting a containment reference will also not automatically remove the target object from its
+ * previous container, if it had one, so it will need to be explicitly removed by the client. Use
+ * of this option is only recommended for scenarios where this kind of container movement/management
+ * is not necessary.
+ * -arrayAccessors
+ * Generates Java array getters/setters for multiplicity-many properties. With this option,
+ * the set of "standard" JavaBean array accessor methods (e.g., Foo[] getFoo(), Foo getFoo(int),
+ * int getFooLength(), setFoo(Foo[]), and void setFoo(int, Foo)) are generated. The normal
+ * List-returning accessor is renamed with the suffix "List" (e.g., List getFooList()). The array
+ * returned by the generated method is not a copy, but instead a pointer to the underlying storage
+ * array, so directly modifying it can have undesirable consequences and should be avoided.
+ * -generateLoader
+ * Generate a fast XML parser/loader for instances of the model. The details of this option are
+ * subject to change, but currently it generates two additional classes in a "util" package:
+ * <prefix>ResourceImpl and <prefix>ResourceFactoryImpl. To use the generated loader at runtime,
+ * you need to pass an option to the XMLHelper.load() method like this:
+ * Map options = new HashMap();
+ * options.put("GENERATED_LOADER", <prefix>ResourceFactoryImpl.class);
+ * XMLDocument doc = XMLHelper.INSTANCE.load(new FileInputStream("somefile.xml"), null, options);
+ * Note: this option currently only works for simple schemas without substitution groups or wildcards.
+ * -noUnsettable
+ * By default, some XML constructs result in SDO property implementations that maintain additional
+ * state information to record when the property has been set to the "default value", as opposed to
+ * being truly unset (see DataObject.isSet() and DataObject.unset()). The SDO specification allows an
+ * implementation to choose to provide this behavior or not. With this option, all generated properties
+ * will not record their unset state. The generated isSet() methods simply returns whether the current
+ * value is equal to the property's "default value".
+ *
+ */
+public abstract class JavaGenerator
+{
+ public static int OPTION_NO_INTERFACES=0x1;
+ public static int OPTION_SPARSE_PATTERN=0x2;
+ public static int OPTION_STORE_PATTERN=0x4;
+ public static int OPTION_NO_CONTAINMENT=0x8;
+ public static int OPTION_NO_NOTIFICATION=0x10;
+ public static int OPTION_ARRAY_ACCESSORS=0x20;
+ public static int OPTION_GENERATE_LOADER=0x40;
+ public static int OPTION_NO_UNSETTABLE=0x80;
+ //FIXME Temporary, I need this option for now to get Switch classes generated for the SCDL models
+ public static int OPTION_GENERATE_SWITCH=0x100;
+ public static int OPTION_NO_EMF=0x200;
+ public static int OPTION_INTERFACE_DO=0x400;
+
+ static
+ {
+ System.setProperty("EMF_NO_CONSTRAINTS", "true"); // never generate a validator class
+ }
+
+ /**
+ * @deprecated replaced by XSD2JavaGenerator
+ */
+ public static void main(String args[])
+ {
+ try
+ {
+ JavaGenerator generator = new XSD2JavaGenerator();
+ generator.processArguments(args);
+ generator.run(args);
+ }
+ catch (IllegalArgumentException e)
+ {
+ printUsage();
+ }
+ }
+
+ protected void processArguments(String args[])
+ {
+ if (args.length == 0)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ int index = 0;
+ while (args[index].startsWith("-"))
+ {
+ int newIndex = handleArgument(args, index);
+ if (newIndex == index)
+ {
+ throw new IllegalArgumentException();
+ }
+ index = newIndex;
+ if (index == args.length)
+ {
+ throw new IllegalArgumentException();
+ }
+ }
+
+ inputIndex = index;
+ }
+
+ protected String targetDirectory = null;
+ protected String javaPackage = null;
+ protected String prefix = null;
+ protected int genOptions = 0;
+ protected String xsdFileName;
+ protected int inputIndex;
+
+ protected int handleArgument(String args[], int index)
+ {
+ if (args[index].equalsIgnoreCase("-targetDirectory"))
+ {
+ targetDirectory = args[++index];
+ }
+ else if (args[index].equalsIgnoreCase("-javaPackage"))
+ {
+ javaPackage = args[++index];
+ }
+ else if (args[index].equalsIgnoreCase("-prefix"))
+ {
+ prefix = args[++index];
+ }
+ else if (args[index].equalsIgnoreCase("-noInterfaces"))
+ {
+ genOptions |= OPTION_NO_INTERFACES;
+ }
+ else if (args[index].equalsIgnoreCase("-sparsePattern"))
+ {
+ genOptions |= OPTION_SPARSE_PATTERN;
+ }
+ else if (args[index].equalsIgnoreCase("-storePattern"))
+ {
+ genOptions |= OPTION_STORE_PATTERN;
+ }
+ else if (args[index].equalsIgnoreCase("-noContainment"))
+ {
+ genOptions |= OPTION_NO_CONTAINMENT;
+ }
+ else if (args[index].equalsIgnoreCase("-noNotification"))
+ {
+ genOptions |= OPTION_NO_NOTIFICATION;
+ }
+ else if (args[index].equalsIgnoreCase("-arrayAccessors"))
+ {
+ genOptions |= OPTION_ARRAY_ACCESSORS;
+ }
+ else if (args[index].equalsIgnoreCase("-generateLoader"))
+ {
+ genOptions |= OPTION_GENERATE_LOADER;
+ }
+ else if (args[index].equalsIgnoreCase("-noUnsettable"))
+ {
+ genOptions |= OPTION_NO_UNSETTABLE;
+ }
+ else if (args[index].equalsIgnoreCase("-noEMF"))
+ {
+ genOptions |= OPTION_NO_EMF;
+ }
+ else if (args[index].equalsIgnoreCase("-interfaceDataObject"))
+ {
+ genOptions |= OPTION_INTERFACE_DO;
+ }
+ //else if (...)
+ else
+ {
+ return index;
+ }
+
+ return index + 1;
+ }
+
+ protected abstract void run(String args[]);
+
+ /**
+ * @deprecated moved to XSD2JavaGenerator
+ */
+ public static void generateFromXMLSchema(String xsdFileName, String targetDirectory, String javaPackage, String prefix, int genOptions)
+ {
+ DataObjectUtil.initRuntime();
+ EPackage.Registry packageRegistry = new EPackageRegistryImpl(EPackage.Registry.INSTANCE);
+ ExtendedMetaData extendedMetaData = new BasicExtendedMetaData(packageRegistry);
+ XSDHelper xsdHelper = new XSDHelperImpl(extendedMetaData);
+
+ try
+ {
+ File inputFile = new File(xsdFileName).getAbsoluteFile();
+ InputStream inputStream = new FileInputStream(inputFile);
+ xsdHelper.define(inputStream, inputFile.toURI().toString());
+
+ if (targetDirectory == null)
+ {
+ targetDirectory = new File(xsdFileName).getCanonicalFile().getParent();
+ }
+ else
+ {
+ targetDirectory = new File(targetDirectory).getCanonicalPath();
+ }
+
+ if (!packageRegistry.values().isEmpty())
+ {
+ String packageURI = getSchemaNamespace(xsdFileName);
+ generatePackages(packageRegistry.values(), packageURI, null, targetDirectory, javaPackage, prefix, genOptions);
+ }
+
+ /*
+ for (Iterator iter = packageRegistry.values().iterator(); iter.hasNext();)
+ {
+ EPackage ePackage = (EPackage)iter.next();
+ String basePackage = extractBasePackageName(ePackage, javaPackage);
+ if (prefix == null)
+ {
+ prefix = CodeGenUtil.capName(ePackage.getName());
+ }
+ generateFromEPackage(ePackage, targetDirectory, basePackage, prefix, genOptions);
+ }
+ */
+ }
+ catch (IOException e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ public static void generatePackages(Collection packageList, String packageURI, String shortName, String targetDirectory, String javaPackage, String prefix, int genOptions)
+ {
+ ResourceSet resourceSet = DataObjectUtil.createResourceSet();
+ List usedGenPackages = new ArrayList();
+ GenModel genModel = null;
+ for (Iterator iter = packageList.iterator(); iter.hasNext();)
+ {
+ EPackage currentEPackage = (EPackage)iter.next();
+ String currentBasePackage = extractBasePackageName(currentEPackage, javaPackage);
+ String currentPrefix = prefix == null ? CodeGenUtil.capName(shortName != null ? shortName : currentEPackage.getName()) : prefix;
+ GenPackage currentGenPackage = createGenPackage(currentEPackage, currentBasePackage, currentPrefix, genOptions, resourceSet);
+ if (currentEPackage.getNsURI().equals(packageURI))
+ {
+ genModel = currentGenPackage.getGenModel();
+ }
+ else
+ {
+ usedGenPackages.add(currentGenPackage);
+ }
+ }
+
+ if (genModel == null) return; // nothing to generate
+
+ usedGenPackages.add(createGenPackage(SDOPackageImpl.eINSTANCE, "org.apache.tuscany", "SDO", 0, resourceSet));
+ usedGenPackages.add(createGenPackage(ModelPackageImpl.eINSTANCE, "org.apache.tuscany.sdo", "Model", 0, resourceSet));
+ genModel.getUsedGenPackages().addAll(usedGenPackages);
+
+ // Invoke the SDO JavaGenerator to generate the SDO classes
+ try
+ {
+ generateFromGenModel(genModel, new File(targetDirectory).getCanonicalPath(), genOptions);
+ }
+ catch (IOException e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * @deprecated
+ */
+ public static String getSchemaNamespace(String xsdFileName)
+ {
+ ResourceSet resourceSet = DataObjectUtil.createResourceSet();
+ File inputFile = new File(xsdFileName).getAbsoluteFile();
+ Resource model = resourceSet.getResource(URI.createURI(inputFile.toURI().toString()), true);
+ XSDSchema schema = (XSDSchema)model.getContents().get(0);
+ return schema.getTargetNamespace();
+ }
+
+ public static GenPackage createGenPackage(EPackage ePackage, String basePackage, String prefix, int genOptions, ResourceSet resourceSet)
+ {
+ GenModel genModel = ecore2GenModel(ePackage, basePackage, prefix, genOptions);
+
+ URI ecoreURI = URI.createURI("file:///" + ePackage.getName() + ".ecore");
+ URI genModelURI = ecoreURI.trimFileExtension().appendFileExtension("genmodel");
+
+ Resource ecoreResource = resourceSet.createResource(ecoreURI);
+ ecoreResource.getContents().add(ePackage);
+
+ Resource genModelResource = resourceSet.createResource(genModelURI);
+ genModelResource.getContents().add(genModel);
+
+ return (GenPackage)genModel.getGenPackages().get(0);
+ }
+
+ public static void generateFromEPackage(EPackage ePackage, String targetDirectory, String basePackage, String prefix, int genOptions)
+ {
+ GenModel genModel = ecore2GenModel(ePackage, basePackage, prefix, genOptions);
+
+ ResourceSet resourceSet = DataObjectUtil.createResourceSet();
+ URI ecoreURI = URI.createURI("file:///temp.ecore");
+ URI genModelURI = ecoreURI.trimFileExtension().appendFileExtension("genmodel");
+
+ Resource ecoreResource = resourceSet.createResource(ecoreURI);
+ ecoreResource.getContents().add(ePackage);
+
+ Resource genModelResource = resourceSet.createResource(genModelURI);
+ genModelResource.getContents().add(genModel);
+
+ generateFromGenModel(genModel, targetDirectory, genOptions);
+ }
+
+ public static void generateFromGenModel(GenModel genModel, String targetDirectory, int genOptions)
+ {
+ Resource resource = genModel.eResource();
+
+ if (targetDirectory != null)
+ {
+ resource.getResourceSet().getURIConverter().getURIMap().put(
+ URI.createURI("platform:/resource/TargetProject/"),
+ URI.createFileURI(targetDirectory + "/"));
+ genModel.setModelDirectory("/TargetProject");
+ }
+
+ //genModel.gen(new BasicMonitor.Printing(System.out));
+ GeneratorAdapterFactory.Descriptor.Registry.INSTANCE.addDescriptor
+ (GenModelPackage.eNS_URI, GenModelGeneratorAdapterFactory.DESCRIPTOR);
+
+ Generator generator = new Generator();
+
+ if ((genOptions & OPTION_NO_EMF) != 0)
+ {
+ generator.getAdapterFactoryDescriptorRegistry().addDescriptor
+ (GenModelPackage.eNS_URI, SDOGenModelGeneratorAdapterFactory.DESCRIPTOR);
+ }
+
+ generator.setInput(genModel);
+ generator.generate(genModel, GenBaseGeneratorAdapter.MODEL_PROJECT_TYPE, new BasicMonitor.Printing(System.out));
+
+
+ for (Iterator j = resource.getContents().iterator(); j.hasNext();)
+ {
+ EObject eObject = (EObject)j.next();
+ Diagnostic diagnostic = Diagnostician.INSTANCE.validate(eObject);
+ if (diagnostic.getSeverity() != Diagnostic.OK)
+ {
+ printDiagnostic(diagnostic, "");
+ }
+ }
+ }
+
+ public static GenModel ecore2GenModel(EPackage ePackage, String basePackage, String prefix, int genOptions)
+ {
+ GenModel genModel = GenModelFactory.eINSTANCE.createGenModel();
+ genModel.initialize(Collections.singleton(ePackage));
+
+ genModel.setRootExtendsInterface("");
+ genModel.setRootImplementsInterface("commonj.sdo.DataObject");
+ genModel.setRootExtendsClass("org.apache.tuscany.sdo.impl.DataObjectImpl");
+ genModel.setFeatureMapWrapperInterface("commonj.sdo.Sequence");
+ genModel.setFeatureMapWrapperInternalInterface("org.apache.tuscany.sdo.util.BasicSequence");
+ genModel.setFeatureMapWrapperClass("org.apache.tuscany.sdo.util.BasicSequence");
+ genModel.setSuppressEMFTypes(true);
+ genModel.setSuppressEMFMetaData(true);
+ genModel.setSuppressEMFModelTags(true);
+ genModel.setCanGenerate(true);
+ //FIXME workaround java.lang.NoClassDefFoundError: org/eclipse/jdt/core/jdom/IDOMNode with 02162006 build
+ genModel.setFacadeHelperClass("Hack");
+ genModel.setForceOverwrite(true);
+
+ if ((genOptions & OPTION_NO_INTERFACES) != 0)
+ {
+ genModel.setSuppressInterfaces(true);
+ }
+
+ if ((genOptions & OPTION_SPARSE_PATTERN) != 0)
+ {
+ genModel.setFeatureDelegation(GenDelegationKind.VIRTUAL_LITERAL);
+ }
+ else if ((genOptions & OPTION_STORE_PATTERN) != 0)
+ {
+ genModel.setFeatureDelegation(GenDelegationKind.REFLECTIVE_LITERAL);
+ genModel.setRootExtendsClass("org.apache.tuscany.sdo.impl.StoreDataObjectImpl");
+ }
+
+ if ((genOptions & OPTION_NO_CONTAINMENT) != 0)
+ {
+ genModel.setSuppressContainment(true);
+ }
+
+ if ((genOptions & OPTION_NO_NOTIFICATION) != 0)
+ {
+ genModel.setSuppressNotification(true);
+ }
+
+ if ((genOptions & OPTION_ARRAY_ACCESSORS) != 0)
+ {
+ genModel.setArrayAccessors(true);
+ }
+
+ if ((genOptions & OPTION_NO_UNSETTABLE) != 0)
+ {
+ genModel.setSuppressUnsettable(true);
+ }
+
+ if ((genOptions & OPTION_NO_EMF) != 0)
+ {
+ genModel.setRootExtendsClass("org.apache.tuscany.sdo.impl.DataObjectBase");
+ }
+
+ if ((genOptions & OPTION_INTERFACE_DO) != 0)
+ {
+ genModel.setRootExtendsInterface("commonj.sdo.DataObject");
+ }
+ else
+ {
+ genModel.setRootExtendsInterface("java.io.Serializable");
+ }
+
+ GenPackage genPackage = (GenPackage)genModel.getGenPackages().get(0);
+
+ if (basePackage != null)
+ {
+ genPackage.setBasePackage(basePackage);
+ }
+ if (prefix != null)
+ {
+ genPackage.setPrefix(prefix);
+ }
+
+ //FIXME Temporary, I need this option for now to get Switch classes generated for the SCDL models
+ if ((genOptions & OPTION_GENERATE_SWITCH) == 0)
+ {
+ genPackage.setAdapterFactory(false);
+ }
+
+ if ((genOptions & OPTION_GENERATE_LOADER) != 0)
+ {
+ //FIXME workaround compile error with 02162006 build, generated code references non-existent EcoreResourceImpl class
+ genPackage.setResource(GenResourceKind.XML_LITERAL);
+ //genPackage.setDataTypeConverters(true);
+ }
+ else
+ {
+ genPackage.setResource(GenResourceKind.NONE_LITERAL);
+ for (Iterator iter = genPackage.getGenClasses().iterator(); iter.hasNext();)
+ {
+ GenClass genClass = (GenClass)iter.next();
+ if ("DocumentRoot".equals(genClass.getName()))
+ {
+ genClass.setDynamic(true); // Don't generate DocumentRoot class
+ break;
+ }
+ }
+ }
+
+ return genModel;
+ }
+
+ public static String extractBasePackageName(EPackage ePackage, String javaPackage)
+ {
+ String qualifiedName = javaPackage != null ? javaPackage : ePackage.getName();
+ String name = /*CodeGenUtil.*/shortName(qualifiedName);
+ String baseName = qualifiedName.substring(0, qualifiedName.length() - name.length());
+ if (javaPackage != null || !name.equals(qualifiedName))
+ {
+ ePackage.setName(name);
+ }
+ return baseName != null ? /*CodeGenUtil.*/safeQualifiedName(baseName) : null;
+ }
+
+ public static String shortName(String qualifiedName)
+ {
+ int index = qualifiedName.lastIndexOf(".");
+ return index != -1 ? qualifiedName.substring(index + 1) : qualifiedName;
+ }
+
+ public static String safeQualifiedName(String qualifiedName)
+ {
+ StringBuffer safeQualifiedName = new StringBuffer();
+ for (StringTokenizer stringTokenizer = new StringTokenizer(qualifiedName, "."); stringTokenizer.hasMoreTokens();)
+ {
+ String name = stringTokenizer.nextToken();
+ safeQualifiedName.append(CodeGenUtil.safeName(name));
+ if (stringTokenizer.hasMoreTokens())
+ {
+ safeQualifiedName.append('.');
+ }
+ }
+ return safeQualifiedName.toString();
+ }
+
+ protected static void printDiagnostic(Diagnostic diagnostic, String indent)
+ {
+ System.out.print(indent);
+ System.out.println(diagnostic.getMessage());
+ for (Iterator i = diagnostic.getChildren().iterator(); i.hasNext();)
+ {
+ printDiagnostic((Diagnostic)i.next(), indent + " ");
+ }
+ }
+
+ protected static void printUsage()
+ {
+ System.out.println("Usage arguments:");
+ System.out.println(" [ -targetDirectory <target-root-directory> ]");
+ System.out.println(" [ -javaPackage <java-package-name> ]");
+ System.out.println(" [ -prefix <prefix-string> ]");
+ System.out.println(" [ -sparsePattern | -storePattern ]");
+ System.out.println(" [ -noInterfaces ]");
+ System.out.println(" [ -noContainment ]");
+ System.out.println(" [ -noNotification ]");
+ System.out.println(" [ -arrayAccessors ]");
+ System.out.println(" [ -generateLoader ]");
+ System.out.println(" [ -noUnsettable ]");
+ System.out.println(" [ -noEMF ]");
+ System.out.println(" <xsd-file> | <wsdl-file>");
+ System.out.println("");
+ System.out.println("For example:");
+ System.out.println("");
+ System.out.println(" generate somedir/somefile.xsd");
+ }
+
+}
diff --git a/branches/sdo-java-M2/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/XSD2JavaGenerator.java b/branches/sdo-java-M2/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/XSD2JavaGenerator.java
new file mode 100644
index 0000000000..78af8efc6e
--- /dev/null
+++ b/branches/sdo-java-M2/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/XSD2JavaGenerator.java
@@ -0,0 +1,183 @@
+/**
+ *
+ * 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.generate;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.apache.tuscany.sdo.helper.XSDHelperImpl;
+import org.apache.tuscany.sdo.util.DataObjectUtil;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.impl.EPackageRegistryImpl;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.util.BasicExtendedMetaData;
+import org.eclipse.emf.ecore.util.ExtendedMetaData;
+import org.eclipse.xsd.XSDSchema;
+
+import commonj.sdo.helper.XSDHelper;
+
+public class XSD2JavaGenerator extends JavaGenerator
+{
+ /**
+ * Generate static SDOs from XML Schema
+ *
+ * Usage arguments: see JavaGenerator
+ *
+ * [ -targetDirectory <target-root-directory> ]
+ * [ -javaPackage <java-package-name> ]
+ * [ -schemaNamespace <namespace-uri> ]
+ * [ other options ... ]
+ * <xsd-file> | <wsdl-file>
+ *
+ * Options:
+ *
+ * -schemaNamespace
+ * Generate classes for XSD types in the specified targetNamespace. By default, types in the
+ * targetNamespace of the first schema in the specified xsd or wsdl file are generated.
+ *
+ * NOTE: see the base class JavaGenerator for other options.
+ *
+ * Example:
+ *
+ * generate somedir/somefile.xsd
+ *
+ * See base class JavaGenerator for details and the other options.
+ *
+ */
+ public static void main(String args[])
+ {
+ try
+ {
+ XSD2JavaGenerator generator = new XSD2JavaGenerator();
+ generator.processArguments(args);
+ generator.run(args);
+ }
+ catch (IllegalArgumentException e)
+ {
+ printUsage();
+ }
+ }
+
+ protected String schemaNamespace = null;
+
+ protected int handleArgument(String args[], int index)
+ {
+ if (args[index].equalsIgnoreCase("-schemaNamespace"))
+ {
+ schemaNamespace = args[++index];
+ }
+ else
+ {
+ return super.handleArgument(args, index);
+ }
+
+ return index + 1;
+ }
+
+ protected void run(String args[])
+ {
+ String xsdFileName = args[inputIndex];
+ generateFromXMLSchema(xsdFileName, schemaNamespace, targetDirectory, javaPackage, prefix, genOptions);
+ }
+
+ public static void generateFromXMLSchema(String xsdFileName, String namespace, String targetDirectory, String javaPackage, String prefix, int genOptions)
+ {
+ DataObjectUtil.initRuntime();
+ EPackage.Registry packageRegistry = new EPackageRegistryImpl(EPackage.Registry.INSTANCE);
+ ExtendedMetaData extendedMetaData = new BasicExtendedMetaData(packageRegistry);
+ XSDHelper xsdHelper = new XSDHelperImpl(extendedMetaData);
+
+ try
+ {
+ File inputFile = new File(xsdFileName).getAbsoluteFile();
+ InputStream inputStream = new FileInputStream(inputFile);
+ xsdHelper.define(inputStream, inputFile.toURI().toString());
+
+ if (targetDirectory == null)
+ {
+ targetDirectory = new File(xsdFileName).getCanonicalFile().getParent();
+ }
+ else
+ {
+ targetDirectory = new File(targetDirectory).getCanonicalPath();
+ }
+
+ if (!packageRegistry.values().isEmpty())
+ {
+ String packageURI = namespace != null ? namespace : getSchemaNamespace(xsdFileName);
+ generatePackages(packageRegistry.values(), packageURI, null, targetDirectory, javaPackage, prefix, genOptions);
+ }
+
+ /*
+ for (Iterator iter = packageRegistry.values().iterator(); iter.hasNext();)
+ {
+ EPackage ePackage = (EPackage)iter.next();
+ String basePackage = extractBasePackageName(ePackage, javaPackage);
+ if (prefix == null)
+ {
+ prefix = CodeGenUtil.capName(ePackage.getName());
+ }
+ generateFromEPackage(ePackage, targetDirectory, basePackage, prefix, genOptions);
+ }
+ */
+ }
+ catch (IOException e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ public static String getSchemaNamespace(String xsdFileName)
+ {
+ ResourceSet resourceSet = DataObjectUtil.createResourceSet();
+ File inputFile = new File(xsdFileName).getAbsoluteFile();
+ Resource model = resourceSet.getResource(URI.createURI(inputFile.toURI().toString()), true);
+ XSDSchema schema = (XSDSchema)model.getContents().get(0);
+ return schema.getTargetNamespace();
+ }
+
+ protected static void printUsage()
+ {
+ System.out.println("Usage arguments:");
+ System.out.println(" [ -targetDirectory <target-root-directory> ]");
+ System.out.println(" [ -javaPackage <java-package-name> ]");
+ System.out.println(" [ -schemaNamespace <namespace-uri> ]");
+ System.out.println(" [ -prefix <prefix-string> ]");
+ System.out.println(" [ -sparsePattern | -storePattern ]");
+ System.out.println(" [ -noInterfaces ]");
+ System.out.println(" [ -noContainment ]");
+ System.out.println(" [ -noNotification ]");
+ System.out.println(" [ -arrayAccessors ]");
+ System.out.println(" [ -generateLoader ]");
+ System.out.println(" [ -noUnsettable ]");
+ System.out.println(" [ -noEMF ]");
+ System.out.println(" [ -interfaceDataObject ]");
+ System.out.println(" <xsd-file> | <wsdl-file>");
+ System.out.println("");
+ System.out.println("For example:");
+ System.out.println("");
+ System.out.println(" generate somedir/somefile.xsd");
+ }
+
+}
diff --git a/branches/sdo-java-M2/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/adapter/SDOGenClassGeneratorAdapter.java b/branches/sdo-java-M2/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/adapter/SDOGenClassGeneratorAdapter.java
new file mode 100644
index 0000000000..80f8fe7755
--- /dev/null
+++ b/branches/sdo-java-M2/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/adapter/SDOGenClassGeneratorAdapter.java
@@ -0,0 +1,46 @@
+/**
+ *
+ * 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.generate.adapter;
+
+import org.eclipse.emf.codegen.ecore.generator.GeneratorAdapterFactory;
+import org.eclipse.emf.codegen.ecore.genmodel.generator.GenClassGeneratorAdapter;
+
+public class SDOGenClassGeneratorAdapter extends GenClassGeneratorAdapter {
+
+ public SDOGenClassGeneratorAdapter(GeneratorAdapterFactory generatorAdapterFactory)
+ {
+ super(generatorAdapterFactory);
+ }
+
+ private static JETEmitterDescriptor[] jetEmitterDescriptors;
+
+ protected JETEmitterDescriptor[] getJETEmitterDescriptors()
+ {
+ if (jetEmitterDescriptors == null)
+ {
+ JETEmitterDescriptor[] base = super.getJETEmitterDescriptors();
+ jetEmitterDescriptors = new JETEmitterDescriptor[base.length];
+ System.arraycopy(base, 0, jetEmitterDescriptors, 0, base.length);
+ jetEmitterDescriptors[CLASS_ID] = new JETEmitterDescriptor("model/SDOClass.javajet", "org.apache.tuscany.sdo.generate.templates.model.SDOClass");
+ }
+ return jetEmitterDescriptors;
+ }
+
+}
diff --git a/branches/sdo-java-M2/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/adapter/SDOGenModelGeneratorAdapterFactory.java b/branches/sdo-java-M2/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/adapter/SDOGenModelGeneratorAdapterFactory.java
new file mode 100644
index 0000000000..eabf90c310
--- /dev/null
+++ b/branches/sdo-java-M2/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/adapter/SDOGenModelGeneratorAdapterFactory.java
@@ -0,0 +1,54 @@
+/**
+ *
+ * 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.generate.adapter;
+
+import org.eclipse.emf.codegen.ecore.generator.GeneratorAdapterFactory;
+import org.eclipse.emf.codegen.ecore.genmodel.generator.GenModelGeneratorAdapterFactory;
+import org.eclipse.emf.common.notify.Adapter;
+
+public class SDOGenModelGeneratorAdapterFactory extends
+ GenModelGeneratorAdapterFactory {
+
+ public static final GeneratorAdapterFactory.Descriptor DESCRIPTOR = new GeneratorAdapterFactory.Descriptor()
+ {
+ public GeneratorAdapterFactory createAdapterFactory()
+ {
+ return new SDOGenModelGeneratorAdapterFactory();
+ }
+ };
+
+ public Adapter createGenClassAdapter()
+ {
+ if (genClassGeneratorAdapter == null)
+ {
+ genClassGeneratorAdapter = new SDOGenClassGeneratorAdapter(this);
+ }
+ return genClassGeneratorAdapter;
+ }
+
+ public Adapter createGenPackageAdapter()
+ {
+ if (genPackageGeneratorAdapter == null)
+ {
+ genPackageGeneratorAdapter = new SDOGenPackageGeneratorAdapter(this);
+ }
+ return genPackageGeneratorAdapter;
+ }
+}
diff --git a/branches/sdo-java-M2/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/adapter/SDOGenPackageGeneratorAdapter.java b/branches/sdo-java-M2/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/adapter/SDOGenPackageGeneratorAdapter.java
new file mode 100644
index 0000000000..4a187674ce
--- /dev/null
+++ b/branches/sdo-java-M2/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/adapter/SDOGenPackageGeneratorAdapter.java
@@ -0,0 +1,52 @@
+/**
+ *
+ * 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.generate.adapter;
+
+import org.eclipse.emf.codegen.ecore.generator.GeneratorAdapterFactory;
+import org.eclipse.emf.codegen.ecore.genmodel.GenPackage;
+import org.eclipse.emf.codegen.ecore.genmodel.generator.GenPackageGeneratorAdapter;
+import org.eclipse.emf.common.util.Monitor;
+
+public class SDOGenPackageGeneratorAdapter extends GenPackageGeneratorAdapter
+{
+ public SDOGenPackageGeneratorAdapter(GeneratorAdapterFactory generatorAdapterFactory)
+ {
+ super(generatorAdapterFactory);
+ }
+
+ private static JETEmitterDescriptor[] jetEmitterDescriptors;
+
+ protected JETEmitterDescriptor[] getJETEmitterDescriptors()
+ {
+ if (jetEmitterDescriptors == null)
+ {
+ JETEmitterDescriptor[] base = super.getJETEmitterDescriptors();
+ jetEmitterDescriptors = new JETEmitterDescriptor[base.length];
+ System.arraycopy(base, 0, jetEmitterDescriptors, 0, base.length);
+ jetEmitterDescriptors[FACTORY_CLASS_ID] = new JETEmitterDescriptor("model/SDOFactoryClass.javajet", "org.apache.tuscany.sdo.generate.templates.model.SDOFactoryClass");
+ }
+ return jetEmitterDescriptors;
+ }
+
+ protected void generatePackageClass(GenPackage genPackage, Monitor monitor)
+ {
+ // do nothing
+ }
+}
diff --git a/branches/sdo-java-M2/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/templates/model/SDOClass.java b/branches/sdo-java-M2/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/templates/model/SDOClass.java
new file mode 100644
index 0000000000..956157a3a8
--- /dev/null
+++ b/branches/sdo-java-M2/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/templates/model/SDOClass.java
@@ -0,0 +1,4142 @@
+/**
+ *
+ * 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.generate.templates.model;
+
+import org.eclipse.emf.codegen.util.*;
+import java.util.*;
+import org.eclipse.emf.codegen.ecore.genmodel.*;
+
+public class SDOClass
+{
+ protected static String nl;
+ public static synchronized SDOClass create(String lineSeparator)
+ {
+ nl = lineSeparator;
+ SDOClass result = new SDOClass();
+ nl = null;
+ return result;
+ }
+
+ protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
+ protected final String TEXT_1 = "";
+ protected final String TEXT_2 = "/**" + NL + " * <copyright>" + NL + " * </copyright>" + NL + " *" + NL + " * ";
+ protected final String TEXT_3 = "Id";
+ protected final String TEXT_4 = NL + " */";
+ protected final String TEXT_5 = NL + "package ";
+ protected final String TEXT_6 = ";";
+ protected final String TEXT_7 = NL + "package ";
+ protected final String TEXT_8 = ";";
+ protected final String TEXT_9 = NL;
+ protected final String TEXT_10 = NL;
+ protected final String TEXT_11 = NL + "/**" + NL + " * <!-- begin-user-doc -->" + NL + " * A representation of the model object '<em><b>";
+ protected final String TEXT_12 = "</b></em>'." + NL + " * <!-- end-user-doc -->";
+ protected final String TEXT_13 = NL + " *" + NL + " * <!-- begin-model-doc -->" + NL + " * ";
+ protected final String TEXT_14 = NL + " * <!-- end-model-doc -->";
+ protected final String TEXT_15 = NL + " *";
+ protected final String TEXT_16 = NL + " * <p>" + NL + " * The following features are supported:" + NL + " * <ul>";
+ protected final String TEXT_17 = NL + " * <li>{@link ";
+ protected final String TEXT_18 = "#";
+ protected final String TEXT_19 = " <em>";
+ protected final String TEXT_20 = "</em>}</li>";
+ protected final String TEXT_21 = NL + " * </ul>" + NL + " * </p>";
+ protected final String TEXT_22 = NL + " *";
+ protected final String TEXT_23 = NL + " * @see ";
+ protected final String TEXT_24 = "#get";
+ protected final String TEXT_25 = "()";
+ protected final String TEXT_26 = NL + " * @model ";
+ protected final String TEXT_27 = NL + " * ";
+ protected final String TEXT_28 = NL + " * @model";
+ protected final String TEXT_29 = NL + " * @extends ";
+ protected final String TEXT_30 = NL + " * @generated" + NL + " */";
+ protected final String TEXT_31 = NL + "/**" + NL + " * <!-- begin-user-doc -->" + NL + " * An implementation of the model object '<em><b>";
+ protected final String TEXT_32 = "</b></em>'." + NL + " * <!-- end-user-doc -->" + NL + " * <p>";
+ protected final String TEXT_33 = NL + " * The following features are implemented:" + NL + " * <ul>";
+ protected final String TEXT_34 = NL + " * <li>{@link ";
+ protected final String TEXT_35 = "#";
+ protected final String TEXT_36 = " <em>";
+ protected final String TEXT_37 = "</em>}</li>";
+ protected final String TEXT_38 = NL + " * </ul>";
+ protected final String TEXT_39 = NL + " * </p>" + NL + " *" + NL + " * @generated" + NL + " */";
+ protected final String TEXT_40 = NL + "public";
+ protected final String TEXT_41 = " abstract";
+ protected final String TEXT_42 = " class ";
+ protected final String TEXT_43 = NL + "public interface ";
+ protected final String TEXT_44 = NL + "{";
+ protected final String TEXT_45 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\t";
+ protected final String TEXT_46 = " copyright = \"";
+ protected final String TEXT_47 = "\";";
+ protected final String TEXT_48 = NL;
+ protected final String TEXT_49 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static final ";
+ protected final String TEXT_50 = " mofDriverNumber = \"";
+ protected final String TEXT_51 = "\";";
+ protected final String TEXT_52 = NL;
+ protected final String TEXT_53 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final long serialVersionUID = 1L;" + NL;
+ protected final String TEXT_54 = NL + "\t/**" + NL + "\t * An array of objects representing the values of non-primitive features." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected Object[] ";
+ protected final String TEXT_55 = " = null;" + NL;
+ protected final String TEXT_56 = NL + "\t/**" + NL + "\t * A bit field representing the indices of non-primitive feature values." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected int ";
+ protected final String TEXT_57 = " = 0;" + NL;
+ protected final String TEXT_58 = NL + "\t/**" + NL + "\t * A set of bit flags representing the values of boolean attributes and whether unsettable features have been set." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t * @ordered" + NL + "\t */" + NL + "\tprotected int ";
+ protected final String TEXT_59 = " = 0;" + NL;
+ protected final String TEXT_60 = NL + "\t/**" + NL + "\t * The feature id for the '<em><b>";
+ protected final String TEXT_61 = "</b></em>' ";
+ protected final String TEXT_62 = "." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t * @ordered" + NL + "\t */";
+ protected final String TEXT_63 = "\t " + NL + "\tpublic final static int ";
+ protected final String TEXT_64 = " = ";
+ protected final String TEXT_65 = ";" + NL;
+ protected final String TEXT_66 = NL + "\t/**" + NL + "\t * This represents the number of properties for this type." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t * @ordered" + NL + "\t */" + NL + "\t";
+ protected final String TEXT_67 = NL + "\tpublic final static int SDO_PROPERTY_COUNT = ";
+ protected final String TEXT_68 = ";" + NL;
+ protected final String TEXT_69 = NL + "\t/**" + NL + "\t * The cached value of the '{@link #";
+ protected final String TEXT_70 = "() <em>";
+ protected final String TEXT_71 = "</em>}' ";
+ protected final String TEXT_72 = "." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @see #";
+ protected final String TEXT_73 = "()" + NL + "\t * @generated" + NL + "\t * @ordered" + NL + "\t */" + NL + "\t" + NL + "\tprotected ";
+ protected final String TEXT_74 = " ";
+ protected final String TEXT_75 = " = null;" + NL + "\t";
+ protected final String TEXT_76 = NL + "\t/**" + NL + "\t * The empty value for the '{@link #";
+ protected final String TEXT_77 = "() <em>";
+ protected final String TEXT_78 = "</em>}' array accessor." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @see #";
+ protected final String TEXT_79 = "()" + NL + "\t * @generated" + NL + "\t * @ordered" + NL + "\t */" + NL + "\tprotected static final ";
+ protected final String TEXT_80 = "[] ";
+ protected final String TEXT_81 = "_EEMPTY_ARRAY = new ";
+ protected final String TEXT_82 = " [0];" + NL;
+ protected final String TEXT_83 = NL + "\t/**" + NL + "\t * The default value of the '{@link #";
+ protected final String TEXT_84 = "() <em>";
+ protected final String TEXT_85 = "</em>}' ";
+ protected final String TEXT_86 = "." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @see #";
+ protected final String TEXT_87 = "()" + NL + "\t * @generated" + NL + "\t * @ordered" + NL + "\t */" + NL + "\tprotected static final ";
+ protected final String TEXT_88 = " ";
+ protected final String TEXT_89 = "_DEFAULT_ = ";
+ protected final String TEXT_90 = ";";
+ protected final String TEXT_91 = NL;
+ protected final String TEXT_92 = NL + "\t/**" + NL + "\t * An additional set of bit flags representing the values of boolean attributes and whether unsettable features have been set." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t * @ordered" + NL + "\t */" + NL + "\tprotected int ";
+ protected final String TEXT_93 = " = 0;" + NL;
+ protected final String TEXT_94 = NL + "\t/**" + NL + "\t * The flag representing the value of the '{@link #";
+ protected final String TEXT_95 = "() <em>";
+ protected final String TEXT_96 = "</em>}' ";
+ protected final String TEXT_97 = "." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @see #";
+ protected final String TEXT_98 = "()" + NL + "\t * @generated" + NL + "\t * @ordered" + NL + "\t */" + NL + "\tprotected static final int ";
+ protected final String TEXT_99 = "_EFLAG = 1 ";
+ protected final String TEXT_100 = ";" + NL;
+ protected final String TEXT_101 = NL + "\t/**" + NL + "\t * The cached value of the '{@link #";
+ protected final String TEXT_102 = "() <em>";
+ protected final String TEXT_103 = "</em>}' ";
+ protected final String TEXT_104 = "." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @see #";
+ protected final String TEXT_105 = "()" + NL + "\t * @generated" + NL + "\t * @ordered" + NL + "\t */" + NL + "\tprotected ";
+ protected final String TEXT_106 = " ";
+ protected final String TEXT_107 = " = ";
+ protected final String TEXT_108 = "_DEFAULT_;" + NL;
+ protected final String TEXT_109 = NL + "\t/**" + NL + "\t * An additional set of bit flags representing the values of boolean attributes and whether unsettable features have been set." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t * @ordered" + NL + "\t */" + NL + "\tprotected int ";
+ protected final String TEXT_110 = " = 0;" + NL;
+ protected final String TEXT_111 = NL + "\t/**" + NL + "\t * The flag representing whether the ";
+ protected final String TEXT_112 = " ";
+ protected final String TEXT_113 = " has been set." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t * @ordered" + NL + "\t */" + NL + "\tprotected static final int ";
+ protected final String TEXT_114 = "_ESETFLAG = 1 ";
+ protected final String TEXT_115 = ";" + NL;
+ protected final String TEXT_116 = NL + "\t/**" + NL + "\t * This is true if the ";
+ protected final String TEXT_117 = " ";
+ protected final String TEXT_118 = " has been set." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t * @ordered" + NL + "\t */" + NL + "\tprotected boolean ";
+ protected final String TEXT_119 = "_set_ = false;" + NL;
+ protected final String TEXT_120 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
+ protected final String TEXT_121 = "()" + NL + "\t{" + NL + "\t\tsuper();";
+ protected final String TEXT_122 = NL + "\t\t";
+ protected final String TEXT_123 = " |= ";
+ protected final String TEXT_124 = "_EFLAG;";
+ protected final String TEXT_125 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
+ protected final String TEXT_126 = " getType()" + NL + "\t{" + NL + "\t\treturn ((";
+ protected final String TEXT_127 = ")";
+ protected final String TEXT_128 = ".INSTANCE).get";
+ protected final String TEXT_129 = "();" + NL + "\t}" + NL;
+ protected final String TEXT_130 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */";
+ protected final String TEXT_131 = NL + "\t";
+ protected final String TEXT_132 = "[] ";
+ protected final String TEXT_133 = "();" + NL;
+ protected final String TEXT_134 = NL + "\tpublic ";
+ protected final String TEXT_135 = "[] ";
+ protected final String TEXT_136 = "()" + NL + "\t{";
+ protected final String TEXT_137 = NL + "\t\t";
+ protected final String TEXT_138 = " list = (";
+ protected final String TEXT_139 = ")";
+ protected final String TEXT_140 = "();" + NL + "\t\tif (list.isEmpty()) return ";
+ protected final String TEXT_141 = "_EEMPTY_ARRAY;";
+ protected final String TEXT_142 = NL + "\t\tif (";
+ protected final String TEXT_143 = " == null || ";
+ protected final String TEXT_144 = ".isEmpty()) return ";
+ protected final String TEXT_145 = "_EEMPTY_ARRAY;" + NL + "\t\t";
+ protected final String TEXT_146 = " list = (";
+ protected final String TEXT_147 = ")";
+ protected final String TEXT_148 = ";";
+ protected final String TEXT_149 = NL + "\t\tlist.shrink();" + NL + "\t\treturn (";
+ protected final String TEXT_150 = "[])list.data();" + NL + "\t}" + NL;
+ protected final String TEXT_151 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */";
+ protected final String TEXT_152 = NL + "\t";
+ protected final String TEXT_153 = " get";
+ protected final String TEXT_154 = "(int index);";
+ protected final String TEXT_155 = NL + "\tpublic ";
+ protected final String TEXT_156 = " get";
+ protected final String TEXT_157 = "(int index)" + NL + "\t{" + NL + "\t\treturn (";
+ protected final String TEXT_158 = ")";
+ protected final String TEXT_159 = "().get(index);" + NL + "\t}";
+ protected final String TEXT_160 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */";
+ protected final String TEXT_161 = NL + "\tint get";
+ protected final String TEXT_162 = "Length();" + NL;
+ protected final String TEXT_163 = NL + "\tpublic int get";
+ protected final String TEXT_164 = "Length()" + NL + "\t{";
+ protected final String TEXT_165 = NL + "\t\treturn ";
+ protected final String TEXT_166 = "().size();";
+ protected final String TEXT_167 = NL + "\t\treturn ";
+ protected final String TEXT_168 = " == null ? 0 : ";
+ protected final String TEXT_169 = ".size();";
+ protected final String TEXT_170 = NL + "\t}" + NL;
+ protected final String TEXT_171 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */";
+ protected final String TEXT_172 = NL + "\tvoid set";
+ protected final String TEXT_173 = "(";
+ protected final String TEXT_174 = "[] new";
+ protected final String TEXT_175 = ");" + NL;
+ protected final String TEXT_176 = NL + "\tpublic void set";
+ protected final String TEXT_177 = "(";
+ protected final String TEXT_178 = "[] new";
+ protected final String TEXT_179 = ")" + NL + "\t{" + NL + "\t\t((";
+ protected final String TEXT_180 = ")";
+ protected final String TEXT_181 = "()).setData(new";
+ protected final String TEXT_182 = ".length, new";
+ protected final String TEXT_183 = ");" + NL + "\t}" + NL;
+ protected final String TEXT_184 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */";
+ protected final String TEXT_185 = NL + "\tvoid set";
+ protected final String TEXT_186 = "(int index, ";
+ protected final String TEXT_187 = " element);" + NL;
+ protected final String TEXT_188 = NL + "\tpublic void set";
+ protected final String TEXT_189 = "(int index, ";
+ protected final String TEXT_190 = " element)" + NL + "\t{" + NL + "\t\t";
+ protected final String TEXT_191 = "().set(index, element);" + NL + "\t}" + NL;
+ protected final String TEXT_192 = NL + "\t/**" + NL + "\t * Returns the value of the '<em><b>";
+ protected final String TEXT_193 = "</b></em>' ";
+ protected final String TEXT_194 = ".";
+ protected final String TEXT_195 = NL + "\t * The key is of type ";
+ protected final String TEXT_196 = "list of {@link ";
+ protected final String TEXT_197 = "}";
+ protected final String TEXT_198 = "{@link ";
+ protected final String TEXT_199 = "}";
+ protected final String TEXT_200 = "," + NL + "\t * and the value is of type ";
+ protected final String TEXT_201 = "list of {@link ";
+ protected final String TEXT_202 = "}";
+ protected final String TEXT_203 = "{@link ";
+ protected final String TEXT_204 = "}";
+ protected final String TEXT_205 = ",";
+ protected final String TEXT_206 = NL + "\t * The list contents are of type {@link ";
+ protected final String TEXT_207 = "}.";
+ protected final String TEXT_208 = NL + "\t * The default value is <code>";
+ protected final String TEXT_209 = "</code>.";
+ protected final String TEXT_210 = NL + "\t * The literals are from the enumeration {@link ";
+ protected final String TEXT_211 = "}.";
+ protected final String TEXT_212 = NL + "\t * It is bidirectional and its opposite is '{@link ";
+ protected final String TEXT_213 = "#";
+ protected final String TEXT_214 = " <em>";
+ protected final String TEXT_215 = "</em>}'.";
+ protected final String TEXT_216 = NL + "\t * <!-- begin-user-doc -->";
+ protected final String TEXT_217 = NL + "\t * <p>" + NL + "\t * If the meaning of the '<em>";
+ protected final String TEXT_218 = "</em>' ";
+ protected final String TEXT_219 = " isn't clear," + NL + "\t * there really should be more of a description here..." + NL + "\t * </p>";
+ protected final String TEXT_220 = NL + "\t * <!-- end-user-doc -->";
+ protected final String TEXT_221 = NL + "\t * <!-- begin-model-doc -->" + NL + "\t * ";
+ protected final String TEXT_222 = NL + "\t * <!-- end-model-doc -->";
+ protected final String TEXT_223 = NL + "\t * @return the value of the '<em>";
+ protected final String TEXT_224 = "</em>' ";
+ protected final String TEXT_225 = ".";
+ protected final String TEXT_226 = NL + "\t * @see ";
+ protected final String TEXT_227 = NL + "\t * @see #isSet";
+ protected final String TEXT_228 = "()";
+ protected final String TEXT_229 = NL + "\t * @see #unset";
+ protected final String TEXT_230 = "()";
+ protected final String TEXT_231 = NL + "\t * @see #set";
+ protected final String TEXT_232 = "(";
+ protected final String TEXT_233 = ")";
+ protected final String TEXT_234 = NL + "\t * @see ";
+ protected final String TEXT_235 = "#get";
+ protected final String TEXT_236 = "()";
+ protected final String TEXT_237 = NL + "\t * @see ";
+ protected final String TEXT_238 = "#";
+ protected final String TEXT_239 = NL + "\t * @model ";
+ protected final String TEXT_240 = NL + "\t * ";
+ protected final String TEXT_241 = NL + "\t * @model";
+ protected final String TEXT_242 = NL + "\t * @generated" + NL + "\t */";
+ protected final String TEXT_243 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */";
+ protected final String TEXT_244 = NL + "\t";
+ protected final String TEXT_245 = " ";
+ protected final String TEXT_246 = "();" + NL;
+ protected final String TEXT_247 = NL + "\tpublic ";
+ protected final String TEXT_248 = " ";
+ protected final String TEXT_249 = "()" + NL + "\t{";
+ protected final String TEXT_250 = NL + "\t\treturn ";
+ protected final String TEXT_251 = "(";
+ protected final String TEXT_252 = "(";
+ protected final String TEXT_253 = ")get(";
+ protected final String TEXT_254 = ", true)";
+ protected final String TEXT_255 = ").";
+ protected final String TEXT_256 = "()";
+ protected final String TEXT_257 = ";";
+ protected final String TEXT_258 = NL + "\t\t";
+ protected final String TEXT_259 = " ";
+ protected final String TEXT_260 = " = (";
+ protected final String TEXT_261 = ")eVirtualGet(";
+ protected final String TEXT_262 = ");";
+ protected final String TEXT_263 = NL + "\t\tif (";
+ protected final String TEXT_264 = " == null)" + NL + "\t\t{";
+ protected final String TEXT_265 = NL + "\t\t\teVirtualSet(";
+ protected final String TEXT_266 = ", ";
+ protected final String TEXT_267 = " = new ";
+ protected final String TEXT_268 = ");";
+ protected final String TEXT_269 = NL + "\t\t ";
+ protected final String TEXT_270 = " = createSequence(";
+ protected final String TEXT_271 = ");";
+ protected final String TEXT_272 = NL + "\t\t ";
+ protected final String TEXT_273 = " = createPropertyList(ListKind.CONTAINMENT, ";
+ protected final String TEXT_274 = ".class, ";
+ protected final String TEXT_275 = ");";
+ protected final String TEXT_276 = NL + "\t\t}" + NL + "\t\treturn ";
+ protected final String TEXT_277 = ";";
+ protected final String TEXT_278 = NL + "\t\tif (eContainerFeatureID != ";
+ protected final String TEXT_279 = ") return null;" + NL + "\t\treturn (";
+ protected final String TEXT_280 = ")eContainer();";
+ protected final String TEXT_281 = NL + "\t\t";
+ protected final String TEXT_282 = " ";
+ protected final String TEXT_283 = " = (";
+ protected final String TEXT_284 = ")eVirtualGet(";
+ protected final String TEXT_285 = ", ";
+ protected final String TEXT_286 = "_DEFAULT_";
+ protected final String TEXT_287 = ");";
+ protected final String TEXT_288 = NL + "\t\tif (";
+ protected final String TEXT_289 = " != null && ";
+ protected final String TEXT_290 = ".isProxy())" + NL + "\t\t{" + NL + "\t\t\t";
+ protected final String TEXT_291 = " old";
+ protected final String TEXT_292 = " = (";
+ protected final String TEXT_293 = ")";
+ protected final String TEXT_294 = ";" + NL + "\t\t\t";
+ protected final String TEXT_295 = " = ";
+ protected final String TEXT_296 = "eResolveProxy(old";
+ protected final String TEXT_297 = ");" + NL + "\t\t\tif (";
+ protected final String TEXT_298 = " != old";
+ protected final String TEXT_299 = ")" + NL + "\t\t\t{";
+ protected final String TEXT_300 = NL + "\t\t\t\t";
+ protected final String TEXT_301 = " new";
+ protected final String TEXT_302 = " = (";
+ protected final String TEXT_303 = ")";
+ protected final String TEXT_304 = ";";
+ protected final String TEXT_305 = NL + "\t\t\t\tChangeContext changeContext = old";
+ protected final String TEXT_306 = ".inverseRemove(this, EOPPOSITE_FEATURE_BASE - ";
+ protected final String TEXT_307 = ", null, null);";
+ protected final String TEXT_308 = NL + "\t\t\t\t";
+ protected final String TEXT_309 = " changeContext = old";
+ protected final String TEXT_310 = ".inverseRemove(this, ";
+ protected final String TEXT_311 = ", ";
+ protected final String TEXT_312 = ".class, null);";
+ protected final String TEXT_313 = NL + "\t\t\t\tif (new";
+ protected final String TEXT_314 = ".eInternalContainer() == null)" + NL + "\t\t\t\t{";
+ protected final String TEXT_315 = NL + "\t\t\t\t\tchangeContext = new";
+ protected final String TEXT_316 = ".eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ";
+ protected final String TEXT_317 = ", null, changeContext);";
+ protected final String TEXT_318 = NL + "\t\t\t\t\tchangeContext = new";
+ protected final String TEXT_319 = ".eInverseAdd(this, ";
+ protected final String TEXT_320 = ", ";
+ protected final String TEXT_321 = ".class, changeContext);";
+ protected final String TEXT_322 = NL + "\t\t\t\t}" + NL + "\t\t\t\tif (changeContext != null) dispatch(changeContext);";
+ protected final String TEXT_323 = NL + "\t\t\t\teVirtualSet(";
+ protected final String TEXT_324 = ", ";
+ protected final String TEXT_325 = ");";
+ protected final String TEXT_326 = NL + "\t\t\t\tif (isNotifying())" + NL + "\t\t\t\t\tnotify(ChangeKind.RESOLVE, ";
+ protected final String TEXT_327 = ", old";
+ protected final String TEXT_328 = ", ";
+ protected final String TEXT_329 = ");";
+ protected final String TEXT_330 = NL + "\t\t\t}" + NL + "\t\t}";
+ protected final String TEXT_331 = NL + "\t\treturn (";
+ protected final String TEXT_332 = ")eVirtualGet(";
+ protected final String TEXT_333 = ", ";
+ protected final String TEXT_334 = "_DEFAULT_";
+ protected final String TEXT_335 = ");";
+ protected final String TEXT_336 = NL + "\t\treturn (";
+ protected final String TEXT_337 = " & ";
+ protected final String TEXT_338 = "_EFLAG) != 0;";
+ protected final String TEXT_339 = NL + "\t\treturn ";
+ protected final String TEXT_340 = ";";
+ protected final String TEXT_341 = NL + "\t\t";
+ protected final String TEXT_342 = " ";
+ protected final String TEXT_343 = " = basicGet";
+ protected final String TEXT_344 = "();" + NL + "\t\treturn ";
+ protected final String TEXT_345 = " != null && ";
+ protected final String TEXT_346 = ".isProxy() ? ";
+ protected final String TEXT_347 = "eResolveProxy((";
+ protected final String TEXT_348 = ")";
+ protected final String TEXT_349 = ") : ";
+ protected final String TEXT_350 = ";";
+ protected final String TEXT_351 = NL + "\t\treturn create";
+ protected final String TEXT_352 = "(get";
+ protected final String TEXT_353 = "(), getType(), ";
+ protected final String TEXT_354 = ");";
+ protected final String TEXT_355 = NL + "\t\treturn (";
+ protected final String TEXT_356 = ")((";
+ protected final String TEXT_357 = ")get";
+ protected final String TEXT_358 = "()).list(";
+ protected final String TEXT_359 = ");";
+ protected final String TEXT_360 = NL + " return get";
+ protected final String TEXT_361 = "(get";
+ protected final String TEXT_362 = "(), getType(), ";
+ protected final String TEXT_363 = ");" + NL;
+ protected final String TEXT_364 = NL + "\t\treturn ((";
+ protected final String TEXT_365 = ")get";
+ protected final String TEXT_366 = "()).list(";
+ protected final String TEXT_367 = ");";
+ protected final String TEXT_368 = NL + "\t\treturn ";
+ protected final String TEXT_369 = "(";
+ protected final String TEXT_370 = "(";
+ protected final String TEXT_371 = ")get(get";
+ protected final String TEXT_372 = "(), getType(), ";
+ protected final String TEXT_373 = ")";
+ protected final String TEXT_374 = ").";
+ protected final String TEXT_375 = "()";
+ protected final String TEXT_376 = ";";
+ protected final String TEXT_377 = NL + "\t\treturn ";
+ protected final String TEXT_378 = "(";
+ protected final String TEXT_379 = "(";
+ protected final String TEXT_380 = ")get(get";
+ protected final String TEXT_381 = "(), getType(), ";
+ protected final String TEXT_382 = ");";
+ protected final String TEXT_383 = ").";
+ protected final String TEXT_384 = "()";
+ protected final String TEXT_385 = ";";
+ protected final String TEXT_386 = NL + "\t\t// TODO: implement this method to return the '";
+ protected final String TEXT_387 = "' ";
+ protected final String TEXT_388 = NL + "\t\t// Ensure that you remove @generated or mark it @generated NOT" + NL + "\t\tthrow new UnsupportedOperationException();";
+ protected final String TEXT_389 = NL + "\t}";
+ protected final String TEXT_390 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
+ protected final String TEXT_391 = " basicGet";
+ protected final String TEXT_392 = "()" + NL + "\t{";
+ protected final String TEXT_393 = NL + "\t\tif (eContainerFeatureID != ";
+ protected final String TEXT_394 = ") return null;" + NL + "\t\treturn (";
+ protected final String TEXT_395 = ")eInternalContainer();";
+ protected final String TEXT_396 = NL + "\t\treturn (";
+ protected final String TEXT_397 = ")eVirtualGet(";
+ protected final String TEXT_398 = ");";
+ protected final String TEXT_399 = NL + "\t\treturn ";
+ protected final String TEXT_400 = ";";
+ protected final String TEXT_401 = NL + "\t\treturn (";
+ protected final String TEXT_402 = ")get(get";
+ protected final String TEXT_403 = "(), getType(), ";
+ protected final String TEXT_404 = ");";
+ protected final String TEXT_405 = NL + "\t\treturn (";
+ protected final String TEXT_406 = ")get";
+ protected final String TEXT_407 = "().get(";
+ protected final String TEXT_408 = ", false);";
+ protected final String TEXT_409 = NL + "\t\t// TODO: implement this method to return the '";
+ protected final String TEXT_410 = "' ";
+ protected final String TEXT_411 = NL + "\t\t// -> do not perform proxy resolution" + NL + "\t\t// Ensure that you remove @generated or mark it @generated NOT" + NL + "\t\tthrow new UnsupportedOperationException();";
+ protected final String TEXT_412 = NL + "\t}" + NL;
+ protected final String TEXT_413 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ChangeContext basicSet";
+ protected final String TEXT_414 = "(";
+ protected final String TEXT_415 = " new";
+ protected final String TEXT_416 = ", ChangeContext changeContext)" + NL + "\t{";
+ protected final String TEXT_417 = NL + "\t\tObject old";
+ protected final String TEXT_418 = " = eVirtualSet(";
+ protected final String TEXT_419 = ", new";
+ protected final String TEXT_420 = ");";
+ protected final String TEXT_421 = NL + "\t\t";
+ protected final String TEXT_422 = " old";
+ protected final String TEXT_423 = " = ";
+ protected final String TEXT_424 = ";" + NL + "\t\t";
+ protected final String TEXT_425 = " = new";
+ protected final String TEXT_426 = ";";
+ protected final String TEXT_427 = NL + "\t\tboolean isSetChange = old";
+ protected final String TEXT_428 = " == EVIRTUAL_NO_VALUE;";
+ protected final String TEXT_429 = NL + "\t\tboolean old";
+ protected final String TEXT_430 = "_set_ = (";
+ protected final String TEXT_431 = " & ";
+ protected final String TEXT_432 = "_ESETFLAG) != 0;" + NL + "\t\t";
+ protected final String TEXT_433 = " |= ";
+ protected final String TEXT_434 = "_ESETFLAG;";
+ protected final String TEXT_435 = NL + "\t\tboolean old";
+ protected final String TEXT_436 = "_set_ = ";
+ protected final String TEXT_437 = "_set_;" + NL + "\t\t";
+ protected final String TEXT_438 = "_set_ = true;";
+ protected final String TEXT_439 = NL + "\t\tif (isNotifying())" + NL + "\t\t{";
+ protected final String TEXT_440 = NL + "\t\t\taddNotification(this, ChangeKind.SET, ";
+ protected final String TEXT_441 = ", ";
+ protected final String TEXT_442 = "isSetChange ? null : old";
+ protected final String TEXT_443 = "old";
+ protected final String TEXT_444 = ", new";
+ protected final String TEXT_445 = ", ";
+ protected final String TEXT_446 = "isSetChange";
+ protected final String TEXT_447 = "!old";
+ protected final String TEXT_448 = "_set_";
+ protected final String TEXT_449 = ", changeContext);";
+ protected final String TEXT_450 = NL + "\t\t\taddNotification(this, ChangeKind.SET, ";
+ protected final String TEXT_451 = ", ";
+ protected final String TEXT_452 = "old";
+ protected final String TEXT_453 = " == EVIRTUAL_NO_VALUE ? null : old";
+ protected final String TEXT_454 = "old";
+ protected final String TEXT_455 = ", new";
+ protected final String TEXT_456 = ", changeContext);";
+ protected final String TEXT_457 = NL + "\t\t}";
+ protected final String TEXT_458 = NL + "\t\treturn changeContext;";
+ protected final String TEXT_459 = NL + "\t\treturn basicAdd(get";
+ protected final String TEXT_460 = "(), getType(), ";
+ protected final String TEXT_461 = ", new";
+ protected final String TEXT_462 = ", changeContext);";
+ protected final String TEXT_463 = NL + "\t\treturn basicAdd(get";
+ protected final String TEXT_464 = "(), getType(), ";
+ protected final String TEXT_465 = ", new";
+ protected final String TEXT_466 = ", changeContext);";
+ protected final String TEXT_467 = NL + "\t\t// TODO: implement this method to set the contained '";
+ protected final String TEXT_468 = "' ";
+ protected final String TEXT_469 = NL + "\t\t// -> this method is automatically invoked to keep the containment relationship in synch" + NL + "\t\t// -> do not modify other features" + NL + "\t\t// -> return changeContext, after adding any generated Notification to it (if it is null, a NotificationChain object must be created first)" + NL + "\t\t// Ensure that you remove @generated or mark it @generated NOT" + NL + "\t\tthrow new UnsupportedOperationException();";
+ protected final String TEXT_470 = NL + "\t}" + NL;
+ protected final String TEXT_471 = NL + "\t/**" + NL + "\t * Sets the value of the '{@link ";
+ protected final String TEXT_472 = "#";
+ protected final String TEXT_473 = " <em>";
+ protected final String TEXT_474 = "</em>}' ";
+ protected final String TEXT_475 = "." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @param value the new value of the '<em>";
+ protected final String TEXT_476 = "</em>' ";
+ protected final String TEXT_477 = ".";
+ protected final String TEXT_478 = NL + "\t * @see ";
+ protected final String TEXT_479 = NL + "\t * @see #isSet";
+ protected final String TEXT_480 = "()";
+ protected final String TEXT_481 = NL + "\t * @see #unset";
+ protected final String TEXT_482 = "()";
+ protected final String TEXT_483 = NL + "\t * @see #";
+ protected final String TEXT_484 = "()" + NL + "\t * @generated" + NL + "\t */";
+ protected final String TEXT_485 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */";
+ protected final String TEXT_486 = NL + "\tvoid set";
+ protected final String TEXT_487 = "(";
+ protected final String TEXT_488 = " value);" + NL;
+ protected final String TEXT_489 = NL + "\tpublic void set";
+ protected final String TEXT_490 = "(";
+ protected final String TEXT_491 = " new";
+ protected final String TEXT_492 = ")" + NL + "\t{";
+ protected final String TEXT_493 = NL + "\t\t_set_(";
+ protected final String TEXT_494 = ", ";
+ protected final String TEXT_495 = "new ";
+ protected final String TEXT_496 = "(";
+ protected final String TEXT_497 = "new";
+ protected final String TEXT_498 = ")";
+ protected final String TEXT_499 = ");";
+ protected final String TEXT_500 = NL + "\t\tif (new";
+ protected final String TEXT_501 = " != eInternalContainer() || (eContainerFeatureID != ";
+ protected final String TEXT_502 = " && new";
+ protected final String TEXT_503 = " != null))" + NL + "\t\t{" + NL + "\t\t\tif (";
+ protected final String TEXT_504 = ".isAncestor(this, ";
+ protected final String TEXT_505 = "new";
+ protected final String TEXT_506 = "))" + NL + "\t\t\t\tthrow new ";
+ protected final String TEXT_507 = "(\"Recursive containment not allowed for \" + toString());";
+ protected final String TEXT_508 = NL + "\t\t\tChangeContext changeContext = null;" + NL + "\t\t\tif (eInternalContainer() != null)" + NL + "\t\t\t\tchangeContext = eBasicRemoveFromContainer(changeContext);" + NL + "\t\t\tif (new";
+ protected final String TEXT_509 = " != null)" + NL + "\t\t\t\tchangeContext = ((";
+ protected final String TEXT_510 = ")new";
+ protected final String TEXT_511 = ").eInverseAdd(this, ";
+ protected final String TEXT_512 = ", ";
+ protected final String TEXT_513 = ".class, changeContext);" + NL + "\t\t\tchangeContext = eBasicSetContainer((";
+ protected final String TEXT_514 = ")new";
+ protected final String TEXT_515 = ", ";
+ protected final String TEXT_516 = ", changeContext);" + NL + "\t\t\tif (changeContext != null) dispatch(changeContext);" + NL + "\t\t}";
+ protected final String TEXT_517 = NL + "\t\telse if (isNotifying())" + NL + "\t\t\tnotify(ChangeKind.SET, ";
+ protected final String TEXT_518 = ", new";
+ protected final String TEXT_519 = ", new";
+ protected final String TEXT_520 = ");";
+ protected final String TEXT_521 = NL + "\t\t";
+ protected final String TEXT_522 = " ";
+ protected final String TEXT_523 = " = (";
+ protected final String TEXT_524 = ")eVirtualGet(";
+ protected final String TEXT_525 = ");";
+ protected final String TEXT_526 = NL + "\t\tif (new";
+ protected final String TEXT_527 = " != ";
+ protected final String TEXT_528 = ")" + NL + "\t\t{" + NL + "\t\t\tChangeContext changeContext = null;" + NL + "\t\t\tif (";
+ protected final String TEXT_529 = " != null)";
+ protected final String TEXT_530 = NL + "\t\t\t\tchangeContext = inverseRemove(";
+ protected final String TEXT_531 = ", this, OPPOSITE_FEATURE_BASE - ";
+ protected final String TEXT_532 = ", null, changeContext);" + NL + "\t\t\tif (new";
+ protected final String TEXT_533 = " != null)" + NL + "\t\t\t\tchangeContext = inverseAdd(new";
+ protected final String TEXT_534 = ", this, OPPOSITE_FEATURE_BASE - ";
+ protected final String TEXT_535 = ", null, changeContext);";
+ protected final String TEXT_536 = NL + "\t\t\t\tchangeContext = inverseRemove(";
+ protected final String TEXT_537 = ", this, ";
+ protected final String TEXT_538 = ", ";
+ protected final String TEXT_539 = ".class, changeContext);" + NL + "\t\t\tif (new";
+ protected final String TEXT_540 = " != null)" + NL + "\t\t\t\tchangeContext = inverseAdd(new";
+ protected final String TEXT_541 = ", this, ";
+ protected final String TEXT_542 = ", ";
+ protected final String TEXT_543 = ".class, changeContext);";
+ protected final String TEXT_544 = NL + "\t\t\tchangeContext = basicSet";
+ protected final String TEXT_545 = "(";
+ protected final String TEXT_546 = "new";
+ protected final String TEXT_547 = ", changeContext);" + NL + "\t\t\tif (changeContext != null) dispatch(changeContext);" + NL + "\t\t}";
+ protected final String TEXT_548 = NL + "\t\telse" + NL + " \t{";
+ protected final String TEXT_549 = NL + "\t\t\tboolean old";
+ protected final String TEXT_550 = "_set_ = eVirtualIsSet(";
+ protected final String TEXT_551 = ");";
+ protected final String TEXT_552 = NL + "\t\t\tboolean old";
+ protected final String TEXT_553 = "_set_ = (";
+ protected final String TEXT_554 = " & ";
+ protected final String TEXT_555 = "_ESETFLAG) != 0;";
+ protected final String TEXT_556 = NL + "\t\t\t";
+ protected final String TEXT_557 = " |= ";
+ protected final String TEXT_558 = "_ESETFLAG;";
+ protected final String TEXT_559 = NL + "\t\t\tboolean old";
+ protected final String TEXT_560 = "_set_ = ";
+ protected final String TEXT_561 = "_set_;";
+ protected final String TEXT_562 = NL + "\t\t\t";
+ protected final String TEXT_563 = "_set_ = true;";
+ protected final String TEXT_564 = NL + "\t\t\tif (isNotifying())" + NL + "\t\t\t\tnotify(ChangeKind.SET, ";
+ protected final String TEXT_565 = ", new";
+ protected final String TEXT_566 = ", new";
+ protected final String TEXT_567 = ", !old";
+ protected final String TEXT_568 = "_set_);";
+ protected final String TEXT_569 = NL + " \t}";
+ protected final String TEXT_570 = NL + "\t\telse if (isNotifying())" + NL + "\t\t\tnotify(ChangeKind.SET, ";
+ protected final String TEXT_571 = ", new";
+ protected final String TEXT_572 = ", new";
+ protected final String TEXT_573 = ");";
+ protected final String TEXT_574 = NL + "\t\t";
+ protected final String TEXT_575 = " old";
+ protected final String TEXT_576 = " = (";
+ protected final String TEXT_577 = " & ";
+ protected final String TEXT_578 = "_EFLAG) != 0;";
+ protected final String TEXT_579 = NL + "\t\tif (new";
+ protected final String TEXT_580 = ") ";
+ protected final String TEXT_581 = " |= ";
+ protected final String TEXT_582 = "_EFLAG; else ";
+ protected final String TEXT_583 = " &= ~";
+ protected final String TEXT_584 = "_EFLAG;";
+ protected final String TEXT_585 = NL + "\t\t";
+ protected final String TEXT_586 = " old";
+ protected final String TEXT_587 = " = ";
+ protected final String TEXT_588 = ";";
+ protected final String TEXT_589 = NL + "\t\t";
+ protected final String TEXT_590 = " ";
+ protected final String TEXT_591 = " = new";
+ protected final String TEXT_592 = " == null ? ";
+ protected final String TEXT_593 = "_DEFAULT_ : new";
+ protected final String TEXT_594 = ";";
+ protected final String TEXT_595 = NL + "\t\t";
+ protected final String TEXT_596 = " = new";
+ protected final String TEXT_597 = " == null ? ";
+ protected final String TEXT_598 = "_DEFAULT_ : new";
+ protected final String TEXT_599 = ";";
+ protected final String TEXT_600 = NL + "\t\t";
+ protected final String TEXT_601 = " ";
+ protected final String TEXT_602 = " = ";
+ protected final String TEXT_603 = "new";
+ protected final String TEXT_604 = ";";
+ protected final String TEXT_605 = NL + "\t\t";
+ protected final String TEXT_606 = " = ";
+ protected final String TEXT_607 = "new";
+ protected final String TEXT_608 = ";";
+ protected final String TEXT_609 = NL + "\t\tObject old";
+ protected final String TEXT_610 = " = eVirtualSet(";
+ protected final String TEXT_611 = ", ";
+ protected final String TEXT_612 = ");";
+ protected final String TEXT_613 = NL + "\t\tboolean isSetChange = old";
+ protected final String TEXT_614 = " == EVIRTUAL_NO_VALUE;";
+ protected final String TEXT_615 = NL + "\t\tboolean old";
+ protected final String TEXT_616 = "_set_ = (";
+ protected final String TEXT_617 = " & ";
+ protected final String TEXT_618 = "_ESETFLAG) != 0;";
+ protected final String TEXT_619 = NL + "\t\t";
+ protected final String TEXT_620 = " |= ";
+ protected final String TEXT_621 = "_ESETFLAG;";
+ protected final String TEXT_622 = NL + "\t\tboolean old";
+ protected final String TEXT_623 = "_set_ = ";
+ protected final String TEXT_624 = "_set_;";
+ protected final String TEXT_625 = NL + "\t\t";
+ protected final String TEXT_626 = "_set_ = true;";
+ protected final String TEXT_627 = NL + "\t\tif (isNotifying())" + NL + "\t\t\tnotify(ChangeKind.SET, ";
+ protected final String TEXT_628 = ", ";
+ protected final String TEXT_629 = "isSetChange ? ";
+ protected final String TEXT_630 = "null";
+ protected final String TEXT_631 = "_DEFAULT_";
+ protected final String TEXT_632 = " : old";
+ protected final String TEXT_633 = "old";
+ protected final String TEXT_634 = ", ";
+ protected final String TEXT_635 = "new";
+ protected final String TEXT_636 = ", ";
+ protected final String TEXT_637 = "isSetChange";
+ protected final String TEXT_638 = "!old";
+ protected final String TEXT_639 = "_set_";
+ protected final String TEXT_640 = ");";
+ protected final String TEXT_641 = NL + "\t\tif (isNotifying())" + NL + "\t\t\tnotify(ChangeKind.SET, ";
+ protected final String TEXT_642 = ", ";
+ protected final String TEXT_643 = "old";
+ protected final String TEXT_644 = " == EVIRTUAL_NO_VALUE ? ";
+ protected final String TEXT_645 = "null";
+ protected final String TEXT_646 = "_DEFAULT_";
+ protected final String TEXT_647 = " : old";
+ protected final String TEXT_648 = "old";
+ protected final String TEXT_649 = ", ";
+ protected final String TEXT_650 = "new";
+ protected final String TEXT_651 = ");";
+ protected final String TEXT_652 = NL + "\t\tset(get";
+ protected final String TEXT_653 = "(), getType(), ";
+ protected final String TEXT_654 = ", ";
+ protected final String TEXT_655 = " new ";
+ protected final String TEXT_656 = "(";
+ protected final String TEXT_657 = "new";
+ protected final String TEXT_658 = ")";
+ protected final String TEXT_659 = ");";
+ protected final String TEXT_660 = NL + "\t\t((";
+ protected final String TEXT_661 = ".Internal)get";
+ protected final String TEXT_662 = "()).set(";
+ protected final String TEXT_663 = ", ";
+ protected final String TEXT_664 = "new ";
+ protected final String TEXT_665 = "(";
+ protected final String TEXT_666 = "new";
+ protected final String TEXT_667 = ")";
+ protected final String TEXT_668 = ");";
+ protected final String TEXT_669 = NL + "\t\t// TODO: implement this method to set the '";
+ protected final String TEXT_670 = "' ";
+ protected final String TEXT_671 = NL + "\t\t// Ensure that you remove @generated or mark it @generated NOT" + NL + "\t\tthrow new UnsupportedOperationException();";
+ protected final String TEXT_672 = NL + "\t}" + NL;
+ protected final String TEXT_673 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ChangeContext basicUnset";
+ protected final String TEXT_674 = "(ChangeContext changeContext)" + NL + "\t{";
+ protected final String TEXT_675 = NL + "\t\tObject old";
+ protected final String TEXT_676 = " = eVirtualUnset(";
+ protected final String TEXT_677 = ");";
+ protected final String TEXT_678 = NL + "\t\t";
+ protected final String TEXT_679 = " old";
+ protected final String TEXT_680 = " = ";
+ protected final String TEXT_681 = ";" + NL + "\t\t";
+ protected final String TEXT_682 = " = null;";
+ protected final String TEXT_683 = NL + "\t\tboolean isSetChange = old";
+ protected final String TEXT_684 = " != EVIRTUAL_NO_VALUE;";
+ protected final String TEXT_685 = NL + "\t\tboolean old";
+ protected final String TEXT_686 = "_set_ = (";
+ protected final String TEXT_687 = " & ";
+ protected final String TEXT_688 = "_ESETFLAG) != 0;" + NL + "\t\t";
+ protected final String TEXT_689 = " &= ~";
+ protected final String TEXT_690 = "_ESETFLAG;";
+ protected final String TEXT_691 = NL + "\t\tboolean old";
+ protected final String TEXT_692 = "_set_ = ";
+ protected final String TEXT_693 = "_set_;" + NL + "\t\t";
+ protected final String TEXT_694 = "_set_ = false;";
+ protected final String TEXT_695 = NL + "\t\tif (isNotifying())" + NL + "\t\t{" + NL + "\t\t\t";
+ protected final String TEXT_696 = " notification = new ";
+ protected final String TEXT_697 = "(this, ";
+ protected final String TEXT_698 = ".UNSET, ";
+ protected final String TEXT_699 = ", ";
+ protected final String TEXT_700 = "isSetChange ? old";
+ protected final String TEXT_701 = " : null";
+ protected final String TEXT_702 = "old";
+ protected final String TEXT_703 = ", null, ";
+ protected final String TEXT_704 = "isSetChange";
+ protected final String TEXT_705 = "old";
+ protected final String TEXT_706 = "_set_";
+ protected final String TEXT_707 = ");" + NL + "\t\t\tif (changeContext == null) changeContext = notification; else changeContext.add(notification);" + NL + "\t\t}" + NL + "\t\treturn changeContext;";
+ protected final String TEXT_708 = NL + "\t\t// TODO: implement this method to unset the contained '";
+ protected final String TEXT_709 = "' ";
+ protected final String TEXT_710 = NL + "\t\t// -> this method is automatically invoked to keep the containment relationship in synch" + NL + "\t\t// -> do not modify other features" + NL + "\t\t// -> return changeContext, after adding any generated Notification to it (if it is null, a NotificationChain object must be created first)" + NL + "\t\t// Ensure that you remove @generated or mark it @generated NOT" + NL + "\t\tthrow new UnsupportedOperationException();";
+ protected final String TEXT_711 = NL + "\t}" + NL;
+ protected final String TEXT_712 = NL + "\t/**" + NL + "\t * Unsets the value of the '{@link ";
+ protected final String TEXT_713 = "#";
+ protected final String TEXT_714 = " <em>";
+ protected final String TEXT_715 = "</em>}' ";
+ protected final String TEXT_716 = "." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->";
+ protected final String TEXT_717 = NL + "\t * @see #isSet";
+ protected final String TEXT_718 = "()";
+ protected final String TEXT_719 = NL + "\t * @see #";
+ protected final String TEXT_720 = "()";
+ protected final String TEXT_721 = NL + "\t * @see #set";
+ protected final String TEXT_722 = "(";
+ protected final String TEXT_723 = ")";
+ protected final String TEXT_724 = NL + "\t * @generated" + NL + "\t */";
+ protected final String TEXT_725 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */";
+ protected final String TEXT_726 = NL + "\tvoid unset";
+ protected final String TEXT_727 = "();" + NL;
+ protected final String TEXT_728 = NL + "\tpublic void unset";
+ protected final String TEXT_729 = "()" + NL + "\t{";
+ protected final String TEXT_730 = NL + "\t\tunset(";
+ protected final String TEXT_731 = ");";
+ protected final String TEXT_732 = NL + "\t\t((";
+ protected final String TEXT_733 = ".Unsettable)get";
+ protected final String TEXT_734 = "()).unset();";
+ protected final String TEXT_735 = NL + "\t\t";
+ protected final String TEXT_736 = " ";
+ protected final String TEXT_737 = " = (";
+ protected final String TEXT_738 = ")eVirtualGet(";
+ protected final String TEXT_739 = ");";
+ protected final String TEXT_740 = NL + "\t\tif (";
+ protected final String TEXT_741 = " != null)" + NL + "\t\t{" + NL + "\t\t\tChangeContext changeContext = null;";
+ protected final String TEXT_742 = NL + "\t\t\tchangeContext = ((";
+ protected final String TEXT_743 = ")";
+ protected final String TEXT_744 = ").inverseRemove(this, EOPPOSITE_FEATURE_BASE - ";
+ protected final String TEXT_745 = ", null, changeContext);";
+ protected final String TEXT_746 = NL + "\t\t\tchangeContext = ((";
+ protected final String TEXT_747 = ")";
+ protected final String TEXT_748 = ").inverseRemove(this, ";
+ protected final String TEXT_749 = ", ";
+ protected final String TEXT_750 = ".class, changeContext);";
+ protected final String TEXT_751 = NL + "\t\t\tchangeContext = basicUnset";
+ protected final String TEXT_752 = "(changeContext);" + NL + "\t\t\tif (changeContext != null) dispatch(changeContext);" + NL + "\t\t}" + NL + "\t\telse" + NL + " \t{";
+ protected final String TEXT_753 = NL + "\t\t\tboolean old";
+ protected final String TEXT_754 = "_set_ = eVirtualIsSet(";
+ protected final String TEXT_755 = ");";
+ protected final String TEXT_756 = NL + "\t\t\tboolean old";
+ protected final String TEXT_757 = "_set_ = (";
+ protected final String TEXT_758 = " & ";
+ protected final String TEXT_759 = "_ESETFLAG) != 0;";
+ protected final String TEXT_760 = NL + "\t\t\t";
+ protected final String TEXT_761 = " &= ~";
+ protected final String TEXT_762 = "_ESETFLAG;";
+ protected final String TEXT_763 = NL + "\t\t\tboolean old";
+ protected final String TEXT_764 = "_set_ = ";
+ protected final String TEXT_765 = "_set_;";
+ protected final String TEXT_766 = NL + "\t\t\t";
+ protected final String TEXT_767 = "_set_ = false;";
+ protected final String TEXT_768 = NL + "\t\t\tif (isNotifying())" + NL + "\t\t\t\tnotify(ChangeKind.UNSET, ";
+ protected final String TEXT_769 = ", null, null, old";
+ protected final String TEXT_770 = "_set_);";
+ protected final String TEXT_771 = NL + " \t}";
+ protected final String TEXT_772 = NL + "\t\t";
+ protected final String TEXT_773 = " old";
+ protected final String TEXT_774 = " = (";
+ protected final String TEXT_775 = " & ";
+ protected final String TEXT_776 = "_EFLAG) != 0;";
+ protected final String TEXT_777 = NL + "\t\tObject old";
+ protected final String TEXT_778 = " = eVirtualUnset(";
+ protected final String TEXT_779 = ");";
+ protected final String TEXT_780 = NL + "\t\t";
+ protected final String TEXT_781 = " old";
+ protected final String TEXT_782 = " = ";
+ protected final String TEXT_783 = ";";
+ protected final String TEXT_784 = NL + "\t\tboolean isSetChange = old";
+ protected final String TEXT_785 = " != EVIRTUAL_NO_VALUE;";
+ protected final String TEXT_786 = NL + "\t\tboolean old";
+ protected final String TEXT_787 = "_set_ = (";
+ protected final String TEXT_788 = " & ";
+ protected final String TEXT_789 = "_ESETFLAG) != 0;";
+ protected final String TEXT_790 = NL + "\t\tboolean old";
+ protected final String TEXT_791 = "_set_ = ";
+ protected final String TEXT_792 = "_set_;";
+ protected final String TEXT_793 = NL + "\t\t";
+ protected final String TEXT_794 = " = null;";
+ protected final String TEXT_795 = NL + "\t\t";
+ protected final String TEXT_796 = " &= ~";
+ protected final String TEXT_797 = "_ESETFLAG;";
+ protected final String TEXT_798 = NL + "\t\t";
+ protected final String TEXT_799 = "_set_ = false;";
+ protected final String TEXT_800 = NL + "\t\tif (isNotifying())" + NL + "\t\t\tnotify(ChangeKind.UNSET, ";
+ protected final String TEXT_801 = ", ";
+ protected final String TEXT_802 = "isSetChange ? old";
+ protected final String TEXT_803 = " : null";
+ protected final String TEXT_804 = "old";
+ protected final String TEXT_805 = ", null, ";
+ protected final String TEXT_806 = "isSetChange";
+ protected final String TEXT_807 = "old";
+ protected final String TEXT_808 = "_set_";
+ protected final String TEXT_809 = ");";
+ protected final String TEXT_810 = NL + "\t\tif (";
+ protected final String TEXT_811 = "_DEFAULT_) ";
+ protected final String TEXT_812 = " |= ";
+ protected final String TEXT_813 = "_EFLAG; else ";
+ protected final String TEXT_814 = " &= ~";
+ protected final String TEXT_815 = "_EFLAG;";
+ protected final String TEXT_816 = NL + "\t\t";
+ protected final String TEXT_817 = " = ";
+ protected final String TEXT_818 = "_DEFAULT_;";
+ protected final String TEXT_819 = NL + "\t\t";
+ protected final String TEXT_820 = " &= ~";
+ protected final String TEXT_821 = "_ESETFLAG;";
+ protected final String TEXT_822 = NL + "\t\t";
+ protected final String TEXT_823 = "_set_ = false;";
+ protected final String TEXT_824 = NL + "\t\tif (isNotifying())" + NL + "\t\t\tnotify(ChangeKind.UNSET, ";
+ protected final String TEXT_825 = ", ";
+ protected final String TEXT_826 = "isSetChange ? old";
+ protected final String TEXT_827 = " : ";
+ protected final String TEXT_828 = "_DEFAULT_";
+ protected final String TEXT_829 = "old";
+ protected final String TEXT_830 = ", ";
+ protected final String TEXT_831 = "_DEFAULT_, ";
+ protected final String TEXT_832 = "isSetChange";
+ protected final String TEXT_833 = "old";
+ protected final String TEXT_834 = "_set_";
+ protected final String TEXT_835 = ");";
+ protected final String TEXT_836 = NL + " unset(get";
+ protected final String TEXT_837 = "(), getType(), ";
+ protected final String TEXT_838 = ");";
+ protected final String TEXT_839 = NL + " unset";
+ protected final String TEXT_840 = "(get";
+ protected final String TEXT_841 = "());";
+ protected final String TEXT_842 = NL + "\t\t// TODO: implement this method to unset the '";
+ protected final String TEXT_843 = "' ";
+ protected final String TEXT_844 = NL + "\t\t// Ensure that you remove @generated or mark it @generated NOT" + NL + "\t\tthrow new UnsupportedOperationException();";
+ protected final String TEXT_845 = NL + "\t}" + NL;
+ protected final String TEXT_846 = NL + "\t/**" + NL + "\t * Returns whether the value of the '{@link ";
+ protected final String TEXT_847 = "#";
+ protected final String TEXT_848 = " <em>";
+ protected final String TEXT_849 = "</em>}' ";
+ protected final String TEXT_850 = " is set." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @return whether the value of the '<em>";
+ protected final String TEXT_851 = "</em>' ";
+ protected final String TEXT_852 = " is set.";
+ protected final String TEXT_853 = NL + "\t * @see #unset";
+ protected final String TEXT_854 = "()";
+ protected final String TEXT_855 = NL + "\t * @see #";
+ protected final String TEXT_856 = "()";
+ protected final String TEXT_857 = NL + "\t * @see #set";
+ protected final String TEXT_858 = "(";
+ protected final String TEXT_859 = ")";
+ protected final String TEXT_860 = NL + "\t * @generated" + NL + "\t */";
+ protected final String TEXT_861 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */";
+ protected final String TEXT_862 = NL + "\tboolean isSet";
+ protected final String TEXT_863 = "();" + NL;
+ protected final String TEXT_864 = NL + "\tpublic boolean isSet";
+ protected final String TEXT_865 = "()" + NL + "\t{";
+ protected final String TEXT_866 = NL + "\t\treturn isSet(";
+ protected final String TEXT_867 = ");";
+ protected final String TEXT_868 = NL + "\t\t";
+ protected final String TEXT_869 = " ";
+ protected final String TEXT_870 = " = (";
+ protected final String TEXT_871 = ")eVirtualGet(";
+ protected final String TEXT_872 = ");";
+ protected final String TEXT_873 = NL + "\t\treturn ";
+ protected final String TEXT_874 = " != null && ((";
+ protected final String TEXT_875 = ".Unsettable)";
+ protected final String TEXT_876 = ").isSet();";
+ protected final String TEXT_877 = NL + "\t\treturn eVirtualIsSet(";
+ protected final String TEXT_878 = ");";
+ protected final String TEXT_879 = NL + "\t\treturn (";
+ protected final String TEXT_880 = " & ";
+ protected final String TEXT_881 = "_ESETFLAG) != 0;";
+ protected final String TEXT_882 = NL + "\t\treturn ";
+ protected final String TEXT_883 = "_set_;";
+ protected final String TEXT_884 = NL + " return isSet(get";
+ protected final String TEXT_885 = "(), getType(), ";
+ protected final String TEXT_886 = ");";
+ protected final String TEXT_887 = NL + "\t\treturn !((";
+ protected final String TEXT_888 = ".Internal)get";
+ protected final String TEXT_889 = "()).isEmpty(";
+ protected final String TEXT_890 = ");";
+ protected final String TEXT_891 = NL + "\t\t// TODO: implement this method to return whether the '";
+ protected final String TEXT_892 = "' ";
+ protected final String TEXT_893 = " is set" + NL + "\t\t// Ensure that you remove @generated or mark it @generated NOT" + NL + "\t\tthrow new UnsupportedOperationException();";
+ protected final String TEXT_894 = NL + "\t}" + NL;
+ protected final String TEXT_895 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->";
+ protected final String TEXT_896 = NL + "\t * <!-- begin-model-doc -->" + NL + "\t * ";
+ protected final String TEXT_897 = NL + "\t * <!-- end-model-doc -->";
+ protected final String TEXT_898 = NL + "\t * @model ";
+ protected final String TEXT_899 = NL + "\t * ";
+ protected final String TEXT_900 = NL + "\t * @model";
+ protected final String TEXT_901 = NL + "\t * @generated" + NL + "\t */";
+ protected final String TEXT_902 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */";
+ protected final String TEXT_903 = NL + "\t";
+ protected final String TEXT_904 = " ";
+ protected final String TEXT_905 = "(";
+ protected final String TEXT_906 = ")";
+ protected final String TEXT_907 = ";" + NL;
+ protected final String TEXT_908 = NL + "\tpublic ";
+ protected final String TEXT_909 = " ";
+ protected final String TEXT_910 = "(";
+ protected final String TEXT_911 = ")";
+ protected final String TEXT_912 = NL + "\t{";
+ protected final String TEXT_913 = NL + "\t\t";
+ protected final String TEXT_914 = NL + "\t\t// TODO: implement this method" + NL + "\t\t// -> specify the condition that violates the invariant" + NL + "\t\t// -> verify the details of the diagnostic, including severity and message" + NL + "\t\t// Ensure that you remove @generated or mark it @generated NOT" + NL + "\t\tif (false)" + NL + "\t\t{" + NL + "\t\t\tif (";
+ protected final String TEXT_915 = " != null)" + NL + "\t\t\t{" + NL + "\t\t\t\t";
+ protected final String TEXT_916 = ".add" + NL + "\t\t\t\t\t(new ";
+ protected final String TEXT_917 = NL + "\t\t\t\t\t\t(";
+ protected final String TEXT_918 = ".ERROR," + NL + "\t\t\t\t\t\t ";
+ protected final String TEXT_919 = ".DIAGNOSTIC_SOURCE," + NL + "\t\t\t\t\t\t ";
+ protected final String TEXT_920 = ".";
+ protected final String TEXT_921 = "," + NL + "\t\t\t\t\t\t ";
+ protected final String TEXT_922 = ".INSTANCE.getString(\"_UI_GenericInvariant_diagnostic\", new Object[] { \"";
+ protected final String TEXT_923 = "\", ";
+ protected final String TEXT_924 = ".getObjectLabel(this, ";
+ protected final String TEXT_925 = ") }),";
+ protected final String TEXT_926 = NL + "\t\t\t\t\t\t new Object [] { this }));" + NL + "\t\t\t}" + NL + "\t\t\treturn false;" + NL + "\t\t}" + NL + "\t\treturn true;";
+ protected final String TEXT_927 = NL + "\t\t// TODO: implement this method" + NL + "\t\t// Ensure that you remove @generated or mark it @generated NOT" + NL + "\t\tthrow new UnsupportedOperationException();";
+ protected final String TEXT_928 = NL + "\t}" + NL;
+ protected final String TEXT_929 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ChangeContext eInverseAdd(";
+ protected final String TEXT_930 = " otherEnd, int propertyIndex, ChangeContext changeContext)" + NL + "\t{" + NL + "\t\tswitch (propertyIndex)" + NL + "\t\t{";
+ protected final String TEXT_931 = NL + "\t\t\tcase ";
+ protected final String TEXT_932 = ":";
+ protected final String TEXT_933 = NL + "\t\t\t\treturn ((";
+ protected final String TEXT_934 = ")((";
+ protected final String TEXT_935 = ".InternalMapView)";
+ protected final String TEXT_936 = "()).eMap()).basicAdd(otherEnd, changeContext);";
+ protected final String TEXT_937 = NL + "\t\t\t\treturn ((";
+ protected final String TEXT_938 = ")";
+ protected final String TEXT_939 = "()).basicAdd(otherEnd, changeContext);";
+ protected final String TEXT_940 = NL + "\t\t\t\tif (eInternalContainer() != null)" + NL + "\t\t\t\t\tchangeContext = eBasicRemoveFromContainer(changeContext);" + NL + "\t\t\t\treturn eBasicSetContainer(otherEnd, ";
+ protected final String TEXT_941 = ", changeContext);";
+ protected final String TEXT_942 = NL + "\t\t\t\t";
+ protected final String TEXT_943 = " ";
+ protected final String TEXT_944 = " = (";
+ protected final String TEXT_945 = ")eVirtualGet(";
+ protected final String TEXT_946 = ");";
+ protected final String TEXT_947 = NL + "\t\t\t\tif (";
+ protected final String TEXT_948 = " != null)";
+ protected final String TEXT_949 = NL + "\t\t\t\t\tchangeContext = ((";
+ protected final String TEXT_950 = ")";
+ protected final String TEXT_951 = ").inverseRemove(this, EOPPOSITE_FEATURE_BASE - ";
+ protected final String TEXT_952 = ", null, changeContext);";
+ protected final String TEXT_953 = NL + "\t\t\t\t\tchangeContext = ((";
+ protected final String TEXT_954 = ")";
+ protected final String TEXT_955 = ").inverseRemove(this, ";
+ protected final String TEXT_956 = ", ";
+ protected final String TEXT_957 = ".class, changeContext);";
+ protected final String TEXT_958 = NL + "\t\t\t\treturn basicSet";
+ protected final String TEXT_959 = "((";
+ protected final String TEXT_960 = ")otherEnd, changeContext);";
+ protected final String TEXT_961 = NL + "\t\t}";
+ protected final String TEXT_962 = NL + "\t\treturn super.eInverseAdd(otherEnd, propertyIndex, changeContext);";
+ protected final String TEXT_963 = NL + "\t\treturn eDynamicInverseAdd(otherEnd, propertyIndex, changeContext);";
+ protected final String TEXT_964 = NL + "\t}" + NL;
+ protected final String TEXT_965 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ChangeContext inverseRemove(";
+ protected final String TEXT_966 = " otherEnd, int propertyIndex, ChangeContext changeContext)" + NL + "\t{" + NL + "\t\tswitch (propertyIndex)" + NL + "\t\t{";
+ protected final String TEXT_967 = NL + "\t\t\tcase ";
+ protected final String TEXT_968 = ":";
+ protected final String TEXT_969 = NL + "\t\t\t\treturn ((";
+ protected final String TEXT_970 = ")((";
+ protected final String TEXT_971 = ".InternalMapView)";
+ protected final String TEXT_972 = "()).eMap()).basicRemove(otherEnd, changeContext);";
+ protected final String TEXT_973 = NL + "\t\t\t\treturn removeFrom";
+ protected final String TEXT_974 = "(";
+ protected final String TEXT_975 = "(), otherEnd, changeContext);";
+ protected final String TEXT_976 = NL + "\t\t\t\treturn removeFromList(";
+ protected final String TEXT_977 = "(), otherEnd, changeContext);";
+ protected final String TEXT_978 = NL + "\t\t\t\treturn eBasicSetContainer(null, ";
+ protected final String TEXT_979 = ", changeContext);";
+ protected final String TEXT_980 = NL + "\t\t\t\treturn basicUnset";
+ protected final String TEXT_981 = "(changeContext);";
+ protected final String TEXT_982 = NL + "\t\t\t\treturn basicSet";
+ protected final String TEXT_983 = "(null, changeContext);";
+ protected final String TEXT_984 = NL + "\t\t}";
+ protected final String TEXT_985 = NL + "\t\treturn super.inverseRemove(otherEnd, propertyIndex, changeContext);";
+ protected final String TEXT_986 = NL + "\t\treturn eDynamicInverseRemove(otherEnd, propertyIndex, changeContext);";
+ protected final String TEXT_987 = NL + "\t}" + NL;
+ protected final String TEXT_988 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ChangeContext eBasicRemoveFromContainerFeature(ChangeContext changeContext)" + NL + "\t{" + NL + "\t\tswitch (eContainerFeatureID)" + NL + "\t\t{";
+ protected final String TEXT_989 = NL + "\t\t\tcase ";
+ protected final String TEXT_990 = ":" + NL + "\t\t\t\treturn eInternalContainer().inverseRemove(this, ";
+ protected final String TEXT_991 = ", ";
+ protected final String TEXT_992 = ".class, changeContext);";
+ protected final String TEXT_993 = NL + "\t\t}";
+ protected final String TEXT_994 = NL + "\t\treturn super.eBasicRemoveFromContainerFeature(changeContext);";
+ protected final String TEXT_995 = NL + "\t\treturn eDynamicBasicRemoveFromContainer(changeContext);";
+ protected final String TEXT_996 = NL + "\t}" + NL;
+ protected final String TEXT_997 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Object get(int propertyIndex, boolean resolve)" + NL + "\t{" + NL + "\t\tswitch (propertyIndex)" + NL + "\t\t{";
+ protected final String TEXT_998 = NL + "\t\t\tcase ";
+ protected final String TEXT_999 = ":";
+ protected final String TEXT_1000 = NL + "\t\t\t\treturn ";
+ protected final String TEXT_1001 = "() ? Boolean.TRUE : Boolean.FALSE;";
+ protected final String TEXT_1002 = NL + "\t\t\t\treturn new ";
+ protected final String TEXT_1003 = "(";
+ protected final String TEXT_1004 = "());";
+ protected final String TEXT_1005 = NL + "\t\t\t\tif (resolve) return ";
+ protected final String TEXT_1006 = "();" + NL + "\t\t\t\treturn basicGet";
+ protected final String TEXT_1007 = "();";
+ protected final String TEXT_1008 = NL + "\t\t\t\tif (coreType) return ((";
+ protected final String TEXT_1009 = ".InternalMapView)";
+ protected final String TEXT_1010 = "()).eMap();" + NL + "\t\t\t\telse return ";
+ protected final String TEXT_1011 = "();";
+ protected final String TEXT_1012 = NL + "\t\t\t\tif (coreType) return ";
+ protected final String TEXT_1013 = "();" + NL + "\t\t\t\telse return ";
+ protected final String TEXT_1014 = "().map();";
+ protected final String TEXT_1015 = NL + "\t\t\t\t// XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view" + NL + "\t\t\t\t//if (coreType) " + NL + "\t\t\t\treturn ";
+ protected final String TEXT_1016 = "();";
+ protected final String TEXT_1017 = NL + "\t\t\t\tif (coreType) return ";
+ protected final String TEXT_1018 = "();" + NL + "\t\t\t\treturn ((";
+ protected final String TEXT_1019 = ".Internal)";
+ protected final String TEXT_1020 = "()).getWrapper();";
+ protected final String TEXT_1021 = NL + "\t\t\t\treturn ";
+ protected final String TEXT_1022 = "();";
+ protected final String TEXT_1023 = NL + "\t\t}";
+ protected final String TEXT_1024 = NL + "\t\treturn super.get(propertyIndex, resolve);";
+ protected final String TEXT_1025 = NL + "\t\treturn eDynamicGet(propertyIndex, resolve, coreType);";
+ protected final String TEXT_1026 = NL + "\t}" + NL;
+ protected final String TEXT_1027 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void set(int propertyIndex, Object newValue)" + NL + "\t{" + NL + "\t\tswitch (propertyIndex)" + NL + "\t\t{";
+ protected final String TEXT_1028 = NL + "\t\t\tcase ";
+ protected final String TEXT_1029 = ":";
+ protected final String TEXT_1030 = NL + " \tset";
+ protected final String TEXT_1031 = "(";
+ protected final String TEXT_1032 = "(), newValue);";
+ protected final String TEXT_1033 = NL + "\t\t\t\t((";
+ protected final String TEXT_1034 = ".Internal)";
+ protected final String TEXT_1035 = "()).set(newValue);";
+ protected final String TEXT_1036 = NL + "\t\t\t\t((";
+ protected final String TEXT_1037 = ".Setting)((";
+ protected final String TEXT_1038 = ".InternalMapView)";
+ protected final String TEXT_1039 = "()).eMap()).set(newValue);";
+ protected final String TEXT_1040 = NL + "\t\t\t\t((";
+ protected final String TEXT_1041 = ".Setting)";
+ protected final String TEXT_1042 = "()).set(newValue);";
+ protected final String TEXT_1043 = NL + "\t\t\t\t";
+ protected final String TEXT_1044 = "().clear();" + NL + "\t\t\t\t";
+ protected final String TEXT_1045 = "().addAll((";
+ protected final String TEXT_1046 = ")newValue);";
+ protected final String TEXT_1047 = NL + "\t\t\t\tset";
+ protected final String TEXT_1048 = "(((";
+ protected final String TEXT_1049 = ")newValue).";
+ protected final String TEXT_1050 = "());";
+ protected final String TEXT_1051 = NL + "\t\t\t\tset";
+ protected final String TEXT_1052 = "((";
+ protected final String TEXT_1053 = ")newValue);";
+ protected final String TEXT_1054 = NL + "\t\t\t\treturn;";
+ protected final String TEXT_1055 = NL + "\t\t}";
+ protected final String TEXT_1056 = NL + "\t\tsuper.set(propertyIndex, newValue);";
+ protected final String TEXT_1057 = NL + "\t\teDynamicSet(propertyIndex, newValue);";
+ protected final String TEXT_1058 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void unset(int propertyIndex)" + NL + "\t{" + NL + "\t\tswitch (propertyIndex)" + NL + "\t\t{";
+ protected final String TEXT_1059 = NL + "\t\t\tcase ";
+ protected final String TEXT_1060 = ":";
+ protected final String TEXT_1061 = NL + "\t\t\t\tunset";
+ protected final String TEXT_1062 = "(";
+ protected final String TEXT_1063 = "());";
+ protected final String TEXT_1064 = NL + "\t\t\t\t";
+ protected final String TEXT_1065 = "().clear();";
+ protected final String TEXT_1066 = NL + "\t\t\t\tunset";
+ protected final String TEXT_1067 = "();";
+ protected final String TEXT_1068 = NL + "\t\t\t\tset";
+ protected final String TEXT_1069 = "((";
+ protected final String TEXT_1070 = ")null);";
+ protected final String TEXT_1071 = NL + "\t\t\t\tset";
+ protected final String TEXT_1072 = "(";
+ protected final String TEXT_1073 = "_DEFAULT_);";
+ protected final String TEXT_1074 = NL + "\t\t\t\treturn;";
+ protected final String TEXT_1075 = NL + "\t\t}";
+ protected final String TEXT_1076 = NL + "\t\tsuper.unset(propertyIndex);";
+ protected final String TEXT_1077 = NL + "\t\teDynamicUnset(propertyIndex);";
+ protected final String TEXT_1078 = NL + "\t}" + NL;
+ protected final String TEXT_1079 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic boolean isSet(int propertyIndex)" + NL + "\t{" + NL + "\t\tswitch (propertyIndex)" + NL + "\t\t{";
+ protected final String TEXT_1080 = NL + "\t\t\tcase ";
+ protected final String TEXT_1081 = ":";
+ protected final String TEXT_1082 = NL + "\t\t\t\treturn !is";
+ protected final String TEXT_1083 = "Empty(";
+ protected final String TEXT_1084 = "());";
+ protected final String TEXT_1085 = NL + "\t\t\t\treturn ";
+ protected final String TEXT_1086 = " != null && !is";
+ protected final String TEXT_1087 = "Empty(";
+ protected final String TEXT_1088 = "());";
+ protected final String TEXT_1089 = NL + "\t\t\t\treturn ";
+ protected final String TEXT_1090 = " != null && !";
+ protected final String TEXT_1091 = ".isEmpty();";
+ protected final String TEXT_1092 = NL + "\t\t\t\t";
+ protected final String TEXT_1093 = " ";
+ protected final String TEXT_1094 = " = (";
+ protected final String TEXT_1095 = ")eVirtualGet(";
+ protected final String TEXT_1096 = ");" + NL + "\t\t\t\treturn ";
+ protected final String TEXT_1097 = " != null && !";
+ protected final String TEXT_1098 = ".isEmpty();";
+ protected final String TEXT_1099 = NL + "\t\t\t\treturn !";
+ protected final String TEXT_1100 = "().isEmpty();";
+ protected final String TEXT_1101 = NL + "\t\t\t\treturn isSet";
+ protected final String TEXT_1102 = "();";
+ protected final String TEXT_1103 = NL + "\t\t\t\treturn ";
+ protected final String TEXT_1104 = " != null;";
+ protected final String TEXT_1105 = NL + "\t\t\t\treturn eVirtualGet(";
+ protected final String TEXT_1106 = ") != null;";
+ protected final String TEXT_1107 = NL + "\t\t\t\treturn basicGet";
+ protected final String TEXT_1108 = "() != null;";
+ protected final String TEXT_1109 = NL + "\t\t\t\treturn ";
+ protected final String TEXT_1110 = " != null;";
+ protected final String TEXT_1111 = NL + "\t\t\t\treturn eVirtualGet(";
+ protected final String TEXT_1112 = ") != null;";
+ protected final String TEXT_1113 = NL + "\t\t\t\treturn ";
+ protected final String TEXT_1114 = "() != null;";
+ protected final String TEXT_1115 = NL + "\t\t\t\treturn ((";
+ protected final String TEXT_1116 = " & ";
+ protected final String TEXT_1117 = "_EFLAG) != 0) != ";
+ protected final String TEXT_1118 = "_DEFAULT_;";
+ protected final String TEXT_1119 = NL + "\t\t\t\treturn ";
+ protected final String TEXT_1120 = " != ";
+ protected final String TEXT_1121 = "_DEFAULT_;";
+ protected final String TEXT_1122 = NL + "\t\t\t\treturn eVirtualGet(";
+ protected final String TEXT_1123 = ", ";
+ protected final String TEXT_1124 = "_DEFAULT_) != ";
+ protected final String TEXT_1125 = "_DEFAULT_;";
+ protected final String TEXT_1126 = NL + "\t\t\t\treturn ";
+ protected final String TEXT_1127 = "() != ";
+ protected final String TEXT_1128 = "_DEFAULT_;";
+ protected final String TEXT_1129 = NL + "\t\t\t\treturn ";
+ protected final String TEXT_1130 = "_DEFAULT_ == null ? ";
+ protected final String TEXT_1131 = " != null : !";
+ protected final String TEXT_1132 = "_DEFAULT_.equals(";
+ protected final String TEXT_1133 = ");";
+ protected final String TEXT_1134 = NL + "\t\t\t\t";
+ protected final String TEXT_1135 = " ";
+ protected final String TEXT_1136 = " = (";
+ protected final String TEXT_1137 = ")eVirtualGet(";
+ protected final String TEXT_1138 = ", ";
+ protected final String TEXT_1139 = "_DEFAULT_);" + NL + "\t\t\t\treturn ";
+ protected final String TEXT_1140 = "_DEFAULT_ == null ? ";
+ protected final String TEXT_1141 = " != null : !";
+ protected final String TEXT_1142 = "_DEFAULT_.equals(";
+ protected final String TEXT_1143 = ");";
+ protected final String TEXT_1144 = NL + "\t\t\t\treturn ";
+ protected final String TEXT_1145 = "_DEFAULT_ == null ? ";
+ protected final String TEXT_1146 = "() != null : !";
+ protected final String TEXT_1147 = "_DEFAULT_.equals(";
+ protected final String TEXT_1148 = "());";
+ protected final String TEXT_1149 = NL + "\t\t}";
+ protected final String TEXT_1150 = NL + "\t\treturn super.isSet(propertyIndex);";
+ protected final String TEXT_1151 = NL + "\t\treturn eDynamicIsSet(propertyIndex);";
+ protected final String TEXT_1152 = NL + "\t}" + NL;
+ protected final String TEXT_1153 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass)" + NL + "\t{";
+ protected final String TEXT_1154 = NL + "\t\tif (baseClass == ";
+ protected final String TEXT_1155 = ".class)" + NL + "\t\t{" + NL + "\t\t\tswitch (derivedFeatureID)" + NL + "\t\t\t{";
+ protected final String TEXT_1156 = NL + "\t\t\t\tcase ";
+ protected final String TEXT_1157 = ": return ";
+ protected final String TEXT_1158 = ";";
+ protected final String TEXT_1159 = NL + "\t\t\t\tdefault: return -1;" + NL + "\t\t\t}" + NL + "\t\t}";
+ protected final String TEXT_1160 = NL + "\t\treturn super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass)" + NL + "\t{";
+ protected final String TEXT_1161 = NL + "\t\tif (baseClass == ";
+ protected final String TEXT_1162 = ".class)" + NL + "\t\t{" + NL + "\t\t\tswitch (baseFeatureID)" + NL + "\t\t\t{";
+ protected final String TEXT_1163 = NL + "\t\t\t\tcase ";
+ protected final String TEXT_1164 = ": return ";
+ protected final String TEXT_1165 = ";";
+ protected final String TEXT_1166 = NL + "\t\t\t\tdefault: return -1;" + NL + "\t\t\t}" + NL + "\t\t}";
+ protected final String TEXT_1167 = NL + "\t\treturn super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);" + NL + "\t}" + NL;
+ protected final String TEXT_1168 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected Object[] eVirtualValues()" + NL + "\t{" + NL + "\t\treturn ";
+ protected final String TEXT_1169 = ";" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void setVirtualValues(Object[] newValues)" + NL + "\t{" + NL + "\t\t";
+ protected final String TEXT_1170 = " = newValues;" + NL + "\t}" + NL;
+ protected final String TEXT_1171 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected int eVirtualIndexBits(int offset)" + NL + "\t{" + NL + "\t\tswitch (offset)" + NL + "\t\t{";
+ protected final String TEXT_1172 = NL + "\t\t\tcase ";
+ protected final String TEXT_1173 = " :" + NL + "\t\t\t\treturn ";
+ protected final String TEXT_1174 = ";";
+ protected final String TEXT_1175 = NL + "\t\t\tdefault :" + NL + "\t\t\t\tthrow new IndexOutOfBoundsException();" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void setVirtualIndexBits(int offset, int newIndexBits)" + NL + "\t{" + NL + "\t\tswitch (offset)" + NL + "\t\t{";
+ protected final String TEXT_1176 = NL + "\t\t\tcase ";
+ protected final String TEXT_1177 = " :" + NL + "\t\t\t\t";
+ protected final String TEXT_1178 = " = newIndexBits;" + NL + "\t\t\t\tbreak;";
+ protected final String TEXT_1179 = NL + "\t\t\tdefault :" + NL + "\t\t\t\tthrow new IndexOutOfBoundsException();" + NL + "\t\t}" + NL + "\t}" + NL;
+ protected final String TEXT_1180 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic String toString()" + NL + "\t{" + NL + "\t\tif (isProxy()) return super.toString();" + NL + "" + NL + "\t\tStringBuffer result = new StringBuffer(super.toString());";
+ protected final String TEXT_1181 = NL + "\t\tresult.append(\" (";
+ protected final String TEXT_1182 = ": \");";
+ protected final String TEXT_1183 = NL + "\t\tresult.append(\", ";
+ protected final String TEXT_1184 = ": \");";
+ protected final String TEXT_1185 = NL + "\t\tif (eVirtualIsSet(";
+ protected final String TEXT_1186 = ")) result.append(eVirtualGet(";
+ protected final String TEXT_1187 = ")); else result.append(\"<unset>\");";
+ protected final String TEXT_1188 = NL + "\t\tif (";
+ protected final String TEXT_1189 = "(";
+ protected final String TEXT_1190 = " & ";
+ protected final String TEXT_1191 = "_ESETFLAG) != 0";
+ protected final String TEXT_1192 = "_set_";
+ protected final String TEXT_1193 = ") result.append((";
+ protected final String TEXT_1194 = " & ";
+ protected final String TEXT_1195 = "_EFLAG) != 0); else result.append(\"<unset>\");";
+ protected final String TEXT_1196 = NL + "\t\tif (";
+ protected final String TEXT_1197 = "(";
+ protected final String TEXT_1198 = " & ";
+ protected final String TEXT_1199 = "_ESETFLAG) != 0";
+ protected final String TEXT_1200 = "_set_";
+ protected final String TEXT_1201 = ") result.append(";
+ protected final String TEXT_1202 = "); else result.append(\"<unset>\");";
+ protected final String TEXT_1203 = NL + "\t\tresult.append(eVirtualGet(";
+ protected final String TEXT_1204 = ", ";
+ protected final String TEXT_1205 = "_DEFAULT_";
+ protected final String TEXT_1206 = "));";
+ protected final String TEXT_1207 = NL + "\t\tresult.append((";
+ protected final String TEXT_1208 = " & ";
+ protected final String TEXT_1209 = "_EFLAG) != 0);";
+ protected final String TEXT_1210 = NL + "\t\tresult.append(";
+ protected final String TEXT_1211 = ");";
+ protected final String TEXT_1212 = NL + "\t\tresult.append(')');" + NL + "\t\treturn result.toString();" + NL + "\t}" + NL;
+ protected final String TEXT_1213 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected int hash = -1;" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + " \t * @generated" + NL + " \t */" + NL + "\tpublic int getHash()" + NL + "\t{" + NL + "\t\tif (hash == -1)" + NL + "\t\t{" + NL + "\t\t\tObject theKey = getKey();" + NL + "\t\t\thash = (theKey == null ? 0 : theKey.hashCode());" + NL + "\t\t}" + NL + "\t\treturn hash;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + " \t * <!-- begin-user-doc -->" + NL + " \t * <!-- end-user-doc -->" + NL + " \t * @generated" + NL + " \t */" + NL + "\tpublic void setHash(int hash)" + NL + "\t{" + NL + "\t\tthis.hash = hash;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + " \t * <!-- begin-user-doc -->" + NL + " \t * <!-- end-user-doc -->" + NL + " \t * @generated" + NL + " \t */" + NL + "\tpublic Object getKey()" + NL + "\t{" + NL + " \t";
+ protected final String TEXT_1214 = NL + "\t\treturn new ";
+ protected final String TEXT_1215 = "(getTypedKey());" + NL + " \t";
+ protected final String TEXT_1216 = NL + "\t\treturn getTypedKey();" + NL + " \t";
+ protected final String TEXT_1217 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void setKey(Object key)" + NL + "\t{";
+ protected final String TEXT_1218 = NL + "\t\tgetTypedKey().addAll((";
+ protected final String TEXT_1219 = ")key);";
+ protected final String TEXT_1220 = NL + "\t\tsetTypedKey(((";
+ protected final String TEXT_1221 = ")key).";
+ protected final String TEXT_1222 = "());";
+ protected final String TEXT_1223 = NL + "\t\tsetTypedKey((";
+ protected final String TEXT_1224 = ")key);";
+ protected final String TEXT_1225 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Object getValue()" + NL + "\t{" + NL + " \t";
+ protected final String TEXT_1226 = NL + "\t\treturn new ";
+ protected final String TEXT_1227 = "(getTypedValue());" + NL + " \t";
+ protected final String TEXT_1228 = NL + "\t\treturn getTypedValue();" + NL + " \t";
+ protected final String TEXT_1229 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Object setValue(Object value)" + NL + "\t{" + NL + "\t\tObject oldValue = getValue();" + NL + " \t";
+ protected final String TEXT_1230 = NL + "\t\tgetTypedValue().clear();" + NL + "\t\tgetTypedValue().addAll((";
+ protected final String TEXT_1231 = ")value);" + NL + " \t";
+ protected final String TEXT_1232 = NL + "\t\tsetTypedValue(((";
+ protected final String TEXT_1233 = ")value).";
+ protected final String TEXT_1234 = "());" + NL + " \t";
+ protected final String TEXT_1235 = NL + "\t\tsetTypedValue((";
+ protected final String TEXT_1236 = ")value);" + NL + " \t";
+ protected final String TEXT_1237 = NL + "\t\treturn oldValue;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
+ protected final String TEXT_1238 = " getEMap()" + NL + "\t{" + NL + "\t\t";
+ protected final String TEXT_1239 = " container = eContainer();" + NL + "\t\treturn container == null ? null : (";
+ protected final String TEXT_1240 = ")container.get(eContainmentFeature());" + NL + "\t}";
+ protected final String TEXT_1241 = NL + "} //";
+ protected final String TEXT_1242 = NL;
+
+ public String generate(Object argument)
+ {
+ final StringBuffer stringBuffer = new StringBuffer();
+
+ GenClass genClass = (GenClass)((Object[])argument)[0]; GenPackage genPackage = genClass.getGenPackage(); GenModel genModel=genPackage.getGenModel();
+ boolean isInterface = Boolean.TRUE.equals(((Object[])argument)[1]); boolean isImplementation = Boolean.TRUE.equals(((Object[])argument)[2]);
+ String publicStaticFinalFlag = isImplementation ? "public static final " : "";
+ stringBuffer.append(TEXT_1);
+ stringBuffer.append(TEXT_2);
+ stringBuffer.append("$");
+ stringBuffer.append(TEXT_3);
+ stringBuffer.append("$");
+ stringBuffer.append(TEXT_4);
+ if (isInterface) {
+ stringBuffer.append(TEXT_5);
+ stringBuffer.append(genPackage.getInterfacePackageName());
+ stringBuffer.append(TEXT_6);
+ } else {
+ stringBuffer.append(TEXT_7);
+ stringBuffer.append(genPackage.getClassPackageName());
+ stringBuffer.append(TEXT_8);
+ }
+ stringBuffer.append(TEXT_9);
+ genModel.markImportLocation(stringBuffer, genPackage);
+ stringBuffer.append(TEXT_10);
+ if (isInterface) {
+ stringBuffer.append(TEXT_11);
+ stringBuffer.append(genClass.getFormattedName());
+ stringBuffer.append(TEXT_12);
+ if (genClass.hasDocumentation()) {
+ stringBuffer.append(TEXT_13);
+ stringBuffer.append(genClass.getDocumentation(genModel.getIndentation(stringBuffer)));
+ stringBuffer.append(TEXT_14);
+ }
+ stringBuffer.append(TEXT_15);
+ if (!genClass.getGenFeatures().isEmpty()) {
+ stringBuffer.append(TEXT_16);
+ for (Iterator i=genClass.getGenFeatures().iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();
+ if (!genFeature.isSuppressedGetVisibility()) {
+ stringBuffer.append(TEXT_17);
+ stringBuffer.append(genClass.getQualifiedInterfaceName());
+ stringBuffer.append(TEXT_18);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_19);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_20);
+ }
+ }
+ stringBuffer.append(TEXT_21);
+ }
+ stringBuffer.append(TEXT_22);
+ if (!genModel.isSuppressEMFMetaData()) {
+ stringBuffer.append(TEXT_23);
+ stringBuffer.append(genPackage.getQualifiedPackageInterfaceName());
+ stringBuffer.append(TEXT_24);
+ stringBuffer.append(genClass.getClassifierAccessorName());
+ stringBuffer.append(TEXT_25);
+ }
+ if (!genModel.isSuppressEMFModelTags()) { boolean first = true; for (StringTokenizer stringTokenizer = new StringTokenizer(genClass.getModelInfo(), "\n\r"); stringTokenizer.hasMoreTokens(); ) { String modelInfo = stringTokenizer.nextToken(); if (first) { first = false;
+ stringBuffer.append(TEXT_26);
+ stringBuffer.append(modelInfo);
+ } else {
+ stringBuffer.append(TEXT_27);
+ stringBuffer.append(modelInfo);
+ }} if (first) {
+ stringBuffer.append(TEXT_28);
+ }}
+ if (genClass.needsRootExtendsInterfaceExtendsTag()) {
+ stringBuffer.append(TEXT_29);
+ stringBuffer.append(genModel.getImportedName(genModel.getRootExtendsInterface()));
+ }
+ stringBuffer.append(TEXT_30);
+ } else {
+ stringBuffer.append(TEXT_31);
+ stringBuffer.append(genClass.getFormattedName());
+ stringBuffer.append(TEXT_32);
+ if (!genClass.getImplementedGenFeatures().isEmpty()) {
+ stringBuffer.append(TEXT_33);
+ for (Iterator i=genClass.getImplementedGenFeatures().iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();
+ stringBuffer.append(TEXT_34);
+ stringBuffer.append(genClass.getQualifiedClassName());
+ stringBuffer.append(TEXT_35);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_36);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_37);
+ }
+ stringBuffer.append(TEXT_38);
+ }
+ stringBuffer.append(TEXT_39);
+ }
+ if (isImplementation) {
+ stringBuffer.append(TEXT_40);
+ if (genClass.isAbstract()) {
+ stringBuffer.append(TEXT_41);
+ }
+ stringBuffer.append(TEXT_42);
+ stringBuffer.append(genClass.getClassName());
+ stringBuffer.append(genClass.getClassExtends());
+ stringBuffer.append(genClass.getClassImplements());
+ } else {
+ stringBuffer.append(TEXT_43);
+ stringBuffer.append(genClass.getInterfaceName());
+ stringBuffer.append(genClass.getInterfaceExtends());
+ }
+ stringBuffer.append(TEXT_44);
+ if (genModel.getCopyrightText() != null) {
+ stringBuffer.append(TEXT_45);
+ stringBuffer.append(publicStaticFinalFlag);
+ stringBuffer.append(genModel.getImportedName("java.lang.String"));
+ stringBuffer.append(TEXT_46);
+ stringBuffer.append(genModel.getCopyrightText());
+ stringBuffer.append(TEXT_47);
+ stringBuffer.append(genModel.getNonNLS());
+ stringBuffer.append(TEXT_48);
+ }
+ if (isImplementation && genModel.getDriverNumber() != null) {
+ stringBuffer.append(TEXT_49);
+ stringBuffer.append(genModel.getImportedName("java.lang.String"));
+ stringBuffer.append(TEXT_50);
+ stringBuffer.append(genModel.getDriverNumber());
+ stringBuffer.append(TEXT_51);
+ stringBuffer.append(genModel.getNonNLS());
+ stringBuffer.append(TEXT_52);
+ }
+ if (isImplementation && genClass.isJavaIOSerializable()) {
+ stringBuffer.append(TEXT_53);
+ }
+ if (isImplementation && genModel.isVirtualDelegation()) { String eVirtualValuesField = genClass.getEVirtualValuesField();
+ if (eVirtualValuesField != null) {
+ stringBuffer.append(TEXT_54);
+ stringBuffer.append(eVirtualValuesField);
+ stringBuffer.append(TEXT_55);
+ }
+ { List eVirtualIndexBitFields = genClass.getEVirtualIndexBitFields(new ArrayList());
+ if (!eVirtualIndexBitFields.isEmpty()) {
+ for (Iterator i = eVirtualIndexBitFields.iterator(); i.hasNext();) { String eVirtualIndexBitField = (String)i.next();
+ stringBuffer.append(TEXT_56);
+ stringBuffer.append(eVirtualIndexBitField);
+ stringBuffer.append(TEXT_57);
+ }
+ }
+ }
+ }
+ if (isImplementation && genClass.isModelRoot() && genModel.isBooleanFlagsEnabled() && genModel.getBooleanFlagsReservedBits() == -1) {
+ stringBuffer.append(TEXT_58);
+ stringBuffer.append(genModel.getBooleanFlagsField());
+ stringBuffer.append(TEXT_59);
+ }
+ if (isImplementation && !genModel.isReflectiveDelegation()) {
+ for (Iterator f=genClass.getAllGenFeatures().iterator(); f.hasNext();) { GenFeature genFeature = (GenFeature)f.next();
+ stringBuffer.append(TEXT_60);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_61);
+ stringBuffer.append(genFeature.getFeatureKind());
+ stringBuffer.append(TEXT_62);
+ String featureValue = "";
+ List allFeatures = genClass.getAllGenFeatures();
+ int g = allFeatures.indexOf(genFeature);
+ GenClass base = genClass.getBaseGenClass();
+ if (base == null)
+ {
+ featureValue = Integer.toString(g);
+ } else {
+ int baseCount = base.getFeatureCount();
+ if (g < baseCount)
+ {
+ featureValue = base.getClassName() + "." + genFeature.getUpperName();
+ } else {
+ String baseCountID = base.getClassName() + "." + "SDO_PROPERTY_COUNT";
+ featureValue = baseCountID + " + " + Integer.toString(g - baseCount);
+ }
+ }
+ stringBuffer.append(TEXT_63);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_64);
+ stringBuffer.append(featureValue);
+ stringBuffer.append(TEXT_65);
+ }
+ stringBuffer.append(TEXT_66);
+ String featureCount = "";
+ GenClass base = genClass.getBaseGenClass();
+ if (base == null)
+ {
+ featureCount = Integer.toString(genClass.getFeatureCount());
+ }
+ else {
+ String baseCountID = base.getClassName() + "." + "SDO_PROPERTY_COUNT";
+ featureCount = baseCountID + " + " + Integer.toString(genClass.getFeatureCount() - base.getFeatureCount());
+ }
+ stringBuffer.append(TEXT_67);
+ stringBuffer.append(featureCount);
+ stringBuffer.append(TEXT_68);
+ for (Iterator i=genClass.getDeclaredFieldGenFeatures().iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();
+ if (genFeature.isListType() || genFeature.isReferenceType()) {
+ if (genClass.isField(genFeature)) {
+ stringBuffer.append(TEXT_69);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_70);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_71);
+ stringBuffer.append(genFeature.getFeatureKind());
+ stringBuffer.append(TEXT_72);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_73);
+ stringBuffer.append(genModel.getImportedName(genFeature.getType()));
+ stringBuffer.append(TEXT_74);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_75);
+ }
+ if (genModel.isArrayAccessors() && !genFeature.isFeatureMapType() && !genFeature.isMapType()) {
+ stringBuffer.append(TEXT_76);
+ stringBuffer.append(genFeature.getGetArrayAccessor());
+ stringBuffer.append(TEXT_77);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_78);
+ stringBuffer.append(genFeature.getGetArrayAccessor());
+ stringBuffer.append(TEXT_79);
+ stringBuffer.append(genFeature.getListItemType());
+ stringBuffer.append(TEXT_80);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_81);
+ stringBuffer.append(genFeature.getListItemType());
+ stringBuffer.append(TEXT_82);
+ }
+ } else {
+ if (!genFeature.isVolatile() || !genModel.isReflectiveDelegation() && (!genFeature.hasDelegateFeature() || !genFeature.isUnsettable())) {
+ stringBuffer.append(TEXT_83);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_84);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_85);
+ stringBuffer.append(genFeature.getFeatureKind());
+ stringBuffer.append(TEXT_86);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_87);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_88);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_89);
+ stringBuffer.append(genFeature.getStaticDefaultValue());
+ stringBuffer.append(TEXT_90);
+ stringBuffer.append(genModel.getNonNLS(genFeature.getStaticDefaultValue()));
+ stringBuffer.append(TEXT_91);
+ }
+ if (genClass.isField(genFeature)) {
+ if (genClass.isFlag(genFeature)) {
+ if (genClass.getFlagIndex(genFeature) > 31 && genClass.getFlagIndex(genFeature) % 32 == 0) {
+ stringBuffer.append(TEXT_92);
+ stringBuffer.append(genClass.getFlagsField(genFeature));
+ stringBuffer.append(TEXT_93);
+ }
+ stringBuffer.append(TEXT_94);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_95);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_96);
+ stringBuffer.append(genFeature.getFeatureKind());
+ stringBuffer.append(TEXT_97);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_98);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_99);
+ stringBuffer.append("<< " + genClass.getFlagIndex(genFeature) % 32 );
+ stringBuffer.append(TEXT_100);
+ } else {
+ stringBuffer.append(TEXT_101);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_102);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_103);
+ stringBuffer.append(genFeature.getFeatureKind());
+ stringBuffer.append(TEXT_104);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_105);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_106);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_107);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_108);
+ }
+ }
+ }
+ if (genClass.isESetField(genFeature)) {
+ if (genClass.isESetFlag(genFeature)) {
+ if (genClass.getESetFlagIndex(genFeature) > 31 && genClass.getESetFlagIndex(genFeature) % 32 == 0) {
+ stringBuffer.append(TEXT_109);
+ stringBuffer.append(genClass.getESetFlagsField(genFeature));
+ stringBuffer.append(TEXT_110);
+ }
+ stringBuffer.append(TEXT_111);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_112);
+ stringBuffer.append(genFeature.getFeatureKind());
+ stringBuffer.append(TEXT_113);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_114);
+ stringBuffer.append("<< " + genClass.getESetFlagIndex(genFeature) % 32 );
+ stringBuffer.append(TEXT_115);
+ } else {
+ stringBuffer.append(TEXT_116);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_117);
+ stringBuffer.append(genFeature.getFeatureKind());
+ stringBuffer.append(TEXT_118);
+ stringBuffer.append(genFeature.getUncapName());
+ stringBuffer.append(TEXT_119);
+ }
+ }
+ }
+ //Class/declaredFieldGenFeature.override.javajetinc
+ }
+ if (isImplementation) {
+ stringBuffer.append(TEXT_120);
+ stringBuffer.append(genClass.getClassName());
+ stringBuffer.append(TEXT_121);
+ for (Iterator i=genClass.getFlagGenFeatures("true").iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();
+ stringBuffer.append(TEXT_122);
+ stringBuffer.append(genClass.getFlagsField(genFeature));
+ stringBuffer.append(TEXT_123);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_124);
+ }
+ stringBuffer.append(TEXT_125);
+ stringBuffer.append(genModel.getImportedName("commonj.sdo.Type"));
+ stringBuffer.append(TEXT_126);
+ stringBuffer.append(genPackage.getImportedFactoryClassName());
+ stringBuffer.append(TEXT_127);
+ stringBuffer.append(genPackage.getImportedFactoryInterfaceName());
+ stringBuffer.append(TEXT_128);
+ stringBuffer.append(genClass.getClassifierAccessorName());
+ stringBuffer.append(TEXT_129);
+ }
+ for (Iterator i=(isImplementation ? genClass.getImplementedGenFeatures() : genClass.getDeclaredGenFeatures()).iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();
+ if (genModel.isArrayAccessors() && genFeature.isListType() && !genFeature.isFeatureMapType() && !genFeature.isMapType()) {
+ stringBuffer.append(TEXT_130);
+ if (!isImplementation) {
+ stringBuffer.append(TEXT_131);
+ stringBuffer.append(genFeature.getListItemType());
+ stringBuffer.append(TEXT_132);
+ stringBuffer.append(genFeature.getGetArrayAccessor());
+ stringBuffer.append(TEXT_133);
+ } else {
+ stringBuffer.append(TEXT_134);
+ stringBuffer.append(genFeature.getListItemType());
+ stringBuffer.append(TEXT_135);
+ stringBuffer.append(genFeature.getGetArrayAccessor());
+ stringBuffer.append(TEXT_136);
+ if (genFeature.isVolatile()) {
+ stringBuffer.append(TEXT_137);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.BasicEList"));
+ stringBuffer.append(TEXT_138);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.BasicEList"));
+ stringBuffer.append(TEXT_139);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_140);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_141);
+ } else {
+ stringBuffer.append(TEXT_142);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_143);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_144);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_145);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.BasicEList"));
+ stringBuffer.append(TEXT_146);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.BasicEList"));
+ stringBuffer.append(TEXT_147);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_148);
+ }
+ stringBuffer.append(TEXT_149);
+ stringBuffer.append(genFeature.getListItemType());
+ stringBuffer.append(TEXT_150);
+ }
+ stringBuffer.append(TEXT_151);
+ if (!isImplementation) {
+ stringBuffer.append(TEXT_152);
+ stringBuffer.append(genFeature.getListItemType());
+ stringBuffer.append(TEXT_153);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_154);
+ } else {
+ stringBuffer.append(TEXT_155);
+ stringBuffer.append(genFeature.getListItemType());
+ stringBuffer.append(TEXT_156);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_157);
+ stringBuffer.append(genFeature.getListItemType());
+ stringBuffer.append(TEXT_158);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_159);
+ }
+ stringBuffer.append(TEXT_160);
+ if (!isImplementation) {
+ stringBuffer.append(TEXT_161);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_162);
+ } else {
+ stringBuffer.append(TEXT_163);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_164);
+ if (genFeature.isVolatile()) {
+ stringBuffer.append(TEXT_165);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_166);
+ } else {
+ stringBuffer.append(TEXT_167);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_168);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_169);
+ }
+ stringBuffer.append(TEXT_170);
+ }
+ stringBuffer.append(TEXT_171);
+ if (!isImplementation) {
+ stringBuffer.append(TEXT_172);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_173);
+ stringBuffer.append(genFeature.getListItemType());
+ stringBuffer.append(TEXT_174);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_175);
+ } else {
+ stringBuffer.append(TEXT_176);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_177);
+ stringBuffer.append(genFeature.getListItemType());
+ stringBuffer.append(TEXT_178);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_179);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.BasicEList"));
+ stringBuffer.append(TEXT_180);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_181);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_182);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_183);
+ }
+ stringBuffer.append(TEXT_184);
+ if (!isImplementation) {
+ stringBuffer.append(TEXT_185);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_186);
+ stringBuffer.append(genFeature.getListItemType());
+ stringBuffer.append(TEXT_187);
+ } else {
+ stringBuffer.append(TEXT_188);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_189);
+ stringBuffer.append(genFeature.getListItemType());
+ stringBuffer.append(TEXT_190);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_191);
+ }
+ }
+ if (genFeature.isGet() && (isImplementation || !genFeature.isSuppressedGetVisibility())) {
+ if (isInterface) {
+ stringBuffer.append(TEXT_192);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_193);
+ stringBuffer.append(genFeature.getFeatureKind());
+ stringBuffer.append(TEXT_194);
+ if (genFeature.isListType()) {
+ if (genFeature.isMapType()) { GenFeature keyFeature = genFeature.getMapEntryTypeGenClass().getMapEntryKeyFeature(); GenFeature valueFeature = genFeature.getMapEntryTypeGenClass().getMapEntryValueFeature();
+ stringBuffer.append(TEXT_195);
+ if (keyFeature.isListType()) {
+ stringBuffer.append(TEXT_196);
+ stringBuffer.append(keyFeature.getQualifiedListItemType());
+ stringBuffer.append(TEXT_197);
+ } else {
+ stringBuffer.append(TEXT_198);
+ stringBuffer.append(keyFeature.getType());
+ stringBuffer.append(TEXT_199);
+ }
+ stringBuffer.append(TEXT_200);
+ if (valueFeature.isListType()) {
+ stringBuffer.append(TEXT_201);
+ stringBuffer.append(valueFeature.getQualifiedListItemType());
+ stringBuffer.append(TEXT_202);
+ } else {
+ stringBuffer.append(TEXT_203);
+ stringBuffer.append(valueFeature.getType());
+ stringBuffer.append(TEXT_204);
+ }
+ stringBuffer.append(TEXT_205);
+ } else if (!genFeature.isWrappedFeatureMapType() && !(genModel.isSuppressEMFMetaData() && "org.eclipse.emf.ecore.EObject".equals(genFeature.getQualifiedListItemType()))) {
+ stringBuffer.append(TEXT_206);
+ stringBuffer.append(genFeature.getQualifiedListItemType());
+ stringBuffer.append(TEXT_207);
+ }
+ } else if (genFeature.isSetDefaultValue()) {
+ stringBuffer.append(TEXT_208);
+ stringBuffer.append(genFeature.getDefaultValue());
+ stringBuffer.append(TEXT_209);
+ }
+ if (genFeature.getTypeGenEnum() != null) {
+ stringBuffer.append(TEXT_210);
+ stringBuffer.append(genFeature.getTypeGenEnum().getQualifiedName());
+ stringBuffer.append(TEXT_211);
+ }
+ if (genFeature.isBidirectional() && !genFeature.getReverse().getGenClass().isMapEntry()) { GenFeature reverseGenFeature = genFeature.getReverse();
+ if (!reverseGenFeature.isSuppressedGetVisibility()) {
+ stringBuffer.append(TEXT_212);
+ stringBuffer.append(reverseGenFeature.getGenClass().getQualifiedInterfaceName());
+ stringBuffer.append(TEXT_213);
+ stringBuffer.append(reverseGenFeature.getGetAccessor());
+ stringBuffer.append(TEXT_214);
+ stringBuffer.append(reverseGenFeature.getFormattedName());
+ stringBuffer.append(TEXT_215);
+ }
+ }
+ stringBuffer.append(TEXT_216);
+ if (!genFeature.hasDocumentation()) {
+ stringBuffer.append(TEXT_217);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_218);
+ stringBuffer.append(genFeature.getFeatureKind());
+ stringBuffer.append(TEXT_219);
+ }
+ stringBuffer.append(TEXT_220);
+ if (genFeature.hasDocumentation()) {
+ stringBuffer.append(TEXT_221);
+ stringBuffer.append(genFeature.getDocumentation(genModel.getIndentation(stringBuffer)));
+ stringBuffer.append(TEXT_222);
+ }
+ stringBuffer.append(TEXT_223);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_224);
+ stringBuffer.append(genFeature.getFeatureKind());
+ stringBuffer.append(TEXT_225);
+ if (genFeature.getTypeGenEnum() != null) {
+ stringBuffer.append(TEXT_226);
+ stringBuffer.append(genFeature.getTypeGenEnum().getQualifiedName());
+ }
+ if (genFeature.isUnsettable()) {
+ if (!genFeature.isSuppressedIsSetVisibility()) {
+ stringBuffer.append(TEXT_227);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_228);
+ }
+ if (genFeature.isChangeable() && !genFeature.isSuppressedUnsetVisibility()) {
+ stringBuffer.append(TEXT_229);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_230);
+ }
+ }
+ if (genFeature.isChangeable() && !genFeature.isListType() && !genFeature.isSuppressedSetVisibility()) {
+ stringBuffer.append(TEXT_231);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_232);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_233);
+ }
+ if (!genModel.isSuppressEMFMetaData()) {
+ stringBuffer.append(TEXT_234);
+ stringBuffer.append(genPackage.getQualifiedPackageInterfaceName());
+ stringBuffer.append(TEXT_235);
+ stringBuffer.append(genFeature.getFeatureAccessorName());
+ stringBuffer.append(TEXT_236);
+ }
+ if (genFeature.isBidirectional() && !genFeature.getReverse().getGenClass().isMapEntry()) { GenFeature reverseGenFeature = genFeature.getReverse();
+ if (!reverseGenFeature.isSuppressedGetVisibility()) {
+ stringBuffer.append(TEXT_237);
+ stringBuffer.append(reverseGenFeature.getGenClass().getQualifiedInterfaceName());
+ stringBuffer.append(TEXT_238);
+ stringBuffer.append(reverseGenFeature.getGetAccessor());
+ }
+ }
+ if (!genModel.isSuppressEMFModelTags()) { boolean first = true; for (StringTokenizer stringTokenizer = new StringTokenizer(genFeature.getModelInfo(), "\n\r"); stringTokenizer.hasMoreTokens(); ) { String modelInfo = stringTokenizer.nextToken(); if (first) { first = false;
+ stringBuffer.append(TEXT_239);
+ stringBuffer.append(modelInfo);
+ } else {
+ stringBuffer.append(TEXT_240);
+ stringBuffer.append(modelInfo);
+ }} if (first) {
+ stringBuffer.append(TEXT_241);
+ }}
+ stringBuffer.append(TEXT_242);
+ } else {
+ stringBuffer.append(TEXT_243);
+ }
+ if (!isImplementation) {
+ stringBuffer.append(TEXT_244);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_245);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_246);
+ } else {
+ stringBuffer.append(TEXT_247);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_248);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_249);
+ if (genModel.isReflectiveDelegation()) {
+ stringBuffer.append(TEXT_250);
+ if (genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_251);
+ }
+ stringBuffer.append(TEXT_252);
+ stringBuffer.append(genFeature.getObjectType());
+ stringBuffer.append(TEXT_253);
+ stringBuffer.append(genFeature.getQualifiedFeatureAccessor());
+ stringBuffer.append(TEXT_254);
+ if (genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_255);
+ stringBuffer.append(genFeature.getPrimitiveValueFunction());
+ stringBuffer.append(TEXT_256);
+ }
+ stringBuffer.append(TEXT_257);
+ } else if (!genFeature.isVolatile()) {
+ if (genFeature.isListType()) {
+ if (genModel.isVirtualDelegation()) {
+ stringBuffer.append(TEXT_258);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_259);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_260);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_261);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_262);
+ }
+ stringBuffer.append(TEXT_263);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_264);
+ if (genModel.isVirtualDelegation()) {
+ stringBuffer.append(TEXT_265);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_266);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_267);
+ stringBuffer.append(genClass.getListConstructor(genFeature));
+ stringBuffer.append(TEXT_268);
+ } else {
+ if (genFeature.getType().equals("commonj.sdo.Sequence")){
+ stringBuffer.append(TEXT_269);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_270);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_271);
+ } else {
+ stringBuffer.append(TEXT_272);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_273);
+ stringBuffer.append(genFeature.getListItemType());
+ stringBuffer.append(TEXT_274);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_275);
+ }}
+ stringBuffer.append(TEXT_276);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(genFeature.isMapType() && genFeature.isEffectiveSuppressEMFTypes() ? ".map()" : "");
+ stringBuffer.append(TEXT_277);
+ } else if (genFeature.isContainer()) {
+ stringBuffer.append(TEXT_278);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_279);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_280);
+ } else {
+ if (genFeature.isResolveProxies()) {
+ if (genModel.isVirtualDelegation()) {
+ stringBuffer.append(TEXT_281);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_282);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_283);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_284);
+ stringBuffer.append(genFeature.getUpperName());
+ if (!genFeature.isReferenceType()) {
+ stringBuffer.append(TEXT_285);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_286);
+ }
+ stringBuffer.append(TEXT_287);
+ }
+ stringBuffer.append(TEXT_288);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_289);
+ stringBuffer.append(genFeature.getSafeNameAsEObject());
+ stringBuffer.append(TEXT_290);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject"));
+ stringBuffer.append(TEXT_291);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_292);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject"));
+ stringBuffer.append(TEXT_293);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_294);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_295);
+ stringBuffer.append(genFeature.getNonEObjectInternalTypeCast());
+ stringBuffer.append(TEXT_296);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_297);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_298);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_299);
+ if (genFeature.isEffectiveContains()) {
+ stringBuffer.append(TEXT_300);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject"));
+ stringBuffer.append(TEXT_301);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_302);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject"));
+ stringBuffer.append(TEXT_303);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_304);
+ if (!genFeature.isBidirectional()) {
+ stringBuffer.append(TEXT_305);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_306);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_307);
+ } else { GenFeature reverseFeature = genFeature.getReverse(); GenClass targetClass = reverseFeature.getGenClass();
+ stringBuffer.append(TEXT_308);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.notify.ChangeContext"));
+ stringBuffer.append(TEXT_309);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_310);
+ stringBuffer.append(targetClass.getQualifiedFeatureID(reverseFeature));
+ stringBuffer.append(TEXT_311);
+ stringBuffer.append(targetClass.getImportedInterfaceName());
+ stringBuffer.append(TEXT_312);
+ }
+ stringBuffer.append(TEXT_313);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_314);
+ if (!genFeature.isBidirectional()) {
+ stringBuffer.append(TEXT_315);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_316);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_317);
+ } else { GenFeature reverseFeature = genFeature.getReverse(); GenClass targetClass = reverseFeature.getGenClass();
+ stringBuffer.append(TEXT_318);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_319);
+ stringBuffer.append(targetClass.getQualifiedFeatureID(reverseFeature));
+ stringBuffer.append(TEXT_320);
+ stringBuffer.append(targetClass.getImportedInterfaceName());
+ stringBuffer.append(TEXT_321);
+ }
+ stringBuffer.append(TEXT_322);
+ } else if (genModel.isVirtualDelegation()) {
+ stringBuffer.append(TEXT_323);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_324);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_325);
+ }
+ if (!genModel.isSuppressNotification()) {
+ stringBuffer.append(TEXT_326);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_327);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_328);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_329);
+ }
+ stringBuffer.append(TEXT_330);
+ }
+ if (!genFeature.isResolveProxies() && genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_331);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_332);
+ stringBuffer.append(genFeature.getUpperName());
+ if (!genFeature.isReferenceType()) {
+ stringBuffer.append(TEXT_333);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_334);
+ }
+ stringBuffer.append(TEXT_335);
+ } else if (genClass.isFlag(genFeature)) {
+ stringBuffer.append(TEXT_336);
+ stringBuffer.append(genClass.getFlagsField(genFeature));
+ stringBuffer.append(TEXT_337);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_338);
+ } else {
+ stringBuffer.append(TEXT_339);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_340);
+ }
+ }
+ } else {//volatile
+ if (genFeature.isResolveProxies() && !genFeature.isListType()) {
+ stringBuffer.append(TEXT_341);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_342);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_343);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_344);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_345);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_346);
+ stringBuffer.append(genFeature.getNonEObjectInternalTypeCast());
+ stringBuffer.append(TEXT_347);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject"));
+ stringBuffer.append(TEXT_348);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_349);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_350);
+ } else if (genFeature.hasDelegateFeature()) { GenFeature delegateFeature = genFeature.getDelegateFeature();
+ if (genFeature.isFeatureMapType()) {
+ if (delegateFeature.isWrappedFeatureMapType()) {
+ stringBuffer.append(TEXT_351);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_352);
+ stringBuffer.append(delegateFeature.getAccessorName());
+ stringBuffer.append(TEXT_353);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_354);
+ } else {
+ stringBuffer.append(TEXT_355);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap"));
+ stringBuffer.append(TEXT_356);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap"));
+ stringBuffer.append(TEXT_357);
+ stringBuffer.append(delegateFeature.getAccessorName());
+ stringBuffer.append(TEXT_358);
+ stringBuffer.append(genFeature.getQualifiedFeatureAccessor());
+ stringBuffer.append(TEXT_359);
+ }
+ } else if (genFeature.isListType()) {
+ if (delegateFeature.isWrappedFeatureMapType()) {
+ stringBuffer.append(TEXT_360);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_361);
+ stringBuffer.append(delegateFeature.getAccessorName());
+ stringBuffer.append(TEXT_362);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_363);
+ } else {
+ stringBuffer.append(TEXT_364);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap"));
+ stringBuffer.append(TEXT_365);
+ stringBuffer.append(delegateFeature.getAccessorName());
+ stringBuffer.append(TEXT_366);
+ stringBuffer.append(genFeature.getQualifiedFeatureAccessor());
+ stringBuffer.append(TEXT_367);
+ }
+ } else {
+ if (delegateFeature.isWrappedFeatureMapType()) {
+ stringBuffer.append(TEXT_368);
+ if (genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_369);
+ }
+ stringBuffer.append(TEXT_370);
+ stringBuffer.append(genFeature.getObjectType());
+ stringBuffer.append(TEXT_371);
+ stringBuffer.append(delegateFeature.getAccessorName());
+ stringBuffer.append(TEXT_372);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_373);
+ if (genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_374);
+ stringBuffer.append(genFeature.getPrimitiveValueFunction());
+ stringBuffer.append(TEXT_375);
+ }
+ stringBuffer.append(TEXT_376);
+ } else {
+ stringBuffer.append(TEXT_377);
+ if (genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_378);
+ }
+ stringBuffer.append(TEXT_379);
+ stringBuffer.append(genFeature.getObjectType());
+ stringBuffer.append(TEXT_380);
+ stringBuffer.append(delegateFeature.getAccessorName());
+ stringBuffer.append(TEXT_381);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_382);
+ if (genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_383);
+ stringBuffer.append(genFeature.getPrimitiveValueFunction());
+ stringBuffer.append(TEXT_384);
+ }
+ stringBuffer.append(TEXT_385);
+ }
+ }
+ } else {
+ stringBuffer.append(TEXT_386);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_387);
+ stringBuffer.append(genFeature.getFeatureKind());
+ stringBuffer.append(TEXT_388);
+ //Class/getGenFeature.todo.override.javajetinc
+ }
+ }
+ stringBuffer.append(TEXT_389);
+ }
+ //Class/getGenFeature.override.javajetinc
+ }
+ if (isImplementation && !genModel.isReflectiveDelegation() && genFeature.isBasicGet()) {
+ stringBuffer.append(TEXT_390);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_391);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_392);
+ if (genFeature.isContainer()) {
+ stringBuffer.append(TEXT_393);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_394);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_395);
+ } else if (!genFeature.isVolatile()) {
+ if (genModel.isVirtualDelegation()) {
+ stringBuffer.append(TEXT_396);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_397);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_398);
+ } else {
+ stringBuffer.append(TEXT_399);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_400);
+ }
+ } else if (genFeature.hasDelegateFeature()) { GenFeature delegateFeature = genFeature.getDelegateFeature();
+ if (delegateFeature.isWrappedFeatureMapType()) {
+ stringBuffer.append(TEXT_401);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_402);
+ stringBuffer.append(delegateFeature.getAccessorName());
+ stringBuffer.append(TEXT_403);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_404);
+ } else {
+ stringBuffer.append(TEXT_405);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_406);
+ stringBuffer.append(delegateFeature.getAccessorName());
+ stringBuffer.append(TEXT_407);
+ stringBuffer.append(genFeature.getQualifiedFeatureAccessor());
+ stringBuffer.append(TEXT_408);
+ }
+ } else {
+ stringBuffer.append(TEXT_409);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_410);
+ stringBuffer.append(genFeature.getFeatureKind());
+ stringBuffer.append(TEXT_411);
+ //Class/basicGetGenFeature.todo.override.javajetinc
+ }
+ stringBuffer.append(TEXT_412);
+ //Class/basicGetGenFeature.override.javajetinc
+ }
+ if (isImplementation && !genModel.isReflectiveDelegation() && genFeature.isBasicSet()) {
+ stringBuffer.append(TEXT_413);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_414);
+ stringBuffer.append(genFeature.getImportedInternalType());
+ stringBuffer.append(TEXT_415);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_416);
+ if (!genFeature.isVolatile()) {
+ if (genModel.isVirtualDelegation()) {
+ stringBuffer.append(TEXT_417);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_418);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_419);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_420);
+ } else {
+ stringBuffer.append(TEXT_421);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_422);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_423);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_424);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_425);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_426);
+ }
+ if (genFeature.isUnsettable()) {
+ if (genModel.isVirtualDelegation()) {
+ stringBuffer.append(TEXT_427);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_428);
+ } else if (genClass.isESetFlag(genFeature)) {
+ stringBuffer.append(TEXT_429);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_430);
+ stringBuffer.append(genClass.getESetFlagsField(genFeature));
+ stringBuffer.append(TEXT_431);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_432);
+ stringBuffer.append(genClass.getESetFlagsField(genFeature));
+ stringBuffer.append(TEXT_433);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_434);
+ } else {
+ stringBuffer.append(TEXT_435);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_436);
+ stringBuffer.append(genFeature.getUncapName());
+ stringBuffer.append(TEXT_437);
+ stringBuffer.append(genFeature.getUncapName());
+ stringBuffer.append(TEXT_438);
+ }
+ }
+ if (!genModel.isSuppressNotification()) {
+ stringBuffer.append(TEXT_439);
+ if (genFeature.isUnsettable()) {
+ stringBuffer.append(TEXT_440);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_441);
+ if (genModel.isVirtualDelegation()) {
+ stringBuffer.append(TEXT_442);
+ stringBuffer.append(genFeature.getCapName());
+ } else {
+ stringBuffer.append(TEXT_443);
+ stringBuffer.append(genFeature.getCapName());
+ }
+ stringBuffer.append(TEXT_444);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_445);
+ if (genModel.isVirtualDelegation()) {
+ stringBuffer.append(TEXT_446);
+ } else {
+ stringBuffer.append(TEXT_447);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_448);
+ }
+ stringBuffer.append(TEXT_449);
+ } else {
+ stringBuffer.append(TEXT_450);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_451);
+ if (genModel.isVirtualDelegation()) {
+ stringBuffer.append(TEXT_452);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_453);
+ stringBuffer.append(genFeature.getCapName());
+ } else {
+ stringBuffer.append(TEXT_454);
+ stringBuffer.append(genFeature.getCapName());
+ }
+ stringBuffer.append(TEXT_455);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_456);
+ }
+ stringBuffer.append(TEXT_457);
+ }
+ stringBuffer.append(TEXT_458);
+ } else if (genFeature.hasDelegateFeature()) { GenFeature delegateFeature = genFeature.getDelegateFeature();
+ if (delegateFeature.isWrappedFeatureMapType()) {
+ stringBuffer.append(TEXT_459);
+ stringBuffer.append(delegateFeature.getAccessorName());
+ stringBuffer.append(TEXT_460);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_461);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_462);
+ } else {
+ stringBuffer.append(TEXT_463);
+ stringBuffer.append(delegateFeature.getAccessorName());
+ stringBuffer.append(TEXT_464);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_465);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_466);
+ }
+ } else {
+ stringBuffer.append(TEXT_467);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_468);
+ stringBuffer.append(genFeature.getFeatureKind());
+ stringBuffer.append(TEXT_469);
+ //Class/basicSetGenFeature.todo.override.javajetinc
+ }
+ stringBuffer.append(TEXT_470);
+ //Class/basicSetGenFeature.override.javajetinc
+ }
+ if (genFeature.isSet() && (isImplementation || !genFeature.isSuppressedSetVisibility())) {
+ if (isInterface) {
+ stringBuffer.append(TEXT_471);
+ stringBuffer.append(genClass.getQualifiedInterfaceName());
+ stringBuffer.append(TEXT_472);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_473);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_474);
+ stringBuffer.append(genFeature.getFeatureKind());
+ stringBuffer.append(TEXT_475);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_476);
+ stringBuffer.append(genFeature.getFeatureKind());
+ stringBuffer.append(TEXT_477);
+ if (genFeature.isEnumType()) {
+ stringBuffer.append(TEXT_478);
+ stringBuffer.append(genFeature.getTypeGenEnum().getQualifiedName());
+ }
+ if (genFeature.isUnsettable()) {
+ if (!genFeature.isSuppressedIsSetVisibility()) {
+ stringBuffer.append(TEXT_479);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_480);
+ }
+ if (!genFeature.isSuppressedUnsetVisibility()) {
+ stringBuffer.append(TEXT_481);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_482);
+ }
+ }
+ stringBuffer.append(TEXT_483);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_484);
+ } else {
+ stringBuffer.append(TEXT_485);
+ }
+ if (!isImplementation) {
+ stringBuffer.append(TEXT_486);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_487);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_488);
+ } else {
+ stringBuffer.append(TEXT_489);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_490);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_491);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_492);
+ if (genModel.isReflectiveDelegation()) {
+ stringBuffer.append(TEXT_493);
+ stringBuffer.append(genFeature.getQualifiedFeatureAccessor());
+ stringBuffer.append(TEXT_494);
+ if (genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_495);
+ stringBuffer.append(genFeature.getObjectType());
+ stringBuffer.append(TEXT_496);
+ }
+ stringBuffer.append(TEXT_497);
+ stringBuffer.append(genFeature.getCapName());
+ if (genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_498);
+ }
+ stringBuffer.append(TEXT_499);
+ } else if (!genFeature.isVolatile()) {
+ if (genFeature.isContainer()) { GenFeature reverseFeature = genFeature.getReverse(); GenClass targetClass = reverseFeature.getGenClass();
+ stringBuffer.append(TEXT_500);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_501);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_502);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_503);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.EcoreUtil"));
+ stringBuffer.append(TEXT_504);
+ stringBuffer.append(genFeature.getEObjectCast());
+ stringBuffer.append(TEXT_505);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_506);
+ stringBuffer.append(genModel.getImportedName("java.lang.IllegalArgumentException"));
+ stringBuffer.append(TEXT_507);
+ stringBuffer.append(genModel.getNonNLS());
+ stringBuffer.append(TEXT_508);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_509);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject"));
+ stringBuffer.append(TEXT_510);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_511);
+ stringBuffer.append(targetClass.getQualifiedFeatureID(reverseFeature));
+ stringBuffer.append(TEXT_512);
+ stringBuffer.append(targetClass.getImportedInterfaceName());
+ stringBuffer.append(TEXT_513);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject"));
+ stringBuffer.append(TEXT_514);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_515);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_516);
+ if (!genModel.isSuppressNotification()) {
+ stringBuffer.append(TEXT_517);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_518);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_519);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_520);
+ }
+ } else if (genFeature.isBidirectional() || genFeature.isEffectiveContains()) {
+ if (genModel.isVirtualDelegation()) {
+ stringBuffer.append(TEXT_521);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_522);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_523);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_524);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_525);
+ }
+ stringBuffer.append(TEXT_526);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_527);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_528);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_529);
+ if (!genFeature.isBidirectional()) {
+ stringBuffer.append(TEXT_530);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_531);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_532);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_533);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_534);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_535);
+ } else { GenFeature reverseFeature = genFeature.getReverse(); GenClass targetClass = reverseFeature.getGenClass();
+ stringBuffer.append(TEXT_536);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_537);
+ stringBuffer.append(targetClass.getQualifiedFeatureID(reverseFeature));
+ stringBuffer.append(TEXT_538);
+ stringBuffer.append(targetClass.getImportedInterfaceName());
+ stringBuffer.append(TEXT_539);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_540);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_541);
+ stringBuffer.append(targetClass.getQualifiedFeatureID(reverseFeature));
+ stringBuffer.append(TEXT_542);
+ stringBuffer.append(targetClass.getImportedInterfaceName());
+ stringBuffer.append(TEXT_543);
+ }
+ stringBuffer.append(TEXT_544);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_545);
+ stringBuffer.append(genFeature.getInternalTypeCast());
+ stringBuffer.append(TEXT_546);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_547);
+ if (genFeature.isUnsettable()) {
+ stringBuffer.append(TEXT_548);
+ if (genModel.isVirtualDelegation()) {
+ stringBuffer.append(TEXT_549);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_550);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_551);
+ } else if (genClass.isESetFlag(genFeature)) {
+ if (!genModel.isSuppressNotification()) {
+ stringBuffer.append(TEXT_552);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_553);
+ stringBuffer.append(genClass.getESetFlagsField(genFeature));
+ stringBuffer.append(TEXT_554);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_555);
+ }
+ stringBuffer.append(TEXT_556);
+ stringBuffer.append(genClass.getESetFlagsField(genFeature));
+ stringBuffer.append(TEXT_557);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_558);
+ } else {
+ if (!genModel.isSuppressNotification()) {
+ stringBuffer.append(TEXT_559);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_560);
+ stringBuffer.append(genFeature.getUncapName());
+ stringBuffer.append(TEXT_561);
+ }
+ stringBuffer.append(TEXT_562);
+ stringBuffer.append(genFeature.getUncapName());
+ stringBuffer.append(TEXT_563);
+ }
+ if (!genModel.isSuppressNotification()) {
+ stringBuffer.append(TEXT_564);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_565);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_566);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_567);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_568);
+ }
+ stringBuffer.append(TEXT_569);
+ } else {
+ if (!genModel.isSuppressNotification()) {
+ stringBuffer.append(TEXT_570);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_571);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_572);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_573);
+ }
+ }
+ } else {
+ if (genClass.isFlag(genFeature)) {
+ if (!genModel.isSuppressNotification()) {
+ stringBuffer.append(TEXT_574);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_575);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_576);
+ stringBuffer.append(genClass.getFlagsField(genFeature));
+ stringBuffer.append(TEXT_577);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_578);
+ }
+ stringBuffer.append(TEXT_579);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_580);
+ stringBuffer.append(genClass.getFlagsField(genFeature));
+ stringBuffer.append(TEXT_581);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_582);
+ stringBuffer.append(genClass.getFlagsField(genFeature));
+ stringBuffer.append(TEXT_583);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_584);
+ } else {
+ if (!genModel.isVirtualDelegation() || genFeature.isPrimitiveType()) {
+ if (!genModel.isSuppressNotification()) {
+ stringBuffer.append(TEXT_585);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_586);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_587);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_588);
+ }
+ }
+ if (genFeature.isEnumType()) {
+ if (genModel.isVirtualDelegation()) {
+ stringBuffer.append(TEXT_589);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_590);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_591);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_592);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_593);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_594);
+ } else {
+ stringBuffer.append(TEXT_595);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_596);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_597);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_598);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_599);
+ }
+ } else {
+ if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_600);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_601);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_602);
+ stringBuffer.append(genFeature.getInternalTypeCast());
+ stringBuffer.append(TEXT_603);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_604);
+ } else {
+ stringBuffer.append(TEXT_605);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_606);
+ stringBuffer.append(genFeature.getInternalTypeCast());
+ stringBuffer.append(TEXT_607);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_608);
+ }
+ }
+ if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_609);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_610);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_611);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_612);
+ }
+ }
+ if (genFeature.isUnsettable()) {
+ if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_613);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_614);
+ } else if (genClass.isESetFlag(genFeature)) {
+ if (!genModel.isSuppressNotification()) {
+ stringBuffer.append(TEXT_615);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_616);
+ stringBuffer.append(genClass.getESetFlagsField(genFeature));
+ stringBuffer.append(TEXT_617);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_618);
+ }
+ stringBuffer.append(TEXT_619);
+ stringBuffer.append(genClass.getESetFlagsField(genFeature));
+ stringBuffer.append(TEXT_620);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_621);
+ } else {
+ if (!genModel.isSuppressNotification()) {
+ stringBuffer.append(TEXT_622);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_623);
+ stringBuffer.append(genFeature.getUncapName());
+ stringBuffer.append(TEXT_624);
+ }
+ stringBuffer.append(TEXT_625);
+ stringBuffer.append(genFeature.getUncapName());
+ stringBuffer.append(TEXT_626);
+ }
+ if (!genModel.isSuppressNotification()) {
+ stringBuffer.append(TEXT_627);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_628);
+ if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_629);
+ if (genFeature.isReferenceType()) {
+ stringBuffer.append(TEXT_630);
+ } else {
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_631);
+ }
+ stringBuffer.append(TEXT_632);
+ stringBuffer.append(genFeature.getCapName());
+ } else {
+ stringBuffer.append(TEXT_633);
+ stringBuffer.append(genFeature.getCapName());
+ }
+ stringBuffer.append(TEXT_634);
+ if (genClass.isFlag(genFeature)) {
+ stringBuffer.append(TEXT_635);
+ stringBuffer.append(genFeature.getCapName());
+ } else {
+ stringBuffer.append(genFeature.getSafeName());
+ }
+ stringBuffer.append(TEXT_636);
+ if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_637);
+ } else {
+ stringBuffer.append(TEXT_638);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_639);
+ }
+ stringBuffer.append(TEXT_640);
+ }
+ } else {
+ if (!genModel.isSuppressNotification()) {
+ stringBuffer.append(TEXT_641);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_642);
+ if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_643);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_644);
+ if (genFeature.isReferenceType()) {
+ stringBuffer.append(TEXT_645);
+ } else {
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_646);
+ }
+ stringBuffer.append(TEXT_647);
+ stringBuffer.append(genFeature.getCapName());
+ } else {
+ stringBuffer.append(TEXT_648);
+ stringBuffer.append(genFeature.getCapName());
+ }
+ stringBuffer.append(TEXT_649);
+ if (genClass.isFlag(genFeature)) {
+ stringBuffer.append(TEXT_650);
+ stringBuffer.append(genFeature.getCapName());
+ } else {
+ stringBuffer.append(genFeature.getSafeName());
+ }
+ stringBuffer.append(TEXT_651);
+ }
+ }
+ }
+ } else if (genFeature.hasDelegateFeature()) { GenFeature delegateFeature = genFeature.getDelegateFeature();
+ if (delegateFeature.isWrappedFeatureMapType()) {
+ stringBuffer.append(TEXT_652);
+ stringBuffer.append(delegateFeature.getAccessorName());
+ stringBuffer.append(TEXT_653);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_654);
+ if (genFeature.isPrimitiveType()){
+ stringBuffer.append(TEXT_655);
+ stringBuffer.append(genFeature.getObjectType());
+ stringBuffer.append(TEXT_656);
+ }
+ stringBuffer.append(TEXT_657);
+ stringBuffer.append(genFeature.getCapName());
+ if (genFeature.isPrimitiveType()){
+ stringBuffer.append(TEXT_658);
+ }
+ stringBuffer.append(TEXT_659);
+ } else {
+ stringBuffer.append(TEXT_660);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap"));
+ stringBuffer.append(TEXT_661);
+ stringBuffer.append(delegateFeature.getAccessorName());
+ stringBuffer.append(TEXT_662);
+ stringBuffer.append(genFeature.getQualifiedFeatureAccessor());
+ stringBuffer.append(TEXT_663);
+ if (genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_664);
+ stringBuffer.append(genFeature.getObjectType());
+ stringBuffer.append(TEXT_665);
+ }
+ stringBuffer.append(TEXT_666);
+ stringBuffer.append(genFeature.getCapName());
+ if (genFeature.isPrimitiveType()){
+ stringBuffer.append(TEXT_667);
+ }
+ stringBuffer.append(TEXT_668);
+ }
+ } else {
+ stringBuffer.append(TEXT_669);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_670);
+ stringBuffer.append(genFeature.getFeatureKind());
+ stringBuffer.append(TEXT_671);
+ //Class/setGenFeature.todo.override.javajetinc
+ }
+ stringBuffer.append(TEXT_672);
+ }
+ //Class/setGenFeature.override.javajetinc
+ }
+ if (isImplementation && !genModel.isReflectiveDelegation() && genFeature.isBasicUnset()) {
+ stringBuffer.append(TEXT_673);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_674);
+ if (!genFeature.isVolatile()) {
+ if (genModel.isVirtualDelegation()) {
+ stringBuffer.append(TEXT_675);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_676);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_677);
+ } else {
+ stringBuffer.append(TEXT_678);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_679);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_680);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_681);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_682);
+ }
+ if (genModel.isVirtualDelegation()) {
+ stringBuffer.append(TEXT_683);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_684);
+ } else if (genClass.isESetFlag(genFeature)) {
+ stringBuffer.append(TEXT_685);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_686);
+ stringBuffer.append(genClass.getESetFlagsField(genFeature));
+ stringBuffer.append(TEXT_687);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_688);
+ stringBuffer.append(genClass.getESetFlagsField(genFeature));
+ stringBuffer.append(TEXT_689);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_690);
+ } else {
+ stringBuffer.append(TEXT_691);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_692);
+ stringBuffer.append(genFeature.getUncapName());
+ stringBuffer.append(TEXT_693);
+ stringBuffer.append(genFeature.getUncapName());
+ stringBuffer.append(TEXT_694);
+ }
+ if (!genModel.isSuppressNotification()) {
+ stringBuffer.append(TEXT_695);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.impl.ENotificationImpl"));
+ stringBuffer.append(TEXT_696);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.impl.ENotificationImpl"));
+ stringBuffer.append(TEXT_697);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.notify.Notification"));
+ stringBuffer.append(TEXT_698);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_699);
+ if (genModel.isVirtualDelegation()) {
+ stringBuffer.append(TEXT_700);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_701);
+ } else {
+ stringBuffer.append(TEXT_702);
+ stringBuffer.append(genFeature.getCapName());
+ }
+ stringBuffer.append(TEXT_703);
+ if (genModel.isVirtualDelegation()) {
+ stringBuffer.append(TEXT_704);
+ } else {
+ stringBuffer.append(TEXT_705);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_706);
+ }
+ stringBuffer.append(TEXT_707);
+ }
+ } else {
+ stringBuffer.append(TEXT_708);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_709);
+ stringBuffer.append(genFeature.getFeatureKind());
+ stringBuffer.append(TEXT_710);
+ //Class/basicUnsetGenFeature.todo.override.javajetinc
+ }
+ stringBuffer.append(TEXT_711);
+ //Class.basicUnsetGenFeature.override.javajetinc
+ }
+ if (genFeature.isUnset() && (isImplementation || !genFeature.isSuppressedUnsetVisibility())) {
+ if (isInterface) {
+ stringBuffer.append(TEXT_712);
+ stringBuffer.append(genClass.getQualifiedInterfaceName());
+ stringBuffer.append(TEXT_713);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_714);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_715);
+ stringBuffer.append(genFeature.getFeatureKind());
+ stringBuffer.append(TEXT_716);
+ if (!genFeature.isSuppressedIsSetVisibility()) {
+ stringBuffer.append(TEXT_717);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_718);
+ }
+ stringBuffer.append(TEXT_719);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_720);
+ if (!genFeature.isListType() && !genFeature.isSuppressedSetVisibility()) {
+ stringBuffer.append(TEXT_721);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_722);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_723);
+ }
+ stringBuffer.append(TEXT_724);
+ } else {
+ stringBuffer.append(TEXT_725);
+ }
+ if (!isImplementation) {
+ stringBuffer.append(TEXT_726);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_727);
+ } else {
+ stringBuffer.append(TEXT_728);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_729);
+ if (genModel.isReflectiveDelegation()) {
+ stringBuffer.append(TEXT_730);
+ stringBuffer.append(genFeature.getQualifiedFeatureAccessor());
+ stringBuffer.append(TEXT_731);
+ } else if (!genFeature.isVolatile()) {
+ if (genFeature.isListType()) {
+ stringBuffer.append(TEXT_732);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.InternalEList"));
+ stringBuffer.append(TEXT_733);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_734);
+ } else if (genFeature.isBidirectional() || genFeature.isEffectiveContains()) {
+ if (genModel.isVirtualDelegation()) {
+ stringBuffer.append(TEXT_735);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_736);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_737);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_738);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_739);
+ }
+ stringBuffer.append(TEXT_740);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_741);
+ if (!genFeature.isBidirectional()) {
+ stringBuffer.append(TEXT_742);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject"));
+ stringBuffer.append(TEXT_743);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_744);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_745);
+ } else { GenFeature reverseFeature = genFeature.getReverse(); GenClass targetClass = reverseFeature.getGenClass();
+ stringBuffer.append(TEXT_746);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject"));
+ stringBuffer.append(TEXT_747);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_748);
+ stringBuffer.append(targetClass.getQualifiedFeatureID(reverseFeature));
+ stringBuffer.append(TEXT_749);
+ stringBuffer.append(targetClass.getImportedInterfaceName());
+ stringBuffer.append(TEXT_750);
+ }
+ stringBuffer.append(TEXT_751);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_752);
+ if (genModel.isVirtualDelegation()) {
+ stringBuffer.append(TEXT_753);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_754);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_755);
+ } else if (genClass.isESetFlag(genFeature)) {
+ if (!genModel.isSuppressNotification()) {
+ stringBuffer.append(TEXT_756);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_757);
+ stringBuffer.append(genClass.getESetFlagsField(genFeature));
+ stringBuffer.append(TEXT_758);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_759);
+ }
+ stringBuffer.append(TEXT_760);
+ stringBuffer.append(genClass.getESetFlagsField(genFeature));
+ stringBuffer.append(TEXT_761);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_762);
+ } else {
+ if (!genModel.isSuppressNotification()) {
+ stringBuffer.append(TEXT_763);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_764);
+ stringBuffer.append(genFeature.getUncapName());
+ stringBuffer.append(TEXT_765);
+ }
+ stringBuffer.append(TEXT_766);
+ stringBuffer.append(genFeature.getUncapName());
+ stringBuffer.append(TEXT_767);
+ }
+ if (!genModel.isSuppressNotification()) {
+ stringBuffer.append(TEXT_768);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_769);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_770);
+ }
+ stringBuffer.append(TEXT_771);
+ } else {
+ if (genClass.isFlag(genFeature)) {
+ if (!genModel.isSuppressNotification()) {
+ stringBuffer.append(TEXT_772);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_773);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_774);
+ stringBuffer.append(genClass.getFlagsField(genFeature));
+ stringBuffer.append(TEXT_775);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_776);
+ }
+ } else if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_777);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_778);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_779);
+ } else {
+ if (!genModel.isSuppressNotification()) {
+ stringBuffer.append(TEXT_780);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_781);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_782);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_783);
+ }
+ }
+ if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_784);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_785);
+ } else if (genClass.isESetFlag(genFeature)) {
+ stringBuffer.append(TEXT_786);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_787);
+ stringBuffer.append(genClass.getESetFlagsField(genFeature));
+ stringBuffer.append(TEXT_788);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_789);
+ } else {
+ if (!genModel.isSuppressNotification()) {
+ stringBuffer.append(TEXT_790);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_791);
+ stringBuffer.append(genFeature.getUncapName());
+ stringBuffer.append(TEXT_792);
+ }
+ }
+ if (genFeature.isReferenceType()) {
+ stringBuffer.append(TEXT_793);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_794);
+ if (!genModel.isVirtualDelegation()) {
+ if (genClass.isESetFlag(genFeature)) {
+ stringBuffer.append(TEXT_795);
+ stringBuffer.append(genClass.getESetFlagsField(genFeature));
+ stringBuffer.append(TEXT_796);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_797);
+ } else {
+ stringBuffer.append(TEXT_798);
+ stringBuffer.append(genFeature.getUncapName());
+ stringBuffer.append(TEXT_799);
+ }
+ }
+ if (!genModel.isSuppressNotification()) {
+ stringBuffer.append(TEXT_800);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_801);
+ if (genModel.isVirtualDelegation()) {
+ stringBuffer.append(TEXT_802);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_803);
+ } else {
+ stringBuffer.append(TEXT_804);
+ stringBuffer.append(genFeature.getCapName());
+ }
+ stringBuffer.append(TEXT_805);
+ if (genModel.isVirtualDelegation()) {
+ stringBuffer.append(TEXT_806);
+ } else {
+ stringBuffer.append(TEXT_807);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_808);
+ }
+ stringBuffer.append(TEXT_809);
+ }
+ } else {
+ if (genClass.isFlag(genFeature)) {
+ stringBuffer.append(TEXT_810);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_811);
+ stringBuffer.append(genClass.getFlagsField(genFeature));
+ stringBuffer.append(TEXT_812);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_813);
+ stringBuffer.append(genClass.getFlagsField(genFeature));
+ stringBuffer.append(TEXT_814);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_815);
+ } else if (!genModel.isVirtualDelegation() || genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_816);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_817);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_818);
+ }
+ if (!genModel.isVirtualDelegation() || genFeature.isPrimitiveType()) {
+ if (genClass.isESetFlag(genFeature)) {
+ stringBuffer.append(TEXT_819);
+ stringBuffer.append(genClass.getESetFlagsField(genFeature));
+ stringBuffer.append(TEXT_820);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_821);
+ } else {
+ stringBuffer.append(TEXT_822);
+ stringBuffer.append(genFeature.getUncapName());
+ stringBuffer.append(TEXT_823);
+ }
+ }
+ if (!genModel.isSuppressNotification()) {
+ stringBuffer.append(TEXT_824);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_825);
+ if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_826);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_827);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_828);
+ } else {
+ stringBuffer.append(TEXT_829);
+ stringBuffer.append(genFeature.getCapName());
+ }
+ stringBuffer.append(TEXT_830);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_831);
+ if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_832);
+ } else {
+ stringBuffer.append(TEXT_833);
+ stringBuffer.append(genFeature.getCapName());
+ stringBuffer.append(TEXT_834);
+ }
+ stringBuffer.append(TEXT_835);
+ }
+ }
+ }
+ } else if (genFeature.hasDelegateFeature()) { GenFeature delegateFeature = genFeature.getDelegateFeature();
+ if (delegateFeature.isWrappedFeatureMapType()) {
+ stringBuffer.append(TEXT_836);
+ stringBuffer.append(delegateFeature.getAccessorName());
+ stringBuffer.append(TEXT_837);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_838);
+ } else {
+ stringBuffer.append(TEXT_839);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_840);
+ stringBuffer.append(delegateFeature.getAccessorName());
+ stringBuffer.append(TEXT_841);
+ }
+ } else {
+ stringBuffer.append(TEXT_842);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_843);
+ stringBuffer.append(genFeature.getFeatureKind());
+ stringBuffer.append(TEXT_844);
+ //Class/unsetGenFeature.todo.override.javajetinc
+ }
+ stringBuffer.append(TEXT_845);
+ }
+ //Class/unsetGenFeature.override.javajetinc
+ }
+ if (genFeature.isIsSet() && (isImplementation || !genFeature.isSuppressedIsSetVisibility())) {
+ if (isInterface) {
+ stringBuffer.append(TEXT_846);
+ stringBuffer.append(genClass.getQualifiedInterfaceName());
+ stringBuffer.append(TEXT_847);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_848);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_849);
+ stringBuffer.append(genFeature.getFeatureKind());
+ stringBuffer.append(TEXT_850);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_851);
+ stringBuffer.append(genFeature.getFeatureKind());
+ stringBuffer.append(TEXT_852);
+ if (genFeature.isChangeable() && !genFeature.isSuppressedUnsetVisibility()) {
+ stringBuffer.append(TEXT_853);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_854);
+ }
+ stringBuffer.append(TEXT_855);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_856);
+ if (!genFeature.isListType() && genFeature.isChangeable() && !genFeature.isSuppressedSetVisibility()) {
+ stringBuffer.append(TEXT_857);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_858);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_859);
+ }
+ stringBuffer.append(TEXT_860);
+ } else {
+ stringBuffer.append(TEXT_861);
+ }
+ if (!isImplementation) {
+ stringBuffer.append(TEXT_862);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_863);
+ } else {
+ stringBuffer.append(TEXT_864);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_865);
+ if (genModel.isReflectiveDelegation()) {
+ stringBuffer.append(TEXT_866);
+ stringBuffer.append(genFeature.getQualifiedFeatureAccessor());
+ stringBuffer.append(TEXT_867);
+ } else if (!genFeature.isVolatile()) {
+ if (genFeature.isListType()) {
+ if (genModel.isVirtualDelegation()) {
+ stringBuffer.append(TEXT_868);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_869);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_870);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_871);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_872);
+ }
+ stringBuffer.append(TEXT_873);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_874);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.InternalEList"));
+ stringBuffer.append(TEXT_875);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_876);
+ } else {
+ if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_877);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_878);
+ } else if (genClass.isESetFlag(genFeature)) {
+ stringBuffer.append(TEXT_879);
+ stringBuffer.append(genClass.getESetFlagsField(genFeature));
+ stringBuffer.append(TEXT_880);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_881);
+ } else {
+ stringBuffer.append(TEXT_882);
+ stringBuffer.append(genFeature.getUncapName());
+ stringBuffer.append(TEXT_883);
+ }
+ }
+ } else if (genFeature.hasDelegateFeature()) { GenFeature delegateFeature = genFeature.getDelegateFeature();
+ if (delegateFeature.isWrappedFeatureMapType()) {
+ stringBuffer.append(TEXT_884);
+ stringBuffer.append(delegateFeature.getAccessorName());
+ stringBuffer.append(TEXT_885);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_886);
+ } else {
+ stringBuffer.append(TEXT_887);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap"));
+ stringBuffer.append(TEXT_888);
+ stringBuffer.append(delegateFeature.getAccessorName());
+ stringBuffer.append(TEXT_889);
+ stringBuffer.append(genFeature.getQualifiedFeatureAccessor());
+ stringBuffer.append(TEXT_890);
+ }
+ } else {
+ stringBuffer.append(TEXT_891);
+ stringBuffer.append(genFeature.getFormattedName());
+ stringBuffer.append(TEXT_892);
+ stringBuffer.append(genFeature.getFeatureKind());
+ stringBuffer.append(TEXT_893);
+ //Class/isSetGenFeature.todo.override.javajetinc
+ }
+ stringBuffer.append(TEXT_894);
+ }
+ //Class/isSetGenFeature.override.javajetinc
+ }
+ //Class/genFeature.override.javajetinc
+ }//for
+ for (Iterator i= (isImplementation ? genClass.getImplementedGenOperations() : genClass.getDeclaredGenOperations()).iterator(); i.hasNext();) { GenOperation genOperation = (GenOperation)i.next();
+ if (isInterface) {
+ stringBuffer.append(TEXT_895);
+ if (genOperation.hasDocumentation()) {
+ stringBuffer.append(TEXT_896);
+ stringBuffer.append(genOperation.getDocumentation(genModel.getIndentation(stringBuffer)));
+ stringBuffer.append(TEXT_897);
+ }
+ if (!genModel.isSuppressEMFModelTags()) { boolean first = true; for (StringTokenizer stringTokenizer = new StringTokenizer(genOperation.getModelInfo(), "\n\r"); stringTokenizer.hasMoreTokens(); ) { String modelInfo = stringTokenizer.nextToken(); if (first) { first = false;
+ stringBuffer.append(TEXT_898);
+ stringBuffer.append(modelInfo);
+ } else {
+ stringBuffer.append(TEXT_899);
+ stringBuffer.append(modelInfo);
+ }} if (first) {
+ stringBuffer.append(TEXT_900);
+ }}
+ stringBuffer.append(TEXT_901);
+ } else {
+ stringBuffer.append(TEXT_902);
+ }
+ if (!isImplementation) {
+ stringBuffer.append(TEXT_903);
+ stringBuffer.append(genOperation.getImportedType());
+ stringBuffer.append(TEXT_904);
+ stringBuffer.append(genOperation.getName());
+ stringBuffer.append(TEXT_905);
+ stringBuffer.append(genOperation.getParameters());
+ stringBuffer.append(TEXT_906);
+ stringBuffer.append(genOperation.getThrows());
+ stringBuffer.append(TEXT_907);
+ } else {
+ stringBuffer.append(TEXT_908);
+ stringBuffer.append(genOperation.getImportedType());
+ stringBuffer.append(TEXT_909);
+ stringBuffer.append(genOperation.getName());
+ stringBuffer.append(TEXT_910);
+ stringBuffer.append(genOperation.getParameters());
+ stringBuffer.append(TEXT_911);
+ stringBuffer.append(genOperation.getThrows());
+ stringBuffer.append(TEXT_912);
+ if (genOperation.hasBody()) {
+ stringBuffer.append(TEXT_913);
+ stringBuffer.append(genOperation.getBody(genModel.getIndentation(stringBuffer)));
+ } else if (genOperation.isInvariant()) {GenClass opClass = genOperation.getGenClass(); String diagnostics = ((GenParameter)genOperation.getGenParameters().get(0)).getName(); String context = ((GenParameter)genOperation.getGenParameters().get(1)).getName();
+ stringBuffer.append(TEXT_914);
+ stringBuffer.append(diagnostics);
+ stringBuffer.append(TEXT_915);
+ stringBuffer.append(diagnostics);
+ stringBuffer.append(TEXT_916);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.BasicDiagnostic"));
+ stringBuffer.append(TEXT_917);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.Diagnostic"));
+ stringBuffer.append(TEXT_918);
+ stringBuffer.append(opClass.getGenPackage().getImportedValidatorClassName());
+ stringBuffer.append(TEXT_919);
+ stringBuffer.append(opClass.getGenPackage().getImportedValidatorClassName());
+ stringBuffer.append(TEXT_920);
+ stringBuffer.append(opClass.getOperationID(genOperation));
+ stringBuffer.append(TEXT_921);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.plugin.EcorePlugin"));
+ stringBuffer.append(TEXT_922);
+ stringBuffer.append(genOperation.getName());
+ stringBuffer.append(TEXT_923);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.EObjectValidator"));
+ stringBuffer.append(TEXT_924);
+ stringBuffer.append(context);
+ stringBuffer.append(TEXT_925);
+ stringBuffer.append(genModel.getNonNLS());
+ stringBuffer.append(genModel.getNonNLS(2));
+ stringBuffer.append(TEXT_926);
+ } else {
+ stringBuffer.append(TEXT_927);
+ //Class/implementedGenOperation.todo.override.javajetinc
+ }
+ stringBuffer.append(TEXT_928);
+ }
+ //Class/implementedGenOperation.override.javajetinc
+ }//for
+ if (isImplementation && !genModel.isReflectiveDelegation() && genClass.implementsAny(genClass.getEInverseAddGenFeatures())) {
+ stringBuffer.append(TEXT_929);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject"));
+ stringBuffer.append(TEXT_930);
+ for (Iterator i=genClass.getEInverseAddGenFeatures().iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();
+ if (!genModel.isMinimalReflectiveMethods() || genClass.getImplementedGenFeatures().contains(genFeature)) {
+ stringBuffer.append(TEXT_931);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_932);
+ if (genFeature.isListType()) {
+ if (genFeature.isMapType() && genFeature.isEffectiveSuppressEMFTypes()) {
+ stringBuffer.append(TEXT_933);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.InternalEList"));
+ stringBuffer.append(TEXT_934);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.EMap"));
+ stringBuffer.append(TEXT_935);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_936);
+ } else {
+ stringBuffer.append(TEXT_937);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.InternalEList"));
+ stringBuffer.append(TEXT_938);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_939);
+ }
+ } else if (genFeature.isContainer()) {
+ stringBuffer.append(TEXT_940);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_941);
+ } else {
+ if (genClass.getImplementingGenModel(genFeature).isVirtualDelegation()) {
+ stringBuffer.append(TEXT_942);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_943);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_944);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_945);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_946);
+ }
+ stringBuffer.append(TEXT_947);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_948);
+ if (genFeature.isEffectiveContains()) {
+ stringBuffer.append(TEXT_949);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject"));
+ stringBuffer.append(TEXT_950);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_951);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_952);
+ } else { GenFeature reverseFeature = genFeature.getReverse(); GenClass targetClass = reverseFeature.getGenClass();
+ stringBuffer.append(TEXT_953);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject"));
+ stringBuffer.append(TEXT_954);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_955);
+ stringBuffer.append(targetClass.getQualifiedFeatureID(reverseFeature));
+ stringBuffer.append(TEXT_956);
+ stringBuffer.append(targetClass.getImportedInterfaceName());
+ stringBuffer.append(TEXT_957);
+ }
+ stringBuffer.append(TEXT_958);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_959);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_960);
+ }
+ }
+ }
+ stringBuffer.append(TEXT_961);
+ if (genModel.isMinimalReflectiveMethods()) {
+ stringBuffer.append(TEXT_962);
+ } else {
+ stringBuffer.append(TEXT_963);
+ }
+ stringBuffer.append(TEXT_964);
+ }
+ if (isImplementation && !genModel.isReflectiveDelegation() && genClass.implementsAny(genClass.getEInverseRemoveGenFeatures())) {
+ stringBuffer.append(TEXT_965);
+ stringBuffer.append(genModel.getImportedName("java.lang.Object"));
+ stringBuffer.append(TEXT_966);
+ for (Iterator i=genClass.getEInverseRemoveGenFeatures().iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();
+ if (!genModel.isMinimalReflectiveMethods() || genClass.getImplementedGenFeatures().contains(genFeature)) {
+ stringBuffer.append(TEXT_967);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_968);
+ if (genFeature.isListType()) {
+ if (genFeature.isMapType() && genFeature.isEffectiveSuppressEMFTypes()) {
+ stringBuffer.append(TEXT_969);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.InternalEList"));
+ stringBuffer.append(TEXT_970);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.EMap"));
+ stringBuffer.append(TEXT_971);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_972);
+ } else if (genFeature.isWrappedFeatureMapType()) {
+ stringBuffer.append(TEXT_973);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_974);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_975);
+ } else {
+ stringBuffer.append(TEXT_976);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_977);
+ }
+ } else if (genFeature.isContainer()) {
+ stringBuffer.append(TEXT_978);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_979);
+ } else if (genFeature.isUnsettable()) {
+ stringBuffer.append(TEXT_980);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_981);
+ } else {
+ stringBuffer.append(TEXT_982);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_983);
+ }
+ }
+ }
+ stringBuffer.append(TEXT_984);
+ if (genModel.isMinimalReflectiveMethods()) {
+ stringBuffer.append(TEXT_985);
+ } else {
+ stringBuffer.append(TEXT_986);
+ }
+ stringBuffer.append(TEXT_987);
+ }
+ if (isImplementation && !genModel.isReflectiveDelegation() && genClass.implementsAny(genClass.getEBasicRemoveFromContainerGenFeatures())) {
+ stringBuffer.append(TEXT_988);
+ for (Iterator i=genClass.getEBasicRemoveFromContainerGenFeatures().iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();
+ GenFeature reverseFeature = genFeature.getReverse(); GenClass targetClass = reverseFeature.getGenClass();
+ if (!genModel.isMinimalReflectiveMethods() || genClass.getImplementedGenFeatures().contains(genFeature)) {
+ stringBuffer.append(TEXT_989);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_990);
+ stringBuffer.append(targetClass.getQualifiedFeatureID(reverseFeature));
+ stringBuffer.append(TEXT_991);
+ stringBuffer.append(targetClass.getImportedInterfaceName());
+ stringBuffer.append(TEXT_992);
+ }
+ }
+ stringBuffer.append(TEXT_993);
+ if (genModel.isMinimalReflectiveMethods()) {
+ stringBuffer.append(TEXT_994);
+ } else {
+ stringBuffer.append(TEXT_995);
+ }
+ stringBuffer.append(TEXT_996);
+ }
+ if (isImplementation && !genModel.isReflectiveDelegation() && !genClass.getImplementedGenFeatures().isEmpty()) {
+ stringBuffer.append(TEXT_997);
+ for (Iterator i=genClass.getAllGenFeatures().iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();
+ if (!genModel.isMinimalReflectiveMethods() || genClass.getImplementedGenFeatures().contains(genFeature)) {
+ stringBuffer.append(TEXT_998);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_999);
+ if (genFeature.isPrimitiveType()) {
+ if (genFeature.isBooleanType()) {
+ stringBuffer.append(TEXT_1000);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1001);
+ } else {
+ stringBuffer.append(TEXT_1002);
+ stringBuffer.append(genFeature.getObjectType());
+ stringBuffer.append(TEXT_1003);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1004);
+ }
+ } else if (genFeature.isResolveProxies() && !genFeature.isListType()) {
+ stringBuffer.append(TEXT_1005);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1006);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_1007);
+ } else if (genFeature.isMapType()) {
+ if (genFeature.isEffectiveSuppressEMFTypes()) {
+ stringBuffer.append(TEXT_1008);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.EMap"));
+ stringBuffer.append(TEXT_1009);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1010);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1011);
+ } else {
+ stringBuffer.append(TEXT_1012);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1013);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1014);
+ }
+ } else if (genFeature.isWrappedFeatureMapType()) {
+ stringBuffer.append(TEXT_1015);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1016);
+ } else if (genFeature.isFeatureMapType()) {
+ stringBuffer.append(TEXT_1017);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1018);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap"));
+ stringBuffer.append(TEXT_1019);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1020);
+ } else {
+ stringBuffer.append(TEXT_1021);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1022);
+ }
+ }
+ }
+ stringBuffer.append(TEXT_1023);
+ if (genModel.isMinimalReflectiveMethods()) {
+ stringBuffer.append(TEXT_1024);
+ } else {
+ stringBuffer.append(TEXT_1025);
+ }
+ stringBuffer.append(TEXT_1026);
+ }
+ if (isImplementation && !genModel.isReflectiveDelegation() && genClass.implementsAny(genClass.getESetGenFeatures())) {
+ stringBuffer.append(TEXT_1027);
+ for (Iterator i=genClass.getESetGenFeatures().iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();
+ if (!genModel.isMinimalReflectiveMethods() || genClass.getImplementedGenFeatures().contains(genFeature)) {
+ stringBuffer.append(TEXT_1028);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1029);
+ if (genFeature.isListType()) {
+ if (genFeature.isWrappedFeatureMapType()) {
+ stringBuffer.append(TEXT_1030);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_1031);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1032);
+ } else if (genFeature.isFeatureMapType()) {
+ stringBuffer.append(TEXT_1033);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap"));
+ stringBuffer.append(TEXT_1034);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1035);
+ } else if (genFeature.isMapType()) {
+ if (genFeature.isEffectiveSuppressEMFTypes()) {
+ stringBuffer.append(TEXT_1036);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
+ stringBuffer.append(TEXT_1037);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.EMap"));
+ stringBuffer.append(TEXT_1038);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1039);
+ } else {
+ stringBuffer.append(TEXT_1040);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
+ stringBuffer.append(TEXT_1041);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1042);
+ }
+ } else {
+ stringBuffer.append(TEXT_1043);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1044);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1045);
+ stringBuffer.append(genModel.getImportedName("java.util.Collection"));
+ stringBuffer.append(TEXT_1046);
+ }
+ } else if (genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_1047);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_1048);
+ stringBuffer.append(genFeature.getObjectType());
+ stringBuffer.append(TEXT_1049);
+ stringBuffer.append(genFeature.getPrimitiveValueFunction());
+ stringBuffer.append(TEXT_1050);
+ } else {
+ stringBuffer.append(TEXT_1051);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_1052);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_1053);
+ }
+ stringBuffer.append(TEXT_1054);
+ }
+ }
+ stringBuffer.append(TEXT_1055);
+ if (genModel.isMinimalReflectiveMethods()) {
+ stringBuffer.append(TEXT_1056);
+ } else {
+ stringBuffer.append(TEXT_1057);
+ }
+ stringBuffer.append(TEXT_1058);
+ for (Iterator i=genClass.getESetGenFeatures().iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();
+ if (!genModel.isMinimalReflectiveMethods() || genClass.getImplementedGenFeatures().contains(genFeature)) {
+ stringBuffer.append(TEXT_1059);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1060);
+ if (genFeature.isListType() && !genFeature.isUnsettable()) {
+ if (genFeature.isWrappedFeatureMapType()) {
+ stringBuffer.append(TEXT_1061);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_1062);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1063);
+ } else {
+ stringBuffer.append(TEXT_1064);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1065);
+ }
+ } else if (genFeature.isUnsettable()) {
+ stringBuffer.append(TEXT_1066);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_1067);
+ } else if (genFeature.isReferenceType()) {
+ stringBuffer.append(TEXT_1068);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_1069);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_1070);
+ } else {
+ stringBuffer.append(TEXT_1071);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_1072);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1073);
+ }
+ stringBuffer.append(TEXT_1074);
+ }
+ }
+ stringBuffer.append(TEXT_1075);
+ if (genModel.isMinimalReflectiveMethods()) {
+ stringBuffer.append(TEXT_1076);
+ } else {
+ stringBuffer.append(TEXT_1077);
+ }
+ stringBuffer.append(TEXT_1078);
+ }
+ if (isImplementation && !genModel.isReflectiveDelegation() && !genClass.getImplementedGenFeatures().isEmpty()) {
+ stringBuffer.append(TEXT_1079);
+ for (Iterator i=genClass.getAllGenFeatures().iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();
+ if (!genModel.isMinimalReflectiveMethods() || genClass.getImplementedGenFeatures().contains(genFeature)) {
+ stringBuffer.append(TEXT_1080);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1081);
+ if (genFeature.isListType() && !genFeature.isUnsettable()) {
+ if (genFeature.isWrappedFeatureMapType()) {
+ if (genFeature.isVolatile()) {
+ stringBuffer.append(TEXT_1082);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_1083);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1084);
+ } else {
+ stringBuffer.append(TEXT_1085);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_1086);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_1087);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1088);
+ }
+ } else {
+ if (genClass.isField(genFeature)) {
+ stringBuffer.append(TEXT_1089);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_1090);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_1091);
+ } else {
+ if (genFeature.isField() && genClass.getImplementingGenModel(genFeature).isVirtualDelegation()) {
+ stringBuffer.append(TEXT_1092);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_1093);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_1094);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_1095);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1096);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_1097);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_1098);
+ } else {
+ stringBuffer.append(TEXT_1099);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1100);
+ }
+ }
+ }
+ } else if (genFeature.isUnsettable()) {
+ stringBuffer.append(TEXT_1101);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_1102);
+ } else if (genFeature.isResolveProxies()) {
+ if (genClass.isField(genFeature)) {
+ stringBuffer.append(TEXT_1103);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_1104);
+ } else {
+ if (genFeature.isField() && genClass.getImplementingGenModel(genFeature).isVirtualDelegation()) {
+ stringBuffer.append(TEXT_1105);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1106);
+ } else {
+ stringBuffer.append(TEXT_1107);
+ stringBuffer.append(genFeature.getAccessorName());
+ stringBuffer.append(TEXT_1108);
+ }
+ }
+ } else if (genFeature.isReferenceType()) {
+ if (genClass.isField(genFeature)) {
+ stringBuffer.append(TEXT_1109);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_1110);
+ } else {
+ if (genFeature.isField() && genClass.getImplementingGenModel(genFeature).isVirtualDelegation()) {
+ stringBuffer.append(TEXT_1111);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1112);
+ } else {
+ stringBuffer.append(TEXT_1113);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1114);
+ }
+ }
+ } else if (genFeature.isPrimitiveType() || genFeature.isEnumType()) {
+ if (genClass.isField(genFeature)) {
+ if (genClass.isFlag(genFeature)) {
+ stringBuffer.append(TEXT_1115);
+ stringBuffer.append(genClass.getFlagsField(genFeature));
+ stringBuffer.append(TEXT_1116);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1117);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1118);
+ } else {
+ stringBuffer.append(TEXT_1119);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_1120);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1121);
+ }
+ } else {
+ if (genFeature.isEnumType() && genFeature.isField() && genClass.getImplementingGenModel(genFeature).isVirtualDelegation()) {
+ stringBuffer.append(TEXT_1122);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1123);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1124);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1125);
+ } else {
+ stringBuffer.append(TEXT_1126);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1127);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1128);
+ }
+ }
+ } else {//datatype
+ if (genClass.isField(genFeature)) {
+ stringBuffer.append(TEXT_1129);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1130);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_1131);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1132);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_1133);
+ } else {
+ if (genFeature.isField() && genClass.getImplementingGenModel(genFeature).isVirtualDelegation()) {
+ stringBuffer.append(TEXT_1134);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_1135);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_1136);
+ stringBuffer.append(genFeature.getImportedType());
+ stringBuffer.append(TEXT_1137);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1138);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1139);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1140);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_1141);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1142);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_1143);
+ } else {
+ stringBuffer.append(TEXT_1144);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1145);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1146);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1147);
+ stringBuffer.append(genFeature.getGetAccessor());
+ stringBuffer.append(TEXT_1148);
+ }
+ }
+ }
+ }
+ }
+ stringBuffer.append(TEXT_1149);
+ if (genModel.isMinimalReflectiveMethods()) {
+ stringBuffer.append(TEXT_1150);
+ } else {
+ stringBuffer.append(TEXT_1151);
+ }
+ stringBuffer.append(TEXT_1152);
+ //Class/eIsSet.override.javajetinc
+ }
+ if (isImplementation && !genClass.getMixinGenFeatures().isEmpty()) {
+ stringBuffer.append(TEXT_1153);
+ for (Iterator m=genClass.getMixinGenClasses().iterator(); m.hasNext();) { GenClass mixinGenClass = (GenClass)m.next();
+ stringBuffer.append(TEXT_1154);
+ stringBuffer.append(mixinGenClass.getImportedInterfaceName());
+ stringBuffer.append(TEXT_1155);
+ for (Iterator f=mixinGenClass.getGenFeatures().iterator(); f.hasNext();) { GenFeature genFeature = (GenFeature)f.next();
+ stringBuffer.append(TEXT_1156);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1157);
+ stringBuffer.append(mixinGenClass.getQualifiedFeatureID(genFeature));
+ stringBuffer.append(TEXT_1158);
+ }
+ stringBuffer.append(TEXT_1159);
+ }
+ stringBuffer.append(TEXT_1160);
+ for (Iterator m=genClass.getMixinGenClasses().iterator(); m.hasNext();) { GenClass mixinGenClass = (GenClass)m.next();
+ stringBuffer.append(TEXT_1161);
+ stringBuffer.append(mixinGenClass.getImportedInterfaceName());
+ stringBuffer.append(TEXT_1162);
+ for (Iterator f=mixinGenClass.getGenFeatures().iterator(); f.hasNext();) { GenFeature genFeature = (GenFeature)f.next();
+ stringBuffer.append(TEXT_1163);
+ stringBuffer.append(mixinGenClass.getQualifiedFeatureID(genFeature));
+ stringBuffer.append(TEXT_1164);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1165);
+ }
+ stringBuffer.append(TEXT_1166);
+ }
+ stringBuffer.append(TEXT_1167);
+ }
+ if (isImplementation && genModel.isVirtualDelegation()) { String eVirtualValuesField = genClass.getEVirtualValuesField();
+ if (eVirtualValuesField != null) {
+ stringBuffer.append(TEXT_1168);
+ stringBuffer.append(eVirtualValuesField);
+ stringBuffer.append(TEXT_1169);
+ stringBuffer.append(eVirtualValuesField);
+ stringBuffer.append(TEXT_1170);
+ }
+ { List eVirtualIndexBitFields = genClass.getEVirtualIndexBitFields(new ArrayList());
+ if (!eVirtualIndexBitFields.isEmpty()) { List allEVirtualIndexBitFields = genClass.getAllEVirtualIndexBitFields(new ArrayList());
+ stringBuffer.append(TEXT_1171);
+ for (int i = 0; i < allEVirtualIndexBitFields.size(); i++) {
+ stringBuffer.append(TEXT_1172);
+ stringBuffer.append(i);
+ stringBuffer.append(TEXT_1173);
+ stringBuffer.append(allEVirtualIndexBitFields.get(i));
+ stringBuffer.append(TEXT_1174);
+ }
+ stringBuffer.append(TEXT_1175);
+ for (int i = 0; i < allEVirtualIndexBitFields.size(); i++) {
+ stringBuffer.append(TEXT_1176);
+ stringBuffer.append(i);
+ stringBuffer.append(TEXT_1177);
+ stringBuffer.append(allEVirtualIndexBitFields.get(i));
+ stringBuffer.append(TEXT_1178);
+ }
+ stringBuffer.append(TEXT_1179);
+ }
+ }
+ }
+ if (isImplementation && !genModel.isReflectiveDelegation() && !genClass.getToStringGenFeatures().isEmpty()) {
+ stringBuffer.append(TEXT_1180);
+ { boolean first = true;
+ for (Iterator i=genClass.getToStringGenFeatures().iterator(); i.hasNext(); ) { GenFeature genFeature = (GenFeature)i.next();
+ if (first) { first = false;
+ stringBuffer.append(TEXT_1181);
+ stringBuffer.append(genFeature.getName());
+ stringBuffer.append(TEXT_1182);
+ stringBuffer.append(genModel.getNonNLS());
+ } else {
+ stringBuffer.append(TEXT_1183);
+ stringBuffer.append(genFeature.getName());
+ stringBuffer.append(TEXT_1184);
+ stringBuffer.append(genModel.getNonNLS());
+ }
+ if (genFeature.isUnsettable() && !genFeature.isListType()) {
+ if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_1185);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1186);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1187);
+ stringBuffer.append(genModel.getNonNLS());
+ } else {
+ if (genClass.isFlag(genFeature)) {
+ stringBuffer.append(TEXT_1188);
+ if (genClass.isESetFlag(genFeature)) {
+ stringBuffer.append(TEXT_1189);
+ stringBuffer.append(genClass.getESetFlagsField(genFeature));
+ stringBuffer.append(TEXT_1190);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1191);
+ } else {
+ stringBuffer.append(genFeature.getUncapName());
+ stringBuffer.append(TEXT_1192);
+ }
+ stringBuffer.append(TEXT_1193);
+ stringBuffer.append(genClass.getFlagsField(genFeature));
+ stringBuffer.append(TEXT_1194);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1195);
+ stringBuffer.append(genModel.getNonNLS());
+ } else {
+ stringBuffer.append(TEXT_1196);
+ if (genClass.isESetFlag(genFeature)) {
+ stringBuffer.append(TEXT_1197);
+ stringBuffer.append(genClass.getESetFlagsField(genFeature));
+ stringBuffer.append(TEXT_1198);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1199);
+ } else {
+ stringBuffer.append(genFeature.getUncapName());
+ stringBuffer.append(TEXT_1200);
+ }
+ stringBuffer.append(TEXT_1201);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_1202);
+ stringBuffer.append(genModel.getNonNLS());
+ }
+ }
+ } else {
+ if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_1203);
+ stringBuffer.append(genFeature.getUpperName());
+ if (!genFeature.isListType() && !genFeature.isReferenceType()){
+ stringBuffer.append(TEXT_1204);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1205);
+ }
+ stringBuffer.append(TEXT_1206);
+ } else {
+ if (genClass.isFlag(genFeature)) {
+ stringBuffer.append(TEXT_1207);
+ stringBuffer.append(genClass.getFlagsField(genFeature));
+ stringBuffer.append(TEXT_1208);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_1209);
+ } else {
+ stringBuffer.append(TEXT_1210);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_1211);
+ }
+ }
+ }
+ }
+ }
+ stringBuffer.append(TEXT_1212);
+ }
+ if (isImplementation && genClass.isMapEntry()) { GenFeature keyFeature = genClass.getMapEntryKeyFeature(); GenFeature valueFeature = genClass.getMapEntryValueFeature();
+ stringBuffer.append(TEXT_1213);
+ if (keyFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_1214);
+ stringBuffer.append(keyFeature.getObjectType());
+ stringBuffer.append(TEXT_1215);
+ } else {
+ stringBuffer.append(TEXT_1216);
+ }
+ stringBuffer.append(TEXT_1217);
+ if (keyFeature.isListType()) {
+ stringBuffer.append(TEXT_1218);
+ stringBuffer.append(genModel.getImportedName("java.util.Collection"));
+ stringBuffer.append(TEXT_1219);
+ } else if (keyFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_1220);
+ stringBuffer.append(keyFeature.getObjectType());
+ stringBuffer.append(TEXT_1221);
+ stringBuffer.append(keyFeature.getPrimitiveValueFunction());
+ stringBuffer.append(TEXT_1222);
+ } else {
+ stringBuffer.append(TEXT_1223);
+ stringBuffer.append(keyFeature.getImportedType());
+ stringBuffer.append(TEXT_1224);
+ }
+ stringBuffer.append(TEXT_1225);
+ if (valueFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_1226);
+ stringBuffer.append(valueFeature.getObjectType());
+ stringBuffer.append(TEXT_1227);
+ } else {
+ stringBuffer.append(TEXT_1228);
+ }
+ stringBuffer.append(TEXT_1229);
+ if (valueFeature.isListType()) {
+ stringBuffer.append(TEXT_1230);
+ stringBuffer.append(genModel.getImportedName("java.util.Collection"));
+ stringBuffer.append(TEXT_1231);
+ } else if (valueFeature.isPrimitiveType()) {
+ stringBuffer.append(TEXT_1232);
+ stringBuffer.append(valueFeature.getObjectType());
+ stringBuffer.append(TEXT_1233);
+ stringBuffer.append(valueFeature.getPrimitiveValueFunction());
+ stringBuffer.append(TEXT_1234);
+ } else {
+ stringBuffer.append(TEXT_1235);
+ stringBuffer.append(valueFeature.getImportedType());
+ stringBuffer.append(TEXT_1236);
+ }
+ stringBuffer.append(TEXT_1237);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.EMap"));
+ stringBuffer.append(TEXT_1238);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(TEXT_1239);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.EMap"));
+ stringBuffer.append(TEXT_1240);
+ }
+ stringBuffer.append(TEXT_1241);
+ stringBuffer.append(isInterface ? " " + genClass.getInterfaceName() : genClass.getClassName());
+ // TODO fix the space above
+ genModel.emitSortedImports();
+ stringBuffer.append(TEXT_1242);
+ return stringBuffer.toString();
+ }
+}
diff --git a/branches/sdo-java-M2/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/templates/model/SDOFactoryClass.java b/branches/sdo-java-M2/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/templates/model/SDOFactoryClass.java
new file mode 100644
index 0000000000..1bcbcc4bc2
--- /dev/null
+++ b/branches/sdo-java-M2/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/templates/model/SDOFactoryClass.java
@@ -0,0 +1,1706 @@
+/**
+ *
+ * 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.generate.templates.model;
+
+import org.apache.tuscany.sdo.generate.util.*;
+import java.util.*;
+import org.eclipse.emf.codegen.ecore.genmodel.*;
+import org.eclipse.emf.ecore.*;
+import org.eclipse.emf.codegen.ecore.genmodel.impl.Literals;
+import org.eclipse.emf.ecore.util.*;
+
+public class SDOFactoryClass
+{
+ protected static String nl;
+ public static synchronized SDOFactoryClass create(String lineSeparator)
+ {
+ nl = lineSeparator;
+ SDOFactoryClass result = new SDOFactoryClass();
+ nl = null;
+ return result;
+ }
+
+ protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
+ protected final String TEXT_1 = "";
+ protected final String TEXT_2 = "/**" + NL + " * <copyright>" + NL + " * </copyright>" + NL + " *" + NL + " * ";
+ protected final String TEXT_3 = "Id";
+ protected final String TEXT_4 = NL + " */";
+ protected final String TEXT_5 = NL + "package ";
+ protected final String TEXT_6 = ";";
+ protected final String TEXT_7 = NL + "package ";
+ protected final String TEXT_8 = ";";
+ protected final String TEXT_9 = NL;
+ protected final String TEXT_10 = NL;
+ protected final String TEXT_11 = NL + "/**" + NL + " * <!-- begin-user-doc -->" + NL + " * The <b>Factory</b> for the model." + NL + " * It provides a create method for each non-abstract class of the model." + NL + " * <!-- end-user-doc -->";
+ protected final String TEXT_12 = NL + " * @see ";
+ protected final String TEXT_13 = NL + " * @generated" + NL + " */";
+ protected final String TEXT_14 = NL + "/**" + NL + " * <!-- begin-user-doc -->" + NL + " * An implementation of the model <b>Factory</b>." + NL + " * <!-- end-user-doc -->" + NL + " * @generated" + NL + " */";
+ protected final String TEXT_15 = NL + "public class ";
+ protected final String TEXT_16 = " extends ";
+ protected final String TEXT_17 = " implements ";
+ protected final String TEXT_18 = NL + "public interface ";
+ protected final String TEXT_19 = " extends ";
+ protected final String TEXT_20 = NL + "{";
+ protected final String TEXT_21 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\t";
+ protected final String TEXT_22 = " copyright = \"";
+ protected final String TEXT_23 = "\";";
+ protected final String TEXT_24 = NL;
+ protected final String TEXT_25 = NL;
+ protected final String TEXT_26 = NL + "\t/**" + NL + "\t * The singleton instance of the factory." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\t";
+ protected final String TEXT_27 = " INSTANCE = ";
+ protected final String TEXT_28 = ".init();" + NL;
+ protected final String TEXT_29 = NL + "\t/**" + NL + "\t * The singleton instance of the factory." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\t";
+ protected final String TEXT_30 = " eINSTANCE = ";
+ protected final String TEXT_31 = ".init();" + NL;
+ protected final String TEXT_32 = NL + "\t/**" + NL + "\t * The package namespace URI." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\t";
+ protected final String TEXT_33 = " NAMESPACE_URI = \"";
+ protected final String TEXT_34 = "\";";
+ protected final String TEXT_35 = NL + NL + "\t/**" + NL + "\t * The package namespace name." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\t";
+ protected final String TEXT_36 = " NAMESPACE_PREFIX = \"";
+ protected final String TEXT_37 = "\";";
+ protected final String TEXT_38 = "\t" + NL + "\t";
+ protected final String TEXT_39 = "int ";
+ protected final String TEXT_40 = " = ";
+ protected final String TEXT_41 = ";";
+ protected final String TEXT_42 = NL + "\t";
+ protected final String TEXT_43 = NL + "\t/**" + NL + "\t * Creates an instance of the factory." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
+ protected final String TEXT_44 = "()" + NL + "\t{" + NL + "\t\tsuper(NAMESPACE_URI, NAMESPACE_PREFIX);" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
+ protected final String TEXT_45 = " create(int typeNumber)" + NL + "\t{" + NL + "\t\tswitch (typeNumber)" + NL + "\t\t{";
+ protected final String TEXT_46 = NL + "\t\t\tcase ";
+ protected final String TEXT_47 = ": return (";
+ protected final String TEXT_48 = ")create";
+ protected final String TEXT_49 = "();";
+ protected final String TEXT_50 = NL + "\t\t\tdefault:" + NL + "\t\t\t\treturn super.create(typeNumber);" + NL + "\t\t}" + NL + "\t}" + NL;
+ protected final String TEXT_51 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Object createFromString(";
+ protected final String TEXT_52 = " type, String initialValue, int propertyValue)" + NL + "\t{" + NL + "\t\tswitch (propertyValue)" + NL + "\t\t{";
+ protected final String TEXT_53 = NL + "\t\t\tcase ";
+ protected final String TEXT_54 = ":" + NL + "\t\t\t\treturn create";
+ protected final String TEXT_55 = "FromString(type, initialValue);";
+ protected final String TEXT_56 = NL + "\t\t\tdefault:" + NL + "\t\t\t\tthrow new IllegalArgumentException(\"The datatype '\" + type.getName() + \"' is not a valid property value\");";
+ protected final String TEXT_57 = NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic String convertToString(";
+ protected final String TEXT_58 = " type, Object instanceValue, int propertyValue)" + NL + "\t{" + NL + "\t\tswitch (propertyValue)" + NL + "\t\t{";
+ protected final String TEXT_59 = NL + "\t\t\tcase ";
+ protected final String TEXT_60 = ":" + NL + "\t\t\t\treturn convert";
+ protected final String TEXT_61 = "ToString(type, instanceValue);";
+ protected final String TEXT_62 = NL + "\t\t\tdefault:" + NL + "\t\t\t\tthrow new IllegalArgumentException(\"The datatype '\" + type.getName() + \"' is not a valid property value\");";
+ protected final String TEXT_63 = NL + "\t\t}" + NL + "\t}";
+ protected final String TEXT_64 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
+ protected final String TEXT_65 = " create";
+ protected final String TEXT_66 = "()" + NL + "\t{";
+ protected final String TEXT_67 = NL + "\t\t";
+ protected final String TEXT_68 = " ";
+ protected final String TEXT_69 = " = ";
+ protected final String TEXT_70 = "super.create(";
+ protected final String TEXT_71 = ");";
+ protected final String TEXT_72 = NL + "\t\t";
+ protected final String TEXT_73 = " ";
+ protected final String TEXT_74 = " = new ";
+ protected final String TEXT_75 = "()";
+ protected final String TEXT_76 = "{}";
+ protected final String TEXT_77 = ";";
+ protected final String TEXT_78 = NL + "\t\treturn ";
+ protected final String TEXT_79 = ";" + NL + "\t}";
+ protected final String TEXT_80 = NL + "\t" + NL + "\t// Following creates and initializes SDO metadata for the supported types.";
+ protected final String TEXT_81 = "\t";
+ protected final String TEXT_82 = "\t" + NL + "\tprotected ";
+ protected final String TEXT_83 = " ";
+ protected final String TEXT_84 = "Type = null;" + NL + "" + NL + "\tpublic ";
+ protected final String TEXT_85 = " get";
+ protected final String TEXT_86 = "()" + NL + "\t{" + NL + "\t\treturn ";
+ protected final String TEXT_87 = "Type;" + NL + "\t}" + NL;
+ protected final String TEXT_88 = "\t" + NL + "" + NL + "\tprivate static boolean isInited = false;" + NL + "" + NL + "\tpublic static ";
+ protected final String TEXT_89 = " init()" + NL + "\t{" + NL + "\t\tif (isInited) return (";
+ protected final String TEXT_90 = ")FactoryBase.getStaticFactory(";
+ protected final String TEXT_91 = ".NAMESPACE_URI);" + NL + "\t\t";
+ protected final String TEXT_92 = " the";
+ protected final String TEXT_93 = " = new ";
+ protected final String TEXT_94 = "();" + NL + "\t\tisInited = true;" + NL + "" + NL + "\t\t// Initialize simple dependencies" + NL + "\t\t";
+ protected final String TEXT_95 = ".registerStaticTypes(";
+ protected final String TEXT_96 = ".class);" + NL + "\t\t";
+ protected final String TEXT_97 = ".registerStaticTypes(";
+ protected final String TEXT_98 = ".class);" + NL + "" + NL + "\t\t// Create package meta-data objects" + NL + "\t\tthe";
+ protected final String TEXT_99 = ".createMetaData();" + NL + "" + NL + "\t\t// Initialize created meta-data" + NL + "\t\tthe";
+ protected final String TEXT_100 = ".initializeMetaData();" + NL + "" + NL + "\t\t// Mark meta-data to indicate it can't be changed" + NL + "\t\t//the";
+ protected final String TEXT_101 = ".freeze(); //FB do we need to freeze / should we freeze ????" + NL + "" + NL + "\t\treturn the";
+ protected final String TEXT_102 = ";" + NL + "\t}" + NL + " " + NL + "\tprivate boolean isCreated = false;" + NL + "" + NL + "\tpublic void createMetaData()" + NL + "\t{" + NL + "\t\tif (isCreated) return;" + NL + "\t\tisCreated = true;";
+ protected final String TEXT_103 = "\t";
+ protected final String TEXT_104 = NL;
+ protected final String TEXT_105 = NL + "\t\t";
+ protected final String TEXT_106 = "Type = createType(false, ";
+ protected final String TEXT_107 = ");";
+ protected final String TEXT_108 = NL + "\t\tcreateProperty(";
+ protected final String TEXT_109 = ", ";
+ protected final String TEXT_110 = "Type, ";
+ protected final String TEXT_111 = ".";
+ protected final String TEXT_112 = ");";
+ protected final String TEXT_113 = NL + "\t\t// Create enums" + NL + "\t\t// todo";
+ protected final String TEXT_114 = NL + "\t\t";
+ protected final String TEXT_115 = " = createEEnum(";
+ protected final String TEXT_116 = ");";
+ protected final String TEXT_117 = NL + "\t\t";
+ protected final String TEXT_118 = "Type = createType(true, ";
+ protected final String TEXT_119 = " );";
+ protected final String TEXT_120 = NL + "\t}" + NL + "\t" + NL + "\tprivate boolean isInitialized = false;" + NL + "" + NL + "\tpublic void initializeMetaData()" + NL + "\t{" + NL + "\t\tif (isInitialized) return;" + NL + "\t\tisInitialized = true;";
+ protected final String TEXT_121 = NL + NL + "\t\t// Obtain other dependent packages";
+ protected final String TEXT_122 = NL + "\t\t";
+ protected final String TEXT_123 = " ";
+ protected final String TEXT_124 = " = (";
+ protected final String TEXT_125 = ")FactoryBase.getStaticFactory(";
+ protected final String TEXT_126 = ".NAMESPACE_URI);";
+ protected final String TEXT_127 = NL + "\t\t";
+ protected final String TEXT_128 = " property = null;" + NL + "" + NL + "\t\t// Add supertypes to classes";
+ protected final String TEXT_129 = NL + "\t\taddSuperType(";
+ protected final String TEXT_130 = "Type, ";
+ protected final String TEXT_131 = "Type);";
+ protected final String TEXT_132 = NL + NL + "\t\t// Initialize classes and features; add operations and parameters";
+ protected final String TEXT_133 = NL + "\t\tinitializeType(";
+ protected final String TEXT_134 = "Type, ";
+ protected final String TEXT_135 = ".class, \"";
+ protected final String TEXT_136 = "\");";
+ protected final String TEXT_137 = NL + "\t\tsetInstanceProperty (";
+ protected final String TEXT_138 = "Type, \"";
+ protected final String TEXT_139 = "\", ";
+ protected final String TEXT_140 = ", ";
+ protected final String TEXT_141 = ");";
+ protected final String TEXT_142 = NL;
+ protected final String TEXT_143 = NL + "\t\tproperty = (";
+ protected final String TEXT_144 = ")";
+ protected final String TEXT_145 = "Type.getProperties().get(";
+ protected final String TEXT_146 = ".";
+ protected final String TEXT_147 = ");";
+ protected final String TEXT_148 = NL + "\t\tinitializeProperty(property, ";
+ protected final String TEXT_149 = ", \"";
+ protected final String TEXT_150 = "\", ";
+ protected final String TEXT_151 = ", ";
+ protected final String TEXT_152 = ", ";
+ protected final String TEXT_153 = ", ";
+ protected final String TEXT_154 = ", ";
+ protected final String TEXT_155 = ", ";
+ protected final String TEXT_156 = ", ";
+ protected final String TEXT_157 = ", ";
+ protected final String TEXT_158 = " , ";
+ protected final String TEXT_159 = ");";
+ protected final String TEXT_160 = NL + "\t\tinitializeProperty(property, ";
+ protected final String TEXT_161 = ", \"";
+ protected final String TEXT_162 = "\", ";
+ protected final String TEXT_163 = ", ";
+ protected final String TEXT_164 = ", ";
+ protected final String TEXT_165 = ", ";
+ protected final String TEXT_166 = ", ";
+ protected final String TEXT_167 = ", ";
+ protected final String TEXT_168 = ", ";
+ protected final String TEXT_169 = ");";
+ protected final String TEXT_170 = NL + "\t\tsetInstanceProperty (property, \"";
+ protected final String TEXT_171 = "\", ";
+ protected final String TEXT_172 = ", ";
+ protected final String TEXT_173 = ");";
+ protected final String TEXT_174 = NL;
+ protected final String TEXT_175 = NL + "\t\t// Initialize data types";
+ protected final String TEXT_176 = NL + "\t\tinitializeType(";
+ protected final String TEXT_177 = "Type, ";
+ protected final String TEXT_178 = ".class, \"";
+ protected final String TEXT_179 = "\", ";
+ protected final String TEXT_180 = ", ";
+ protected final String TEXT_181 = ");";
+ protected final String TEXT_182 = NL + "\t\tsetInstanceProperty (";
+ protected final String TEXT_183 = "Type, \"";
+ protected final String TEXT_184 = "\", ";
+ protected final String TEXT_185 = ", ";
+ protected final String TEXT_186 = ");";
+ protected final String TEXT_187 = NL;
+ protected final String TEXT_188 = NL + "\t\tcreateXSDMetaData(theModelPackageImpl);" + NL + "\t}" + NL + "\t " + NL + "\tprotected void createXSDMetaData(ModelFactoryImpl theModelPackageImpl)" + NL + "\t{" + NL + "\t\tsuper.createXSDMetaData();" + NL + "\t\t" + NL + "\t\t";
+ protected final String TEXT_189 = " property = null;" + NL + "\t\t";
+ protected final String TEXT_190 = NL + "\t\taddXSDMapping" + NL + "\t\t (new String[]" + NL + "\t\t\t {";
+ protected final String TEXT_191 = NL + "\t\t\t ";
+ protected final String TEXT_192 = ", ";
+ protected final String TEXT_193 = NL + "\t\t\t });" + NL;
+ protected final String TEXT_194 = NL + "\t\taddXSDMapping" + NL + "\t\t (";
+ protected final String TEXT_195 = "Type," + NL + "\t\t\t new String[] " + NL + "\t\t\t {";
+ protected final String TEXT_196 = NL + "\t\t\t ";
+ protected final String TEXT_197 = ", ";
+ protected final String TEXT_198 = NL + "\t\t\t });" + NL;
+ protected final String TEXT_199 = NL + "\t\tproperty = createGlobalProperty" + NL + "\t\t (\"";
+ protected final String TEXT_200 = "\"," + NL + "\t\t ";
+ protected final String TEXT_201 = ".get";
+ protected final String TEXT_202 = "()," + NL + "\t\t\t new String[]" + NL + "\t\t\t {";
+ protected final String TEXT_203 = NL + "\t\t\t ";
+ protected final String TEXT_204 = ", ";
+ protected final String TEXT_205 = NL + "\t\t\t }," + NL + "\t\t\t IS_ATTRIBUTE);";
+ protected final String TEXT_206 = NL + "\t\t\t });";
+ protected final String TEXT_207 = NL + " ";
+ protected final String TEXT_208 = NL + "\t\tsetInstanceProperty" + NL + "\t\t (property," + NL + "\t\t\t \"";
+ protected final String TEXT_209 = "\"," + NL + "\t\t\t ";
+ protected final String TEXT_210 = ", ";
+ protected final String TEXT_211 = ");";
+ protected final String TEXT_212 = NL + " ";
+ protected final String TEXT_213 = " ";
+ protected final String TEXT_214 = NL + "\t\taddXSDMapping" + NL + "\t\t ((";
+ protected final String TEXT_215 = ")";
+ protected final String TEXT_216 = "Type.getProperties().get(";
+ protected final String TEXT_217 = ".";
+ protected final String TEXT_218 = ")," + NL + "\t\t\t new String[]" + NL + "\t\t\t {";
+ protected final String TEXT_219 = NL + "\t\t\t ";
+ protected final String TEXT_220 = ", ";
+ protected final String TEXT_221 = NL + "\t\t\t });" + NL;
+ protected final String TEXT_222 = NL + " }" + NL + " ";
+ protected final String TEXT_223 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
+ protected final String TEXT_224 = " create";
+ protected final String TEXT_225 = "(String literal)" + NL + "\t{";
+ protected final String TEXT_226 = NL + "\t\t";
+ protected final String TEXT_227 = " result = ";
+ protected final String TEXT_228 = ".get(literal);" + NL + "\t\tif (result == null) throw new IllegalArgumentException(\"The value '\" + literal + \"' is not a valid enumerator of '\" + ";
+ protected final String TEXT_229 = ".getName() + \"'\");";
+ protected final String TEXT_230 = NL + "\t\treturn result;";
+ protected final String TEXT_231 = NL + "\t\treturn new ";
+ protected final String TEXT_232 = "(create";
+ protected final String TEXT_233 = "(literal));";
+ protected final String TEXT_234 = NL + "\t\treturn create";
+ protected final String TEXT_235 = "(literal);";
+ protected final String TEXT_236 = NL + "\t\treturn new ";
+ protected final String TEXT_237 = "(";
+ protected final String TEXT_238 = ".create";
+ protected final String TEXT_239 = "(literal));";
+ protected final String TEXT_240 = NL + "\t\treturn ";
+ protected final String TEXT_241 = ".create";
+ protected final String TEXT_242 = "(literal);";
+ protected final String TEXT_243 = NL + "\t\treturn (";
+ protected final String TEXT_244 = ")";
+ protected final String TEXT_245 = ".createFromString(";
+ protected final String TEXT_246 = ", literal);";
+ protected final String TEXT_247 = NL + "\t\tif (literal == null) return null;" + NL + "\t\t";
+ protected final String TEXT_248 = " result = new ";
+ protected final String TEXT_249 = "();" + NL + "\t\tfor (";
+ protected final String TEXT_250 = " stringTokenizer = new ";
+ protected final String TEXT_251 = "(literal); stringTokenizer.hasMoreTokens(); )" + NL + "\t\t{" + NL + "\t\t\tString item = stringTokenizer.nextToken();";
+ protected final String TEXT_252 = NL + "\t\t\tresult.add(create";
+ protected final String TEXT_253 = "(item));";
+ protected final String TEXT_254 = NL + "\t\t\tresult.add(create";
+ protected final String TEXT_255 = "FromString(";
+ protected final String TEXT_256 = ", item));";
+ protected final String TEXT_257 = NL + "\t\t\tresult.add(";
+ protected final String TEXT_258 = ".create";
+ protected final String TEXT_259 = "(item));";
+ protected final String TEXT_260 = NL + "\t\t\tresult.add(";
+ protected final String TEXT_261 = ".createFromString(";
+ protected final String TEXT_262 = ", item));";
+ protected final String TEXT_263 = NL + "\t\t}" + NL + "\t\treturn result;";
+ protected final String TEXT_264 = NL + "\t\tif (literal == null) return ";
+ protected final String TEXT_265 = ";" + NL + "\t\t";
+ protected final String TEXT_266 = " result = ";
+ protected final String TEXT_267 = ";" + NL + "\t\tRuntimeException exception = null;";
+ protected final String TEXT_268 = NL + "\t\ttry" + NL + "\t\t{";
+ protected final String TEXT_269 = NL + "\t\t\tresult = create";
+ protected final String TEXT_270 = "(literal);";
+ protected final String TEXT_271 = NL + "\t\t\tresult = (";
+ protected final String TEXT_272 = ")create";
+ protected final String TEXT_273 = "FromString(";
+ protected final String TEXT_274 = ", literal);";
+ protected final String TEXT_275 = NL + "\t\t\tresult = ";
+ protected final String TEXT_276 = ".create";
+ protected final String TEXT_277 = "(literal);";
+ protected final String TEXT_278 = NL + "\t\t\tresult = (";
+ protected final String TEXT_279 = ")";
+ protected final String TEXT_280 = ".createFromString(";
+ protected final String TEXT_281 = ", literal);";
+ protected final String TEXT_282 = NL + "\t\t\tif (";
+ protected final String TEXT_283 = "result != null && ";
+ protected final String TEXT_284 = ".INSTANCE.validate(";
+ protected final String TEXT_285 = ", ";
+ protected final String TEXT_286 = "new ";
+ protected final String TEXT_287 = "(result)";
+ protected final String TEXT_288 = "result";
+ protected final String TEXT_289 = ", null, null))" + NL + "\t\t\t{" + NL + "\t\t\t\treturn result;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tcatch (RuntimeException e)" + NL + "\t\t{" + NL + "\t\t\texception = e;" + NL + "\t\t}";
+ protected final String TEXT_290 = NL + "\t\tif (";
+ protected final String TEXT_291 = "result != null || ";
+ protected final String TEXT_292 = "exception == null) return result;" + NL + " " + NL + "\t\tthrow exception;";
+ protected final String TEXT_293 = NL + "\t\t// TODO: implement this method" + NL + "\t\t// Ensure that you remove @generated or mark it @generated NOT" + NL + "\t\tthrow new ";
+ protected final String TEXT_294 = "();";
+ protected final String TEXT_295 = NL + "\t\treturn ((";
+ protected final String TEXT_296 = ")super.createFromString(";
+ protected final String TEXT_297 = ", literal)).";
+ protected final String TEXT_298 = "();";
+ protected final String TEXT_299 = NL + "\t\treturn (";
+ protected final String TEXT_300 = ")super.createFromString(";
+ protected final String TEXT_301 = ", literal);";
+ protected final String TEXT_302 = NL + "\t}" + NL;
+ protected final String TEXT_303 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
+ protected final String TEXT_304 = " create";
+ protected final String TEXT_305 = "FromString(";
+ protected final String TEXT_306 = " type, String initialValue)" + NL + "\t{";
+ protected final String TEXT_307 = NL + "\t\treturn create";
+ protected final String TEXT_308 = "(initialValue);";
+ protected final String TEXT_309 = NL + "\t\t";
+ protected final String TEXT_310 = " result = ";
+ protected final String TEXT_311 = ".get(initialValue);" + NL + "\t\tif (result == null) throw new IllegalArgumentException(\"The value '\" + initialValue + \"' is not a valid enumerator of '\" + type.getName() + \"'\");";
+ protected final String TEXT_312 = NL + "\t\treturn result;";
+ protected final String TEXT_313 = NL + "\t\treturn (";
+ protected final String TEXT_314 = ")create";
+ protected final String TEXT_315 = "FromString(";
+ protected final String TEXT_316 = ", initialValue);";
+ protected final String TEXT_317 = NL + "\t\treturn (";
+ protected final String TEXT_318 = ")";
+ protected final String TEXT_319 = ".createFromString(";
+ protected final String TEXT_320 = ", initialValue);";
+ protected final String TEXT_321 = NL + "\t\treturn create";
+ protected final String TEXT_322 = "(initialValue);";
+ protected final String TEXT_323 = NL + "\t\tif (initialValue == null) return null;" + NL + "\t\t";
+ protected final String TEXT_324 = " result = new ";
+ protected final String TEXT_325 = "();" + NL + "\t\tfor (";
+ protected final String TEXT_326 = " stringTokenizer = new ";
+ protected final String TEXT_327 = "(initialValue); stringTokenizer.hasMoreTokens(); )" + NL + "\t\t{" + NL + "\t\t\tString item = stringTokenizer.nextToken();";
+ protected final String TEXT_328 = NL + "\t\t\tresult.add(create";
+ protected final String TEXT_329 = "FromString(";
+ protected final String TEXT_330 = ", item));";
+ protected final String TEXT_331 = NL + "\t\t\tresult.add(";
+ protected final String TEXT_332 = ".createFromString(";
+ protected final String TEXT_333 = ", item));";
+ protected final String TEXT_334 = NL + "\t\t}" + NL + "\t\treturn result;";
+ protected final String TEXT_335 = NL + "\t\treturn new ";
+ protected final String TEXT_336 = "(create";
+ protected final String TEXT_337 = "(initialValue));";
+ protected final String TEXT_338 = NL + "\t\treturn create";
+ protected final String TEXT_339 = "(initialValue);";
+ protected final String TEXT_340 = NL + "\t\tif (initialValue == null) return null;" + NL + "\t\t";
+ protected final String TEXT_341 = " result = null;" + NL + "\t\tRuntimeException exception = null;";
+ protected final String TEXT_342 = NL + "\t\ttry" + NL + "\t\t{";
+ protected final String TEXT_343 = NL + "\t\t\tresult = (";
+ protected final String TEXT_344 = ")create";
+ protected final String TEXT_345 = "FromString(";
+ protected final String TEXT_346 = ", initialValue);";
+ protected final String TEXT_347 = NL + "\t\t\tresult = (";
+ protected final String TEXT_348 = ")";
+ protected final String TEXT_349 = ".createFromString(";
+ protected final String TEXT_350 = ", initialValue);";
+ protected final String TEXT_351 = NL + "\t\t\tif (result != null && ";
+ protected final String TEXT_352 = ".INSTANCE.validate(type, result, null, null))" + NL + "\t\t\t{" + NL + "\t\t\t\treturn result;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tcatch (RuntimeException e)" + NL + "\t\t{" + NL + "\t\t\texception = e;" + NL + "\t\t}";
+ protected final String TEXT_353 = NL + "\t\tif (result != null || exception == null) return result;" + NL + " " + NL + "\t\tthrow exception;";
+ protected final String TEXT_354 = NL + "\t\t// TODO: implement this method" + NL + "\t\t// Ensure that you remove @generated or mark it @generated NOT" + NL + "\t\tthrow new ";
+ protected final String TEXT_355 = "();";
+ protected final String TEXT_356 = NL + "\t\treturn (";
+ protected final String TEXT_357 = ")super.createFromString(type, initialValue);";
+ protected final String TEXT_358 = NL + "\t}" + NL;
+ protected final String TEXT_359 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic String convert";
+ protected final String TEXT_360 = "(";
+ protected final String TEXT_361 = " instanceValue)" + NL + "\t{";
+ protected final String TEXT_362 = NL + "\t\treturn instanceValue == null ? null : instanceValue.toString();";
+ protected final String TEXT_363 = NL + "\t\treturn instanceValue == null ? null : convert";
+ protected final String TEXT_364 = "(instanceValue.";
+ protected final String TEXT_365 = "());";
+ protected final String TEXT_366 = NL + "\t\treturn convert";
+ protected final String TEXT_367 = "(instanceValue);";
+ protected final String TEXT_368 = NL + "\t\treturn ";
+ protected final String TEXT_369 = ".convert";
+ protected final String TEXT_370 = "(instanceValue);";
+ protected final String TEXT_371 = NL + "\t\treturn ";
+ protected final String TEXT_372 = ".convertToString(";
+ protected final String TEXT_373 = ", instanceValue);";
+ protected final String TEXT_374 = NL + "\t\tif (instanceValue == null) return null;" + NL + "\t\tif (instanceValue.isEmpty()) return \"\";" + NL + "\t\t";
+ protected final String TEXT_375 = " result = new ";
+ protected final String TEXT_376 = "();" + NL + "\t\tfor (";
+ protected final String TEXT_377 = " i = instanceValue.iterator(); i.hasNext(); )" + NL + "\t\t{";
+ protected final String TEXT_378 = NL + "\t\t\tresult.append(convert";
+ protected final String TEXT_379 = "((";
+ protected final String TEXT_380 = ")i.next()));";
+ protected final String TEXT_381 = NL + "\t\t\tresult.append(convert";
+ protected final String TEXT_382 = "ToString(";
+ protected final String TEXT_383 = ", i.next()));";
+ protected final String TEXT_384 = NL + "\t\t\tresult.append(";
+ protected final String TEXT_385 = ".convert";
+ protected final String TEXT_386 = "((";
+ protected final String TEXT_387 = ")i.next()));";
+ protected final String TEXT_388 = NL + "\t\t\tresult.append(";
+ protected final String TEXT_389 = ".convertToString(";
+ protected final String TEXT_390 = ", i.next()));";
+ protected final String TEXT_391 = NL + "\t\t\tresult.append(' ');" + NL + "\t\t}" + NL + "\t\treturn result.substring(0, result.length() - 1);";
+ protected final String TEXT_392 = NL + "\t\tif (instanceValue == null) return null;";
+ protected final String TEXT_393 = NL + "\t\tif (";
+ protected final String TEXT_394 = ".isInstance(instanceValue))" + NL + "\t\t{" + NL + "\t\t\ttry" + NL + "\t\t\t{";
+ protected final String TEXT_395 = NL + "\t\t\t\tString value = convert";
+ protected final String TEXT_396 = "(instanceValue);";
+ protected final String TEXT_397 = NL + "\t\t\t\tString value = convert";
+ protected final String TEXT_398 = "ToString(";
+ protected final String TEXT_399 = ", instanceValue);";
+ protected final String TEXT_400 = NL + "\t\t\t\tString value = ";
+ protected final String TEXT_401 = ".convert";
+ protected final String TEXT_402 = "((";
+ protected final String TEXT_403 = ")instanceValue);";
+ protected final String TEXT_404 = NL + "\t\t\t\tString value = ";
+ protected final String TEXT_405 = ".convertToString(";
+ protected final String TEXT_406 = ", instanceValue);";
+ protected final String TEXT_407 = NL + "\t\t\t\tif (value != null) return value;" + NL + "\t\t\t}" + NL + "\t\t\tcatch (Exception e)" + NL + "\t\t\t{" + NL + "\t\t\t}" + NL + "\t\t}";
+ protected final String TEXT_408 = NL + "\t\ttry" + NL + "\t\t{";
+ protected final String TEXT_409 = NL + "\t\t\tString value = convert";
+ protected final String TEXT_410 = "(instanceValue);";
+ protected final String TEXT_411 = NL + "\t\t\tString value = convert";
+ protected final String TEXT_412 = "ToString(";
+ protected final String TEXT_413 = ", new ";
+ protected final String TEXT_414 = "(instanceValue));";
+ protected final String TEXT_415 = NL + "\t\t\tString value = ";
+ protected final String TEXT_416 = ".convert";
+ protected final String TEXT_417 = "(instanceValue);";
+ protected final String TEXT_418 = NL + "\t\t\tString value = ";
+ protected final String TEXT_419 = ".convertToString(";
+ protected final String TEXT_420 = ", new ";
+ protected final String TEXT_421 = "(instanceValue));";
+ protected final String TEXT_422 = NL + "\t\t\tif (value != null) return value;" + NL + "\t\t}" + NL + "\t\tcatch (Exception e)" + NL + "\t\t{" + NL + "\t\t}";
+ protected final String TEXT_423 = NL + "\t\tthrow new IllegalArgumentException(\"Invalid value: '\"+instanceValue+\"' for datatype :\"+";
+ protected final String TEXT_424 = ".getName());";
+ protected final String TEXT_425 = NL + "\t\t// TODO: implement this method" + NL + "\t\t// Ensure that you remove @generated or mark it @generated NOT" + NL + "\t\tthrow new ";
+ protected final String TEXT_426 = "();";
+ protected final String TEXT_427 = NL + "\t\treturn super.convertToString(";
+ protected final String TEXT_428 = ", new ";
+ protected final String TEXT_429 = "(instanceValue));";
+ protected final String TEXT_430 = NL + "\t\treturn super.convertToString(";
+ protected final String TEXT_431 = ", instanceValue);";
+ protected final String TEXT_432 = NL + "\t}" + NL;
+ protected final String TEXT_433 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic String convert";
+ protected final String TEXT_434 = "ToString(";
+ protected final String TEXT_435 = " type, Object instanceValue)" + NL + "\t{";
+ protected final String TEXT_436 = NL + "\t\treturn instanceValue == null ? null : instanceValue.toString();";
+ protected final String TEXT_437 = NL + "\t\treturn convert";
+ protected final String TEXT_438 = "ToString(";
+ protected final String TEXT_439 = ", instanceValue);";
+ protected final String TEXT_440 = NL + "\t\treturn ";
+ protected final String TEXT_441 = ".convertToString(";
+ protected final String TEXT_442 = ", instanceValue);";
+ protected final String TEXT_443 = NL + "\t\treturn convert";
+ protected final String TEXT_444 = "((";
+ protected final String TEXT_445 = ")instanceValue);";
+ protected final String TEXT_446 = NL + "\t\tif (instanceValue == null) return null;" + NL + "\t\t";
+ protected final String TEXT_447 = " list = (";
+ protected final String TEXT_448 = ")instanceValue;" + NL + "\t\tif (list.isEmpty()) return \"\";" + NL + "\t\t";
+ protected final String TEXT_449 = " result = new ";
+ protected final String TEXT_450 = "();" + NL + "\t\tfor (";
+ protected final String TEXT_451 = " i = list.iterator(); i.hasNext(); )" + NL + "\t\t{";
+ protected final String TEXT_452 = NL + "\t\t\tresult.append(convert";
+ protected final String TEXT_453 = "ToString(";
+ protected final String TEXT_454 = ", i.next()));";
+ protected final String TEXT_455 = NL + "\t\t\tresult.append(";
+ protected final String TEXT_456 = ".convertToString(";
+ protected final String TEXT_457 = ", i.next()));";
+ protected final String TEXT_458 = NL + "\t\t\tresult.append(' ');" + NL + "\t\t}" + NL + "\t\treturn result.substring(0, result.length() - 1);";
+ protected final String TEXT_459 = NL + "\t\treturn instanceValue == null ? null : convert";
+ protected final String TEXT_460 = "(((";
+ protected final String TEXT_461 = ")instanceValue).";
+ protected final String TEXT_462 = "());";
+ protected final String TEXT_463 = NL + "\t\treturn convert";
+ protected final String TEXT_464 = "(instanceValue);";
+ protected final String TEXT_465 = NL + "\t\tif (instanceValue == null) return null;";
+ protected final String TEXT_466 = NL + "\t\tif (";
+ protected final String TEXT_467 = ".isInstance(instanceValue))" + NL + "\t\t{" + NL + "\t\t\ttry" + NL + "\t\t\t{";
+ protected final String TEXT_468 = NL + "\t\t\t\tString value = convert";
+ protected final String TEXT_469 = "ToString(";
+ protected final String TEXT_470 = ", instanceValue);";
+ protected final String TEXT_471 = NL + "\t\t\t\tString value = ";
+ protected final String TEXT_472 = ".convertToString(";
+ protected final String TEXT_473 = ", instanceValue);";
+ protected final String TEXT_474 = NL + "\t\t\t\tif (value != null) return value;" + NL + "\t\t\t}" + NL + "\t\t\tcatch (Exception e)" + NL + "\t\t\t{" + NL + "\t\t\t}" + NL + "\t\t}";
+ protected final String TEXT_475 = NL + "\t\tthrow new IllegalArgumentException(\"Invalid value: '\"+instanceValue+\"' for datatype :\"+type.getName());";
+ protected final String TEXT_476 = NL + "\t\t// TODO: implement this method" + NL + "\t\t// Ensure that you remove @generated or mark it @generated NOT" + NL + "\t\tthrow new ";
+ protected final String TEXT_477 = "();";
+ protected final String TEXT_478 = NL + "\t\treturn super.convertToString(type, instanceValue);";
+ protected final String TEXT_479 = NL + "\t}" + NL;
+ protected final String TEXT_480 = NL + "\t/**" + NL + "\t * Returns a new object of class '<em>";
+ protected final String TEXT_481 = "</em>'." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @return a new object of class '<em>";
+ protected final String TEXT_482 = "</em>'." + NL + "\t * @generated" + NL + "\t */" + NL + "\t";
+ protected final String TEXT_483 = " create";
+ protected final String TEXT_484 = "();" + NL;
+ protected final String TEXT_485 = NL + "\t/**" + NL + "\t * Returns an instance of data type '<em>";
+ protected final String TEXT_486 = "</em>' corresponding the given literal." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @param literal a literal of the data type." + NL + "\t * @return a new instance value of the data type." + NL + "\t * @generated" + NL + "\t */" + NL + "\t";
+ protected final String TEXT_487 = " create";
+ protected final String TEXT_488 = "(String literal);" + NL + "" + NL + "\t/**" + NL + "\t * Returns a literal representation of an instance of data type '<em>";
+ protected final String TEXT_489 = "</em>'." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @param instanceValue an instance value of the data type." + NL + "\t * @return a literal representation of the instance value." + NL + "\t * @generated" + NL + "\t */" + NL + "\tString convert";
+ protected final String TEXT_490 = "(";
+ protected final String TEXT_491 = " instanceValue);" + NL;
+ protected final String TEXT_492 = NL + "} //";
+ protected final String TEXT_493 = NL;
+
+ public String generate(Object argument)
+ {
+ final StringBuffer stringBuffer = new StringBuffer();
+
+
+ GenPackage genPackage = (GenPackage)((Object[])argument)[0]; GenModel genModel=genPackage.getGenModel();
+ boolean isInterface = Boolean.TRUE.equals(((Object[])argument)[1]); boolean isImplementation = Boolean.TRUE.equals(((Object[])argument)[2]);
+ String publicStaticFinalFlag = isImplementation ? "public static final " : "";
+ stringBuffer.append(TEXT_1);
+ stringBuffer.append(TEXT_2);
+ stringBuffer.append("$");
+ stringBuffer.append(TEXT_3);
+ stringBuffer.append("$");
+ stringBuffer.append(TEXT_4);
+ if (isInterface || genModel.isSuppressInterfaces()) {
+ stringBuffer.append(TEXT_5);
+ stringBuffer.append(genPackage.getReflectionPackageName());
+ stringBuffer.append(TEXT_6);
+ } else {
+ stringBuffer.append(TEXT_7);
+ stringBuffer.append(genPackage.getClassPackageName());
+ stringBuffer.append(TEXT_8);
+ }
+ stringBuffer.append(TEXT_9);
+ if (isImplementation) {
+ if (!genPackage.hasJavaLangConflict() && !genPackage.hasInterfaceImplConflict() && !genPackage.getClassPackageName().equals(genPackage.getInterfacePackageName())) genModel.addImport(genPackage.getInterfacePackageName() + ".*");
+ }
+ genModel.markImportLocation(stringBuffer);
+ stringBuffer.append(TEXT_10);
+ if (isInterface) {
+ stringBuffer.append(TEXT_11);
+ if (!genModel.isSuppressEMFMetaData()) {
+ stringBuffer.append(TEXT_12);
+ stringBuffer.append(genPackage.getQualifiedPackageInterfaceName());
+ }
+ stringBuffer.append(TEXT_13);
+ } else {
+ stringBuffer.append(TEXT_14);
+ }
+ if (isImplementation) {
+ stringBuffer.append(TEXT_15);
+ stringBuffer.append(genPackage.getFactoryClassName());
+ stringBuffer.append(TEXT_16);
+ stringBuffer.append(genModel.getImportedName("org.apache.tuscany.sdo.impl.FactoryBase"));
+ if (!genModel.isSuppressInterfaces()) {
+ stringBuffer.append(TEXT_17);
+ stringBuffer.append(genPackage.getImportedFactoryInterfaceName());
+ }
+ } else {
+ stringBuffer.append(TEXT_18);
+ stringBuffer.append(genPackage.getFactoryInterfaceName());
+ if (!genModel.isSuppressEMFMetaData()) {
+ stringBuffer.append(TEXT_19);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.EFactory"));
+ }
+ }
+ stringBuffer.append(TEXT_20);
+ if (genModel.getCopyrightText() != null) {
+ stringBuffer.append(TEXT_21);
+ stringBuffer.append(publicStaticFinalFlag);
+ stringBuffer.append(genModel.getImportedName("java.lang.String"));
+ stringBuffer.append(TEXT_22);
+ stringBuffer.append(genModel.getCopyrightText());
+ stringBuffer.append(TEXT_23);
+ stringBuffer.append(genModel.getNonNLS());
+ stringBuffer.append(TEXT_24);
+ }
+ stringBuffer.append(TEXT_25);
+ if (isInterface && genModel.isSuppressEMFMetaData()) {
+ stringBuffer.append(TEXT_26);
+ stringBuffer.append(publicStaticFinalFlag);
+ stringBuffer.append(genPackage.getFactoryInterfaceName());
+ stringBuffer.append(TEXT_27);
+ stringBuffer.append(genPackage.getQualifiedFactoryClassName());
+ stringBuffer.append(TEXT_28);
+ } else if (isInterface && !genModel.isSuppressInterfaces()) {
+ stringBuffer.append(TEXT_29);
+ stringBuffer.append(publicStaticFinalFlag);
+ stringBuffer.append(genPackage.getFactoryInterfaceName());
+ stringBuffer.append(TEXT_30);
+ stringBuffer.append(genPackage.getQualifiedFactoryClassName());
+ stringBuffer.append(TEXT_31);
+ }
+ if (isImplementation) {
+ stringBuffer.append(TEXT_32);
+ stringBuffer.append(publicStaticFinalFlag);
+ stringBuffer.append(genModel.getImportedName("java.lang.String"));
+ stringBuffer.append(TEXT_33);
+ stringBuffer.append(genPackage.getNSURI());
+ stringBuffer.append(TEXT_34);
+ stringBuffer.append(genModel.getNonNLS());
+ stringBuffer.append(TEXT_35);
+ stringBuffer.append(publicStaticFinalFlag);
+ stringBuffer.append(genModel.getImportedName("java.lang.String"));
+ stringBuffer.append(TEXT_36);
+ stringBuffer.append(genPackage.getNSName());
+ stringBuffer.append(TEXT_37);
+ stringBuffer.append(genModel.getNonNLS());
+ int genIndex = 1;
+for (Iterator i=genPackage.getOrderedGenClassifiers().iterator(); i.hasNext();) { GenClassifier genClassifier = (GenClassifier)i.next();
+ if (!genPackage.getClassifierID(genClassifier).equals("DOCUMENT_ROOT")) {
+ stringBuffer.append(TEXT_38);
+ stringBuffer.append(publicStaticFinalFlag);
+ stringBuffer.append(TEXT_39);
+ stringBuffer.append(genPackage.getClassifierID(genClassifier));
+ stringBuffer.append(TEXT_40);
+ stringBuffer.append(genIndex);
+ stringBuffer.append(TEXT_41);
+ genIndex++;
+ } }
+ stringBuffer.append(TEXT_42);
+ String factoryType = genModel.isSuppressEMFMetaData() ? genPackage.getFactoryClassName() : genPackage.getImportedFactoryInterfaceName();
+ stringBuffer.append(TEXT_43);
+ stringBuffer.append(genPackage.getFactoryClassName());
+ stringBuffer.append(TEXT_44);
+ stringBuffer.append(genModel.getImportedName("commonj.sdo.DataObject"));
+ stringBuffer.append(TEXT_45);
+ for (Iterator i=genPackage.getGenClasses().iterator(); i.hasNext();) { GenClass genClass = (GenClass)i.next();
+ if (!genClass.isAbstract() && !genClass.isDynamic()) {
+ stringBuffer.append(TEXT_46);
+ stringBuffer.append(genClass.getClassifierID());
+ stringBuffer.append(TEXT_47);
+ stringBuffer.append(genModel.getImportedName("commonj.sdo.DataObject"));
+ stringBuffer.append(TEXT_48);
+ stringBuffer.append(genClass.getName());
+ stringBuffer.append(TEXT_49);
+ }
+ }
+ stringBuffer.append(TEXT_50);
+ if (!genPackage.getAllGenDataTypes().isEmpty()) {
+ stringBuffer.append(TEXT_51);
+ stringBuffer.append(genModel.getImportedName("commonj.sdo.Type"));
+ stringBuffer.append(TEXT_52);
+ for (Iterator i=genPackage.getAllGenDataTypes().iterator(); i.hasNext();) { GenDataType genDataType = (GenDataType)i.next();
+ if (genDataType.isSerializable()) {
+ stringBuffer.append(TEXT_53);
+ stringBuffer.append(genDataType.getClassifierID());
+ stringBuffer.append(TEXT_54);
+ stringBuffer.append(genDataType.getName());
+ stringBuffer.append(TEXT_55);
+ }
+ }
+ stringBuffer.append(TEXT_56);
+ stringBuffer.append(genModel.getNonNLS());
+ stringBuffer.append(genModel.getNonNLS(2));
+ stringBuffer.append(TEXT_57);
+ stringBuffer.append(genModel.getImportedName("commonj.sdo.Type"));
+ stringBuffer.append(TEXT_58);
+ for (Iterator i=genPackage.getAllGenDataTypes().iterator(); i.hasNext();) { GenDataType genDataType = (GenDataType)i.next();
+ if (genDataType.isSerializable()) {
+ stringBuffer.append(TEXT_59);
+ stringBuffer.append(genDataType.getClassifierID());
+ stringBuffer.append(TEXT_60);
+ stringBuffer.append(genDataType.getName());
+ stringBuffer.append(TEXT_61);
+ }
+ }
+ stringBuffer.append(TEXT_62);
+ stringBuffer.append(genModel.getNonNLS());
+ stringBuffer.append(genModel.getNonNLS(2));
+ stringBuffer.append(TEXT_63);
+ }
+ for (Iterator i=genPackage.getGenClasses().iterator(); i.hasNext();) { GenClass genClass = (GenClass)i.next();
+ if (!genClass.isAbstract() && !genClass.isDynamic()) {
+ stringBuffer.append(TEXT_64);
+ stringBuffer.append(genClass.getImportedInterfaceName());
+ stringBuffer.append(TEXT_65);
+ stringBuffer.append(genClass.getName());
+ stringBuffer.append(TEXT_66);
+ if (genClass.isDynamic()) {
+ stringBuffer.append(TEXT_67);
+ stringBuffer.append(genClass.getImportedInterfaceName());
+ stringBuffer.append(TEXT_68);
+ stringBuffer.append(genClass.getSafeUncapName());
+ stringBuffer.append(TEXT_69);
+ stringBuffer.append(genClass.getCastFromEObject());
+ stringBuffer.append(TEXT_70);
+ stringBuffer.append(genClass.getQualifiedClassifierAccessor());
+ stringBuffer.append(TEXT_71);
+ } else {
+ stringBuffer.append(TEXT_72);
+ stringBuffer.append(genClass.getImportedClassName());
+ stringBuffer.append(TEXT_73);
+ stringBuffer.append(genClass.getSafeUncapName());
+ stringBuffer.append(TEXT_74);
+ stringBuffer.append(genClass.getImportedClassName());
+ stringBuffer.append(TEXT_75);
+ if (genModel.isSuppressInterfaces() && !genPackage.getReflectionPackageName().equals(genPackage.getInterfacePackageName())) {
+ stringBuffer.append(TEXT_76);
+ }
+ stringBuffer.append(TEXT_77);
+ }
+ stringBuffer.append(TEXT_78);
+ stringBuffer.append(genClass.getSafeUncapName());
+ stringBuffer.append(TEXT_79);
+ }
+ }
+ stringBuffer.append(TEXT_80);
+ for (Iterator i=genPackage.getOrderedGenClassifiers().iterator(); i.hasNext();) { GenClassifier genClassifier = (GenClassifier)i.next();
+ stringBuffer.append(TEXT_81);
+ if (!genPackage.getClassifierID(genClassifier).equals("DOCUMENT_ROOT")) {
+ stringBuffer.append(TEXT_82);
+ stringBuffer.append(genModel.getImportedName("commonj.sdo.Type"));
+ stringBuffer.append(TEXT_83);
+ stringBuffer.append(genClassifier.getSafeUncapName());
+ stringBuffer.append(TEXT_84);
+ stringBuffer.append(genModel.getImportedName("commonj.sdo.Type"));
+ stringBuffer.append(TEXT_85);
+ stringBuffer.append(genClassifier.getClassifierAccessorName());
+ stringBuffer.append(TEXT_86);
+ stringBuffer.append(genClassifier.getSafeUncapName());
+ stringBuffer.append(TEXT_87);
+ } }
+ stringBuffer.append(TEXT_88);
+ stringBuffer.append(factoryType);
+ stringBuffer.append(TEXT_89);
+ stringBuffer.append(factoryType);
+ stringBuffer.append(TEXT_90);
+ stringBuffer.append(factoryType);
+ stringBuffer.append(TEXT_91);
+ stringBuffer.append(factoryType);
+ stringBuffer.append(TEXT_92);
+ stringBuffer.append(factoryType);
+ stringBuffer.append(TEXT_93);
+ stringBuffer.append(factoryType);
+ stringBuffer.append(TEXT_94);
+ stringBuffer.append(genModel.getImportedName("org.apache.tuscany.sdo.util.SDOUtil"));
+ stringBuffer.append(TEXT_95);
+ stringBuffer.append(genModel.getImportedName("org.apache.tuscany.sdo.impl.SDOFactoryImpl"));
+ stringBuffer.append(TEXT_96);
+ stringBuffer.append(genModel.getImportedName("org.apache.tuscany.sdo.util.SDOUtil"));
+ stringBuffer.append(TEXT_97);
+ stringBuffer.append(genModel.getImportedName("org.apache.tuscany.sdo.model.impl.ModelPackageImpl"));
+ stringBuffer.append(TEXT_98);
+ stringBuffer.append(factoryType);
+ stringBuffer.append(TEXT_99);
+ stringBuffer.append(factoryType);
+ stringBuffer.append(TEXT_100);
+ stringBuffer.append(factoryType);
+ stringBuffer.append(TEXT_101);
+ stringBuffer.append(factoryType);
+ stringBuffer.append(TEXT_102);
+ if (!genPackage.getGenClasses().isEmpty()) {
+ stringBuffer.append(TEXT_103);
+ for (Iterator i=genPackage.getGenClasses().iterator(); i.hasNext();) { GenClass genClass = (GenClass)i.next();
+ stringBuffer.append(TEXT_104);
+ if (!genClass.isAbstract() && !genClass.isDynamic()) {
+ stringBuffer.append(TEXT_105);
+ stringBuffer.append(genClass.getSafeUncapName());
+ stringBuffer.append(TEXT_106);
+ stringBuffer.append(genPackage.getClassifierID(genClass));
+ stringBuffer.append(TEXT_107);
+ for (Iterator j=genClass.getGenFeatures().iterator(); j.hasNext();) { GenFeature genFeature = (GenFeature)j.next();
+ stringBuffer.append(TEXT_108);
+ stringBuffer.append(!genFeature.isReferenceType());
+ stringBuffer.append(TEXT_109);
+ stringBuffer.append(genClass.getSafeUncapName());
+ stringBuffer.append(TEXT_110);
+ stringBuffer.append(genClass.getClassName());
+ stringBuffer.append(TEXT_111);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_112);
+ }
+ }
+ }
+ }
+ if (!genPackage.getGenEnums().isEmpty()) {
+ stringBuffer.append(TEXT_113);
+ for (Iterator e=genPackage.getGenEnums().iterator(); e.hasNext();) { GenEnum genEnum = (GenEnum)e.next();
+ stringBuffer.append(TEXT_114);
+ stringBuffer.append(genEnum.getClassifierInstanceName());
+ stringBuffer.append(TEXT_115);
+ stringBuffer.append(genEnum.getClassifierID());
+ stringBuffer.append(TEXT_116);
+ }
+ }
+ if (!genPackage.getGenDataTypes().isEmpty()) {
+ for (Iterator d=genPackage.getGenDataTypes().iterator(); d.hasNext();) { GenDataType genDataType = (GenDataType)d.next();
+ stringBuffer.append(TEXT_117);
+ stringBuffer.append(genDataType.getSafeUncapName());
+ stringBuffer.append(TEXT_118);
+ stringBuffer.append(genPackage.getClassifierID(genDataType));
+ stringBuffer.append(TEXT_119);
+ }
+ }
+ stringBuffer.append(TEXT_120);
+ if (!genPackage.getPackageInitializationDependencies().isEmpty()) {
+ stringBuffer.append(TEXT_121);
+ for (Iterator p=genPackage.getPackageInitializationDependencies().iterator(); p.hasNext();) { GenPackage dep = (GenPackage)p.next();
+ stringBuffer.append(TEXT_122);
+ stringBuffer.append(dep.getImportedFactoryClassName());
+ stringBuffer.append(TEXT_123);
+ stringBuffer.append(genPackage.getPackageInstanceVariable(dep));
+ stringBuffer.append(TEXT_124);
+ stringBuffer.append(dep.getImportedFactoryClassName());
+ stringBuffer.append(TEXT_125);
+ stringBuffer.append(dep.getImportedFactoryClassName());
+ stringBuffer.append(TEXT_126);
+ }
+ }
+ List annotationSources = genPackage.getAnnotationSources();
+ annotationSources.remove(ExtendedMetaData.ANNOTATION_URI);
+ stringBuffer.append(TEXT_127);
+ stringBuffer.append(genModel.getImportedName("commonj.sdo.Property"));
+ stringBuffer.append(TEXT_128);
+ for (Iterator c=genPackage.getGenClasses().iterator(); c.hasNext();) { GenClass genClass = (GenClass)c.next();
+ for (Iterator b=genClass.getBaseGenClasses().iterator(); b.hasNext();) { GenClass baseGenClass = (GenClass)b.next();
+ stringBuffer.append(TEXT_129);
+ stringBuffer.append(genClass.getSafeUncapName());
+ stringBuffer.append(TEXT_130);
+ stringBuffer.append(baseGenClass.getSafeUncapName());
+ stringBuffer.append(TEXT_131);
+ }
+ }
+ stringBuffer.append(TEXT_132);
+ for (Iterator i=genPackage.getGenClasses().iterator(); i.hasNext();) { GenClass genClass = (GenClass)i.next();
+ if (!genClass.isAbstract() && !genClass.isDynamic()) {
+ stringBuffer.append(TEXT_133);
+ stringBuffer.append(genClass.getSafeUncapName());
+ stringBuffer.append(TEXT_134);
+ stringBuffer.append(genClass.getImportedInterfaceName());
+ stringBuffer.append(TEXT_135);
+ stringBuffer.append(genClass.getName());
+ stringBuffer.append(TEXT_136);
+ for (Iterator sources = annotationSources.iterator(); sources.hasNext();) { String annotationSource = (String)sources.next();
+ EAnnotation classAnnotation = genClass.getEcoreClassifier().getEAnnotation(annotationSource);
+ if (classAnnotation != null) {
+ for (Iterator k = classAnnotation.getDetails().iterator(); k.hasNext();) { Map.Entry detail = (Map.Entry)k.next(); String key = Literals.toStringLiteral((String)detail.getKey(), genModel); String value = Literals.toStringLiteral((String)detail.getValue(), genModel);
+ stringBuffer.append(TEXT_137);
+ stringBuffer.append(genClass.getSafeUncapName());
+ stringBuffer.append(TEXT_138);
+ stringBuffer.append(annotationSource);
+ stringBuffer.append(TEXT_139);
+ stringBuffer.append(key);
+ stringBuffer.append(TEXT_140);
+ stringBuffer.append(value);
+ stringBuffer.append(genModel.getNonNLS(key + value));
+ stringBuffer.append(TEXT_141);
+ }
+ }
+ }
+ stringBuffer.append(TEXT_142);
+ for (Iterator j=genClass.getGenFeatures().iterator(); j.hasNext();) {GenFeature genFeature = (GenFeature)j.next();
+ String type = genFeature.getType().equals("commonj.sdo.Sequence") ? "getSequence()" : genPackage.getPackageInstanceVariable(genFeature.getTypeGenPackage()) + ".get" + genFeature.getTypeClassifierAccessorName() + "()";
+ stringBuffer.append(TEXT_143);
+ stringBuffer.append(genModel.getImportedName("commonj.sdo.Property"));
+ stringBuffer.append(TEXT_144);
+ stringBuffer.append(genClass.getSafeUncapName());
+ stringBuffer.append(TEXT_145);
+ stringBuffer.append(genClass.getClassName());
+ stringBuffer.append(TEXT_146);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_147);
+ if (genFeature.isReferenceType()) { GenFeature reverseGenFeature = genFeature.getReverse();
+ String reverse = reverseGenFeature == null ? "null" : genPackage.getPackageInstanceVariable(reverseGenFeature.getGenPackage()) + ".get" + reverseGenFeature.getFeatureAccessorName() + "()";
+ stringBuffer.append(TEXT_148);
+ stringBuffer.append(type);
+ stringBuffer.append(TEXT_149);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_150);
+ stringBuffer.append(genFeature.getDefaultValue());
+ stringBuffer.append(TEXT_151);
+ stringBuffer.append(genFeature.getLowerBound());
+ stringBuffer.append(TEXT_152);
+ stringBuffer.append(genFeature.getUpperBound());
+ stringBuffer.append(TEXT_153);
+ stringBuffer.append(genFeature.getContainerClass());
+ stringBuffer.append(TEXT_154);
+ stringBuffer.append(genFeature.getChangeableFlag().equals("IS_CHANGEABLE") ? "false" : "true");
+ stringBuffer.append(TEXT_155);
+ stringBuffer.append(genFeature.getUnsettableFlag().equals("IS_UNSETTABLE") ? "true": "false");
+ stringBuffer.append(TEXT_156);
+ stringBuffer.append(genFeature.getDerivedFlag().equals("IS_DERIVED") ? "true" : "false");
+ stringBuffer.append(TEXT_157);
+ stringBuffer.append(genFeature.getContainmentFlag().equals("IS_COMPOSITE")? "true": "false");
+ stringBuffer.append(TEXT_158);
+ stringBuffer.append(reverse);
+ stringBuffer.append(TEXT_159);
+ }else{
+ stringBuffer.append(TEXT_160);
+ stringBuffer.append(type);
+ stringBuffer.append(TEXT_161);
+ stringBuffer.append(genFeature.getSafeName());
+ stringBuffer.append(TEXT_162);
+ stringBuffer.append(genFeature.getDefaultValue());
+ stringBuffer.append(TEXT_163);
+ stringBuffer.append(genFeature.getLowerBound());
+ stringBuffer.append(TEXT_164);
+ stringBuffer.append(genFeature.getUpperBound());
+ stringBuffer.append(TEXT_165);
+ stringBuffer.append(genFeature.getContainerClass());
+ stringBuffer.append(TEXT_166);
+ stringBuffer.append(genFeature.getChangeableFlag().equals("IS_CHANGEABLE") ? "false" : "true");
+ stringBuffer.append(TEXT_167);
+ stringBuffer.append(genFeature.getUnsettableFlag().equals("IS_UNSETTABLE") ? "true": "false");
+ stringBuffer.append(TEXT_168);
+ stringBuffer.append(genFeature.getDerivedFlag().equals("IS_DERIVED") ? "true" : "false");
+ stringBuffer.append(TEXT_169);
+ }
+ for (Iterator sources = annotationSources.iterator(); sources.hasNext();) { String annotationSource = (String)sources.next();
+ EAnnotation featureAnnotation = genFeature.getEcoreFeature().getEAnnotation(annotationSource);
+ if (featureAnnotation != null) {
+ for (Iterator k = featureAnnotation.getDetails().iterator(); k.hasNext();) { Map.Entry detail = (Map.Entry)k.next(); String key = Literals.toStringLiteral((String)detail.getKey(), genModel); String value = Literals.toStringLiteral((String)detail.getValue(), genModel);
+ stringBuffer.append(TEXT_170);
+ stringBuffer.append(annotationSource);
+ stringBuffer.append(TEXT_171);
+ stringBuffer.append(key);
+ stringBuffer.append(TEXT_172);
+ stringBuffer.append(value);
+ stringBuffer.append(genModel.getNonNLS(key + value));
+ stringBuffer.append(TEXT_173);
+ }
+ }
+ }
+ stringBuffer.append(TEXT_174);
+ }
+ }
+ }
+ if (!genPackage.getGenDataTypes().isEmpty()) {
+ stringBuffer.append(TEXT_175);
+ for (Iterator d=genPackage.getGenDataTypes().iterator(); d.hasNext();) { GenDataType genDataType = (GenDataType)d.next();
+ stringBuffer.append(TEXT_176);
+ stringBuffer.append(genDataType.getSafeUncapName());
+ stringBuffer.append(TEXT_177);
+ stringBuffer.append(genDataType.getImportedInstanceClassName());
+ stringBuffer.append(TEXT_178);
+ stringBuffer.append(genDataType.getName());
+ stringBuffer.append(TEXT_179);
+ stringBuffer.append(genDataType.getSerializableFlag().equals("IS_SERIALIZABLE") ? "true" : "false");
+ stringBuffer.append(TEXT_180);
+ stringBuffer.append(genDataType.getGeneratedInstanceClassFlag().equals("IS_GENERATED_INSTANCE_CLASS") ? "true" : "false" );
+ stringBuffer.append(TEXT_181);
+ stringBuffer.append(genModel.getNonNLS());
+ for (Iterator sources = annotationSources.iterator(); sources.hasNext();) { String annotationSource = (String)sources.next();
+ EAnnotation dataTypeAnnotation = genDataType.getEcoreDataType().getEAnnotation(annotationSource);
+ if (dataTypeAnnotation != null) {
+ for (Iterator k = dataTypeAnnotation.getDetails().iterator(); k.hasNext();) { Map.Entry detail = (Map.Entry)k.next(); String key = Literals.toStringLiteral((String)detail.getKey(), genModel); String value = Literals.toStringLiteral((String)detail.getValue(), genModel);
+ stringBuffer.append(TEXT_182);
+ stringBuffer.append(genDataType.getSafeUncapName());
+ stringBuffer.append(TEXT_183);
+ stringBuffer.append(annotationSource);
+ stringBuffer.append(TEXT_184);
+ stringBuffer.append(key);
+ stringBuffer.append(TEXT_185);
+ stringBuffer.append(value);
+ stringBuffer.append(genModel.getNonNLS(key + value));
+ stringBuffer.append(TEXT_186);
+ }
+ }
+ }
+ stringBuffer.append(TEXT_187);
+ }
+ }
+ stringBuffer.append(TEXT_188);
+ stringBuffer.append(genModel.getImportedName("commonj.sdo.Property"));
+ stringBuffer.append(TEXT_189);
+ String extendedMetaDataSource = ExtendedMetaData.ANNOTATION_URI;
+ EAnnotation packageAnnotation = genPackage.getEcorePackage().getEAnnotation(extendedMetaDataSource);
+ if (packageAnnotation != null){
+ stringBuffer.append(TEXT_190);
+ for (Iterator k = packageAnnotation.getDetails().iterator(); k.hasNext();) { Map.Entry detail = (Map.Entry)k.next(); String key = Literals.toStringLiteral((String)detail.getKey(), genModel); String value = Literals.toStringLiteral((String)detail.getValue(), genModel);
+ stringBuffer.append(TEXT_191);
+ stringBuffer.append(key);
+ stringBuffer.append(TEXT_192);
+ stringBuffer.append(value);
+ stringBuffer.append(k.hasNext() ? "," : "");
+ stringBuffer.append(genModel.getNonNLS(key + value));
+ }
+ stringBuffer.append(TEXT_193);
+ }
+ for (Iterator i=genPackage.getGenClassifiers().iterator(); i.hasNext();) { GenClassifier genClassifier = (GenClassifier)i.next(); EAnnotation classAnnotation = genClassifier.getEcoreClassifier().getEAnnotation(extendedMetaDataSource);
+ if (classAnnotation != null && !genClassifier.getName().equals("DocumentRoot")) {
+ stringBuffer.append(TEXT_194);
+ stringBuffer.append(genClassifier.getSafeUncapName());
+ stringBuffer.append(TEXT_195);
+ for (Iterator k = classAnnotation.getDetails().iterator(); k.hasNext();) { Map.Entry detail = (Map.Entry)k.next(); String key = Literals.toStringLiteral((String)detail.getKey(), genModel); String value = Literals.toStringLiteral((String)detail.getValue(), genModel);
+ stringBuffer.append(TEXT_196);
+ stringBuffer.append(key);
+ stringBuffer.append(TEXT_197);
+ stringBuffer.append(value);
+ stringBuffer.append(k.hasNext() ? "," : "");
+ stringBuffer.append(genModel.getNonNLS(key + value));
+ }
+ stringBuffer.append(TEXT_198);
+ }
+ if (genClassifier instanceof GenClass) { GenClass genClass = (GenClass) genClassifier;
+ for (Iterator j=genClass.getGenFeatures().iterator(); j.hasNext();) { GenFeature genFeature = (GenFeature)j.next();
+ EAnnotation featureAnnotation = genFeature.getEcoreFeature().getEAnnotation(extendedMetaDataSource);
+ if (genClass.getName().equals("DocumentRoot")) {
+ if (!(genFeature.getName().equals("mixed") || genFeature.getName().equals("xMLNSPrefixMap") || genFeature.getName().equals("xSISchemaLocation"))) {
+ stringBuffer.append(TEXT_199);
+ stringBuffer.append(genFeature.getName());
+ stringBuffer.append(TEXT_200);
+ stringBuffer.append(genPackage.getPackageInstanceVariable(genFeature.getTypeGenPackage()));
+ stringBuffer.append(TEXT_201);
+ stringBuffer.append(genFeature.getTypeClassifierAccessorName());
+ stringBuffer.append(TEXT_202);
+ for (Iterator k = featureAnnotation.getDetails().iterator(); k.hasNext();) { Map.Entry detail = (Map.Entry)k.next(); String key = Literals.toStringLiteral((String)detail.getKey(), genModel); String value = Literals.toStringLiteral((String)detail.getValue(), genModel);
+ stringBuffer.append(TEXT_203);
+ stringBuffer.append(key);
+ stringBuffer.append(TEXT_204);
+ stringBuffer.append(value);
+ stringBuffer.append(k.hasNext() ? "," : "");
+ stringBuffer.append(genModel.getNonNLS(key + value));
+ }
+ if (!genFeature.isReferenceType()) {
+ stringBuffer.append(TEXT_205);
+ } else {
+ stringBuffer.append(TEXT_206);
+ }
+ stringBuffer.append(TEXT_207);
+ for (Iterator sources = genPackage.getAnnotationSources().iterator(); sources.hasNext();) { String annotationSource = (String)sources.next();
+ if (!annotationSource.equals(extendedMetaDataSource)) {
+ EAnnotation globalAnnotation = genFeature.getEcoreFeature().getEAnnotation(annotationSource);
+ if (globalAnnotation != null) {
+ for (Iterator k = globalAnnotation.getDetails().iterator(); k.hasNext();) { Map.Entry detail = (Map.Entry)k.next(); String key = Literals.toStringLiteral((String)detail.getKey(), genModel); String value = Literals.toStringLiteral((String)detail.getValue(), genModel);
+ stringBuffer.append(TEXT_208);
+ stringBuffer.append(annotationSource);
+ stringBuffer.append(TEXT_209);
+ stringBuffer.append(key);
+ stringBuffer.append(TEXT_210);
+ stringBuffer.append(value);
+ stringBuffer.append(genModel.getNonNLS(key + value));
+ stringBuffer.append(TEXT_211);
+ }
+ stringBuffer.append(TEXT_212);
+ }
+ }
+ stringBuffer.append(TEXT_213);
+ }
+ }
+ } else {
+ stringBuffer.append(TEXT_214);
+ stringBuffer.append(genModel.getImportedName("commonj.sdo.Property"));
+ stringBuffer.append(TEXT_215);
+ stringBuffer.append(genClassifier.getSafeUncapName());
+ stringBuffer.append(TEXT_216);
+ stringBuffer.append(genClass.getClassName());
+ stringBuffer.append(TEXT_217);
+ stringBuffer.append(genFeature.getUpperName());
+ stringBuffer.append(TEXT_218);
+ for (Iterator k = featureAnnotation.getDetails().iterator(); k.hasNext();) { Map.Entry detail = (Map.Entry)k.next(); String key = Literals.toStringLiteral((String)detail.getKey(), genModel); String value = Literals.toStringLiteral((String)detail.getValue(), genModel);
+ stringBuffer.append(TEXT_219);
+ stringBuffer.append(key);
+ stringBuffer.append(TEXT_220);
+ stringBuffer.append(value);
+ stringBuffer.append(k.hasNext() ? "," : "");
+ stringBuffer.append(genModel.getNonNLS(key + value));
+ }
+ stringBuffer.append(TEXT_221);
+ }
+ }
+ }
+ }
+ stringBuffer.append(TEXT_222);
+ for (Iterator i=genPackage.getAllGenDataTypes().iterator(); i.hasNext();) { GenDataType genDataType = (GenDataType)i.next();
+ if (genDataType.isSerializable()) {
+ if (genPackage.isDataTypeConverters()) { String eDataType = genDataType.getQualifiedClassifierAccessor();
+ stringBuffer.append(TEXT_223);
+ stringBuffer.append(genDataType.getImportedInstanceClassName());
+ stringBuffer.append(TEXT_224);
+ stringBuffer.append(genDataType.getName());
+ stringBuffer.append(TEXT_225);
+ if (genDataType instanceof GenEnum) {
+ stringBuffer.append(TEXT_226);
+ stringBuffer.append(genDataType.getImportedInstanceClassName());
+ stringBuffer.append(TEXT_227);
+ stringBuffer.append(genDataType.getImportedInstanceClassName());
+ stringBuffer.append(TEXT_228);
+ stringBuffer.append(eDataType);
+ stringBuffer.append(TEXT_229);
+ stringBuffer.append(genModel.getNonNLS());
+ stringBuffer.append(genModel.getNonNLS(2));
+ stringBuffer.append(genModel.getNonNLS(3));
+ stringBuffer.append(TEXT_230);
+ } else if (genDataType.getBaseType() != null) { GenDataType genBaseType = genDataType.getBaseType(); boolean isPrimitiveConversion = !genDataType.isPrimitiveType() && genBaseType.isPrimitiveType();
+ if (genBaseType.getGenPackage() == genPackage) {
+ if (isPrimitiveConversion) {
+ stringBuffer.append(TEXT_231);
+ stringBuffer.append(genDataType.getObjectInstanceClassName());
+ stringBuffer.append(TEXT_232);
+ stringBuffer.append(genBaseType.getName());
+ stringBuffer.append(TEXT_233);
+ } else {
+ stringBuffer.append(TEXT_234);
+ stringBuffer.append(genBaseType.getName());
+ stringBuffer.append(TEXT_235);
+ }
+ } else if (genBaseType.getGenPackage().isDataTypeConverters()) {
+ if (isPrimitiveConversion) {
+ stringBuffer.append(TEXT_236);
+ stringBuffer.append(genDataType.getObjectInstanceClassName());
+ stringBuffer.append(TEXT_237);
+ stringBuffer.append(genBaseType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor());
+ stringBuffer.append(TEXT_238);
+ stringBuffer.append(genBaseType.getName());
+ stringBuffer.append(TEXT_239);
+ } else {
+ stringBuffer.append(TEXT_240);
+ stringBuffer.append(genBaseType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor());
+ stringBuffer.append(TEXT_241);
+ stringBuffer.append(genBaseType.getName());
+ stringBuffer.append(TEXT_242);
+ }
+ } else {
+ stringBuffer.append(TEXT_243);
+ stringBuffer.append(genDataType.getObjectInstanceClassName());
+ stringBuffer.append(TEXT_244);
+ stringBuffer.append(genBaseType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor());
+ stringBuffer.append(TEXT_245);
+ stringBuffer.append(genBaseType.getQualifiedClassifierAccessor());
+ stringBuffer.append(TEXT_246);
+ }
+ } else if (genDataType.getItemType() != null) { GenDataType genItemType = genDataType.getItemType();
+ stringBuffer.append(TEXT_247);
+ stringBuffer.append(genModel.getImportedName("java.util.List"));
+ stringBuffer.append(TEXT_248);
+ stringBuffer.append(genModel.getImportedName("java.util.ArrayList"));
+ stringBuffer.append(TEXT_249);
+ stringBuffer.append(genModel.getImportedName("java.util.StringTokenizer"));
+ stringBuffer.append(TEXT_250);
+ stringBuffer.append(genModel.getImportedName("java.util.StringTokenizer"));
+ stringBuffer.append(TEXT_251);
+ if (genItemType.getGenPackage() == genPackage) {
+ if (genPackage.isDataTypeConverters()) { genItemType = genItemType.getObjectType();
+ stringBuffer.append(TEXT_252);
+ stringBuffer.append(genItemType.getName());
+ stringBuffer.append(TEXT_253);
+ } else {
+ stringBuffer.append(TEXT_254);
+ stringBuffer.append(genItemType.getName());
+ stringBuffer.append(TEXT_255);
+ stringBuffer.append(genItemType.getQualifiedClassifierAccessor());
+ stringBuffer.append(TEXT_256);
+ }
+ } else {
+ if (genItemType.getGenPackage().isDataTypeConverters()) { genItemType = genItemType.getObjectType();
+ stringBuffer.append(TEXT_257);
+ stringBuffer.append(genItemType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor());
+ stringBuffer.append(TEXT_258);
+ stringBuffer.append(genItemType.getName());
+ stringBuffer.append(TEXT_259);
+ } else {
+ stringBuffer.append(TEXT_260);
+ stringBuffer.append(genItemType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor());
+ stringBuffer.append(TEXT_261);
+ stringBuffer.append(genItemType.getQualifiedClassifierAccessor());
+ stringBuffer.append(TEXT_262);
+ }
+ }
+ stringBuffer.append(TEXT_263);
+ } else if (!genDataType.getMemberTypes().isEmpty()) {
+ stringBuffer.append(TEXT_264);
+ stringBuffer.append(genDataType.getStaticValue(null));
+ stringBuffer.append(TEXT_265);
+ stringBuffer.append(genDataType.getImportedInstanceClassName());
+ stringBuffer.append(TEXT_266);
+ stringBuffer.append(genDataType.getStaticValue(null));
+ stringBuffer.append(TEXT_267);
+ for (Iterator j = genDataType.getMemberTypes().iterator(); j.hasNext(); ) { GenDataType genMemberType = (GenDataType)j.next();
+ stringBuffer.append(TEXT_268);
+ if (genMemberType.getGenPackage() == genPackage) {
+ if (genPackage.isDataTypeConverters()) { if (!genDataType.isPrimitiveType()) genMemberType = genMemberType.getObjectType();
+ stringBuffer.append(TEXT_269);
+ stringBuffer.append(genMemberType.getName());
+ stringBuffer.append(TEXT_270);
+ } else {
+ stringBuffer.append(TEXT_271);
+ stringBuffer.append(genDataType.getObjectInstanceClassName());
+ stringBuffer.append(TEXT_272);
+ stringBuffer.append(genMemberType.getName());
+ stringBuffer.append(TEXT_273);
+ stringBuffer.append(genMemberType.getQualifiedClassifierAccessor());
+ stringBuffer.append(TEXT_274);
+ }
+ } else {
+ if (genPackage.isDataTypeConverters()) { if (!genDataType.isPrimitiveType()) genMemberType = genMemberType.getObjectType();
+ stringBuffer.append(TEXT_275);
+ stringBuffer.append(genMemberType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor());
+ stringBuffer.append(TEXT_276);
+ stringBuffer.append(genMemberType.getName());
+ stringBuffer.append(TEXT_277);
+ } else {
+ stringBuffer.append(TEXT_278);
+ stringBuffer.append(genDataType.getObjectInstanceClassName());
+ stringBuffer.append(TEXT_279);
+ stringBuffer.append(genMemberType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor());
+ stringBuffer.append(TEXT_280);
+ stringBuffer.append(genMemberType.getQualifiedClassifierAccessor());
+ stringBuffer.append(TEXT_281);
+ }
+ }
+ stringBuffer.append(TEXT_282);
+ if (!genDataType.isPrimitiveType()) {
+ stringBuffer.append(TEXT_283);
+ }
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.Diagnostician"));
+ stringBuffer.append(TEXT_284);
+ stringBuffer.append(eDataType);
+ stringBuffer.append(TEXT_285);
+ if (genDataType.isPrimitiveType()) {
+ stringBuffer.append(TEXT_286);
+ stringBuffer.append(genDataType.getObjectInstanceClassName());
+ stringBuffer.append(TEXT_287);
+ } else {
+ stringBuffer.append(TEXT_288);
+ }
+ stringBuffer.append(TEXT_289);
+ }
+ stringBuffer.append(TEXT_290);
+ if (!genDataType.isPrimitiveType()) {
+ stringBuffer.append(TEXT_291);
+ }
+ stringBuffer.append(TEXT_292);
+ } else if (genDataType.isArrayType()) {
+ stringBuffer.append(TEXT_293);
+ stringBuffer.append(genModel.getImportedName("java.lang.UnsupportedOperationException"));
+ stringBuffer.append(TEXT_294);
+ } else if (genDataType.isPrimitiveType()) {
+ stringBuffer.append(TEXT_295);
+ stringBuffer.append(genDataType.getObjectInstanceClassName());
+ stringBuffer.append(TEXT_296);
+ stringBuffer.append(eDataType);
+ stringBuffer.append(TEXT_297);
+ stringBuffer.append(genDataType.getPrimitiveValueFunction());
+ stringBuffer.append(TEXT_298);
+ } else {
+ stringBuffer.append(TEXT_299);
+ stringBuffer.append(genDataType.getObjectInstanceClassName());
+ stringBuffer.append(TEXT_300);
+ stringBuffer.append(eDataType);
+ stringBuffer.append(TEXT_301);
+ }
+ stringBuffer.append(TEXT_302);
+ }
+ stringBuffer.append(TEXT_303);
+ stringBuffer.append(genDataType.getObjectInstanceClassName());
+ stringBuffer.append(TEXT_304);
+ stringBuffer.append(genDataType.getName());
+ stringBuffer.append(TEXT_305);
+ stringBuffer.append(genModel.getImportedName("commonj.sdo.Type"));
+ stringBuffer.append(TEXT_306);
+ if (genDataType instanceof GenEnum) {
+ if (genPackage.isDataTypeConverters()) {
+ stringBuffer.append(TEXT_307);
+ stringBuffer.append(genDataType.getName());
+ stringBuffer.append(TEXT_308);
+ } else {
+ stringBuffer.append(TEXT_309);
+ stringBuffer.append(((GenEnum)genDataType).getImportedInstanceClassName());
+ stringBuffer.append(TEXT_310);
+ stringBuffer.append(((GenEnum)genDataType).getImportedInstanceClassName());
+ stringBuffer.append(TEXT_311);
+ stringBuffer.append(genModel.getNonNLS());
+ stringBuffer.append(genModel.getNonNLS(2));
+ stringBuffer.append(genModel.getNonNLS(3));
+ stringBuffer.append(TEXT_312);
+ }
+ } else if (genDataType.getBaseType() != null) { GenDataType genBaseType = genDataType.getBaseType();
+ if (genBaseType.getGenPackage() == genPackage) {
+ stringBuffer.append(TEXT_313);
+ stringBuffer.append(genDataType.getObjectInstanceClassName());
+ stringBuffer.append(TEXT_314);
+ stringBuffer.append(genBaseType.getName());
+ stringBuffer.append(TEXT_315);
+ stringBuffer.append(SDOGenUtil.getQualifiedTypeAccessor(genDataType));
+ stringBuffer.append(TEXT_316);
+ } else {
+ stringBuffer.append(TEXT_317);
+ stringBuffer.append(genDataType.getObjectInstanceClassName());
+ stringBuffer.append(TEXT_318);
+ stringBuffer.append(genBaseType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor());
+ stringBuffer.append(TEXT_319);
+ stringBuffer.append(genBaseType.getQualifiedClassifierAccessor());
+ stringBuffer.append(TEXT_320);
+ }
+ } else if (genDataType.getItemType() != null) { GenDataType genItemType = genDataType.getItemType();
+ if (genPackage.isDataTypeConverters()) {
+ stringBuffer.append(TEXT_321);
+ stringBuffer.append(genDataType.getName());
+ stringBuffer.append(TEXT_322);
+ } else {
+ stringBuffer.append(TEXT_323);
+ stringBuffer.append(genModel.getImportedName("java.util.List"));
+ stringBuffer.append(TEXT_324);
+ stringBuffer.append(genModel.getImportedName("java.util.ArrayList"));
+ stringBuffer.append(TEXT_325);
+ stringBuffer.append(genModel.getImportedName("java.util.StringTokenizer"));
+ stringBuffer.append(TEXT_326);
+ stringBuffer.append(genModel.getImportedName("java.util.StringTokenizer"));
+ stringBuffer.append(TEXT_327);
+ if (genItemType.getGenPackage() == genPackage) {
+ stringBuffer.append(TEXT_328);
+ stringBuffer.append(genItemType.getName());
+ stringBuffer.append(TEXT_329);
+ stringBuffer.append(genItemType.getQualifiedClassifierAccessor());
+ stringBuffer.append(TEXT_330);
+ } else {
+ stringBuffer.append(TEXT_331);
+ stringBuffer.append(genItemType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor());
+ stringBuffer.append(TEXT_332);
+ stringBuffer.append(genItemType.getQualifiedClassifierAccessor());
+ stringBuffer.append(TEXT_333);
+ }
+ stringBuffer.append(TEXT_334);
+ }
+ } else if (!genDataType.getMemberTypes().isEmpty()) {
+ if (genPackage.isDataTypeConverters()) {
+ if (genDataType.isPrimitiveType()) {
+ stringBuffer.append(TEXT_335);
+ stringBuffer.append(genDataType.getObjectInstanceClassName());
+ stringBuffer.append(TEXT_336);
+ stringBuffer.append(genDataType.getName());
+ stringBuffer.append(TEXT_337);
+ } else {
+ stringBuffer.append(TEXT_338);
+ stringBuffer.append(genDataType.getName());
+ stringBuffer.append(TEXT_339);
+ }
+ } else {
+ stringBuffer.append(TEXT_340);
+ stringBuffer.append(genDataType.getObjectInstanceClassName());
+ stringBuffer.append(TEXT_341);
+ for (Iterator j = genDataType.getMemberTypes().iterator(); j.hasNext(); ) { GenDataType genMemberType = (GenDataType)j.next();
+ stringBuffer.append(TEXT_342);
+ if (genMemberType.getGenPackage() == genPackage) {
+ stringBuffer.append(TEXT_343);
+ stringBuffer.append(genDataType.getObjectInstanceClassName());
+ stringBuffer.append(TEXT_344);
+ stringBuffer.append(genMemberType.getName());
+ stringBuffer.append(TEXT_345);
+ stringBuffer.append(genMemberType.getQualifiedClassifierAccessor());
+ stringBuffer.append(TEXT_346);
+ } else {
+ stringBuffer.append(TEXT_347);
+ stringBuffer.append(genDataType.getObjectInstanceClassName());
+ stringBuffer.append(TEXT_348);
+ stringBuffer.append(genMemberType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor());
+ stringBuffer.append(TEXT_349);
+ stringBuffer.append(genMemberType.getQualifiedClassifierAccessor());
+ stringBuffer.append(TEXT_350);
+ }
+ stringBuffer.append(TEXT_351);
+ stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.Diagnostician"));
+ stringBuffer.append(TEXT_352);
+ }
+ stringBuffer.append(TEXT_353);
+ }
+ } else if (genDataType.isArrayType()) {
+ stringBuffer.append(TEXT_354);
+ stringBuffer.append(genModel.getImportedName("java.lang.UnsupportedOperationException"));
+ stringBuffer.append(TEXT_355);
+ } else {
+ stringBuffer.append(TEXT_356);
+ stringBuffer.append(genDataType.getObjectInstanceClassName());
+ stringBuffer.append(TEXT_357);
+ }
+ stringBuffer.append(TEXT_358);
+ if (genPackage.isDataTypeConverters()) { String eDataType = genDataType.getQualifiedClassifierAccessor();
+ stringBuffer.append(TEXT_359);
+ stringBuffer.append(genDataType.getName());
+ stringBuffer.append(TEXT_360);
+ stringBuffer.append(genDataType.getImportedInstanceClassName());
+ stringBuffer.append(TEXT_361);
+ if (genDataType instanceof GenEnum) {
+ stringBuffer.append(TEXT_362);
+ } else if (genDataType.getBaseType() != null) { GenDataType genBaseType = genDataType.getBaseType(); boolean isPrimitiveConversion = !genDataType.isPrimitiveType() && genBaseType.isPrimitiveType();
+ if (genBaseType.getGenPackage() == genPackage) {
+ if (isPrimitiveConversion) {
+ stringBuffer.append(TEXT_363);
+ stringBuffer.append(genBaseType.getName());
+ stringBuffer.append(TEXT_364);
+ stringBuffer.append(genBaseType.getPrimitiveValueFunction());
+ stringBuffer.append(TEXT_365);
+ } else {
+ stringBuffer.append(TEXT_366);
+ stringBuffer.append(genBaseType.getName());
+ stringBuffer.append(TEXT_367);
+ }
+ } else if (genBaseType.getGenPackage().isDataTypeConverters()) {
+ stringBuffer.append(TEXT_368);
+ stringBuffer.append(genBaseType.getGenPackage().getQualifiedFactoryInstanceAccessor());
+ stringBuffer.append(TEXT_369);
+ stringBuffer.append(genBaseType.getName());
+ stringBuffer.append(TEXT_370);
+ } else {
+ stringBuffer.append(TEXT_371);
+ stringBuffer.append(genBaseType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor());
+ stringBuffer.append(TEXT_372);
+ stringBuffer.append(genBaseType.getQualifiedClassifierAccessor());
+ stringBuffer.append(TEXT_373);
+ }
+ } else if (genDataType.getItemType() != null) { GenDataType genItemType = genDataType.getItemType();
+ stringBuffer.append(TEXT_374);
+ stringBuffer.append(genModel.getImportedName("java.lang.StringBuffer"));
+ stringBuffer.append(TEXT_375);
+ stringBuffer.append(genModel.getImportedName("java.lang.StringBuffer"));
+ stringBuffer.append(TEXT_376);
+ stringBuffer.append(genModel.getImportedName("java.util.Iterator"));
+ stringBuffer.append(TEXT_377);
+ if (genItemType.getGenPackage() == genPackage) {
+ if (genPackage.isDataTypeConverters()) { genItemType = genItemType.getObjectType();
+ stringBuffer.append(TEXT_378);
+ stringBuffer.append(genItemType.getName());
+ stringBuffer.append(TEXT_379);
+ stringBuffer.append(genItemType.getObjectInstanceClassName());
+ stringBuffer.append(TEXT_380);
+ } else {
+ stringBuffer.append(TEXT_381);
+ stringBuffer.append(genItemType.getName());
+ stringBuffer.append(TEXT_382);
+ stringBuffer.append(genItemType.getQualifiedClassifierAccessor());
+ stringBuffer.append(TEXT_383);
+ }
+ } else {
+ if (genItemType.getGenPackage().isDataTypeConverters()) { genItemType = genItemType.getObjectType();
+ stringBuffer.append(TEXT_384);
+ stringBuffer.append(genItemType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor());
+ stringBuffer.append(TEXT_385);
+ stringBuffer.append(genItemType.getName());
+ stringBuffer.append(TEXT_386);
+ stringBuffer.append(genItemType.getObjectInstanceClassName());
+ stringBuffer.append(TEXT_387);
+ } else {
+ stringBuffer.append(TEXT_388);
+ stringBuffer.append(genItemType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor());
+ stringBuffer.append(TEXT_389);
+ stringBuffer.append(genItemType.getQualifiedClassifierAccessor());
+ stringBuffer.append(TEXT_390);
+ }
+ }
+ stringBuffer.append(TEXT_391);
+ } else if (!genDataType.getMemberTypes().isEmpty()) {
+ if (!genDataType.isPrimitiveType()) {
+ stringBuffer.append(TEXT_392);
+ for (Iterator j = genDataType.getMemberTypes().iterator(); j.hasNext(); ) { GenDataType genMemberType = (GenDataType)j.next();
+ stringBuffer.append(TEXT_393);
+ stringBuffer.append(genMemberType.getQualifiedClassifierAccessor());
+ stringBuffer.append(TEXT_394);
+ if (genMemberType.getGenPackage() == genPackage) {
+ if (genPackage.isDataTypeConverters()) {
+ stringBuffer.append(TEXT_395);
+ stringBuffer.append(genMemberType.getName());
+ stringBuffer.append(TEXT_396);
+ } else {
+ stringBuffer.append(TEXT_397);
+ stringBuffer.append(genMemberType.getName());
+ stringBuffer.append(TEXT_398);
+ stringBuffer.append(genMemberType.getQualifiedClassifierAccessor());
+ stringBuffer.append(TEXT_399);
+ }
+ } else {
+ if (genMemberType.getGenPackage().isDataTypeConverters()) { genMemberType = genMemberType.getObjectType();
+ stringBuffer.append(TEXT_400);
+ stringBuffer.append(genMemberType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor());
+ stringBuffer.append(TEXT_401);
+ stringBuffer.append(genMemberType.getName());
+ stringBuffer.append(TEXT_402);
+ stringBuffer.append(genMemberType.getObjectInstanceClassName());
+ stringBuffer.append(TEXT_403);
+ } else {
+ stringBuffer.append(TEXT_404);
+ stringBuffer.append(genMemberType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor());
+ stringBuffer.append(TEXT_405);
+ stringBuffer.append(genMemberType.getQualifiedClassifierAccessor());
+ stringBuffer.append(TEXT_406);
+ }
+ }
+ stringBuffer.append(TEXT_407);
+ }
+ } else {
+ for (Iterator j = genDataType.getMemberTypes().iterator(); j.hasNext(); ) { GenDataType genMemberType = (GenDataType)j.next();
+ stringBuffer.append(TEXT_408);
+ if (genMemberType.getGenPackage() == genPackage) {
+ if (genPackage.isDataTypeConverters()) {
+ stringBuffer.append(TEXT_409);
+ stringBuffer.append(genMemberType.getName());
+ stringBuffer.append(TEXT_410);
+ } else {
+ stringBuffer.append(TEXT_411);
+ stringBuffer.append(genMemberType.getName());
+ stringBuffer.append(TEXT_412);
+ stringBuffer.append(genMemberType.getQualifiedClassifierAccessor());
+ stringBuffer.append(TEXT_413);
+ stringBuffer.append(genMemberType.getObjectInstanceClassName());
+ stringBuffer.append(TEXT_414);
+ }
+ } else {
+ if (genMemberType.getGenPackage().isDataTypeConverters()) {
+ stringBuffer.append(TEXT_415);
+ stringBuffer.append(genMemberType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor());
+ stringBuffer.append(TEXT_416);
+ stringBuffer.append(genMemberType.getName());
+ stringBuffer.append(TEXT_417);
+ } else {
+ stringBuffer.append(TEXT_418);
+ stringBuffer.append(genMemberType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor());
+ stringBuffer.append(TEXT_419);
+ stringBuffer.append(genMemberType.getQualifiedClassifierAccessor());
+ stringBuffer.append(TEXT_420);
+ stringBuffer.append(genMemberType.getObjectInstanceClassName());
+ stringBuffer.append(TEXT_421);
+ }
+ }
+ stringBuffer.append(TEXT_422);
+ }
+ }
+ stringBuffer.append(TEXT_423);
+ stringBuffer.append(eDataType);
+ stringBuffer.append(TEXT_424);
+ } else if (genDataType.isArrayType()) {
+ stringBuffer.append(TEXT_425);
+ stringBuffer.append(genModel.getImportedName("java.lang.UnsupportedOperationException"));
+ stringBuffer.append(TEXT_426);
+ } else if (genDataType.isPrimitiveType()) {
+ stringBuffer.append(TEXT_427);
+ stringBuffer.append(eDataType);
+ stringBuffer.append(TEXT_428);
+ stringBuffer.append(genDataType.getObjectInstanceClassName());
+ stringBuffer.append(TEXT_429);
+ } else {
+ stringBuffer.append(TEXT_430);
+ stringBuffer.append(eDataType);
+ stringBuffer.append(TEXT_431);
+ }
+ stringBuffer.append(TEXT_432);
+ }
+ stringBuffer.append(TEXT_433);
+ stringBuffer.append(genDataType.getName());
+ stringBuffer.append(TEXT_434);
+ stringBuffer.append(genModel.getImportedName("commonj.sdo.Type"));
+ stringBuffer.append(TEXT_435);
+ if (genDataType instanceof GenEnum) {
+ stringBuffer.append(TEXT_436);
+ } else if (genDataType.getBaseType() != null) { GenDataType genBaseType = genDataType.getBaseType();
+ if (genBaseType.getGenPackage() == genPackage) {
+ stringBuffer.append(TEXT_437);
+ stringBuffer.append(genBaseType.getName());
+ stringBuffer.append(TEXT_438);
+ stringBuffer.append(SDOGenUtil.getQualifiedTypeAccessor(genBaseType));
+ stringBuffer.append(TEXT_439);
+ } else {
+ stringBuffer.append(TEXT_440);
+ stringBuffer.append(genBaseType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor());
+ stringBuffer.append(TEXT_441);
+ stringBuffer.append(genBaseType.getQualifiedClassifierAccessor());
+ stringBuffer.append(TEXT_442);
+ }
+ } else if (genDataType.getItemType() != null) { GenDataType genItemType = genDataType.getItemType();
+ if (genPackage.isDataTypeConverters()) {
+ stringBuffer.append(TEXT_443);
+ stringBuffer.append(genDataType.getName());
+ stringBuffer.append(TEXT_444);
+ stringBuffer.append(genModel.getImportedName("java.util.List"));
+ stringBuffer.append(TEXT_445);
+ } else {
+ stringBuffer.append(TEXT_446);
+ stringBuffer.append(genModel.getImportedName("java.util.List"));
+ stringBuffer.append(TEXT_447);
+ stringBuffer.append(genModel.getImportedName("java.util.List"));
+ stringBuffer.append(TEXT_448);
+ stringBuffer.append(genModel.getImportedName("java.lang.StringBuffer"));
+ stringBuffer.append(TEXT_449);
+ stringBuffer.append(genModel.getImportedName("java.lang.StringBuffer"));
+ stringBuffer.append(TEXT_450);
+ stringBuffer.append(genModel.getImportedName("java.util.Iterator"));
+ stringBuffer.append(TEXT_451);
+ if (genItemType.getGenPackage() == genPackage) {
+ stringBuffer.append(TEXT_452);
+ stringBuffer.append(genItemType.getName());
+ stringBuffer.append(TEXT_453);
+ stringBuffer.append(genItemType.getQualifiedClassifierAccessor());
+ stringBuffer.append(TEXT_454);
+ } else {
+ stringBuffer.append(TEXT_455);
+ stringBuffer.append(genItemType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor());
+ stringBuffer.append(TEXT_456);
+ stringBuffer.append(genItemType.getQualifiedClassifierAccessor());
+ stringBuffer.append(TEXT_457);
+ }
+ stringBuffer.append(TEXT_458);
+ }
+ } else if (!genDataType.getMemberTypes().isEmpty()) {
+ if (genPackage.isDataTypeConverters()) {
+ if (genDataType.isPrimitiveType()) {
+ stringBuffer.append(TEXT_459);
+ stringBuffer.append(genDataType.getName());
+ stringBuffer.append(TEXT_460);
+ stringBuffer.append(genDataType.getObjectInstanceClassName());
+ stringBuffer.append(TEXT_461);
+ stringBuffer.append(genDataType.getPrimitiveValueFunction());
+ stringBuffer.append(TEXT_462);
+ } else {
+ stringBuffer.append(TEXT_463);
+ stringBuffer.append(genDataType.getName());
+ stringBuffer.append(TEXT_464);
+ }
+ } else {
+ stringBuffer.append(TEXT_465);
+ for (Iterator j = genDataType.getMemberTypes().iterator(); j.hasNext(); ) { GenDataType genMemberType = (GenDataType)j.next();
+ stringBuffer.append(TEXT_466);
+ stringBuffer.append(genMemberType.getQualifiedClassifierAccessor());
+ stringBuffer.append(TEXT_467);
+ if (genMemberType.getGenPackage() == genPackage) {
+ stringBuffer.append(TEXT_468);
+ stringBuffer.append(genMemberType.getName());
+ stringBuffer.append(TEXT_469);
+ stringBuffer.append(genMemberType.getQualifiedClassifierAccessor());
+ stringBuffer.append(TEXT_470);
+ } else {
+ stringBuffer.append(TEXT_471);
+ stringBuffer.append(genMemberType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor());
+ stringBuffer.append(TEXT_472);
+ stringBuffer.append(genMemberType.getQualifiedClassifierAccessor());
+ stringBuffer.append(TEXT_473);
+ }
+ stringBuffer.append(TEXT_474);
+ }
+ stringBuffer.append(TEXT_475);
+ }
+ } else if (genDataType.isArrayType()) {
+ stringBuffer.append(TEXT_476);
+ stringBuffer.append(genModel.getImportedName("java.lang.UnsupportedOperationException"));
+ stringBuffer.append(TEXT_477);
+ } else {
+ stringBuffer.append(TEXT_478);
+ }
+ stringBuffer.append(TEXT_479);
+ }
+ }
+ } else {
+ for (Iterator i=genPackage.getGenClasses().iterator(); i.hasNext();) { GenClass genClass = (GenClass)i.next();
+ if (genClass.hasFactoryInterfaceCreateMethod()) {
+ stringBuffer.append(TEXT_480);
+ stringBuffer.append(genClass.getFormattedName());
+ stringBuffer.append(TEXT_481);
+ stringBuffer.append(genClass.getFormattedName());
+ stringBuffer.append(TEXT_482);
+ stringBuffer.append(genClass.getImportedInterfaceName());
+ stringBuffer.append(TEXT_483);
+ stringBuffer.append(genClass.getName());
+ stringBuffer.append(TEXT_484);
+ }
+ }
+ if (genPackage.isDataTypeConverters()) {
+ for (Iterator i=genPackage.getAllGenDataTypes().iterator(); i.hasNext();) { GenDataType genDataType = (GenDataType)i.next();
+ if (genDataType.isSerializable()) {
+ stringBuffer.append(TEXT_485);
+ stringBuffer.append(genDataType.getFormattedName());
+ stringBuffer.append(TEXT_486);
+ stringBuffer.append(genDataType.getImportedInstanceClassName());
+ stringBuffer.append(TEXT_487);
+ stringBuffer.append(genDataType.getName());
+ stringBuffer.append(TEXT_488);
+ stringBuffer.append(genDataType.getFormattedName());
+ stringBuffer.append(TEXT_489);
+ stringBuffer.append(genDataType.getName());
+ stringBuffer.append(TEXT_490);
+ stringBuffer.append(genDataType.getImportedInstanceClassName());
+ stringBuffer.append(TEXT_491);
+ }
+ }
+ }
+ }
+ stringBuffer.append(TEXT_492);
+ stringBuffer.append(isInterface ? genPackage.getFactoryInterfaceName() : genPackage.getFactoryClassName());
+ genModel.emitSortedImports();
+ stringBuffer.append(TEXT_493);
+ return stringBuffer.toString();
+ }
+}
diff --git a/branches/sdo-java-M2/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/util/SDOGenUtil.java b/branches/sdo-java-M2/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/util/SDOGenUtil.java
new file mode 100644
index 0000000000..83b57cc8da
--- /dev/null
+++ b/branches/sdo-java-M2/sdo/tools/src/main/java/org/apache/tuscany/sdo/generate/util/SDOGenUtil.java
@@ -0,0 +1,33 @@
+/**
+ *
+ * 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.generate.util;
+
+import org.eclipse.emf.codegen.ecore.genmodel.GenClassifier;
+import org.eclipse.emf.codegen.ecore.genmodel.GenPackage;
+
+public class SDOGenUtil {
+
+ public static String getQualifiedTypeAccessor(GenClassifier genClassifier){
+ GenPackage genPackage = genClassifier.getGenPackage();
+ return "((" + genPackage.getImportedFactoryClassName() + ")"
+ + genPackage.getImportedFactoryInterfaceName() + ".INSTANCE).get" + genClassifier.getClassifierAccessorName() + "()";
+ }
+
+}
diff --git a/branches/sdo-java-M2/sdo/tools/src/main/java/org/eclipse/jdt/core/formatter/CodeFormatter.java b/branches/sdo-java-M2/sdo/tools/src/main/java/org/eclipse/jdt/core/formatter/CodeFormatter.java
new file mode 100644
index 0000000000..1c1f37682f
--- /dev/null
+++ b/branches/sdo-java-M2/sdo/tools/src/main/java/org/eclipse/jdt/core/formatter/CodeFormatter.java
@@ -0,0 +1,27 @@
+/**
+ *
+ * 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.
+ */
+/*******************************************************************************
+ * TEMPORARY dummy file to work around EMF generator dependency problem.
+ * This file will be deleted as soon as the EMF generator is fixed.
+ *******************************************************************************/
+package org.eclipse.jdt.core.formatter;
+
+public abstract class CodeFormatter {
+}
diff --git a/branches/sdo-java-M2/sdo/tools/src/main/resources/META-INF/LICENSE.txt b/branches/sdo-java-M2/sdo/tools/src/main/resources/META-INF/LICENSE.txt
new file mode 100644
index 0000000000..25d78feeac
--- /dev/null
+++ b/branches/sdo-java-M2/sdo/tools/src/main/resources/META-INF/LICENSE.txt
@@ -0,0 +1,1277 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+
+APACHE TUSCANY SUBCOMPONENTS:
+
+The Apache Tuscany distribution includes a number of subcomponents with
+separate copyright notices and license terms. Your use of the source
+code for the these subcomponents is subject to the terms and
+conditions of the following licenses.
+
+===============================================================================
+
+For the Eclipse Modeling Framework component and the Celtix binding:
+
+Eclipse Public License - v 1.0
+
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
+PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF
+THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+
+1. DEFINITIONS
+
+"Contribution" means:
+
+a) in the case of the initial Contributor, the initial code and
+documentation distributed under this Agreement, and
+b) in the case of each subsequent Contributor:
+
+i) changes to the Program, and
+
+ii) additions to the Program;
+
+where such changes and/or additions to the Program originate from and
+are distributed by that particular Contributor. A Contribution
+'originates' from a Contributor if it was added to the Program by such
+Contributor itself or anyone acting on such Contributor's behalf.
+Contributions do not include additions to the Program which: (i) are
+separate modules of software distributed in conjunction with the
+Program under their own license agreement, and (ii) are not derivative
+works of the Program.
+
+"Contributor" means any person or entity that distributes the Program.
+
+"Licensed Patents " mean patent claims licensable by a Contributor
+which are necessarily infringed by the use or sale of its Contribution
+alone or when combined with the Program.
+
+"Program" means the Contributions distributed in accordance with this
+Agreement.
+
+"Recipient" means anyone who receives the Program under this
+Agreement, including all Contributors.
+
+2. GRANT OF RIGHTS
+
+a) Subject to the terms of this Agreement, each Contributor hereby
+grants Recipient a non-exclusive, worldwide, royalty-free copyright
+license to reproduce, prepare derivative works of, publicly display,
+publicly perform, distribute and sublicense the Contribution of such
+Contributor, if any, and such derivative works, in source code and
+object code form.
+
+b) Subject to the terms of this Agreement, each Contributor hereby
+grants Recipient a non-exclusive, worldwide, royalty-free patent
+license under Licensed Patents to make, use, sell, offer to sell,
+import and otherwise transfer the Contribution of such Contributor, if
+any, in source code and object code form. This patent license shall
+apply to the combination of the Contribution and the Program if, at
+the time the Contribution is added by the Contributor, such addition
+of the Contribution causes such combination to be covered by the
+Licensed Patents. The patent license shall not apply to any other
+combinations which include the Contribution. No hardware per se is
+licensed hereunder.
+
+c) Recipient understands that although each Contributor grants the
+licenses to its Contributions set forth herein, no assurances are
+provided by any Contributor that the Program does not infringe the
+patent or other intellectual property rights of any other entity. Each
+Contributor disclaims any liability to Recipient for claims brought by
+any other entity based on infringement of intellectual property rights
+or otherwise. As a condition to exercising the rights and licenses
+granted hereunder, each Recipient hereby assumes sole responsibility
+to secure any other intellectual property rights needed, if any. For
+example, if a third party patent license is required to allow
+Recipient to distribute the Program, it is Recipient's responsibility
+to acquire that license before distributing the Program.
+
+d) Each Contributor represents that to its knowledge it has sufficient
+copyright rights in its Contribution, if any, to grant the copyright
+license set forth in this Agreement.
+
+3. REQUIREMENTS
+
+A Contributor may choose to distribute the Program in object code form
+under its own license agreement, provided that:
+
+a) it complies with the terms and conditions of this Agreement; and
+
+b) its license agreement:
+
+i) effectively disclaims on behalf of all Contributors all warranties
+and conditions, express and implied, including warranties or
+conditions of title and non-infringement, and implied warranties or
+conditions of merchantability and fitness for a particular purpose;
+
+ii) effectively excludes on behalf of all Contributors all liability
+for damages, including direct, indirect, special, incidental and
+consequential damages, such as lost profits;
+
+iii) states that any provisions which differ from this Agreement are
+offered by that Contributor alone and not by any other party; and
+
+iv) states that source code for the Program is available from such
+Contributor, and informs licensees how to obtain it in a reasonable
+manner on or through a medium customarily used for software exchange.
+
+When the Program is made available in source code form:
+
+a) it must be made available under this Agreement; and
+
+b) a copy of this Agreement must be included with each copy of the
+Program.
+
+Contributors may not remove or alter any copyright notices contained
+within the Program.
+
+Each Contributor must identify itself as the originator of its
+Contribution, if any, in a manner that reasonably allows subsequent
+Recipients to identify the originator of the Contribution.
+
+4. COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain
+responsibilities with respect to end users, business partners and the
+like. While this license is intended to facilitate the commercial use
+of the Program, the Contributor who includes the Program in a
+commercial product offering should do so in a manner which does not
+create potential liability for other Contributors. Therefore, if a
+Contributor includes the Program in a commercial product offering,
+such Contributor ("Commercial Contributor") hereby agrees to defend
+and indemnify every other Contributor ("Indemnified Contributor")
+against any losses, damages and costs (collectively "Losses") arising
+from claims, lawsuits and other legal actions brought by a third party
+against the Indemnified Contributor to the extent caused by the acts
+or omissions of such Commercial Contributor in connection with its
+distribution of the Program in a commercial product offering. The
+obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement.
+In order to qualify, an Indemnified Contributor must: a) promptly
+notify the Commercial Contributor in writing of such claim, and b)
+allow the Commercial Contributor to control, and cooperate with the
+Commercial Contributor in, the defense and any related settlement
+negotiations. The Indemnified Contributor may participate in any such
+claim at its own expense.
+
+For example, a Contributor might include the Program in a commercial
+product offering, Product X. That Contributor is then a Commercial
+Contributor. If that Commercial Contributor then makes performance
+claims, or offers warranties related to Product X, those performance
+claims and warranties are such Commercial Contributor's responsibility
+alone. Under this section, the Commercial Contributor would have to
+defend claims against the other Contributors related to those
+performance claims and warranties, and if a court requires any other
+Contributor to pay any damages as a result, the Commercial Contributor
+must pay those damages.
+
+5. NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS
+PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY
+WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY
+OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
+responsible for determining the appropriateness of using and
+distributing the Program and assumes all risks associated with its
+exercise of rights under this Agreement , including but not limited to
+the risks and costs of program errors, compliance with applicable
+laws, damage to or loss of data, programs or equipment, and
+unavailability or interruption of operations.
+
+6. DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR
+ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING
+WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR
+DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
+HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under
+applicable law, it shall not affect the validity or enforceability of
+the remainder of the terms of this Agreement, and without further
+action by the parties hereto, such provision shall be reformed to the
+minimum extent necessary to make such provision valid and enforceable.
+
+If Recipient institutes patent litigation against any entity
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+the Program itself (excluding combinations of the Program with other
+software or hardware) infringes such Recipient's patent(s), then such
+Recipient's rights granted under Section 2(b) shall terminate as of
+the date such litigation is filed.
+
+All Recipient's rights under this Agreement shall terminate if it
+fails to comply with any of the material terms or conditions of this
+Agreement and does not cure such failure in a reasonable period of
+time after becoming aware of such noncompliance. If all Recipient's
+rights under this Agreement terminate, Recipient agrees to cease use
+and distribution of the Program as soon as reasonably practicable.
+However, Recipient's obligations under this Agreement and any licenses
+granted by Recipient relating to the Program shall continue and
+survive.
+
+Everyone is permitted to copy and distribute copies of this Agreement,
+but in order to avoid inconsistency the Agreement is copyrighted and
+may only be modified in the following manner. The Agreement Steward
+reserves the right to publish new versions (including revisions) of
+this Agreement from time to time. No one other than the Agreement
+Steward has the right to modify this Agreement. The Eclipse Foundation
+is the initial Agreement Steward. The Eclipse Foundation may assign
+the responsibility to serve as the Agreement Steward to a suitable
+separate entity. Each new version of the Agreement will be given a
+distinguishing version number. The Program (including Contributions)
+may always be distributed subject to the version of the Agreement
+under which it was received. In addition, after a new version of the
+Agreement is published, Contributor may elect to distribute the
+Program (including its Contributions) under the new version. Except as
+expressly stated in Sections 2(a) and 2(b) above, Recipient receives
+no rights or licenses to the intellectual property of any Contributor
+under this Agreement, whether expressly, by implication, estoppel or
+otherwise. All rights in the Program not expressly granted under this
+Agreement are reserved.
+
+This Agreement is governed by the laws of the State of New York and
+the intellectual property laws of the United States of America. No
+party to this Agreement will bring a legal action under this Agreement
+more than one year after the cause of action arose. Each party waives
+its rights to a jury trial in any resulting litigation.
+
+===============================================================================
+
+For the Rhino JavaScript container component:
+
+Mozilla Public License 1.1 (MPL 1.1)
+
+1. Definitions.
+
+ 1.0.1. "Commercial Use" means distribution or otherwise making the
+Covered Code available to a third party.
+
+ 1.1. "Contributor" means each entity that creates or contributes to
+the creation of Modifications.
+
+ 1.2. "Contributor Version" means the combination of the Original Code,
+prior Modifications used by a Contributor, and the Modifications made by that
+particular Contributor.
+
+ 1.3. "Covered Code" means the Original Code or Modifications or the
+combination of the Original Code and Modifications, in each case including
+portions thereof.
+
+ 1.4. "Electronic Distribution Mechanism" means a mechanism generally
+accepted in the software development community for the electronic transfer of
+data.
+
+ 1.5. "Executable" means Covered Code in any form other than Source
+Code.
+
+ 1.6. "Initial Developer" means the individual or entity identified as
+the Initial Developer in the Source Code notice required by Exhibit A.
+
+ 1.7. "Larger Work" means a work which combines Covered Code or
+portions thereof with code not governed by the terms of this License.
+
+ 1.8. "License" means this document.
+
+ 1.8.1. "Licensable" means having the right to grant, to the maximum
+extent possible, whether at the time of the initial grant or subsequently
+acquired, any and all of the rights conveyed herein.
+
+ 1.9. "Modifications" means any addition to or deletion from the
+substance or structure of either the Original Code or any previous
+Modifications. When Covered Code is released as a series of files, a
+Modification is:
+ A. Any addition to or deletion from the contents of a file
+containing Original Code or previous Modifications.
+
+ B. Any new file that contains any part of the Original Code or
+previous Modifications.
+
+ 1.10. "Original Code" means Source Code of computer software code
+which is described in the Source Code notice required by Exhibit A as Original
+Code, and which, at the time of its release under this License is not already
+Covered Code governed by this License.
+
+ 1.10.1. "Patent Claims" means any patent claim(s), now owned or
+hereafter acquired, including without limitation, method, process, and
+apparatus claims, in any patent Licensable by grantor.
+
+ 1.11. "Source Code" means the preferred form of the Covered Code for
+making modifications to it, including all modules it contains, plus any
+associated interface definition files, scripts used to control compilation and
+installation of an Executable, or source code differential comparisons against
+either the Original Code or another well known, available Covered Code of the
+Contributor's choice. The Source Code can be in a compressed or archival form,
+provided the appropriate decompression or de-archiving software is widely
+available for no charge.
+
+ 1.12. "You" (or "Your") means an individual or a legal entity
+exercising rights under, and complying with all of the terms of, this License
+or a future version of this License issued under Section 6.1. For legal
+entities, "You" includes any entity which controls, is controlled by, or is
+under common control with You. For purposes of this definition, "control"
+means (a) the power, direct or indirect, to cause the direction or management
+of such entity, whether by contract or otherwise, or (b) ownership of more
+than fifty percent (50%) of the outstanding shares or beneficial ownership of
+such entity.
+
+2. Source Code License.
+
+ 2.1. The Initial Developer Grant.
+ The Initial Developer hereby grants You a world-wide, royalty-free,
+non-exclusive license, subject to third party intellectual property claims:
+ (a) under intellectual property rights (other than patent or
+trademark) Licensable by Initial Developer to use, reproduce, modify, display,
+perform, sublicense and distribute the Original Code (or portions thereof)
+with or without Modifications, and/or as part of a Larger Work; and
+
+ (b) under Patents Claims infringed by the making, using or selling
+of Original Code, to make, have made, use, practice, sell, and offer for sale,
+and/or otherwise dispose of the Original Code (or portions thereof).
+ (c) the licenses granted in this Section 2.1(a) and
+(b) are effective on the date Initial Developer first distributes Original
+Code under the terms of this License.
+
+ (d) Notwithstanding Section 2.1(b) above, no patent license is
+granted: 1) for code that You delete from the Original Code; 2) separate from
+the Original Code; or 3) for infringements caused by: i) the modification of
+the Original Code or ii) the combination of the Original Code with other
+software or devices.
+
+ 2.2. Contributor Grant.
+ Subject to third party intellectual property claims, each Contributor
+hereby grants You a world-wide, royalty-free, non-exclusive license
+
+ (a) under intellectual property rights (other than patent or
+trademark) Licensable by Contributor, to use, reproduce, modify, display,
+perform, sublicense and distribute the Modifications created by such
+Contributor (or portions thereof) either on an unmodified basis, with other
+Modifications, as Covered Code and/or as part of a Larger Work; and
+
+ (b) under Patent Claims infringed by the making, using, or selling
+of Modifications made by that Contributor either alone and/or in combination
+with its Contributor Version (or portions of such combination), to make, use,
+sell, offer for sale, have made, and/or otherwise dispose of: 1) Modifications
+made by that Contributor (or portions thereof); and 2) the combination of
+Modifications made by that Contributor with its Contributor Version (or
+portions of such combination).
+
+ (c) the licenses granted in Sections 2.2(a) and 2.2(b) are
+effective on the date Contributor first makes Commercial Use of the Covered
+Code.
+
+ (d) Notwithstanding Section 2.2(b) above, no patent license is
+granted: 1) for any code that Contributor has deleted from the Contributor
+Version; 2) separate from the Contributor Version; 3) for infringements
+caused by: i) third party modifications of Contributor Version or ii) the
+combination of Modifications made by that Contributor with other software
+(except as part of the Contributor Version) or other devices; or 4) under
+Patent Claims infringed by Covered Code in the absence of Modifications made
+by that Contributor.
+
+
+3. Distribution Obligations.
+
+ 3.1. Application of License.
+ The Modifications which You create or to which You contribute are
+governed by the terms of this License, including without limitation Section
+2.2. The Source Code version of Covered Code may be distributed only under the
+terms of this License or a future version of this License released under
+Section 6.1, and You must include a copy of this License with every copy of
+the Source Code You distribute. You may not offer or impose any terms on any
+Source Code version that alters or restricts the applicable version of this
+License or the recipients' rights hereunder. However, You may include an
+additional document offering the additional rights described in Section 3.5.
+
+ 3.2. Availability of Source Code.
+ Any Modification which You create or to which You contribute must be
+made available in Source Code form under the terms of this License either on
+the same media as an Executable version or via an accepted Electronic
+Distribution Mechanism to anyone to whom you made an Executable version
+available; and if made available via Electronic Distribution Mechanism, must
+remain available for at least twelve (12) months after the date it initially
+became available, or at least six (6) months after a subsequent version of
+that particular Modification has been made available to such recipients. You
+are responsible for ensuring that the Source Code version remains available
+even if the Electronic Distribution Mechanism is maintained by a third party.
+
+ 3.3. Description of Modifications.
+ You must cause all Covered Code to which You contribute to contain a
+file documenting the changes You made to create that Covered Code and the date
+of any change. You must include a prominent statement that the Modification is
+derived, directly or indirectly, from Original Code provided by the Initial
+Developer and including the name of the Initial Developer in (a) the Source
+Code, and (b) in any notice in an Executable version or related documentation
+in which You describe the origin or ownership of the Covered Code.
+
+ 3.4. Intellectual Property Matters
+ (a) Third Party Claims.
+ If Contributor has knowledge that a license under a third party's
+intellectual property rights is required to exercise the rights granted by
+such Contributor under Sections 2.1 or 2.2, Contributor must include a text
+file with the Source Code distribution titled "LEGAL" which describes the
+claim and the party making the claim in sufficient detail that a recipient
+will know whom to contact. If Contributor obtains such knowledge after the
+Modification is made available as described in Section 3.2, Contributor shall
+promptly modify the LEGAL file in all copies Contributor makes available
+thereafter and shall take other steps (such as notifying appropriate mailing
+lists or newsgroups) reasonably calculated to inform those who received the
+Covered Code that new knowledge has been obtained.
+
+ (b) Contributor APIs.
+ If Contributor's Modifications include an application programming
+interface and Contributor has knowledge of patent licenses which are
+reasonably necessary to implement that API, Contributor must also include this
+information in the LEGAL file.
+
+ (c) Representations.
+ Contributor represents that, except as disclosed pursuant to
+Section 3.4(a) above, Contributor believes that Contributor's Modifications
+are Contributor's original creation(s) and/or Contributor has sufficient
+rights to grant the rights conveyed by this License.
+
+
+ 3.5. Required Notices.
+ You must duplicate the notice in Exhibit A in each file of the Source
+Code. If it is not possible to put such notice in a particular Source Code
+file due to its structure, then You must include such notice in a location
+(such as a relevant directory) where a user would be likely to look for such a
+notice. If You created one or more Modification(s) You may add your name as a
+Contributor to the notice described in Exhibit A. You must also duplicate
+this License in any documentation for the Source Code where You describe
+recipients' rights or ownership rights relating to Covered Code. You may
+choose to offer, and to charge a fee for, warranty, support, indemnity or
+liability obligations to one or more recipients of Covered Code. However, You
+may do so only on Your own behalf, and not on behalf of the Initial Developer
+or any Contributor. You must make it absolutely clear than any such warranty,
+support, indemnity or liability obligation is offered by You alone, and You
+hereby agree to indemnify the Initial Developer and every Contributor for any
+liability incurred by the Initial Developer or such Contributor as a result of
+warranty, support, indemnity or liability terms You offer.
+
+ 3.6. Distribution of Executable Versions.
+ You may distribute Covered Code in Executable form only if the
+requirements of Section 3.1-3.5 have been met for that Covered Code, and if
+You include a notice stating that the Source Code version of the Covered Code
+is available under the terms of this License, including a description of how
+and where You have fulfilled the obligations of Section 3.2. The notice must
+be conspicuously included in any notice in an Executable version, related
+documentation or collateral in which You describe recipients' rights relating
+to the Covered Code. You may distribute the Executable version of Covered Code
+or ownership rights under a license of Your choice, which may contain terms
+different from this License, provided that You are in compliance with the
+terms of this License and that the license for the Executable version does not
+attempt to limit or alter the recipient's rights in the Source Code version
+from the rights set forth in this License. If You distribute the Executable
+version under a different license You must make it absolutely clear that any
+terms which differ from this License are offered by You alone, not by the
+Initial Developer or any Contributor. You hereby agree to indemnify the
+Initial Developer and every Contributor for any liability incurred by the
+Initial Developer or such Contributor as a result of any such terms You offer.
+
+ 3.7. Larger Works.
+ You may create a Larger Work by combining Covered Code with other code
+not governed by the terms of this License and distribute the Larger Work as a
+single product. In such a case, You must make sure the requirements of this
+License are fulfilled for the Covered Code.
+
+4. Inability to Comply Due to Statute or Regulation.
+
+ If it is impossible for You to comply with any of the terms of this
+License with respect to some or all of the Covered Code due to statute,
+judicial order, or regulation then You must: (a) comply with the terms of this
+License to the maximum extent possible; and (b) describe the limitations and
+the code they affect. Such description must be included in the LEGAL file
+described in Section 3.4 and must be included with all distributions of the
+Source Code. Except to the extent prohibited by statute or regulation, such
+description must be sufficiently detailed for a recipient of ordinary skill to
+be able to understand it.
+
+5. Application of this License.
+
+ This License applies to code to which the Initial Developer has attached
+the notice in Exhibit A and to related Covered Code.
+
+6. Versions of the License.
+
+ 6.1. New Versions.
+ Netscape Communications Corporation ("Netscape") may publish revised
+and/or new versions of the License from time to time. Each version will be
+given a distinguishing version number.
+
+ 6.2. Effect of New Versions.
+ Once Covered Code has been published under a particular version of the
+License, You may always continue to use it under the terms of that version.
+You may also choose to use such Covered Code under the terms of any subsequent
+version of the License published by Netscape. No one other than Netscape has
+the right to modify the terms applicable to Covered Code created under this
+License.
+
+ 6.3. Derivative Works.
+ If You create or use a modified version of this License (which you may
+only do in order to apply it to code which is not already Covered Code
+governed by this License), You must (a) rename Your license so that the
+phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape", "MPL", "NPL" or
+any confusingly similar phrase do not appear in your license (except to note
+that your license differs from this License) and (b) otherwise make it clear
+that Your version of the license contains terms which differ from the Mozilla
+Public License and Netscape Public License. (Filling in the name of the
+Initial Developer, Original Code or Contributor in the notice described in
+Exhibit A shall not of themselves be deemed to be modifications of this
+License.)
+
+7. DISCLAIMER OF WARRANTY.
+
+ COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT
+LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE,
+FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE
+QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED
+CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY
+OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR
+CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS
+DISCLAIMER.
+
+8. TERMINATION.
+
+ 8.1. This License and the rights granted hereunder will terminate
+automatically if You fail to comply with terms herein and fail to cure such
+breach within 30 days of becoming aware of the breach. All sublicenses to the
+Covered Code which are properly granted shall survive any termination of this
+License. Provisions which, by their nature, must remain in effect beyond the
+termination of this License shall survive.
+
+ 8.2. If You initiate litigation by asserting a patent infringement
+claim (excluding declatory judgment actions) against Initial Developer or a
+Contributor (the Initial Developer or Contributor against whom You file such
+action is referred to as "Participant") alleging that:
+
+ (a) such Participant's Contributor Version directly or indirectly
+infringes any patent, then any and all rights granted by such Participant to
+You under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice
+from Participant terminate prospectively, unless if within 60 days after
+receipt of notice You either: (i) agree in writing to pay Participant a
+mutually agreeable reasonable royalty for Your past and future use of
+Modifications made by such Participant, or (ii) withdraw Your litigation claim
+with respect to the Contributor Version against such Participant. If within
+60 days of notice, a reasonable royalty and payment arrangement are not
+mutually agreed upon in writing by the parties or the litigation claim is not
+withdrawn, the rights granted by Participant to You under Sections 2.1 and/or
+2.2 automatically terminate at the expiration of the 60 day notice period
+specified above.
+
+ (b) any software, hardware, or device, other than such Participant's
+Contributor Version, directly or indirectly infringes any patent, then any
+rights granted to You by such Participant under Sections 2.1(b) and 2.2(b) are
+revoked effective as of the date You first made, used, sold, distributed, or
+had made, Modifications made by that Participant.
+
+ 8.3. If You assert a patent infringement claim against Participant
+alleging that such Participant's Contributor Version directly or indirectly
+infringes any patent where such claim is resolved (such as by license or
+settlement) prior to the initiation of patent infringement litigation, then
+the reasonable value of the licenses granted by such Participant under
+Sections 2.1 or 2.2 shall be taken into account in determining the amount or
+value of any payment or license.
+
+ 8.4. In the event of termination under Sections 8.1 or 8.2 above, all
+end user license agreements (excluding distributors and resellers) which have
+been validly granted by You or any distributor hereunder prior to termination
+shall survive termination.
+
+9. LIMITATION OF LIABILITY.
+
+ UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
+(INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
+DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY
+SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING,
+WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER
+FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES,
+EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH
+DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH
+OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT
+APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
+EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS
+EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+10. U.S. GOVERNMENT END USERS.
+
+ The Covered Code is a "commercial item," as that term is defined in 48
+C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software" and
+"commercial computer software documentation," as such terms are used in 48
+C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R.
+227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users
+acquire Covered Code with only those rights set forth herein.
+
+11. MISCELLANEOUS.
+
+ This License represents the complete agreement concerning subject matter
+hereof. If any provision of this License is held to be unenforceable, such
+provision shall be reformed only to the extent necessary to make it
+enforceable. This License shall be governed by California law provisions
+(except to the extent applicable law, if any, provides otherwise), excluding
+its conflict-of-law provisions. With respect to disputes in which at least one
+party is a citizen of, or an entity chartered or registered to do business in
+the United States of America, any litigation relating to this License shall be
+subject to the jurisdiction of the Federal Courts of the Northern District of
+California, with venue lying in Santa Clara County, California, with the
+losing party responsible for costs, including without limitation, court costs
+and reasonable attorneys' fees and expenses. The application of the United
+Nations Convention on Contracts for the International Sale of Goods is
+expressly excluded. Any law or regulation which provides that the language of
+a contract shall be construed against the drafter shall not apply to this
+License.
+
+12. RESPONSIBILITY FOR CLAIMS.
+
+ As between Initial Developer and the Contributors, each party is
+responsible for claims and damages arising, directly or indirectly, out of its
+utilization of rights under this License and You agree to work with Initial
+Developer and Contributors to distribute such responsibility on an equitable
+basis. Nothing herein is intended or shall be deemed to constitute any
+admission of liability.
+
+13. MULTIPLE-LICENSED CODE.
+
+ Initial Developer may designate portions of the Covered Code as
+Multiple-Licensed. Multiple-Licensed means that the Initial Developer permits
+you to utilize portions of the Covered Code under Your choice of the MPL or
+the alternative licenses, if any, specified by the Initial Developer in the
+file described in Exhibit A.
+
+
+EXHIBIT A -Mozilla Public License.
+
+ ``The contents of this file are subject to the Mozilla Public License
+Version 1.1 (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.mozilla.org/MPL/
+
+ Software distributed under the License is distributed on an "AS IS"
+basis, WITHOUT WARRANTY OF
+ ANY KIND, either express or implied. See the License for the specific
+language governing rights and
+ limitations under the License.
+
+ The Original Code is ______________________________________.
+
+ The Initial Developer of the Original Code is ________________________.
+Portions created by
+ ______________________ are Copyright (C) ______
+_______________________. All Rights
+ Reserved.
+
+ Contributor(s): ______________________________________.
+
+ Alternatively, the contents of this file may be used under the terms of
+the _____ license (the [___] License), in which case the provisions of
+[______] License are applicable instead of those above. If you wish to allow
+use of your version of this file only under the terms of the [____] License
+and not to allow others to use your version of this file under the MPL,
+indicate your decision by deleting the provisions above and replace them
+with the notice and other provisions required by the [___] License. If you do
+not delete the provisions above, a recipient may use your version of this file
+under either the MPL or the [___] License."
+
+ [NOTE: The text of this Exhibit A may differ slightly from the text of
+the notices in the Source Code files of the Original Code. You should use the
+text of this Exhibit A rather than the text found in the Original Code Source
+Code for Your Modifications.]
+
+
+===============================================================================
+
+For the JAX-WS Reference Implementation component:
+
+COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
+
+
+ 1. Definitions.
+
+ 1.1. "Contributor" means each individual or entity that
+ creates or contributes to the creation of Modifications.
+
+ 1.2. "Contributor Version" means the combination of the
+ Original Software, prior Modifications used by a
+ Contributor (if any), and the Modifications made by that
+ particular Contributor.
+
+ 1.3. "Covered Software" means (a) the Original Software, or
+ (b) Modifications, or (c) the combination of files
+ containing Original Software with files containing
+ Modifications, in each case including portions thereof.
+
+ 1.4. "Executable" means the Covered Software in any form
+ other than Source Code.
+
+ 1.5. "Initial Developer" means the individual or entity
+ that first makes Original Software available under this
+ License.
+
+ 1.6. "Larger Work" means a work which combines Covered
+ Software or portions thereof with code not governed by the
+ terms of this License.
+
+ 1.7. "License" means this document.
+
+ 1.8. "Licensable" means having the right to grant, to the
+ maximum extent possible, whether at the time of the initial
+ grant or subsequently acquired, any and all of the rights
+ conveyed herein.
+
+ 1.9. "Modifications" means the Source Code and Executable
+ form of any of the following:
+
+ A. Any file that results from an addition to,
+ deletion from or modification of the contents of a
+ file containing Original Software or previous
+ Modifications;
+
+ B. Any new file that contains any part of the
+ Original Software or previous Modification; or
+
+ C. Any new file that is contributed or otherwise made
+ available under the terms of this License.
+
+ 1.10. "Original Software" means the Source Code and
+ Executable form of computer software code that is
+ originally released under this License.
+
+ 1.11. "Patent Claims" means any patent claim(s), now owned
+ or hereafter acquired, including without limitation,
+ method, process, and apparatus claims, in any patent
+ Licensable by grantor.
+
+ 1.12. "Source Code" means (a) the common form of computer
+ software code in which modifications are made and (b)
+ associated documentation included in or with such code.
+
+ 1.13. "You" (or "Your") means an individual or a legal
+ entity exercising rights under, and complying with all of
+ the terms of, this License. For legal entities, "You"
+ includes any entity which controls, is controlled by, or is
+ under common control with You. For purposes of this
+ definition, "control" means (a) the power, direct or
+ indirect, to cause the direction or management of such
+ entity, whether by contract or otherwise, or (b) ownership
+ of more than fifty percent (50%) of the outstanding shares
+ or beneficial ownership of such entity.
+
+ 2. License Grants.
+
+ 2.1. The Initial Developer Grant.
+
+ Conditioned upon Your compliance with Section 3.1 below and
+ subject to third party intellectual property claims, the
+ Initial Developer hereby grants You a world-wide,
+ royalty-free, non-exclusive license:
+
+ (a) under intellectual property rights (other than
+ patent or trademark) Licensable by Initial Developer,
+ to use, reproduce, modify, display, perform,
+ sublicense and distribute the Original Software (or
+ portions thereof), with or without Modifications,
+ and/or as part of a Larger Work; and
+
+ (b) under Patent Claims infringed by the making,
+ using or selling of Original Software, to make, have
+ made, use, practice, sell, and offer for sale, and/or
+ otherwise dispose of the Original Software (or
+ portions thereof).
+
+ (c) The licenses granted in Sections 2.1(a) and (b)
+ are effective on the date Initial Developer first
+ distributes or otherwise makes the Original Software
+ available to a third party under the terms of this
+ License.
+
+ (d) Notwithstanding Section 2.1(b) above, no patent
+ license is granted: (1) for code that You delete from
+ the Original Software, or (2) for infringements
+ caused by: (i) the modification of the Original
+ Software, or (ii) the combination of the Original
+ Software with other software or devices.
+
+ 2.2. Contributor Grant.
+
+ Conditioned upon Your compliance with Section 3.1 below and
+ subject to third party intellectual property claims, each
+ Contributor hereby grants You a world-wide, royalty-free,
+ non-exclusive license:
+
+ (a) under intellectual property rights (other than
+ patent or trademark) Licensable by Contributor to
+ use, reproduce, modify, display, perform, sublicense
+ and distribute the Modifications created by such
+ Contributor (or portions thereof), either on an
+ unmodified basis, with other Modifications, as
+ Covered Software and/or as part of a Larger Work; and
+
+
+ (b) under Patent Claims infringed by the making,
+ using, or selling of Modifications made by that
+ Contributor either alone and/or in combination with
+ its Contributor Version (or portions of such
+ combination), to make, use, sell, offer for sale,
+ have made, and/or otherwise dispose of: (1)
+ Modifications made by that Contributor (or portions
+ thereof); and (2) the combination of Modifications
+ made by that Contributor with its Contributor Version
+ (or portions of such combination).
+
+ (c) The licenses granted in Sections 2.2(a) and
+ 2.2(b) are effective on the date Contributor first
+ distributes or otherwise makes the Modifications
+ available to a third party.
+
+ (d) Notwithstanding Section 2.2(b) above, no patent
+ license is granted: (1) for any code that Contributor
+ has deleted from the Contributor Version; (2) for
+ infringements caused by: (i) third party
+ modifications of Contributor Version, or (ii) the
+ combination of Modifications made by that Contributor
+ with other software (except as part of the
+ Contributor Version) or other devices; or (3) under
+ Patent Claims infringed by Covered Software in the
+ absence of Modifications made by that Contributor.
+
+ 3. Distribution Obligations.
+
+ 3.1. Availability of Source Code.
+
+ Any Covered Software that You distribute or otherwise make
+ available in Executable form must also be made available in
+ Source Code form and that Source Code form must be
+ distributed only under the terms of this License. You must
+ include a copy of this License with every copy of the
+ Source Code form of the Covered Software You distribute or
+ otherwise make available. You must inform recipients of any
+ such Covered Software in Executable form as to how they can
+ obtain such Covered Software in Source Code form in a
+ reasonable manner on or through a medium customarily used
+ for software exchange.
+
+ 3.2. Modifications.
+
+ The Modifications that You create or to which You
+ contribute are governed by the terms of this License. You
+ represent that You believe Your Modifications are Your
+ original creation(s) and/or You have sufficient rights to
+ grant the rights conveyed by this License.
+
+ 3.3. Required Notices.
+
+ You must include a notice in each of Your Modifications
+ that identifies You as the Contributor of the Modification.
+ You may not remove or alter any copyright, patent or
+ trademark notices contained within the Covered Software, or
+ any notices of licensing or any descriptive text giving
+ attribution to any Contributor or the Initial Developer.
+
+ 3.4. Application of Additional Terms.
+
+ You may not offer or impose any terms on any Covered
+ Software in Source Code form that alters or restricts the
+ applicable version of this License or the recipients'
+ rights hereunder. You may choose to offer, and to charge a
+ fee for, warranty, support, indemnity or liability
+ obligations to one or more recipients of Covered Software.
+ However, you may do so only on Your own behalf, and not on
+ behalf of the Initial Developer or any Contributor. You
+ must make it absolutely clear that any such warranty,
+ support, indemnity or liability obligation is offered by
+ You alone, and You hereby agree to indemnify the Initial
+ Developer and every Contributor for any liability incurred
+ by the Initial Developer or such Contributor as a result of
+ warranty, support, indemnity or liability terms You offer.
+
+
+ 3.5. Distribution of Executable Versions.
+
+ You may distribute the Executable form of the Covered
+ Software under the terms of this License or under the terms
+ of a license of Your choice, which may contain terms
+ different from this License, provided that You are in
+ compliance with the terms of this License and that the
+ license for the Executable form does not attempt to limit
+ or alter the recipient's rights in the Source Code form
+ from the rights set forth in this License. If You
+ distribute the Covered Software in Executable form under a
+ different license, You must make it absolutely clear that
+ any terms which differ from this License are offered by You
+ alone, not by the Initial Developer or Contributor. You
+ hereby agree to indemnify the Initial Developer and every
+ Contributor for any liability incurred by the Initial
+ Developer or such Contributor as a result of any such terms
+ You offer.
+
+ 3.6. Larger Works.
+
+ You may create a Larger Work by combining Covered Software
+ with other code not governed by the terms of this License
+ and distribute the Larger Work as a single product. In such
+ a case, You must make sure the requirements of this License
+ are fulfilled for the Covered Software.
+
+ 4. Versions of the License.
+
+ 4.1. New Versions.
+
+ Sun Microsystems, Inc. is the initial license steward and
+ may publish revised and/or new versions of this License
+ from time to time. Each version will be given a
+ distinguishing version number. Except as provided in
+ Section 4.3, no one other than the license steward has the
+ right to modify this License.
+
+ 4.2. Effect of New Versions.
+
+ You may always continue to use, distribute or otherwise
+ make the Covered Software available under the terms of the
+ version of the License under which You originally received
+ the Covered Software. If the Initial Developer includes a
+ notice in the Original Software prohibiting it from being
+ distributed or otherwise made available under any
+ subsequent version of the License, You must distribute and
+ make the Covered Software available under the terms of the
+ version of the License under which You originally received
+ the Covered Software. Otherwise, You may also choose to
+ use, distribute or otherwise make the Covered Software
+ available under the terms of any subsequent version of the
+ License published by the license steward.
+
+ 4.3. Modified Versions.
+
+ When You are an Initial Developer and You want to create a
+ new license for Your Original Software, You may create and
+ use a modified version of this License if You: (a) rename
+ the license and remove any references to the name of the
+ license steward (except to note that the license differs
+ from this License); and (b) otherwise make it clear that
+ the license contains terms which differ from this License.
+
+
+ 5. DISCLAIMER OF WARRANTY.
+
+ COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS"
+ BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
+ INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED
+ SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR
+ PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND
+ PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY
+ COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE
+ INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF
+ ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF
+ WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
+ ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS
+ DISCLAIMER.
+
+ 6. TERMINATION.
+
+ 6.1. This License and the rights granted hereunder will
+ terminate automatically if You fail to comply with terms
+ herein and fail to cure such breach within 30 days of
+ becoming aware of the breach. Provisions which, by their
+ nature, must remain in effect beyond the termination of
+ this License shall survive.
+
+ 6.2. If You assert a patent infringement claim (excluding
+ declaratory judgment actions) against Initial Developer or
+ a Contributor (the Initial Developer or Contributor against
+ whom You assert such claim is referred to as "Participant")
+ alleging that the Participant Software (meaning the
+ Contributor Version where the Participant is a Contributor
+ or the Original Software where the Participant is the
+ Initial Developer) directly or indirectly infringes any
+ patent, then any and all rights granted directly or
+ indirectly to You by such Participant, the Initial
+ Developer (if the Initial Developer is not the Participant)
+ and all Contributors under Sections 2.1 and/or 2.2 of this
+ License shall, upon 60 days notice from Participant
+ terminate prospectively and automatically at the expiration
+ of such 60 day notice period, unless if within such 60 day
+ period You withdraw Your claim with respect to the
+ Participant Software against such Participant either
+ unilaterally or pursuant to a written agreement with
+ Participant.
+
+ 6.3. In the event of termination under Sections 6.1 or 6.2
+ above, all end user licenses that have been validly granted
+ by You or any distributor hereunder prior to termination
+ (excluding licenses granted to You by any distributor)
+ shall survive termination.
+
+ 7. LIMITATION OF LIABILITY.
+
+ UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
+ (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE
+ INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF
+ COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE
+ LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR
+ CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT
+ LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK
+ STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
+ COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
+ INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
+ LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL
+ INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT
+ APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO
+ NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR
+ CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT
+ APPLY TO YOU.
+
+ 8. U.S. GOVERNMENT END USERS.
+
+ The Covered Software is a "commercial item," as that term is
+ defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial
+ computer software" (as that term is defined at 48 C.F.R.
+ 252.227-7014(a)(1)) and "commercial computer software
+ documentation" as such terms are used in 48 C.F.R. 12.212 (Sept.
+ 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1
+ through 227.7202-4 (June 1995), all U.S. Government End Users
+ acquire Covered Software with only those rights set forth herein.
+ This U.S. Government Rights clause is in lieu of, and supersedes,
+ any other FAR, DFAR, or other clause or provision that addresses
+ Government rights in computer software under this License.
+
+ 9. MISCELLANEOUS.
+
+ This License represents the complete agreement concerning subject
+ matter hereof. If any provision of this License is held to be
+ unenforceable, such provision shall be reformed only to the
+ extent necessary to make it enforceable. This License shall be
+ governed by the law of the jurisdiction specified in a notice
+ contained within the Original Software (except to the extent
+ applicable law, if any, provides otherwise), excluding such
+ jurisdiction's conflict-of-law provisions. Any litigation
+ relating to this License shall be subject to the jurisdiction of
+ the courts located in the jurisdiction and venue specified in a
+ notice contained within the Original Software, with the losing
+ party responsible for costs, including, without limitation, court
+ costs and reasonable attorneys' fees and expenses. The
+ application of the United Nations Convention on Contracts for the
+ International Sale of Goods is expressly excluded. Any law or
+ regulation which provides that the language of a contract shall
+ be construed against the drafter shall not apply to this License.
+ You agree that You alone are responsible for compliance with the
+ United States export administration regulations (and the export
+ control laws and regulation of any other countries) when You use,
+ distribute or otherwise make available any Covered Software.
+
+ 10. RESPONSIBILITY FOR CLAIMS.
+
+ As between Initial Developer and the Contributors, each party is
+ responsible for claims and damages arising, directly or
+ indirectly, out of its utilization of rights under this License
+ and You agree to work with Initial Developer and Contributors to
+ distribute such responsibility on an equitable basis. Nothing
+ herein is intended or shall be deemed to constitute any admission
+ of liability.
+
diff --git a/branches/sdo-java-M2/sdo/tools/src/main/resources/META-INF/NOTICE b/branches/sdo-java-M2/sdo/tools/src/main/resources/META-INF/NOTICE
new file mode 100644
index 0000000000..322cf40f9f
--- /dev/null
+++ b/branches/sdo-java-M2/sdo/tools/src/main/resources/META-INF/NOTICE
@@ -0,0 +1,29 @@
+Apache Tuscany SDO for Java
+Copyright 2006 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+Apache Tuscany is an effort undergoing incubation at The Apache Software Foundation (ASF),
+sponsored by the Apache Web Services PMC. Incubation is required of all newly accepted
+projects until a further review indicates that the infrastructure, communications,
+and decision making process have stabilized in a manner consistent with other successful
+ASF projects. While incubation status is not necessarily a reflection of the completeness
+or stability of the code, it does indicate that the project has yet to be fully endorsed
+by the ASF.
+
+Unless otherwise indicated, all distribution made available by the Apache Software Foundation
+is provided to you under the terms and conditions of the Apache License Version 2.0 ("AL").
+A copy of the AL is provided with this distribution as the LICENSE.txt file present in the
+root directory, and is also available at http://www.apache.org/licenses/.
+
+The terms and conditions governing the distribution may refer to the AL or other license
+agreements, notices or terms and conditions. Some of these other license agreements may
+include (but are not limited to):
+
+ . Eclipse Public License Version 1.0 (available at http://www.eclipse.org/legal/epl-v10.html)
+ . Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)
+
+It is your obligation to read and accept all such terms and conditions prior to use of the
+distribution. If term or condition is provided, please contact the Apache Software Foundation
+to determine what terms and conditions govern that particular distribution.
diff --git a/branches/sdo-java-M2/sdo/tools/src/main/resources/META-INF/README.txt b/branches/sdo-java-M2/sdo/tools/src/main/resources/META-INF/README.txt
new file mode 100644
index 0000000000..9b26d1690a
--- /dev/null
+++ b/branches/sdo-java-M2/sdo/tools/src/main/resources/META-INF/README.txt
@@ -0,0 +1,35 @@
+Apache Tuscany M1 build (May, 2006)
+===================================
+
+http://incubator.apache.org/tuscany/
+
+Tuscany is an effort undergoing incubation at the Apache Software Foundation
+(ASF), sponsored by the Web Services PMC.
+
+Incubation is required of all newly accepted projects until a further review
+indicates that the infrastructure, communications, and decision making process
+have stabilized in a manner consistent with other successful ASF projects.
+
+While incubation status is not necessarily a reflection of the completeness or
+stability of the code, it does indicate that the project has yet to be fully
+endorsed by the ASF.
+
+
+Support
+-------
+
+Any problem with this release can be reported to the Tuscany mailing list
+or in the JIRA issue tracker.
+
+Mailing list subscription:
+ tuscany-dev-subscribe@ws.apache.org
+
+Jira:
+ http://issues.apache.org/jira/browse/Tuscany
+
+
+Thank you for using Tuscany!
+
+
+The Tuscany Team.
+
diff --git a/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/MixedQuote.java b/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/MixedQuote.java
new file mode 100644
index 0000000000..9fe16b1eea
--- /dev/null
+++ b/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/MixedQuote.java
@@ -0,0 +1,326 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.sequences;
+
+import commonj.sdo.Sequence;
+
+import java.math.BigDecimal;
+
+import java.util.List;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Mixed Quote</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link com.example.sequences.MixedQuote#getMixed <em>Mixed</em>}</li>
+ * <li>{@link com.example.sequences.MixedQuote#getSymbol <em>Symbol</em>}</li>
+ * <li>{@link com.example.sequences.MixedQuote#getCompanyName <em>Company Name</em>}</li>
+ * <li>{@link com.example.sequences.MixedQuote#getPrice <em>Price</em>}</li>
+ * <li>{@link com.example.sequences.MixedQuote#getOpen1 <em>Open1</em>}</li>
+ * <li>{@link com.example.sequences.MixedQuote#getHigh <em>High</em>}</li>
+ * <li>{@link com.example.sequences.MixedQuote#getLow <em>Low</em>}</li>
+ * <li>{@link com.example.sequences.MixedQuote#getVolume <em>Volume</em>}</li>
+ * <li>{@link com.example.sequences.MixedQuote#getChange1 <em>Change1</em>}</li>
+ * <li>{@link com.example.sequences.MixedQuote#getQuotes <em>Quotes</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public interface MixedQuote
+{
+ /**
+ * Returns the value of the '<em><b>Mixed</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Mixed</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Mixed</em>' attribute list.
+ * @generated
+ */
+ Sequence getMixed();
+
+ /**
+ * Returns the value of the '<em><b>Symbol</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Symbol</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Symbol</em>' attribute.
+ * @see #setSymbol(String)
+ * @generated
+ */
+ String getSymbol();
+
+ /**
+ * Sets the value of the '{@link com.example.sequences.MixedQuote#getSymbol <em>Symbol</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Symbol</em>' attribute.
+ * @see #getSymbol()
+ * @generated
+ */
+ void setSymbol(String value);
+
+ /**
+ * Returns the value of the '<em><b>Company Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Company Name</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Company Name</em>' attribute.
+ * @see #setCompanyName(String)
+ * @generated
+ */
+ String getCompanyName();
+
+ /**
+ * Sets the value of the '{@link com.example.sequences.MixedQuote#getCompanyName <em>Company Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Company Name</em>' attribute.
+ * @see #getCompanyName()
+ * @generated
+ */
+ void setCompanyName(String value);
+
+ /**
+ * Returns the value of the '<em><b>Price</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Price</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Price</em>' attribute.
+ * @see #setPrice(BigDecimal)
+ * @generated
+ */
+ BigDecimal getPrice();
+
+ /**
+ * Sets the value of the '{@link com.example.sequences.MixedQuote#getPrice <em>Price</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Price</em>' attribute.
+ * @see #getPrice()
+ * @generated
+ */
+ void setPrice(BigDecimal value);
+
+ /**
+ * Returns the value of the '<em><b>Open1</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Open1</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Open1</em>' attribute.
+ * @see #setOpen1(BigDecimal)
+ * @generated
+ */
+ BigDecimal getOpen1();
+
+ /**
+ * Sets the value of the '{@link com.example.sequences.MixedQuote#getOpen1 <em>Open1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Open1</em>' attribute.
+ * @see #getOpen1()
+ * @generated
+ */
+ void setOpen1(BigDecimal value);
+
+ /**
+ * Returns the value of the '<em><b>High</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>High</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>High</em>' attribute.
+ * @see #setHigh(BigDecimal)
+ * @generated
+ */
+ BigDecimal getHigh();
+
+ /**
+ * Sets the value of the '{@link com.example.sequences.MixedQuote#getHigh <em>High</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>High</em>' attribute.
+ * @see #getHigh()
+ * @generated
+ */
+ void setHigh(BigDecimal value);
+
+ /**
+ * Returns the value of the '<em><b>Low</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Low</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Low</em>' attribute.
+ * @see #setLow(BigDecimal)
+ * @generated
+ */
+ BigDecimal getLow();
+
+ /**
+ * Sets the value of the '{@link com.example.sequences.MixedQuote#getLow <em>Low</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Low</em>' attribute.
+ * @see #getLow()
+ * @generated
+ */
+ void setLow(BigDecimal value);
+
+ /**
+ * Returns the value of the '<em><b>Volume</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Volume</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Volume</em>' attribute.
+ * @see #isSetVolume()
+ * @see #unsetVolume()
+ * @see #setVolume(double)
+ * @generated
+ */
+ double getVolume();
+
+ /**
+ * Sets the value of the '{@link com.example.sequences.MixedQuote#getVolume <em>Volume</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Volume</em>' attribute.
+ * @see #isSetVolume()
+ * @see #unsetVolume()
+ * @see #getVolume()
+ * @generated
+ */
+ void setVolume(double value);
+
+ /**
+ * Unsets the value of the '{@link com.example.sequences.MixedQuote#getVolume <em>Volume</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetVolume()
+ * @see #getVolume()
+ * @see #setVolume(double)
+ * @generated
+ */
+ void unsetVolume();
+
+ /**
+ * Returns whether the value of the '{@link com.example.sequences.MixedQuote#getVolume <em>Volume</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Volume</em>' attribute is set.
+ * @see #unsetVolume()
+ * @see #getVolume()
+ * @see #setVolume(double)
+ * @generated
+ */
+ boolean isSetVolume();
+
+ /**
+ * Returns the value of the '<em><b>Change1</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Change1</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Change1</em>' attribute.
+ * @see #isSetChange1()
+ * @see #unsetChange1()
+ * @see #setChange1(double)
+ * @generated
+ */
+ double getChange1();
+
+ /**
+ * Sets the value of the '{@link com.example.sequences.MixedQuote#getChange1 <em>Change1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Change1</em>' attribute.
+ * @see #isSetChange1()
+ * @see #unsetChange1()
+ * @see #getChange1()
+ * @generated
+ */
+ void setChange1(double value);
+
+ /**
+ * Unsets the value of the '{@link com.example.sequences.MixedQuote#getChange1 <em>Change1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetChange1()
+ * @see #getChange1()
+ * @see #setChange1(double)
+ * @generated
+ */
+ void unsetChange1();
+
+ /**
+ * Returns whether the value of the '{@link com.example.sequences.MixedQuote#getChange1 <em>Change1</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Change1</em>' attribute is set.
+ * @see #unsetChange1()
+ * @see #getChange1()
+ * @see #setChange1(double)
+ * @generated
+ */
+ boolean isSetChange1();
+
+ /**
+ * Returns the value of the '<em><b>Quotes</b></em>' containment reference list.
+ * The list contents are of type {@link com.example.sequences.MixedQuote}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Quotes</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Quotes</em>' containment reference list.
+ * @generated
+ */
+ List getQuotes();
+
+} // MixedQuote
diff --git a/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/MixedRepeatingChoice.java b/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/MixedRepeatingChoice.java
new file mode 100644
index 0000000000..6f20eba6e1
--- /dev/null
+++ b/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/MixedRepeatingChoice.java
@@ -0,0 +1,99 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.sequences;
+
+import commonj.sdo.Sequence;
+
+import java.util.List;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Mixed Repeating Choice</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link com.example.sequences.MixedRepeatingChoice#getMixed <em>Mixed</em>}</li>
+ * <li>{@link com.example.sequences.MixedRepeatingChoice#getGroup <em>Group</em>}</li>
+ * <li>{@link com.example.sequences.MixedRepeatingChoice#getA <em>A</em>}</li>
+ * <li>{@link com.example.sequences.MixedRepeatingChoice#getB <em>B</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public interface MixedRepeatingChoice
+{
+ /**
+ * Returns the value of the '<em><b>Mixed</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Mixed</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Mixed</em>' attribute list.
+ * @generated
+ */
+ Sequence getMixed();
+
+ /**
+ * Returns the value of the '<em><b>Group</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Group</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Group</em>' attribute list.
+ * @generated
+ */
+ Sequence getGroup();
+
+ /**
+ * Returns the value of the '<em><b>A</b></em>' attribute list.
+ * The list contents are of type {@link java.lang.String}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>A</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>A</em>' attribute list.
+ * @generated
+ */
+ List getA();
+
+ /**
+ * Returns the value of the '<em><b>B</b></em>' attribute list.
+ * The list contents are of type {@link java.lang.Integer}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>B</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>B</em>' attribute list.
+ * @generated
+ */
+ List getB();
+
+} // MixedRepeatingChoice
diff --git a/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/RepeatingChoice.java b/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/RepeatingChoice.java
new file mode 100644
index 0000000000..1ffff03539
--- /dev/null
+++ b/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/RepeatingChoice.java
@@ -0,0 +1,85 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.sequences;
+
+import commonj.sdo.Sequence;
+
+import java.util.List;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Repeating Choice</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link com.example.sequences.RepeatingChoice#getGroup <em>Group</em>}</li>
+ * <li>{@link com.example.sequences.RepeatingChoice#getA <em>A</em>}</li>
+ * <li>{@link com.example.sequences.RepeatingChoice#getB <em>B</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public interface RepeatingChoice
+{
+ /**
+ * Returns the value of the '<em><b>Group</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Group</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Group</em>' attribute list.
+ * @generated
+ */
+ Sequence getGroup();
+
+ /**
+ * Returns the value of the '<em><b>A</b></em>' attribute list.
+ * The list contents are of type {@link java.lang.String}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>A</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>A</em>' attribute list.
+ * @generated
+ */
+ List getA();
+
+ /**
+ * Returns the value of the '<em><b>B</b></em>' attribute list.
+ * The list contents are of type {@link java.lang.Integer}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>B</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>B</em>' attribute list.
+ * @generated
+ */
+ List getB();
+
+} // RepeatingChoice
diff --git a/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/SequencesFactory.java b/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/SequencesFactory.java
new file mode 100644
index 0000000000..66eac414c6
--- /dev/null
+++ b/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/SequencesFactory.java
@@ -0,0 +1,86 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.sequences;
+
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Factory</b> for the model.
+ * It provides a create method for each non-abstract class of the model.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public interface SequencesFactory
+{
+
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ SequencesFactory INSTANCE = com.example.sequences.impl.SequencesFactoryImpl.init();
+
+ /**
+ * Returns a new object of class '<em>Mixed Quote</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Mixed Quote</em>'.
+ * @generated
+ */
+ MixedQuote createMixedQuote();
+
+ /**
+ * Returns a new object of class '<em>Mixed Repeating Choice</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Mixed Repeating Choice</em>'.
+ * @generated
+ */
+ MixedRepeatingChoice createMixedRepeatingChoice();
+
+ /**
+ * Returns a new object of class '<em>Repeating Choice</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Repeating Choice</em>'.
+ * @generated
+ */
+ RepeatingChoice createRepeatingChoice();
+
+ /**
+ * Returns a new object of class '<em>Two RCs</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Two RCs</em>'.
+ * @generated
+ */
+ TwoRCs createTwoRCs();
+
+ /**
+ * Returns a new object of class '<em>Two RCs Mixed</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Two RCs Mixed</em>'.
+ * @generated
+ */
+ TwoRCsMixed createTwoRCsMixed();
+
+} //SequencesFactory
diff --git a/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/TwoRCs.java b/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/TwoRCs.java
new file mode 100644
index 0000000000..8ffc5a39af
--- /dev/null
+++ b/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/TwoRCs.java
@@ -0,0 +1,154 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.sequences;
+
+import commonj.sdo.Sequence;
+
+import java.util.List;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Two RCs</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link com.example.sequences.TwoRCs#getGroup <em>Group</em>}</li>
+ * <li>{@link com.example.sequences.TwoRCs#getA <em>A</em>}</li>
+ * <li>{@link com.example.sequences.TwoRCs#getB <em>B</em>}</li>
+ * <li>{@link com.example.sequences.TwoRCs#getSplit <em>Split</em>}</li>
+ * <li>{@link com.example.sequences.TwoRCs#getGroup1 <em>Group1</em>}</li>
+ * <li>{@link com.example.sequences.TwoRCs#getY <em>Y</em>}</li>
+ * <li>{@link com.example.sequences.TwoRCs#getZ <em>Z</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public interface TwoRCs
+{
+ /**
+ * Returns the value of the '<em><b>Group</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Group</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Group</em>' attribute list.
+ * @generated
+ */
+ Sequence getGroup();
+
+ /**
+ * Returns the value of the '<em><b>A</b></em>' attribute list.
+ * The list contents are of type {@link java.lang.String}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>A</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>A</em>' attribute list.
+ * @generated
+ */
+ List getA();
+
+ /**
+ * Returns the value of the '<em><b>B</b></em>' attribute list.
+ * The list contents are of type {@link java.lang.Integer}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>B</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>B</em>' attribute list.
+ * @generated
+ */
+ List getB();
+
+ /**
+ * Returns the value of the '<em><b>Split</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Split</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Split</em>' attribute.
+ * @see #setSplit(String)
+ * @generated
+ */
+ String getSplit();
+
+ /**
+ * Sets the value of the '{@link com.example.sequences.TwoRCs#getSplit <em>Split</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Split</em>' attribute.
+ * @see #getSplit()
+ * @generated
+ */
+ void setSplit(String value);
+
+ /**
+ * Returns the value of the '<em><b>Group1</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Group1</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Group1</em>' attribute list.
+ * @generated
+ */
+ Sequence getGroup1();
+
+ /**
+ * Returns the value of the '<em><b>Y</b></em>' attribute list.
+ * The list contents are of type {@link java.lang.String}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Y</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Y</em>' attribute list.
+ * @generated
+ */
+ List getY();
+
+ /**
+ * Returns the value of the '<em><b>Z</b></em>' attribute list.
+ * The list contents are of type {@link java.lang.Integer}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Z</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Z</em>' attribute list.
+ * @generated
+ */
+ List getZ();
+
+} // TwoRCs
diff --git a/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/TwoRCsMixed.java b/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/TwoRCsMixed.java
new file mode 100644
index 0000000000..ef2d776d90
--- /dev/null
+++ b/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/TwoRCsMixed.java
@@ -0,0 +1,168 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.sequences;
+
+import commonj.sdo.Sequence;
+
+import java.util.List;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Two RCs Mixed</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link com.example.sequences.TwoRCsMixed#getMixed <em>Mixed</em>}</li>
+ * <li>{@link com.example.sequences.TwoRCsMixed#getGroup <em>Group</em>}</li>
+ * <li>{@link com.example.sequences.TwoRCsMixed#getA <em>A</em>}</li>
+ * <li>{@link com.example.sequences.TwoRCsMixed#getB <em>B</em>}</li>
+ * <li>{@link com.example.sequences.TwoRCsMixed#getSplit <em>Split</em>}</li>
+ * <li>{@link com.example.sequences.TwoRCsMixed#getGroup1 <em>Group1</em>}</li>
+ * <li>{@link com.example.sequences.TwoRCsMixed#getY <em>Y</em>}</li>
+ * <li>{@link com.example.sequences.TwoRCsMixed#getZ <em>Z</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public interface TwoRCsMixed
+{
+ /**
+ * Returns the value of the '<em><b>Mixed</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Mixed</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Mixed</em>' attribute list.
+ * @generated
+ */
+ Sequence getMixed();
+
+ /**
+ * Returns the value of the '<em><b>Group</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Group</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Group</em>' attribute list.
+ * @generated
+ */
+ Sequence getGroup();
+
+ /**
+ * Returns the value of the '<em><b>A</b></em>' attribute list.
+ * The list contents are of type {@link java.lang.String}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>A</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>A</em>' attribute list.
+ * @generated
+ */
+ List getA();
+
+ /**
+ * Returns the value of the '<em><b>B</b></em>' attribute list.
+ * The list contents are of type {@link java.lang.Integer}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>B</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>B</em>' attribute list.
+ * @generated
+ */
+ List getB();
+
+ /**
+ * Returns the value of the '<em><b>Split</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Split</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Split</em>' attribute.
+ * @see #setSplit(String)
+ * @generated
+ */
+ String getSplit();
+
+ /**
+ * Sets the value of the '{@link com.example.sequences.TwoRCsMixed#getSplit <em>Split</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Split</em>' attribute.
+ * @see #getSplit()
+ * @generated
+ */
+ void setSplit(String value);
+
+ /**
+ * Returns the value of the '<em><b>Group1</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Group1</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Group1</em>' attribute list.
+ * @generated
+ */
+ Sequence getGroup1();
+
+ /**
+ * Returns the value of the '<em><b>Y</b></em>' attribute list.
+ * The list contents are of type {@link java.lang.String}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Y</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Y</em>' attribute list.
+ * @generated
+ */
+ List getY();
+
+ /**
+ * Returns the value of the '<em><b>Z</b></em>' attribute list.
+ * The list contents are of type {@link java.lang.Integer}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Z</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Z</em>' attribute list.
+ * @generated
+ */
+ List getZ();
+
+} // TwoRCsMixed
diff --git a/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/impl/MixedQuoteImpl.java b/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/impl/MixedQuoteImpl.java
new file mode 100644
index 0000000000..be5915b1ce
--- /dev/null
+++ b/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/impl/MixedQuoteImpl.java
@@ -0,0 +1,660 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.sequences.impl;
+
+import com.example.sequences.MixedQuote;
+
+import commonj.sdo.Sequence;
+import commonj.sdo.Type;
+
+import commonj.sdo.helper.TypeHelper;
+
+import java.math.BigDecimal;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.tuscany.sdo.impl.DataObjectBase;
+
+import org.apache.tuscany.sdo.util.BasicSequence;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Mixed Quote</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link com.example.sequences.impl.MixedQuoteImpl#getMixed <em>Mixed</em>}</li>
+ * <li>{@link com.example.sequences.impl.MixedQuoteImpl#getSymbol <em>Symbol</em>}</li>
+ * <li>{@link com.example.sequences.impl.MixedQuoteImpl#getCompanyName <em>Company Name</em>}</li>
+ * <li>{@link com.example.sequences.impl.MixedQuoteImpl#getPrice <em>Price</em>}</li>
+ * <li>{@link com.example.sequences.impl.MixedQuoteImpl#getOpen1 <em>Open1</em>}</li>
+ * <li>{@link com.example.sequences.impl.MixedQuoteImpl#getHigh <em>High</em>}</li>
+ * <li>{@link com.example.sequences.impl.MixedQuoteImpl#getLow <em>Low</em>}</li>
+ * <li>{@link com.example.sequences.impl.MixedQuoteImpl#getVolume <em>Volume</em>}</li>
+ * <li>{@link com.example.sequences.impl.MixedQuoteImpl#getChange1 <em>Change1</em>}</li>
+ * <li>{@link com.example.sequences.impl.MixedQuoteImpl#getQuotes <em>Quotes</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class MixedQuoteImpl extends DataObjectBase implements MixedQuote
+{
+ /**
+ * The feature id for the '<em><b>Mixed</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- 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>Symbol</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int SYMBOL = 1;
+
+ /**
+ * The default value of the '{@link #getSymbol() <em>Symbol</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getSymbol()
+ * @generated
+ * @ordered
+ */
+ protected static final String SYMBOL_DEFAULT_ = null;
+
+ /**
+ * The feature id for the '<em><b>Company Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int COMPANY_NAME = 2;
+
+ /**
+ * The default value of the '{@link #getCompanyName() <em>Company Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getCompanyName()
+ * @generated
+ * @ordered
+ */
+ protected static final String COMPANY_NAME_DEFAULT_ = null;
+
+ /**
+ * The feature id for the '<em><b>Price</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int PRICE = 3;
+
+ /**
+ * The default value of the '{@link #getPrice() <em>Price</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getPrice()
+ * @generated
+ * @ordered
+ */
+ protected static final BigDecimal PRICE_DEFAULT_ = null;
+
+ /**
+ * The feature id for the '<em><b>Open1</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int OPEN1 = 4;
+
+ /**
+ * The default value of the '{@link #getOpen1() <em>Open1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getOpen1()
+ * @generated
+ * @ordered
+ */
+ protected static final BigDecimal OPEN1_DEFAULT_ = null;
+
+ /**
+ * The feature id for the '<em><b>High</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int HIGH = 5;
+
+ /**
+ * The default value of the '{@link #getHigh() <em>High</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getHigh()
+ * @generated
+ * @ordered
+ */
+ protected static final BigDecimal HIGH_DEFAULT_ = null;
+
+ /**
+ * The feature id for the '<em><b>Low</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int LOW = 6;
+
+ /**
+ * The default value of the '{@link #getLow() <em>Low</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getLow()
+ * @generated
+ * @ordered
+ */
+ protected static final BigDecimal LOW_DEFAULT_ = null;
+
+ /**
+ * The feature id for the '<em><b>Volume</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int VOLUME = 7;
+
+ /**
+ * The feature id for the '<em><b>Change1</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int CHANGE1 = 8;
+
+ /**
+ * The feature id for the '<em><b>Quotes</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int QUOTES = 9;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected MixedQuoteImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Type getType()
+ {
+ return TypeHelper.INSTANCE.getType(MixedQuote.class); //TBD Generate a more efficient implementation
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Sequence getMixed()
+ {
+ if (mixed == null)
+ {
+ mixed = createSequence(MIXED);
+
+ }
+ return mixed;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getSymbol()
+ {
+ return (String)get(getMixed(), getType(), SYMBOL);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setSymbol(String newSymbol)
+ {
+ set(getMixed(), getType(), SYMBOL, newSymbol);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getCompanyName()
+ {
+ return (String)get(getMixed(), getType(), COMPANY_NAME);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setCompanyName(String newCompanyName)
+ {
+ set(getMixed(), getType(), COMPANY_NAME, newCompanyName);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public BigDecimal getPrice()
+ {
+ return (BigDecimal)get(getMixed(), getType(), PRICE);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setPrice(BigDecimal newPrice)
+ {
+ set(getMixed(), getType(), PRICE, newPrice);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public BigDecimal getOpen1()
+ {
+ return (BigDecimal)get(getMixed(), getType(), OPEN1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setOpen1(BigDecimal newOpen1)
+ {
+ set(getMixed(), getType(), OPEN1, newOpen1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public BigDecimal getHigh()
+ {
+ return (BigDecimal)get(getMixed(), getType(), HIGH);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setHigh(BigDecimal newHigh)
+ {
+ set(getMixed(), getType(), HIGH, newHigh);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public BigDecimal getLow()
+ {
+ return (BigDecimal)get(getMixed(), getType(), LOW);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setLow(BigDecimal newLow)
+ {
+ set(getMixed(), getType(), LOW, newLow);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public double getVolume()
+ {
+ return ((Double)get(getMixed(), getType(), VOLUME)).doubleValue();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setVolume(double newVolume)
+ {
+ set(getMixed(), getType(), VOLUME, new Double(newVolume));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetVolume()
+ {
+ unset(getMixed(), getType(), VOLUME);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetVolume()
+ {
+ return isSet(getMixed(), getType(), VOLUME);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public double getChange1()
+ {
+ return ((Double)get(getMixed(), getType(), CHANGE1)).doubleValue();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setChange1(double newChange1)
+ {
+ set(getMixed(), getType(), CHANGE1, new Double(newChange1));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetChange1()
+ {
+ unset(getMixed(), getType(), CHANGE1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetChange1()
+ {
+ return isSet(getMixed(), getType(), CHANGE1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public List getQuotes()
+ {
+ return getList(getMixed(), getType(), QUOTES);
+
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeContext inverseRemove(Object otherEnd, int propertyIndex, ChangeContext changeContext)
+ {
+ switch (propertyIndex)
+ {
+ case MIXED:
+ return removeFromSequence(getMixed(), otherEnd, changeContext);
+ case QUOTES:
+ return removeFromList(getQuotes(), otherEnd, changeContext);
+ }
+ return super.inverseRemove(otherEnd, propertyIndex, changeContext);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object get(int propertyIndex, boolean resolve)
+ {
+ switch (propertyIndex)
+ {
+ case MIXED:
+ // XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view
+ //if (coreType)
+ return getMixed();
+ case SYMBOL:
+ return getSymbol();
+ case COMPANY_NAME:
+ return getCompanyName();
+ case PRICE:
+ return getPrice();
+ case OPEN1:
+ return getOpen1();
+ case HIGH:
+ return getHigh();
+ case LOW:
+ return getLow();
+ case VOLUME:
+ return new Double(getVolume());
+ case CHANGE1:
+ return new Double(getChange1());
+ case QUOTES:
+ return getQuotes();
+ }
+ return super.get(propertyIndex, resolve);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void set(int propertyIndex, Object newValue)
+ {
+ switch (propertyIndex)
+ {
+ case MIXED:
+ setSequence(getMixed(), newValue);
+ return;
+ case SYMBOL:
+ setSymbol((String)newValue);
+ return;
+ case COMPANY_NAME:
+ setCompanyName((String)newValue);
+ return;
+ case PRICE:
+ setPrice((BigDecimal)newValue);
+ return;
+ case OPEN1:
+ setOpen1((BigDecimal)newValue);
+ return;
+ case HIGH:
+ setHigh((BigDecimal)newValue);
+ return;
+ case LOW:
+ setLow((BigDecimal)newValue);
+ return;
+ case VOLUME:
+ setVolume(((Double)newValue).doubleValue());
+ return;
+ case CHANGE1:
+ setChange1(((Double)newValue).doubleValue());
+ return;
+ case QUOTES:
+ getQuotes().clear();
+ getQuotes().addAll((Collection)newValue);
+ return;
+ }
+ super.set(propertyIndex, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unset(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case MIXED:
+ unsetSequence(getMixed());
+ return;
+ case SYMBOL:
+ setSymbol(SYMBOL_DEFAULT_);
+ return;
+ case COMPANY_NAME:
+ setCompanyName(COMPANY_NAME_DEFAULT_);
+ return;
+ case PRICE:
+ setPrice(PRICE_DEFAULT_);
+ return;
+ case OPEN1:
+ setOpen1(OPEN1_DEFAULT_);
+ return;
+ case HIGH:
+ setHigh(HIGH_DEFAULT_);
+ return;
+ case LOW:
+ setLow(LOW_DEFAULT_);
+ return;
+ case VOLUME:
+ unsetVolume();
+ return;
+ case CHANGE1:
+ unsetChange1();
+ return;
+ case QUOTES:
+ getQuotes().clear();
+ return;
+ }
+ super.unset(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSet(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case MIXED:
+ // KDK - should this be !isSequenceEmpty?
+ return mixed != null && !isSequenceEmpty(getMixed());
+ case SYMBOL:
+ return SYMBOL_DEFAULT_ == null ? getSymbol() != null : !SYMBOL_DEFAULT_.equals(getSymbol());
+ case COMPANY_NAME:
+ return COMPANY_NAME_DEFAULT_ == null ? getCompanyName() != null : !COMPANY_NAME_DEFAULT_.equals(getCompanyName());
+ case PRICE:
+ return PRICE_DEFAULT_ == null ? getPrice() != null : !PRICE_DEFAULT_.equals(getPrice());
+ case OPEN1:
+ return OPEN1_DEFAULT_ == null ? getOpen1() != null : !OPEN1_DEFAULT_.equals(getOpen1());
+ case HIGH:
+ return HIGH_DEFAULT_ == null ? getHigh() != null : !HIGH_DEFAULT_.equals(getHigh());
+ case LOW:
+ return LOW_DEFAULT_ == null ? getLow() != null : !LOW_DEFAULT_.equals(getLow());
+ case VOLUME:
+ return isSetVolume();
+ case CHANGE1:
+ return isSetChange1();
+ case QUOTES:
+ return !getQuotes().isEmpty();
+ }
+ return super.isSet(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString()
+ {
+ if (isProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (mixed: ");
+ result.append(mixed);
+ result.append(')');
+ return result.toString();
+ }
+
+} //MixedQuoteImpl
diff --git a/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/impl/MixedRepeatingChoiceImpl.java b/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/impl/MixedRepeatingChoiceImpl.java
new file mode 100644
index 0000000000..e2a49f12f2
--- /dev/null
+++ b/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/impl/MixedRepeatingChoiceImpl.java
@@ -0,0 +1,302 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.sequences.impl;
+
+import com.example.sequences.MixedRepeatingChoice;
+
+import commonj.sdo.Sequence;
+import commonj.sdo.Type;
+
+import commonj.sdo.helper.TypeHelper;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.tuscany.sdo.impl.DataObjectBase;
+
+import org.apache.tuscany.sdo.util.BasicSequence;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Mixed Repeating Choice</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link com.example.sequences.impl.MixedRepeatingChoiceImpl#getMixed <em>Mixed</em>}</li>
+ * <li>{@link com.example.sequences.impl.MixedRepeatingChoiceImpl#getGroup <em>Group</em>}</li>
+ * <li>{@link com.example.sequences.impl.MixedRepeatingChoiceImpl#getA <em>A</em>}</li>
+ * <li>{@link com.example.sequences.impl.MixedRepeatingChoiceImpl#getB <em>B</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class MixedRepeatingChoiceImpl extends DataObjectBase implements MixedRepeatingChoice
+{
+ /**
+ * The feature id for the '<em><b>Mixed</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- 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;
+
+ /**
+ * 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 = 2;
+
+ /**
+ * The feature id for the '<em><b>B</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int B = 3;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected MixedRepeatingChoiceImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Type getType()
+ {
+ return TypeHelper.INSTANCE.getType(MixedRepeatingChoice.class); //TBD Generate a more efficient implementation
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Sequence getMixed()
+ {
+ if (mixed == null)
+ {
+ mixed = createSequence(MIXED);
+
+ }
+ return mixed;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Sequence getGroup()
+ {
+ return createSequence(getMixed(), getType(), GROUP);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public List getA()
+ {
+ return getList(getGroup(), getType(), A);
+
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public List getB()
+ {
+ return getList(getGroup(), getType(), B);
+
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeContext inverseRemove(Object otherEnd, int propertyIndex, ChangeContext changeContext)
+ {
+ switch (propertyIndex)
+ {
+ case MIXED:
+ return removeFromSequence(getMixed(), otherEnd, changeContext);
+ case GROUP:
+ return removeFromSequence(getGroup(), otherEnd, changeContext);
+ }
+ return super.inverseRemove(otherEnd, propertyIndex, changeContext);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object get(int propertyIndex, boolean resolve)
+ {
+ switch (propertyIndex)
+ {
+ case MIXED:
+ // XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view
+ //if (coreType)
+ return getMixed();
+ case GROUP:
+ // XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view
+ //if (coreType)
+ return getGroup();
+ case A:
+ return getA();
+ case B:
+ return getB();
+ }
+ return super.get(propertyIndex, resolve);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void set(int propertyIndex, Object newValue)
+ {
+ switch (propertyIndex)
+ {
+ case MIXED:
+ setSequence(getMixed(), newValue);
+ return;
+ case GROUP:
+ setSequence(getGroup(), newValue);
+ return;
+ case A:
+ getA().clear();
+ getA().addAll((Collection)newValue);
+ return;
+ case B:
+ getB().clear();
+ getB().addAll((Collection)newValue);
+ return;
+ }
+ super.set(propertyIndex, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unset(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case MIXED:
+ unsetSequence(getMixed());
+ return;
+ case GROUP:
+ unsetSequence(getGroup());
+ return;
+ case A:
+ getA().clear();
+ return;
+ case B:
+ getB().clear();
+ return;
+ }
+ super.unset(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSet(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case MIXED:
+ // KDK - should this be !isSequenceEmpty?
+ return mixed != null && !isSequenceEmpty(getMixed());
+ case GROUP:
+ return !isSequenceEmpty(getGroup());
+ case A:
+ return !getA().isEmpty();
+ case B:
+ return !getB().isEmpty();
+ }
+ return super.isSet(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString()
+ {
+ if (isProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (mixed: ");
+ result.append(mixed);
+ result.append(')');
+ return result.toString();
+ }
+
+} //MixedRepeatingChoiceImpl
diff --git a/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/impl/RepeatingChoiceImpl.java b/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/impl/RepeatingChoiceImpl.java
new file mode 100644
index 0000000000..addcb5b246
--- /dev/null
+++ b/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/impl/RepeatingChoiceImpl.java
@@ -0,0 +1,268 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.sequences.impl;
+
+import com.example.sequences.RepeatingChoice;
+
+import commonj.sdo.Sequence;
+import commonj.sdo.Type;
+
+import commonj.sdo.helper.TypeHelper;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.tuscany.sdo.impl.DataObjectBase;
+
+import org.apache.tuscany.sdo.util.BasicSequence;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Repeating Choice</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link com.example.sequences.impl.RepeatingChoiceImpl#getGroup <em>Group</em>}</li>
+ * <li>{@link com.example.sequences.impl.RepeatingChoiceImpl#getA <em>A</em>}</li>
+ * <li>{@link com.example.sequences.impl.RepeatingChoiceImpl#getB <em>B</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class RepeatingChoiceImpl extends DataObjectBase implements RepeatingChoice
+{
+ /**
+ * 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 = 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;
+
+ /**
+ * The feature id for the '<em><b>B</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int B = 2;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected RepeatingChoiceImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Type getType()
+ {
+ return TypeHelper.INSTANCE.getType(RepeatingChoice.class); //TBD Generate a more efficient implementation
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Sequence getGroup()
+ {
+ if (group == null)
+ {
+ group = createSequence(GROUP);
+
+ }
+ return group;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public List getA()
+ {
+ return getList(getGroup(), getType(), A);
+
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public List getB()
+ {
+ return getList(getGroup(), getType(), B);
+
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeContext inverseRemove(Object otherEnd, int propertyIndex, ChangeContext changeContext)
+ {
+ switch (propertyIndex)
+ {
+ case GROUP:
+ return removeFromSequence(getGroup(), otherEnd, changeContext);
+ }
+ return super.inverseRemove(otherEnd, propertyIndex, changeContext);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object get(int propertyIndex, boolean resolve)
+ {
+ switch (propertyIndex)
+ {
+ case GROUP:
+ // XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view
+ //if (coreType)
+ return getGroup();
+ case A:
+ return getA();
+ case B:
+ return getB();
+ }
+ return super.get(propertyIndex, resolve);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void set(int propertyIndex, Object newValue)
+ {
+ switch (propertyIndex)
+ {
+ case GROUP:
+ setSequence(getGroup(), newValue);
+ return;
+ case A:
+ getA().clear();
+ getA().addAll((Collection)newValue);
+ return;
+ case B:
+ getB().clear();
+ getB().addAll((Collection)newValue);
+ return;
+ }
+ super.set(propertyIndex, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unset(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case GROUP:
+ unsetSequence(getGroup());
+ return;
+ case A:
+ getA().clear();
+ return;
+ case B:
+ getB().clear();
+ return;
+ }
+ super.unset(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSet(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case GROUP:
+ // KDK - should this be !isSequenceEmpty?
+ return group != null && !isSequenceEmpty(getGroup());
+ case A:
+ return !getA().isEmpty();
+ case B:
+ return !getB().isEmpty();
+ }
+ return super.isSet(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString()
+ {
+ if (isProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (group: ");
+ result.append(group);
+ result.append(')');
+ return result.toString();
+ }
+
+} //RepeatingChoiceImpl
diff --git a/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/impl/SequencesFactoryImpl.java b/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/impl/SequencesFactoryImpl.java
new file mode 100644
index 0000000000..f558c6d5c7
--- /dev/null
+++ b/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/impl/SequencesFactoryImpl.java
@@ -0,0 +1,695 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.sequences.impl;
+
+import org.apache.tuscany.sdo.impl.FactoryBase;
+import org.apache.tuscany.sdo.impl.SDOFactoryImpl;
+import org.apache.tuscany.sdo.model.impl.ModelFactoryImpl;
+import org.apache.tuscany.sdo.model.impl.ModelPackageImpl;
+import org.apache.tuscany.sdo.util.SDOUtil;
+
+import com.example.sequences.MixedQuote;
+import com.example.sequences.MixedRepeatingChoice;
+import com.example.sequences.RepeatingChoice;
+import com.example.sequences.SequencesFactory;
+import com.example.sequences.TwoRCs;
+import com.example.sequences.TwoRCsMixed;
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Factory</b>.
+ * <!-- 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";
+
+
+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.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+
+ /**
+ * Creates an instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public SequencesFactoryImpl()
+ {
+ super(NAMESPACE_URI, NAMESPACE_PREFIX);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public DataObject create(int typeNumber)
+ {
+ switch (typeNumber)
+ {
+ // TODO make sure we're supposed to ingore DOCUMENT_ROOT
+ case MIXED_QUOTE: return (DataObject)createMixedQuote();
+ // TODO make sure we're supposed to ingore DOCUMENT_ROOT
+ case MIXED_REPEATING_CHOICE: return (DataObject)createMixedRepeatingChoice();
+ // TODO make sure we're supposed to ingore DOCUMENT_ROOT
+ case REPEATING_CHOICE: return (DataObject)createRepeatingChoice();
+ // TODO make sure we're supposed to ingore DOCUMENT_ROOT
+ case TWO_RCS: return (DataObject)createTwoRCs();
+ // TODO make sure we're supposed to ingore DOCUMENT_ROOT
+ case TWO_RCS_MIXED: return (DataObject)createTwoRCsMixed();
+ default:
+ return super.create(typeNumber);
+ }
+ }
+
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public MixedQuote createMixedQuote()
+ {
+ MixedQuoteImpl mixedQuote = new MixedQuoteImpl();
+ return mixedQuote;
+ }
+
+ // Following creates and initializes SDO metadata for the supported types.
+ protected Type mixedQuoteType = null;
+
+ public Type getMixedQuote()
+ {
+ // TODO - kdk - verify how to generate quoteType...mixedQuoteType?
+ return mixedQuoteType;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public MixedRepeatingChoice createMixedRepeatingChoice()
+ {
+ MixedRepeatingChoiceImpl mixedRepeatingChoice = new MixedRepeatingChoiceImpl();
+ return mixedRepeatingChoice;
+ }
+
+ // Following creates and initializes SDO metadata for the supported types.
+ protected Type mixedRepeatingChoiceType = null;
+
+ public Type getMixedRepeatingChoice()
+ {
+ // TODO - kdk - verify how to generate quoteType...mixedRepeatingChoiceType?
+ return mixedRepeatingChoiceType;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public RepeatingChoice createRepeatingChoice()
+ {
+ RepeatingChoiceImpl repeatingChoice = new RepeatingChoiceImpl();
+ return repeatingChoice;
+ }
+
+ // Following creates and initializes SDO metadata for the supported types.
+ protected Type repeatingChoiceType = null;
+
+ public Type getRepeatingChoice()
+ {
+ // TODO - kdk - verify how to generate quoteType...repeatingChoiceType?
+ return repeatingChoiceType;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public TwoRCs createTwoRCs()
+ {
+ TwoRCsImpl twoRCs = new TwoRCsImpl();
+ return twoRCs;
+ }
+
+ // Following creates and initializes SDO metadata for the supported types.
+ protected Type twoRCsType = null;
+
+ public Type getTwoRCs()
+ {
+ // TODO - kdk - verify how to generate quoteType...twoRCsType?
+ return twoRCsType;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public TwoRCsMixed createTwoRCsMixed()
+ {
+ TwoRCsMixedImpl twoRCsMixed = new TwoRCsMixedImpl();
+ return twoRCsMixed;
+ }
+
+ // Following creates and initializes SDO metadata for the supported types.
+ protected Type twoRCsMixedType = null;
+
+ public Type getTwoRCsMixed()
+ {
+ // TODO - kdk - verify how to generate quoteType...twoRCsMixedType?
+ return twoRCsMixedType;
+ }
+
+ private static boolean isInited = false;
+
+ public static SequencesFactoryImpl init()
+ {
+ if (isInited) return (SequencesFactoryImpl)FactoryBase.getStaticFactory(SequencesFactoryImpl.NAMESPACE_URI);
+ SequencesFactoryImpl theSequencesFactoryImpl = new SequencesFactoryImpl();
+ isInited = true;
+
+ // Initialize simple dependencies
+ SDOUtil.registerStaticTypes(SDOFactoryImpl.class);
+ SDOUtil.registerStaticTypes(ModelPackageImpl.class);
+
+ // Create package meta-data objects
+ theSequencesFactoryImpl.createMetaData();
+
+ // Initialize created meta-data
+ theSequencesFactoryImpl.initializeMetaData();
+
+ // Mark meta-data to indicate it can't be changed
+ //theSequencesFactoryImpl.freeze(); //FB do we need to freeze / should we freeze ????
+
+ return theSequencesFactoryImpl;
+ }
+
+ private boolean isCreated = false;
+
+ public void createMetaData()
+ {
+ if (isCreated) return;
+ isCreated = true;
+
+
+ mixedQuoteType = createType(false, MIXED_QUOTE);
+ createProperty(true, mixedQuoteType, MixedQuoteImpl.MIXED);
+ createProperty(true, mixedQuoteType, MixedQuoteImpl.SYMBOL);
+ createProperty(true, mixedQuoteType, MixedQuoteImpl.COMPANY_NAME);
+ createProperty(true, mixedQuoteType, MixedQuoteImpl.PRICE);
+ createProperty(true, mixedQuoteType, MixedQuoteImpl.OPEN1);
+ createProperty(true, mixedQuoteType, MixedQuoteImpl.HIGH);
+ createProperty(true, mixedQuoteType, MixedQuoteImpl.LOW);
+ createProperty(true, mixedQuoteType, MixedQuoteImpl.VOLUME);
+ createProperty(true, mixedQuoteType, MixedQuoteImpl.CHANGE1);
+ createProperty(false, mixedQuoteType, MixedQuoteImpl.QUOTES);
+
+ mixedRepeatingChoiceType = createType(false, MIXED_REPEATING_CHOICE);
+ createProperty(true, mixedRepeatingChoiceType, MixedRepeatingChoiceImpl.MIXED);
+ createProperty(true, mixedRepeatingChoiceType, MixedRepeatingChoiceImpl.GROUP);
+ createProperty(true, mixedRepeatingChoiceType, MixedRepeatingChoiceImpl.A);
+ createProperty(true, mixedRepeatingChoiceType, MixedRepeatingChoiceImpl.B);
+
+ repeatingChoiceType = createType(false, REPEATING_CHOICE);
+ createProperty(true, repeatingChoiceType, RepeatingChoiceImpl.GROUP);
+ createProperty(true, repeatingChoiceType, RepeatingChoiceImpl.A);
+ createProperty(true, repeatingChoiceType, RepeatingChoiceImpl.B);
+
+ twoRCsType = createType(false, TWO_RCS);
+ createProperty(true, twoRCsType, TwoRCsImpl.GROUP);
+ createProperty(true, twoRCsType, TwoRCsImpl.A);
+ createProperty(true, twoRCsType, TwoRCsImpl.B);
+ createProperty(true, twoRCsType, TwoRCsImpl.SPLIT);
+ createProperty(true, twoRCsType, TwoRCsImpl.GROUP1);
+ createProperty(true, twoRCsType, TwoRCsImpl.Y);
+ createProperty(true, twoRCsType, TwoRCsImpl.Z);
+
+ twoRCsMixedType = createType(false, TWO_RCS_MIXED);
+ createProperty(true, twoRCsMixedType, TwoRCsMixedImpl.MIXED);
+ createProperty(true, twoRCsMixedType, TwoRCsMixedImpl.GROUP);
+ createProperty(true, twoRCsMixedType, TwoRCsMixedImpl.A);
+ createProperty(true, twoRCsMixedType, TwoRCsMixedImpl.B);
+ createProperty(true, twoRCsMixedType, TwoRCsMixedImpl.SPLIT);
+ createProperty(true, twoRCsMixedType, TwoRCsMixedImpl.GROUP1);
+ createProperty(true, twoRCsMixedType, TwoRCsMixedImpl.Y);
+ createProperty(true, twoRCsMixedType, TwoRCsMixedImpl.Z);
+ }
+ private boolean isInitialized = false;
+
+ public void initializeMetaData()
+ {
+ if (isInitialized) return;
+ isInitialized = true;
+
+ // Obtain other dependent packages
+ ModelFactoryImpl theModelPackageImpl = (ModelFactoryImpl)FactoryBase.getStaticFactory(ModelFactoryImpl.NAMESPACE_URI);
+
+ // Add supertypes to classes
+ // Initialize classes and features; add operations and parameters
+
+ initializeType(mixedQuoteType, MixedQuote.class, "MixedQuote");
+ initializeProperty((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.MIXED), getSequence(), "mixed", null, 0, -1, MixedQuote.class, false, false, false);
+ initializeProperty((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.SYMBOL), theModelPackageImpl.getString(), "symbol", null, 1, 1, MixedQuote.class, false, false, true);
+ initializeProperty((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.COMPANY_NAME), theModelPackageImpl.getString(), "companyName", null, 1, 1, MixedQuote.class, false, false, true);
+ initializeProperty((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.PRICE), theModelPackageImpl.getDecimal(), "price", null, 1, 1, MixedQuote.class, false, false, true);
+ initializeProperty((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.OPEN1), theModelPackageImpl.getDecimal(), "open1", null, 1, 1, MixedQuote.class, false, false, true);
+ initializeProperty((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.HIGH), theModelPackageImpl.getDecimal(), "high", null, 1, 1, MixedQuote.class, false, false, true);
+ initializeProperty((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.LOW), theModelPackageImpl.getDecimal(), "low", null, 1, 1, MixedQuote.class, false, false, true);
+ initializeProperty((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.VOLUME), theModelPackageImpl.getDouble(), "volume", null, 1, 1, MixedQuote.class, false, true, true);
+ initializeProperty((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.CHANGE1), theModelPackageImpl.getDouble(), "change1", null, 1, 1, MixedQuote.class, false, true, true);
+ initializeProperty((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.QUOTES), this.getMixedQuote(), "quotes", null, 0, -1, MixedQuote.class, false, false, true, true , null);
+
+ initializeType(mixedRepeatingChoiceType, MixedRepeatingChoice.class, "MixedRepeatingChoice");
+ initializeProperty((Property)mixedRepeatingChoiceType.getProperties().get(MixedRepeatingChoiceImpl.MIXED), getSequence(), "mixed", null, 0, -1, MixedRepeatingChoice.class, false, false, false);
+ initializeProperty((Property)mixedRepeatingChoiceType.getProperties().get(MixedRepeatingChoiceImpl.GROUP), getSequence(), "group", null, 0, -1, MixedRepeatingChoice.class, false, false, true);
+ initializeProperty((Property)mixedRepeatingChoiceType.getProperties().get(MixedRepeatingChoiceImpl.A), theModelPackageImpl.getString(), "a", null, 0, -1, MixedRepeatingChoice.class, false, false, true);
+ initializeProperty((Property)mixedRepeatingChoiceType.getProperties().get(MixedRepeatingChoiceImpl.B), theModelPackageImpl.getInt(), "b", null, 0, -1, MixedRepeatingChoice.class, false, false, true);
+
+ initializeType(repeatingChoiceType, RepeatingChoice.class, "RepeatingChoice");
+ initializeProperty((Property)repeatingChoiceType.getProperties().get(RepeatingChoiceImpl.GROUP), getSequence(), "group", null, 0, -1, RepeatingChoice.class, false, false, false);
+ initializeProperty((Property)repeatingChoiceType.getProperties().get(RepeatingChoiceImpl.A), theModelPackageImpl.getString(), "a", null, 0, -1, RepeatingChoice.class, false, false, true);
+ initializeProperty((Property)repeatingChoiceType.getProperties().get(RepeatingChoiceImpl.B), theModelPackageImpl.getInt(), "b", null, 0, -1, RepeatingChoice.class, false, false, true);
+
+ initializeType(twoRCsType, TwoRCs.class, "TwoRCs");
+ initializeProperty((Property)twoRCsType.getProperties().get(TwoRCsImpl.GROUP), getSequence(), "group", null, 0, -1, TwoRCs.class, false, false, false);
+ initializeProperty((Property)twoRCsType.getProperties().get(TwoRCsImpl.A), theModelPackageImpl.getString(), "a", null, 0, -1, TwoRCs.class, false, false, true);
+ initializeProperty((Property)twoRCsType.getProperties().get(TwoRCsImpl.B), theModelPackageImpl.getInt(), "b", null, 0, -1, TwoRCs.class, false, false, true);
+ initializeProperty((Property)twoRCsType.getProperties().get(TwoRCsImpl.SPLIT), theModelPackageImpl.getString(), "split", null, 1, 1, TwoRCs.class, false, false, false);
+ initializeProperty((Property)twoRCsType.getProperties().get(TwoRCsImpl.GROUP1), getSequence(), "group1", null, 0, -1, TwoRCs.class, false, false, false);
+ initializeProperty((Property)twoRCsType.getProperties().get(TwoRCsImpl.Y), theModelPackageImpl.getString(), "y", null, 0, -1, TwoRCs.class, false, false, true);
+ initializeProperty((Property)twoRCsType.getProperties().get(TwoRCsImpl.Z), theModelPackageImpl.getInt(), "z", null, 0, -1, TwoRCs.class, false, false, true);
+
+ initializeType(twoRCsMixedType, TwoRCsMixed.class, "TwoRCsMixed");
+ initializeProperty((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.MIXED), getSequence(), "mixed", null, 0, -1, TwoRCsMixed.class, false, false, false);
+ initializeProperty((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.GROUP), getSequence(), "group", null, 0, -1, TwoRCsMixed.class, false, false, true);
+ initializeProperty((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.A), theModelPackageImpl.getString(), "a", null, 0, -1, TwoRCsMixed.class, false, false, true);
+ initializeProperty((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.B), theModelPackageImpl.getInt(), "b", null, 0, -1, TwoRCsMixed.class, false, false, true);
+ initializeProperty((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.SPLIT), theModelPackageImpl.getString(), "split", null, 1, 1, TwoRCsMixed.class, false, false, true);
+ initializeProperty((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.GROUP1), getSequence(), "group1", null, 0, -1, TwoRCsMixed.class, false, false, true);
+ initializeProperty((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.Y), theModelPackageImpl.getString(), "y", null, 0, -1, TwoRCsMixed.class, false, false, true);
+ initializeProperty((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.Z), theModelPackageImpl.getInt(), "z", null, 0, -1, TwoRCsMixed.class, false, false, true);createXSDMetaData();
+ }
+
+ protected void createXSDMetaData()
+ {
+ super.createXSDMetaData();
+ // TODO - kdk - is the order right? should kind, elementOnly be first
+ addXSDMapping
+ (mixedQuoteType,
+ new String[]
+ {
+ "name", "MixedQuote",
+ "kind", "elementOnly"
+ });
+ addXSDMapping
+ ((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.MIXED),
+ new String[]
+ {
+ "kind", "element",
+ "name", "mixed"
+ });
+
+ addXSDMapping
+ ((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.SYMBOL),
+ new String[]
+ {
+ "kind", "element",
+ "name", "symbol"
+ });
+
+ addXSDMapping
+ ((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.COMPANY_NAME),
+ new String[]
+ {
+ "kind", "element",
+ "name", "companyName"
+ });
+
+ addXSDMapping
+ ((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.PRICE),
+ new String[]
+ {
+ "kind", "element",
+ "name", "price"
+ });
+
+ addXSDMapping
+ ((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.OPEN1),
+ new String[]
+ {
+ "kind", "element",
+ "name", "open1"
+ });
+
+ addXSDMapping
+ ((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.HIGH),
+ new String[]
+ {
+ "kind", "element",
+ "name", "high"
+ });
+
+ addXSDMapping
+ ((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.LOW),
+ new String[]
+ {
+ "kind", "element",
+ "name", "low"
+ });
+
+ addXSDMapping
+ ((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.VOLUME),
+ new String[]
+ {
+ "kind", "element",
+ "name", "volume"
+ });
+
+ addXSDMapping
+ ((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.CHANGE1),
+ new String[]
+ {
+ "kind", "element",
+ "name", "change1"
+ });
+
+ addXSDMapping
+ ((Property)mixedQuoteType.getProperties().get(MixedQuoteImpl.QUOTES),
+ new String[]
+ {
+ "kind", "element",
+ "name", "quotes"
+ });
+
+ // TODO - kdk - is the order right? should kind, elementOnly be first
+ addXSDMapping
+ (mixedRepeatingChoiceType,
+ new String[]
+ {
+ "name", "MixedRepeatingChoice",
+ "kind", "elementOnly"
+ });
+ addXSDMapping
+ ((Property)mixedRepeatingChoiceType.getProperties().get(MixedRepeatingChoiceImpl.MIXED),
+ new String[]
+ {
+ "kind", "element",
+ "name", "mixed"
+ });
+
+ addXSDMapping
+ ((Property)mixedRepeatingChoiceType.getProperties().get(MixedRepeatingChoiceImpl.GROUP),
+ new String[]
+ {
+ "kind", "element",
+ "name", "group"
+ });
+
+ addXSDMapping
+ ((Property)mixedRepeatingChoiceType.getProperties().get(MixedRepeatingChoiceImpl.A),
+ new String[]
+ {
+ "kind", "element",
+ "name", "a"
+ });
+
+ addXSDMapping
+ ((Property)mixedRepeatingChoiceType.getProperties().get(MixedRepeatingChoiceImpl.B),
+ new String[]
+ {
+ "kind", "element",
+ "name", "b"
+ });
+
+ // TODO - kdk - is the order right? should kind, elementOnly be first
+ addXSDMapping
+ (repeatingChoiceType,
+ new String[]
+ {
+ "name", "RepeatingChoice",
+ "kind", "elementOnly"
+ });
+ addXSDMapping
+ ((Property)repeatingChoiceType.getProperties().get(RepeatingChoiceImpl.GROUP),
+ new String[]
+ {
+ "kind", "element",
+ "name", "group"
+ });
+
+ addXSDMapping
+ ((Property)repeatingChoiceType.getProperties().get(RepeatingChoiceImpl.A),
+ new String[]
+ {
+ "kind", "element",
+ "name", "a"
+ });
+
+ addXSDMapping
+ ((Property)repeatingChoiceType.getProperties().get(RepeatingChoiceImpl.B),
+ new String[]
+ {
+ "kind", "element",
+ "name", "b"
+ });
+
+ // TODO - kdk - is the order right? should kind, elementOnly be first
+ addXSDMapping
+ (twoRCsType,
+ new String[]
+ {
+ "name", "TwoRCs",
+ "kind", "elementOnly"
+ });
+ addXSDMapping
+ ((Property)twoRCsType.getProperties().get(TwoRCsImpl.GROUP),
+ new String[]
+ {
+ "kind", "element",
+ "name", "group"
+ });
+
+ addXSDMapping
+ ((Property)twoRCsType.getProperties().get(TwoRCsImpl.A),
+ new String[]
+ {
+ "kind", "element",
+ "name", "a"
+ });
+
+ addXSDMapping
+ ((Property)twoRCsType.getProperties().get(TwoRCsImpl.B),
+ new String[]
+ {
+ "kind", "element",
+ "name", "b"
+ });
+
+ addXSDMapping
+ ((Property)twoRCsType.getProperties().get(TwoRCsImpl.SPLIT),
+ new String[]
+ {
+ "kind", "element",
+ "name", "split"
+ });
+
+ addXSDMapping
+ ((Property)twoRCsType.getProperties().get(TwoRCsImpl.GROUP1),
+ new String[]
+ {
+ "kind", "element",
+ "name", "group1"
+ });
+
+ addXSDMapping
+ ((Property)twoRCsType.getProperties().get(TwoRCsImpl.Y),
+ new String[]
+ {
+ "kind", "element",
+ "name", "y"
+ });
+
+ addXSDMapping
+ ((Property)twoRCsType.getProperties().get(TwoRCsImpl.Z),
+ new String[]
+ {
+ "kind", "element",
+ "name", "z"
+ });
+
+ // TODO - kdk - is the order right? should kind, elementOnly be first
+ addXSDMapping
+ (twoRCsMixedType,
+ new String[]
+ {
+ "name", "TwoRCsMixed",
+ "kind", "elementOnly"
+ });
+ addXSDMapping
+ ((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.MIXED),
+ new String[]
+ {
+ "kind", "element",
+ "name", "mixed"
+ });
+
+ addXSDMapping
+ ((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.GROUP),
+ new String[]
+ {
+ "kind", "element",
+ "name", "group"
+ });
+
+ addXSDMapping
+ ((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.A),
+ new String[]
+ {
+ "kind", "element",
+ "name", "a"
+ });
+
+ addXSDMapping
+ ((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.B),
+ new String[]
+ {
+ "kind", "element",
+ "name", "b"
+ });
+
+ addXSDMapping
+ ((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.SPLIT),
+ new String[]
+ {
+ "kind", "element",
+ "name", "split"
+ });
+
+ addXSDMapping
+ ((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.GROUP1),
+ new String[]
+ {
+ "kind", "element",
+ "name", "group1"
+ });
+
+ addXSDMapping
+ ((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.Y),
+ new String[]
+ {
+ "kind", "element",
+ "name", "y"
+ });
+
+ addXSDMapping
+ ((Property)twoRCsMixedType.getProperties().get(TwoRCsMixedImpl.Z),
+ new String[]
+ {
+ "kind", "element",
+ "name", "z"
+ });
+
+
+ // TODO - kdk - how do I filter out mixed, xMLNSPrefixMap, and xSISchemaLocation without hardcoding it
+ // TODO - kdk - can I hardcode ##targetNamespace?
+
+ createGlobalProperty
+ ("mixedStockQuote",
+ this.getMixedQuote(),
+ new String[]
+ {
+ "kind", "element",
+ "name", "mixedStockQuote",
+ "namespace", "##targetNamespace"
+ });
+
+ createGlobalProperty
+ ("mrc",
+ this.getMixedRepeatingChoice(),
+ new String[]
+ {
+ "kind", "element",
+ "name", "mrc",
+ "namespace", "##targetNamespace"
+ });
+
+ createGlobalProperty
+ ("mrc2",
+ this.getTwoRCsMixed(),
+ new String[]
+ {
+ "kind", "element",
+ "name", "mrc2",
+ "namespace", "##targetNamespace"
+ });
+
+ createGlobalProperty
+ ("rc",
+ this.getRepeatingChoice(),
+ new String[]
+ {
+ "kind", "element",
+ "name", "rc",
+ "namespace", "##targetNamespace"
+ });
+
+ createGlobalProperty
+ ("rc2",
+ this.getTwoRCs(),
+ new String[]
+ {
+ "kind", "element",
+ "name", "rc2",
+ "namespace", "##targetNamespace"
+ });
+
+ }
+
+} //SequencesFactoryImpl
diff --git a/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/impl/TwoRCsImpl.java b/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/impl/TwoRCsImpl.java
new file mode 100644
index 0000000000..8ad414935c
--- /dev/null
+++ b/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/impl/TwoRCsImpl.java
@@ -0,0 +1,452 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.sequences.impl;
+
+import com.example.sequences.TwoRCs;
+
+import commonj.sdo.Sequence;
+import commonj.sdo.Type;
+
+import commonj.sdo.helper.TypeHelper;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.tuscany.sdo.impl.DataObjectBase;
+
+import org.apache.tuscany.sdo.util.BasicSequence;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Two RCs</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link com.example.sequences.impl.TwoRCsImpl#getGroup <em>Group</em>}</li>
+ * <li>{@link com.example.sequences.impl.TwoRCsImpl#getA <em>A</em>}</li>
+ * <li>{@link com.example.sequences.impl.TwoRCsImpl#getB <em>B</em>}</li>
+ * <li>{@link com.example.sequences.impl.TwoRCsImpl#getSplit <em>Split</em>}</li>
+ * <li>{@link com.example.sequences.impl.TwoRCsImpl#getGroup1 <em>Group1</em>}</li>
+ * <li>{@link com.example.sequences.impl.TwoRCsImpl#getY <em>Y</em>}</li>
+ * <li>{@link com.example.sequences.impl.TwoRCsImpl#getZ <em>Z</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class TwoRCsImpl extends DataObjectBase implements TwoRCs
+{
+ /**
+ * 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 = 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;
+
+ /**
+ * The feature id for the '<em><b>B</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int B = 2;
+
+ /**
+ * The feature id for the '<em><b>Split</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int SPLIT = 3;
+
+ /**
+ * 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;
+
+ /**
+ * The cached value of the '{@link #getSplit() <em>Split</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getSplit()
+ * @generated
+ * @ordered
+ */
+ protected String split = SPLIT_DEFAULT_;
+
+ /**
+ * The feature id for the '<em><b>Group1</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int GROUP1 = 4;
+
+ /**
+ * The cached value of the '{@link #getGroup1() <em>Group1</em>}' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getGroup1()
+ * @generated
+ * @ordered
+ */
+
+ // How to get BasicSequence from Sequence?
+
+ protected BasicSequence group1 = null;
+
+ /**
+ * The feature id for the '<em><b>Y</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int Y = 5;
+
+ /**
+ * 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 = 6;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TwoRCsImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Type getType()
+ {
+ return TypeHelper.INSTANCE.getType(TwoRCs.class); //TBD Generate a more efficient implementation
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Sequence getGroup()
+ {
+ if (group == null)
+ {
+ group = createSequence(GROUP);
+
+ }
+ return group;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public List getA()
+ {
+ return getList(getGroup(), getType(), A);
+
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public List getB()
+ {
+ return getList(getGroup(), getType(), B);
+
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getSplit()
+ {
+ return split;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setSplit(String newSplit)
+ {
+ String oldSplit = split;
+ split = newSplit;
+ if (isNotifying())
+ notify(ChangeKind.SET, SPLIT, oldSplit, split);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Sequence getGroup1()
+ {
+ if (group1 == null)
+ {
+ group1 = createSequence(GROUP1);
+
+ }
+ return group1;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public List getY()
+ {
+ return getList(getGroup1(), getType(), Y);
+
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public List getZ()
+ {
+ return getList(getGroup1(), getType(), Z);
+
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeContext inverseRemove(Object otherEnd, int propertyIndex, ChangeContext changeContext)
+ {
+ switch (propertyIndex)
+ {
+ case GROUP:
+ return removeFromSequence(getGroup(), otherEnd, changeContext);
+ case GROUP1:
+ return removeFromSequence(getGroup1(), otherEnd, changeContext);
+ }
+ return super.inverseRemove(otherEnd, propertyIndex, changeContext);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object get(int propertyIndex, boolean resolve)
+ {
+ switch (propertyIndex)
+ {
+ case GROUP:
+ // XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view
+ //if (coreType)
+ return getGroup();
+ case A:
+ return getA();
+ case B:
+ return getB();
+ case SPLIT:
+ return getSplit();
+ case GROUP1:
+ // XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view
+ //if (coreType)
+ return getGroup1();
+ case Y:
+ return getY();
+ case Z:
+ return getZ();
+ }
+ return super.get(propertyIndex, resolve);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void set(int propertyIndex, Object newValue)
+ {
+ switch (propertyIndex)
+ {
+ case GROUP:
+ setSequence(getGroup(), newValue);
+ return;
+ case A:
+ getA().clear();
+ getA().addAll((Collection)newValue);
+ return;
+ case B:
+ getB().clear();
+ getB().addAll((Collection)newValue);
+ return;
+ case SPLIT:
+ setSplit((String)newValue);
+ return;
+ case GROUP1:
+ setSequence(getGroup1(), newValue);
+ return;
+ case Y:
+ getY().clear();
+ getY().addAll((Collection)newValue);
+ return;
+ case Z:
+ getZ().clear();
+ getZ().addAll((Collection)newValue);
+ return;
+ }
+ super.set(propertyIndex, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unset(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case GROUP:
+ unsetSequence(getGroup());
+ return;
+ case A:
+ getA().clear();
+ return;
+ case B:
+ getB().clear();
+ return;
+ case SPLIT:
+ setSplit(SPLIT_DEFAULT_);
+ return;
+ case GROUP1:
+ unsetSequence(getGroup1());
+ return;
+ case Y:
+ getY().clear();
+ return;
+ case Z:
+ getZ().clear();
+ return;
+ }
+ super.unset(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSet(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case GROUP:
+ // KDK - should this be !isSequenceEmpty?
+ return group != null && !isSequenceEmpty(getGroup());
+ case A:
+ return !getA().isEmpty();
+ case B:
+ return !getB().isEmpty();
+ case SPLIT:
+ return SPLIT_DEFAULT_ == null ? split != null : !SPLIT_DEFAULT_.equals(split);
+ case GROUP1:
+ // KDK - should this be !isSequenceEmpty?
+ return group1 != null && !isSequenceEmpty(getGroup1());
+ case Y:
+ return !getY().isEmpty();
+ case Z:
+ return !getZ().isEmpty();
+ }
+ return super.isSet(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString()
+ {
+ if (isProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (group: ");
+ result.append(group);
+ result.append(", split: ");
+ result.append(split);
+ result.append(", group1: ");
+ result.append(group1);
+ result.append(')');
+ return result.toString();
+ }
+
+} //TwoRCsImpl
diff --git a/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/impl/TwoRCsMixedImpl.java b/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/impl/TwoRCsMixedImpl.java
new file mode 100644
index 0000000000..05fa81d977
--- /dev/null
+++ b/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/sequences/impl/TwoRCsMixedImpl.java
@@ -0,0 +1,450 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.sequences.impl;
+
+import com.example.sequences.TwoRCsMixed;
+
+import commonj.sdo.Sequence;
+import commonj.sdo.Type;
+
+import commonj.sdo.helper.TypeHelper;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.tuscany.sdo.impl.DataObjectBase;
+
+import org.apache.tuscany.sdo.util.BasicSequence;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Two RCs Mixed</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link com.example.sequences.impl.TwoRCsMixedImpl#getMixed <em>Mixed</em>}</li>
+ * <li>{@link com.example.sequences.impl.TwoRCsMixedImpl#getGroup <em>Group</em>}</li>
+ * <li>{@link com.example.sequences.impl.TwoRCsMixedImpl#getA <em>A</em>}</li>
+ * <li>{@link com.example.sequences.impl.TwoRCsMixedImpl#getB <em>B</em>}</li>
+ * <li>{@link com.example.sequences.impl.TwoRCsMixedImpl#getSplit <em>Split</em>}</li>
+ * <li>{@link com.example.sequences.impl.TwoRCsMixedImpl#getGroup1 <em>Group1</em>}</li>
+ * <li>{@link com.example.sequences.impl.TwoRCsMixedImpl#getY <em>Y</em>}</li>
+ * <li>{@link com.example.sequences.impl.TwoRCsMixedImpl#getZ <em>Z</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class TwoRCsMixedImpl extends DataObjectBase implements TwoRCsMixed
+{
+ /**
+ * The feature id for the '<em><b>Mixed</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- 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;
+
+ /**
+ * 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 = 2;
+
+ /**
+ * The feature id for the '<em><b>B</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int B = 3;
+
+ /**
+ * The feature id for the '<em><b>Split</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int SPLIT = 4;
+
+ /**
+ * 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;
+
+ /**
+ * The feature id for the '<em><b>Group1</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int GROUP1 = 5;
+
+ /**
+ * The feature id for the '<em><b>Y</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int Y = 6;
+
+ /**
+ * 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;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TwoRCsMixedImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Type getType()
+ {
+ return TypeHelper.INSTANCE.getType(TwoRCsMixed.class); //TBD Generate a more efficient implementation
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Sequence getMixed()
+ {
+ if (mixed == null)
+ {
+ mixed = createSequence(MIXED);
+
+ }
+ return mixed;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Sequence getGroup()
+ {
+ return createSequence(getMixed(), getType(), GROUP);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public List getA()
+ {
+ return getList(getGroup(), getType(), A);
+
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public List getB()
+ {
+ return getList(getGroup(), getType(), B);
+
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getSplit()
+ {
+ return (String)get(getMixed(), getType(), SPLIT);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setSplit(String newSplit)
+ {
+ set(getMixed(), getType(), SPLIT, newSplit);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Sequence getGroup1()
+ {
+ return createSequence(getMixed(), getType(), GROUP1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public List getY()
+ {
+ return getList(getGroup1(), getType(), Y);
+
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public List getZ()
+ {
+ return getList(getGroup1(), getType(), Z);
+
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeContext inverseRemove(Object otherEnd, int propertyIndex, ChangeContext changeContext)
+ {
+ switch (propertyIndex)
+ {
+ case MIXED:
+ return removeFromSequence(getMixed(), otherEnd, changeContext);
+ case GROUP:
+ return removeFromSequence(getGroup(), otherEnd, changeContext);
+ case GROUP1:
+ return removeFromSequence(getGroup1(), otherEnd, changeContext);
+ }
+ return super.inverseRemove(otherEnd, propertyIndex, changeContext);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object get(int propertyIndex, boolean resolve)
+ {
+ switch (propertyIndex)
+ {
+ case MIXED:
+ // XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view
+ //if (coreType)
+ return getMixed();
+ case GROUP:
+ // XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view
+ //if (coreType)
+ return getGroup();
+ case A:
+ return getA();
+ case B:
+ return getB();
+ case SPLIT:
+ return getSplit();
+ case GROUP1:
+ // XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view
+ //if (coreType)
+ return getGroup1();
+ case Y:
+ return getY();
+ case Z:
+ return getZ();
+ }
+ return super.get(propertyIndex, resolve);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void set(int propertyIndex, Object newValue)
+ {
+ switch (propertyIndex)
+ {
+ case MIXED:
+ setSequence(getMixed(), newValue);
+ return;
+ case GROUP:
+ setSequence(getGroup(), newValue);
+ return;
+ case A:
+ getA().clear();
+ getA().addAll((Collection)newValue);
+ return;
+ case B:
+ getB().clear();
+ getB().addAll((Collection)newValue);
+ return;
+ case SPLIT:
+ setSplit((String)newValue);
+ return;
+ case GROUP1:
+ setSequence(getGroup1(), newValue);
+ return;
+ case Y:
+ getY().clear();
+ getY().addAll((Collection)newValue);
+ return;
+ case Z:
+ getZ().clear();
+ getZ().addAll((Collection)newValue);
+ return;
+ }
+ super.set(propertyIndex, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unset(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case MIXED:
+ unsetSequence(getMixed());
+ return;
+ case GROUP:
+ unsetSequence(getGroup());
+ return;
+ case A:
+ getA().clear();
+ return;
+ case B:
+ getB().clear();
+ return;
+ case SPLIT:
+ setSplit(SPLIT_DEFAULT_);
+ return;
+ case GROUP1:
+ unsetSequence(getGroup1());
+ return;
+ case Y:
+ getY().clear();
+ return;
+ case Z:
+ getZ().clear();
+ return;
+ }
+ super.unset(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSet(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case MIXED:
+ // KDK - should this be !isSequenceEmpty?
+ return mixed != null && !isSequenceEmpty(getMixed());
+ case GROUP:
+ return !isSequenceEmpty(getGroup());
+ case A:
+ return !getA().isEmpty();
+ case B:
+ return !getB().isEmpty();
+ case SPLIT:
+ return SPLIT_DEFAULT_ == null ? getSplit() != null : !SPLIT_DEFAULT_.equals(getSplit());
+ case GROUP1:
+ return !isSequenceEmpty(getGroup1());
+ case Y:
+ return !getY().isEmpty();
+ case Z:
+ return !getZ().isEmpty();
+ }
+ return super.isSet(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString()
+ {
+ if (isProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (mixed: ");
+ result.append(mixed);
+ result.append(')');
+ return result.toString();
+ }
+
+} //TwoRCsMixedImpl
diff --git a/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/simple/Quote.java b/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/simple/Quote.java
new file mode 100644
index 0000000000..2855d2a67c
--- /dev/null
+++ b/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/simple/Quote.java
@@ -0,0 +1,310 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.simple;
+
+import java.math.BigDecimal;
+
+import java.util.List;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Quote</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link com.example.simple.Quote#getSymbol <em>Symbol</em>}</li>
+ * <li>{@link com.example.simple.Quote#getCompanyName <em>Company Name</em>}</li>
+ * <li>{@link com.example.simple.Quote#getPrice <em>Price</em>}</li>
+ * <li>{@link com.example.simple.Quote#getOpen1 <em>Open1</em>}</li>
+ * <li>{@link com.example.simple.Quote#getHigh <em>High</em>}</li>
+ * <li>{@link com.example.simple.Quote#getLow <em>Low</em>}</li>
+ * <li>{@link com.example.simple.Quote#getVolume <em>Volume</em>}</li>
+ * <li>{@link com.example.simple.Quote#getChange1 <em>Change1</em>}</li>
+ * <li>{@link com.example.simple.Quote#getQuotes <em>Quotes</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public interface Quote
+{
+ /**
+ * Returns the value of the '<em><b>Symbol</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Symbol</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Symbol</em>' attribute.
+ * @see #setSymbol(String)
+ * @generated
+ */
+ String getSymbol();
+
+ /**
+ * Sets the value of the '{@link com.example.simple.Quote#getSymbol <em>Symbol</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Symbol</em>' attribute.
+ * @see #getSymbol()
+ * @generated
+ */
+ void setSymbol(String value);
+
+ /**
+ * Returns the value of the '<em><b>Company Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Company Name</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Company Name</em>' attribute.
+ * @see #setCompanyName(String)
+ * @generated
+ */
+ String getCompanyName();
+
+ /**
+ * Sets the value of the '{@link com.example.simple.Quote#getCompanyName <em>Company Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Company Name</em>' attribute.
+ * @see #getCompanyName()
+ * @generated
+ */
+ void setCompanyName(String value);
+
+ /**
+ * Returns the value of the '<em><b>Price</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Price</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Price</em>' attribute.
+ * @see #setPrice(BigDecimal)
+ * @generated
+ */
+ BigDecimal getPrice();
+
+ /**
+ * Sets the value of the '{@link com.example.simple.Quote#getPrice <em>Price</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Price</em>' attribute.
+ * @see #getPrice()
+ * @generated
+ */
+ void setPrice(BigDecimal value);
+
+ /**
+ * Returns the value of the '<em><b>Open1</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Open1</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Open1</em>' attribute.
+ * @see #setOpen1(BigDecimal)
+ * @generated
+ */
+ BigDecimal getOpen1();
+
+ /**
+ * Sets the value of the '{@link com.example.simple.Quote#getOpen1 <em>Open1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Open1</em>' attribute.
+ * @see #getOpen1()
+ * @generated
+ */
+ void setOpen1(BigDecimal value);
+
+ /**
+ * Returns the value of the '<em><b>High</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>High</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>High</em>' attribute.
+ * @see #setHigh(BigDecimal)
+ * @generated
+ */
+ BigDecimal getHigh();
+
+ /**
+ * Sets the value of the '{@link com.example.simple.Quote#getHigh <em>High</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>High</em>' attribute.
+ * @see #getHigh()
+ * @generated
+ */
+ void setHigh(BigDecimal value);
+
+ /**
+ * Returns the value of the '<em><b>Low</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Low</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Low</em>' attribute.
+ * @see #setLow(BigDecimal)
+ * @generated
+ */
+ BigDecimal getLow();
+
+ /**
+ * Sets the value of the '{@link com.example.simple.Quote#getLow <em>Low</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Low</em>' attribute.
+ * @see #getLow()
+ * @generated
+ */
+ void setLow(BigDecimal value);
+
+ /**
+ * Returns the value of the '<em><b>Volume</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Volume</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Volume</em>' attribute.
+ * @see #isSetVolume()
+ * @see #unsetVolume()
+ * @see #setVolume(double)
+ * @generated
+ */
+ double getVolume();
+
+ /**
+ * Sets the value of the '{@link com.example.simple.Quote#getVolume <em>Volume</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Volume</em>' attribute.
+ * @see #isSetVolume()
+ * @see #unsetVolume()
+ * @see #getVolume()
+ * @generated
+ */
+ void setVolume(double value);
+
+ /**
+ * Unsets the value of the '{@link com.example.simple.Quote#getVolume <em>Volume</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetVolume()
+ * @see #getVolume()
+ * @see #setVolume(double)
+ * @generated
+ */
+ void unsetVolume();
+
+ /**
+ * Returns whether the value of the '{@link com.example.simple.Quote#getVolume <em>Volume</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Volume</em>' attribute is set.
+ * @see #unsetVolume()
+ * @see #getVolume()
+ * @see #setVolume(double)
+ * @generated
+ */
+ boolean isSetVolume();
+
+ /**
+ * Returns the value of the '<em><b>Change1</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Change1</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Change1</em>' attribute.
+ * @see #isSetChange1()
+ * @see #unsetChange1()
+ * @see #setChange1(double)
+ * @generated
+ */
+ double getChange1();
+
+ /**
+ * Sets the value of the '{@link com.example.simple.Quote#getChange1 <em>Change1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Change1</em>' attribute.
+ * @see #isSetChange1()
+ * @see #unsetChange1()
+ * @see #getChange1()
+ * @generated
+ */
+ void setChange1(double value);
+
+ /**
+ * Unsets the value of the '{@link com.example.simple.Quote#getChange1 <em>Change1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetChange1()
+ * @see #getChange1()
+ * @see #setChange1(double)
+ * @generated
+ */
+ void unsetChange1();
+
+ /**
+ * Returns whether the value of the '{@link com.example.simple.Quote#getChange1 <em>Change1</em>}' attribute is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Change1</em>' attribute is set.
+ * @see #unsetChange1()
+ * @see #getChange1()
+ * @see #setChange1(double)
+ * @generated
+ */
+ boolean isSetChange1();
+
+ /**
+ * Returns the value of the '<em><b>Quotes</b></em>' containment reference list.
+ * The list contents are of type {@link com.example.simple.Quote}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Quotes</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Quotes</em>' containment reference list.
+ * @generated
+ */
+ List getQuotes();
+
+} // Quote
diff --git a/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/simple/SimpleFactory.java b/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/simple/SimpleFactory.java
new file mode 100644
index 0000000000..4f33a3e19f
--- /dev/null
+++ b/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/simple/SimpleFactory.java
@@ -0,0 +1,49 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.simple;
+
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Factory</b> for the model.
+ * It provides a create method for each non-abstract class of the model.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public interface SimpleFactory
+{
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ SimpleFactory INSTANCE = com.example.simple.impl.SimpleFactoryImpl.eINSTANCE;
+
+ /**
+ * Returns a new object of class '<em>Quote</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Quote</em>'.
+ * @generated
+ */
+ Quote createQuote();
+
+} //SimpleFactory
diff --git a/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/simple/impl/QuoteImpl.java b/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/simple/impl/QuoteImpl.java
new file mode 100644
index 0000000000..18c63894af
--- /dev/null
+++ b/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/simple/impl/QuoteImpl.java
@@ -0,0 +1,715 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.simple.impl;
+
+import com.example.simple.Quote;
+
+import java.math.BigDecimal;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.tuscany.sdo.impl.DataObjectImpl;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+
+import org.eclipse.emf.ecore.util.EObjectContainmentEList;
+import org.eclipse.emf.ecore.util.InternalEList;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Quote</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link com.example.simple.impl.QuoteImpl#getSymbol <em>Symbol</em>}</li>
+ * <li>{@link com.example.simple.impl.QuoteImpl#getCompanyName <em>Company Name</em>}</li>
+ * <li>{@link com.example.simple.impl.QuoteImpl#getPrice <em>Price</em>}</li>
+ * <li>{@link com.example.simple.impl.QuoteImpl#getOpen1 <em>Open1</em>}</li>
+ * <li>{@link com.example.simple.impl.QuoteImpl#getHigh <em>High</em>}</li>
+ * <li>{@link com.example.simple.impl.QuoteImpl#getLow <em>Low</em>}</li>
+ * <li>{@link com.example.simple.impl.QuoteImpl#getVolume <em>Volume</em>}</li>
+ * <li>{@link com.example.simple.impl.QuoteImpl#getChange1 <em>Change1</em>}</li>
+ * <li>{@link com.example.simple.impl.QuoteImpl#getQuotes <em>Quotes</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class QuoteImpl extends DataObjectImpl implements Quote
+{
+ /**
+ * The default value of the '{@link #getSymbol() <em>Symbol</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getSymbol()
+ * @generated
+ * @ordered
+ */
+ protected static final String SYMBOL_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getSymbol() <em>Symbol</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getSymbol()
+ * @generated
+ * @ordered
+ */
+ protected String symbol = SYMBOL_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getCompanyName() <em>Company Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getCompanyName()
+ * @generated
+ * @ordered
+ */
+ protected static final String COMPANY_NAME_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getCompanyName() <em>Company Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getCompanyName()
+ * @generated
+ * @ordered
+ */
+ protected String companyName = COMPANY_NAME_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getPrice() <em>Price</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getPrice()
+ * @generated
+ * @ordered
+ */
+ protected static final BigDecimal PRICE_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getPrice() <em>Price</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getPrice()
+ * @generated
+ * @ordered
+ */
+ protected BigDecimal price = PRICE_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getOpen1() <em>Open1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getOpen1()
+ * @generated
+ * @ordered
+ */
+ protected static final BigDecimal OPEN1_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getOpen1() <em>Open1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getOpen1()
+ * @generated
+ * @ordered
+ */
+ protected BigDecimal open1 = OPEN1_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getHigh() <em>High</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getHigh()
+ * @generated
+ * @ordered
+ */
+ protected static final BigDecimal HIGH_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getHigh() <em>High</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getHigh()
+ * @generated
+ * @ordered
+ */
+ protected BigDecimal high = HIGH_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getLow() <em>Low</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getLow()
+ * @generated
+ * @ordered
+ */
+ protected static final BigDecimal LOW_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getLow() <em>Low</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getLow()
+ * @generated
+ * @ordered
+ */
+ protected BigDecimal low = LOW_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getVolume() <em>Volume</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getVolume()
+ * @generated
+ * @ordered
+ */
+ protected static final double VOLUME_EDEFAULT = 0.0;
+
+ /**
+ * The cached value of the '{@link #getVolume() <em>Volume</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getVolume()
+ * @generated
+ * @ordered
+ */
+ protected double volume = VOLUME_EDEFAULT;
+
+ /**
+ * This is true if the Volume attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean volumeESet = false;
+
+ /**
+ * The default value of the '{@link #getChange1() <em>Change1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getChange1()
+ * @generated
+ * @ordered
+ */
+ protected static final double CHANGE1_EDEFAULT = 0.0;
+
+ /**
+ * The cached value of the '{@link #getChange1() <em>Change1</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getChange1()
+ * @generated
+ * @ordered
+ */
+ protected double change1 = CHANGE1_EDEFAULT;
+
+ /**
+ * This is true if the Change1 attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean change1ESet = false;
+
+ /**
+ * The cached value of the '{@link #getQuotes() <em>Quotes</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getQuotes()
+ * @generated
+ * @ordered
+ */
+ protected EList quotes = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected QuoteImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EClass eStaticClass()
+ {
+ return SimplePackageImpl.Literals.QUOTE;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getSymbol()
+ {
+ return symbol;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setSymbol(String newSymbol)
+ {
+ String oldSymbol = symbol;
+ symbol = newSymbol;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, SimplePackageImpl.QUOTE__SYMBOL, oldSymbol, symbol));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getCompanyName()
+ {
+ return companyName;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setCompanyName(String newCompanyName)
+ {
+ String oldCompanyName = companyName;
+ companyName = newCompanyName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, SimplePackageImpl.QUOTE__COMPANY_NAME, oldCompanyName, companyName));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public BigDecimal getPrice()
+ {
+ return price;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setPrice(BigDecimal newPrice)
+ {
+ BigDecimal oldPrice = price;
+ price = newPrice;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, SimplePackageImpl.QUOTE__PRICE, oldPrice, price));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public BigDecimal getOpen1()
+ {
+ return open1;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setOpen1(BigDecimal newOpen1)
+ {
+ BigDecimal oldOpen1 = open1;
+ open1 = newOpen1;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, SimplePackageImpl.QUOTE__OPEN1, oldOpen1, open1));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public BigDecimal getHigh()
+ {
+ return high;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setHigh(BigDecimal newHigh)
+ {
+ BigDecimal oldHigh = high;
+ high = newHigh;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, SimplePackageImpl.QUOTE__HIGH, oldHigh, high));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public BigDecimal getLow()
+ {
+ return low;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setLow(BigDecimal newLow)
+ {
+ BigDecimal oldLow = low;
+ low = newLow;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, SimplePackageImpl.QUOTE__LOW, oldLow, low));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public double getVolume()
+ {
+ return volume;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setVolume(double newVolume)
+ {
+ double oldVolume = volume;
+ volume = newVolume;
+ boolean oldVolumeESet = volumeESet;
+ volumeESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, SimplePackageImpl.QUOTE__VOLUME, oldVolume, volume, !oldVolumeESet));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetVolume()
+ {
+ double oldVolume = volume;
+ boolean oldVolumeESet = volumeESet;
+ volume = VOLUME_EDEFAULT;
+ volumeESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET, SimplePackageImpl.QUOTE__VOLUME, oldVolume, VOLUME_EDEFAULT, oldVolumeESet));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetVolume()
+ {
+ return volumeESet;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public double getChange1()
+ {
+ return change1;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setChange1(double newChange1)
+ {
+ double oldChange1 = change1;
+ change1 = newChange1;
+ boolean oldChange1ESet = change1ESet;
+ change1ESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, SimplePackageImpl.QUOTE__CHANGE1, oldChange1, change1, !oldChange1ESet));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetChange1()
+ {
+ double oldChange1 = change1;
+ boolean oldChange1ESet = change1ESet;
+ change1 = CHANGE1_EDEFAULT;
+ change1ESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET, SimplePackageImpl.QUOTE__CHANGE1, oldChange1, CHANGE1_EDEFAULT, oldChange1ESet));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetChange1()
+ {
+ return change1ESet;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public List getQuotes()
+ {
+ if (quotes == null)
+ {
+ quotes = new EObjectContainmentEList(Quote.class, this, SimplePackageImpl.QUOTE__QUOTES);
+ }
+ return quotes;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
+ {
+ switch (featureID)
+ {
+ case SimplePackageImpl.QUOTE__QUOTES:
+ return ((InternalEList)getQuotes()).basicRemove(otherEnd, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object eGet(int featureID, boolean resolve, boolean coreType)
+ {
+ switch (featureID)
+ {
+ case SimplePackageImpl.QUOTE__SYMBOL:
+ return getSymbol();
+ case SimplePackageImpl.QUOTE__COMPANY_NAME:
+ return getCompanyName();
+ case SimplePackageImpl.QUOTE__PRICE:
+ return getPrice();
+ case SimplePackageImpl.QUOTE__OPEN1:
+ return getOpen1();
+ case SimplePackageImpl.QUOTE__HIGH:
+ return getHigh();
+ case SimplePackageImpl.QUOTE__LOW:
+ return getLow();
+ case SimplePackageImpl.QUOTE__VOLUME:
+ return new Double(getVolume());
+ case SimplePackageImpl.QUOTE__CHANGE1:
+ return new Double(getChange1());
+ case SimplePackageImpl.QUOTE__QUOTES:
+ return getQuotes();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void eSet(int featureID, Object newValue)
+ {
+ switch (featureID)
+ {
+ case SimplePackageImpl.QUOTE__SYMBOL:
+ setSymbol((String)newValue);
+ return;
+ case SimplePackageImpl.QUOTE__COMPANY_NAME:
+ setCompanyName((String)newValue);
+ return;
+ case SimplePackageImpl.QUOTE__PRICE:
+ setPrice((BigDecimal)newValue);
+ return;
+ case SimplePackageImpl.QUOTE__OPEN1:
+ setOpen1((BigDecimal)newValue);
+ return;
+ case SimplePackageImpl.QUOTE__HIGH:
+ setHigh((BigDecimal)newValue);
+ return;
+ case SimplePackageImpl.QUOTE__LOW:
+ setLow((BigDecimal)newValue);
+ return;
+ case SimplePackageImpl.QUOTE__VOLUME:
+ setVolume(((Double)newValue).doubleValue());
+ return;
+ case SimplePackageImpl.QUOTE__CHANGE1:
+ setChange1(((Double)newValue).doubleValue());
+ return;
+ case SimplePackageImpl.QUOTE__QUOTES:
+ getQuotes().clear();
+ getQuotes().addAll((Collection)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void eUnset(int featureID)
+ {
+ switch (featureID)
+ {
+ case SimplePackageImpl.QUOTE__SYMBOL:
+ setSymbol(SYMBOL_EDEFAULT);
+ return;
+ case SimplePackageImpl.QUOTE__COMPANY_NAME:
+ setCompanyName(COMPANY_NAME_EDEFAULT);
+ return;
+ case SimplePackageImpl.QUOTE__PRICE:
+ setPrice(PRICE_EDEFAULT);
+ return;
+ case SimplePackageImpl.QUOTE__OPEN1:
+ setOpen1(OPEN1_EDEFAULT);
+ return;
+ case SimplePackageImpl.QUOTE__HIGH:
+ setHigh(HIGH_EDEFAULT);
+ return;
+ case SimplePackageImpl.QUOTE__LOW:
+ setLow(LOW_EDEFAULT);
+ return;
+ case SimplePackageImpl.QUOTE__VOLUME:
+ unsetVolume();
+ return;
+ case SimplePackageImpl.QUOTE__CHANGE1:
+ unsetChange1();
+ return;
+ case SimplePackageImpl.QUOTE__QUOTES:
+ getQuotes().clear();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean eIsSet(int featureID)
+ {
+ switch (featureID)
+ {
+ case SimplePackageImpl.QUOTE__SYMBOL:
+ return SYMBOL_EDEFAULT == null ? symbol != null : !SYMBOL_EDEFAULT.equals(symbol);
+ case SimplePackageImpl.QUOTE__COMPANY_NAME:
+ return COMPANY_NAME_EDEFAULT == null ? companyName != null : !COMPANY_NAME_EDEFAULT.equals(companyName);
+ case SimplePackageImpl.QUOTE__PRICE:
+ return PRICE_EDEFAULT == null ? price != null : !PRICE_EDEFAULT.equals(price);
+ case SimplePackageImpl.QUOTE__OPEN1:
+ return OPEN1_EDEFAULT == null ? open1 != null : !OPEN1_EDEFAULT.equals(open1);
+ case SimplePackageImpl.QUOTE__HIGH:
+ return HIGH_EDEFAULT == null ? high != null : !HIGH_EDEFAULT.equals(high);
+ case SimplePackageImpl.QUOTE__LOW:
+ return LOW_EDEFAULT == null ? low != null : !LOW_EDEFAULT.equals(low);
+ case SimplePackageImpl.QUOTE__VOLUME:
+ return isSetVolume();
+ case SimplePackageImpl.QUOTE__CHANGE1:
+ return isSetChange1();
+ case SimplePackageImpl.QUOTE__QUOTES:
+ return quotes != null && !quotes.isEmpty();
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString()
+ {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (symbol: ");
+ result.append(symbol);
+ result.append(", companyName: ");
+ result.append(companyName);
+ result.append(", price: ");
+ result.append(price);
+ result.append(", open1: ");
+ result.append(open1);
+ result.append(", high: ");
+ result.append(high);
+ result.append(", low: ");
+ result.append(low);
+ result.append(", volume: ");
+ if (volumeESet) result.append(volume); else result.append("<unset>");
+ result.append(", change1: ");
+ if (change1ESet) result.append(change1); else result.append("<unset>");
+ result.append(')');
+ return result.toString();
+ }
+
+} //QuoteImpl
diff --git a/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/simple/impl/SimpleFactoryImpl.java b/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/simple/impl/SimpleFactoryImpl.java
new file mode 100644
index 0000000000..5f275a94d4
--- /dev/null
+++ b/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/simple/impl/SimpleFactoryImpl.java
@@ -0,0 +1,141 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.simple.impl;
+
+import com.example.simple.*;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.impl.EFactoryImpl;
+
+import org.eclipse.emf.ecore.plugin.EcorePlugin;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Factory</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class SimpleFactoryImpl extends EFactoryImpl implements SimpleFactory
+{
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final SimpleFactoryImpl eINSTANCE = init();
+
+ /**
+ * Creates the default factory implementation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static SimpleFactoryImpl init()
+ {
+ try
+ {
+ SimpleFactoryImpl theSimpleFactory = (SimpleFactoryImpl)EPackage.Registry.INSTANCE.getEFactory("http://www.example.com/simple");
+ if (theSimpleFactory != null)
+ {
+ return theSimpleFactory;
+ }
+ }
+ catch (Exception exception)
+ {
+ EcorePlugin.INSTANCE.log(exception);
+ }
+ return new SimpleFactoryImpl();
+ }
+
+ /**
+ * Creates an instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public SimpleFactoryImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EObject create(EClass eClass)
+ {
+ switch (eClass.getClassifierID())
+ {
+ case SimplePackageImpl.DOCUMENT_ROOT: return (EObject)createDocumentRoot();
+ case SimplePackageImpl.QUOTE: return (EObject)createQuote();
+ default:
+ throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EObject createDocumentRoot()
+ {
+ EObject documentRoot = super.create(SimplePackageImpl.Literals.DOCUMENT_ROOT);
+ return documentRoot;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Quote createQuote()
+ {
+ QuoteImpl quote = new QuoteImpl();
+ return quote;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public SimplePackageImpl getSimplePackageImpl()
+ {
+ return (SimplePackageImpl)getEPackage();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @deprecated
+ * @generated
+ */
+ public static SimplePackageImpl getPackage()
+ {
+ return SimplePackageImpl.eINSTANCE;
+ }
+
+} //SimpleFactoryImpl
diff --git a/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/simple/impl/SimplePackageImpl.java b/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/simple/impl/SimplePackageImpl.java
new file mode 100644
index 0000000000..50ad614fd7
--- /dev/null
+++ b/branches/sdo-java-M2/sdo/tools/src/test/java/com/example/simple/impl/SimplePackageImpl.java
@@ -0,0 +1,911 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.example.simple.impl;
+
+import com.example.simple.Quote;
+import com.example.simple.SimpleFactory;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EFactory;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+
+import org.eclipse.emf.ecore.impl.EPackageImpl;
+
+import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Package</b> for the model.
+ * It contains accessors for the meta objects to represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @see com.example.simple.SimpleFactory
+ * @generated
+ */
+public class SimplePackageImpl extends EPackageImpl
+{
+ /**
+ * The package name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String eNAME = "simple";
+
+ /**
+ * The package namespace URI.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String eNS_URI = "http://www.example.com/simple";
+
+ /**
+ * The package namespace name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String eNS_PREFIX = "simple";
+
+ /**
+ * The singleton instance of the package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final SimplePackageImpl eINSTANCE = com.example.simple.impl.SimplePackageImpl.init();
+
+ /**
+ * The meta object id for the '{@link com.example.simple.impl.DocumentRootImpl <em>Document Root</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see com.example.simple.impl.DocumentRootImpl
+ * @see com.example.simple.impl.SimplePackageImpl#getDocumentRoot()
+ * @generated
+ */
+ public static final int DOCUMENT_ROOT = 0;
+
+ /**
+ * The feature id for the '<em><b>Mixed</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int DOCUMENT_ROOT__MIXED = 0;
+
+ /**
+ * The feature id for the '<em><b>XMLNS Prefix Map</b></em>' map.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int DOCUMENT_ROOT__XMLNS_PREFIX_MAP = 1;
+
+ /**
+ * The feature id for the '<em><b>XSI Schema Location</b></em>' map.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int DOCUMENT_ROOT__XSI_SCHEMA_LOCATION = 2;
+
+ /**
+ * The feature id for the '<em><b>Stock Quote</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int DOCUMENT_ROOT__STOCK_QUOTE = 3;
+
+ /**
+ * The number of structural features of the '<em>Document Root</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int DOCUMENT_ROOT_FEATURE_COUNT = 4;
+
+ /**
+ * The meta object id for the '{@link com.example.simple.impl.QuoteImpl <em>Quote</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see com.example.simple.impl.QuoteImpl
+ * @see com.example.simple.impl.SimplePackageImpl#getQuote()
+ * @generated
+ */
+ public static final int QUOTE = 1;
+
+ /**
+ * The feature id for the '<em><b>Symbol</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int QUOTE__SYMBOL = 0;
+
+ /**
+ * The feature id for the '<em><b>Company Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int QUOTE__COMPANY_NAME = 1;
+
+ /**
+ * The feature id for the '<em><b>Price</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int QUOTE__PRICE = 2;
+
+ /**
+ * The feature id for the '<em><b>Open1</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int QUOTE__OPEN1 = 3;
+
+ /**
+ * The feature id for the '<em><b>High</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int QUOTE__HIGH = 4;
+
+ /**
+ * The feature id for the '<em><b>Low</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int QUOTE__LOW = 5;
+
+ /**
+ * The feature id for the '<em><b>Volume</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int QUOTE__VOLUME = 6;
+
+ /**
+ * The feature id for the '<em><b>Change1</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int QUOTE__CHANGE1 = 7;
+
+ /**
+ * The feature id for the '<em><b>Quotes</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int QUOTE__QUOTES = 8;
+
+ /**
+ * The number of structural features of the '<em>Quote</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int QUOTE_FEATURE_COUNT = 9;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass documentRootEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass quoteEClass = null;
+
+ /**
+ * Creates an instance of the model <b>Package</b>, registered with
+ * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
+ * package URI value.
+ * <p>Note: the correct way to create the package is via the static
+ * factory method {@link #init init()}, which also performs
+ * initialization of the package, or returns the registered package,
+ * if one already exists.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.ecore.EPackage.Registry
+ * @see com.example.simple.impl.SimplePackageImpl#eNS_URI
+ * @see #init()
+ * @generated
+ */
+ private SimplePackageImpl()
+ {
+ super(eNS_URI, ((EFactory)SimpleFactory.INSTANCE));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static boolean isInited = false;
+
+ /**
+ * Creates, registers, and initializes the <b>Package</b> for this
+ * model, and for any others upon which it depends. Simple
+ * dependencies are satisfied by calling this method on all
+ * dependent packages before doing anything else. This method drives
+ * initialization for interdependent packages directly, in parallel
+ * with this package, itself.
+ * <p>Of this package and its interdependencies, all packages which
+ * have not yet been registered by their URI values are first created
+ * and registered. The packages are then initialized in two steps:
+ * meta-model objects for all of the packages are created before any
+ * are initialized, since one package's meta-model objects may refer to
+ * those of another.
+ * <p>Invocation of this method will not affect any packages that have
+ * already been initialized.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #eNS_URI
+ * @see #createPackageContents()
+ * @see #initializePackageContents()
+ * @generated
+ */
+ public static SimplePackageImpl init()
+ {
+ if (isInited) return (SimplePackageImpl)EPackage.Registry.INSTANCE.getEPackage(SimplePackageImpl.eNS_URI);
+
+ // Obtain or create and register package
+ SimplePackageImpl theSimplePackageImpl = (SimplePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof SimplePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new SimplePackageImpl());
+
+ isInited = true;
+
+ // Initialize simple dependencies
+ XMLTypePackage.eINSTANCE.eClass();
+
+ // Create package meta-data objects
+ theSimplePackageImpl.createPackageContents();
+
+ // Initialize created meta-data
+ theSimplePackageImpl.initializePackageContents();
+
+ // Mark meta-data to indicate it can't be changed
+ theSimplePackageImpl.freeze();
+
+ return theSimplePackageImpl;
+ }
+
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.emf.ecore.EObject <em>Document Root</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Document Root</em>'.
+ * @see org.eclipse.emf.ecore.EObject
+ * @generated
+ */
+ public EClass getDocumentRoot()
+ {
+ return documentRootEClass;
+ }
+
+ /**
+ * Returns the meta object for the attribute list '{@link org.eclipse.emf.ecore.EObject#getMixed <em>Mixed</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute list '<em>Mixed</em>'.
+ * @see org.eclipse.emf.ecore.EObject#getMixed()
+ * @see #getDocumentRoot()
+ * @generated
+ */
+ public EAttribute getDocumentRoot_Mixed()
+ {
+ return (EAttribute)documentRootEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * Returns the meta object for the map '{@link org.eclipse.emf.ecore.EObject#getXMLNSPrefixMap <em>XMLNS Prefix Map</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the map '<em>XMLNS Prefix Map</em>'.
+ * @see org.eclipse.emf.ecore.EObject#getXMLNSPrefixMap()
+ * @see #getDocumentRoot()
+ * @generated
+ */
+ public EReference getDocumentRoot_XMLNSPrefixMap()
+ {
+ return (EReference)documentRootEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * Returns the meta object for the map '{@link org.eclipse.emf.ecore.EObject#getXSISchemaLocation <em>XSI Schema Location</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the map '<em>XSI Schema Location</em>'.
+ * @see org.eclipse.emf.ecore.EObject#getXSISchemaLocation()
+ * @see #getDocumentRoot()
+ * @generated
+ */
+ public EReference getDocumentRoot_XSISchemaLocation()
+ {
+ return (EReference)documentRootEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * Returns the meta object for the containment reference '{@link org.eclipse.emf.ecore.EObject#getStockQuote <em>Stock Quote</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference '<em>Stock Quote</em>'.
+ * @see org.eclipse.emf.ecore.EObject#getStockQuote()
+ * @see #getDocumentRoot()
+ * @generated
+ */
+ public EReference getDocumentRoot_StockQuote()
+ {
+ return (EReference)documentRootEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * Returns the meta object for class '{@link com.example.simple.Quote <em>Quote</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Quote</em>'.
+ * @see com.example.simple.Quote
+ * @generated
+ */
+ public EClass getQuote()
+ {
+ return quoteEClass;
+ }
+
+ /**
+ * Returns the meta object for the attribute '{@link com.example.simple.Quote#getSymbol <em>Symbol</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Symbol</em>'.
+ * @see com.example.simple.Quote#getSymbol()
+ * @see #getQuote()
+ * @generated
+ */
+ public EAttribute getQuote_Symbol()
+ {
+ return (EAttribute)quoteEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * Returns the meta object for the attribute '{@link com.example.simple.Quote#getCompanyName <em>Company Name</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Company Name</em>'.
+ * @see com.example.simple.Quote#getCompanyName()
+ * @see #getQuote()
+ * @generated
+ */
+ public EAttribute getQuote_CompanyName()
+ {
+ return (EAttribute)quoteEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * Returns the meta object for the attribute '{@link com.example.simple.Quote#getPrice <em>Price</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Price</em>'.
+ * @see com.example.simple.Quote#getPrice()
+ * @see #getQuote()
+ * @generated
+ */
+ public EAttribute getQuote_Price()
+ {
+ return (EAttribute)quoteEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * Returns the meta object for the attribute '{@link com.example.simple.Quote#getOpen1 <em>Open1</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Open1</em>'.
+ * @see com.example.simple.Quote#getOpen1()
+ * @see #getQuote()
+ * @generated
+ */
+ public EAttribute getQuote_Open1()
+ {
+ return (EAttribute)quoteEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * Returns the meta object for the attribute '{@link com.example.simple.Quote#getHigh <em>High</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>High</em>'.
+ * @see com.example.simple.Quote#getHigh()
+ * @see #getQuote()
+ * @generated
+ */
+ public EAttribute getQuote_High()
+ {
+ return (EAttribute)quoteEClass.getEStructuralFeatures().get(4);
+ }
+
+ /**
+ * Returns the meta object for the attribute '{@link com.example.simple.Quote#getLow <em>Low</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Low</em>'.
+ * @see com.example.simple.Quote#getLow()
+ * @see #getQuote()
+ * @generated
+ */
+ public EAttribute getQuote_Low()
+ {
+ return (EAttribute)quoteEClass.getEStructuralFeatures().get(5);
+ }
+
+ /**
+ * Returns the meta object for the attribute '{@link com.example.simple.Quote#getVolume <em>Volume</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Volume</em>'.
+ * @see com.example.simple.Quote#getVolume()
+ * @see #getQuote()
+ * @generated
+ */
+ public EAttribute getQuote_Volume()
+ {
+ return (EAttribute)quoteEClass.getEStructuralFeatures().get(6);
+ }
+
+ /**
+ * Returns the meta object for the attribute '{@link com.example.simple.Quote#getChange1 <em>Change1</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Change1</em>'.
+ * @see com.example.simple.Quote#getChange1()
+ * @see #getQuote()
+ * @generated
+ */
+ public EAttribute getQuote_Change1()
+ {
+ return (EAttribute)quoteEClass.getEStructuralFeatures().get(7);
+ }
+
+ /**
+ * Returns the meta object for the containment reference list '{@link com.example.simple.Quote#getQuotes <em>Quotes</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Quotes</em>'.
+ * @see com.example.simple.Quote#getQuotes()
+ * @see #getQuote()
+ * @generated
+ */
+ public EReference getQuote_Quotes()
+ {
+ return (EReference)quoteEClass.getEStructuralFeatures().get(8);
+ }
+
+ /**
+ * Returns the factory that creates the instances of the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the factory that creates the instances of the model.
+ * @generated
+ */
+ public SimpleFactory getSimpleFactory()
+ {
+ return (SimpleFactory)getEFactoryInstance();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private boolean isCreated = false;
+
+ /**
+ * Creates the meta-model objects for the package. This method is
+ * guarded to have no affect on any invocation but its first.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void createPackageContents()
+ {
+ if (isCreated) return;
+ isCreated = true;
+
+ // Create classes and their features
+ documentRootEClass = createEClass(DOCUMENT_ROOT);
+ createEAttribute(documentRootEClass, DOCUMENT_ROOT__MIXED);
+ createEReference(documentRootEClass, DOCUMENT_ROOT__XMLNS_PREFIX_MAP);
+ createEReference(documentRootEClass, DOCUMENT_ROOT__XSI_SCHEMA_LOCATION);
+ createEReference(documentRootEClass, DOCUMENT_ROOT__STOCK_QUOTE);
+
+ quoteEClass = createEClass(QUOTE);
+ createEAttribute(quoteEClass, QUOTE__SYMBOL);
+ createEAttribute(quoteEClass, QUOTE__COMPANY_NAME);
+ createEAttribute(quoteEClass, QUOTE__PRICE);
+ createEAttribute(quoteEClass, QUOTE__OPEN1);
+ createEAttribute(quoteEClass, QUOTE__HIGH);
+ createEAttribute(quoteEClass, QUOTE__LOW);
+ createEAttribute(quoteEClass, QUOTE__VOLUME);
+ createEAttribute(quoteEClass, QUOTE__CHANGE1);
+ createEReference(quoteEClass, QUOTE__QUOTES);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private boolean isInitialized = false;
+
+ /**
+ * Complete the initialization of the package and its meta-model. This
+ * method is guarded to have no affect on any invocation but its first.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void initializePackageContents()
+ {
+ if (isInitialized) return;
+ isInitialized = true;
+
+ // Initialize package
+ setName(eNAME);
+ setNsPrefix(eNS_PREFIX);
+ setNsURI(eNS_URI);
+
+ // Obtain other dependent packages
+ XMLTypePackage theXMLTypePackage = (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI);
+
+ // Add supertypes to classes
+
+ // Initialize classes and features; add operations and parameters
+ initEClass(documentRootEClass, null, "DocumentRoot", !IS_ABSTRACT, !IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getDocumentRoot_Mixed(), ecorePackage.getEFeatureMapEntry(), "mixed", null, 0, -1, null, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getDocumentRoot_XMLNSPrefixMap(), ecorePackage.getEStringToStringMapEntry(), null, "xMLNSPrefixMap", null, 0, -1, null, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getDocumentRoot_XSISchemaLocation(), ecorePackage.getEStringToStringMapEntry(), null, "xSISchemaLocation", null, 0, -1, null, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getDocumentRoot_StockQuote(), this.getQuote(), null, "stockQuote", null, 0, -2, null, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
+
+ initEClass(quoteEClass, Quote.class, "Quote", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getQuote_Symbol(), theXMLTypePackage.getString(), "symbol", null, 1, 1, Quote.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getQuote_CompanyName(), theXMLTypePackage.getString(), "companyName", null, 1, 1, Quote.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getQuote_Price(), theXMLTypePackage.getDecimal(), "price", null, 1, 1, Quote.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getQuote_Open1(), theXMLTypePackage.getDecimal(), "open1", null, 1, 1, Quote.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getQuote_High(), theXMLTypePackage.getDecimal(), "high", null, 1, 1, Quote.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getQuote_Low(), theXMLTypePackage.getDecimal(), "low", null, 1, 1, Quote.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getQuote_Volume(), theXMLTypePackage.getDouble(), "volume", null, 1, 1, Quote.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getQuote_Change1(), theXMLTypePackage.getDouble(), "change1", null, 1, 1, Quote.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getQuote_Quotes(), this.getQuote(), null, "quotes", null, 0, -1, Quote.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ // Create resource
+ createResource(eNS_URI);
+
+ // Create annotations
+ // http:///org/eclipse/emf/ecore/util/ExtendedMetaData
+ createExtendedMetaDataAnnotations();
+ }
+
+ /**
+ * Initializes the annotations for <b>http:///org/eclipse/emf/ecore/util/ExtendedMetaData</b>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void createExtendedMetaDataAnnotations()
+ {
+ String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData";
+ addAnnotation
+ (documentRootEClass,
+ source,
+ new String[]
+ {
+ "name", "",
+ "kind", "mixed"
+ });
+ addAnnotation
+ (getDocumentRoot_Mixed(),
+ source,
+ new String[]
+ {
+ "kind", "elementWildcard",
+ "name", ":mixed"
+ });
+ addAnnotation
+ (getDocumentRoot_XMLNSPrefixMap(),
+ source,
+ new String[]
+ {
+ "kind", "attribute",
+ "name", "xmlns:prefix"
+ });
+ addAnnotation
+ (getDocumentRoot_XSISchemaLocation(),
+ source,
+ new String[]
+ {
+ "kind", "attribute",
+ "name", "xsi:schemaLocation"
+ });
+ addAnnotation
+ (getDocumentRoot_StockQuote(),
+ source,
+ new String[]
+ {
+ "kind", "element",
+ "name", "stockQuote",
+ "namespace", "##targetNamespace"
+ });
+ addAnnotation
+ (quoteEClass,
+ source,
+ new String[]
+ {
+ "name", "Quote",
+ "kind", "elementOnly"
+ });
+ addAnnotation
+ (getQuote_Symbol(),
+ source,
+ new String[]
+ {
+ "kind", "element",
+ "name", "symbol"
+ });
+ addAnnotation
+ (getQuote_CompanyName(),
+ source,
+ new String[]
+ {
+ "kind", "element",
+ "name", "companyName"
+ });
+ addAnnotation
+ (getQuote_Price(),
+ source,
+ new String[]
+ {
+ "kind", "element",
+ "name", "price"
+ });
+ addAnnotation
+ (getQuote_Open1(),
+ source,
+ new String[]
+ {
+ "kind", "element",
+ "name", "open1"
+ });
+ addAnnotation
+ (getQuote_High(),
+ source,
+ new String[]
+ {
+ "kind", "element",
+ "name", "high"
+ });
+ addAnnotation
+ (getQuote_Low(),
+ source,
+ new String[]
+ {
+ "kind", "element",
+ "name", "low"
+ });
+ addAnnotation
+ (getQuote_Volume(),
+ source,
+ new String[]
+ {
+ "kind", "element",
+ "name", "volume"
+ });
+ addAnnotation
+ (getQuote_Change1(),
+ source,
+ new String[]
+ {
+ "kind", "element",
+ "name", "change1"
+ });
+ addAnnotation
+ (getQuote_Quotes(),
+ source,
+ new String[]
+ {
+ "kind", "element",
+ "name", "quotes"
+ });
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * Defines literals for the meta objects that represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public interface Literals
+ {
+ /**
+ * The meta object literal for the '{@link com.example.simple.impl.DocumentRootImpl <em>Document Root</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see com.example.simple.impl.DocumentRootImpl
+ * @see com.example.simple.impl.SimplePackageImpl#getDocumentRoot()
+ * @generated
+ */
+ public static final EClass DOCUMENT_ROOT = eINSTANCE.getDocumentRoot();
+
+ /**
+ * The meta object literal for the '<em><b>Mixed</b></em>' attribute list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final EAttribute DOCUMENT_ROOT__MIXED = eINSTANCE.getDocumentRoot_Mixed();
+
+ /**
+ * The meta object literal for the '<em><b>XMLNS Prefix Map</b></em>' map feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final EReference DOCUMENT_ROOT__XMLNS_PREFIX_MAP = eINSTANCE.getDocumentRoot_XMLNSPrefixMap();
+
+ /**
+ * The meta object literal for the '<em><b>XSI Schema Location</b></em>' map feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final EReference DOCUMENT_ROOT__XSI_SCHEMA_LOCATION = eINSTANCE.getDocumentRoot_XSISchemaLocation();
+
+ /**
+ * The meta object literal for the '<em><b>Stock Quote</b></em>' containment reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final EReference DOCUMENT_ROOT__STOCK_QUOTE = eINSTANCE.getDocumentRoot_StockQuote();
+
+ /**
+ * The meta object literal for the '{@link com.example.simple.impl.QuoteImpl <em>Quote</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see com.example.simple.impl.QuoteImpl
+ * @see com.example.simple.impl.SimplePackageImpl#getQuote()
+ * @generated
+ */
+ public static final EClass QUOTE = eINSTANCE.getQuote();
+
+ /**
+ * The meta object literal for the '<em><b>Symbol</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final EAttribute QUOTE__SYMBOL = eINSTANCE.getQuote_Symbol();
+
+ /**
+ * The meta object literal for the '<em><b>Company Name</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final EAttribute QUOTE__COMPANY_NAME = eINSTANCE.getQuote_CompanyName();
+
+ /**
+ * The meta object literal for the '<em><b>Price</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final EAttribute QUOTE__PRICE = eINSTANCE.getQuote_Price();
+
+ /**
+ * The meta object literal for the '<em><b>Open1</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final EAttribute QUOTE__OPEN1 = eINSTANCE.getQuote_Open1();
+
+ /**
+ * The meta object literal for the '<em><b>High</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final EAttribute QUOTE__HIGH = eINSTANCE.getQuote_High();
+
+ /**
+ * The meta object literal for the '<em><b>Low</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final EAttribute QUOTE__LOW = eINSTANCE.getQuote_Low();
+
+ /**
+ * The meta object literal for the '<em><b>Volume</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final EAttribute QUOTE__VOLUME = eINSTANCE.getQuote_Volume();
+
+ /**
+ * The meta object literal for the '<em><b>Change1</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final EAttribute QUOTE__CHANGE1 = eINSTANCE.getQuote_Change1();
+
+ /**
+ * The meta object literal for the '<em><b>Quotes</b></em>' containment reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final EReference QUOTE__QUOTES = eINSTANCE.getQuote_Quotes();
+
+ }
+
+} //SimplePackageImpl
diff --git a/branches/sdo-java-M2/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/SimpleStaticTest.java b/branches/sdo-java-M2/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/SimpleStaticTest.java
new file mode 100644
index 0000000000..b177373b5e
--- /dev/null
+++ b/branches/sdo-java-M2/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/SimpleStaticTest.java
@@ -0,0 +1,67 @@
+/**
+ *
+ * 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 java.math.BigDecimal;
+
+import org.apache.tuscany.sdo.util.SDOUtil;
+
+import com.example.simple.Quote;
+import com.example.simple.SimpleFactory;
+import commonj.sdo.DataObject;
+import commonj.sdo.helper.XMLHelper;
+
+
+public class SimpleStaticTest
+{
+ /**
+ * Simple Static SDO 2 test.
+ */
+ public static void main(String[] args)
+ {
+ try
+ {
+ SDOUtil.registerStaticTypes(SimpleFactory.class);
+
+ //Quote quote = (Quote)DataFactory.INSTANCE.create(Quote.class);
+ Quote quote = SimpleFactory.INSTANCE.createQuote();
+
+ quote.setSymbol("fbnt");
+ quote.setCompanyName("FlyByNightTechnology");
+ quote.setPrice(new BigDecimal("1000.0"));
+ quote.setOpen1(new BigDecimal("1000.0"));
+ quote.setHigh(new BigDecimal("1000.0"));
+ quote.setLow(new BigDecimal("1000.0"));
+ quote.setVolume(1000);
+ quote.setChange1(1000);
+
+ //Quote child = (Quote)((DataObject)quote).createDataObject(8);
+ Quote child = SimpleFactory.INSTANCE.createQuote();
+ quote.getQuotes().add(child);
+ child.setPrice(new BigDecimal("2000.0"));
+
+ XMLHelper.INSTANCE.save((DataObject)quote, "http://www.example.com/simple", "stockQuote", System.out);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/branches/sdo-java-M2/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/StaticSequenceNoEmfTestCase.java b/branches/sdo-java-M2/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/StaticSequenceNoEmfTestCase.java
new file mode 100644
index 0000000000..966e52cdba
--- /dev/null
+++ b/branches/sdo-java-M2/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/StaticSequenceNoEmfTestCase.java
@@ -0,0 +1,252 @@
+/**
+ *
+ * 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 java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.math.BigDecimal;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sdo.util.SDOUtil;
+
+import com.example.sequences.MixedQuote;
+import com.example.sequences.MixedRepeatingChoice;
+import com.example.sequences.RepeatingChoice;
+import com.example.sequences.SequencesFactory;
+import com.example.sequences.TwoRCs;
+import com.example.sequences.TwoRCsMixed;
+import commonj.sdo.DataObject;
+import commonj.sdo.Sequence;
+import commonj.sdo.Type;
+import commonj.sdo.helper.XMLHelper;
+
+
+public class StaticSequenceNoEmfTestCase extends TestCase {
+ private final String TEST_NAMESPACE = "http://www.example.com/sequences";
+ private final String MQ_TEST_DATA = "/mixedStaticTestResult.xml";
+ private final String RC_TEST_DATA = "/repeatingChoiceTestResult.xml";
+ private final String MRC_TEST_DATA = "/mixedRepeatingChoiceTestResult.xml";
+ private final String RC2_TEST_DATA = "/twoRepeatingChoicesTestResult.xml";
+ private final String RC2M_TEST_DATA = "/twoRepeatingChoicesMixedTestResult.xml";
+
+ /**
+ * Sequenced type SDO 2 test.
+ */
+ public void testMixedQuoteType() throws IOException {
+ MixedQuote quote = SequencesFactory.INSTANCE.createMixedQuote();
+
+ Type t = ((DataObject)quote).getType();
+ List ps = t.getProperties();
+
+
+ Sequence sequence = quote.getMixed();
+
+ sequence.add("\n ");
+
+ quote.setSymbol("fbnt");
+
+ sequence.add("\n ");
+
+ quote.setCompanyName("FlyByNightTechnology");
+
+ sequence.add("\n some text\n ");
+
+ List quotes = quote.getQuotes();
+ MixedQuote child = SequencesFactory.INSTANCE.createMixedQuote();
+ quotes.add(child);
+
+ child.setPrice(new BigDecimal("2000.0"));
+
+ sequence.add("\n more text\n ");
+
+ sequence.add("price", new BigDecimal("1000.0"));
+
+ sequence.add("\n");
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ XMLHelper.INSTANCE.save((DataObject)quote, TEST_NAMESPACE, "mixedStockQuote", baos);
+ assertTrue(baos.toString(), TestUtil.equalXmlFiles(new ByteArrayInputStream(baos.toByteArray()), getClass().getResource(MQ_TEST_DATA)));
+ }
+
+ public void testRepeatingChoice() throws IOException
+ {
+ RepeatingChoice rc = SequencesFactory.INSTANCE.createRepeatingChoice();
+
+ List as = rc.getA();
+ List bs = rc.getB();
+
+ bs.add(new Integer(1));
+ as.add("foo");
+ as.add("bar");
+ bs.add(new Integer(2));
+
+
+
+
+ Sequence group = rc.getGroup();
+ assertEquals(group.size(), 4);
+ assertEquals(rc.getA().size(), 2);
+ assertEquals(rc.getB().size(),2);
+
+ assertEquals(group.getValue(0), new Integer(1));
+ assertEquals(group.getValue(1), "foo");
+ assertEquals(group.getValue(2), "bar");
+ assertEquals(group.getValue(3), new Integer(2));
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+
+ XMLHelper.INSTANCE.save((DataObject)rc, TEST_NAMESPACE, "rc", baos);
+ assertTrue(baos.toString(), TestUtil.equalXmlFiles(new ByteArrayInputStream(baos.toByteArray()), getClass().getResource(RC_TEST_DATA)));
+ }
+
+ public void testMixedRepeatingChoice() throws Exception {
+ MixedRepeatingChoice mrc = SequencesFactory.INSTANCE.createMixedRepeatingChoice();
+
+ List as = mrc.getA();
+ List bs = mrc.getB();
+
+
+ bs.add(new Integer(1));
+ as.add("foo");
+ Sequence mixed = mrc.getMixed();
+ mixed.add("some mixed text");
+ as.add("bar");
+ bs.add(new Integer(2));
+
+ // FIXME reintroduce check
+ // assertEquals(4, mrc.getGroup().size());
+ assertEquals(5, mrc.getMixed().size());
+ assertEquals(2, mrc.getA().size());
+ assertEquals(2, mrc.getB().size(),2);
+
+
+
+ assertEquals(mixed.getValue(0), new Integer(1));
+ assertEquals(mixed.getValue(1), "foo");
+ assertEquals(mixed.getValue(3), "bar");
+ assertEquals(mixed.getValue(4), new Integer(2));
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+
+
+ XMLHelper.INSTANCE.save((DataObject)mrc, TEST_NAMESPACE, "mrc", baos);
+ assertTrue(baos.toString(), TestUtil.equalXmlFiles(new ByteArrayInputStream(baos.toByteArray()), getClass().getResource(MRC_TEST_DATA)));
+ }
+
+ public void test2RepeatingChoices() throws Exception {
+ TwoRCs rc2 = SequencesFactory.INSTANCE.createTwoRCs();
+
+ List as = rc2.getA();
+ List bs = rc2.getB();
+ List ys = rc2.getY();
+ List zs = rc2.getZ();
+
+ zs.add(new Integer(99));
+ bs.add(new Integer(1));
+ ys.add("fred");
+ as.add("foo");
+ as.add("bar");
+ bs.add(new Integer(2));
+ rc2.setSplit("banana");
+
+
+ Sequence group = rc2.getGroup();
+ assertEquals(group.size(), 4);
+ assertEquals(rc2.getA().size(), 2);
+ assertEquals(rc2.getB().size(),2);
+
+ Sequence group1 = rc2.getGroup1();
+ assertEquals(group1.size(), 2);
+ assertEquals(rc2.getY().size(), 1);
+ assertEquals(rc2.getZ().size(),1);
+
+ assertEquals(group.getValue(0), new Integer(1));
+ assertEquals(group.getValue(1), "foo");
+ assertEquals(group.getValue(2), "bar");
+ assertEquals(group.getValue(3), new Integer(2));
+ assertEquals(group1.getValue(0), new Integer(99));
+ assertEquals(group1.getValue(1), "fred");
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+
+
+ XMLHelper.INSTANCE.save((DataObject)rc2, TEST_NAMESPACE, "rc2", baos);
+ assertTrue(baos.toString(), TestUtil.equalXmlFiles(new ByteArrayInputStream(baos.toByteArray()), getClass().getResource(RC2_TEST_DATA)));
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ SDOUtil.registerStaticTypes(SequencesFactory.class);
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ public void test2RepeatingChoicesMixed() throws Exception {
+ TwoRCsMixed rc2m = SequencesFactory.INSTANCE.createTwoRCsMixed();
+
+ List as = rc2m.getA();
+ List bs = rc2m.getB();
+ List ys = rc2m.getY();
+ List zs = rc2m.getZ();
+ Sequence mixed = rc2m.getMixed();
+
+ bs.add(new Integer(1));
+ mixed.add("where will this appear?");
+ as.add("foo");
+ as.add("bar");
+ bs.add(new Integer(2));
+ rc2m.setSplit("pea");
+ zs.add(new Integer(99));
+ ys.add("fred");
+
+
+ assertEquals(8, mixed.size());
+
+ Sequence group = rc2m.getGroup();
+ // FIXME reintroduce test assertEquals(4, group.size());
+ assertEquals(rc2m.getA().size(), 2);
+ assertEquals(rc2m.getB().size(),2);
+
+ Sequence group1 = rc2m.getGroup1();
+ // FIXME ditto assertEquals(group1.size(), 2);
+ assertEquals(rc2m.getY().size(), 1);
+ assertEquals(rc2m.getZ().size(),1);
+
+ int i = 0;
+ assertEquals(mixed.getValue(i++), new Integer(1));
+ assertEquals(mixed.getValue(i++), "where will this appear?");
+ assertEquals(mixed.getValue(i++), "foo");
+ assertEquals(mixed.getValue(i++), "bar");
+ assertEquals(mixed.getValue(i++), new Integer(2));
+ assertEquals(mixed.getValue(i++), "pea");
+ assertEquals(mixed.getValue(i++), new Integer(99));
+ assertEquals(mixed.getValue(i++), "fred");
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+
+ XMLHelper.INSTANCE.save((DataObject)rc2m, TEST_NAMESPACE, "rc2m", baos);
+ assertTrue(baos.toString(), TestUtil.equalXmlFiles(new ByteArrayInputStream(baos.toByteArray()), getClass().getResource(RC2M_TEST_DATA)));
+ }
+
+
+}
diff --git a/branches/sdo-java-M2/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/TestUtil.java b/branches/sdo-java-M2/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/TestUtil.java
new file mode 100644
index 0000000000..0ca49b6122
--- /dev/null
+++ b/branches/sdo-java-M2/sdo/tools/src/test/java/org/apache/tuscany/sdo/test/TestUtil.java
@@ -0,0 +1,288 @@
+/**
+ *
+ * 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 java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.FactoryConfigurationError;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.DocumentType;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+public class TestUtil
+{
+ private static void getAllNodes(NodeList nodeList, List nodes)
+ {
+ int length = nodeList.getLength();
+ if (length == 0)
+ {
+ return;
+ }
+
+ for (int i=0; i<length; i++)
+ {
+ Node node = nodeList.item(i);
+ nodes.add(node);
+ getAllNodes(node.getChildNodes(), nodes);
+ } // for
+ }
+
+ private static boolean equalNamedNodeMap(NamedNodeMap mapA, NamedNodeMap mapB) {
+ if (mapA == null) {
+ if (mapB == null) {
+ return true;
+ }
+ return false;
+ }
+ if (mapA.getLength() != mapB.getLength()) {
+ return false;
+ }
+ for (int i = 0; i < mapA.getLength(); i++) {
+ Node trialNode = mapA.item(i);
+ if (trialNode == null) {
+ return false;
+ }
+ Node checkNode = mapB.getNamedItem(trialNode.getNodeName());
+ if (checkNode == null) {
+ return false;
+ }
+ if (!equalNode(trialNode, checkNode)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ private static boolean equalNode(Node nodeA, Node nodeB) {
+ if (nodeA == null) {
+ if (nodeB == null) {
+ return true;
+ }
+ return false;
+ }
+ // following is intended to provide same function as 1.5 isEqualNode()
+ if (nodeA.getNodeType() != nodeB.getNodeType()) {
+ return false;
+ }
+ if (!equalString(nodeA.getNodeName(), nodeB.getNodeName())) {
+ return false;
+ }
+ if (!equalString(nodeA.getLocalName(), nodeB.getLocalName())) {
+ return false;
+ }
+ if (!equalString(nodeA.getNamespaceURI(), nodeB.getNamespaceURI())) {
+ return false;
+ }
+ if (!equalString(nodeA.getNamespaceURI(), nodeB.getNamespaceURI())) {
+ return false;
+ }
+ if (!equalString(nodeA.getPrefix(), nodeB.getPrefix())) {
+ return false;
+ }
+ if (!equalString(nodeA.getNodeValue(), nodeB.getNodeValue())) {
+ return false;
+ }
+ if (!equalNamedNodeMap(nodeA.getAttributes(), nodeB.getAttributes())) {
+ return false;
+ }
+ if (!equalNodeList(nodeA.getChildNodes(), nodeB.getChildNodes())) {
+ return false;
+ }
+ if (nodeA.getNodeType() == Node.DOCUMENT_TYPE_NODE) {
+ DocumentType documentTypeA = (DocumentType) nodeA;
+ DocumentType documentTypeB = (DocumentType) nodeB;
+ if (!equalString(documentTypeA.getPublicId(), documentTypeB.getPublicId())) {
+ return false;
+ }
+ if (!equalString(documentTypeA.getSystemId(), documentTypeB.getSystemId())) {
+ return false;
+ }
+ if (!equalString(documentTypeA.getInternalSubset(), documentTypeB.getInternalSubset())) {
+ return false;
+ }
+ if (!equalNamedNodeMap(documentTypeA.getEntities(), documentTypeB.getEntities())) {
+ return false;
+ }
+ if (!equalNamedNodeMap(documentTypeA.getNotations(), documentTypeB.getNotations())) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ private static boolean equalNodeList(NodeList nodeListA, NodeList nodeListB) {
+ if (nodeListA == null) {
+ if (nodeListB == null) {
+ return true;
+ }
+ return false;
+ }
+ return equalNodes(nodeListA, nodeListB);
+ }
+
+ private static boolean equalString(String stringA, String stringB) {
+ if (stringA == null) {
+ if (stringB == null) {
+ return true;
+ }
+ return false;
+ }
+ return stringA.equals(stringB);
+ }
+
+ private static boolean equalNodes(NodeList sourceNodeList, NodeList targetNodeList)
+ {
+ ArrayList sourceNodes = new ArrayList();
+ ArrayList targetNodes = new ArrayList();
+
+ getAllNodes(sourceNodeList, sourceNodes);
+ getAllNodes(targetNodeList, targetNodes);
+
+ int sourceLength = sourceNodes.size();
+ int targetLength = targetNodes.size();
+
+ if (sourceLength != targetLength)
+ {
+ return false;
+ }
+
+ for (int i=0; i<sourceLength; i++)
+ {
+ Node sourceNode = (Node)sourceNodes.get(i);
+ Node targetNode = (Node)targetNodes.get(i);
+
+ /* remove comment when migrated to Java 1.5
+ if (!sourceNode.isEqualNode(targetNode))
+ {
+ return false;
+ }
+ */
+ // following is intended as 1.4 equivalent of isEqualNode()
+ if (!equalNode(sourceNode, targetNode))
+ {
+ return false;
+ }
+ } // for
+
+ return true;
+ }
+
+ public static boolean equalXmlFiles(URL source, URL target)
+ {
+ try {
+ return equalXmlFiles(source.openStream(), target.openStream());
+ }
+ catch (IOException e)
+ {
+ return false;
+ }
+ }
+
+ public static boolean equalXmlFiles(InputStream sourceStream, URL target)
+ {
+ try {
+ return equalXmlFiles(sourceStream, target.openStream());
+ }
+ catch (IOException e)
+ {
+ return false;
+ }
+ }
+
+ public static boolean equalXmlFiles(URL source, InputStream targetStream)
+ {
+ try {
+ return equalXmlFiles(source.openStream(), targetStream);
+ }
+ catch (IOException e)
+ {
+ return false;
+ }
+ }
+
+ public static boolean equalXmlFiles(InputStream sourceStream, InputStream targetStream)
+ {
+ DocumentBuilder builder;
+ Document sourceDocument;
+ Document targetDocument;
+
+ try {
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ factory.setIgnoringComments(true);
+ builder = factory.newDocumentBuilder();
+ //builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ sourceDocument = builder.parse(sourceStream);
+ targetDocument = builder.parse(targetStream);
+ }
+ catch (FactoryConfigurationError fce) {
+ return false;
+ }
+ catch (ParserConfigurationException ce) {
+ return false;
+ }
+ catch (SAXException se)
+ {
+ return false;
+ }
+ catch (IOException ie)
+ {
+ return false;
+ }
+
+ sourceDocument.normalize();
+ targetDocument.normalize();
+
+ /* remove comment when migrated to Java 1.5
+ if (!sourceDocument.getXmlVersion().equals(targetDocument.getXmlVersion()))
+ {
+ return false;
+ }
+
+ String sourceXmlEncoding = sourceDocument.getXmlEncoding();
+ String targetXmlEncoding = targetDocument.getXmlEncoding();
+
+ if (sourceXmlEncoding != null && targetXmlEncoding != null &&
+ sourceXmlEncoding.equalsIgnoreCase(targetXmlEncoding))
+ {
+ // continue
+ }
+ else
+ {
+ return false;
+ }
+ */
+
+ NodeList sourceNodes = sourceDocument.getChildNodes();
+ NodeList targetNodes = targetDocument.getChildNodes();
+
+ return equalNodes(sourceNodes, targetNodes);
+ }
+}
diff --git a/branches/sdo-java-M2/sdo/tools/src/test/resources/enum.xsd b/branches/sdo-java-M2/sdo/tools/src/test/resources/enum.xsd
new file mode 100644
index 0000000000..8be96d6896
--- /dev/null
+++ b/branches/sdo-java-M2/sdo/tools/src/test/resources/enum.xsd
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+ <!--
+ 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.
+ -->
+<xsd:schema
+ targetNamespace="http://www.example.com/simple"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:simple="http://www.example.com/simple">
+
+ <xsd:element name="stockQuote" type="simple:Quote"/>
+
+ <xsd:simpleType name="PriceClass">
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="Large"/>
+ <xsd:enumeration value="Medium"/>
+ <xsd:enumeration value="Small"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+
+ <xsd:complexType name="Quote">
+ <xsd:sequence>
+ <xsd:element name="symbol" type="xsd:string"/>
+ <xsd:element name="companyName" type="xsd:string"/>
+ <xsd:element name="priceClass" type="simple:PriceClass"/>
+ <xsd:element name="price" type="xsd:decimal"/>
+ <xsd:element name="open1" type="xsd:decimal"/>
+ <xsd:element name="high" type="xsd:decimal"/>
+ <xsd:element name="low" type="xsd:decimal"/>
+ <xsd:element name="volume" type="xsd:double"/>
+ <xsd:element name="change1" type="xsd:double"/>
+ <xsd:element name="quotes" type="simple:Quote" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+</xsd:schema>
diff --git a/branches/sdo-java-M2/sdo/tools/src/test/resources/mixedRepeatingChoiceTestResult.xml b/branches/sdo-java-M2/sdo/tools/src/test/resources/mixedRepeatingChoiceTestResult.xml
new file mode 100644
index 0000000000..cefaf93fa3
--- /dev/null
+++ b/branches/sdo-java-M2/sdo/tools/src/test/resources/mixedRepeatingChoiceTestResult.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ 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.
+ -->
+<sequences:mrc xmlns:sequences="http://www.example.com/sequences">
+ <b>1</b>
+ <a>foo</a>
+some mixed text <a>bar</a>
+ <b>2</b>
+</sequences:mrc>
diff --git a/branches/sdo-java-M2/sdo/tools/src/test/resources/mixedStaticTestResult.xml b/branches/sdo-java-M2/sdo/tools/src/test/resources/mixedStaticTestResult.xml
new file mode 100644
index 0000000000..01a20bd350
--- /dev/null
+++ b/branches/sdo-java-M2/sdo/tools/src/test/resources/mixedStaticTestResult.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ 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.
+ -->
+<sequences:mixedStockQuote xmlns:sequences="http://www.example.com/sequences">
+
+ <symbol>fbnt</symbol>
+
+ <companyName>FlyByNightTechnology</companyName>
+
+ some text
+ <quotes>
+ <price>2000.0</price>
+ </quotes>
+
+ more text
+ <price>1000.0</price>
+
+</sequences:mixedStockQuote>
diff --git a/branches/sdo-java-M2/sdo/tools/src/test/resources/repeatingChoice.xsd b/branches/sdo-java-M2/sdo/tools/src/test/resources/repeatingChoice.xsd
new file mode 100644
index 0000000000..3650b634ab
--- /dev/null
+++ b/branches/sdo-java-M2/sdo/tools/src/test/resources/repeatingChoice.xsd
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+ <!--
+ 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.
+ -->
+
+<xsd:schema xmlns:repchoice="http://www.example.com/repchoice" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.com/repchoice">
+
+ <xsd:element name="rc" type="repchoice:RCType"/>
+
+ <xsd:complexType name="RCType">
+ <xsd:choice maxOccurs="unbounded" minOccurs="0">
+ <xsd:element name="s" type="xsd:string"/>
+ <xsd:element name="i" type="xsd:int"/>
+ <xsd:element name="f" type="xsd:float"/>
+ </xsd:choice>
+ </xsd:complexType>
+
+</xsd:schema>
diff --git a/branches/sdo-java-M2/sdo/tools/src/test/resources/repeatingChoiceTestResult.xml b/branches/sdo-java-M2/sdo/tools/src/test/resources/repeatingChoiceTestResult.xml
new file mode 100644
index 0000000000..2719457b6d
--- /dev/null
+++ b/branches/sdo-java-M2/sdo/tools/src/test/resources/repeatingChoiceTestResult.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ 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.
+ -->
+<sequences:rc xmlns:sequences="http://www.example.com/sequences">
+ <b>1</b>
+ <a>foo</a>
+ <a>bar</a>
+ <b>2</b>
+</sequences:rc>
diff --git a/branches/sdo-java-M2/sdo/tools/src/test/resources/sequences.xsd b/branches/sdo-java-M2/sdo/tools/src/test/resources/sequences.xsd
new file mode 100644
index 0000000000..7d1d9e07ac
--- /dev/null
+++ b/branches/sdo-java-M2/sdo/tools/src/test/resources/sequences.xsd
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8"?>
+ <!--
+ 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.
+ -->
+<xsd:schema xmlns:seq="http://www.example.com/sequences"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://www.example.com/sequences">
+
+ <xsd:element name="mixedStockQuote" type="seq:MixedQuote" />
+ <xsd:element name="rc" type="seq:RepeatingChoice" />
+ <xsd:element name="mrc" type="seq:MixedRepeatingChoice" />
+ <xsd:element name="rc2" type="seq:TwoRCs" />
+ <xsd:element name="mrc2" type="seq:TwoRCsMixed" />
+
+
+
+ <xsd:complexType mixed="true" name="MixedQuote">
+ <xsd:sequence>
+ <xsd:element name="symbol" type="xsd:string" />
+ <xsd:element name="companyName" type="xsd:string" />
+ <xsd:element name="price" type="xsd:decimal" />
+ <xsd:element name="open1" type="xsd:decimal" />
+ <xsd:element name="high" type="xsd:decimal" />
+ <xsd:element name="low" type="xsd:decimal" />
+ <xsd:element name="volume" type="xsd:double" />
+ <xsd:element name="change1" type="xsd:double" />
+ <xsd:element maxOccurs="unbounded" minOccurs="0"
+ name="quotes" type="seq:MixedQuote" />
+ </xsd:sequence>
+ </xsd:complexType>
+
+
+ <xsd:complexType name="RepeatingChoice">
+ <xsd:choice maxOccurs="unbounded" minOccurs="0">
+ <xsd:element name="a" type="xsd:string" />
+ <xsd:element name="b" type="xsd:int" />
+ </xsd:choice>
+ </xsd:complexType>
+
+
+ <xsd:complexType mixed="true" name="MixedRepeatingChoice">
+ <xsd:choice maxOccurs="unbounded" minOccurs="0">
+ <xsd:element name="a" type="xsd:string" />
+ <xsd:element name="b" type="xsd:int" />
+ </xsd:choice>
+ </xsd:complexType>
+
+
+ <xsd:complexType name="TwoRCs">
+ <xsd:sequence>
+
+ <xsd:choice maxOccurs="unbounded" minOccurs="0">
+ <xsd:element name="a" type="xsd:string" />
+ <xsd:element name="b" type="xsd:int" />
+ </xsd:choice>
+
+ <xsd:element name="split" type="xsd:string" />
+
+ <xsd:choice maxOccurs="unbounded" minOccurs="0">
+ <xsd:element name="y" type="xsd:string" />
+ <xsd:element name="z" type="xsd:int" />
+ </xsd:choice>
+
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType mixed="true" name="TwoRCsMixed">
+ <xsd:sequence>
+
+ <xsd:choice maxOccurs="unbounded" minOccurs="0">
+ <xsd:element name="a" type="xsd:string" />
+ <xsd:element name="b" type="xsd:int" />
+ </xsd:choice>
+
+ <xsd:element name="split" type="xsd:string" />
+
+ <xsd:choice maxOccurs="unbounded" minOccurs="0">
+ <xsd:element name="y" type="xsd:string" />
+ <xsd:element name="z" type="xsd:int" />
+ </xsd:choice>
+
+ </xsd:sequence>
+ </xsd:complexType>
+
+</xsd:schema>
diff --git a/branches/sdo-java-M2/sdo/tools/src/test/resources/simple.xsd b/branches/sdo-java-M2/sdo/tools/src/test/resources/simple.xsd
new file mode 100644
index 0000000000..4092113c42
--- /dev/null
+++ b/branches/sdo-java-M2/sdo/tools/src/test/resources/simple.xsd
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+ <!--
+ 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.
+ -->
+<xsd:schema
+ targetNamespace="http://www.example.com/simple"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:simple="http://www.example.com/simple">
+
+ <xsd:element name="stockQuote" type="simple:Quote"/>
+
+ <xsd:complexType name="Quote">
+ <xsd:sequence>
+ <xsd:element name="symbol" type="xsd:string"/>
+ <xsd:element name="companyName" type="xsd:string"/>
+ <xsd:element name="price" type="xsd:decimal"/>
+ <xsd:element name="open1" type="xsd:decimal"/>
+ <xsd:element name="high" type="xsd:decimal"/>
+ <xsd:element name="low" type="xsd:decimal"/>
+ <xsd:element name="volume" type="xsd:double"/>
+ <xsd:element name="change1" type="xsd:double"/>
+ <xsd:element name="quotes" type="simple:Quote" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+</xsd:schema>
diff --git a/branches/sdo-java-M2/sdo/tools/src/test/resources/twoRepeatingChoicesMixedTestResult.xml b/branches/sdo-java-M2/sdo/tools/src/test/resources/twoRepeatingChoicesMixedTestResult.xml
new file mode 100644
index 0000000000..cfc434c8e8
--- /dev/null
+++ b/branches/sdo-java-M2/sdo/tools/src/test/resources/twoRepeatingChoicesMixedTestResult.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ 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.
+ -->
+<sequences:rc2m xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sequences="http://www.example.com/sequences" xsi:type="sequences:TwoRCsMixed">
+ <b>1</b>
+where will this appear? <a>foo</a>
+ <a>bar</a>
+ <b>2</b>
+ <split>pea</split>
+ <z>99</z>
+ <y>fred</y>
+</sequences:rc2m>
diff --git a/branches/sdo-java-M2/sdo/tools/src/test/resources/twoRepeatingChoicesTestResult.xml b/branches/sdo-java-M2/sdo/tools/src/test/resources/twoRepeatingChoicesTestResult.xml
new file mode 100644
index 0000000000..3585ad00d3
--- /dev/null
+++ b/branches/sdo-java-M2/sdo/tools/src/test/resources/twoRepeatingChoicesTestResult.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ 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.
+ -->
+<sequences:rc2 xmlns:sequences="http://www.example.com/sequences">
+ <b>1</b>
+ <a>foo</a>
+ <a>bar</a>
+ <b>2</b>
+ <split>banana</split>
+ <z>99</z>
+ <y>fred</y>
+</sequences:rc2>
diff --git a/branches/sdo-java-M2/sdo/tools/templates/Header.javajetinc b/branches/sdo-java-M2/sdo/tools/templates/Header.javajetinc
new file mode 100644
index 0000000000..27becf3645
--- /dev/null
+++ b/branches/sdo-java-M2/sdo/tools/templates/Header.javajetinc
@@ -0,0 +1,6 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * <%="$"%>Id<%="$"%>
+ */
diff --git a/branches/sdo-java-M2/sdo/tools/templates/models/SDOClass.javajet b/branches/sdo-java-M2/sdo/tools/templates/models/SDOClass.javajet
new file mode 100644
index 0000000000..8daf6a9904
--- /dev/null
+++ b/branches/sdo-java-M2/sdo/tools/templates/models/SDOClass.javajet
@@ -0,0 +1,1844 @@
+<%@ jet package="org.apache.tuscany.sdo.generate.templates.model" imports="org.eclipse.emf.codegen.util.* java.util.* org.eclipse.emf.codegen.ecore.genmodel.*" class="SDOClass" version="$Id: Class.javajet,v 1.41 2006/02/15 19:58:39 emerks Exp $" %>
+<%
+/**
+ *
+ * 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.
+ */
+%>
+<%GenClass genClass = (GenClass)((Object[])argument)[0]; GenPackage genPackage = genClass.getGenPackage(); GenModel genModel=genPackage.getGenModel();%>
+<%boolean isInterface = Boolean.TRUE.equals(((Object[])argument)[1]); boolean isImplementation = Boolean.TRUE.equals(((Object[])argument)[2]);%>
+<%String publicStaticFinalFlag = isImplementation ? "public static final " : "";%>
+<%@ include file="../Header.javajetinc"%>
+<%if (isInterface) {%>
+package <%=genPackage.getInterfacePackageName()%>;
+<%} else {%>
+package <%=genPackage.getClassPackageName()%>;
+<%}%>
+
+<%genModel.markImportLocation(stringBuffer, genPackage);%>
+
+<%if (isInterface) {%>
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b><%=genClass.getFormattedName()%></b></em>'.
+ * <!-- end-user-doc -->
+<%if (genClass.hasDocumentation()) {%>
+ *
+ * <!-- begin-model-doc -->
+ * <%=genClass.getDocumentation(genModel.getIndentation(stringBuffer))%>
+ * <!-- end-model-doc -->
+<%}%>
+ *
+<%if (!genClass.getGenFeatures().isEmpty()) {%>
+ * <p>
+ * The following features are supported:
+ * <ul>
+<%for (Iterator i=genClass.getGenFeatures().iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();%>
+ <%if (!genFeature.isSuppressedGetVisibility()) {%>
+ * <li>{@link <%=genClass.getQualifiedInterfaceName()%>#<%=genFeature.getGetAccessor()%> <em><%=genFeature.getFormattedName()%></em>}</li>
+ <%}%>
+<%}%>
+ * </ul>
+ * </p>
+<%}%>
+ *
+<%if (!genModel.isSuppressEMFMetaData()) {%>
+ * @see <%=genPackage.getQualifiedPackageInterfaceName()%>#get<%=genClass.getClassifierAccessorName()%>()
+<%}%>
+<%if (!genModel.isSuppressEMFModelTags()) { boolean first = true; for (StringTokenizer stringTokenizer = new StringTokenizer(genClass.getModelInfo(), "\n\r"); stringTokenizer.hasMoreTokens(); ) { String modelInfo = stringTokenizer.nextToken(); if (first) { first = false;%>
+ * @model <%=modelInfo%>
+<%} else {%>
+ * <%=modelInfo%>
+<%}} if (first) {%>
+ * @model
+<%}}%>
+<%if (genClass.needsRootExtendsInterfaceExtendsTag()) {%>
+ * @extends <%=genModel.getImportedName(genModel.getRootExtendsInterface())%>
+<%}%>
+ * @generated
+ */
+<%} else {%>
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b><%=genClass.getFormattedName()%></b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+<%if (!genClass.getImplementedGenFeatures().isEmpty()) {%>
+ * The following features are implemented:
+ * <ul>
+<%for (Iterator i=genClass.getImplementedGenFeatures().iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();%>
+ * <li>{@link <%=genClass.getQualifiedClassName()%>#<%=genFeature.getGetAccessor()%> <em><%=genFeature.getFormattedName()%></em>}</li>
+<%}%>
+ * </ul>
+<%}%>
+ * </p>
+ *
+ * @generated
+ */
+<%}%>
+<%if (isImplementation) {%>
+public<%if (genClass.isAbstract()) {%> abstract<%}%> class <%=genClass.getClassName()%><%=genClass.getClassExtends()%><%=genClass.getClassImplements()%>
+<%} else {%>
+public interface <%=genClass.getInterfaceName()%><%=genClass.getInterfaceExtends()%>
+<%}%>
+{
+<%if (genModel.getCopyrightText() != null) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%=publicStaticFinalFlag%><%=genModel.getImportedName("java.lang.String")%> copyright = "<%=genModel.getCopyrightText()%>";<%=genModel.getNonNLS()%>
+
+<%}%>
+<%if (isImplementation && genModel.getDriverNumber() != null) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final <%=genModel.getImportedName("java.lang.String")%> mofDriverNumber = "<%=genModel.getDriverNumber()%>";<%=genModel.getNonNLS()%>
+
+<%}%>
+<%if (isImplementation && genClass.isJavaIOSerializable()) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static final long serialVersionUID = 1L;
+
+<%}%>
+<%if (isImplementation && genModel.isVirtualDelegation()) { String eVirtualValuesField = genClass.getEVirtualValuesField();%>
+ <%if (eVirtualValuesField != null) {%>
+ /**
+ * An array of objects representing the values of non-primitive features.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Object[] <%=eVirtualValuesField%> = null;
+
+ <%}%>
+ <%{ List eVirtualIndexBitFields = genClass.getEVirtualIndexBitFields(new ArrayList());%>
+ <%if (!eVirtualIndexBitFields.isEmpty()) {%>
+ <%for (Iterator i = eVirtualIndexBitFields.iterator(); i.hasNext();) { String eVirtualIndexBitField = (String)i.next();%>
+ /**
+ * A bit field representing the indices of non-primitive feature values.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected int <%=eVirtualIndexBitField%> = 0;
+
+ <%}%>
+ <%}%>
+ <%}%>
+<%}%>
+<%if (isImplementation && genClass.isModelRoot() && genModel.isBooleanFlagsEnabled() && genModel.getBooleanFlagsReservedBits() == -1) {%>
+ /**
+ * A set of bit flags representing the values of boolean attributes and whether unsettable features have been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected int <%=genModel.getBooleanFlagsField()%> = 0;
+
+<%}%>
+<%if (isImplementation && !genModel.isReflectiveDelegation()) {%>
+ <%for (Iterator f=genClass.getAllGenFeatures().iterator(); f.hasNext();) { GenFeature genFeature = (GenFeature)f.next();%>
+ /**
+ * The feature id for the '<em><b><%=genFeature.getFormattedName()%></b></em>' <%=genFeature.getFeatureKind()%>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ <%String featureValue = "";
+ List allFeatures = genClass.getAllGenFeatures();
+ int g = allFeatures.indexOf(genFeature);
+ GenClass base = genClass.getBaseGenClass();
+ if (base == null)
+ {
+ featureValue = Integer.toString(g);
+ } else {
+ int baseCount = base.getFeatureCount();
+ if (g < baseCount)
+ {
+ featureValue = base.getClassName() + "." + genFeature.getUpperName();
+ } else {
+ String baseCountID = base.getClassName() + "." + "SDO_PROPERTY_COUNT";
+ featureValue = baseCountID + " + " + Integer.toString(g - baseCount);
+ }
+ }%>
+ public final static int <%=genFeature.getUpperName()%> = <%=featureValue%>;
+
+ <%}%>
+ /**
+ * This represents the number of properties for this type.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ <%String featureCount = "";
+ GenClass base = genClass.getBaseGenClass();
+ if (base == null)
+ {
+ featureCount = Integer.toString(genClass.getFeatureCount());
+ }
+ else {
+ String baseCountID = base.getClassName() + "." + "SDO_PROPERTY_COUNT";
+ featureCount = baseCountID + " + " + Integer.toString(genClass.getFeatureCount() - base.getFeatureCount());
+ }%>
+ public final static int SDO_PROPERTY_COUNT = <%=featureCount%>;
+
+ <%for (Iterator i=genClass.getDeclaredFieldGenFeatures().iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();%>
+<%@ include file="Class/declaredFieldGenFeature.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ <%if (genFeature.isListType() || genFeature.isReferenceType()) {%>
+ <%if (genClass.isField(genFeature)) {%>
+ /**
+ * The cached value of the '{@link #<%=genFeature.getGetAccessor()%>() <em><%=genFeature.getFormattedName()%></em>}' <%=genFeature.getFeatureKind()%>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #<%=genFeature.getGetAccessor()%>()
+ * @generated
+ * @ordered
+ */
+
+ protected <%=genModel.getImportedName(genFeature.getType())%> <%=genFeature.getSafeName()%> = null;
+
+ <%}%>
+ <%if (genModel.isArrayAccessors() && !genFeature.isFeatureMapType() && !genFeature.isMapType()) {%>
+ /**
+ * The empty value for the '{@link #<%=genFeature.getGetArrayAccessor()%>() <em><%=genFeature.getFormattedName()%></em>}' array accessor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #<%=genFeature.getGetArrayAccessor()%>()
+ * @generated
+ * @ordered
+ */
+ protected static final <%=genFeature.getListItemType()%>[] <%=genFeature.getUpperName()%>_EEMPTY_ARRAY = new <%=genFeature.getListItemType()%> [0];
+
+ <%}%>
+ <%} else {%>
+ <%if (!genFeature.isVolatile() || !genModel.isReflectiveDelegation() && (!genFeature.hasDelegateFeature() || !genFeature.isUnsettable())) {%>
+ /**
+ * The default value of the '{@link #<%=genFeature.getGetAccessor()%>() <em><%=genFeature.getFormattedName()%></em>}' <%=genFeature.getFeatureKind()%>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #<%=genFeature.getGetAccessor()%>()
+ * @generated
+ * @ordered
+ */
+ protected static final <%=genFeature.getImportedType()%> <%=genFeature.getUpperName()%>_DEFAULT_ = <%=genFeature.getStaticDefaultValue()%>;<%=genModel.getNonNLS(genFeature.getStaticDefaultValue())%>
+
+ <%}%>
+ <%if (genClass.isField(genFeature)) {%>
+ <%if (genClass.isFlag(genFeature)) {%>
+ <%if (genClass.getFlagIndex(genFeature) > 31 && genClass.getFlagIndex(genFeature) % 32 == 0) {%>
+ /**
+ * An additional set of bit flags representing the values of boolean attributes and whether unsettable features have been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected int <%=genClass.getFlagsField(genFeature)%> = 0;
+
+ <%}%>
+ /**
+ * The flag representing the value of the '{@link #<%=genFeature.getGetAccessor()%>() <em><%=genFeature.getFormattedName()%></em>}' <%=genFeature.getFeatureKind()%>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #<%=genFeature.getGetAccessor()%>()
+ * @generated
+ * @ordered
+ */
+ protected static final int <%=genFeature.getUpperName()%>_EFLAG = 1 <%="<< " + genClass.getFlagIndex(genFeature) % 32 %>;
+
+ <%} else {%>
+ /**
+ * The cached value of the '{@link #<%=genFeature.getGetAccessor()%>() <em><%=genFeature.getFormattedName()%></em>}' <%=genFeature.getFeatureKind()%>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #<%=genFeature.getGetAccessor()%>()
+ * @generated
+ * @ordered
+ */
+ protected <%=genFeature.getImportedType()%> <%=genFeature.getSafeName()%> = <%=genFeature.getUpperName()%>_DEFAULT_;
+
+ <%}%>
+ <%}%>
+ <%}%>
+ <%if (genClass.isESetField(genFeature)) {%>
+ <%if (genClass.isESetFlag(genFeature)) {%>
+ <%if (genClass.getESetFlagIndex(genFeature) > 31 && genClass.getESetFlagIndex(genFeature) % 32 == 0) {%>
+ /**
+ * An additional set of bit flags representing the values of boolean attributes and whether unsettable features have been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected int <%=genClass.getESetFlagsField(genFeature)%> = 0;
+
+ <%}%>
+ /**
+ * The flag representing whether the <%=genFeature.getFormattedName()%> <%=genFeature.getFeatureKind()%> has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected static final int <%=genFeature.getUpperName()%>_ESETFLAG = 1 <%="<< " + genClass.getESetFlagIndex(genFeature) % 32 %>;
+
+ <%} else {%>
+ /**
+ * This is true if the <%=genFeature.getFormattedName()%> <%=genFeature.getFeatureKind()%> has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean <%=genFeature.getUncapName()%>_set_ = false;
+
+ <%}%>
+ <%}%>
+ <%}%>
+<%@ include file="Class/declaredFieldGenFeature.insert.javajetinc" fail="silent" %>
+<%@ end %><%//Class/declaredFieldGenFeature.override.javajetinc%>
+<%}%>
+<%if (isImplementation) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected <%=genClass.getClassName()%>()
+ {
+ super();
+ <%for (Iterator i=genClass.getFlagGenFeatures("true").iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();%>
+ <%=genClass.getFlagsField(genFeature)%> |= <%=genFeature.getUpperName()%>_EFLAG;
+ <%}%>
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public <%=genModel.getImportedName("commonj.sdo.Type")%> getType()
+ {
+ return ((<%=genPackage.getImportedFactoryClassName()%>)<%=genPackage.getImportedFactoryInterfaceName()%>.INSTANCE).get<%=genClass.getClassifierAccessorName()%>();
+ }
+
+<%}%>
+<%for (Iterator i=(isImplementation ? genClass.getImplementedGenFeatures() : genClass.getDeclaredGenFeatures()).iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();%>
+<%@ include file="Class/genFeature.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ <%if (genModel.isArrayAccessors() && genFeature.isListType() && !genFeature.isFeatureMapType() && !genFeature.isMapType()) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%if (!isImplementation) {%>
+ <%=genFeature.getListItemType()%>[] <%=genFeature.getGetArrayAccessor()%>();
+
+ <%} else {%>
+ public <%=genFeature.getListItemType()%>[] <%=genFeature.getGetArrayAccessor()%>()
+ {
+ <%if (genFeature.isVolatile()) {%>
+ <%=genModel.getImportedName("org.eclipse.emf.common.util.BasicEList")%> list = (<%=genModel.getImportedName("org.eclipse.emf.common.util.BasicEList")%>)<%=genFeature.getGetAccessor()%>();
+ if (list.isEmpty()) return <%=genFeature.getUpperName()%>_EEMPTY_ARRAY;
+ <%} else {%>
+ if (<%=genFeature.getSafeName()%> == null || <%=genFeature.getSafeName()%>.isEmpty()) return <%=genFeature.getUpperName()%>_EEMPTY_ARRAY;
+ <%=genModel.getImportedName("org.eclipse.emf.common.util.BasicEList")%> list = (<%=genModel.getImportedName("org.eclipse.emf.common.util.BasicEList")%>)<%=genFeature.getSafeName()%>;
+ <%}%>
+ list.shrink();
+ return (<%=genFeature.getListItemType()%>[])list.data();
+ }
+
+ <%}%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%if (!isImplementation) {%>
+ <%=genFeature.getListItemType()%> get<%=genFeature.getAccessorName()%>(int index);
+ <%} else {%>
+ public <%=genFeature.getListItemType()%> get<%=genFeature.getAccessorName()%>(int index)
+ {
+ return (<%=genFeature.getListItemType()%>)<%=genFeature.getGetAccessor()%>().get(index);
+ }
+ <%}%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%if (!isImplementation) {%>
+ int get<%=genFeature.getAccessorName()%>Length();
+
+ <%} else {%>
+ public int get<%=genFeature.getAccessorName()%>Length()
+ {
+ <%if (genFeature.isVolatile()) {%>
+ return <%=genFeature.getGetAccessor()%>().size();
+ <%} else {%>
+ return <%=genFeature.getSafeName()%> == null ? 0 : <%=genFeature.getSafeName()%>.size();
+ <%}%>
+ }
+
+ <%}%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%if (!isImplementation) {%>
+ void set<%=genFeature.getAccessorName()%>(<%=genFeature.getListItemType()%>[] new<%=genFeature.getCapName()%>);
+
+ <%} else {%>
+ public void set<%=genFeature.getAccessorName()%>(<%=genFeature.getListItemType()%>[] new<%=genFeature.getCapName()%>)
+ {
+ ((<%=genModel.getImportedName("org.eclipse.emf.common.util.BasicEList")%>)<%=genFeature.getGetAccessor()%>()).setData(new<%=genFeature.getCapName()%>.length, new<%=genFeature.getCapName()%>);
+ }
+
+ <%}%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%if (!isImplementation) {%>
+ void set<%=genFeature.getAccessorName()%>(int index, <%=genFeature.getListItemType()%> element);
+
+ <%} else {%>
+ public void set<%=genFeature.getAccessorName()%>(int index, <%=genFeature.getListItemType()%> element)
+ {
+ <%=genFeature.getGetAccessor()%>().set(index, element);
+ }
+
+ <%}%>
+ <%}%>
+ <%if (genFeature.isGet() && (isImplementation || !genFeature.isSuppressedGetVisibility())) {%>
+<%@ include file="Class/getGenFeature.override.javajetinc" fail="alternative" %>
+<%@ start %>
+<%if (isInterface) {%>
+ /**
+ * Returns the value of the '<em><b><%=genFeature.getFormattedName()%></b></em>' <%=genFeature.getFeatureKind()%>.
+ <%if (genFeature.isListType()) {%>
+ <%if (genFeature.isMapType()) { GenFeature keyFeature = genFeature.getMapEntryTypeGenClass().getMapEntryKeyFeature(); GenFeature valueFeature = genFeature.getMapEntryTypeGenClass().getMapEntryValueFeature(); %>
+ * The key is of type <%if (keyFeature.isListType()) {%>list of {@link <%=keyFeature.getQualifiedListItemType()%>}<%} else {%>{@link <%=keyFeature.getType()%>}<%}%>,
+ * and the value is of type <%if (valueFeature.isListType()) {%>list of {@link <%=valueFeature.getQualifiedListItemType()%>}<%} else {%>{@link <%=valueFeature.getType()%>}<%}%>,
+ <%} else if (!genFeature.isWrappedFeatureMapType() && !(genModel.isSuppressEMFMetaData() && "org.eclipse.emf.ecore.EObject".equals(genFeature.getQualifiedListItemType()))) {%>
+ * The list contents are of type {@link <%=genFeature.getQualifiedListItemType()%>}.
+ <%}%>
+ <%} else if (genFeature.isSetDefaultValue()) {%>
+ * The default value is <code><%=genFeature.getDefaultValue()%></code>.
+ <%}%>
+ <%if (genFeature.getTypeGenEnum() != null) {%>
+ * The literals are from the enumeration {@link <%=genFeature.getTypeGenEnum().getQualifiedName()%>}.
+ <%}%>
+ <%if (genFeature.isBidirectional() && !genFeature.getReverse().getGenClass().isMapEntry()) { GenFeature reverseGenFeature = genFeature.getReverse(); %>
+ <%if (!reverseGenFeature.isSuppressedGetVisibility()) {%>
+ * It is bidirectional and its opposite is '{@link <%=reverseGenFeature.getGenClass().getQualifiedInterfaceName()%>#<%=reverseGenFeature.getGetAccessor()%> <em><%=reverseGenFeature.getFormattedName()%></em>}'.
+ <%}%>
+ <%}%>
+ * <!-- begin-user-doc -->
+ <%if (!genFeature.hasDocumentation()) {%>
+ * <p>
+ * If the meaning of the '<em><%=genFeature.getFormattedName()%></em>' <%=genFeature.getFeatureKind()%> isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ <%}%>
+ * <!-- end-user-doc -->
+ <%if (genFeature.hasDocumentation()) {%>
+ * <!-- begin-model-doc -->
+ * <%=genFeature.getDocumentation(genModel.getIndentation(stringBuffer))%>
+ * <!-- end-model-doc -->
+ <%}%>
+ * @return the value of the '<em><%=genFeature.getFormattedName()%></em>' <%=genFeature.getFeatureKind()%>.
+ <%if (genFeature.getTypeGenEnum() != null) {%>
+ * @see <%=genFeature.getTypeGenEnum().getQualifiedName()%>
+ <%}%>
+ <%if (genFeature.isUnsettable()) {%>
+ <%if (!genFeature.isSuppressedIsSetVisibility()) {%>
+ * @see #isSet<%=genFeature.getAccessorName()%>()
+ <%}%>
+ <%if (genFeature.isChangeable() && !genFeature.isSuppressedUnsetVisibility()) {%>
+ * @see #unset<%=genFeature.getAccessorName()%>()
+ <%}%>
+ <%}%>
+ <%if (genFeature.isChangeable() && !genFeature.isListType() && !genFeature.isSuppressedSetVisibility()) {%>
+ * @see #set<%=genFeature.getAccessorName()%>(<%=genFeature.getImportedType()%>)
+ <%}%>
+ <%if (!genModel.isSuppressEMFMetaData()) {%>
+ * @see <%=genPackage.getQualifiedPackageInterfaceName()%>#get<%=genFeature.getFeatureAccessorName()%>()
+ <%}%>
+ <%if (genFeature.isBidirectional() && !genFeature.getReverse().getGenClass().isMapEntry()) { GenFeature reverseGenFeature = genFeature.getReverse(); %>
+ <%if (!reverseGenFeature.isSuppressedGetVisibility()) {%>
+ * @see <%=reverseGenFeature.getGenClass().getQualifiedInterfaceName()%>#<%=reverseGenFeature.getGetAccessor()%>
+ <%}%>
+ <%}%>
+ <%if (!genModel.isSuppressEMFModelTags()) { boolean first = true; for (StringTokenizer stringTokenizer = new StringTokenizer(genFeature.getModelInfo(), "\n\r"); stringTokenizer.hasMoreTokens(); ) { String modelInfo = stringTokenizer.nextToken(); if (first) { first = false;%>
+ * @model <%=modelInfo%>
+ <%} else {%>
+ * <%=modelInfo%>
+ <%}} if (first) {%>
+ * @model
+ <%}}%>
+ * @generated
+ */
+<%} else {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+<%}%>
+<%if (!isImplementation) {%>
+ <%=genFeature.getImportedType()%> <%=genFeature.getGetAccessor()%>();
+
+<%} else {%>
+ public <%=genFeature.getImportedType()%> <%=genFeature.getGetAccessor()%>()
+ {
+<%@ include file="Class/getGenFeature.pre.insert.javajetinc" fail="silent" %>
+ <%if (genModel.isReflectiveDelegation()) {%>
+ return <%if (genFeature.isPrimitiveType()) {%>(<%}%>(<%=genFeature.getObjectType()%>)get(<%=genFeature.getQualifiedFeatureAccessor()%>, true)<%if (genFeature.isPrimitiveType()) {%>).<%=genFeature.getPrimitiveValueFunction()%>()<%}%>;
+ <%} else if (!genFeature.isVolatile()) {%>
+ <%if (genFeature.isListType()) {%>
+ <%if (genModel.isVirtualDelegation()) {%>
+ <%=genFeature.getImportedType()%> <%=genFeature.getSafeName()%> = (<%=genFeature.getImportedType()%>)eVirtualGet(<%=genFeature.getUpperName()%>);
+ <%}%>
+ if (<%=genFeature.getSafeName()%> == null)
+ {
+ <%if (genModel.isVirtualDelegation()) {%>
+ eVirtualSet(<%=genFeature.getUpperName()%>, <%=genFeature.getSafeName()%> = new <%=genClass.getListConstructor(genFeature)%>);
+ <%} else {
+ if (genFeature.getType().equals("commonj.sdo.Sequence")){%>
+ <%=genFeature.getSafeName()%> = createSequence(<%=genFeature.getUpperName()%>);<%} else {%>
+ <%=genFeature.getSafeName()%> = createPropertyList(ListKind.CONTAINMENT, <%=genFeature.getListItemType()%>.class, <%=genFeature.getUpperName()%>);<%}}%>
+ }
+ return <%=genFeature.getSafeName()%><%=genFeature.isMapType() && genFeature.isEffectiveSuppressEMFTypes() ? ".map()" : ""%>;
+ <%} else if (genFeature.isContainer()) {%>
+ if (eContainerFeatureID != <%=genFeature.getUpperName()%>) return null;
+ return (<%=genFeature.getImportedType()%>)eContainer();
+ <%} else {%>
+ <%if (genFeature.isResolveProxies()) {%>
+ <%if (genModel.isVirtualDelegation()) {%>
+ <%=genFeature.getImportedType()%> <%=genFeature.getSafeName()%> = (<%=genFeature.getImportedType()%>)eVirtualGet(<%=genFeature.getUpperName()%><%if (!genFeature.isReferenceType()) {%>, <%=genFeature.getUpperName()%>_DEFAULT_<%}%>);
+ <%}%>
+ if (<%=genFeature.getSafeName()%> != null && <%=genFeature.getSafeNameAsEObject()%>.isProxy())
+ {
+ <%=genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject")%> old<%=genFeature.getCapName()%> = (<%=genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject")%>)<%=genFeature.getSafeName()%>;
+ <%=genFeature.getSafeName()%> = <%=genFeature.getNonEObjectInternalTypeCast()%>eResolveProxy(old<%=genFeature.getCapName()%>);
+ if (<%=genFeature.getSafeName()%> != old<%=genFeature.getCapName()%>)
+ {
+ <%if (genFeature.isEffectiveContains()) {%>
+ <%=genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject")%> new<%=genFeature.getCapName()%> = (<%=genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject")%>)<%=genFeature.getSafeName()%>;
+ <%if (!genFeature.isBidirectional()) {%>
+ ChangeContext changeContext = old<%=genFeature.getCapName()%>.inverseRemove(this, EOPPOSITE_FEATURE_BASE - <%=genFeature.getUpperName()%>, null, null);
+ <%} else { GenFeature reverseFeature = genFeature.getReverse(); GenClass targetClass = reverseFeature.getGenClass();%>
+ <%=genModel.getImportedName("org.eclipse.emf.common.notify.ChangeContext")%> changeContext = old<%=genFeature.getCapName()%>.inverseRemove(this, <%=targetClass.getQualifiedFeatureID(reverseFeature)%>, <%=targetClass.getImportedInterfaceName()%>.class, null);
+ <%}%>
+ if (new<%=genFeature.getCapName()%>.eInternalContainer() == null)
+ {
+ <%if (!genFeature.isBidirectional()) {%>
+ changeContext = new<%=genFeature.getCapName()%>.eInverseAdd(this, EOPPOSITE_FEATURE_BASE - <%=genFeature.getUpperName()%>, null, changeContext);
+ <%} else { GenFeature reverseFeature = genFeature.getReverse(); GenClass targetClass = reverseFeature.getGenClass();%>
+ changeContext = new<%=genFeature.getCapName()%>.eInverseAdd(this, <%=targetClass.getQualifiedFeatureID(reverseFeature)%>, <%=targetClass.getImportedInterfaceName()%>.class, changeContext);
+ <%}%>
+ }
+ if (changeContext != null) dispatch(changeContext);
+ <%} else if (genModel.isVirtualDelegation()) {%>
+ eVirtualSet(<%=genFeature.getUpperName()%>, <%=genFeature.getSafeName()%>);
+ <%}%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ if (isNotifying())
+ notify(ChangeKind.RESOLVE, <%=genFeature.getUpperName()%>, old<%=genFeature.getCapName()%>, <%=genFeature.getSafeName()%>);
+ <%}%>
+ }
+ }
+ <%}%>
+ <%if (!genFeature.isResolveProxies() && genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {%>
+ return (<%=genFeature.getImportedType()%>)eVirtualGet(<%=genFeature.getUpperName()%><%if (!genFeature.isReferenceType()) {%>, <%=genFeature.getUpperName()%>_DEFAULT_<%}%>);
+ <%} else if (genClass.isFlag(genFeature)) {%>
+ return (<%=genClass.getFlagsField(genFeature)%> & <%=genFeature.getUpperName()%>_EFLAG) != 0;
+ <%} else {%>
+ return <%=genFeature.getSafeName()%>;
+ <%}%>
+ <%}%>
+ <%} else {//volatile%>
+ <%if (genFeature.isResolveProxies() && !genFeature.isListType()) {%>
+ <%=genFeature.getImportedType()%> <%=genFeature.getSafeName()%> = basicGet<%=genFeature.getAccessorName()%>();
+ return <%=genFeature.getSafeName()%> != null && <%=genFeature.getSafeName()%>.isProxy() ? <%=genFeature.getNonEObjectInternalTypeCast()%>eResolveProxy((<%=genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject")%>)<%=genFeature.getSafeName()%>) : <%=genFeature.getSafeName()%>;
+ <%} else if (genFeature.hasDelegateFeature()) { GenFeature delegateFeature = genFeature.getDelegateFeature();%>
+ <%if (genFeature.isFeatureMapType()) {%>
+ <%if (delegateFeature.isWrappedFeatureMapType()) {%>
+ return create<%=genFeature.getImportedType()%>(get<%=delegateFeature.getAccessorName()%>(), getType(), <%=genFeature.getUpperName()%>);
+ <%} else {%>
+ return (<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")%>)((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")%>)get<%=delegateFeature.getAccessorName()%>()).list(<%=genFeature.getQualifiedFeatureAccessor()%>);
+ <%}%>
+ <%} else if (genFeature.isListType()) {%>
+ <%if (delegateFeature.isWrappedFeatureMapType()) {%>
+ return get<%=genFeature.getImportedType()%>(get<%=delegateFeature.getAccessorName()%>(), getType(), <%=genFeature.getUpperName()%>);
+
+ <%} else {%>
+ return ((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")%>)get<%=delegateFeature.getAccessorName()%>()).list(<%=genFeature.getQualifiedFeatureAccessor()%>);
+ <%}%>
+ <%} else {%>
+ <%if (delegateFeature.isWrappedFeatureMapType()) {%>
+ return <%if (genFeature.isPrimitiveType()) {%>(<%}%>(<%=genFeature.getObjectType()%>)get(get<%=delegateFeature.getAccessorName()%>(), getType(), <%=genFeature.getUpperName()%>)<%if (genFeature.isPrimitiveType()) {%>).<%=genFeature.getPrimitiveValueFunction()%>()<%}%>;
+ <%} else {%>
+ return <%if (genFeature.isPrimitiveType()) {%>(<%}%>(<%=genFeature.getObjectType()%>)get(get<%=delegateFeature.getAccessorName()%>(), getType(), <%=genFeature.getUpperName()%>);<%if (genFeature.isPrimitiveType()) {%>).<%=genFeature.getPrimitiveValueFunction()%>()<%}%>;
+ <%}%>
+ <%}%>
+ <%} else {%>
+<%@ include file="Class/getGenFeature.TODO.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ // TODO: implement this method to return the '<%=genFeature.getFormattedName()%>' <%=genFeature.getFeatureKind()%>
+ // Ensure that you remove @generated or mark it @generated NOT
+ throw new UnsupportedOperationException();
+<%@ end %><%//Class/getGenFeature.todo.override.javajetinc%>
+ <%}%>
+ <%}%>
+ }
+<%}%>
+<%@ end %><%//Class/getGenFeature.override.javajetinc%>
+ <%}%>
+ <%if (isImplementation && !genModel.isReflectiveDelegation() && genFeature.isBasicGet()) {%>
+<%@ include file="Class/basicGetGenFeature.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public <%=genFeature.getImportedType()%> basicGet<%=genFeature.getAccessorName()%>()
+ {
+<%@ include file="Class/basicGetGenFeature.pre.insert.javajetinc" fail="silent" %>
+ <%if (genFeature.isContainer()) {%>
+ if (eContainerFeatureID != <%=genFeature.getUpperName()%>) return null;
+ return (<%=genFeature.getImportedType()%>)eInternalContainer();
+ <%} else if (!genFeature.isVolatile()) {%>
+ <%if (genModel.isVirtualDelegation()) {%>
+ return (<%=genFeature.getImportedType()%>)eVirtualGet(<%=genFeature.getUpperName()%>);
+ <%} else {%>
+ return <%=genFeature.getSafeName()%>;
+ <%}%>
+ <%} else if (genFeature.hasDelegateFeature()) { GenFeature delegateFeature = genFeature.getDelegateFeature();%>
+ <%if (delegateFeature.isWrappedFeatureMapType()) {%>
+ return (<%=genFeature.getImportedType()%>)get(get<%=delegateFeature.getAccessorName()%>(), getType(), <%=genFeature.getUpperName()%>);
+ <%} else {%>
+ return (<%=genFeature.getImportedType()%>)get<%=delegateFeature.getAccessorName()%>().get(<%=genFeature.getQualifiedFeatureAccessor()%>, false);
+ <%}%>
+ <%} else {%>
+<%@ include file="Class/basicGetGenFeature.TODO.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ // TODO: implement this method to return the '<%=genFeature.getFormattedName()%>' <%=genFeature.getFeatureKind()%>
+ // -> do not perform proxy resolution
+ // Ensure that you remove @generated or mark it @generated NOT
+ throw new UnsupportedOperationException();
+<%@ end %><%//Class/basicGetGenFeature.todo.override.javajetinc%>
+ <%}%>
+ }
+
+<%@ end %><%//Class/basicGetGenFeature.override.javajetinc%>
+ <%}%>
+ <%if (isImplementation && !genModel.isReflectiveDelegation() && genFeature.isBasicSet()) {%>
+<%@ include file="Class/basicSetGenFeature.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeContext basicSet<%=genFeature.getAccessorName()%>(<%=genFeature.getImportedInternalType()%> new<%=genFeature.getCapName()%>, ChangeContext changeContext)
+ {
+ <%if (!genFeature.isVolatile()) {%>
+<%@ include file="Class/basicSetGenFeature.pre.insert.javajetinc" fail="silent" %>
+ <%if (genModel.isVirtualDelegation()) {%>
+ Object old<%=genFeature.getCapName()%> = eVirtualSet(<%=genFeature.getUpperName()%>, new<%=genFeature.getCapName()%>);
+ <%} else {%>
+ <%=genFeature.getImportedType()%> old<%=genFeature.getCapName()%> = <%=genFeature.getSafeName()%>;
+ <%=genFeature.getSafeName()%> = new<%=genFeature.getCapName()%>;
+ <%}%>
+ <%if (genFeature.isUnsettable()) {%>
+ <%if (genModel.isVirtualDelegation()) {%>
+ boolean isSetChange = old<%=genFeature.getCapName()%> == EVIRTUAL_NO_VALUE;
+ <%} else if (genClass.isESetFlag(genFeature)) {%>
+ boolean old<%=genFeature.getCapName()%>_set_ = (<%=genClass.getESetFlagsField(genFeature)%> & <%=genFeature.getUpperName()%>_ESETFLAG) != 0;
+ <%=genClass.getESetFlagsField(genFeature)%> |= <%=genFeature.getUpperName()%>_ESETFLAG;
+ <%} else {%>
+ boolean old<%=genFeature.getCapName()%>_set_ = <%=genFeature.getUncapName()%>_set_;
+ <%=genFeature.getUncapName()%>_set_ = true;
+ <%}%>
+ <%}%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ if (isNotifying())
+ {
+ <%if (genFeature.isUnsettable()) {%>
+ addNotification(this, ChangeKind.SET, <%=genFeature.getUpperName()%>, <%if (genModel.isVirtualDelegation()) {%>isSetChange ? null : old<%=genFeature.getCapName()%><%} else {%>old<%=genFeature.getCapName()%><%}%>, new<%=genFeature.getCapName()%>, <%if (genModel.isVirtualDelegation()) {%>isSetChange<%} else {%>!old<%=genFeature.getCapName()%>_set_<%}%>, changeContext);
+ <%} else {%>
+ addNotification(this, ChangeKind.SET, <%=genFeature.getUpperName()%>, <%if (genModel.isVirtualDelegation()) {%>old<%=genFeature.getCapName()%> == EVIRTUAL_NO_VALUE ? null : old<%=genFeature.getCapName()%><%} else {%>old<%=genFeature.getCapName()%><%}%>, new<%=genFeature.getCapName()%>, changeContext);
+ <%}%>
+ }
+ <%}%>
+<%@ include file="Class/basicSetGenFeature.post.insert.javajetinc" fail="silent" %>
+ return changeContext;
+ <%} else if (genFeature.hasDelegateFeature()) { GenFeature delegateFeature = genFeature.getDelegateFeature();%>
+ <%if (delegateFeature.isWrappedFeatureMapType()) {%>
+ return basicAdd(get<%=delegateFeature.getAccessorName()%>(), getType(), <%=genFeature.getUpperName()%>, new<%=genFeature.getCapName()%>, changeContext);
+ <%} else {%>
+ return basicAdd(get<%=delegateFeature.getAccessorName()%>(), getType(), <%=genFeature.getUpperName()%>, new<%=genFeature.getCapName()%>, changeContext);
+ <%}%>
+ <%} else {%>
+<%@ include file="Class/basicSetGenFeature.TODO.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ // TODO: implement this method to set the contained '<%=genFeature.getFormattedName()%>' <%=genFeature.getFeatureKind()%>
+ // -> this method is automatically invoked to keep the containment relationship in synch
+ // -> do not modify other features
+ // -> return changeContext, after adding any generated Notification to it (if it is null, a NotificationChain object must be created first)
+ // Ensure that you remove @generated or mark it @generated NOT
+ throw new UnsupportedOperationException();
+<%@ end %><%//Class/basicSetGenFeature.todo.override.javajetinc%>
+ <%}%>
+ }
+
+<%@ end %><%//Class/basicSetGenFeature.override.javajetinc%>
+ <%}%>
+ <%if (genFeature.isSet() && (isImplementation || !genFeature.isSuppressedSetVisibility())) {%>
+<%@ include file="Class/setGenFeature.override.javajetinc" fail="alternative" %>
+<%@ start %>
+<%if (isInterface) { %>
+ /**
+ * Sets the value of the '{@link <%=genClass.getQualifiedInterfaceName()%>#<%=genFeature.getGetAccessor()%> <em><%=genFeature.getFormattedName()%></em>}' <%=genFeature.getFeatureKind()%>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em><%=genFeature.getFormattedName()%></em>' <%=genFeature.getFeatureKind()%>.
+ <%if (genFeature.isEnumType()) {%>
+ * @see <%=genFeature.getTypeGenEnum().getQualifiedName()%>
+ <%}%>
+ <%if (genFeature.isUnsettable()) {%>
+ <%if (!genFeature.isSuppressedIsSetVisibility()) {%>
+ * @see #isSet<%=genFeature.getAccessorName()%>()
+ <%}%>
+ <%if (!genFeature.isSuppressedUnsetVisibility()) {%>
+ * @see #unset<%=genFeature.getAccessorName()%>()
+ <%}%>
+ <%}%>
+ * @see #<%=genFeature.getGetAccessor()%>()
+ * @generated
+ */
+<%} else {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+<%}%>
+<%if (!isImplementation) { %>
+ void set<%=genFeature.getAccessorName()%>(<%=genFeature.getImportedType()%> value);
+
+<%} else {%>
+ public void set<%=genFeature.getAccessorName()%>(<%=genFeature.getImportedType()%> new<%=genFeature.getCapName()%>)
+ {
+<%@ include file="Class/setGenFeature.pre.insert.javajetinc" fail="alternative" %>
+ <%if (genModel.isReflectiveDelegation()) {%>
+ _set_(<%=genFeature.getQualifiedFeatureAccessor()%>, <%if (genFeature.isPrimitiveType()) {%>new <%=genFeature.getObjectType()%>(<%}%>new<%=genFeature.getCapName()%><%if (genFeature.isPrimitiveType()) {%>)<%}%>);
+ <%} else if (!genFeature.isVolatile()) {%>
+ <%if (genFeature.isContainer()) { GenFeature reverseFeature = genFeature.getReverse(); GenClass targetClass = reverseFeature.getGenClass();%>
+ if (new<%=genFeature.getCapName()%> != eInternalContainer() || (eContainerFeatureID != <%=genFeature.getUpperName()%> && new<%=genFeature.getCapName()%> != null))
+ {
+ if (<%=genModel.getImportedName("org.eclipse.emf.ecore.util.EcoreUtil")%>.isAncestor(this, <%=genFeature.getEObjectCast()%>new<%=genFeature.getCapName()%>))
+ throw new <%=genModel.getImportedName("java.lang.IllegalArgumentException")%>("Recursive containment not allowed for " + toString());<%=genModel.getNonNLS()%>
+ ChangeContext changeContext = null;
+ if (eInternalContainer() != null)
+ changeContext = eBasicRemoveFromContainer(changeContext);
+ if (new<%=genFeature.getCapName()%> != null)
+ changeContext = ((<%=genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject")%>)new<%=genFeature.getCapName()%>).eInverseAdd(this, <%=targetClass.getQualifiedFeatureID(reverseFeature)%>, <%=targetClass.getImportedInterfaceName()%>.class, changeContext);
+ changeContext = eBasicSetContainer((<%=genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject")%>)new<%=genFeature.getCapName()%>, <%=genFeature.getUpperName()%>, changeContext);
+ if (changeContext != null) dispatch(changeContext);
+ }
+ <%if (!genModel.isSuppressNotification()) {%>
+ else if (isNotifying())
+ notify(ChangeKind.SET, <%=genFeature.getUpperName()%>, new<%=genFeature.getCapName()%>, new<%=genFeature.getCapName()%>);
+ <%}%>
+ <%} else if (genFeature.isBidirectional() || genFeature.isEffectiveContains()) {%>
+ <%if (genModel.isVirtualDelegation()) {%>
+ <%=genFeature.getImportedType()%> <%=genFeature.getSafeName()%> = (<%=genFeature.getImportedType()%>)eVirtualGet(<%=genFeature.getUpperName()%>);
+ <%}%>
+ if (new<%=genFeature.getCapName()%> != <%=genFeature.getSafeName()%>)
+ {
+ ChangeContext changeContext = null;
+ if (<%=genFeature.getSafeName()%> != null)
+ <%if (!genFeature.isBidirectional()) {%>
+ changeContext = inverseRemove(<%=genFeature.getSafeName()%>, this, OPPOSITE_FEATURE_BASE - <%=genFeature.getUpperName()%>, null, changeContext);
+ if (new<%=genFeature.getCapName()%> != null)
+ changeContext = inverseAdd(new<%=genFeature.getCapName()%>, this, OPPOSITE_FEATURE_BASE - <%=genFeature.getUpperName()%>, null, changeContext);
+ <%} else { GenFeature reverseFeature = genFeature.getReverse(); GenClass targetClass = reverseFeature.getGenClass();%>
+ changeContext = inverseRemove(<%=genFeature.getSafeName()%>, this, <%=targetClass.getQualifiedFeatureID(reverseFeature)%>, <%=targetClass.getImportedInterfaceName()%>.class, changeContext);
+ if (new<%=genFeature.getCapName()%> != null)
+ changeContext = inverseAdd(new<%=genFeature.getCapName()%>, this, <%=targetClass.getQualifiedFeatureID(reverseFeature)%>, <%=targetClass.getImportedInterfaceName()%>.class, changeContext);
+ <%}%>
+ changeContext = basicSet<%=genFeature.getAccessorName()%>(<%=genFeature.getInternalTypeCast()%>new<%=genFeature.getCapName()%>, changeContext);
+ if (changeContext != null) dispatch(changeContext);
+ }
+ <%if (genFeature.isUnsettable()) {%>
+ else
+ {
+ <%if (genModel.isVirtualDelegation()) {%>
+ boolean old<%=genFeature.getCapName()%>_set_ = eVirtualIsSet(<%=genFeature.getUpperName()%>);
+ <%} else if (genClass.isESetFlag(genFeature)) {%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ boolean old<%=genFeature.getCapName()%>_set_ = (<%=genClass.getESetFlagsField(genFeature)%> & <%=genFeature.getUpperName()%>_ESETFLAG) != 0;
+ <%}%>
+ <%=genClass.getESetFlagsField(genFeature)%> |= <%=genFeature.getUpperName()%>_ESETFLAG;
+ <%} else {%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ boolean old<%=genFeature.getCapName()%>_set_ = <%=genFeature.getUncapName()%>_set_;
+ <%}%>
+ <%=genFeature.getUncapName()%>_set_ = true;
+ <%}%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ if (isNotifying())
+ notify(ChangeKind.SET, <%=genFeature.getUpperName()%>, new<%=genFeature.getCapName()%>, new<%=genFeature.getCapName()%>, !old<%=genFeature.getCapName()%>_set_);
+ <%}%>
+ }
+ <%} else {%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ else if (isNotifying())
+ notify(ChangeKind.SET, <%=genFeature.getUpperName()%>, new<%=genFeature.getCapName()%>, new<%=genFeature.getCapName()%>);
+ <%}%>
+ <%}%>
+ <%} else {%>
+ <%if (genClass.isFlag(genFeature)) {%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ <%=genFeature.getImportedType()%> old<%=genFeature.getCapName()%> = (<%=genClass.getFlagsField(genFeature)%> & <%=genFeature.getUpperName()%>_EFLAG) != 0;
+ <%}%>
+ if (new<%=genFeature.getCapName()%>) <%=genClass.getFlagsField(genFeature)%> |= <%=genFeature.getUpperName()%>_EFLAG; else <%=genClass.getFlagsField(genFeature)%> &= ~<%=genFeature.getUpperName()%>_EFLAG;
+ <%} else {%>
+ <%if (!genModel.isVirtualDelegation() || genFeature.isPrimitiveType()) {%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ <%=genFeature.getImportedType()%> old<%=genFeature.getCapName()%> = <%=genFeature.getSafeName()%>;
+ <%}%>
+ <%}%>
+ <%if (genFeature.isEnumType()) {%>
+ <%if (genModel.isVirtualDelegation()) {%>
+ <%=genFeature.getImportedType()%> <%=genFeature.getSafeName()%> = new<%=genFeature.getCapName()%> == null ? <%=genFeature.getUpperName()%>_DEFAULT_ : new<%=genFeature.getCapName()%>;
+ <%} else {%>
+ <%=genFeature.getSafeName()%> = new<%=genFeature.getCapName()%> == null ? <%=genFeature.getUpperName()%>_DEFAULT_ : new<%=genFeature.getCapName()%>;
+ <%}%>
+ <%} else {%>
+ <%if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {%>
+ <%=genFeature.getImportedType()%> <%=genFeature.getSafeName()%> = <%=genFeature.getInternalTypeCast()%>new<%=genFeature.getCapName()%>;
+ <%} else {%>
+ <%=genFeature.getSafeName()%> = <%=genFeature.getInternalTypeCast()%>new<%=genFeature.getCapName()%>;
+ <%}%>
+ <%}%>
+ <%if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {%>
+ Object old<%=genFeature.getCapName()%> = eVirtualSet(<%=genFeature.getUpperName()%>, <%=genFeature.getSafeName()%>);
+ <%}%>
+ <%}%>
+ <%if (genFeature.isUnsettable()) {%>
+ <%if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {%>
+ boolean isSetChange = old<%=genFeature.getCapName()%> == EVIRTUAL_NO_VALUE;
+ <%} else if (genClass.isESetFlag(genFeature)) {%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ boolean old<%=genFeature.getCapName()%>_set_ = (<%=genClass.getESetFlagsField(genFeature)%> & <%=genFeature.getUpperName()%>_ESETFLAG) != 0;
+ <%}%>
+ <%=genClass.getESetFlagsField(genFeature)%> |= <%=genFeature.getUpperName()%>_ESETFLAG;
+ <%} else {%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ boolean old<%=genFeature.getCapName()%>_set_ = <%=genFeature.getUncapName()%>_set_;
+ <%}%>
+ <%=genFeature.getUncapName()%>_set_ = true;
+ <%}%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ if (isNotifying())
+ notify(ChangeKind.SET, <%=genFeature.getUpperName()%>, <%if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {%>isSetChange ? <%if (genFeature.isReferenceType()) {%>null<%} else {%><%=genFeature.getUpperName()%>_DEFAULT_<%}%> : old<%=genFeature.getCapName()%><%} else {%>old<%=genFeature.getCapName()%><%}%>, <%if (genClass.isFlag(genFeature)) {%>new<%=genFeature.getCapName()%><%} else {%><%=genFeature.getSafeName()%><%}%>, <%if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {%>isSetChange<%} else {%>!old<%=genFeature.getCapName()%>_set_<%}%>);
+ <%}%>
+ <%} else {%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ if (isNotifying())
+ notify(ChangeKind.SET, <%=genFeature.getUpperName()%>, <%if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {%>old<%=genFeature.getCapName()%> == EVIRTUAL_NO_VALUE ? <%if (genFeature.isReferenceType()) {%>null<%} else {%><%=genFeature.getUpperName()%>_DEFAULT_<%}%> : old<%=genFeature.getCapName()%><%} else {%>old<%=genFeature.getCapName()%><%}%>, <%if (genClass.isFlag(genFeature)) {%>new<%=genFeature.getCapName()%><%} else {%><%=genFeature.getSafeName()%><%}%>);
+ <%}%>
+ <%}%>
+ <%}%>
+<%@ include file="Class/setGenFeature.post.insert.javajetinc" fail="silent" %>
+ <%} else if (genFeature.hasDelegateFeature()) { GenFeature delegateFeature = genFeature.getDelegateFeature();%>
+ <%if (delegateFeature.isWrappedFeatureMapType()) {%>
+ set(get<%=delegateFeature.getAccessorName()%>(), getType(), <%=genFeature.getUpperName()%>, <%if (genFeature.isPrimitiveType()){%> new <%=genFeature.getObjectType()%>(<%}%>new<%=genFeature.getCapName()%><%if (genFeature.isPrimitiveType()){%>)<%}%>);
+ <%} else {%>
+ ((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")%>.Internal)get<%=delegateFeature.getAccessorName()%>()).set(<%=genFeature.getQualifiedFeatureAccessor()%>, <%if (genFeature.isPrimitiveType()) {%>new <%=genFeature.getObjectType()%>(<%}%>new<%=genFeature.getCapName()%><%if (genFeature.isPrimitiveType()){%>)<%}%>);
+ <%}%>
+ <%} else {%>
+<%@ include file="Class/setGenFeature.TODO.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ // TODO: implement this method to set the '<%=genFeature.getFormattedName()%>' <%=genFeature.getFeatureKind()%>
+ // Ensure that you remove @generated or mark it @generated NOT
+ throw new UnsupportedOperationException();
+<%@ end %><%//Class/setGenFeature.todo.override.javajetinc%>
+ <%}%>
+ }
+
+<%}%>
+<%@ end %><%//Class/setGenFeature.override.javajetinc%>
+ <%}%>
+ <%if (isImplementation && !genModel.isReflectiveDelegation() && genFeature.isBasicUnset()) {%>
+<%@ include file="Class/basicUnsetGenFeature.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeContext basicUnset<%=genFeature.getAccessorName()%>(ChangeContext changeContext)
+ {
+ <%if (!genFeature.isVolatile()) {%>
+ <%if (genModel.isVirtualDelegation()) {%>
+ Object old<%=genFeature.getCapName()%> = eVirtualUnset(<%=genFeature.getUpperName()%>);
+ <%} else {%>
+ <%=genFeature.getImportedType()%> old<%=genFeature.getCapName()%> = <%=genFeature.getSafeName()%>;
+ <%=genFeature.getSafeName()%> = null;
+ <%}%>
+ <%if (genModel.isVirtualDelegation()) {%>
+ boolean isSetChange = old<%=genFeature.getCapName()%> != EVIRTUAL_NO_VALUE;
+ <%} else if (genClass.isESetFlag(genFeature)) {%>
+ boolean old<%=genFeature.getCapName()%>_set_ = (<%=genClass.getESetFlagsField(genFeature)%> & <%=genFeature.getUpperName()%>_ESETFLAG) != 0;
+ <%=genClass.getESetFlagsField(genFeature)%> &= ~<%=genFeature.getUpperName()%>_ESETFLAG;
+ <%} else {%>
+ boolean old<%=genFeature.getCapName()%>_set_ = <%=genFeature.getUncapName()%>_set_;
+ <%=genFeature.getUncapName()%>_set_ = false;
+ <%}%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ if (isNotifying())
+ {
+ <%=genModel.getImportedName("org.eclipse.emf.ecore.impl.ENotificationImpl")%> notification = new <%=genModel.getImportedName("org.eclipse.emf.ecore.impl.ENotificationImpl")%>(this, <%=genModel.getImportedName("org.eclipse.emf.common.notify.Notification")%>.UNSET, <%=genFeature.getUpperName()%>, <%if (genModel.isVirtualDelegation()) {%>isSetChange ? old<%=genFeature.getCapName()%> : null<%} else {%>old<%=genFeature.getCapName()%><%}%>, null, <%if (genModel.isVirtualDelegation()) {%>isSetChange<%} else {%>old<%=genFeature.getCapName()%>_set_<%}%>);
+ if (changeContext == null) changeContext = notification; else changeContext.add(notification);
+ }
+ return changeContext;
+ <%}%>
+ <%} else {%>
+<%@ include file="Class/basicUnsetGenFeature.TODO.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ // TODO: implement this method to unset the contained '<%=genFeature.getFormattedName()%>' <%=genFeature.getFeatureKind()%>
+ // -> this method is automatically invoked to keep the containment relationship in synch
+ // -> do not modify other features
+ // -> return changeContext, after adding any generated Notification to it (if it is null, a NotificationChain object must be created first)
+ // Ensure that you remove @generated or mark it @generated NOT
+ throw new UnsupportedOperationException();
+<%@ end %><%//Class/basicUnsetGenFeature.todo.override.javajetinc%>
+ <%}%>
+ }
+
+<%@ end %><%//Class.basicUnsetGenFeature.override.javajetinc%>
+ <%}%>
+ <%if (genFeature.isUnset() && (isImplementation || !genFeature.isSuppressedUnsetVisibility())) {%>
+<%@ include file="Class/unsetGenFeature.override.javajetinc" fail="alternative" %>
+<%@ start %>
+<%if (isInterface) {%>
+ /**
+ * Unsets the value of the '{@link <%=genClass.getQualifiedInterfaceName()%>#<%=genFeature.getGetAccessor()%> <em><%=genFeature.getFormattedName()%></em>}' <%=genFeature.getFeatureKind()%>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ <%if (!genFeature.isSuppressedIsSetVisibility()) {%>
+ * @see #isSet<%=genFeature.getAccessorName()%>()
+ <%}%>
+ * @see #<%=genFeature.getGetAccessor()%>()
+ <%if (!genFeature.isListType() && !genFeature.isSuppressedSetVisibility()) {%>
+ * @see #set<%=genFeature.getAccessorName()%>(<%=genFeature.getImportedType()%>)
+ <%}%>
+ * @generated
+ */
+<%} else {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+<%}%>
+<%if (!isImplementation) {%>
+ void unset<%=genFeature.getAccessorName()%>();
+
+<%} else {%>
+ public void unset<%=genFeature.getAccessorName()%>()
+ {
+ <%if (genModel.isReflectiveDelegation()) {%>
+ unset(<%=genFeature.getQualifiedFeatureAccessor()%>);
+ <%} else if (!genFeature.isVolatile()) {%>
+ <%if (genFeature.isListType()) {%>
+ ((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.InternalEList")%>.Unsettable)get<%=genFeature.getAccessorName()%>()).unset();
+ <%} else if (genFeature.isBidirectional() || genFeature.isEffectiveContains()) {%>
+ <%if (genModel.isVirtualDelegation()) {%>
+ <%=genFeature.getImportedType()%> <%=genFeature.getSafeName()%> = (<%=genFeature.getImportedType()%>)eVirtualGet(<%=genFeature.getUpperName()%>);
+ <%}%>
+ if (<%=genFeature.getSafeName()%> != null)
+ {
+ ChangeContext changeContext = null;
+ <%if (!genFeature.isBidirectional()) {%>
+ changeContext = ((<%=genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject")%>)<%=genFeature.getSafeName()%>).inverseRemove(this, EOPPOSITE_FEATURE_BASE - <%=genFeature.getUpperName()%>, null, changeContext);
+ <%} else { GenFeature reverseFeature = genFeature.getReverse(); GenClass targetClass = reverseFeature.getGenClass();%>
+ changeContext = ((<%=genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject")%>)<%=genFeature.getSafeName()%>).inverseRemove(this, <%=targetClass.getQualifiedFeatureID(reverseFeature)%>, <%=targetClass.getImportedInterfaceName()%>.class, changeContext);
+ <%}%>
+ changeContext = basicUnset<%=genFeature.getAccessorName()%>(changeContext);
+ if (changeContext != null) dispatch(changeContext);
+ }
+ else
+ {
+ <%if (genModel.isVirtualDelegation()) {%>
+ boolean old<%=genFeature.getCapName()%>_set_ = eVirtualIsSet(<%=genFeature.getUpperName()%>);
+ <%} else if (genClass.isESetFlag(genFeature)) {%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ boolean old<%=genFeature.getCapName()%>_set_ = (<%=genClass.getESetFlagsField(genFeature)%> & <%=genFeature.getUpperName()%>_ESETFLAG) != 0;
+ <%}%>
+ <%=genClass.getESetFlagsField(genFeature)%> &= ~<%=genFeature.getUpperName()%>_ESETFLAG;
+ <%} else {%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ boolean old<%=genFeature.getCapName()%>_set_ = <%=genFeature.getUncapName()%>_set_;
+ <%}%>
+ <%=genFeature.getUncapName()%>_set_ = false;
+ <%}%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ if (isNotifying())
+ notify(ChangeKind.UNSET, <%=genFeature.getUpperName()%>, null, null, old<%=genFeature.getCapName()%>_set_);
+ <%}%>
+ }
+ <%} else {%>
+ <%if (genClass.isFlag(genFeature)) {%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ <%=genFeature.getImportedType()%> old<%=genFeature.getCapName()%> = (<%=genClass.getFlagsField(genFeature)%> & <%=genFeature.getUpperName()%>_EFLAG) != 0;
+ <%}%>
+ <%} else if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {%>
+ Object old<%=genFeature.getCapName()%> = eVirtualUnset(<%=genFeature.getUpperName()%>);
+ <%} else {%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ <%=genFeature.getImportedType()%> old<%=genFeature.getCapName()%> = <%=genFeature.getSafeName()%>;
+ <%}%>
+ <%}%>
+ <%if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {%>
+ boolean isSetChange = old<%=genFeature.getCapName()%> != EVIRTUAL_NO_VALUE;
+ <%} else if (genClass.isESetFlag(genFeature)) {%>
+ boolean old<%=genFeature.getCapName()%>_set_ = (<%=genClass.getESetFlagsField(genFeature)%> & <%=genFeature.getUpperName()%>_ESETFLAG) != 0;
+ <%} else {%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ boolean old<%=genFeature.getCapName()%>_set_ = <%=genFeature.getUncapName()%>_set_;
+ <%}%>
+ <%}%>
+ <%if (genFeature.isReferenceType()) {%>
+ <%=genFeature.getSafeName()%> = null;
+ <%if (!genModel.isVirtualDelegation()) {%>
+ <%if (genClass.isESetFlag(genFeature)) {%>
+ <%=genClass.getESetFlagsField(genFeature)%> &= ~<%=genFeature.getUpperName()%>_ESETFLAG;
+ <%} else {%>
+ <%=genFeature.getUncapName()%>_set_ = false;
+ <%}%>
+ <%}%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ if (isNotifying())
+ notify(ChangeKind.UNSET, <%=genFeature.getUpperName()%>, <%if (genModel.isVirtualDelegation()) {%>isSetChange ? old<%=genFeature.getCapName()%> : null<%} else {%>old<%=genFeature.getCapName()%><%}%>, null, <%if (genModel.isVirtualDelegation()) {%>isSetChange<%} else {%>old<%=genFeature.getCapName()%>_set_<%}%>);
+ <%}%>
+ <%} else {%>
+ <%if (genClass.isFlag(genFeature)) {%>
+ if (<%=genFeature.getUpperName()%>_DEFAULT_) <%=genClass.getFlagsField(genFeature)%> |= <%=genFeature.getUpperName()%>_EFLAG; else <%=genClass.getFlagsField(genFeature)%> &= ~<%=genFeature.getUpperName()%>_EFLAG;
+ <%} else if (!genModel.isVirtualDelegation() || genFeature.isPrimitiveType()) {%>
+ <%=genFeature.getSafeName()%> = <%=genFeature.getUpperName()%>_DEFAULT_;
+ <%}%>
+ <%if (!genModel.isVirtualDelegation() || genFeature.isPrimitiveType()) {%>
+ <%if (genClass.isESetFlag(genFeature)) {%>
+ <%=genClass.getESetFlagsField(genFeature)%> &= ~<%=genFeature.getUpperName()%>_ESETFLAG;
+ <%} else {%>
+ <%=genFeature.getUncapName()%>_set_ = false;
+ <%}%>
+ <%}%>
+ <%if (!genModel.isSuppressNotification()) {%>
+ if (isNotifying())
+ notify(ChangeKind.UNSET, <%=genFeature.getUpperName()%>, <%if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {%>isSetChange ? old<%=genFeature.getCapName()%> : <%=genFeature.getUpperName()%>_DEFAULT_<%} else {%>old<%=genFeature.getCapName()%><%}%>, <%=genFeature.getUpperName()%>_DEFAULT_, <%if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {%>isSetChange<%} else {%>old<%=genFeature.getCapName()%>_set_<%}%>);
+ <%}%>
+ <%}%>
+ <%}%>
+ <%} else if (genFeature.hasDelegateFeature()) { GenFeature delegateFeature = genFeature.getDelegateFeature();%>
+ <%if (delegateFeature.isWrappedFeatureMapType()) {%>
+ unset(get<%=delegateFeature.getAccessorName()%>(), getType(), <%=genFeature.getUpperName()%>);
+ <%} else {%>
+ unset<%=genFeature.getImportedType()%>(get<%=delegateFeature.getAccessorName()%>());
+ <%}%>
+ <%} else {%>
+<%@ include file="Class/unsetGenFeature.TODO.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ // TODO: implement this method to unset the '<%=genFeature.getFormattedName()%>' <%=genFeature.getFeatureKind()%>
+ // Ensure that you remove @generated or mark it @generated NOT
+ throw new UnsupportedOperationException();
+<%@ end %><%//Class/unsetGenFeature.todo.override.javajetinc%>
+ <%}%>
+ }
+
+<%}%>
+<%@ end %><%//Class/unsetGenFeature.override.javajetinc%>
+ <%}%>
+ <%if (genFeature.isIsSet() && (isImplementation || !genFeature.isSuppressedIsSetVisibility())) {%>
+<%@ include file="Class/isSetGenFeature.override.javajetinc" fail="alternative" %>
+<%@ start %>
+<%if (isInterface) {%>
+ /**
+ * Returns whether the value of the '{@link <%=genClass.getQualifiedInterfaceName()%>#<%=genFeature.getGetAccessor()%> <em><%=genFeature.getFormattedName()%></em>}' <%=genFeature.getFeatureKind()%> is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em><%=genFeature.getFormattedName()%></em>' <%=genFeature.getFeatureKind()%> is set.
+ <%if (genFeature.isChangeable() && !genFeature.isSuppressedUnsetVisibility()) {%>
+ * @see #unset<%=genFeature.getAccessorName()%>()
+ <%}%>
+ * @see #<%=genFeature.getGetAccessor()%>()
+ <%if (!genFeature.isListType() && genFeature.isChangeable() && !genFeature.isSuppressedSetVisibility()) {%>
+ * @see #set<%=genFeature.getAccessorName()%>(<%=genFeature.getImportedType()%>)
+ <%}%>
+ * @generated
+ */
+<%} else {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+<%}%>
+<%if (!isImplementation) {%>
+ boolean isSet<%=genFeature.getAccessorName()%>();
+
+<%} else {%>
+ public boolean isSet<%=genFeature.getAccessorName()%>()
+ {
+ <%if (genModel.isReflectiveDelegation()) {%>
+ return isSet(<%=genFeature.getQualifiedFeatureAccessor()%>);
+ <%} else if (!genFeature.isVolatile()) {%>
+ <%if (genFeature.isListType()) {%>
+ <%if (genModel.isVirtualDelegation()) {%>
+ <%=genFeature.getImportedType()%> <%=genFeature.getSafeName()%> = (<%=genFeature.getImportedType()%>)eVirtualGet(<%=genFeature.getUpperName()%>);
+ <%}%>
+ return <%=genFeature.getSafeName()%> != null && ((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.InternalEList")%>.Unsettable)<%=genFeature.getSafeName()%>).isSet();
+ <%} else {%>
+ <%if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {%>
+ return eVirtualIsSet(<%=genFeature.getUpperName()%>);
+ <%} else if (genClass.isESetFlag(genFeature)) {%>
+ return (<%=genClass.getESetFlagsField(genFeature)%> & <%=genFeature.getUpperName()%>_ESETFLAG) != 0;
+ <%} else {%>
+ return <%=genFeature.getUncapName()%>_set_;
+ <%}%>
+ <%}%>
+ <%} else if (genFeature.hasDelegateFeature()) { GenFeature delegateFeature = genFeature.getDelegateFeature();%>
+ <%if (delegateFeature.isWrappedFeatureMapType()) {%>
+ return isSet(get<%=delegateFeature.getAccessorName()%>(), getType(), <%=genFeature.getUpperName()%>);
+ <%} else {%>
+ return !((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")%>.Internal)get<%=delegateFeature.getAccessorName()%>()).isEmpty(<%=genFeature.getQualifiedFeatureAccessor()%>);
+ <%}%>
+ <%} else {%>
+<%@ include file="Class/isSetGenFeature.TODO.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ // TODO: implement this method to return whether the '<%=genFeature.getFormattedName()%>' <%=genFeature.getFeatureKind()%> is set
+ // Ensure that you remove @generated or mark it @generated NOT
+ throw new UnsupportedOperationException();
+<%@ end %><%//Class/isSetGenFeature.todo.override.javajetinc%>
+ <%}%>
+ }
+
+<%}%>
+<%@ end %><%//Class/isSetGenFeature.override.javajetinc%>
+ <%}%>
+<%@ include file="Class/genFeature.insert.javajetinc" fail="silent" %>
+<%@ end %><%//Class/genFeature.override.javajetinc%>
+<%}//for%>
+<%for (Iterator i= (isImplementation ? genClass.getImplementedGenOperations() : genClass.getDeclaredGenOperations()).iterator(); i.hasNext();) { GenOperation genOperation = (GenOperation)i.next();%>
+<%@ include file="Class/genOperation.override.javajetinc" fail="alternative" %>
+<%@ start %>
+<%if (isInterface) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ <%if (genOperation.hasDocumentation()) {%>
+ * <!-- begin-model-doc -->
+ * <%=genOperation.getDocumentation(genModel.getIndentation(stringBuffer))%>
+ * <!-- end-model-doc -->
+ <%}%>
+ <%if (!genModel.isSuppressEMFModelTags()) { boolean first = true; for (StringTokenizer stringTokenizer = new StringTokenizer(genOperation.getModelInfo(), "\n\r"); stringTokenizer.hasMoreTokens(); ) { String modelInfo = stringTokenizer.nextToken(); if (first) { first = false;%>
+ * @model <%=modelInfo%>
+ <%} else {%>
+ * <%=modelInfo%>
+ <%}} if (first) {%>
+ * @model
+ <%}}%>
+ * @generated
+ */
+<%} else {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+<%}%>
+<%if (!isImplementation) {%>
+ <%=genOperation.getImportedType()%> <%=genOperation.getName()%>(<%=genOperation.getParameters()%>)<%=genOperation.getThrows()%>;
+
+<%} else {%>
+ public <%=genOperation.getImportedType()%> <%=genOperation.getName()%>(<%=genOperation.getParameters()%>)<%=genOperation.getThrows()%>
+ {
+ <%if (genOperation.hasBody()) {%>
+ <%=genOperation.getBody(genModel.getIndentation(stringBuffer))%>
+ <%} else if (genOperation.isInvariant()) {GenClass opClass = genOperation.getGenClass(); String diagnostics = ((GenParameter)genOperation.getGenParameters().get(0)).getName(); String context = ((GenParameter)genOperation.getGenParameters().get(1)).getName();%>
+ // TODO: implement this method
+ // -> specify the condition that violates the invariant
+ // -> verify the details of the diagnostic, including severity and message
+ // Ensure that you remove @generated or mark it @generated NOT
+ if (false)
+ {
+ if (<%=diagnostics%> != null)
+ {
+ <%=diagnostics%>.add
+ (new <%=genModel.getImportedName("org.eclipse.emf.common.util.BasicDiagnostic")%>
+ (<%=genModel.getImportedName("org.eclipse.emf.common.util.Diagnostic")%>.ERROR,
+ <%=opClass.getGenPackage().getImportedValidatorClassName()%>.DIAGNOSTIC_SOURCE,
+ <%=opClass.getGenPackage().getImportedValidatorClassName()%>.<%=opClass.getOperationID(genOperation)%>,
+ <%=genModel.getImportedName("org.eclipse.emf.ecore.plugin.EcorePlugin")%>.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "<%=genOperation.getName()%>", <%=genModel.getImportedName("org.eclipse.emf.ecore.util.EObjectValidator")%>.getObjectLabel(this, <%=context%>) }),<%=genModel.getNonNLS()%><%=genModel.getNonNLS(2)%>
+ new Object [] { this }));
+ }
+ return false;
+ }
+ return true;
+ <%} else {%>
+<%@ include file="Class/implementedGenOperation.TODO.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ // TODO: implement this method
+ // Ensure that you remove @generated or mark it @generated NOT
+ throw new UnsupportedOperationException();
+<%@ end %><%//Class/implementedGenOperation.todo.override.javajetinc%>
+ <%}%>
+ }
+
+<%}%>
+<%@ include file="Class/genOperation.insert.javajetinc" fail="silent" %>
+<%@ end %><%//Class/implementedGenOperation.override.javajetinc%>
+<%}//for%>
+<%if (isImplementation && !genModel.isReflectiveDelegation() && genClass.implementsAny(genClass.getEInverseAddGenFeatures())) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeContext eInverseAdd(<%=genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject")%> otherEnd, int propertyIndex, ChangeContext changeContext)
+ {
+ switch (propertyIndex)
+ {
+<%for (Iterator i=genClass.getEInverseAddGenFeatures().iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();%>
+ <%if (!genModel.isMinimalReflectiveMethods() || genClass.getImplementedGenFeatures().contains(genFeature)) {%>
+ case <%=genFeature.getUpperName()%>:
+ <%if (genFeature.isListType()) {%>
+ <%if (genFeature.isMapType() && genFeature.isEffectiveSuppressEMFTypes()) {%>
+ return ((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.InternalEList")%>)((<%=genModel.getImportedName("org.eclipse.emf.common.util.EMap")%>.InternalMapView)<%=genFeature.getGetAccessor()%>()).eMap()).basicAdd(otherEnd, changeContext);
+ <%} else {%>
+ return ((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.InternalEList")%>)<%=genFeature.getGetAccessor()%>()).basicAdd(otherEnd, changeContext);
+ <%}%>
+ <%} else if (genFeature.isContainer()) {%>
+ if (eInternalContainer() != null)
+ changeContext = eBasicRemoveFromContainer(changeContext);
+ return eBasicSetContainer(otherEnd, <%=genFeature.getUpperName()%>, changeContext);
+ <%} else {%>
+ <%if (genClass.getImplementingGenModel(genFeature).isVirtualDelegation()) {%>
+ <%=genFeature.getImportedType()%> <%=genFeature.getSafeName()%> = (<%=genFeature.getImportedType()%>)eVirtualGet(<%=genFeature.getUpperName()%>);
+ <%}%>
+ if (<%=genFeature.getSafeName()%> != null)
+ <%if (genFeature.isEffectiveContains()) {%>
+ changeContext = ((<%=genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject")%>)<%=genFeature.getSafeName()%>).inverseRemove(this, EOPPOSITE_FEATURE_BASE - <%=genFeature.getUpperName()%>, null, changeContext);
+ <%} else { GenFeature reverseFeature = genFeature.getReverse(); GenClass targetClass = reverseFeature.getGenClass();%>
+ changeContext = ((<%=genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject")%>)<%=genFeature.getSafeName()%>).inverseRemove(this, <%=targetClass.getQualifiedFeatureID(reverseFeature)%>, <%=targetClass.getImportedInterfaceName()%>.class, changeContext);
+ <%}%>
+ return basicSet<%=genFeature.getAccessorName()%>((<%=genFeature.getImportedType()%>)otherEnd, changeContext);
+ <%}%>
+ <%}%>
+<%}%>
+ }
+<%if (genModel.isMinimalReflectiveMethods()) {%>
+ return super.eInverseAdd(otherEnd, propertyIndex, changeContext);
+<%} else {%>
+ return eDynamicInverseAdd(otherEnd, propertyIndex, changeContext);
+<%}%>
+ }
+
+<%}%>
+<%if (isImplementation && !genModel.isReflectiveDelegation() && genClass.implementsAny(genClass.getEInverseRemoveGenFeatures())) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeContext inverseRemove(<%=genModel.getImportedName("java.lang.Object")%> otherEnd, int propertyIndex, ChangeContext changeContext)
+ {
+ switch (propertyIndex)
+ {
+<%for (Iterator i=genClass.getEInverseRemoveGenFeatures().iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();%>
+ <%if (!genModel.isMinimalReflectiveMethods() || genClass.getImplementedGenFeatures().contains(genFeature)) {%>
+ case <%=genFeature.getUpperName()%>:
+ <%if (genFeature.isListType()) {%>
+ <%if (genFeature.isMapType() && genFeature.isEffectiveSuppressEMFTypes()) {%>
+ return ((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.InternalEList")%>)((<%=genModel.getImportedName("org.eclipse.emf.common.util.EMap")%>.InternalMapView)<%=genFeature.getGetAccessor()%>()).eMap()).basicRemove(otherEnd, changeContext);
+ <%} else if (genFeature.isWrappedFeatureMapType()) {%>
+ return removeFrom<%=genFeature.getImportedType()%>(<%=genFeature.getGetAccessor()%>(), otherEnd, changeContext);
+ <%} else {%>
+ return removeFromList(<%=genFeature.getGetAccessor()%>(), otherEnd, changeContext);
+ <%}%>
+ <%} else if (genFeature.isContainer()) {%>
+ return eBasicSetContainer(null, <%=genFeature.getUpperName()%>, changeContext);
+ <%} else if (genFeature.isUnsettable()) {%>
+ return basicUnset<%=genFeature.getAccessorName()%>(changeContext);
+ <%} else {%>
+ return basicSet<%=genFeature.getAccessorName()%>(null, changeContext);
+ <%}%>
+ <%}%>
+<%}%>
+ }
+<%if (genModel.isMinimalReflectiveMethods()) {%>
+ return super.inverseRemove(otherEnd, propertyIndex, changeContext);
+<%} else {%>
+ return eDynamicInverseRemove(otherEnd, propertyIndex, changeContext);
+<%}%>
+ }
+
+<%}%>
+<%if (isImplementation && !genModel.isReflectiveDelegation() && genClass.implementsAny(genClass.getEBasicRemoveFromContainerGenFeatures())) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeContext eBasicRemoveFromContainerFeature(ChangeContext changeContext)
+ {
+ switch (eContainerFeatureID)
+ {
+<%for (Iterator i=genClass.getEBasicRemoveFromContainerGenFeatures().iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();%>
+ <%GenFeature reverseFeature = genFeature.getReverse(); GenClass targetClass = reverseFeature.getGenClass();%>
+ <%if (!genModel.isMinimalReflectiveMethods() || genClass.getImplementedGenFeatures().contains(genFeature)) {%>
+ case <%=genFeature.getUpperName()%>:
+ return eInternalContainer().inverseRemove(this, <%=targetClass.getQualifiedFeatureID(reverseFeature)%>, <%=targetClass.getImportedInterfaceName()%>.class, changeContext);
+ <%}%>
+<%}%>
+ }
+<%if (genModel.isMinimalReflectiveMethods()) {%>
+ return super.eBasicRemoveFromContainerFeature(changeContext);
+<%} else {%>
+ return eDynamicBasicRemoveFromContainer(changeContext);
+<%}%>
+ }
+
+<%}%>
+<%if (isImplementation && !genModel.isReflectiveDelegation() && !genClass.getImplementedGenFeatures().isEmpty()) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object get(int propertyIndex, boolean resolve)
+ {
+ switch (propertyIndex)
+ {
+<%for (Iterator i=genClass.getAllGenFeatures().iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();%>
+ <%if (!genModel.isMinimalReflectiveMethods() || genClass.getImplementedGenFeatures().contains(genFeature)) {%>
+ case <%=genFeature.getUpperName()%>:
+ <%if (genFeature.isPrimitiveType()) {%>
+ <%if (genFeature.isBooleanType()) {%>
+ return <%=genFeature.getGetAccessor()%>() ? Boolean.TRUE : Boolean.FALSE;
+ <%} else {%>
+ return new <%=genFeature.getObjectType()%>(<%=genFeature.getGetAccessor()%>());
+ <%}%>
+ <%} else if (genFeature.isResolveProxies() && !genFeature.isListType()) {%>
+ if (resolve) return <%=genFeature.getGetAccessor()%>();
+ return basicGet<%=genFeature.getAccessorName()%>();
+ <%} else if (genFeature.isMapType()) {%>
+ <%if (genFeature.isEffectiveSuppressEMFTypes()) {%>
+ if (coreType) return ((<%=genModel.getImportedName("org.eclipse.emf.common.util.EMap")%>.InternalMapView)<%=genFeature.getGetAccessor()%>()).eMap();
+ else return <%=genFeature.getGetAccessor()%>();
+ <%} else {%>
+ if (coreType) return <%=genFeature.getGetAccessor()%>();
+ else return <%=genFeature.getGetAccessor()%>().map();
+ <%}%>
+ <%} else if (genFeature.isWrappedFeatureMapType()) {%>
+ // XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view
+ //if (coreType)
+ return <%=genFeature.getGetAccessor()%>();
+ <%} else if (genFeature.isFeatureMapType()) {%>
+ if (coreType) return <%=genFeature.getGetAccessor()%>();
+ return ((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")%>.Internal)<%=genFeature.getGetAccessor()%>()).getWrapper();
+ <%} else {%>
+ return <%=genFeature.getGetAccessor()%>();
+ <%}%>
+ <%}%>
+<%}%>
+ }
+<%if (genModel.isMinimalReflectiveMethods()) {%>
+ return super.get(propertyIndex, resolve);
+<%} else {%>
+ return eDynamicGet(propertyIndex, resolve, coreType);
+<%}%>
+ }
+
+<%}%>
+<%if (isImplementation && !genModel.isReflectiveDelegation() && genClass.implementsAny(genClass.getESetGenFeatures())) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void set(int propertyIndex, Object newValue)
+ {
+ switch (propertyIndex)
+ {
+<%for (Iterator i=genClass.getESetGenFeatures().iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();%>
+ <%if (!genModel.isMinimalReflectiveMethods() || genClass.getImplementedGenFeatures().contains(genFeature)) {%>
+ case <%=genFeature.getUpperName()%>:
+ <%if (genFeature.isListType()) {%>
+ <%if (genFeature.isWrappedFeatureMapType()) {%>
+ set<%=genFeature.getImportedType()%>(<%=genFeature.getGetAccessor()%>(), newValue);
+ <%} else if (genFeature.isFeatureMapType()) {%>
+ ((<%=genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")%>.Internal)<%=genFeature.getGetAccessor()%>()).set(newValue);
+ <%} else if (genFeature.isMapType()) {%>
+ <%if (genFeature.isEffectiveSuppressEMFTypes()) {%>
+ ((<%=genModel.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")%>.Setting)((<%=genModel.getImportedName("org.eclipse.emf.common.util.EMap")%>.InternalMapView)<%=genFeature.getGetAccessor()%>()).eMap()).set(newValue);
+ <%} else {%>
+ ((<%=genModel.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")%>.Setting)<%=genFeature.getGetAccessor()%>()).set(newValue);
+ <%}%>
+ <%} else {%>
+ <%=genFeature.getGetAccessor()%>().clear();
+ <%=genFeature.getGetAccessor()%>().addAll((<%=genModel.getImportedName("java.util.Collection")%>)newValue);
+ <%}%>
+ <%} else if (genFeature.isPrimitiveType()) {%>
+ set<%=genFeature.getAccessorName()%>(((<%=genFeature.getObjectType()%>)newValue).<%=genFeature.getPrimitiveValueFunction()%>());
+ <%} else {%>
+ set<%=genFeature.getAccessorName()%>((<%=genFeature.getImportedType()%>)newValue);
+ <%}%>
+ return;
+ <%}%>
+<%}%>
+ }
+<%if (genModel.isMinimalReflectiveMethods()) {%>
+ super.set(propertyIndex, newValue);
+<%} else {%>
+ eDynamicSet(propertyIndex, newValue);
+<%}%>
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unset(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+<%for (Iterator i=genClass.getESetGenFeatures().iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();%>
+ <%if (!genModel.isMinimalReflectiveMethods() || genClass.getImplementedGenFeatures().contains(genFeature)) {%>
+ case <%=genFeature.getUpperName()%>:
+ <%if (genFeature.isListType() && !genFeature.isUnsettable()) {%>
+ <%if (genFeature.isWrappedFeatureMapType()) {%>
+ unset<%=genFeature.getImportedType()%>(<%=genFeature.getGetAccessor()%>());
+ <%} else {%>
+ <%=genFeature.getGetAccessor()%>().clear();
+ <%}%>
+ <%} else if (genFeature.isUnsettable()) {%>
+ unset<%=genFeature.getAccessorName()%>();
+ <%} else if (genFeature.isReferenceType()) {%>
+ set<%=genFeature.getAccessorName()%>((<%=genFeature.getImportedType()%>)null);
+ <%} else {%>
+ set<%=genFeature.getAccessorName()%>(<%=genFeature.getUpperName()%>_DEFAULT_);
+ <%}%>
+ return;
+ <%}%>
+<%}%>
+ }
+<%if (genModel.isMinimalReflectiveMethods()) {%>
+ super.unset(propertyIndex);
+<%} else {%>
+ eDynamicUnset(propertyIndex);
+<%}%>
+ }
+
+<%}%>
+<%if (isImplementation && !genModel.isReflectiveDelegation() && !genClass.getImplementedGenFeatures().isEmpty()) {%>
+<%@ include file="Class/eIsSet.override.javajetinc" fail="alternative" %>
+<%@ start %>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSet(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+<%for (Iterator i=genClass.getAllGenFeatures().iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next();%>
+ <%if (!genModel.isMinimalReflectiveMethods() || genClass.getImplementedGenFeatures().contains(genFeature)) {%>
+ case <%=genFeature.getUpperName()%>:
+ <%if (genFeature.isListType() && !genFeature.isUnsettable()) {%>
+ <%if (genFeature.isWrappedFeatureMapType()) {%>
+ <%if (genFeature.isVolatile()) {%>
+ return !is<%=genFeature.getImportedType()%>Empty(<%=genFeature.getGetAccessor()%>());
+ <%} else {%>
+ return <%=genFeature.getSafeName()%> != null && !is<%=genFeature.getImportedType()%>Empty(<%=genFeature.getGetAccessor()%>());
+ <%}%>
+ <%} else {%>
+ <%if (genClass.isField(genFeature)) {%>
+ return <%=genFeature.getSafeName()%> != null && !<%=genFeature.getSafeName()%>.isEmpty();
+ <%} else {%>
+ <%if (genFeature.isField() && genClass.getImplementingGenModel(genFeature).isVirtualDelegation()) {%>
+ <%=genFeature.getImportedType()%> <%=genFeature.getSafeName()%> = (<%=genFeature.getImportedType()%>)eVirtualGet(<%=genFeature.getUpperName()%>);
+ return <%=genFeature.getSafeName()%> != null && !<%=genFeature.getSafeName()%>.isEmpty();
+ <%} else {%>
+ return !<%=genFeature.getGetAccessor()%>().isEmpty();
+ <%}%>
+ <%}%>
+ <%}%>
+ <%} else if (genFeature.isUnsettable()) {%>
+ return isSet<%=genFeature.getAccessorName()%>();
+ <%} else if (genFeature.isResolveProxies()) {%>
+ <%if (genClass.isField(genFeature)) {%>
+ return <%=genFeature.getSafeName()%> != null;
+ <%} else {%>
+ <%if (genFeature.isField() && genClass.getImplementingGenModel(genFeature).isVirtualDelegation()) {%>
+ return eVirtualGet(<%=genFeature.getUpperName()%>) != null;
+ <%} else {%>
+ return basicGet<%=genFeature.getAccessorName()%>() != null;
+ <%}%>
+ <%}%>
+ <%} else if (genFeature.isReferenceType()) {%>
+ <%if (genClass.isField(genFeature)) {%>
+ return <%=genFeature.getSafeName()%> != null;
+ <%} else {%>
+ <%if (genFeature.isField() && genClass.getImplementingGenModel(genFeature).isVirtualDelegation()) {%>
+ return eVirtualGet(<%=genFeature.getUpperName()%>) != null;
+ <%} else {%>
+ return <%=genFeature.getGetAccessor()%>() != null;
+ <%}%>
+ <%}%>
+ <%} else if (genFeature.isPrimitiveType() || genFeature.isEnumType()) {%>
+ <%if (genClass.isField(genFeature)) {%>
+ <%if (genClass.isFlag(genFeature)) {%>
+ return ((<%=genClass.getFlagsField(genFeature)%> & <%=genFeature.getUpperName()%>_EFLAG) != 0) != <%=genFeature.getUpperName()%>_DEFAULT_;
+ <%} else {%>
+ return <%=genFeature.getSafeName()%> != <%=genFeature.getUpperName()%>_DEFAULT_;
+ <%}%>
+ <%} else {%>
+ <%if (genFeature.isEnumType() && genFeature.isField() && genClass.getImplementingGenModel(genFeature).isVirtualDelegation()) {%>
+ return eVirtualGet(<%=genFeature.getUpperName()%>, <%=genFeature.getUpperName()%>_DEFAULT_) != <%=genFeature.getUpperName()%>_DEFAULT_;
+ <%} else {%>
+ return <%=genFeature.getGetAccessor()%>() != <%=genFeature.getUpperName()%>_DEFAULT_;
+ <%}%>
+ <%}%>
+ <%} else {//datatype%>
+ <%if (genClass.isField(genFeature)) {%>
+ return <%=genFeature.getUpperName()%>_DEFAULT_ == null ? <%=genFeature.getSafeName()%> != null : !<%=genFeature.getUpperName()%>_DEFAULT_.equals(<%=genFeature.getSafeName()%>);
+ <%} else {%>
+ <%if (genFeature.isField() && genClass.getImplementingGenModel(genFeature).isVirtualDelegation()) {%>
+ <%=genFeature.getImportedType()%> <%=genFeature.getSafeName()%> = (<%=genFeature.getImportedType()%>)eVirtualGet(<%=genFeature.getUpperName()%>, <%=genFeature.getUpperName()%>_DEFAULT_);
+ return <%=genFeature.getUpperName()%>_DEFAULT_ == null ? <%=genFeature.getSafeName()%> != null : !<%=genFeature.getUpperName()%>_DEFAULT_.equals(<%=genFeature.getSafeName()%>);
+ <%} else {%>
+ return <%=genFeature.getUpperName()%>_DEFAULT_ == null ? <%=genFeature.getGetAccessor()%>() != null : !<%=genFeature.getUpperName()%>_DEFAULT_.equals(<%=genFeature.getGetAccessor()%>());
+ <%}%>
+ <%}%>
+ <%}%>
+ <%}%>
+<%}%>
+ }
+<%if (genModel.isMinimalReflectiveMethods()) {%>
+ return super.isSet(propertyIndex);
+<%} else {%>
+ return eDynamicIsSet(propertyIndex);
+<%}%>
+ }
+
+<%@ end %><%//Class/eIsSet.override.javajetinc%>
+<%}%>
+<%if (isImplementation && !genClass.getMixinGenFeatures().isEmpty()) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass)
+ {
+ <%for (Iterator m=genClass.getMixinGenClasses().iterator(); m.hasNext();) { GenClass mixinGenClass = (GenClass)m.next(); %>
+ if (baseClass == <%=mixinGenClass.getImportedInterfaceName()%>.class)
+ {
+ switch (derivedFeatureID)
+ {
+ <%for (Iterator f=mixinGenClass.getGenFeatures().iterator(); f.hasNext();) { GenFeature genFeature = (GenFeature)f.next(); %>
+ case <%=genFeature.getUpperName()%>: return <%=mixinGenClass.getQualifiedFeatureID(genFeature)%>;
+ <%}%>
+ default: return -1;
+ }
+ }
+ <%}%>
+ return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass)
+ {
+ <%for (Iterator m=genClass.getMixinGenClasses().iterator(); m.hasNext();) { GenClass mixinGenClass = (GenClass)m.next(); %>
+ if (baseClass == <%=mixinGenClass.getImportedInterfaceName()%>.class)
+ {
+ switch (baseFeatureID)
+ {
+ <%for (Iterator f=mixinGenClass.getGenFeatures().iterator(); f.hasNext();) { GenFeature genFeature = (GenFeature)f.next(); %>
+ case <%=mixinGenClass.getQualifiedFeatureID(genFeature)%>: return <%=genFeature.getUpperName()%>;
+ <%}%>
+ default: return -1;
+ }
+ }
+ <%}%>
+ return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
+ }
+
+<%}%>
+<%if (isImplementation && genModel.isVirtualDelegation()) { String eVirtualValuesField = genClass.getEVirtualValuesField();%>
+ <%if (eVirtualValuesField != null) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Object[] eVirtualValues()
+ {
+ return <%=eVirtualValuesField%>;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void setVirtualValues(Object[] newValues)
+ {
+ <%=eVirtualValuesField%> = newValues;
+ }
+
+ <%}%>
+ <%{ List eVirtualIndexBitFields = genClass.getEVirtualIndexBitFields(new ArrayList());%>
+ <%if (!eVirtualIndexBitFields.isEmpty()) { List allEVirtualIndexBitFields = genClass.getAllEVirtualIndexBitFields(new ArrayList());%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected int eVirtualIndexBits(int offset)
+ {
+ switch (offset)
+ {
+ <%for (int i = 0; i < allEVirtualIndexBitFields.size(); i++) {%>
+ case <%=i%> :
+ return <%=allEVirtualIndexBitFields.get(i)%>;
+ <%}%>
+ default :
+ throw new IndexOutOfBoundsException();
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void setVirtualIndexBits(int offset, int newIndexBits)
+ {
+ switch (offset)
+ {
+ <%for (int i = 0; i < allEVirtualIndexBitFields.size(); i++) {%>
+ case <%=i%> :
+ <%=allEVirtualIndexBitFields.get(i)%> = newIndexBits;
+ break;
+ <%}%>
+ default :
+ throw new IndexOutOfBoundsException();
+ }
+ }
+
+ <%}%>
+ <%}%>
+<%}%>
+<%if (isImplementation && !genModel.isReflectiveDelegation() && !genClass.getToStringGenFeatures().isEmpty()) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString()
+ {
+ if (isProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ <%{ boolean first = true;%>
+ <%for (Iterator i=genClass.getToStringGenFeatures().iterator(); i.hasNext(); ) { GenFeature genFeature = (GenFeature)i.next();%>
+ <%if (first) { first = false;%>
+ result.append(" (<%=genFeature.getName()%>: ");<%=genModel.getNonNLS()%>
+ <%} else {%>
+ result.append(", <%=genFeature.getName()%>: ");<%=genModel.getNonNLS()%>
+ <%}%>
+ <%if (genFeature.isUnsettable() && !genFeature.isListType()) {%>
+ <%if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {%>
+ if (eVirtualIsSet(<%=genFeature.getUpperName()%>)) result.append(eVirtualGet(<%=genFeature.getUpperName()%>)); else result.append("<unset>");<%=genModel.getNonNLS()%>
+ <%} else {%>
+ <%if (genClass.isFlag(genFeature)) {%>
+ if (<%if (genClass.isESetFlag(genFeature)) {%>(<%=genClass.getESetFlagsField(genFeature)%> & <%=genFeature.getUpperName()%>_ESETFLAG) != 0<%} else {%><%=genFeature.getUncapName()%>_set_<%}%>) result.append((<%=genClass.getFlagsField(genFeature)%> & <%=genFeature.getUpperName()%>_EFLAG) != 0); else result.append("<unset>");<%=genModel.getNonNLS()%>
+ <%} else {%>
+ if (<%if (genClass.isESetFlag(genFeature)) {%>(<%=genClass.getESetFlagsField(genFeature)%> & <%=genFeature.getUpperName()%>_ESETFLAG) != 0<%} else {%><%=genFeature.getUncapName()%>_set_<%}%>) result.append(<%=genFeature.getSafeName()%>); else result.append("<unset>");<%=genModel.getNonNLS()%>
+ <%}%>
+ <%}%>
+ <%} else {%>
+ <%if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) {%>
+ result.append(eVirtualGet(<%=genFeature.getUpperName()%><%if (!genFeature.isListType() && !genFeature.isReferenceType()){%>, <%=genFeature.getUpperName()%>_DEFAULT_<%}%>));
+ <%} else {%>
+ <%if (genClass.isFlag(genFeature)) {%>
+ result.append((<%=genClass.getFlagsField(genFeature)%> & <%=genFeature.getUpperName()%>_EFLAG) != 0);
+ <%} else {%>
+ result.append(<%=genFeature.getSafeName()%>);
+ <%}%>
+ <%}%>
+ <%}%>
+ <%}%>
+ <%}%>
+ result.append(')');
+ return result.toString();
+ }
+
+<%}%>
+<%if (isImplementation && genClass.isMapEntry()) { GenFeature keyFeature = genClass.getMapEntryKeyFeature(); GenFeature valueFeature = genClass.getMapEntryValueFeature();%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected int hash = -1;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public int getHash()
+ {
+ if (hash == -1)
+ {
+ Object theKey = getKey();
+ hash = (theKey == null ? 0 : theKey.hashCode());
+ }
+ return hash;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setHash(int hash)
+ {
+ this.hash = hash;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object getKey()
+ {
+ <%if (keyFeature.isPrimitiveType()) {%>
+ return new <%=keyFeature.getObjectType()%>(getTypedKey());
+ <%} else {%>
+ return getTypedKey();
+ <%}%>
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setKey(Object key)
+ {
+ <%if (keyFeature.isListType()) {%>
+ getTypedKey().addAll((<%=genModel.getImportedName("java.util.Collection")%>)key);
+ <%} else if (keyFeature.isPrimitiveType()) {%>
+ setTypedKey(((<%=keyFeature.getObjectType()%>)key).<%=keyFeature.getPrimitiveValueFunction()%>());
+ <%} else {%>
+ setTypedKey((<%=keyFeature.getImportedType()%>)key);
+ <%}%>
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object getValue()
+ {
+ <%if (valueFeature.isPrimitiveType()) {%>
+ return new <%=valueFeature.getObjectType()%>(getTypedValue());
+ <%} else {%>
+ return getTypedValue();
+ <%}%>
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object setValue(Object value)
+ {
+ Object oldValue = getValue();
+ <%if (valueFeature.isListType()) {%>
+ getTypedValue().clear();
+ getTypedValue().addAll((<%=genModel.getImportedName("java.util.Collection")%>)value);
+ <%} else if (valueFeature.isPrimitiveType()) {%>
+ setTypedValue(((<%=valueFeature.getObjectType()%>)value).<%=valueFeature.getPrimitiveValueFunction()%>());
+ <%} else {%>
+ setTypedValue((<%=valueFeature.getImportedType()%>)value);
+ <%}%>
+ return oldValue;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public <%=genModel.getImportedName("org.eclipse.emf.common.util.EMap")%> getEMap()
+ {
+ <%=genModel.getImportedName("org.eclipse.emf.ecore.EObject")%> container = eContainer();
+ return container == null ? null : (<%=genModel.getImportedName("org.eclipse.emf.common.util.EMap")%>)container.get(eContainmentFeature());
+ }
+<%}%>
+<%@ include file="Class/insert.javajetinc" fail="silent" %>
+} //<%=isInterface ? " " + genClass.getInterfaceName() : genClass.getClassName()%>
+<%// TODO fix the space above%>
+<%genModel.emitSortedImports();%>
diff --git a/branches/sdo-java-M2/sdo/tools/templates/models/SDOFactoryClass.javajet b/branches/sdo-java-M2/sdo/tools/templates/models/SDOFactoryClass.javajet
new file mode 100644
index 0000000000..5d2609b9c3
--- /dev/null
+++ b/branches/sdo-java-M2/sdo/tools/templates/models/SDOFactoryClass.javajet
@@ -0,0 +1,830 @@
+<%@ jet package="org.apache.tuscany.sdo.generate.templates.model" imports="org.apache.tuscany.sdo.generate.util.* java.util.* org.eclipse.emf.codegen.ecore.genmodel.* org.eclipse.emf.ecore.* org.eclipse.emf.codegen.ecore.genmodel.impl.Literals org.eclipse.emf.ecore.util.*" class="SDOFactoryClass" version="$Id: SDOFactoryClass.javajet,v 1.23 2005/12/10 13:31:02 emerks Exp $" %>
+<%
+/**
+ *
+ * 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.
+ */
+%>
+<%GenPackage genPackage = (GenPackage)((Object[])argument)[0]; GenModel genModel=genPackage.getGenModel();%>
+<%boolean isInterface = Boolean.TRUE.equals(((Object[])argument)[1]); boolean isImplementation = Boolean.TRUE.equals(((Object[])argument)[2]);%>
+<%String publicStaticFinalFlag = isImplementation ? "public static final " : "";%>
+<%@ include file="../Header.javajetinc"%>
+<%if (isInterface || genModel.isSuppressInterfaces()) {%>
+package <%=genPackage.getReflectionPackageName()%>;
+<%} else {%>
+package <%=genPackage.getClassPackageName()%>;
+<%}%>
+
+<%if (isImplementation) {%>
+<%if (!genPackage.hasJavaLangConflict() && !genPackage.hasInterfaceImplConflict() && !genPackage.getClassPackageName().equals(genPackage.getInterfacePackageName())) genModel.addImport(genPackage.getInterfacePackageName() + ".*");%>
+<%}%>
+<%genModel.markImportLocation(stringBuffer);%>
+
+<%if (isInterface) {%>
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Factory</b> for the model.
+ * It provides a create method for each non-abstract class of the model.
+ * <!-- end-user-doc -->
+<%if (!genModel.isSuppressEMFMetaData()) {%>
+ * @see <%=genPackage.getQualifiedPackageInterfaceName()%>
+<%}%>
+ * @generated
+ */
+<%} else {%>
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Factory</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+<%}%>
+<%if (isImplementation) {%>
+public class <%=genPackage.getFactoryClassName()%> extends <%=genModel.getImportedName("org.apache.tuscany.sdo.impl.FactoryBase")%><%if (!genModel.isSuppressInterfaces()) {%> implements <%=genPackage.getImportedFactoryInterfaceName()%><%}%>
+<%} else {%>
+public interface <%=genPackage.getFactoryInterfaceName()%><%if (!genModel.isSuppressEMFMetaData()) {%> extends <%=genModel.getImportedName("org.eclipse.emf.ecore.EFactory")%><%}%>
+<%}%>
+{
+<%if (genModel.getCopyrightText() != null) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%=publicStaticFinalFlag%><%=genModel.getImportedName("java.lang.String")%> copyright = "<%=genModel.getCopyrightText()%>";<%=genModel.getNonNLS()%>
+
+<%}%>
+
+<%if (isInterface && genModel.isSuppressEMFMetaData()) {%>
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%=publicStaticFinalFlag%><%=genPackage.getFactoryInterfaceName()%> INSTANCE = <%=genPackage.getQualifiedFactoryClassName()%>.init();
+
+<%} else if (isInterface && !genModel.isSuppressInterfaces()) {%>
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%=publicStaticFinalFlag%><%=genPackage.getFactoryInterfaceName()%> eINSTANCE = <%=genPackage.getQualifiedFactoryClassName()%>.init();
+
+<%}%>
+<%if (isImplementation) {%>
+ /**
+ * The package namespace URI.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%=publicStaticFinalFlag%><%=genModel.getImportedName("java.lang.String")%> NAMESPACE_URI = "<%=genPackage.getNSURI()%>";<%=genModel.getNonNLS()%>
+
+ /**
+ * The package namespace name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ <%=publicStaticFinalFlag%><%=genModel.getImportedName("java.lang.String")%> NAMESPACE_PREFIX = "<%=genPackage.getNSName()%>";<%=genModel.getNonNLS()%>
+<%int genIndex = 1;
+for (Iterator i=genPackage.getOrderedGenClassifiers().iterator(); i.hasNext();) { GenClassifier genClassifier = (GenClassifier)i.next();%>
+ <%if (!genPackage.getClassifierID(genClassifier).equals("DOCUMENT_ROOT")) { %>
+ <%=publicStaticFinalFlag%>int <%=genPackage.getClassifierID(genClassifier)%> = <%=genIndex%>;
+<%genIndex++;%>
+<% } }%>
+
+<%String factoryType = genModel.isSuppressEMFMetaData() ? genPackage.getFactoryClassName() : genPackage.getImportedFactoryInterfaceName();%>
+ /**
+ * Creates an instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public <%=genPackage.getFactoryClassName()%>()
+ {
+ super(NAMESPACE_URI, NAMESPACE_PREFIX);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public <%=genModel.getImportedName("commonj.sdo.DataObject")%> create(int typeNumber)
+ {
+ switch (typeNumber)
+ {
+<%for (Iterator i=genPackage.getGenClasses().iterator(); i.hasNext();) { GenClass genClass = (GenClass)i.next();%>
+<%if (!genClass.isAbstract() && !genClass.isDynamic()) {%>
+ case <%=genClass.getClassifierID()%>: return (<%=genModel.getImportedName("commonj.sdo.DataObject")%>)create<%=genClass.getName()%>();
+<%}%>
+<%}%>
+ default:
+ return super.create(typeNumber);
+ }
+ }
+
+<%if (!genPackage.getAllGenDataTypes().isEmpty()) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object createFromString(<%=genModel.getImportedName("commonj.sdo.Type")%> type, String initialValue, int propertyValue)
+ {
+ switch (propertyValue)
+ {
+<%for (Iterator i=genPackage.getAllGenDataTypes().iterator(); i.hasNext();) { GenDataType genDataType = (GenDataType)i.next();%>
+ <%if (genDataType.isSerializable()) {%>
+ case <%=genDataType.getClassifierID()%>:
+ return create<%=genDataType.getName()%>FromString(type, initialValue);
+ <%}%>
+<%}%>
+ default:
+ throw new IllegalArgumentException("The datatype '" + type.getName() + "' is not a valid property value");<%=genModel.getNonNLS()%><%=genModel.getNonNLS(2)%>
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String convertToString(<%=genModel.getImportedName("commonj.sdo.Type")%> type, Object instanceValue, int propertyValue)
+ {
+ switch (propertyValue)
+ {
+<%for (Iterator i=genPackage.getAllGenDataTypes().iterator(); i.hasNext();) { GenDataType genDataType = (GenDataType)i.next();%>
+ <%if (genDataType.isSerializable()) {%>
+ case <%=genDataType.getClassifierID()%>:
+ return convert<%=genDataType.getName()%>ToString(type, instanceValue);
+ <%}%>
+<%}%>
+ default:
+ throw new IllegalArgumentException("The datatype '" + type.getName() + "' is not a valid property value");<%=genModel.getNonNLS()%><%=genModel.getNonNLS(2)%>
+ }
+ }
+<%}%>
+<%for (Iterator i=genPackage.getGenClasses().iterator(); i.hasNext();) { GenClass genClass = (GenClass)i.next();%>
+ <%if (!genClass.isAbstract() && !genClass.isDynamic()) {%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public <%=genClass.getImportedInterfaceName()%> create<%=genClass.getName()%>()
+ {
+ <%if (genClass.isDynamic()) {%>
+ <%=genClass.getImportedInterfaceName()%> <%=genClass.getSafeUncapName()%> = <%=genClass.getCastFromEObject()%>super.create(<%=genClass.getQualifiedClassifierAccessor()%>);
+ <%} else {%>
+ <%=genClass.getImportedClassName()%> <%=genClass.getSafeUncapName()%> = new <%=genClass.getImportedClassName()%>()<%if (genModel.isSuppressInterfaces() && !genPackage.getReflectionPackageName().equals(genPackage.getInterfacePackageName())) {%>{}<%}%>;
+ <%}%>
+ return <%=genClass.getSafeUncapName()%>;
+ }
+ <%}%>
+<%}%>
+
+ // Following creates and initializes SDO metadata for the supported types.
+<%for (Iterator i=genPackage.getOrderedGenClassifiers().iterator(); i.hasNext();) { GenClassifier genClassifier = (GenClassifier)i.next();%>
+ <%if (!genPackage.getClassifierID(genClassifier).equals("DOCUMENT_ROOT")) { %>
+ protected <%=genModel.getImportedName("commonj.sdo.Type")%> <%=genClassifier.getSafeUncapName()%>Type = null;
+
+ public <%=genModel.getImportedName("commonj.sdo.Type")%> get<%=genClassifier.getClassifierAccessorName()%>()
+ {
+ return <%=genClassifier.getSafeUncapName()%>Type;
+ }
+
+<%} }%>
+
+ private static boolean isInited = false;
+
+ public static <%=factoryType%> init()
+ {
+ if (isInited) return (<%=factoryType%>)FactoryBase.getStaticFactory(<%=factoryType%>.NAMESPACE_URI);
+ <%=factoryType%> the<%=factoryType%> = new <%=factoryType%>();
+ isInited = true;
+
+ // Initialize simple dependencies
+ <%=genModel.getImportedName("org.apache.tuscany.sdo.util.SDOUtil")%>.registerStaticTypes(<%=genModel.getImportedName("org.apache.tuscany.sdo.impl.SDOFactoryImpl")%>.class);
+ <%=genModel.getImportedName("org.apache.tuscany.sdo.util.SDOUtil")%>.registerStaticTypes(<%=genModel.getImportedName("org.apache.tuscany.sdo.model.impl.ModelPackageImpl")%>.class);
+
+ // Create package meta-data objects
+ the<%=factoryType%>.createMetaData();
+
+ // Initialize created meta-data
+ the<%=factoryType%>.initializeMetaData();
+
+ // Mark meta-data to indicate it can't be changed
+ //the<%=factoryType%>.freeze(); //FB do we need to freeze / should we freeze ????
+
+ return the<%=factoryType%>;
+ }
+
+ private boolean isCreated = false;
+
+ public void createMetaData()
+ {
+ if (isCreated) return;
+ isCreated = true;
+ <%if (!genPackage.getGenClasses().isEmpty()) {%>
+ <%for (Iterator i=genPackage.getGenClasses().iterator(); i.hasNext();) { GenClass genClass = (GenClass)i.next();%>
+
+ <%if (!genClass.isAbstract() && !genClass.isDynamic()) {%>
+ <%=genClass.getSafeUncapName()%>Type = createType(false, <%=genPackage.getClassifierID(genClass)%>);
+ <%for (Iterator j=genClass.getGenFeatures().iterator(); j.hasNext();) { GenFeature genFeature = (GenFeature)j.next();%>
+ createProperty(<%=!genFeature.isReferenceType()%>, <%=genClass.getSafeUncapName()%>Type, <%=genClass.getClassName()%>.<%=genFeature.getUpperName()%>);
+ <%}%>
+ <%}%>
+ <%}%>
+ <%}%>
+ <%if (!genPackage.getGenEnums().isEmpty()) {%>
+ // Create enums
+ // todo
+ <%for (Iterator e=genPackage.getGenEnums().iterator(); e.hasNext();) { GenEnum genEnum = (GenEnum)e.next();%>
+ <%=genEnum.getClassifierInstanceName()%> = createEEnum(<%=genEnum.getClassifierID()%>);
+ <%}%>
+ <%}%>
+ <%if (!genPackage.getGenDataTypes().isEmpty()) {%>
+ <%for (Iterator d=genPackage.getGenDataTypes().iterator(); d.hasNext();) { GenDataType genDataType = (GenDataType)d.next();%>
+ <%=genDataType.getSafeUncapName()%>Type = createType(true, <%=genPackage.getClassifierID(genDataType)%> );
+ <%}%>
+ <%}%>
+ }
+
+ private boolean isInitialized = false;
+
+ public void initializeMetaData()
+ {
+ if (isInitialized) return;
+ isInitialized = true;
+ <%if (!genPackage.getPackageInitializationDependencies().isEmpty()) {%>
+
+ // Obtain other dependent packages
+ <%for (Iterator p=genPackage.getPackageInitializationDependencies().iterator(); p.hasNext();) { GenPackage dep = (GenPackage)p.next();%>
+ <%=dep.getImportedFactoryClassName()%> <%=genPackage.getPackageInstanceVariable(dep)%> = (<%=dep.getImportedFactoryClassName()%>)FactoryBase.getStaticFactory(<%=dep.getImportedFactoryClassName()%>.NAMESPACE_URI);
+ <%}%>
+ <%}%>
+ <%List annotationSources = genPackage.getAnnotationSources();%>
+ <%annotationSources.remove(ExtendedMetaData.ANNOTATION_URI);%>
+ <%=genModel.getImportedName("commonj.sdo.Property")%> property = null;
+
+ // Add supertypes to classes
+ <%for (Iterator c=genPackage.getGenClasses().iterator(); c.hasNext();) { GenClass genClass = (GenClass)c.next();%>
+ <%for (Iterator b=genClass.getBaseGenClasses().iterator(); b.hasNext();) { GenClass baseGenClass = (GenClass)b.next();%>
+ addSuperType(<%=genClass.getSafeUncapName()%>Type, <%=baseGenClass.getSafeUncapName()%>Type);
+ <%}%>
+ <%}%>
+
+ // Initialize classes and features; add operations and parameters
+ <%for (Iterator i=genPackage.getGenClasses().iterator(); i.hasNext();) { GenClass genClass = (GenClass)i.next();%>
+ <%if (!genClass.isAbstract() && !genClass.isDynamic()) {%>
+ initializeType(<%=genClass.getSafeUncapName()%>Type, <%=genClass.getImportedInterfaceName()%>.class, "<%=genClass.getName()%>");
+ <%for (Iterator sources = annotationSources.iterator(); sources.hasNext();) { String annotationSource = (String)sources.next();%>
+ <%EAnnotation classAnnotation = genClass.getEcoreClassifier().getEAnnotation(annotationSource);%>
+ <%if (classAnnotation != null) { %>
+ <%for (Iterator k = classAnnotation.getDetails().iterator(); k.hasNext();) { Map.Entry detail = (Map.Entry)k.next(); String key = Literals.toStringLiteral((String)detail.getKey(), genModel); String value = Literals.toStringLiteral((String)detail.getValue(), genModel);%>
+ setInstanceProperty (<%=genClass.getSafeUncapName()%>Type, "<%=annotationSource%>", <%=key%>, <%=value%><%=genModel.getNonNLS(key + value)%>);
+ <%}%>
+ <%}%>
+ <%}%>
+
+ <%for (Iterator j=genClass.getGenFeatures().iterator(); j.hasNext();) {GenFeature genFeature = (GenFeature)j.next();%>
+ <%String type = genFeature.getType().equals("commonj.sdo.Sequence") ? "getSequence()" : genPackage.getPackageInstanceVariable(genFeature.getTypeGenPackage()) + ".get" + genFeature.getTypeClassifierAccessorName() + "()";%>
+ property = (<%=genModel.getImportedName("commonj.sdo.Property")%>)<%=genClass.getSafeUncapName()%>Type.getProperties().get(<%=genClass.getClassName()%>.<%=genFeature.getUpperName()%>);
+ <%if (genFeature.isReferenceType()) { GenFeature reverseGenFeature = genFeature.getReverse();%>
+ <%String reverse = reverseGenFeature == null ? "null" : genPackage.getPackageInstanceVariable(reverseGenFeature.getGenPackage()) + ".get" + reverseGenFeature.getFeatureAccessorName() + "()";%>
+ initializeProperty(property, <%=type%>, "<%=genFeature.getSafeName()%>", <%=genFeature.getDefaultValue()%>, <%=genFeature.getLowerBound()%>, <%=genFeature.getUpperBound()%>, <%=genFeature.getContainerClass()%>, <%=genFeature.getChangeableFlag().equals("IS_CHANGEABLE") ? "false" : "true"%>, <%=genFeature.getUnsettableFlag().equals("IS_UNSETTABLE") ? "true": "false"%>, <%=genFeature.getDerivedFlag().equals("IS_DERIVED") ? "true" : "false"%>, <%=genFeature.getContainmentFlag().equals("IS_COMPOSITE")? "true": "false"%> , <%=reverse%>);
+ <%}else{%>
+ initializeProperty(property, <%=type%>, "<%=genFeature.getSafeName()%>", <%=genFeature.getDefaultValue()%>, <%=genFeature.getLowerBound()%>, <%=genFeature.getUpperBound()%>, <%=genFeature.getContainerClass()%>, <%=genFeature.getChangeableFlag().equals("IS_CHANGEABLE") ? "false" : "true"%>, <%=genFeature.getUnsettableFlag().equals("IS_UNSETTABLE") ? "true": "false"%>, <%=genFeature.getDerivedFlag().equals("IS_DERIVED") ? "true" : "false"%>);
+ <%}%>
+ <%for (Iterator sources = annotationSources.iterator(); sources.hasNext();) { String annotationSource = (String)sources.next();%>
+ <%EAnnotation featureAnnotation = genFeature.getEcoreFeature().getEAnnotation(annotationSource);%>
+ <%if (featureAnnotation != null) { %>
+ <%for (Iterator k = featureAnnotation.getDetails().iterator(); k.hasNext();) { Map.Entry detail = (Map.Entry)k.next(); String key = Literals.toStringLiteral((String)detail.getKey(), genModel); String value = Literals.toStringLiteral((String)detail.getValue(), genModel);%>
+ setInstanceProperty (property, "<%=annotationSource%>", <%=key%>, <%=value%><%=genModel.getNonNLS(key + value)%>);
+ <%}%>
+ <%}%>
+ <%}%>
+
+ <%}%>
+ <%}%>
+ <%}%>
+ <%if (!genPackage.getGenDataTypes().isEmpty()) {%>
+ // Initialize data types
+ <%for (Iterator d=genPackage.getGenDataTypes().iterator(); d.hasNext();) { GenDataType genDataType = (GenDataType)d.next();%>
+ initializeType(<%=genDataType.getSafeUncapName()%>Type, <%=genDataType.getImportedInstanceClassName()%>.class, "<%=genDataType.getName()%>", <%=genDataType.getSerializableFlag().equals("IS_SERIALIZABLE") ? "true" : "false"%>, <%=genDataType.getGeneratedInstanceClassFlag().equals("IS_GENERATED_INSTANCE_CLASS") ? "true" : "false" %>);<%=genModel.getNonNLS()%>
+ <%for (Iterator sources = annotationSources.iterator(); sources.hasNext();) { String annotationSource = (String)sources.next();%>
+ <%EAnnotation dataTypeAnnotation = genDataType.getEcoreDataType().getEAnnotation(annotationSource);%>
+ <%if (dataTypeAnnotation != null) { %>
+ <%for (Iterator k = dataTypeAnnotation.getDetails().iterator(); k.hasNext();) { Map.Entry detail = (Map.Entry)k.next(); String key = Literals.toStringLiteral((String)detail.getKey(), genModel); String value = Literals.toStringLiteral((String)detail.getValue(), genModel);%>
+ setInstanceProperty (<%=genDataType.getSafeUncapName()%>Type, "<%=annotationSource%>", <%=key%>, <%=value%><%=genModel.getNonNLS(key + value)%>);
+ <%}%>
+ <%}%>
+ <%}%>
+
+ <%}%>
+ <%}%>
+ createXSDMetaData(theModelPackageImpl);
+ }
+
+ protected void createXSDMetaData(ModelFactoryImpl theModelPackageImpl)
+ {
+ super.createXSDMetaData();
+
+ <%=genModel.getImportedName("commonj.sdo.Property")%> property = null;
+
+ <%String extendedMetaDataSource = ExtendedMetaData.ANNOTATION_URI;%>
+ <%EAnnotation packageAnnotation = genPackage.getEcorePackage().getEAnnotation(extendedMetaDataSource);%>
+ <%if (packageAnnotation != null){ %>
+ addXSDMapping
+ (new String[]
+ {
+ <%for (Iterator k = packageAnnotation.getDetails().iterator(); k.hasNext();) { Map.Entry detail = (Map.Entry)k.next(); String key = Literals.toStringLiteral((String)detail.getKey(), genModel); String value = Literals.toStringLiteral((String)detail.getValue(), genModel);%>
+ <%=key%>, <%=value%><%=k.hasNext() ? "," : ""%><%=genModel.getNonNLS(key + value)%>
+ <%}%>
+ });
+
+ <%}%>
+ <%for (Iterator i=genPackage.getGenClassifiers().iterator(); i.hasNext();) { GenClassifier genClassifier = (GenClassifier)i.next(); EAnnotation classAnnotation = genClassifier.getEcoreClassifier().getEAnnotation(extendedMetaDataSource);%>
+ <%if (classAnnotation != null && !genClassifier.getName().equals("DocumentRoot")) {%>
+ addXSDMapping
+ (<%=genClassifier.getSafeUncapName()%>Type,
+ new String[]
+ {
+ <%for (Iterator k = classAnnotation.getDetails().iterator(); k.hasNext();) { Map.Entry detail = (Map.Entry)k.next(); String key = Literals.toStringLiteral((String)detail.getKey(), genModel); String value = Literals.toStringLiteral((String)detail.getValue(), genModel);%>
+ <%=key%>, <%=value%><%=k.hasNext() ? "," : ""%><%=genModel.getNonNLS(key + value)%>
+ <%}%>
+ });
+
+ <%}%>
+ <%if (genClassifier instanceof GenClass) { GenClass genClass = (GenClass) genClassifier;%>
+ <%for (Iterator j=genClass.getGenFeatures().iterator(); j.hasNext();) { GenFeature genFeature = (GenFeature)j.next(); %>
+ <%EAnnotation featureAnnotation = genFeature.getEcoreFeature().getEAnnotation(extendedMetaDataSource);%>
+ <%if (genClass.getName().equals("DocumentRoot")) { %>
+ <%if (!(genFeature.getName().equals("mixed") || genFeature.getName().equals("xMLNSPrefixMap") || genFeature.getName().equals("xSISchemaLocation"))) { %>
+ property = createGlobalProperty
+ ("<%=genFeature.getName()%>",
+ <%=genPackage.getPackageInstanceVariable(genFeature.getTypeGenPackage())%>.get<%=genFeature.getTypeClassifierAccessorName()%>(),
+ new String[]
+ {
+ <%for (Iterator k = featureAnnotation.getDetails().iterator(); k.hasNext();) { Map.Entry detail = (Map.Entry)k.next(); String key = Literals.toStringLiteral((String)detail.getKey(), genModel); String value = Literals.toStringLiteral((String)detail.getValue(), genModel);%>
+ <%=key%>, <%=value%><%=k.hasNext() ? "," : ""%><%=genModel.getNonNLS(key + value)%>
+ <%}%>
+ <%if (!genFeature.isReferenceType()) {%>
+ },
+ IS_ATTRIBUTE);
+ <%} else {%>
+ });
+ <%}%>
+
+ <%for (Iterator sources = genPackage.getAnnotationSources().iterator(); sources.hasNext();) { String annotationSource = (String)sources.next(); %>
+ <%if (!annotationSource.equals(extendedMetaDataSource)) {%>
+ <%EAnnotation globalAnnotation = genFeature.getEcoreFeature().getEAnnotation(annotationSource);%>
+ <%if (globalAnnotation != null) {%>
+ <%for (Iterator k = globalAnnotation.getDetails().iterator(); k.hasNext();) { Map.Entry detail = (Map.Entry)k.next(); String key = Literals.toStringLiteral((String)detail.getKey(), genModel); String value = Literals.toStringLiteral((String)detail.getValue(), genModel);%>
+ setInstanceProperty
+ (property,
+ "<%=annotationSource%>",
+ <%=key%>, <%=value%><%=genModel.getNonNLS(key + value)%>);
+ <%}%>
+
+ <%}%>
+ <%}%>
+ <%}%>
+ <%}%>
+ <%} else {%>
+ addXSDMapping
+ ((<%=genModel.getImportedName("commonj.sdo.Property")%>)<%=genClassifier.getSafeUncapName()%>Type.getProperties().get(<%=genClass.getClassName()%>.<%=genFeature.getUpperName()%>),
+ new String[]
+ {
+ <%for (Iterator k = featureAnnotation.getDetails().iterator(); k.hasNext();) { Map.Entry detail = (Map.Entry)k.next(); String key = Literals.toStringLiteral((String)detail.getKey(), genModel); String value = Literals.toStringLiteral((String)detail.getValue(), genModel);%>
+ <%=key%>, <%=value%><%=k.hasNext() ? "," : ""%><%=genModel.getNonNLS(key + value)%>
+ <%}%>
+ });
+
+ <%}%>
+ <%}%>
+ <%}%>
+ <%}%>
+ }
+
+<%for (Iterator i=genPackage.getAllGenDataTypes().iterator(); i.hasNext();) { GenDataType genDataType = (GenDataType)i.next();%>
+ <%if (genDataType.isSerializable()) {%>
+<%if (genPackage.isDataTypeConverters()) { String eDataType = genDataType.getQualifiedClassifierAccessor();%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public <%=genDataType.getImportedInstanceClassName()%> create<%=genDataType.getName()%>(String literal)
+ {
+ <%if (genDataType instanceof GenEnum) {%>
+ <%=genDataType.getImportedInstanceClassName()%> result = <%=genDataType.getImportedInstanceClassName()%>.get(literal);
+ if (result == null) throw new IllegalArgumentException("The value '" + literal + "' is not a valid enumerator of '" + <%=eDataType%>.getName() + "'");<%=genModel.getNonNLS()%><%=genModel.getNonNLS(2)%><%=genModel.getNonNLS(3)%>
+ return result;
+ <%} else if (genDataType.getBaseType() != null) { GenDataType genBaseType = genDataType.getBaseType(); boolean isPrimitiveConversion = !genDataType.isPrimitiveType() && genBaseType.isPrimitiveType();%>
+ <%if (genBaseType.getGenPackage() == genPackage) {%>
+ <%if (isPrimitiveConversion) {%>
+ return new <%=genDataType.getObjectInstanceClassName()%>(create<%=genBaseType.getName()%>(literal));
+ <%} else {%>
+ return create<%=genBaseType.getName()%>(literal);
+ <%}%>
+ <%} else if (genBaseType.getGenPackage().isDataTypeConverters()) {%>
+ <%if (isPrimitiveConversion) {%>
+ return new <%=genDataType.getObjectInstanceClassName()%>(<%=genBaseType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()%>.create<%=genBaseType.getName()%>(literal));
+ <%} else {%>
+ return <%=genBaseType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()%>.create<%=genBaseType.getName()%>(literal);
+ <%}%>
+ <%} else {%>
+ return (<%=genDataType.getObjectInstanceClassName()%>)<%=genBaseType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()%>.createFromString(<%=genBaseType.getQualifiedClassifierAccessor()%>, literal);
+ <%}%>
+ <%} else if (genDataType.getItemType() != null) { GenDataType genItemType = genDataType.getItemType(); %>
+ if (literal == null) return null;
+ <%=genModel.getImportedName("java.util.List")%> result = new <%=genModel.getImportedName("java.util.ArrayList")%>();
+ for (<%=genModel.getImportedName("java.util.StringTokenizer")%> stringTokenizer = new <%=genModel.getImportedName("java.util.StringTokenizer")%>(literal); stringTokenizer.hasMoreTokens(); )
+ {
+ String item = stringTokenizer.nextToken();
+ <%if (genItemType.getGenPackage() == genPackage) {%>
+ <%if (genPackage.isDataTypeConverters()) { genItemType = genItemType.getObjectType();%>
+ result.add(create<%=genItemType.getName()%>(item));
+ <%} else {%>
+ result.add(create<%=genItemType.getName()%>FromString(<%=genItemType.getQualifiedClassifierAccessor()%>, item));
+ <%}%>
+ <%} else {%>
+ <%if (genItemType.getGenPackage().isDataTypeConverters()) { genItemType = genItemType.getObjectType();%>
+ result.add(<%=genItemType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()%>.create<%=genItemType.getName()%>(item));
+ <%} else {%>
+ result.add(<%=genItemType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()%>.createFromString(<%=genItemType.getQualifiedClassifierAccessor()%>, item));
+ <%}%>
+ <%}%>
+ }
+ return result;
+ <%} else if (!genDataType.getMemberTypes().isEmpty()) {%>
+ if (literal == null) return <%=genDataType.getStaticValue(null)%>;
+ <%=genDataType.getImportedInstanceClassName()%> result = <%=genDataType.getStaticValue(null)%>;
+ RuntimeException exception = null;
+ <%for (Iterator j = genDataType.getMemberTypes().iterator(); j.hasNext(); ) { GenDataType genMemberType = (GenDataType)j.next();%>
+ try
+ {
+ <%if (genMemberType.getGenPackage() == genPackage) {%>
+ <%if (genPackage.isDataTypeConverters()) { if (!genDataType.isPrimitiveType()) genMemberType = genMemberType.getObjectType();%>
+ result = create<%=genMemberType.getName()%>(literal);
+ <%} else {%>
+ result = (<%=genDataType.getObjectInstanceClassName()%>)create<%=genMemberType.getName()%>FromString(<%=genMemberType.getQualifiedClassifierAccessor()%>, literal);
+ <%}%>
+ <%} else {%>
+ <%if (genPackage.isDataTypeConverters()) { if (!genDataType.isPrimitiveType()) genMemberType = genMemberType.getObjectType();%>
+ result = <%=genMemberType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()%>.create<%=genMemberType.getName()%>(literal);
+ <%} else {%>
+ result = (<%=genDataType.getObjectInstanceClassName()%>)<%=genMemberType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()%>.createFromString(<%=genMemberType.getQualifiedClassifierAccessor()%>, literal);
+ <%}%>
+ <%}%>
+ if (<%if (!genDataType.isPrimitiveType()) {%>result != null && <%}%><%=genModel.getImportedName("org.eclipse.emf.ecore.util.Diagnostician")%>.INSTANCE.validate(<%=eDataType%>, <%if (genDataType.isPrimitiveType()) {%>new <%=genDataType.getObjectInstanceClassName()%>(result)<%} else {%>result<%}%>, null, null))
+ {
+ return result;
+ }
+ }
+ catch (RuntimeException e)
+ {
+ exception = e;
+ }
+ <%}%>
+ if (<%if (!genDataType.isPrimitiveType()) {%>result != null || <%}%>exception == null) return result;
+
+ throw exception;
+ <%} else if (genDataType.isArrayType()) {%>
+ // TODO: implement this method
+ // Ensure that you remove @generated or mark it @generated NOT
+ throw new <%=genModel.getImportedName("java.lang.UnsupportedOperationException")%>();
+ <%} else if (genDataType.isPrimitiveType()) {%>
+ return ((<%=genDataType.getObjectInstanceClassName()%>)super.createFromString(<%=eDataType%>, literal)).<%=genDataType.getPrimitiveValueFunction()%>();
+ <%} else {%>
+ return (<%=genDataType.getObjectInstanceClassName()%>)super.createFromString(<%=eDataType%>, literal);
+ <%}%>
+ }
+
+<%}%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public <%=genDataType.getObjectInstanceClassName()%> create<%=genDataType.getName()%>FromString(<%=genModel.getImportedName("commonj.sdo.Type")%> type, String initialValue)
+ {
+ <%if (genDataType instanceof GenEnum) {%>
+ <%if (genPackage.isDataTypeConverters()) {%>
+ return create<%=genDataType.getName()%>(initialValue);
+ <%} else {%>
+ <%=((GenEnum)genDataType).getImportedInstanceClassName()%> result = <%=((GenEnum)genDataType).getImportedInstanceClassName()%>.get(initialValue);
+ if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + type.getName() + "'");<%=genModel.getNonNLS()%><%=genModel.getNonNLS(2)%><%=genModel.getNonNLS(3)%>
+ return result;
+ <%}%>
+ <%} else if (genDataType.getBaseType() != null) { GenDataType genBaseType = genDataType.getBaseType(); %>
+ <%if (genBaseType.getGenPackage() == genPackage) {%>
+ return (<%=genDataType.getObjectInstanceClassName()%>)create<%=genBaseType.getName()%>FromString(<%=SDOGenUtil.getQualifiedTypeAccessor(genDataType)%>, initialValue);
+ <%} else {%>
+ return (<%=genDataType.getObjectInstanceClassName()%>)<%=genBaseType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()%>.createFromString(<%=genBaseType.getQualifiedClassifierAccessor()%>, initialValue);
+ <%}%>
+ <%} else if (genDataType.getItemType() != null) { GenDataType genItemType = genDataType.getItemType(); %>
+ <%if (genPackage.isDataTypeConverters()) {%>
+ return create<%=genDataType.getName()%>(initialValue);
+ <%} else {%>
+ if (initialValue == null) return null;
+ <%=genModel.getImportedName("java.util.List")%> result = new <%=genModel.getImportedName("java.util.ArrayList")%>();
+ for (<%=genModel.getImportedName("java.util.StringTokenizer")%> stringTokenizer = new <%=genModel.getImportedName("java.util.StringTokenizer")%>(initialValue); stringTokenizer.hasMoreTokens(); )
+ {
+ String item = stringTokenizer.nextToken();
+ <%if (genItemType.getGenPackage() == genPackage) {%>
+ result.add(create<%=genItemType.getName()%>FromString(<%=genItemType.getQualifiedClassifierAccessor()%>, item));
+ <%} else {%>
+ result.add(<%=genItemType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()%>.createFromString(<%=genItemType.getQualifiedClassifierAccessor()%>, item));
+ <%}%>
+ }
+ return result;
+ <%}%>
+ <%} else if (!genDataType.getMemberTypes().isEmpty()) {%>
+ <%if (genPackage.isDataTypeConverters()) {%>
+ <%if (genDataType.isPrimitiveType()) {%>
+ return new <%=genDataType.getObjectInstanceClassName()%>(create<%=genDataType.getName()%>(initialValue));
+ <%} else {%>
+ return create<%=genDataType.getName()%>(initialValue);
+ <%}%>
+ <%} else {%>
+ if (initialValue == null) return null;
+ <%=genDataType.getObjectInstanceClassName()%> result = null;
+ RuntimeException exception = null;
+ <%for (Iterator j = genDataType.getMemberTypes().iterator(); j.hasNext(); ) { GenDataType genMemberType = (GenDataType)j.next();%>
+ try
+ {
+ <%if (genMemberType.getGenPackage() == genPackage) {%>
+ result = (<%=genDataType.getObjectInstanceClassName()%>)create<%=genMemberType.getName()%>FromString(<%=genMemberType.getQualifiedClassifierAccessor()%>, initialValue);
+ <%} else {%>
+ result = (<%=genDataType.getObjectInstanceClassName()%>)<%=genMemberType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()%>.createFromString(<%=genMemberType.getQualifiedClassifierAccessor()%>, initialValue);
+ <%}%>
+ if (result != null && <%=genModel.getImportedName("org.eclipse.emf.ecore.util.Diagnostician")%>.INSTANCE.validate(type, result, null, null))
+ {
+ return result;
+ }
+ }
+ catch (RuntimeException e)
+ {
+ exception = e;
+ }
+ <%}%>
+ if (result != null || exception == null) return result;
+
+ throw exception;
+ <%}%>
+ <%} else if (genDataType.isArrayType()) {%>
+ // TODO: implement this method
+ // Ensure that you remove @generated or mark it @generated NOT
+ throw new <%=genModel.getImportedName("java.lang.UnsupportedOperationException")%>();
+ <%} else {%>
+ return (<%=genDataType.getObjectInstanceClassName()%>)super.createFromString(type, initialValue);
+ <%}%>
+ }
+
+<%if (genPackage.isDataTypeConverters()) { String eDataType = genDataType.getQualifiedClassifierAccessor();%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String convert<%=genDataType.getName()%>(<%=genDataType.getImportedInstanceClassName()%> instanceValue)
+ {
+ <%if (genDataType instanceof GenEnum) {%>
+ return instanceValue == null ? null : instanceValue.toString();
+ <%} else if (genDataType.getBaseType() != null) { GenDataType genBaseType = genDataType.getBaseType(); boolean isPrimitiveConversion = !genDataType.isPrimitiveType() && genBaseType.isPrimitiveType();%>
+ <%if (genBaseType.getGenPackage() == genPackage) {%>
+ <%if (isPrimitiveConversion) {%>
+ return instanceValue == null ? null : convert<%=genBaseType.getName()%>(instanceValue.<%=genBaseType.getPrimitiveValueFunction()%>());
+ <%} else {%>
+ return convert<%=genBaseType.getName()%>(instanceValue);
+ <%}%>
+ <%} else if (genBaseType.getGenPackage().isDataTypeConverters()) {%>
+ return <%=genBaseType.getGenPackage().getQualifiedFactoryInstanceAccessor()%>.convert<%=genBaseType.getName()%>(instanceValue);
+ <%} else {%>
+ return <%=genBaseType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()%>.convertToString(<%=genBaseType.getQualifiedClassifierAccessor()%>, instanceValue);
+ <%}%>
+ <%} else if (genDataType.getItemType() != null) { GenDataType genItemType = genDataType.getItemType(); %>
+ if (instanceValue == null) return null;
+ if (instanceValue.isEmpty()) return "";
+ <%=genModel.getImportedName("java.lang.StringBuffer")%> result = new <%=genModel.getImportedName("java.lang.StringBuffer")%>();
+ for (<%=genModel.getImportedName("java.util.Iterator")%> i = instanceValue.iterator(); i.hasNext(); )
+ {
+ <%if (genItemType.getGenPackage() == genPackage) {%>
+ <%if (genPackage.isDataTypeConverters()) { genItemType = genItemType.getObjectType();%>
+ result.append(convert<%=genItemType.getName()%>((<%=genItemType.getObjectInstanceClassName()%>)i.next()));
+ <%} else {%>
+ result.append(convert<%=genItemType.getName()%>ToString(<%=genItemType.getQualifiedClassifierAccessor()%>, i.next()));
+ <%}%>
+ <%} else {%>
+ <%if (genItemType.getGenPackage().isDataTypeConverters()) { genItemType = genItemType.getObjectType();%>
+ result.append(<%=genItemType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()%>.convert<%=genItemType.getName()%>((<%=genItemType.getObjectInstanceClassName()%>)i.next()));
+ <%} else {%>
+ result.append(<%=genItemType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()%>.convertToString(<%=genItemType.getQualifiedClassifierAccessor()%>, i.next()));
+ <%}%>
+ <%}%>
+ result.append(' ');
+ }
+ return result.substring(0, result.length() - 1);
+ <%} else if (!genDataType.getMemberTypes().isEmpty()) {%>
+ <%if (!genDataType.isPrimitiveType()) {%>
+ if (instanceValue == null) return null;
+ <%for (Iterator j = genDataType.getMemberTypes().iterator(); j.hasNext(); ) { GenDataType genMemberType = (GenDataType)j.next();%>
+ if (<%=genMemberType.getQualifiedClassifierAccessor()%>.isInstance(instanceValue))
+ {
+ try
+ {
+ <%if (genMemberType.getGenPackage() == genPackage) {%>
+ <%if (genPackage.isDataTypeConverters()) {%>
+ String value = convert<%=genMemberType.getName()%>(instanceValue);
+ <%} else {%>
+ String value = convert<%=genMemberType.getName()%>ToString(<%=genMemberType.getQualifiedClassifierAccessor()%>, instanceValue);
+ <%}%>
+ <%} else {%>
+ <%if (genMemberType.getGenPackage().isDataTypeConverters()) { genMemberType = genMemberType.getObjectType();%>
+ String value = <%=genMemberType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()%>.convert<%=genMemberType.getName()%>((<%=genMemberType.getObjectInstanceClassName()%>)instanceValue);
+ <%} else {%>
+ String value = <%=genMemberType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()%>.convertToString(<%=genMemberType.getQualifiedClassifierAccessor()%>, instanceValue);
+ <%}%>
+ <%}%>
+ if (value != null) return value;
+ }
+ catch (Exception e)
+ {
+ }
+ }
+ <%}%>
+ <%} else {%>
+ <%for (Iterator j = genDataType.getMemberTypes().iterator(); j.hasNext(); ) { GenDataType genMemberType = (GenDataType)j.next();%>
+ try
+ {
+ <%if (genMemberType.getGenPackage() == genPackage) {%>
+ <%if (genPackage.isDataTypeConverters()) {%>
+ String value = convert<%=genMemberType.getName()%>(instanceValue);
+ <%} else {%>
+ String value = convert<%=genMemberType.getName()%>ToString(<%=genMemberType.getQualifiedClassifierAccessor()%>, new <%=genMemberType.getObjectInstanceClassName()%>(instanceValue));
+ <%}%>
+ <%} else {%>
+ <%if (genMemberType.getGenPackage().isDataTypeConverters()) {%>
+ String value = <%=genMemberType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()%>.convert<%=genMemberType.getName()%>(instanceValue);
+ <%} else {%>
+ String value = <%=genMemberType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()%>.convertToString(<%=genMemberType.getQualifiedClassifierAccessor()%>, new <%=genMemberType.getObjectInstanceClassName()%>(instanceValue));
+ <%}%>
+ <%}%>
+ if (value != null) return value;
+ }
+ catch (Exception e)
+ {
+ }
+ <%}%>
+ <%}%>
+ throw new IllegalArgumentException("Invalid value: '"+instanceValue+"' for datatype :"+<%=eDataType%>.getName());
+ <%} else if (genDataType.isArrayType()) {%>
+ // TODO: implement this method
+ // Ensure that you remove @generated or mark it @generated NOT
+ throw new <%=genModel.getImportedName("java.lang.UnsupportedOperationException")%>();
+ <%} else if (genDataType.isPrimitiveType()) {%>
+ return super.convertToString(<%=eDataType%>, new <%=genDataType.getObjectInstanceClassName()%>(instanceValue));
+ <%} else {%>
+ return super.convertToString(<%=eDataType%>, instanceValue);
+ <%}%>
+ }
+
+<%}%>
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String convert<%=genDataType.getName()%>ToString(<%=genModel.getImportedName("commonj.sdo.Type")%> type, Object instanceValue)
+ {
+ <%if (genDataType instanceof GenEnum) {%>
+ return instanceValue == null ? null : instanceValue.toString();
+ <%} else if (genDataType.getBaseType() != null) { GenDataType genBaseType = genDataType.getBaseType(); %>
+ <%if (genBaseType.getGenPackage() == genPackage) {%>
+ return convert<%=genBaseType.getName()%>ToString(<%=SDOGenUtil.getQualifiedTypeAccessor(genBaseType)%>, instanceValue);
+ <%} else {%>
+ return <%=genBaseType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()%>.convertToString(<%=genBaseType.getQualifiedClassifierAccessor()%>, instanceValue);
+ <%}%>
+ <%} else if (genDataType.getItemType() != null) { GenDataType genItemType = genDataType.getItemType(); %>
+ <%if (genPackage.isDataTypeConverters()) {%>
+ return convert<%=genDataType.getName()%>((<%=genModel.getImportedName("java.util.List")%>)instanceValue);
+ <%} else {%>
+ if (instanceValue == null) return null;
+ <%=genModel.getImportedName("java.util.List")%> list = (<%=genModel.getImportedName("java.util.List")%>)instanceValue;
+ if (list.isEmpty()) return "";
+ <%=genModel.getImportedName("java.lang.StringBuffer")%> result = new <%=genModel.getImportedName("java.lang.StringBuffer")%>();
+ for (<%=genModel.getImportedName("java.util.Iterator")%> i = list.iterator(); i.hasNext(); )
+ {
+ <%if (genItemType.getGenPackage() == genPackage) {%>
+ result.append(convert<%=genItemType.getName()%>ToString(<%=genItemType.getQualifiedClassifierAccessor()%>, i.next()));
+ <%} else {%>
+ result.append(<%=genItemType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()%>.convertToString(<%=genItemType.getQualifiedClassifierAccessor()%>, i.next()));
+ <%}%>
+ result.append(' ');
+ }
+ return result.substring(0, result.length() - 1);
+ <%}%>
+ <%} else if (!genDataType.getMemberTypes().isEmpty()) {%>
+ <%if (genPackage.isDataTypeConverters()) {%>
+ <%if (genDataType.isPrimitiveType()) {%>
+ return instanceValue == null ? null : convert<%=genDataType.getName()%>(((<%=genDataType.getObjectInstanceClassName()%>)instanceValue).<%=genDataType.getPrimitiveValueFunction()%>());
+ <%} else {%>
+ return convert<%=genDataType.getName()%>(instanceValue);
+ <%}%>
+ <%} else {%>
+ if (instanceValue == null) return null;
+ <%for (Iterator j = genDataType.getMemberTypes().iterator(); j.hasNext(); ) { GenDataType genMemberType = (GenDataType)j.next();%>
+ if (<%=genMemberType.getQualifiedClassifierAccessor()%>.isInstance(instanceValue))
+ {
+ try
+ {
+ <%if (genMemberType.getGenPackage() == genPackage) {%>
+ String value = convert<%=genMemberType.getName()%>ToString(<%=genMemberType.getQualifiedClassifierAccessor()%>, instanceValue);
+ <%} else {%>
+ String value = <%=genMemberType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()%>.convertToString(<%=genMemberType.getQualifiedClassifierAccessor()%>, instanceValue);
+ <%}%>
+ if (value != null) return value;
+ }
+ catch (Exception e)
+ {
+ }
+ }
+ <%}%>
+ throw new IllegalArgumentException("Invalid value: '"+instanceValue+"' for datatype :"+type.getName());
+ <%}%>
+ <%} else if (genDataType.isArrayType()) {%>
+ // TODO: implement this method
+ // Ensure that you remove @generated or mark it @generated NOT
+ throw new <%=genModel.getImportedName("java.lang.UnsupportedOperationException")%>();
+ <%} else {%>
+ return super.convertToString(type, instanceValue);
+ <%}%>
+ }
+
+ <%}%>
+<%}%>
+<%} else {%>
+ <%for (Iterator i=genPackage.getGenClasses().iterator(); i.hasNext();) { GenClass genClass = (GenClass)i.next();%>
+ <%if (genClass.hasFactoryInterfaceCreateMethod()) {%>
+ /**
+ * Returns a new object of class '<em><%=genClass.getFormattedName()%></em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em><%=genClass.getFormattedName()%></em>'.
+ * @generated
+ */
+ <%=genClass.getImportedInterfaceName()%> create<%=genClass.getName()%>();
+
+ <%}%>
+ <%}%>
+ <%if (genPackage.isDataTypeConverters()) {%>
+ <%for (Iterator i=genPackage.getAllGenDataTypes().iterator(); i.hasNext();) { GenDataType genDataType = (GenDataType)i.next();%>
+ <%if (genDataType.isSerializable()) {%>
+ /**
+ * Returns an instance of data type '<em><%=genDataType.getFormattedName()%></em>' corresponding the given literal.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param literal a literal of the data type.
+ * @return a new instance value of the data type.
+ * @generated
+ */
+ <%=genDataType.getImportedInstanceClassName()%> create<%=genDataType.getName()%>(String literal);
+
+ /**
+ * Returns a literal representation of an instance of data type '<em><%=genDataType.getFormattedName()%></em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param instanceValue an instance value of the data type.
+ * @return a literal representation of the instance value.
+ * @generated
+ */
+ String convert<%=genDataType.getName()%>(<%=genDataType.getImportedInstanceClassName()%> instanceValue);
+
+ <%}%>
+ <%}%>
+ <%}%>
+<%}%>
+} //<%=isInterface ? genPackage.getFactoryInterfaceName() : genPackage.getFactoryClassName()%>
+<%genModel.emitSortedImports();%>