From 2a444004802173fa97afbc389fc4a6600b6d3f88 Mon Sep 17 00:00:00 2001 From: lresende Date: Tue, 10 Nov 2009 19:19:55 +0000 Subject: moving SDO branches git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@834614 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/tuscany/sdo/generate/JavaGenerator.java | 739 ++++ .../tuscany/sdo/generate/XSD2JavaGenerator.java | 500 +++ .../adapter/SDOGenClassGeneratorAdapter.java | 53 + .../adapter/SDOGenModelGeneratorAdapter.java | 38 + .../SDOGenModelGeneratorAdapterFactory.java | 63 + .../adapter/SDOGenPackageGeneratorAdapter.java | 59 + .../sdo/generate/templates/model/SDOClass.java | 4288 ++++++++++++++++++++ .../generate/templates/model/SDOFactoryClass.java | 1132 ++++++ .../tuscany/sdo/generate/util/SDOGenUtil.java | 326 ++ 9 files changed, 7198 insertions(+) create mode 100644 sdo-java/branches/sdo-1.1-incubating/tools/src/main/java/org/apache/tuscany/sdo/generate/JavaGenerator.java create mode 100644 sdo-java/branches/sdo-1.1-incubating/tools/src/main/java/org/apache/tuscany/sdo/generate/XSD2JavaGenerator.java create mode 100644 sdo-java/branches/sdo-1.1-incubating/tools/src/main/java/org/apache/tuscany/sdo/generate/adapter/SDOGenClassGeneratorAdapter.java create mode 100644 sdo-java/branches/sdo-1.1-incubating/tools/src/main/java/org/apache/tuscany/sdo/generate/adapter/SDOGenModelGeneratorAdapter.java create mode 100644 sdo-java/branches/sdo-1.1-incubating/tools/src/main/java/org/apache/tuscany/sdo/generate/adapter/SDOGenModelGeneratorAdapterFactory.java create mode 100644 sdo-java/branches/sdo-1.1-incubating/tools/src/main/java/org/apache/tuscany/sdo/generate/adapter/SDOGenPackageGeneratorAdapter.java create mode 100644 sdo-java/branches/sdo-1.1-incubating/tools/src/main/java/org/apache/tuscany/sdo/generate/templates/model/SDOClass.java create mode 100644 sdo-java/branches/sdo-1.1-incubating/tools/src/main/java/org/apache/tuscany/sdo/generate/templates/model/SDOFactoryClass.java create mode 100644 sdo-java/branches/sdo-1.1-incubating/tools/src/main/java/org/apache/tuscany/sdo/generate/util/SDOGenUtil.java (limited to 'sdo-java/branches/sdo-1.1-incubating/tools/src/main/java/org/apache/tuscany/sdo/generate') diff --git a/sdo-java/branches/sdo-1.1-incubating/tools/src/main/java/org/apache/tuscany/sdo/generate/JavaGenerator.java b/sdo-java/branches/sdo-1.1-incubating/tools/src/main/java/org/apache/tuscany/sdo/generate/JavaGenerator.java new file mode 100644 index 0000000000..c735e55e2a --- /dev/null +++ b/sdo-java/branches/sdo-1.1-incubating/tools/src/main/java/org/apache/tuscany/sdo/generate/JavaGenerator.java @@ -0,0 +1,739 @@ +/** + * + * 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.Hashtable; +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.HelperContextImpl; +import org.apache.tuscany.sdo.impl.SDOPackageImpl; +import org.apache.tuscany.sdo.model.ModelFactory; +import org.apache.tuscany.sdo.model.internal.InternalFactory; +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.merge.java.JControlModel; +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 ] + * [ -javaPackage ] + * [ -prefix ] + * [ -noInterfaces ] + * [ -noContainment ] + * [ -noNotification ] + * [ -noUnsettable ] + * + * Not supported (future options): + * + * [ -arrayAccessors ] + * [ -generateLoader ] + * [ -interfaceDataObject ] + * [ -sparsePattern | -storePattern ] + * [ -noGenerate ] + * + * Basic options: + * + * -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". + * -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. + * is not necessary. + * + * Extended options: + * + * -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 + * -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. + * -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. + * -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". + * + * Following are planned but not supported yet: + * + * -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: + * ResourceImpl and 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", 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. + * -interfaceDataObject + * This option is used to generate static interfaces that extend commonj.sdo.DataObject + * -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. + * -noGenerate + * A basic implementation of this switch is in place, but is not fully implemented. An intention + * behind this is to provide commentary on the artifacts that would be generated. + * + * + */ +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_INTERFACE_DO=0x400; + public static int OPTION_NO_GENERATE=0x800; + + 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")) + { + System.out.println("Warning: -noEMF is deprecated. It is the default now."); + //genOptions |= OPTION_NO_EMF; + } + else if (args[index].equalsIgnoreCase("-interfaceDataObject")) + { + genOptions |= OPTION_INTERFACE_DO; + } + else if (args[index].equalsIgnoreCase("-noGenerate")) + { + genOptions |= OPTION_NO_GENERATE; + } + //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 HelperContextImpl(extendedMetaData, false)).getXSDHelper(); + + 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(); + } + } + + protected static void generatePackages(Collection packageList, String packageURI, String shortName, String targetDirectory, String javaPackage, String prefix, int genOptions) + { + Hashtable packageInfoTable = new Hashtable(); + packageInfoTable.put(packageURI, new PackageInfo(javaPackage, prefix, packageURI, shortName )); + generatePackages(packageList, targetDirectory, packageInfoTable, genOptions, false); + } + + protected static GenModel generatePackages(Collection packageList, String targetDirectory, Hashtable packageInfoTable, int genOptions, boolean allNamespaces ) + { + ResourceSet resourceSet = DataObjectUtil.createResourceSet(); + List usedGenPackages = new ArrayList(); + GenModel genModel = null; + ArrayList packagesToModel = new ArrayList(); + for (Iterator iter = packageList.iterator(); iter.hasNext();) + { + EPackage currentEPackage = (EPackage)iter.next(); + String packageNamespace = currentEPackage.getNsURI(); + PackageInfo packageInfo = (PackageInfo)packageInfoTable.get(packageNamespace); + boolean bTargetPackage = allNamespaces; + String javaPackage = null; + String prefix = null; + String shortName = null; + if( packageInfo != null ) + { + bTargetPackage = true; + javaPackage = packageInfo.getBasePackage(); + prefix = packageInfo.getPrefix(); + shortName = packageInfo.getShortName(); + } + String currentBasePackage = extractBasePackageName(currentEPackage, bTargetPackage ? javaPackage : null); + String currentPrefix = bTargetPackage && prefix != null ? prefix : CodeGenUtil.capName(shortName != null ? shortName : currentEPackage.getName()); + packageInfoTable.put(currentEPackage, new PackageInfo(currentBasePackage, currentPrefix, null, null )); + + if( allNamespaces || packageInfo != null ) + packagesToModel.add(currentEPackage); + else + { + GenPackage currentGenPackage = createGenPackage(currentEPackage, currentBasePackage, currentPrefix, genOptions, resourceSet); + usedGenPackages.add(currentGenPackage); + } + } + genModel = createGenPackages(packagesToModel, packageInfoTable, genOptions, resourceSet); + + if (genModel == null) return null; // nothing to generate + + //TODO Figure out which predefined packages are really "used" + usedGenPackages.add(createGenPackage(SDOPackageImpl.eINSTANCE, "org.apache.tuscany", "SDO", 0, resourceSet)); + usedGenPackages.add(createGenPackage((EPackage)ModelFactory.INSTANCE, "org.apache.tuscany.sdo", "Model", 0, resourceSet)); + usedGenPackages.add(createGenPackage((EPackage)InternalFactory.INSTANCE, "org.apache.tuscany.sdo.model", "Internal", 0, resourceSet)); + //usedGenPackages.add(createGenPackage((EPackage)JavaFactory.INSTANCE, "org.apache.tuscany.sdo.model", "Java", 0, resourceSet)); + //usedGenPackages.add(createGenPackage((EPackage)XMLFactory.INSTANCE, "org.apache.tuscany.sdo.model", "XML", 0, resourceSet)); + + genModel.getUsedGenPackages().addAll(usedGenPackages); + + // If the display namespace option is selected, Don't generate + if( (genOptions & OPTION_NO_GENERATE) == 0) + { + // Invoke the SDO JavaGenerator to generate the SDO classes + try + { + generateFromGenModel(genModel, new File(targetDirectory).getCanonicalPath(), genOptions); + } + catch (IOException e) + { + e.printStackTrace(); + } + } + + return genModel; + } + + /** + * @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(); + } + + protected static GenModel createGenPackages(Collection ePackages, Hashtable packageInfoTable, int genOptions, ResourceSet resourceSet) + { + GenModel genModel = ecore2GenModel(ePackages, packageInfoTable, genOptions); + + for (Iterator iter = ePackages.iterator(); iter.hasNext();) + { + EPackage ePackage = (EPackage)iter.next(); + + 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 genModel; + } + + 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(); + + // Return if nothing is found + if( resource == null ) + return; + + 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(); + Generator generator = new Generator() + { + public JControlModel getJControlModel() + { + if (jControlModel == null) + { + jControlModel = new JControlModel(); + } + return jControlModel; + } + }; + + + //if ((genOptions & OPTION_USE_EMF_PATTERNS) == 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) + { + ArrayList ePackages = new ArrayList(); + ePackages.add(ePackage); + Hashtable packageInfoTable = new Hashtable(); + packageInfoTable.put(ePackage, new PackageInfo(basePackage, prefix, null, null )); + return ecore2GenModel(ePackages, packageInfoTable, genOptions ); + } + + private static GenModel ecore2GenModel(Collection ePackages, Hashtable packageInfoTable, int genOptions) + { + GenModel genModel = GenModelFactory.eINSTANCE.createGenModel(); + genModel.initialize(ePackages); + + genModel.setRootExtendsInterface(""); + genModel.setRootImplementsInterface("commonj.sdo.DataObject"); + genModel.setRootExtendsClass("org.apache.tuscany.sdo.impl.ExtensibleDataObjectImpl"); + 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_USE_EMF_PATTERNS) == 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); + Collection packages = genModel.getGenPackages(); + for (Iterator iter1 = packages.iterator(); iter1.hasNext();) + { + GenPackage genPackage = (GenPackage)iter1.next(); + PackageInfo packageInfo = (PackageInfo)packageInfoTable.get(genPackage.getEcorePackage()); + + if (packageInfo.getBasePackage() != null) + { + genPackage.setBasePackage(packageInfo.getBasePackage()); + } + if (packageInfo.getPrefix() != null) + { + genPackage.setPrefix(packageInfo.getPrefix()); + } + + //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 iter2 = genPackage.getGenClasses().iterator(); iter2.hasNext();) + { + GenClass genClass = (GenClass)iter2.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: this is a deprecated command replaced by XSD2JavaGenerator"); + } + + public static class PackageInfo + { + private String basePackage; + private String prefix; + private String namespace; + private String shortName; + + public PackageInfo(String basePackage, String prefix, String namespace, String shortName ) + { + setBasePackage(basePackage); + setPrefix(prefix); + setNamespace(namespace); + setShortName(shortName); + } + + public void setBasePackage(String basePackage) { this.basePackage = basePackage; } + public String getBasePackage() { return basePackage; } + public void setPrefix(String prefix) { this.prefix = prefix; } + public String getPrefix() { return prefix; } + public void setNamespace(String namespace) { this.namespace = namespace; } + public String getNamespace() { return namespace; } + public void setShortName(String shortName) { this.shortName = shortName; } + public String getShortName() { return shortName; } + } +} diff --git a/sdo-java/branches/sdo-1.1-incubating/tools/src/main/java/org/apache/tuscany/sdo/generate/XSD2JavaGenerator.java b/sdo-java/branches/sdo-1.1-incubating/tools/src/main/java/org/apache/tuscany/sdo/generate/XSD2JavaGenerator.java new file mode 100644 index 0000000000..7e65549165 --- /dev/null +++ b/sdo-java/branches/sdo-1.1-incubating/tools/src/main/java/org/apache/tuscany/sdo/generate/XSD2JavaGenerator.java @@ -0,0 +1,500 @@ +/** + * + * 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.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileReader; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Hashtable; +import java.util.Iterator; +import java.util.List; + +import org.apache.tuscany.sdo.helper.HelperContextImpl; +import org.apache.tuscany.sdo.helper.XSDHelperImpl; +import org.apache.tuscany.sdo.util.DataObjectUtil; +import org.eclipse.emf.codegen.ecore.genmodel.GenClass; +import org.eclipse.emf.codegen.ecore.genmodel.GenFeature; +import org.eclipse.emf.codegen.ecore.genmodel.GenModel; +import org.eclipse.emf.codegen.ecore.genmodel.GenPackage; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EClassifier; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EStructuralFeature; +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.HelperContext; +import commonj.sdo.helper.XSDHelper; + +public class XSD2JavaGenerator extends JavaGenerator +{ + /** + * Generate static SDOs from XML Schema + * + * Usage arguments: see JavaGenerator + * + * [ -targetDirectory ] + * [ -javaPackage ] + * [ -schemaNamespace ] + * [ -namespaceInfo ] + * [ other options ... ] + * | + * + * 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. Specify + * 'all' and this parameter will act as a wildcard selecting all namespaces for code generation. + * -namespaceInfo + * Specifies the name of a file that should contain a list of namespaces and their associated package names. + * Optionally, a prefix may be assigned to each namespace as well. These values are separated by semicolons. + * So each line in the file would look something like this: + * + * some\namespace;custom.package.name;optionalPrefix + * + * 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 (Exception e) + { + e.printStackTrace(); + printUsage(); + } + } + + + protected String schemaNamespace = null; + protected String namespaceInfo = null; + protected String generateBuiltIn = null; + protected static GeneratedPackages generatedPackages = null; + protected boolean allNamespaces = false; + + protected int handleArgument(String args[], int index) + { + if (args[index].equalsIgnoreCase("-schemaNamespace")) + { + schemaNamespace = args[++index]; + if( "all".equalsIgnoreCase(schemaNamespace) ) + { + schemaNamespace = null; + allNamespaces = true; + } + } + else if (args[index].equalsIgnoreCase("-generateBuiltIn")) + { + // Internal option used when regenerating one of the built-in (predefined) models (e.g., commonj.sdo). + generateBuiltIn = args[++index]; + } + else if (args[index].equalsIgnoreCase("-namespaceInfo")) + { + namespaceInfo = args[++index]; + } + else + { + return super.handleArgument(args, index); + } + + return index + 1; + } + + protected void run(String args[]) + { + String xsdFileName = args[inputIndex]; + EPackage.Registry packageRegistry = new EPackageRegistryImpl(EPackage.Registry.INSTANCE); + ExtendedMetaData extendedMetaData = new BasicExtendedMetaData(packageRegistry); + String packageURI = getSchemaNamespace(xsdFileName); + Hashtable packageInfoTable = createPackageInfoTable(packageURI, schemaNamespace, javaPackage, prefix, namespaceInfo ); + generateFromXMLSchema(xsdFileName, packageRegistry, extendedMetaData, targetDirectory, packageInfoTable, genOptions, generateBuiltIn, allNamespaces); + } + + /** + * This method was invoked by the SDO Mojo plugin + * + * @param xsdFileName + * @param namespace + * @param targetDirectory + * @param javaPackage + * @param prefix + * @param genOptions + */ + public static void generateFromXMLSchema(String xsdFileName, String namespace, String targetDirectory, String javaPackage, String prefix, int genOptions) + { + boolean allNamespaces = false; + + // Need to process the passed-in schemaNamespace value from Mojo plugin the same as the command line + if( "all".equalsIgnoreCase(namespace)) + { + namespace = null; + allNamespaces = true; + } + + EPackage.Registry packageRegistry = new EPackageRegistryImpl(EPackage.Registry.INSTANCE); + ExtendedMetaData extendedMetaData = new BasicExtendedMetaData(packageRegistry); + String packageURI = getSchemaNamespace(xsdFileName); + Hashtable packageInfoTable = createPackageInfoTable(packageURI, namespace, javaPackage, prefix, null ); + generateFromXMLSchema(xsdFileName, packageRegistry, extendedMetaData, targetDirectory, packageInfoTable, genOptions, null, allNamespaces); + } + + + protected static GenModel generateFromXMLSchema(String xsdFileName, + EPackage.Registry packageRegistry, + ExtendedMetaData extendedMetaData, + String targetDirectory, + Hashtable packageInfoTable, + int genOptions, + String regenerateBuiltIn, + boolean allNamespaces ) + { + GenModel genModel = null; + + HelperContext hc = new HelperContextImpl(extendedMetaData, false); + XSDHelper xsdHelper = hc.getXSDHelper(); + ((XSDHelperImpl)xsdHelper).setRedefineBuiltIn(regenerateBuiltIn); + + 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()) + { + genModel = generatePackages(packageRegistry.values(), targetDirectory, packageInfoTable, genOptions, allNamespaces ); + // For now, this option is not supported + /* + if( (genModel != null) ) + { + if((extendedMetaData != null)) + { + // Display only, will report all namespaces and associated packages found + List genPackages = genModel.getGenPackages(); + for (Iterator iter = genPackages.iterator(); iter.hasNext();) + { + GenPackage genPackage = (GenPackage)iter.next(); + EPackage ecorePackage = genPackage.getEcorePackage(); + if( (genOptions & OPTION_DISPLAY_NAMESPACES) != 0) + System.out.println(extendedMetaData.getNamespace(ecorePackage)+";"+genPackage.getInterfacePackageName()+"."+ecorePackage.getName()); + } + } + } + */ + } else { + System.err.println("Input schema file " + xsdFileName + " defined no metadata."); + } + + /* + 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(); + } + return genModel; + } + + 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); + String targetNS = schema.getTargetNamespace(); + if (targetNS == null) { + targetNS = schema.getSchemaLocation(); + } + + return targetNS; + } + + protected static void printUsage() + { + System.out.println("Usage arguments:"); + System.out.println(" [ -targetDirectory ]"); + System.out.println(" [ -javaPackage ]"); + System.out.println(" [ -prefix ]"); + System.out.println(" [ -schemaNamespace ]"); + System.out.println(" [ -namespaceInfo ]"); + System.out.println(" [ -noInterfaces ]"); + System.out.println(" [ -noContainment ]"); + System.out.println(" [ -noNotification ]"); + System.out.println(" [ -noUnsettable ]"); + /* Future Option: System.out.println(" [ -sparsePattern | -storePattern ]"); */ + /* Future Option: System.out.println(" [ -arrayAccessors ]"); */ + /* Future Option: System.out.println(" [ -generateLoader ]"); */ + /* Future Option: System.out.println(" [ -interfaceDataObject ]"); */ + System.out.println(" | "); + System.out.println(""); + System.out.println("For example:"); + System.out.println(""); + System.out.println(" generate somedir/somefile.xsd"); + } + + public void generateFromXMLSchema(String args[]) + { + try + { + processArguments(args); + EPackage.Registry packageRegistry = new EPackageRegistryImpl(EPackage.Registry.INSTANCE); + ExtendedMetaData extendedMetaData = new BasicExtendedMetaData(packageRegistry); + String xsdFileName = args[inputIndex]; + String packageURI = getSchemaNamespace(xsdFileName); + Hashtable packageInfoTable = createPackageInfoTable(packageURI, schemaNamespace, javaPackage, prefix, namespaceInfo ); + GenModel genModel = generateFromXMLSchema(xsdFileName, packageRegistry, extendedMetaData, targetDirectory, packageInfoTable, genOptions, generateBuiltIn, allNamespaces); + generatedPackages = new GeneratedPackages(genModel,extendedMetaData); + } + catch (IllegalArgumentException e) + { + printUsage(); + } + } + + private static Hashtable createPackageInfoTable( String packageURI, String schemaNamespace, String javaPackage, String prefix, String namespaceInfo ) + { + Hashtable packageInfoTable = new Hashtable(); + + if( namespaceInfo != null ) + { + try + { + FileReader inputFile = new FileReader(namespaceInfo); + BufferedReader bufRead = new BufferedReader(inputFile); + + String line = bufRead.readLine(); + while( line != null ) + { + if( line.length() > 0 ) + { + String [] options = line.split(";"); + if( options.length > 1 ) + { + if( options.length > 2 ) + packageInfoTable.put(options[0], new PackageInfo(options[1], options[2], options[0], null )); + else + packageInfoTable.put(options[0], new PackageInfo(options[1], null, options[0], null )); + } + else + packageInfoTable.put(options[0], new PackageInfo(null, null, options[0], null )); + } + line = bufRead.readLine(); + } + } + catch (IOException e) + { + e.printStackTrace(); + } + } + else + { + if( schemaNamespace != null ) + packageInfoTable.put(schemaNamespace, new PackageInfo(javaPackage, prefix, schemaNamespace, null )); + else if( packageURI != null ) + packageInfoTable.put(packageURI, new PackageInfo(javaPackage, prefix, null, null )); + } + return packageInfoTable; + } + + public List getGeneratedPackageInfo() + { + if( generatedPackages != null ) + return generatedPackages.getPackageList(); + else + return null; + } + + protected class GeneratedPackages + { + private List genPackages = null; + + GeneratedPackages(GenModel genModel, ExtendedMetaData extendedMetaData) + { + List packages = genModel.getGenPackages(); + Hashtable genClasses = new Hashtable(); + for (Iterator iter = packages.iterator(); iter.hasNext();) + { + // loop through the list, once to build up the eclass to genclass mapper + GenPackage genPackage = (GenPackage)iter.next(); + List classes = genPackage.getGenClasses(); + for (Iterator classIter = classes.iterator(); classIter.hasNext();) + { + GenClass genClass = (GenClass)classIter.next(); + genClasses.put(genClass.getEcoreClass(), genClass); + } + } + genPackages = new ArrayList(); + for (Iterator iter = packages.iterator(); iter.hasNext();) + { + // now process the pckage list + GenPackage genPackage = (GenPackage)iter.next(); + genPackages.add(new GeneratedPackage(genPackage,extendedMetaData,genClasses)); + } + } + + List getPackageList() {return genPackages;} + } + + public class GeneratedPackage + { + private String namespace; + private Hashtable classes; + + public String getNamespace() {return namespace;} + public List getClasses() {return new ArrayList(classes.values());} + + GeneratedPackage(GenPackage genPackage, ExtendedMetaData extendedMetaData, Hashtable eclassGenClassMap ) + { + classes = new Hashtable(); + + EPackage ePackage = genPackage.getEcorePackage(); + namespace = extendedMetaData.getNamespace(ePackage); + + List genClasses = genPackage.getGenClasses(); + for (Iterator iterClass = genClasses.iterator(); iterClass.hasNext();) + { + GenClass genClass = (GenClass)iterClass.next(); + if ("DocumentRoot".equals(genClass.getEcoreClass().getName())) { + List features = genClass.getGenFeatures(); + for (Iterator iterFeatures = features.iterator(); iterFeatures.hasNext();) + { + GenFeature feature = (GenFeature)iterFeatures.next(); + addGlobalElement(feature.getEcoreFeature(),extendedMetaData, eclassGenClassMap); + } + } + } + } + + private void addGlobalElement(EStructuralFeature eFeature, ExtendedMetaData extendedMetaData, Hashtable eclassGenClassMap ) + { + + String name = eFeature.getName(); + String classname = ""; + boolean anonymous = false; + List propertyClassNames = null; + + EClassifier eClassifier = eFeature.getEType(); + + if( eClassifier instanceof EClass ) + { + // complex type + EClass eClass = (EClass)eClassifier; + GenClass genEClass = (GenClass)eclassGenClassMap.get(eClassifier); + if( genEClass != null ) + { + classname = genEClass.getGenPackage().getInterfacePackageName() + + '.' + genEClass.getInterfaceName(); + anonymous = extendedMetaData.isAnonymous(eClass); + + // Build list of property names + propertyClassNames = new ArrayList(); + List properties = eClass.getEStructuralFeatures(); + for (Iterator iterProperties = properties.iterator(); iterProperties.hasNext();) + { + EStructuralFeature property = (EStructuralFeature)iterProperties.next(); + EClassifier propertyType = property.getEType(); + if (propertyType instanceof EClass) + { + GenClass propertyGenClass = (GenClass)eclassGenClassMap.get(propertyType); + if( propertyGenClass != null ) + { + String propertyClassName = propertyGenClass.getGenPackage().getInterfacePackageName() + '.' + + propertyGenClass.getInterfaceName(); + propertyClassNames.add(propertyClassName); + } + } + else if (propertyType instanceof EClassifier) + { + String propertyClassName = propertyType.getInstanceClass().getName(); + propertyClassNames.add(propertyClassName); + } + } + } + } + else + { + // simple type + classname = eClassifier.getInstanceClass().getName(); + } + classes.put( name, new PackageClassInfo( name, classname, anonymous, propertyClassNames ) ); + } + + public class PackageClassInfo + { + private String name; + private String className = null; + private boolean anonymous = false; + private List properties = null; + + PackageClassInfo( String name, String className, boolean anonymous, List properties ) + { + this.name = name; + this.className = className; + this.anonymous = anonymous; + this.properties = properties; + } + + public String getName() {return name;} + public String getClassName() {return className;} + public boolean getAnonymous() {return anonymous;} + public List getProperties() {return properties;} + } + } +} diff --git a/sdo-java/branches/sdo-1.1-incubating/tools/src/main/java/org/apache/tuscany/sdo/generate/adapter/SDOGenClassGeneratorAdapter.java b/sdo-java/branches/sdo-1.1-incubating/tools/src/main/java/org/apache/tuscany/sdo/generate/adapter/SDOGenClassGeneratorAdapter.java new file mode 100644 index 0000000000..d522ad5fad --- /dev/null +++ b/sdo-java/branches/sdo-1.1-incubating/tools/src/main/java/org/apache/tuscany/sdo/generate/adapter/SDOGenClassGeneratorAdapter.java @@ -0,0 +1,53 @@ +/** + * + * 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; +import org.eclipse.emf.common.util.Monitor; + +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; + } + + protected void ensureProjectExists(String workspacePath, Object object, + Object projectType, boolean force, Monitor monitor) + { + // Do nothing -- this avoids differential behaviour according to whether we + // are running in Eclipse or not + } +} diff --git a/sdo-java/branches/sdo-1.1-incubating/tools/src/main/java/org/apache/tuscany/sdo/generate/adapter/SDOGenModelGeneratorAdapter.java b/sdo-java/branches/sdo-1.1-incubating/tools/src/main/java/org/apache/tuscany/sdo/generate/adapter/SDOGenModelGeneratorAdapter.java new file mode 100644 index 0000000000..16678e001b --- /dev/null +++ b/sdo-java/branches/sdo-1.1-incubating/tools/src/main/java/org/apache/tuscany/sdo/generate/adapter/SDOGenModelGeneratorAdapter.java @@ -0,0 +1,38 @@ +/** + * + * 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.GenModelGeneratorAdapter; +import org.eclipse.emf.common.util.Monitor; + +public class SDOGenModelGeneratorAdapter extends GenModelGeneratorAdapter { + + public SDOGenModelGeneratorAdapter( + GeneratorAdapterFactory generatorAdapterFactory) { + super(generatorAdapterFactory); + } + + protected void ensureProjectExists(String workspacePath, Object object, + Object projectType, boolean force, Monitor monitor) { + // Do nothing -- this avoids differential behaviour according to whether we + // are running in Eclipse or not + } +} diff --git a/sdo-java/branches/sdo-1.1-incubating/tools/src/main/java/org/apache/tuscany/sdo/generate/adapter/SDOGenModelGeneratorAdapterFactory.java b/sdo-java/branches/sdo-1.1-incubating/tools/src/main/java/org/apache/tuscany/sdo/generate/adapter/SDOGenModelGeneratorAdapterFactory.java new file mode 100644 index 0000000000..dfe62878af --- /dev/null +++ b/sdo-java/branches/sdo-1.1-incubating/tools/src/main/java/org/apache/tuscany/sdo/generate/adapter/SDOGenModelGeneratorAdapterFactory.java @@ -0,0 +1,63 @@ +/** + * + * 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; + } + + public Adapter createGenModelAdapter() + { + if (genModelGeneratorAdapter == null) + { + genModelGeneratorAdapter = new SDOGenModelGeneratorAdapter(this); + } + return genModelGeneratorAdapter; + } +} diff --git a/sdo-java/branches/sdo-1.1-incubating/tools/src/main/java/org/apache/tuscany/sdo/generate/adapter/SDOGenPackageGeneratorAdapter.java b/sdo-java/branches/sdo-1.1-incubating/tools/src/main/java/org/apache/tuscany/sdo/generate/adapter/SDOGenPackageGeneratorAdapter.java new file mode 100644 index 0000000000..6616be995c --- /dev/null +++ b/sdo-java/branches/sdo-1.1-incubating/tools/src/main/java/org/apache/tuscany/sdo/generate/adapter/SDOGenPackageGeneratorAdapter.java @@ -0,0 +1,59 @@ +/** + * + * 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 + } + + protected void ensureProjectExists(String workspacePath, Object object, + Object projectType, boolean force, Monitor monitor) + { + // Do nothing -- this avoids differential behaviour according to whether we + // are running in Eclipse or not + } +} diff --git a/sdo-java/branches/sdo-1.1-incubating/tools/src/main/java/org/apache/tuscany/sdo/generate/templates/model/SDOClass.java b/sdo-java/branches/sdo-1.1-incubating/tools/src/main/java/org/apache/tuscany/sdo/generate/templates/model/SDOClass.java new file mode 100644 index 0000000000..74e6a77699 --- /dev/null +++ b/sdo-java/branches/sdo-1.1-incubating/tools/src/main/java/org/apache/tuscany/sdo/generate/templates/model/SDOClass.java @@ -0,0 +1,4288 @@ +package org.apache.tuscany.sdo.generate.templates.model; + +import org.eclipse.emf.codegen.util.*; +import org.apache.tuscany.sdo.impl.*; +import java.util.*; +import org.eclipse.emf.codegen.ecore.genmodel.*; +import org.apache.tuscany.sdo.generate.util.*; + +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 + " * " + NL + " * " + 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 + " // EYECATCHER 1"; + protected final String TEXT_12 = NL + "/**" + NL + " * " + NL + " * A representation of the model object '"; + protected final String TEXT_13 = "'." + NL + " * "; + protected final String TEXT_14 = NL + " *" + NL + " * " + NL + " * "; + protected final String TEXT_15 = NL + " * "; + protected final String TEXT_16 = NL + " *"; + protected final String TEXT_17 = NL + " *

" + NL + " * The following features are supported:" + NL + " *

    "; + protected final String TEXT_18 = NL + " *
  • {@link "; + protected final String TEXT_19 = "#"; + protected final String TEXT_20 = " "; + protected final String TEXT_21 = "}
  • "; + protected final String TEXT_22 = NL + " *
" + NL + " *

"; + protected final String TEXT_23 = NL + " *"; + protected final String TEXT_24 = NL + " * @see "; + protected final String TEXT_25 = "#get"; + protected final String TEXT_26 = "()"; + protected final String TEXT_27 = NL + " * @model "; + protected final String TEXT_28 = NL + " * "; + protected final String TEXT_29 = NL + " * @model"; + protected final String TEXT_30 = NL + " * @extends "; + protected final String TEXT_31 = NL + " * @generated" + NL + " */"; + protected final String TEXT_32 = NL + "/**" + NL + " * " + NL + " * An implementation of the model object '"; + protected final String TEXT_33 = "'." + NL + " * " + NL + " *

"; + protected final String TEXT_34 = NL + " * The following features are implemented:" + NL + " *

    "; + protected final String TEXT_35 = NL + " *
  • {@link "; + protected final String TEXT_36 = "#"; + protected final String TEXT_37 = " "; + protected final String TEXT_38 = "}
  • "; + protected final String TEXT_39 = NL + " *
"; + protected final String TEXT_40 = NL + " *

" + NL + " *" + NL + " * @generated" + NL + " */"; + protected final String TEXT_41 = NL + "public"; + protected final String TEXT_42 = " abstract"; + protected final String TEXT_43 = " class "; + protected final String TEXT_44 = NL + "public interface "; + protected final String TEXT_45 = NL + "{"; + protected final String TEXT_46 = NL + "\t/**" + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\t"; + protected final String TEXT_47 = " copyright = \""; + protected final String TEXT_48 = "\";"; + protected final String TEXT_49 = NL; + protected final String TEXT_50 = NL + "\t/**" + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static final "; + protected final String TEXT_51 = " mofDriverNumber = \""; + protected final String TEXT_52 = "\";"; + protected final String TEXT_53 = NL; + protected final String TEXT_54 = NL + "\t/**" + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final long serialVersionUID = 1L;" + NL; + protected final String TEXT_55 = NL + "\t/**" + NL + "\t * An array of objects representing the values of non-primitive features." + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected Object[] "; + protected final String TEXT_56 = " = null;" + NL; + protected final String TEXT_57 = NL + "\t/**" + NL + "\t * A bit field representing the indices of non-primitive feature values." + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected int "; + protected final String TEXT_58 = " = 0;" + NL; + protected final String TEXT_59 = NL + "\t/**" + NL + "\t * A set of bit flags representing the values of boolean attributes and whether unsettable features have been set." + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t * @ordered" + NL + "\t */" + NL + "\tprotected int "; + protected final String TEXT_60 = " = 0;" + NL; + protected final String TEXT_61 = NL; + protected final String TEXT_62 = NL + "\tpublic final static int "; + protected final String TEXT_63 = " = "; + protected final String TEXT_64 = ";" + NL; + protected final String TEXT_65 = NL + "\tpublic final static int "; + protected final String TEXT_66 = " = "; + protected final String TEXT_67 = ";" + NL; + protected final String TEXT_68 = NL + "\tpublic final static int SDO_PROPERTY_COUNT = "; + protected final String TEXT_69 = ";" + NL; + protected final String TEXT_70 = NL + "\tpublic final static int EXTENDED_PROPERTY_COUNT = "; + protected final String TEXT_71 = ";" + NL + NL; + protected final String TEXT_72 = NL + "\t/**" + NL + "\t * The internal feature id for the '"; + protected final String TEXT_73 = "' "; + protected final String TEXT_74 = "." + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t * @ordered" + NL + "\t */"; + protected final String TEXT_75 = " " + NL + "\tpublic final static int _INTERNAL_"; + protected final String TEXT_76 = " = "; + protected final String TEXT_77 = ";" + NL; + protected final String TEXT_78 = NL + "\t/**" + NL + "\t * The number of properties for this type." + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t * @ordered" + NL + "\t */"; + protected final String TEXT_79 = NL + "\tpublic final static int INTERNAL_PROPERTY_COUNT = "; + protected final String TEXT_80 = ";" + NL + "" + NL + "\tprotected int internalConvertIndex(int internalIndex)" + NL + "\t{" + NL + "\t\tswitch (internalIndex)" + NL + "\t\t{"; + protected final String TEXT_81 = NL + "\t\t\tcase _INTERNAL_"; + protected final String TEXT_82 = ": return "; + protected final String TEXT_83 = ";"; + protected final String TEXT_84 = NL + "\t\t}" + NL + "\t\treturn super.internalConvertIndex(internalIndex);" + NL + "\t}" + NL + NL; + protected final String TEXT_85 = NL + "\t/**" + NL + "\t * The cached value of the '{@link #"; + protected final String TEXT_86 = "() "; + protected final String TEXT_87 = "}' "; + protected final String TEXT_88 = "." + NL + "\t * " + NL + "\t * " + NL + "\t * @see #"; + protected final String TEXT_89 = "()" + NL + "\t * @generated" + NL + "\t * @ordered" + NL + "\t */" + NL + "\t" + NL + "\tprotected "; + protected final String TEXT_90 = " "; + protected final String TEXT_91 = " = null;" + NL + "\t"; + protected final String TEXT_92 = NL + "\t/**" + NL + "\t * The empty value for the '{@link #"; + protected final String TEXT_93 = "() "; + protected final String TEXT_94 = "}' array accessor." + NL + "\t * " + NL + "\t * " + NL + "\t * @see #"; + protected final String TEXT_95 = "()" + NL + "\t * @generated" + NL + "\t * @ordered" + NL + "\t */" + NL + "\tprotected static final "; + protected final String TEXT_96 = "[] "; + protected final String TEXT_97 = "_EEMPTY_ARRAY = new "; + protected final String TEXT_98 = " [0];" + NL; + protected final String TEXT_99 = NL + "\t/**" + NL + "\t * The default value of the '{@link #"; + protected final String TEXT_100 = "() "; + protected final String TEXT_101 = "}' "; + protected final String TEXT_102 = "." + NL + "\t * " + NL + "\t * " + NL + "\t * @see #"; + protected final String TEXT_103 = "()" + NL + "\t * @generated" + NL + "\t * @ordered" + NL + "\t */" + NL + "\tprotected static final "; + protected final String TEXT_104 = " "; + protected final String TEXT_105 = "_DEFAULT_ = "; + protected final String TEXT_106 = ";"; + protected final String TEXT_107 = NL; + protected final String TEXT_108 = 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 * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t * @ordered" + NL + "\t */" + NL + "\tprotected int "; + protected final String TEXT_109 = " = 0;" + NL; + protected final String TEXT_110 = NL + "\t/**" + NL + "\t * The flag representing the value of the '{@link #"; + protected final String TEXT_111 = "() "; + protected final String TEXT_112 = "}' "; + protected final String TEXT_113 = "." + NL + "\t * " + NL + "\t * " + NL + "\t * @see #"; + protected final String TEXT_114 = "()" + NL + "\t * @generated" + NL + "\t * @ordered" + NL + "\t */" + NL + "\tprotected static final int "; + protected final String TEXT_115 = "_EFLAG = 1 "; + protected final String TEXT_116 = ";" + NL; + protected final String TEXT_117 = NL + "\t/**" + NL + "\t * The cached value of the '{@link #"; + protected final String TEXT_118 = "() "; + protected final String TEXT_119 = "}' "; + protected final String TEXT_120 = "." + NL + "\t * " + NL + "\t * " + NL + "\t * @see #"; + protected final String TEXT_121 = "()" + NL + "\t * @generated" + NL + "\t * @ordered" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_122 = " "; + protected final String TEXT_123 = " = "; + protected final String TEXT_124 = "_DEFAULT_;" + NL; + protected final String TEXT_125 = 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 * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t * @ordered" + NL + "\t */" + NL + "\tprotected int "; + protected final String TEXT_126 = " = 0;" + NL; + protected final String TEXT_127 = NL + "\t/**" + NL + "\t * The flag representing whether the "; + protected final String TEXT_128 = " "; + protected final String TEXT_129 = " has been set." + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t * @ordered" + NL + "\t */" + NL + "\tprotected static final int "; + protected final String TEXT_130 = "_ESETFLAG = 1 "; + protected final String TEXT_131 = ";" + NL; + protected final String TEXT_132 = NL + "\t/**" + NL + "\t * This is true if the "; + protected final String TEXT_133 = " "; + protected final String TEXT_134 = " has been set." + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t * @ordered" + NL + "\t */" + NL + "\tprotected boolean "; + protected final String TEXT_135 = "_set_ = false;" + NL; + protected final String TEXT_136 = NL + "\t/**" + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_137 = "()" + NL + "\t{" + NL + "\t\tsuper();"; + protected final String TEXT_138 = NL + "\t\t"; + protected final String TEXT_139 = " |= "; + protected final String TEXT_140 = "_EFLAG;"; + protected final String TEXT_141 = NL + "\t\tcreateChangeSummary("; + protected final String TEXT_142 = ");"; + protected final String TEXT_143 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_144 = " getStaticType()" + NL + "\t{" + NL + "\t\treturn (("; + protected final String TEXT_145 = ")"; + protected final String TEXT_146 = ".INSTANCE).get"; + protected final String TEXT_147 = "();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic int getStaticPropertyCount()" + NL + "\t{" + NL + "\t\treturn INTERNAL_PROPERTY_COUNT;" + NL + "\t}" + NL; + protected final String TEXT_148 = NL + "\t/**" + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */"; + protected final String TEXT_149 = NL + "\t"; + protected final String TEXT_150 = "[] "; + protected final String TEXT_151 = "();" + NL; + protected final String TEXT_152 = NL + "\tpublic "; + protected final String TEXT_153 = "[] "; + protected final String TEXT_154 = "()" + NL + "\t{"; + protected final String TEXT_155 = NL + "\t\t"; + protected final String TEXT_156 = " list = ("; + protected final String TEXT_157 = ")"; + protected final String TEXT_158 = "();" + NL + "\t\tif (list.isEmpty()) return "; + protected final String TEXT_159 = "_EEMPTY_ARRAY;"; + protected final String TEXT_160 = NL + "\t\tif ("; + protected final String TEXT_161 = " == null || "; + protected final String TEXT_162 = ".isEmpty()) return "; + protected final String TEXT_163 = "_EEMPTY_ARRAY;" + NL + "\t\t"; + protected final String TEXT_164 = " list = ("; + protected final String TEXT_165 = ")"; + protected final String TEXT_166 = ";"; + protected final String TEXT_167 = NL + "\t\tlist.shrink();" + NL + "\t\treturn ("; + protected final String TEXT_168 = "[])list.data();" + NL + "\t}" + NL; + protected final String TEXT_169 = NL + "\t/**" + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */"; + protected final String TEXT_170 = NL + "\t"; + protected final String TEXT_171 = " get"; + protected final String TEXT_172 = "(int index);"; + protected final String TEXT_173 = NL + "\tpublic "; + protected final String TEXT_174 = " get"; + protected final String TEXT_175 = "(int index)" + NL + "\t{" + NL + "\t\treturn ("; + protected final String TEXT_176 = ")"; + protected final String TEXT_177 = "().get(index);" + NL + "\t}"; + protected final String TEXT_178 = NL + "\t/**" + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */"; + protected final String TEXT_179 = NL + "\tint get"; + protected final String TEXT_180 = "Length();" + NL; + protected final String TEXT_181 = NL + "\tpublic int get"; + protected final String TEXT_182 = "Length()" + NL + "\t{"; + protected final String TEXT_183 = NL + "\t\treturn "; + protected final String TEXT_184 = "().size();"; + protected final String TEXT_185 = NL + "\t\treturn "; + protected final String TEXT_186 = " == null ? 0 : "; + protected final String TEXT_187 = ".size();"; + protected final String TEXT_188 = NL + "\t}" + NL; + protected final String TEXT_189 = NL + "\t/**" + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */"; + protected final String TEXT_190 = NL + "\tvoid set"; + protected final String TEXT_191 = "("; + protected final String TEXT_192 = "[] new"; + protected final String TEXT_193 = ");" + NL; + protected final String TEXT_194 = NL + "\tpublic void set"; + protected final String TEXT_195 = "("; + protected final String TEXT_196 = "[] new"; + protected final String TEXT_197 = ")" + NL + "\t{" + NL + "\t\t(("; + protected final String TEXT_198 = ")"; + protected final String TEXT_199 = "()).setData(new"; + protected final String TEXT_200 = ".length, new"; + protected final String TEXT_201 = ");" + NL + "\t}" + NL; + protected final String TEXT_202 = NL + "\t/**" + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */"; + protected final String TEXT_203 = NL + "\tvoid set"; + protected final String TEXT_204 = "(int index, "; + protected final String TEXT_205 = " element);" + NL; + protected final String TEXT_206 = NL + "\tpublic void set"; + protected final String TEXT_207 = "(int index, "; + protected final String TEXT_208 = " element)" + NL + "\t{" + NL + "\t\t"; + protected final String TEXT_209 = "().set(index, element);" + NL + "\t}" + NL; + protected final String TEXT_210 = NL + "\t/**" + NL + "\t * Returns the value of the '"; + protected final String TEXT_211 = "' "; + protected final String TEXT_212 = "."; + protected final String TEXT_213 = NL + "\t * The key is of type "; + protected final String TEXT_214 = "list of {@link "; + protected final String TEXT_215 = "}"; + protected final String TEXT_216 = "{@link "; + protected final String TEXT_217 = "}"; + protected final String TEXT_218 = "," + NL + "\t * and the value is of type "; + protected final String TEXT_219 = "list of {@link "; + protected final String TEXT_220 = "}"; + protected final String TEXT_221 = "{@link "; + protected final String TEXT_222 = "}"; + protected final String TEXT_223 = ","; + protected final String TEXT_224 = NL + "\t * The list contents are of type {@link "; + protected final String TEXT_225 = "}."; + protected final String TEXT_226 = NL + "\t * The default value is "; + protected final String TEXT_227 = "."; + protected final String TEXT_228 = NL + "\t * The literals are from the enumeration {@link "; + protected final String TEXT_229 = "}."; + protected final String TEXT_230 = NL + "\t * It is bidirectional and its opposite is '{@link "; + protected final String TEXT_231 = "#"; + protected final String TEXT_232 = " "; + protected final String TEXT_233 = "}'."; + protected final String TEXT_234 = NL + "\t * "; + protected final String TEXT_235 = NL + "\t *

" + NL + "\t * If the meaning of the '"; + protected final String TEXT_236 = "' "; + protected final String TEXT_237 = " isn't clear," + NL + "\t * there really should be more of a description here..." + NL + "\t *

"; + protected final String TEXT_238 = NL + "\t * "; + protected final String TEXT_239 = NL + "\t * " + NL + "\t * "; + protected final String TEXT_240 = NL + "\t * "; + protected final String TEXT_241 = NL + "\t * @return the value of the '"; + protected final String TEXT_242 = "' "; + protected final String TEXT_243 = "."; + protected final String TEXT_244 = NL + "\t * @see "; + protected final String TEXT_245 = NL + "\t * @see #isSet"; + protected final String TEXT_246 = "()"; + protected final String TEXT_247 = NL + "\t * @see #unset"; + protected final String TEXT_248 = "()"; + protected final String TEXT_249 = NL + "\t * @see #set"; + protected final String TEXT_250 = "("; + protected final String TEXT_251 = ")"; + protected final String TEXT_252 = NL + "\t * @see "; + protected final String TEXT_253 = "#get"; + protected final String TEXT_254 = "()"; + protected final String TEXT_255 = NL + "\t * @see "; + protected final String TEXT_256 = "#"; + protected final String TEXT_257 = NL + "\t * @model "; + protected final String TEXT_258 = NL + "\t * "; + protected final String TEXT_259 = NL + "\t * @model"; + protected final String TEXT_260 = NL + "\t * @generated" + NL + "\t */"; + protected final String TEXT_261 = NL + "\t/**" + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */"; + protected final String TEXT_262 = NL + "\t"; + protected final String TEXT_263 = " "; + protected final String TEXT_264 = "();" + NL; + protected final String TEXT_265 = NL + "\tpublic "; + protected final String TEXT_266 = " "; + protected final String TEXT_267 = "()" + NL + "\t{"; + protected final String TEXT_268 = NL + "\t\treturn "; + protected final String TEXT_269 = "("; + protected final String TEXT_270 = "("; + protected final String TEXT_271 = ")get("; + protected final String TEXT_272 = ", true)"; + protected final String TEXT_273 = ")."; + protected final String TEXT_274 = "()"; + protected final String TEXT_275 = ";"; + protected final String TEXT_276 = NL + "\t\t"; + protected final String TEXT_277 = " "; + protected final String TEXT_278 = " = ("; + protected final String TEXT_279 = ")eVirtualGet("; + protected final String TEXT_280 = ");"; + protected final String TEXT_281 = NL + "\t\tif ("; + protected final String TEXT_282 = " == null)" + NL + "\t\t{"; + protected final String TEXT_283 = NL + "\t\t\teVirtualSet("; + protected final String TEXT_284 = ", "; + protected final String TEXT_285 = " = new "; + protected final String TEXT_286 = ");"; + protected final String TEXT_287 = NL + "\t\t "; + protected final String TEXT_288 = " = createSequence(_INTERNAL_"; + protected final String TEXT_289 = ");"; + protected final String TEXT_290 = NL + "\t\t "; + protected final String TEXT_291 = " = createPropertyList("; + protected final String TEXT_292 = ", "; + protected final String TEXT_293 = ".class, "; + protected final String TEXT_294 = ", "; + protected final String TEXT_295 = ");"; + protected final String TEXT_296 = NL + "\t\t}" + NL + "\t\treturn "; + protected final String TEXT_297 = ";"; + protected final String TEXT_298 = NL + "\t\tif (eContainerFeatureID != "; + protected final String TEXT_299 = ") return null;" + NL + "\t\treturn ("; + protected final String TEXT_300 = ")eContainer();"; + protected final String TEXT_301 = NL + "\t\t"; + protected final String TEXT_302 = " "; + protected final String TEXT_303 = " = ("; + protected final String TEXT_304 = ")eVirtualGet("; + protected final String TEXT_305 = ", "; + protected final String TEXT_306 = "_DEFAULT_"; + protected final String TEXT_307 = ");"; + protected final String TEXT_308 = NL + "\t\tif ("; + protected final String TEXT_309 = " != null && isProxy("; + protected final String TEXT_310 = "))" + NL + "\t\t{" + NL + "\t\t\tObject old"; + protected final String TEXT_311 = " = "; + protected final String TEXT_312 = ";" + NL + "\t\t\t"; + protected final String TEXT_313 = " = "; + protected final String TEXT_314 = "resolveProxy(old"; + protected final String TEXT_315 = ");" + NL + "\t\t\tif ("; + protected final String TEXT_316 = " != old"; + protected final String TEXT_317 = ")" + NL + "\t\t\t{"; + protected final String TEXT_318 = NL + "\t\t\t\t"; + protected final String TEXT_319 = " new"; + protected final String TEXT_320 = " = ("; + protected final String TEXT_321 = ")"; + protected final String TEXT_322 = ";"; + protected final String TEXT_323 = NL + "\t\t\t\tChangeContext changeContext = old"; + protected final String TEXT_324 = ".eInverseRemove(this, EOPPOSITE_FEATURE_BASE - "; + protected final String TEXT_325 = ", null, null);"; + protected final String TEXT_326 = NL + "\t\t\t\t"; + protected final String TEXT_327 = " changeContext = old"; + protected final String TEXT_328 = ".eInverseRemove(this, "; + protected final String TEXT_329 = ", "; + protected final String TEXT_330 = ".class, null);"; + protected final String TEXT_331 = NL + "\t\t\t\tif (new"; + protected final String TEXT_332 = ".eInternalContainer() == null)" + NL + "\t\t\t\t{"; + protected final String TEXT_333 = NL + "\t\t\t\t\tchangeContext = new"; + protected final String TEXT_334 = ".eInverseAdd(this, EOPPOSITE_FEATURE_BASE - "; + protected final String TEXT_335 = ", null, changeContext);"; + protected final String TEXT_336 = NL + "\t\t\t\t\tchangeContext = new"; + protected final String TEXT_337 = ".eInverseAdd(this, "; + protected final String TEXT_338 = ", "; + protected final String TEXT_339 = ".class, changeContext);"; + protected final String TEXT_340 = NL + "\t\t\t\t}" + NL + "\t\t\t\tif (changeContext != null) dispatch(changeContext);"; + protected final String TEXT_341 = NL + "\t\t\t\teVirtualSet("; + protected final String TEXT_342 = ", "; + protected final String TEXT_343 = ");"; + protected final String TEXT_344 = NL + "\t\t\t\tif (isNotifying())" + NL + "\t\t\t\t\tnotify(ChangeKind.RESOLVE, _INTERNAL_"; + protected final String TEXT_345 = ", old"; + protected final String TEXT_346 = ", "; + protected final String TEXT_347 = ");"; + protected final String TEXT_348 = NL + "\t\t\t}" + NL + "\t\t}"; + protected final String TEXT_349 = NL + "\t\treturn ("; + protected final String TEXT_350 = ")eVirtualGet("; + protected final String TEXT_351 = ", "; + protected final String TEXT_352 = "_DEFAULT_"; + protected final String TEXT_353 = ");"; + protected final String TEXT_354 = NL + "\t\treturn ("; + protected final String TEXT_355 = " & "; + protected final String TEXT_356 = "_EFLAG) != 0;"; + protected final String TEXT_357 = NL + "\t\treturn "; + protected final String TEXT_358 = ";"; + protected final String TEXT_359 = NL + "\t\t"; + protected final String TEXT_360 = " "; + protected final String TEXT_361 = " = basicGet"; + protected final String TEXT_362 = "();" + NL + "\t\treturn "; + protected final String TEXT_363 = " != null && "; + protected final String TEXT_364 = ".isProxy() ? "; + protected final String TEXT_365 = "eResolveProxy(("; + protected final String TEXT_366 = ")"; + protected final String TEXT_367 = ") : "; + protected final String TEXT_368 = ";"; + protected final String TEXT_369 = NL + "\t\treturn create"; + protected final String TEXT_370 = "(get"; + protected final String TEXT_371 = "(), getType(), _INTERNAL_"; + protected final String TEXT_372 = ");"; + protected final String TEXT_373 = NL + "\t\treturn ("; + protected final String TEXT_374 = ")(("; + protected final String TEXT_375 = ")get"; + protected final String TEXT_376 = "()).list("; + protected final String TEXT_377 = ");"; + protected final String TEXT_378 = NL + "\t\treturn get"; + protected final String TEXT_379 = "(get"; + protected final String TEXT_380 = "(), getType(), _INTERNAL_"; + protected final String TEXT_381 = ");"; + protected final String TEXT_382 = NL + "\t\treturn (("; + protected final String TEXT_383 = ")get"; + protected final String TEXT_384 = "()).list("; + protected final String TEXT_385 = ");"; + protected final String TEXT_386 = NL + "\t\treturn "; + protected final String TEXT_387 = "("; + protected final String TEXT_388 = "("; + protected final String TEXT_389 = ")get(get"; + protected final String TEXT_390 = "(), getType(), _INTERNAL_"; + protected final String TEXT_391 = ")"; + protected final String TEXT_392 = ")."; + protected final String TEXT_393 = "()"; + protected final String TEXT_394 = ";"; + protected final String TEXT_395 = NL + "\t\treturn "; + protected final String TEXT_396 = "("; + protected final String TEXT_397 = "("; + protected final String TEXT_398 = ")get(get"; + protected final String TEXT_399 = "(), getType(), _INTERNAL_"; + protected final String TEXT_400 = ")"; + protected final String TEXT_401 = ")."; + protected final String TEXT_402 = "()"; + protected final String TEXT_403 = ";"; + protected final String TEXT_404 = NL + "\t\t// TODO: implement this method to return the '"; + protected final String TEXT_405 = "' "; + protected final String TEXT_406 = NL + "\t\t// Ensure that you remove @generated or mark it @generated NOT" + NL + "\t\tthrow new UnsupportedOperationException();"; + protected final String TEXT_407 = NL + "\t}"; + protected final String TEXT_408 = NL + "\t/**" + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_409 = " basicGet"; + protected final String TEXT_410 = "()" + NL + "\t{"; + protected final String TEXT_411 = NL + "\t\tif (eContainerFeatureID != "; + protected final String TEXT_412 = ") return null;" + NL + "\t\treturn ("; + protected final String TEXT_413 = ")eInternalContainer();"; + protected final String TEXT_414 = NL + "\t\treturn ("; + protected final String TEXT_415 = ")eVirtualGet("; + protected final String TEXT_416 = ");"; + protected final String TEXT_417 = NL + "\t\treturn "; + protected final String TEXT_418 = ";"; + protected final String TEXT_419 = NL + "\t\treturn ("; + protected final String TEXT_420 = ")get(get"; + protected final String TEXT_421 = "(), getType(), _INTERNAL_"; + protected final String TEXT_422 = ");"; + protected final String TEXT_423 = NL + "\t\treturn ("; + protected final String TEXT_424 = ")get"; + protected final String TEXT_425 = "().get("; + protected final String TEXT_426 = ", false);"; + protected final String TEXT_427 = NL + "\t\t// TODO: implement this method to return the '"; + protected final String TEXT_428 = "' "; + protected final String TEXT_429 = 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_430 = NL + "\t}" + NL; + protected final String TEXT_431 = NL + "\t/**" + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ChangeContext basicSet"; + protected final String TEXT_432 = "("; + protected final String TEXT_433 = " new"; + protected final String TEXT_434 = ", ChangeContext changeContext)" + NL + "\t{"; + protected final String TEXT_435 = NL + "\t\tObject old"; + protected final String TEXT_436 = " = eVirtualSet("; + protected final String TEXT_437 = ", new"; + protected final String TEXT_438 = ");"; + protected final String TEXT_439 = NL + "\t\t"; + protected final String TEXT_440 = " old"; + protected final String TEXT_441 = " = "; + protected final String TEXT_442 = ";" + NL + "\t\t"; + protected final String TEXT_443 = " = new"; + protected final String TEXT_444 = ";"; + protected final String TEXT_445 = NL + "\t\tboolean isSetChange = old"; + protected final String TEXT_446 = " == EVIRTUAL_NO_VALUE;"; + protected final String TEXT_447 = NL + "\t\tboolean old"; + protected final String TEXT_448 = "_set_ = ("; + protected final String TEXT_449 = " & "; + protected final String TEXT_450 = "_ESETFLAG) != 0;" + NL + "\t\t"; + protected final String TEXT_451 = " |= "; + protected final String TEXT_452 = "_ESETFLAG;"; + protected final String TEXT_453 = NL + "\t\tboolean old"; + protected final String TEXT_454 = "_set_ = "; + protected final String TEXT_455 = "_set_;" + NL + "\t\t"; + protected final String TEXT_456 = "_set_ = true;"; + protected final String TEXT_457 = NL + "\t\tif (isNotifying())" + NL + "\t\t{"; + protected final String TEXT_458 = NL + "\t\t\taddNotification(this, ChangeKind.SET, _INTERNAL_"; + protected final String TEXT_459 = ", "; + protected final String TEXT_460 = "isSetChange ? null : old"; + protected final String TEXT_461 = "old"; + protected final String TEXT_462 = ", new"; + protected final String TEXT_463 = ", "; + protected final String TEXT_464 = "isSetChange"; + protected final String TEXT_465 = "!old"; + protected final String TEXT_466 = "_set_"; + protected final String TEXT_467 = ", changeContext);"; + protected final String TEXT_468 = NL + "\t\t\taddNotification(this, ChangeKind.SET, _INTERNAL_"; + protected final String TEXT_469 = ", "; + protected final String TEXT_470 = "old"; + protected final String TEXT_471 = " == EVIRTUAL_NO_VALUE ? null : old"; + protected final String TEXT_472 = "old"; + protected final String TEXT_473 = ", new"; + protected final String TEXT_474 = ", changeContext);"; + protected final String TEXT_475 = NL + "\t\t}"; + protected final String TEXT_476 = NL + "\t\treturn changeContext;"; + protected final String TEXT_477 = NL + "\t\treturn basicAdd(get"; + protected final String TEXT_478 = "(), getType(), _INTERNAL_"; + protected final String TEXT_479 = ", new"; + protected final String TEXT_480 = ", changeContext);"; + protected final String TEXT_481 = NL + "\t\treturn basicAdd(get"; + protected final String TEXT_482 = "(), getType(), _INTERNAL_"; + protected final String TEXT_483 = ", new"; + protected final String TEXT_484 = ", changeContext);"; + protected final String TEXT_485 = NL + "\t\t// TODO: implement this method to set the contained '"; + protected final String TEXT_486 = "' "; + protected final String TEXT_487 = 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_488 = NL + "\t}" + NL; + protected final String TEXT_489 = NL + "\t/**" + NL + "\t * Sets the value of the '{@link "; + protected final String TEXT_490 = "#"; + protected final String TEXT_491 = " "; + protected final String TEXT_492 = "}' "; + protected final String TEXT_493 = "." + NL + "\t * " + NL + "\t * " + NL + "\t * @param value the new value of the '"; + protected final String TEXT_494 = "' "; + protected final String TEXT_495 = "."; + protected final String TEXT_496 = NL + "\t * @see "; + protected final String TEXT_497 = NL + "\t * @see #isSet"; + protected final String TEXT_498 = "()"; + protected final String TEXT_499 = NL + "\t * @see #unset"; + protected final String TEXT_500 = "()"; + protected final String TEXT_501 = NL + "\t * @see #"; + protected final String TEXT_502 = "()" + NL + "\t * @generated" + NL + "\t */"; + protected final String TEXT_503 = NL + "\t/**" + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */"; + protected final String TEXT_504 = NL + "\tvoid set"; + protected final String TEXT_505 = "("; + protected final String TEXT_506 = " value);" + NL; + protected final String TEXT_507 = NL + "\tpublic void set"; + protected final String TEXT_508 = "("; + protected final String TEXT_509 = " new"; + protected final String TEXT_510 = ")" + NL + "\t{"; + protected final String TEXT_511 = NL + "\t\t_set_("; + protected final String TEXT_512 = ", "; + protected final String TEXT_513 = "new "; + protected final String TEXT_514 = "("; + protected final String TEXT_515 = "new"; + protected final String TEXT_516 = ")"; + protected final String TEXT_517 = ");"; + protected final String TEXT_518 = NL + "\t\tif (new"; + protected final String TEXT_519 = " != eInternalContainer() || (eContainerFeatureID != "; + protected final String TEXT_520 = " && new"; + protected final String TEXT_521 = " != null))" + NL + "\t\t{" + NL + "\t\t\tif ("; + protected final String TEXT_522 = ".isAncestor(this, "; + protected final String TEXT_523 = "new"; + protected final String TEXT_524 = "))" + NL + "\t\t\t\tthrow new "; + protected final String TEXT_525 = "(\"Recursive containment not allowed for \" + toString());"; + protected final String TEXT_526 = 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_527 = " != null)" + NL + "\t\t\t\tchangeContext = (("; + protected final String TEXT_528 = ")new"; + protected final String TEXT_529 = ").eInverseAdd(this, "; + protected final String TEXT_530 = ", "; + protected final String TEXT_531 = ".class, changeContext);" + NL + "\t\t\tchangeContext = eBasicSetContainer(("; + protected final String TEXT_532 = ")new"; + protected final String TEXT_533 = ", "; + protected final String TEXT_534 = ", changeContext);" + NL + "\t\t\tif (changeContext != null) dispatch(changeContext);" + NL + "\t\t}"; + protected final String TEXT_535 = NL + "\t\telse if (isNotifying())" + NL + "\t\t\tnotify(ChangeKind.SET, _INTERNAL_"; + protected final String TEXT_536 = ", new"; + protected final String TEXT_537 = ", new"; + protected final String TEXT_538 = ");"; + protected final String TEXT_539 = NL + "\t\t"; + protected final String TEXT_540 = " "; + protected final String TEXT_541 = " = ("; + protected final String TEXT_542 = ")eVirtualGet("; + protected final String TEXT_543 = ");"; + protected final String TEXT_544 = NL + "\t\tif (new"; + protected final String TEXT_545 = " != "; + protected final String TEXT_546 = ")" + NL + "\t\t{" + NL + "\t\t\tChangeContext changeContext = null;" + NL + "\t\t\tif ("; + protected final String TEXT_547 = " != null)"; + protected final String TEXT_548 = NL + "\t\t\t\tchangeContext = inverseRemove("; + protected final String TEXT_549 = ", this, OPPOSITE_FEATURE_BASE - _INTERNAL_"; + protected final String TEXT_550 = ", null, changeContext);" + NL + "\t\t\tif (new"; + protected final String TEXT_551 = " != null)" + NL + "\t\t\t\tchangeContext = inverseAdd(new"; + protected final String TEXT_552 = ", this, OPPOSITE_FEATURE_BASE - _INTERNAL_"; + protected final String TEXT_553 = ", null, changeContext);"; + protected final String TEXT_554 = NL + "\t\t\t\tchangeContext = inverseRemove("; + protected final String TEXT_555 = ", this, "; + protected final String TEXT_556 = ", "; + protected final String TEXT_557 = ".class, changeContext);" + NL + "\t\t\tif (new"; + protected final String TEXT_558 = " != null)" + NL + "\t\t\t\tchangeContext = inverseAdd(new"; + protected final String TEXT_559 = ", this, "; + protected final String TEXT_560 = ", "; + protected final String TEXT_561 = ".class, changeContext);"; + protected final String TEXT_562 = NL + "\t\t\tchangeContext = basicSet"; + protected final String TEXT_563 = "("; + protected final String TEXT_564 = "new"; + protected final String TEXT_565 = ", changeContext);" + NL + "\t\t\tif (changeContext != null) dispatch(changeContext);" + NL + "\t\t}"; + protected final String TEXT_566 = NL + "\t\telse" + NL + "\t\t{"; + protected final String TEXT_567 = NL + "\t\t\tboolean old"; + protected final String TEXT_568 = "_set_ = eVirtualIsSet("; + protected final String TEXT_569 = ");"; + protected final String TEXT_570 = NL + "\t\t\tboolean old"; + protected final String TEXT_571 = "_set_ = ("; + protected final String TEXT_572 = " & "; + protected final String TEXT_573 = "_ESETFLAG) != 0;"; + protected final String TEXT_574 = NL + "\t\t\t"; + protected final String TEXT_575 = " |= "; + protected final String TEXT_576 = "_ESETFLAG;"; + protected final String TEXT_577 = NL + "\t\t\tboolean old"; + protected final String TEXT_578 = "_set_ = "; + protected final String TEXT_579 = "_set_;"; + protected final String TEXT_580 = NL + "\t\t\t"; + protected final String TEXT_581 = "_set_ = true;"; + protected final String TEXT_582 = NL + "\t\t\tif (isNotifying())" + NL + "\t\t\t\tnotify(ChangeKind.SET, _INTERNAL_"; + protected final String TEXT_583 = ", new"; + protected final String TEXT_584 = ", new"; + protected final String TEXT_585 = ", !old"; + protected final String TEXT_586 = "_set_);"; + protected final String TEXT_587 = NL + "\t\t}"; + protected final String TEXT_588 = NL + "\t\telse if (isNotifying())" + NL + "\t\t\tnotify(ChangeKind.SET, _INTERNAL_"; + protected final String TEXT_589 = ", new"; + protected final String TEXT_590 = ", new"; + protected final String TEXT_591 = ");"; + protected final String TEXT_592 = NL + "\t\t"; + protected final String TEXT_593 = " old"; + protected final String TEXT_594 = " = ("; + protected final String TEXT_595 = " & "; + protected final String TEXT_596 = "_EFLAG) != 0;"; + protected final String TEXT_597 = NL + "\t\tif (new"; + protected final String TEXT_598 = ") "; + protected final String TEXT_599 = " |= "; + protected final String TEXT_600 = "_EFLAG; else "; + protected final String TEXT_601 = " &= ~"; + protected final String TEXT_602 = "_EFLAG;"; + protected final String TEXT_603 = NL + "\t\t"; + protected final String TEXT_604 = " old"; + protected final String TEXT_605 = " = "; + protected final String TEXT_606 = ";"; + protected final String TEXT_607 = NL + "\t\t"; + protected final String TEXT_608 = " "; + protected final String TEXT_609 = " = new"; + protected final String TEXT_610 = " == null ? "; + protected final String TEXT_611 = "_DEFAULT_ : new"; + protected final String TEXT_612 = ";"; + protected final String TEXT_613 = NL + "\t\t"; + protected final String TEXT_614 = " = new"; + protected final String TEXT_615 = " == null ? "; + protected final String TEXT_616 = "_DEFAULT_ : new"; + protected final String TEXT_617 = ";"; + protected final String TEXT_618 = NL + "\t\t"; + protected final String TEXT_619 = " "; + protected final String TEXT_620 = " = "; + protected final String TEXT_621 = "new"; + protected final String TEXT_622 = ";"; + protected final String TEXT_623 = NL + "\t\t"; + protected final String TEXT_624 = " = "; + protected final String TEXT_625 = "new"; + protected final String TEXT_626 = ";"; + protected final String TEXT_627 = NL + "\t\tObject old"; + protected final String TEXT_628 = " = eVirtualSet("; + protected final String TEXT_629 = ", "; + protected final String TEXT_630 = ");"; + protected final String TEXT_631 = NL + "\t\tboolean isSetChange = old"; + protected final String TEXT_632 = " == EVIRTUAL_NO_VALUE;"; + protected final String TEXT_633 = NL + "\t\tboolean old"; + protected final String TEXT_634 = "_set_ = ("; + protected final String TEXT_635 = " & "; + protected final String TEXT_636 = "_ESETFLAG) != 0;"; + protected final String TEXT_637 = NL + "\t\t"; + protected final String TEXT_638 = " |= "; + protected final String TEXT_639 = "_ESETFLAG;"; + protected final String TEXT_640 = NL + "\t\tboolean old"; + protected final String TEXT_641 = "_set_ = "; + protected final String TEXT_642 = "_set_;"; + protected final String TEXT_643 = NL + "\t\t"; + protected final String TEXT_644 = "_set_ = true;"; + protected final String TEXT_645 = NL + "\t\tif (isNotifying())" + NL + "\t\t\tnotify(ChangeKind.SET, _INTERNAL_"; + protected final String TEXT_646 = ", "; + protected final String TEXT_647 = "isSetChange ? "; + protected final String TEXT_648 = "null"; + protected final String TEXT_649 = "_DEFAULT_"; + protected final String TEXT_650 = " : old"; + protected final String TEXT_651 = "old"; + protected final String TEXT_652 = ", "; + protected final String TEXT_653 = "new"; + protected final String TEXT_654 = ", "; + protected final String TEXT_655 = "isSetChange"; + protected final String TEXT_656 = "!old"; + protected final String TEXT_657 = "_set_"; + protected final String TEXT_658 = ");"; + protected final String TEXT_659 = NL + "\t\tif (isNotifying())" + NL + "\t\t\tnotify(ChangeKind.SET, _INTERNAL_"; + protected final String TEXT_660 = ", "; + protected final String TEXT_661 = "old"; + protected final String TEXT_662 = " == EVIRTUAL_NO_VALUE ? "; + protected final String TEXT_663 = "null"; + protected final String TEXT_664 = "_DEFAULT_"; + protected final String TEXT_665 = " : old"; + protected final String TEXT_666 = "old"; + protected final String TEXT_667 = ", "; + protected final String TEXT_668 = "new"; + protected final String TEXT_669 = ");"; + protected final String TEXT_670 = NL + "\t\tset(get"; + protected final String TEXT_671 = "(), getType(), _INTERNAL_"; + protected final String TEXT_672 = ", "; + protected final String TEXT_673 = " new "; + protected final String TEXT_674 = "("; + protected final String TEXT_675 = "new"; + protected final String TEXT_676 = ")"; + protected final String TEXT_677 = ");"; + protected final String TEXT_678 = NL + "\t\t(("; + protected final String TEXT_679 = ".Internal)get"; + protected final String TEXT_680 = "()).set("; + protected final String TEXT_681 = ", "; + protected final String TEXT_682 = "new "; + protected final String TEXT_683 = "("; + protected final String TEXT_684 = "new"; + protected final String TEXT_685 = ")"; + protected final String TEXT_686 = ");"; + protected final String TEXT_687 = NL + "\t\t// TODO: implement this method to set the '"; + protected final String TEXT_688 = "' "; + protected final String TEXT_689 = NL + "\t\t// Ensure that you remove @generated or mark it @generated NOT" + NL + "\t\tthrow new UnsupportedOperationException();"; + protected final String TEXT_690 = NL + "\t}" + NL; + protected final String TEXT_691 = NL + "\t/**" + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ChangeContext basicUnset"; + protected final String TEXT_692 = "(ChangeContext changeContext)" + NL + "\t{"; + protected final String TEXT_693 = NL + "\t\tObject old"; + protected final String TEXT_694 = " = eVirtualUnset("; + protected final String TEXT_695 = ");"; + protected final String TEXT_696 = NL + "\t\t"; + protected final String TEXT_697 = " old"; + protected final String TEXT_698 = " = "; + protected final String TEXT_699 = ";" + NL + "\t\t"; + protected final String TEXT_700 = " = null;"; + protected final String TEXT_701 = NL + "\t\tboolean isSetChange = old"; + protected final String TEXT_702 = " != EVIRTUAL_NO_VALUE;"; + protected final String TEXT_703 = NL + "\t\tboolean old"; + protected final String TEXT_704 = "_set_ = ("; + protected final String TEXT_705 = " & "; + protected final String TEXT_706 = "_ESETFLAG) != 0;" + NL + "\t\t"; + protected final String TEXT_707 = " &= ~"; + protected final String TEXT_708 = "_ESETFLAG;"; + protected final String TEXT_709 = NL + "\t\tboolean old"; + protected final String TEXT_710 = "_set_ = "; + protected final String TEXT_711 = "_set_;" + NL + "\t\t"; + protected final String TEXT_712 = "_set_ = false;"; + protected final String TEXT_713 = NL + "\t\tif (isNotifying())" + NL + "\t\t{"; + protected final String TEXT_714 = NL + "\t\t\taddNotification(this, ChangeKind.UNSET, _INTERNAL_"; + protected final String TEXT_715 = ", "; + protected final String TEXT_716 = "isSetChange ? null : old"; + protected final String TEXT_717 = "old"; + protected final String TEXT_718 = ", null, "; + protected final String TEXT_719 = "isSetChange"; + protected final String TEXT_720 = "!old"; + protected final String TEXT_721 = "_set_"; + protected final String TEXT_722 = ", changeContext);"; + protected final String TEXT_723 = NL + "\t\t\taddNotification(this, ChangeKind.UNSET, _INTERNAL_"; + protected final String TEXT_724 = ", "; + protected final String TEXT_725 = "old"; + protected final String TEXT_726 = " == EVIRTUAL_NO_VALUE ? null : old"; + protected final String TEXT_727 = "old"; + protected final String TEXT_728 = ", null, changeContext);"; + protected final String TEXT_729 = NL + "\t\t}"; + protected final String TEXT_730 = NL + "\t\treturn changeContext;"; + protected final String TEXT_731 = NL + "\t\t// TODO: implement this method to unset the contained '"; + protected final String TEXT_732 = "' "; + protected final String TEXT_733 = 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_734 = NL + "\t}" + NL; + protected final String TEXT_735 = NL + "\t/**" + NL + "\t * Unsets the value of the '{@link "; + protected final String TEXT_736 = "#"; + protected final String TEXT_737 = " "; + protected final String TEXT_738 = "}' "; + protected final String TEXT_739 = "." + NL + "\t * " + NL + "\t * "; + protected final String TEXT_740 = NL + "\t * @see #isSet"; + protected final String TEXT_741 = "()"; + protected final String TEXT_742 = NL + "\t * @see #"; + protected final String TEXT_743 = "()"; + protected final String TEXT_744 = NL + "\t * @see #set"; + protected final String TEXT_745 = "("; + protected final String TEXT_746 = ")"; + protected final String TEXT_747 = NL + "\t * @generated" + NL + "\t */"; + protected final String TEXT_748 = NL + "\t/**" + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */"; + protected final String TEXT_749 = NL + "\tvoid unset"; + protected final String TEXT_750 = "();" + NL; + protected final String TEXT_751 = NL + "\tpublic void unset"; + protected final String TEXT_752 = "()" + NL + "\t{"; + protected final String TEXT_753 = NL + "\t\tunset("; + protected final String TEXT_754 = ");"; + protected final String TEXT_755 = NL + "\t\t(("; + protected final String TEXT_756 = ".Unsettable)get"; + protected final String TEXT_757 = "()).unset();"; + protected final String TEXT_758 = NL + "\t\t"; + protected final String TEXT_759 = " "; + protected final String TEXT_760 = " = ("; + protected final String TEXT_761 = ")eVirtualGet("; + protected final String TEXT_762 = ");"; + protected final String TEXT_763 = NL + "\t\tif ("; + protected final String TEXT_764 = " != null)" + NL + "\t\t{" + NL + "\t\t\tChangeContext changeContext = null;"; + protected final String TEXT_765 = NL + "\t\t\tchangeContext = inverseRemove("; + protected final String TEXT_766 = ", this, EOPPOSITE_FEATURE_BASE - _INTERNAL_"; + protected final String TEXT_767 = ", null, changeContext);"; + protected final String TEXT_768 = NL + "\t\t\tchangeContext = inverseRemove("; + protected final String TEXT_769 = ", this, "; + protected final String TEXT_770 = ", "; + protected final String TEXT_771 = ".class, changeContext);"; + protected final String TEXT_772 = NL + "\t\t\tchangeContext = basicUnset"; + protected final String TEXT_773 = "(changeContext);" + NL + "\t\t\tif (changeContext != null) dispatch(changeContext);" + NL + "\t\t}" + NL + "\t\telse" + NL + " \t{"; + protected final String TEXT_774 = NL + "\t\t\tboolean old"; + protected final String TEXT_775 = "_set_ = eVirtualIsSet("; + protected final String TEXT_776 = ");"; + protected final String TEXT_777 = NL + "\t\t\tboolean old"; + protected final String TEXT_778 = "_set_ = ("; + protected final String TEXT_779 = " & "; + protected final String TEXT_780 = "_ESETFLAG) != 0;"; + protected final String TEXT_781 = NL + "\t\t\t"; + protected final String TEXT_782 = " &= ~"; + protected final String TEXT_783 = "_ESETFLAG;"; + protected final String TEXT_784 = NL + "\t\t\tboolean old"; + protected final String TEXT_785 = "_set_ = "; + protected final String TEXT_786 = "_set_;"; + protected final String TEXT_787 = NL + "\t\t\t"; + protected final String TEXT_788 = "_set_ = false;"; + protected final String TEXT_789 = NL + "\t\t\tif (isNotifying())" + NL + "\t\t\t\tnotify(ChangeKind.UNSET, _INTERNAL_"; + protected final String TEXT_790 = ", null, null, old"; + protected final String TEXT_791 = "_set_);"; + protected final String TEXT_792 = NL + " \t}"; + protected final String TEXT_793 = NL + "\t\t"; + protected final String TEXT_794 = " old"; + protected final String TEXT_795 = " = ("; + protected final String TEXT_796 = " & "; + protected final String TEXT_797 = "_EFLAG) != 0;"; + protected final String TEXT_798 = NL + "\t\tObject old"; + protected final String TEXT_799 = " = eVirtualUnset("; + protected final String TEXT_800 = ");"; + protected final String TEXT_801 = NL + "\t\t"; + protected final String TEXT_802 = " old"; + protected final String TEXT_803 = " = "; + protected final String TEXT_804 = ";"; + protected final String TEXT_805 = NL + "\t\tboolean isSetChange = old"; + protected final String TEXT_806 = " != EVIRTUAL_NO_VALUE;"; + protected final String TEXT_807 = NL + "\t\tboolean old"; + protected final String TEXT_808 = "_set_ = ("; + protected final String TEXT_809 = " & "; + protected final String TEXT_810 = "_ESETFLAG) != 0;"; + protected final String TEXT_811 = NL + "\t\tboolean old"; + protected final String TEXT_812 = "_set_ = "; + protected final String TEXT_813 = "_set_;"; + protected final String TEXT_814 = NL + "\t\t"; + protected final String TEXT_815 = " = null;"; + protected final String TEXT_816 = NL + "\t\t"; + protected final String TEXT_817 = " &= ~"; + protected final String TEXT_818 = "_ESETFLAG;"; + protected final String TEXT_819 = NL + "\t\t"; + protected final String TEXT_820 = "_set_ = false;"; + protected final String TEXT_821 = NL + "\t\tif (isNotifying())" + NL + "\t\t\tnotify(ChangeKind.UNSET, _INTERNAL_"; + protected final String TEXT_822 = ", "; + protected final String TEXT_823 = "isSetChange ? old"; + protected final String TEXT_824 = " : null"; + protected final String TEXT_825 = "old"; + protected final String TEXT_826 = ", null, "; + protected final String TEXT_827 = "isSetChange"; + protected final String TEXT_828 = "old"; + protected final String TEXT_829 = "_set_"; + protected final String TEXT_830 = ");"; + protected final String TEXT_831 = NL + "\t\tif ("; + protected final String TEXT_832 = "_DEFAULT_) "; + protected final String TEXT_833 = " |= "; + protected final String TEXT_834 = "_EFLAG; else "; + protected final String TEXT_835 = " &= ~"; + protected final String TEXT_836 = "_EFLAG;"; + protected final String TEXT_837 = NL + "\t\t"; + protected final String TEXT_838 = " = "; + protected final String TEXT_839 = "_DEFAULT_;"; + protected final String TEXT_840 = NL + "\t\t"; + protected final String TEXT_841 = " &= ~"; + protected final String TEXT_842 = "_ESETFLAG;"; + protected final String TEXT_843 = NL + "\t\t"; + protected final String TEXT_844 = "_set_ = false;"; + protected final String TEXT_845 = NL + "\t\tif (isNotifying())" + NL + "\t\t\tnotify(ChangeKind.UNSET, _INTERNAL_"; + protected final String TEXT_846 = ", "; + protected final String TEXT_847 = "isSetChange ? old"; + protected final String TEXT_848 = " : "; + protected final String TEXT_849 = "_DEFAULT_"; + protected final String TEXT_850 = "old"; + protected final String TEXT_851 = ", "; + protected final String TEXT_852 = "_DEFAULT_, "; + protected final String TEXT_853 = "isSetChange"; + protected final String TEXT_854 = "old"; + protected final String TEXT_855 = "_set_"; + protected final String TEXT_856 = ");"; + protected final String TEXT_857 = NL + " unset(get"; + protected final String TEXT_858 = "(), getType(), _INTERNAL_"; + protected final String TEXT_859 = ");"; + protected final String TEXT_860 = NL + " unset"; + protected final String TEXT_861 = "(get"; + protected final String TEXT_862 = "());"; + protected final String TEXT_863 = NL + "\t\t// TODO: implement this method to unset the '"; + protected final String TEXT_864 = "' "; + protected final String TEXT_865 = NL + "\t\t// Ensure that you remove @generated or mark it @generated NOT" + NL + "\t\tthrow new UnsupportedOperationException();"; + protected final String TEXT_866 = NL + "\t}" + NL; + protected final String TEXT_867 = NL + "\t/**" + NL + "\t * Returns whether the value of the '{@link "; + protected final String TEXT_868 = "#"; + protected final String TEXT_869 = " "; + protected final String TEXT_870 = "}' "; + protected final String TEXT_871 = " is set." + NL + "\t * " + NL + "\t * " + NL + "\t * @return whether the value of the '"; + protected final String TEXT_872 = "' "; + protected final String TEXT_873 = " is set."; + protected final String TEXT_874 = NL + "\t * @see #unset"; + protected final String TEXT_875 = "()"; + protected final String TEXT_876 = NL + "\t * @see #"; + protected final String TEXT_877 = "()"; + protected final String TEXT_878 = NL + "\t * @see #set"; + protected final String TEXT_879 = "("; + protected final String TEXT_880 = ")"; + protected final String TEXT_881 = NL + "\t * @generated" + NL + "\t */"; + protected final String TEXT_882 = NL + "\t/**" + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */"; + protected final String TEXT_883 = NL + "\tboolean isSet"; + protected final String TEXT_884 = "();" + NL; + protected final String TEXT_885 = NL + "\tpublic boolean isSet"; + protected final String TEXT_886 = "()" + NL + "\t{"; + protected final String TEXT_887 = NL + "\t\treturn isSet("; + protected final String TEXT_888 = ");"; + protected final String TEXT_889 = NL + "\t\t"; + protected final String TEXT_890 = " "; + protected final String TEXT_891 = " = ("; + protected final String TEXT_892 = ")eVirtualGet("; + protected final String TEXT_893 = ");"; + protected final String TEXT_894 = NL + "\t\treturn "; + protected final String TEXT_895 = " != null && (("; + protected final String TEXT_896 = ".Unsettable)"; + protected final String TEXT_897 = ").isSet();"; + protected final String TEXT_898 = NL + "\t\treturn eVirtualIsSet("; + protected final String TEXT_899 = ");"; + protected final String TEXT_900 = NL + "\t\treturn ("; + protected final String TEXT_901 = " & "; + protected final String TEXT_902 = "_ESETFLAG) != 0;"; + protected final String TEXT_903 = NL + "\t\treturn "; + protected final String TEXT_904 = "_set_;"; + protected final String TEXT_905 = NL + " return isSet(get"; + protected final String TEXT_906 = "(), getType(), _INTERNAL_"; + protected final String TEXT_907 = ");"; + protected final String TEXT_908 = NL + "\t\treturn !(("; + protected final String TEXT_909 = ".Internal)get"; + protected final String TEXT_910 = "()).isEmpty("; + protected final String TEXT_911 = ");"; + protected final String TEXT_912 = NL + "\t\t// TODO: implement this method to return whether the '"; + protected final String TEXT_913 = "' "; + protected final String TEXT_914 = " is set" + NL + "\t\t// Ensure that you remove @generated or mark it @generated NOT" + NL + "\t\tthrow new UnsupportedOperationException();"; + protected final String TEXT_915 = NL + "\t}" + NL; + protected final String TEXT_916 = NL + "\t/**" + NL + "\t * " + NL + "\t * "; + protected final String TEXT_917 = NL + "\t * " + NL + "\t * "; + protected final String TEXT_918 = NL + "\t * "; + protected final String TEXT_919 = NL + "\t * @model "; + protected final String TEXT_920 = NL + "\t * "; + protected final String TEXT_921 = NL + "\t * @model"; + protected final String TEXT_922 = NL + "\t * @generated" + NL + "\t */"; + protected final String TEXT_923 = NL + "\t/**" + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */"; + protected final String TEXT_924 = NL + "\t"; + protected final String TEXT_925 = " "; + protected final String TEXT_926 = "("; + protected final String TEXT_927 = ")"; + protected final String TEXT_928 = ";" + NL; + protected final String TEXT_929 = NL + "\tpublic "; + protected final String TEXT_930 = " "; + protected final String TEXT_931 = "("; + protected final String TEXT_932 = ")"; + protected final String TEXT_933 = NL + "\t{"; + protected final String TEXT_934 = NL + "\t\t"; + protected final String TEXT_935 = 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_936 = " != null)" + NL + "\t\t\t{" + NL + "\t\t\t\t"; + protected final String TEXT_937 = ".add" + NL + "\t\t\t\t\t(new "; + protected final String TEXT_938 = NL + "\t\t\t\t\t\t("; + protected final String TEXT_939 = ".ERROR," + NL + "\t\t\t\t\t\t "; + protected final String TEXT_940 = ".DIAGNOSTIC_SOURCE," + NL + "\t\t\t\t\t\t "; + protected final String TEXT_941 = "."; + protected final String TEXT_942 = "," + NL + "\t\t\t\t\t\t "; + protected final String TEXT_943 = ".INSTANCE.getString(\"_UI_GenericInvariant_diagnostic\", new Object[] { \""; + protected final String TEXT_944 = "\", "; + protected final String TEXT_945 = ".getObjectLabel(this, "; + protected final String TEXT_946 = ") }),"; + protected final String TEXT_947 = 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_948 = 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_949 = NL + "\t}" + NL; + protected final String TEXT_950 = NL + "\t/**" + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ChangeContext eInverseAdd("; + protected final String TEXT_951 = " otherEnd, int propertyIndex, ChangeContext changeContext)" + NL + "\t{" + NL + "\t\tswitch (propertyIndex)" + NL + "\t\t{"; + protected final String TEXT_952 = NL + "\t\t\tcase "; + protected final String TEXT_953 = ":"; + protected final String TEXT_954 = NL + "\t\t\t\treturn (("; + protected final String TEXT_955 = ")(("; + protected final String TEXT_956 = ".InternalMapView)"; + protected final String TEXT_957 = "()).eMap()).basicAdd(otherEnd, changeContext);"; + protected final String TEXT_958 = NL + "\t\t\t\treturn (("; + protected final String TEXT_959 = ")"; + protected final String TEXT_960 = "()).basicAdd(otherEnd, changeContext);"; + protected final String TEXT_961 = 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_962 = ", changeContext);"; + protected final String TEXT_963 = NL + "\t\t\t\t"; + protected final String TEXT_964 = " "; + protected final String TEXT_965 = " = ("; + protected final String TEXT_966 = ")eVirtualGet("; + protected final String TEXT_967 = ");"; + protected final String TEXT_968 = NL + "\t\t\t\tif ("; + protected final String TEXT_969 = " != null)"; + protected final String TEXT_970 = NL + "\t\t\t\t\tchangeContext = (("; + protected final String TEXT_971 = ")"; + protected final String TEXT_972 = ").eInverseRemove(this, EOPPOSITE_FEATURE_BASE - "; + protected final String TEXT_973 = ", null, changeContext);"; + protected final String TEXT_974 = NL + "\t\t\t\t\tchangeContext = (("; + protected final String TEXT_975 = ")"; + protected final String TEXT_976 = ").eInverseRemove(this, "; + protected final String TEXT_977 = ", "; + protected final String TEXT_978 = ".class, changeContext);"; + protected final String TEXT_979 = NL + "\t\t\t\treturn basicSet"; + protected final String TEXT_980 = "(("; + protected final String TEXT_981 = ")otherEnd, changeContext);"; + protected final String TEXT_982 = NL + "\t\t}"; + protected final String TEXT_983 = NL + "\t\treturn super.eInverseAdd(otherEnd, propertyIndex, changeContext);"; + protected final String TEXT_984 = NL + "\t\treturn eDynamicInverseAdd(otherEnd, propertyIndex, changeContext);"; + protected final String TEXT_985 = NL + "\t}" + NL; + protected final String TEXT_986 = NL + "\t/**" + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ChangeContext inverseRemove("; + protected final String TEXT_987 = " otherEnd, int propertyIndex, ChangeContext changeContext)" + NL + "\t{" + NL + "\t\tswitch (propertyIndex)" + NL + "\t\t{"; + protected final String TEXT_988 = NL + "\t\t\tcase "; + protected final String TEXT_989 = ":"; + protected final String TEXT_990 = NL + "\t\t\t\treturn (("; + protected final String TEXT_991 = ")(("; + protected final String TEXT_992 = ".InternalMapView)"; + protected final String TEXT_993 = "()).eMap()).basicRemove(otherEnd, changeContext);"; + protected final String TEXT_994 = NL + "\t\t\t\treturn removeFrom"; + protected final String TEXT_995 = "("; + protected final String TEXT_996 = "(), otherEnd, changeContext);"; + protected final String TEXT_997 = NL + "\t\t\t\treturn removeFromList("; + protected final String TEXT_998 = "(), otherEnd, changeContext);"; + protected final String TEXT_999 = NL + "\t\t\t\treturn eBasicSetContainer(null, "; + protected final String TEXT_1000 = ", changeContext);"; + protected final String TEXT_1001 = NL + "\t\t\t\treturn basicUnset"; + protected final String TEXT_1002 = "(changeContext);"; + protected final String TEXT_1003 = NL + "\t\t\t\treturn basicSet"; + protected final String TEXT_1004 = "(null, changeContext);"; + protected final String TEXT_1005 = NL + "\t\t}"; + protected final String TEXT_1006 = NL + "\t\treturn super.inverseRemove(otherEnd, propertyIndex, changeContext);"; + protected final String TEXT_1007 = NL + "\t\treturn eDynamicInverseRemove(otherEnd, propertyIndex, changeContext);"; + protected final String TEXT_1008 = NL + "\t}" + NL; + protected final String TEXT_1009 = NL + "\t/**" + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ChangeContext eBasicRemoveFromContainerFeature(ChangeContext changeContext)" + NL + "\t{" + NL + "\t\tswitch (eContainerFeatureID)" + NL + "\t\t{"; + protected final String TEXT_1010 = NL + "\t\t\tcase "; + protected final String TEXT_1011 = ":" + NL + "\t\t\t\treturn eInternalContainer().eInverseRemove(this, "; + protected final String TEXT_1012 = ", "; + protected final String TEXT_1013 = ".class, changeContext);"; + protected final String TEXT_1014 = NL + "\t\t}"; + protected final String TEXT_1015 = NL + "\t\treturn super.eBasicRemoveFromContainerFeature(changeContext);"; + protected final String TEXT_1016 = NL + "\t\treturn eDynamicBasicRemoveFromContainer(changeContext);"; + protected final String TEXT_1017 = NL + "\t}" + NL; + protected final String TEXT_1018 = NL + "\t/**" + NL + "\t * " + NL + "\t * " + 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_1019 = NL + "\t\t\tcase "; + protected final String TEXT_1020 = ":"; + protected final String TEXT_1021 = NL + "\t\t\t\treturn "; + protected final String TEXT_1022 = "() ? Boolean.TRUE : Boolean.FALSE;"; + protected final String TEXT_1023 = NL + "\t\t\t\treturn new "; + protected final String TEXT_1024 = "("; + protected final String TEXT_1025 = "());"; + protected final String TEXT_1026 = NL + "\t\t\t\tif (resolve) return "; + protected final String TEXT_1027 = "();" + NL + "\t\t\t\treturn basicGet"; + protected final String TEXT_1028 = "();"; + protected final String TEXT_1029 = NL + "\t\t\t\tif (coreType) return (("; + protected final String TEXT_1030 = ".InternalMapView)"; + protected final String TEXT_1031 = "()).eMap();" + NL + "\t\t\t\telse return "; + protected final String TEXT_1032 = "();"; + protected final String TEXT_1033 = NL + "\t\t\t\tif (coreType) return "; + protected final String TEXT_1034 = "();" + NL + "\t\t\t\telse return "; + protected final String TEXT_1035 = "().map();"; + protected final String TEXT_1036 = 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_1037 = "();"; + protected final String TEXT_1038 = NL + "\t\t\t\tif (coreType) return "; + protected final String TEXT_1039 = "();" + NL + "\t\t\t\treturn (("; + protected final String TEXT_1040 = ".Internal)"; + protected final String TEXT_1041 = "()).getWrapper();"; + protected final String TEXT_1042 = NL + "\t\t\t\treturn "; + protected final String TEXT_1043 = "();"; + protected final String TEXT_1044 = NL + "\t\t}"; + protected final String TEXT_1045 = NL + "\t\treturn super.get(propertyIndex, resolve);"; + protected final String TEXT_1046 = NL + "\t\treturn eDynamicGet(propertyIndex, resolve, coreType);"; + protected final String TEXT_1047 = NL + "\t}" + NL; + protected final String TEXT_1048 = NL + "\t/**" + NL + "\t * " + NL + "\t * " + 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_1049 = NL + "\t\t\tcase "; + protected final String TEXT_1050 = ":"; + protected final String TEXT_1051 = NL + " \tset"; + protected final String TEXT_1052 = "("; + protected final String TEXT_1053 = "(), newValue);"; + protected final String TEXT_1054 = NL + "\t\t\t\t(("; + protected final String TEXT_1055 = ".Internal)"; + protected final String TEXT_1056 = "()).set(newValue);"; + protected final String TEXT_1057 = NL + "\t\t\t\t(("; + protected final String TEXT_1058 = ".Setting)(("; + protected final String TEXT_1059 = ".InternalMapView)"; + protected final String TEXT_1060 = "()).eMap()).set(newValue);"; + protected final String TEXT_1061 = NL + "\t\t\t\t(("; + protected final String TEXT_1062 = ".Setting)"; + protected final String TEXT_1063 = "()).set(newValue);"; + protected final String TEXT_1064 = NL + "\t\t\t\t"; + protected final String TEXT_1065 = "().clear();" + NL + "\t\t\t\t"; + protected final String TEXT_1066 = "().addAll(("; + protected final String TEXT_1067 = ")newValue);"; + protected final String TEXT_1068 = NL + "\t\t\t\tset"; + protected final String TEXT_1069 = "((("; + protected final String TEXT_1070 = ")newValue)."; + protected final String TEXT_1071 = "());"; + protected final String TEXT_1072 = NL + "\t\t\t\tset"; + protected final String TEXT_1073 = "(("; + protected final String TEXT_1074 = ")newValue);"; + protected final String TEXT_1075 = NL + "\t\t\t\treturn;"; + protected final String TEXT_1076 = NL + "\t\t}"; + protected final String TEXT_1077 = NL + "\t\tsuper.set(propertyIndex, newValue);"; + protected final String TEXT_1078 = NL + "\t\teDynamicSet(propertyIndex, newValue);"; + protected final String TEXT_1079 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void unset(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\tunset"; + protected final String TEXT_1083 = "("; + protected final String TEXT_1084 = "());"; + protected final String TEXT_1085 = NL + "\t\t\t\t"; + protected final String TEXT_1086 = "().clear();"; + protected final String TEXT_1087 = NL + "\t\t\t\tunset"; + protected final String TEXT_1088 = "();"; + protected final String TEXT_1089 = NL + "\t\t\t\tset"; + protected final String TEXT_1090 = "(("; + protected final String TEXT_1091 = ")null);"; + protected final String TEXT_1092 = NL + "\t\t\t\tset"; + protected final String TEXT_1093 = "("; + protected final String TEXT_1094 = "_DEFAULT_);"; + protected final String TEXT_1095 = NL + "\t\t\t\treturn;"; + protected final String TEXT_1096 = NL + "\t\t}"; + protected final String TEXT_1097 = NL + "\t\tsuper.unset(propertyIndex);"; + protected final String TEXT_1098 = NL + "\t\teDynamicUnset(propertyIndex);"; + protected final String TEXT_1099 = NL + "\t}" + NL; + protected final String TEXT_1100 = NL + "\t/**" + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic boolean isSet(int propertyIndex)" + NL + "\t{" + NL + "\t\tswitch (propertyIndex)" + NL + "\t\t{"; + protected final String TEXT_1101 = NL + "\t\t\tcase "; + protected final String TEXT_1102 = ":"; + protected final String TEXT_1103 = NL + "\t\t\t\treturn !is"; + protected final String TEXT_1104 = "Empty("; + protected final String TEXT_1105 = "());"; + protected final String TEXT_1106 = NL + "\t\t\t\treturn "; + protected final String TEXT_1107 = " != null && !is"; + protected final String TEXT_1108 = "Empty("; + protected final String TEXT_1109 = "());"; + protected final String TEXT_1110 = NL + "\t\t\t\treturn "; + protected final String TEXT_1111 = " != null && !"; + protected final String TEXT_1112 = ".isEmpty();"; + protected final String TEXT_1113 = NL + "\t\t\t\t"; + protected final String TEXT_1114 = " "; + protected final String TEXT_1115 = " = ("; + protected final String TEXT_1116 = ")eVirtualGet("; + protected final String TEXT_1117 = ");" + NL + "\t\t\t\treturn "; + protected final String TEXT_1118 = " != null && !"; + protected final String TEXT_1119 = ".isEmpty();"; + protected final String TEXT_1120 = NL + "\t\t\t\treturn !"; + protected final String TEXT_1121 = "().isEmpty();"; + protected final String TEXT_1122 = NL + "\t\t\t\treturn isSet"; + protected final String TEXT_1123 = "();"; + protected final String TEXT_1124 = NL + "\t\t\t\treturn "; + protected final String TEXT_1125 = " != null;"; + protected final String TEXT_1126 = NL + "\t\t\t\treturn eVirtualGet("; + protected final String TEXT_1127 = ") != null;"; + protected final String TEXT_1128 = NL + "\t\t\t\treturn basicGet"; + protected final String TEXT_1129 = "() != null;"; + protected final String TEXT_1130 = NL + "\t\t\t\treturn "; + protected final String TEXT_1131 = " != null;"; + protected final String TEXT_1132 = NL + "\t\t\t\treturn eVirtualGet("; + protected final String TEXT_1133 = ") != null;"; + protected final String TEXT_1134 = NL + "\t\t\t\treturn "; + protected final String TEXT_1135 = "() != null;"; + protected final String TEXT_1136 = NL + "\t\t\t\treturn (("; + protected final String TEXT_1137 = " & "; + protected final String TEXT_1138 = "_EFLAG) != 0) != "; + protected final String TEXT_1139 = "_DEFAULT_;"; + protected final String TEXT_1140 = NL + "\t\t\t\treturn "; + protected final String TEXT_1141 = " != "; + protected final String TEXT_1142 = "_DEFAULT_;"; + protected final String TEXT_1143 = NL + "\t\t\t\treturn eVirtualGet("; + protected final String TEXT_1144 = ", "; + protected final String TEXT_1145 = "_DEFAULT_) != "; + protected final String TEXT_1146 = "_DEFAULT_;"; + protected final String TEXT_1147 = NL + "\t\t\t\treturn "; + protected final String TEXT_1148 = "() != "; + protected final String TEXT_1149 = "_DEFAULT_;"; + protected final String TEXT_1150 = NL + "\t\t\t\treturn "; + protected final String TEXT_1151 = "_DEFAULT_ == null ? "; + protected final String TEXT_1152 = " != null : !"; + protected final String TEXT_1153 = "_DEFAULT_.equals("; + protected final String TEXT_1154 = ");"; + protected final String TEXT_1155 = NL + "\t\t\t\t"; + protected final String TEXT_1156 = " "; + protected final String TEXT_1157 = " = ("; + protected final String TEXT_1158 = ")eVirtualGet("; + protected final String TEXT_1159 = ", "; + protected final String TEXT_1160 = "_DEFAULT_);" + NL + "\t\t\t\treturn "; + protected final String TEXT_1161 = "_DEFAULT_ == null ? "; + protected final String TEXT_1162 = " != null : !"; + protected final String TEXT_1163 = "_DEFAULT_.equals("; + protected final String TEXT_1164 = ");"; + protected final String TEXT_1165 = NL + "\t\t\t\treturn "; + protected final String TEXT_1166 = "_DEFAULT_ == null ? "; + protected final String TEXT_1167 = "() != null : !"; + protected final String TEXT_1168 = "_DEFAULT_.equals("; + protected final String TEXT_1169 = "());"; + protected final String TEXT_1170 = NL + "\t\t}"; + protected final String TEXT_1171 = NL + "\t\treturn super.isSet(propertyIndex);"; + protected final String TEXT_1172 = NL + "\t\treturn eDynamicIsSet(propertyIndex);"; + protected final String TEXT_1173 = NL + "\t}" + NL; + protected final String TEXT_1174 = NL + "\t/**" + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass)" + NL + "\t{"; + protected final String TEXT_1175 = NL + "\t\tif (baseClass == "; + protected final String TEXT_1176 = ".class)" + NL + "\t\t{" + NL + "\t\t\tswitch (derivedFeatureID)" + NL + "\t\t\t{"; + protected final String TEXT_1177 = NL + "\t\t\t\tcase "; + protected final String TEXT_1178 = ": return "; + protected final String TEXT_1179 = ";"; + protected final String TEXT_1180 = NL + "\t\t\t\tdefault: return -1;" + NL + "\t\t\t}" + NL + "\t\t}"; + protected final String TEXT_1181 = NL + "\t\treturn super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass)" + NL + "\t{"; + protected final String TEXT_1182 = NL + "\t\tif (baseClass == "; + protected final String TEXT_1183 = ".class)" + NL + "\t\t{" + NL + "\t\t\tswitch (baseFeatureID)" + NL + "\t\t\t{"; + protected final String TEXT_1184 = NL + "\t\t\t\tcase "; + protected final String TEXT_1185 = ": return "; + protected final String TEXT_1186 = ";"; + protected final String TEXT_1187 = NL + "\t\t\t\tdefault: return -1;" + NL + "\t\t\t}" + NL + "\t\t}"; + protected final String TEXT_1188 = NL + "\t\treturn super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);" + NL + "\t}" + NL; + protected final String TEXT_1189 = NL + "\t/**" + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected Object[] eVirtualValues()" + NL + "\t{" + NL + "\t\treturn "; + protected final String TEXT_1190 = ";" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void setVirtualValues(Object[] newValues)" + NL + "\t{" + NL + "\t\t"; + protected final String TEXT_1191 = " = newValues;" + NL + "\t}" + NL; + protected final String TEXT_1192 = NL + "\t/**" + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected int eVirtualIndexBits(int offset)" + NL + "\t{" + NL + "\t\tswitch (offset)" + NL + "\t\t{"; + protected final String TEXT_1193 = NL + "\t\t\tcase "; + protected final String TEXT_1194 = " :" + NL + "\t\t\t\treturn "; + protected final String TEXT_1195 = ";"; + protected final String TEXT_1196 = NL + "\t\t\tdefault :" + NL + "\t\t\t\tthrow new IndexOutOfBoundsException();" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * " + NL + "\t * " + 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_1197 = NL + "\t\t\tcase "; + protected final String TEXT_1198 = " :" + NL + "\t\t\t\t"; + protected final String TEXT_1199 = " = newIndexBits;" + NL + "\t\t\t\tbreak;"; + protected final String TEXT_1200 = NL + "\t\t\tdefault :" + NL + "\t\t\t\tthrow new IndexOutOfBoundsException();" + NL + "\t\t}" + NL + "\t}" + NL; + protected final String TEXT_1201 = NL + "\t/**" + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic String toString()" + NL + "\t{" + NL + "\t\tif (isProxy(this)) return super.toString();" + NL + "" + NL + "\t\tStringBuffer result = new StringBuffer(super.toString());"; + protected final String TEXT_1202 = NL + "\t\tresult.append(\" ("; + protected final String TEXT_1203 = ": \");"; + protected final String TEXT_1204 = NL + "\t\tresult.append(\", "; + protected final String TEXT_1205 = ": \");"; + protected final String TEXT_1206 = NL + "\t\tif (eVirtualIsSet("; + protected final String TEXT_1207 = ")) result.append(eVirtualGet("; + protected final String TEXT_1208 = ")); else result.append(\"\");"; + protected final String TEXT_1209 = NL + "\t\tif ("; + protected final String TEXT_1210 = "("; + protected final String TEXT_1211 = " & "; + protected final String TEXT_1212 = "_ESETFLAG) != 0"; + protected final String TEXT_1213 = "_set_"; + protected final String TEXT_1214 = ") result.append(("; + protected final String TEXT_1215 = " & "; + protected final String TEXT_1216 = "_EFLAG) != 0); else result.append(\"\");"; + protected final String TEXT_1217 = NL + "\t\tif ("; + protected final String TEXT_1218 = "("; + protected final String TEXT_1219 = " & "; + protected final String TEXT_1220 = "_ESETFLAG) != 0"; + protected final String TEXT_1221 = "_set_"; + protected final String TEXT_1222 = ") result.append("; + protected final String TEXT_1223 = "); else result.append(\"\");"; + protected final String TEXT_1224 = NL + "\t\tresult.append(eVirtualGet("; + protected final String TEXT_1225 = ", "; + protected final String TEXT_1226 = "_DEFAULT_"; + protected final String TEXT_1227 = "));"; + protected final String TEXT_1228 = NL + "\t\tresult.append(("; + protected final String TEXT_1229 = " & "; + protected final String TEXT_1230 = "_EFLAG) != 0);"; + protected final String TEXT_1231 = NL + "\t\tresult.append("; + protected final String TEXT_1232 = ");"; + protected final String TEXT_1233 = NL + "\t\tresult.append(')');" + NL + "\t\treturn result.toString();" + NL + "\t}" + NL; + protected final String TEXT_1234 = NL + "\tpublic static class ConcreteBase extends "; + protected final String TEXT_1235 = NL + "\t{" + NL + "\t\tpublic ConcreteBase()" + NL + "\t\t{" + NL + "\t\t\tsuper();" + NL + "\t\t}" + NL + "\t}" + NL + "\t"; + protected final String TEXT_1236 = NL + "\t/**" + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected int hash = -1;" + NL + "" + NL + "\t/**" + NL + "\t * " + NL + "\t * " + 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 * " + NL + " \t * " + 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 * " + NL + " \t * " + NL + " \t * @generated" + NL + " \t */" + NL + "\tpublic Object getKey()" + NL + "\t{" + NL + " \t"; + protected final String TEXT_1237 = NL + "\t\treturn new "; + protected final String TEXT_1238 = "(getTypedKey());" + NL + " \t"; + protected final String TEXT_1239 = NL + "\t\treturn getTypedKey();" + NL + " \t"; + protected final String TEXT_1240 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void setKey(Object key)" + NL + "\t{"; + protected final String TEXT_1241 = NL + "\t\tgetTypedKey().addAll(("; + protected final String TEXT_1242 = ")key);"; + protected final String TEXT_1243 = NL + "\t\tsetTypedKey((("; + protected final String TEXT_1244 = ")key)."; + protected final String TEXT_1245 = "());"; + protected final String TEXT_1246 = NL + "\t\tsetTypedKey(("; + protected final String TEXT_1247 = ")key);"; + protected final String TEXT_1248 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Object getValue()" + NL + "\t{" + NL + " \t"; + protected final String TEXT_1249 = NL + "\t\treturn new "; + protected final String TEXT_1250 = "(getTypedValue());" + NL + " \t"; + protected final String TEXT_1251 = NL + "\t\treturn getTypedValue();" + NL + " \t"; + protected final String TEXT_1252 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Object setValue(Object value)" + NL + "\t{" + NL + "\t\tObject oldValue = getValue();" + NL + " \t"; + protected final String TEXT_1253 = NL + "\t\tgetTypedValue().clear();" + NL + "\t\tgetTypedValue().addAll(("; + protected final String TEXT_1254 = ")value);" + NL + " \t"; + protected final String TEXT_1255 = NL + "\t\tsetTypedValue((("; + protected final String TEXT_1256 = ")value)."; + protected final String TEXT_1257 = "());" + NL + " \t"; + protected final String TEXT_1258 = NL + "\t\tsetTypedValue(("; + protected final String TEXT_1259 = ")value);" + NL + " \t"; + protected final String TEXT_1260 = NL + "\t\treturn oldValue;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_1261 = " getEMap()" + NL + "\t{" + NL + "\t\t"; + protected final String TEXT_1262 = " container = eContainer();" + NL + "\t\treturn container == null ? null : ("; + protected final String TEXT_1263 = ")container.get(eContainmentFeature());" + NL + "\t}"; + protected final String TEXT_1264 = NL + "} //"; + protected final String TEXT_1265 = NL; + + public String generate(Object argument) + { + final StringBuffer stringBuffer = new StringBuffer(); + +/** + * + * 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]); + boolean isDebug = false; + String publicStaticFinalFlag = isImplementation ? "public static final " : ""; + /* + * Output preamble and javadoc header + */ + 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 (isDebug) { // EYECATCHER 1 + stringBuffer.append(TEXT_11); + } + if (isInterface) { + stringBuffer.append(TEXT_12); + stringBuffer.append(genClass.getFormattedName()); + stringBuffer.append(TEXT_13); + if (genClass.hasDocumentation()) { + stringBuffer.append(TEXT_14); + stringBuffer.append(genClass.getDocumentation(genModel.getIndentation(stringBuffer))); + stringBuffer.append(TEXT_15); + } + stringBuffer.append(TEXT_16); + if (!genClass.getGenFeatures().isEmpty()) { + stringBuffer.append(TEXT_17); + for (Iterator i=genClass.getGenFeatures().iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next(); + if (!genFeature.isSuppressedGetVisibility()) { + stringBuffer.append(TEXT_18); + stringBuffer.append(genClass.getQualifiedInterfaceName()); + stringBuffer.append(TEXT_19); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_20); + stringBuffer.append(genFeature.getFormattedName()); + stringBuffer.append(TEXT_21); + } + } + stringBuffer.append(TEXT_22); + } + stringBuffer.append(TEXT_23); + if (!genModel.isSuppressEMFMetaData()) { + stringBuffer.append(TEXT_24); + stringBuffer.append(genPackage.getQualifiedPackageInterfaceName()); + stringBuffer.append(TEXT_25); + stringBuffer.append(genClass.getClassifierAccessorName()); + stringBuffer.append(TEXT_26); + } + 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_27); + stringBuffer.append(modelInfo); + } else { + stringBuffer.append(TEXT_28); + stringBuffer.append(modelInfo); + }} if (first) { + stringBuffer.append(TEXT_29); + }} + if (genClass.needsRootExtendsInterfaceExtendsTag()) { // does it need an @extends tag + stringBuffer.append(TEXT_30); + stringBuffer.append(genModel.getImportedName(genModel.getRootExtendsInterface())); + } + stringBuffer.append(TEXT_31); + } else { + stringBuffer.append(TEXT_32); + stringBuffer.append(genClass.getFormattedName()); + stringBuffer.append(TEXT_33); + if (!genClass.getImplementedGenFeatures().isEmpty()) { + stringBuffer.append(TEXT_34); + for (Iterator i=genClass.getImplementedGenFeatures().iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next(); + stringBuffer.append(TEXT_35); + stringBuffer.append(genClass.getQualifiedClassName()); + stringBuffer.append(TEXT_36); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_37); + stringBuffer.append(genFeature.getFormattedName()); + stringBuffer.append(TEXT_38); + } + stringBuffer.append(TEXT_39); + } + stringBuffer.append(TEXT_40); + } + if (isImplementation) { + stringBuffer.append(TEXT_41); + if (genClass.isAbstract()) { + stringBuffer.append(TEXT_42); + } + stringBuffer.append(TEXT_43); + stringBuffer.append(genClass.getClassName()); + stringBuffer.append(genClass.getClassExtends()); + stringBuffer.append(genClass.getClassImplements()); + } else { + stringBuffer.append(TEXT_44); + stringBuffer.append(genClass.getInterfaceName()); + stringBuffer.append(genClass.getInterfaceExtends()); + } + stringBuffer.append(TEXT_45); + if (genModel.getCopyrightText() != null) { + stringBuffer.append(TEXT_46); + stringBuffer.append(publicStaticFinalFlag); + stringBuffer.append(genModel.getImportedName("java.lang.String")); + stringBuffer.append(TEXT_47); + stringBuffer.append(genModel.getCopyrightText()); + stringBuffer.append(TEXT_48); + stringBuffer.append(genModel.getNonNLS()); + stringBuffer.append(TEXT_49); + } + if (isImplementation && genModel.getDriverNumber() != null) { + stringBuffer.append(TEXT_50); + stringBuffer.append(genModel.getImportedName("java.lang.String")); + stringBuffer.append(TEXT_51); + stringBuffer.append(genModel.getDriverNumber()); + stringBuffer.append(TEXT_52); + stringBuffer.append(genModel.getNonNLS()); + stringBuffer.append(TEXT_53); + } + if (isImplementation && genClass.isJavaIOSerializable()) { + stringBuffer.append(TEXT_54); + } + if (isImplementation && genModel.isVirtualDelegation()) { String eVirtualValuesField = genClass.getEVirtualValuesField(); + if (eVirtualValuesField != null) { + stringBuffer.append(TEXT_55); + stringBuffer.append(eVirtualValuesField); + stringBuffer.append(TEXT_56); + } + { List eVirtualIndexBitFields = genClass.getEVirtualIndexBitFields(new ArrayList()); + if (!eVirtualIndexBitFields.isEmpty()) { + for (Iterator i = eVirtualIndexBitFields.iterator(); i.hasNext();) { String eVirtualIndexBitField = (String)i.next(); + stringBuffer.append(TEXT_57); + stringBuffer.append(eVirtualIndexBitField); + stringBuffer.append(TEXT_58); + } + } + } + } + if (isImplementation && genClass.isModelRoot() && genModel.isBooleanFlagsEnabled() && genModel.getBooleanFlagsReservedBits() == -1) { + stringBuffer.append(TEXT_59); + stringBuffer.append(genModel.getBooleanFlagsField()); + stringBuffer.append(TEXT_60); + } + if (isImplementation && !genModel.isReflectiveDelegation()) { + stringBuffer.append(TEXT_61); + ClassImpl classImpl = (ClassImpl) genClass.getEcoreClass(); + List declaredProperties = classImpl.getDeclaredProperties(); + List extendedProperties = classImpl.getExtendedProperties(); + int declaredPropertiesCount = 0; + int extendedPropertiesCount = 0; + for (Iterator f=genClass.getAllGenFeatures().iterator(); f.hasNext();) { GenFeature genFeature = (GenFeature)f.next(); + if (declaredProperties.contains(genFeature.getEcoreFeature())){ + declaredPropertiesCount++; + String featureValue = ""; + List allFeatures = genClass.getAllGenFeatures(); + int g = allFeatures.indexOf(genFeature); + GenClass base = genClass.getBaseGenClass(); + if (base == null) + { + featureValue = Integer.toString(declaredProperties.indexOf(genFeature.getEcoreFeature())); + } else { + int baseCount = base.getFeatureCount(); + if (g < baseCount) + { + featureValue = base.getImportedClassName() + "." + genFeature.getUpperName(); + } else { + String baseCountID = base.getImportedClassName() + "." + "SDO_PROPERTY_COUNT"; + featureValue = baseCountID + " + " + Integer.toString(declaredProperties.indexOf(genFeature.getEcoreFeature())); + } + } + stringBuffer.append(TEXT_62); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_63); + stringBuffer.append(featureValue); + stringBuffer.append(TEXT_64); + } else if (extendedProperties.contains(genFeature.getEcoreFeature())){ + extendedPropertiesCount++; + String featureValue = ""; + List allFeatures = genClass.getAllGenFeatures(); + int g = allFeatures.indexOf(genFeature); + GenClass base = genClass.getBaseGenClass(); + if (base == null) + { + featureValue = Integer.toString(-1 - extendedProperties.indexOf(genFeature.getEcoreFeature())); + } else { + int baseCount = base.getFeatureCount(); + if (g < baseCount) + { + featureValue = base.getImportedClassName() + "." + genFeature.getUpperName(); + } else { + String baseCountID = base.getImportedClassName() + "." + "EXTENDED_PROPERTY_COUNT"; + featureValue = baseCountID + " + " + Integer.toString(-1 - extendedProperties.indexOf(genFeature.getEcoreFeature())); + } + } + stringBuffer.append(TEXT_65); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_66); + stringBuffer.append(featureValue); + stringBuffer.append(TEXT_67); + } + } + String featureCount = ""; + GenClass base = genClass.getBaseGenClass(); + if (base == null) + { + featureCount = Integer.toString(declaredPropertiesCount); + } + else { + String baseCountID = base.getImportedClassName() + "." + "SDO_PROPERTY_COUNT"; + featureCount = baseCountID + " + " + Integer.toString(declaredPropertiesCount); + } + stringBuffer.append(TEXT_68); + stringBuffer.append(featureCount); + stringBuffer.append(TEXT_69); + featureCount = ""; + base = genClass.getBaseGenClass(); + if (base == null) + { + featureCount = Integer.toString(extendedPropertiesCount*-1); + } + else { + String baseCountID = base.getImportedClassName() + "." + "EXTENDED_PROPERTY_COUNT"; + featureCount = baseCountID + " - " + Integer.toString(extendedPropertiesCount); + } + stringBuffer.append(TEXT_70); + stringBuffer.append(featureCount); + stringBuffer.append(TEXT_71); + for (Iterator f=genClass.getAllGenFeatures().iterator(); f.hasNext();) { GenFeature genFeature = (GenFeature)f.next(); + stringBuffer.append(TEXT_72); + stringBuffer.append(genFeature.getFormattedName()); + stringBuffer.append(TEXT_73); + stringBuffer.append(genFeature.getFeatureKind()); + stringBuffer.append(TEXT_74); + String featureValue = ""; + List allFeatures = genClass.getAllGenFeatures(); + int g = allFeatures.indexOf(genFeature); + base = genClass.getBaseGenClass(); + if (base == null) + { + featureValue = Integer.toString(g); + } else { + int baseCount = base.getFeatureCount(); + if (g < baseCount) + { + featureValue = base.getImportedClassName() + "._INTERNAL_" + genFeature.getUpperName(); + } else { + String baseCountID = base.getImportedClassName() + "." + "INTERNAL_PROPERTY_COUNT"; + featureValue = baseCountID + " + " + Integer.toString(g - baseCount); + } + } + stringBuffer.append(TEXT_75); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_76); + stringBuffer.append(featureValue); + stringBuffer.append(TEXT_77); + } + stringBuffer.append(TEXT_78); + featureCount = ""; + base = genClass.getBaseGenClass(); + if (base == null) + { + featureCount = Integer.toString(genClass.getFeatureCount()); + } + else { + String baseCountID = base.getImportedClassName() + "." + "INTERNAL_PROPERTY_COUNT"; + featureCount = baseCountID + " + " + Integer.toString(genClass.getFeatureCount() - base.getFeatureCount()); + } + stringBuffer.append(TEXT_79); + stringBuffer.append(featureCount); + stringBuffer.append(TEXT_80); + for (Iterator f=genClass.getAllGenFeatures().iterator(); f.hasNext();) { GenFeature genFeature = (GenFeature)f.next(); + stringBuffer.append(TEXT_81); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_82); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_83); + } + stringBuffer.append(TEXT_84); + 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_85); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_86); + stringBuffer.append(genFeature.getFormattedName()); + stringBuffer.append(TEXT_87); + stringBuffer.append(genFeature.getFeatureKind()); + stringBuffer.append(TEXT_88); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_89); + stringBuffer.append(genModel.getImportedName(genFeature.getType())); + stringBuffer.append(TEXT_90); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_91); + } + if (genModel.isArrayAccessors() && !genFeature.isFeatureMapType() && !genFeature.isMapType()) { + stringBuffer.append(TEXT_92); + stringBuffer.append(genFeature.getGetArrayAccessor()); + stringBuffer.append(TEXT_93); + stringBuffer.append(genFeature.getFormattedName()); + stringBuffer.append(TEXT_94); + stringBuffer.append(genFeature.getGetArrayAccessor()); + stringBuffer.append(TEXT_95); + stringBuffer.append(genFeature.getListItemType()); + stringBuffer.append(TEXT_96); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_97); + stringBuffer.append(genFeature.getListItemType()); + stringBuffer.append(TEXT_98); + } + } else { + if (!genFeature.isVolatile() || !genModel.isReflectiveDelegation() && (!genFeature.hasDelegateFeature() || !genFeature.isUnsettable())) { + stringBuffer.append(TEXT_99); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_100); + stringBuffer.append(genFeature.getFormattedName()); + stringBuffer.append(TEXT_101); + stringBuffer.append(genFeature.getFeatureKind()); + stringBuffer.append(TEXT_102); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_103); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_104); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_105); + stringBuffer.append(SDOGenUtil.getStaticDefaultValue(genFeature)); + stringBuffer.append(TEXT_106); + stringBuffer.append(genModel.getNonNLS(genFeature.getStaticDefaultValue())); + stringBuffer.append(TEXT_107); + } + if (genClass.isField(genFeature)) { + if (genClass.isFlag(genFeature)) { + if (genClass.getFlagIndex(genFeature) > 31 && genClass.getFlagIndex(genFeature) % 32 == 0) { + stringBuffer.append(TEXT_108); + stringBuffer.append(genClass.getFlagsField(genFeature)); + stringBuffer.append(TEXT_109); + } + stringBuffer.append(TEXT_110); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_111); + stringBuffer.append(genFeature.getFormattedName()); + stringBuffer.append(TEXT_112); + stringBuffer.append(genFeature.getFeatureKind()); + stringBuffer.append(TEXT_113); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_114); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_115); + stringBuffer.append("<< " + genClass.getFlagIndex(genFeature) % 32 ); + stringBuffer.append(TEXT_116); + } else { + stringBuffer.append(TEXT_117); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_118); + stringBuffer.append(genFeature.getFormattedName()); + stringBuffer.append(TEXT_119); + stringBuffer.append(genFeature.getFeatureKind()); + stringBuffer.append(TEXT_120); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_121); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_122); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_123); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_124); + } + } + } + if (genClass.isESetField(genFeature)) { + if (genClass.isESetFlag(genFeature)) { + if (genClass.getESetFlagIndex(genFeature) > 31 && genClass.getESetFlagIndex(genFeature) % 32 == 0) { + stringBuffer.append(TEXT_125); + stringBuffer.append(genClass.getESetFlagsField(genFeature)); + stringBuffer.append(TEXT_126); + } + stringBuffer.append(TEXT_127); + stringBuffer.append(genFeature.getFormattedName()); + stringBuffer.append(TEXT_128); + stringBuffer.append(genFeature.getFeatureKind()); + stringBuffer.append(TEXT_129); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_130); + stringBuffer.append("<< " + genClass.getESetFlagIndex(genFeature) % 32 ); + stringBuffer.append(TEXT_131); + } else { + stringBuffer.append(TEXT_132); + stringBuffer.append(genFeature.getFormattedName()); + stringBuffer.append(TEXT_133); + stringBuffer.append(genFeature.getFeatureKind()); + stringBuffer.append(TEXT_134); + stringBuffer.append(genFeature.getUncapName()); + stringBuffer.append(TEXT_135); + } + } + } + //Class/declaredFieldGenFeature.override.javajetinc + } + if (isImplementation) { // create constructor + stringBuffer.append(TEXT_136); + stringBuffer.append(genClass.getClassName()); + stringBuffer.append(TEXT_137); + for (Iterator i=genClass.getFlagGenFeatures("true").iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next(); + stringBuffer.append(TEXT_138); + stringBuffer.append(genClass.getFlagsField(genFeature)); + stringBuffer.append(TEXT_139); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_140); + } + if (SDOGenUtil.hasChangeSummaryProperty(genClass)) { + stringBuffer.append(TEXT_141); + stringBuffer.append(SDOGenUtil.getChangeSummaryProperty(genClass)); + stringBuffer.append(TEXT_142); + } + stringBuffer.append(TEXT_143); + stringBuffer.append(genModel.getImportedName("commonj.sdo.Type")); + stringBuffer.append(TEXT_144); + stringBuffer.append(genPackage.getImportedFactoryClassName()); + stringBuffer.append(TEXT_145); + stringBuffer.append(genPackage.getImportedFactoryInterfaceName()); + stringBuffer.append(TEXT_146); + stringBuffer.append(genClass.getClassifierAccessorName()); + stringBuffer.append(TEXT_147); + } + /* + * Output getter and setter interfaces / impls + */ + + 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_148); + if (!isImplementation) { + stringBuffer.append(TEXT_149); + stringBuffer.append(genFeature.getListItemType()); + stringBuffer.append(TEXT_150); + stringBuffer.append(genFeature.getGetArrayAccessor()); + stringBuffer.append(TEXT_151); + } else { + stringBuffer.append(TEXT_152); + stringBuffer.append(genFeature.getListItemType()); + stringBuffer.append(TEXT_153); + stringBuffer.append(genFeature.getGetArrayAccessor()); + stringBuffer.append(TEXT_154); + if (genFeature.isVolatile()) { + stringBuffer.append(TEXT_155); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.BasicEList")); + stringBuffer.append(TEXT_156); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.BasicEList")); + stringBuffer.append(TEXT_157); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_158); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_159); + } else { + stringBuffer.append(TEXT_160); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_161); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_162); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_163); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.BasicEList")); + stringBuffer.append(TEXT_164); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.BasicEList")); + stringBuffer.append(TEXT_165); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_166); + } + stringBuffer.append(TEXT_167); + stringBuffer.append(genFeature.getListItemType()); + stringBuffer.append(TEXT_168); + } + stringBuffer.append(TEXT_169); + if (!isImplementation) { + stringBuffer.append(TEXT_170); + stringBuffer.append(genFeature.getListItemType()); + stringBuffer.append(TEXT_171); + stringBuffer.append(genFeature.getAccessorName()); + stringBuffer.append(TEXT_172); + } else { + stringBuffer.append(TEXT_173); + stringBuffer.append(genFeature.getListItemType()); + stringBuffer.append(TEXT_174); + stringBuffer.append(genFeature.getAccessorName()); + stringBuffer.append(TEXT_175); + stringBuffer.append(genFeature.getListItemType()); + stringBuffer.append(TEXT_176); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_177); + } + stringBuffer.append(TEXT_178); + if (!isImplementation) { + stringBuffer.append(TEXT_179); + stringBuffer.append(genFeature.getAccessorName()); + stringBuffer.append(TEXT_180); + } else { + stringBuffer.append(TEXT_181); + stringBuffer.append(genFeature.getAccessorName()); + stringBuffer.append(TEXT_182); + if (genFeature.isVolatile()) { + stringBuffer.append(TEXT_183); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_184); + } else { + stringBuffer.append(TEXT_185); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_186); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_187); + } + stringBuffer.append(TEXT_188); + } + stringBuffer.append(TEXT_189); + if (!isImplementation) { + stringBuffer.append(TEXT_190); + stringBuffer.append(genFeature.getAccessorName()); + stringBuffer.append(TEXT_191); + stringBuffer.append(genFeature.getListItemType()); + stringBuffer.append(TEXT_192); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_193); + } else { + stringBuffer.append(TEXT_194); + stringBuffer.append(genFeature.getAccessorName()); + stringBuffer.append(TEXT_195); + stringBuffer.append(genFeature.getListItemType()); + stringBuffer.append(TEXT_196); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_197); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.BasicEList")); + stringBuffer.append(TEXT_198); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_199); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_200); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_201); + } + stringBuffer.append(TEXT_202); + if (!isImplementation) { + stringBuffer.append(TEXT_203); + stringBuffer.append(genFeature.getAccessorName()); + stringBuffer.append(TEXT_204); + stringBuffer.append(genFeature.getListItemType()); + stringBuffer.append(TEXT_205); + } else { + stringBuffer.append(TEXT_206); + stringBuffer.append(genFeature.getAccessorName()); + stringBuffer.append(TEXT_207); + stringBuffer.append(genFeature.getListItemType()); + stringBuffer.append(TEXT_208); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_209); + } + } + if (genFeature.isGet() && (isImplementation || !genFeature.isSuppressedGetVisibility())) { + if (isInterface) { + stringBuffer.append(TEXT_210); + stringBuffer.append(genFeature.getFormattedName()); + stringBuffer.append(TEXT_211); + stringBuffer.append(genFeature.getFeatureKind()); + stringBuffer.append(TEXT_212); + if (genFeature.isListType()) { + if (genFeature.isMapType()) { GenFeature keyFeature = genFeature.getMapEntryTypeGenClass().getMapEntryKeyFeature(); GenFeature valueFeature = genFeature.getMapEntryTypeGenClass().getMapEntryValueFeature(); + stringBuffer.append(TEXT_213); + if (keyFeature.isListType()) { + stringBuffer.append(TEXT_214); + stringBuffer.append(keyFeature.getQualifiedListItemType()); + stringBuffer.append(TEXT_215); + } else { + stringBuffer.append(TEXT_216); + stringBuffer.append(keyFeature.getType()); + stringBuffer.append(TEXT_217); + } + stringBuffer.append(TEXT_218); + if (valueFeature.isListType()) { + stringBuffer.append(TEXT_219); + stringBuffer.append(valueFeature.getQualifiedListItemType()); + stringBuffer.append(TEXT_220); + } else { + stringBuffer.append(TEXT_221); + stringBuffer.append(valueFeature.getType()); + stringBuffer.append(TEXT_222); + } + stringBuffer.append(TEXT_223); + } else if (!genFeature.isWrappedFeatureMapType() && !(genModel.isSuppressEMFMetaData() && "org.eclipse.emf.ecore.EObject".equals(genFeature.getQualifiedListItemType()))) { + stringBuffer.append(TEXT_224); + stringBuffer.append(genFeature.getQualifiedListItemType()); + stringBuffer.append(TEXT_225); + } + } else if (genFeature.isSetDefaultValue()) { + stringBuffer.append(TEXT_226); + stringBuffer.append(genFeature.getDefaultValue()); + stringBuffer.append(TEXT_227); + } + if (genFeature.getTypeGenEnum() != null) { + stringBuffer.append(TEXT_228); + stringBuffer.append(genFeature.getTypeGenEnum().getQualifiedName()); + stringBuffer.append(TEXT_229); + } + if (genFeature.isBidirectional() && !genFeature.getReverse().getGenClass().isMapEntry()) { GenFeature reverseGenFeature = genFeature.getReverse(); + if (!reverseGenFeature.isSuppressedGetVisibility()) { + stringBuffer.append(TEXT_230); + stringBuffer.append(reverseGenFeature.getGenClass().getQualifiedInterfaceName()); + stringBuffer.append(TEXT_231); + stringBuffer.append(reverseGenFeature.getGetAccessor()); + stringBuffer.append(TEXT_232); + stringBuffer.append(reverseGenFeature.getFormattedName()); + stringBuffer.append(TEXT_233); + } + } + stringBuffer.append(TEXT_234); + if (!genFeature.hasDocumentation()) { + stringBuffer.append(TEXT_235); + stringBuffer.append(genFeature.getFormattedName()); + stringBuffer.append(TEXT_236); + stringBuffer.append(genFeature.getFeatureKind()); + stringBuffer.append(TEXT_237); + } + stringBuffer.append(TEXT_238); + if (genFeature.hasDocumentation()) { + stringBuffer.append(TEXT_239); + stringBuffer.append(genFeature.getDocumentation(genModel.getIndentation(stringBuffer))); + stringBuffer.append(TEXT_240); + } + stringBuffer.append(TEXT_241); + stringBuffer.append(genFeature.getFormattedName()); + stringBuffer.append(TEXT_242); + stringBuffer.append(genFeature.getFeatureKind()); + stringBuffer.append(TEXT_243); + if (genFeature.getTypeGenEnum() != null) { + stringBuffer.append(TEXT_244); + stringBuffer.append(genFeature.getTypeGenEnum().getQualifiedName()); + } + if (genFeature.isUnsettable()) { + if (!genFeature.isSuppressedIsSetVisibility()) { + stringBuffer.append(TEXT_245); + stringBuffer.append(genFeature.getAccessorName()); + stringBuffer.append(TEXT_246); + } + if (genFeature.isChangeable() && !genFeature.isSuppressedUnsetVisibility()) { + stringBuffer.append(TEXT_247); + stringBuffer.append(genFeature.getAccessorName()); + stringBuffer.append(TEXT_248); + } + } + if (genFeature.isChangeable() && !genFeature.isListType() && !genFeature.isSuppressedSetVisibility()) { + stringBuffer.append(TEXT_249); + stringBuffer.append(genFeature.getAccessorName()); + stringBuffer.append(TEXT_250); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_251); + } + if (!genModel.isSuppressEMFMetaData()) { + stringBuffer.append(TEXT_252); + stringBuffer.append(genPackage.getQualifiedPackageInterfaceName()); + stringBuffer.append(TEXT_253); + stringBuffer.append(genFeature.getFeatureAccessorName()); + stringBuffer.append(TEXT_254); + } + if (genFeature.isBidirectional() && !genFeature.getReverse().getGenClass().isMapEntry()) { GenFeature reverseGenFeature = genFeature.getReverse(); + if (!reverseGenFeature.isSuppressedGetVisibility()) { + stringBuffer.append(TEXT_255); + stringBuffer.append(reverseGenFeature.getGenClass().getQualifiedInterfaceName()); + stringBuffer.append(TEXT_256); + 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_257); + stringBuffer.append(modelInfo); + } else { + stringBuffer.append(TEXT_258); + stringBuffer.append(modelInfo); + }} if (first) { + stringBuffer.append(TEXT_259); + }} + stringBuffer.append(TEXT_260); + } else { + stringBuffer.append(TEXT_261); + } + if (!isImplementation) { + stringBuffer.append(TEXT_262); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_263); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_264); + } else { + stringBuffer.append(TEXT_265); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_266); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_267); + if (genModel.isReflectiveDelegation()) { + stringBuffer.append(TEXT_268); + if (genFeature.isPrimitiveType()) { + stringBuffer.append(TEXT_269); + } + stringBuffer.append(TEXT_270); + stringBuffer.append(genFeature.getObjectType()); + stringBuffer.append(TEXT_271); + stringBuffer.append(genFeature.getQualifiedFeatureAccessor()); + stringBuffer.append(TEXT_272); + if (genFeature.isPrimitiveType()) { + stringBuffer.append(TEXT_273); + stringBuffer.append(genFeature.getPrimitiveValueFunction()); + stringBuffer.append(TEXT_274); + } + stringBuffer.append(TEXT_275); + } else if (!genFeature.isVolatile()) { + if (genFeature.isListType()) { + if (genModel.isVirtualDelegation()) { + stringBuffer.append(TEXT_276); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_277); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_278); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_279); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_280); + } + stringBuffer.append(TEXT_281); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_282); + if (genModel.isVirtualDelegation()) { + stringBuffer.append(TEXT_283); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_284); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_285); + stringBuffer.append(genClass.getListConstructor(genFeature)); + stringBuffer.append(TEXT_286); + } else { + if (genFeature.getType().equals("commonj.sdo.Sequence")){ + stringBuffer.append(TEXT_287); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_288); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_289); + } else { + stringBuffer.append(TEXT_290); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_291); + stringBuffer.append(SDOGenUtil.getListKind(genFeature, genFeature.isUnsettable())); + stringBuffer.append(TEXT_292); + stringBuffer.append(genFeature.getListItemType()); + stringBuffer.append(TEXT_293); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_294); + stringBuffer.append(genFeature.isBidirectional()?genFeature.getReverse().getUpperName():"0" ); + stringBuffer.append(TEXT_295); + }} + stringBuffer.append(TEXT_296); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(genFeature.isMapType() && genFeature.isEffectiveSuppressEMFTypes() ? ".map()" : ""); + stringBuffer.append(TEXT_297); + } else if (genFeature.isContainer()) { + stringBuffer.append(TEXT_298); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_299); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_300); + } else { + if (genFeature.isResolveProxies()) { + if (genModel.isVirtualDelegation()) { + stringBuffer.append(TEXT_301); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_302); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_303); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_304); + stringBuffer.append(genFeature.getUpperName()); + if (!genFeature.isReferenceType()) { + stringBuffer.append(TEXT_305); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_306); + } + stringBuffer.append(TEXT_307); + } + stringBuffer.append(TEXT_308); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_309); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_310); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_311); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_312); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_313); + stringBuffer.append(genFeature.getNonEObjectInternalTypeCast()); + stringBuffer.append(TEXT_314); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_315); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_316); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_317); + if (genFeature.isEffectiveContains()) { + stringBuffer.append(TEXT_318); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject")); + stringBuffer.append(TEXT_319); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_320); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject")); + stringBuffer.append(TEXT_321); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_322); + if (!genFeature.isBidirectional()) { + stringBuffer.append(TEXT_323); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_324); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_325); + } else { GenFeature reverseFeature = genFeature.getReverse(); GenClass targetClass = reverseFeature.getGenClass(); + stringBuffer.append(TEXT_326); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.notify.ChangeContext")); + stringBuffer.append(TEXT_327); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_328); + stringBuffer.append(targetClass.getQualifiedFeatureID(reverseFeature)); + stringBuffer.append(TEXT_329); + stringBuffer.append(targetClass.getImportedInterfaceName()); + stringBuffer.append(TEXT_330); + } + stringBuffer.append(TEXT_331); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_332); + if (!genFeature.isBidirectional()) { + stringBuffer.append(TEXT_333); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_334); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_335); + } else { GenFeature reverseFeature = genFeature.getReverse(); GenClass targetClass = reverseFeature.getGenClass(); + stringBuffer.append(TEXT_336); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_337); + stringBuffer.append(targetClass.getQualifiedFeatureID(reverseFeature)); + stringBuffer.append(TEXT_338); + stringBuffer.append(targetClass.getImportedInterfaceName()); + stringBuffer.append(TEXT_339); + } + stringBuffer.append(TEXT_340); + } else if (genModel.isVirtualDelegation()) { + stringBuffer.append(TEXT_341); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_342); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_343); + } + if (!genModel.isSuppressNotification()) { + stringBuffer.append(TEXT_344); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_345); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_346); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_347); + } + stringBuffer.append(TEXT_348); + } + if (!genFeature.isResolveProxies() && genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) { + stringBuffer.append(TEXT_349); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_350); + stringBuffer.append(genFeature.getUpperName()); + if (!genFeature.isReferenceType()) { + stringBuffer.append(TEXT_351); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_352); + } + stringBuffer.append(TEXT_353); + } else if (genClass.isFlag(genFeature)) { + stringBuffer.append(TEXT_354); + stringBuffer.append(genClass.getFlagsField(genFeature)); + stringBuffer.append(TEXT_355); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_356); + } else { + stringBuffer.append(TEXT_357); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_358); + } + } + } else {//volatile + if (genFeature.isResolveProxies() && !genFeature.isListType()) { + stringBuffer.append(TEXT_359); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_360); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_361); + stringBuffer.append(genFeature.getAccessorName()); + stringBuffer.append(TEXT_362); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_363); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_364); + stringBuffer.append(genFeature.getNonEObjectInternalTypeCast()); + stringBuffer.append(TEXT_365); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject")); + stringBuffer.append(TEXT_366); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_367); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_368); + } else if (genFeature.hasDelegateFeature()) { GenFeature delegateFeature = genFeature.getDelegateFeature(); // AAAA + if (genFeature.isFeatureMapType()) { + if (delegateFeature.isWrappedFeatureMapType()) { + stringBuffer.append(TEXT_369); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_370); + stringBuffer.append(delegateFeature.getAccessorName()); + stringBuffer.append(TEXT_371); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_372); + } else { + stringBuffer.append(TEXT_373); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")); + stringBuffer.append(TEXT_374); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")); + stringBuffer.append(TEXT_375); + stringBuffer.append(delegateFeature.getAccessorName()); + stringBuffer.append(TEXT_376); + stringBuffer.append(genFeature.getQualifiedFeatureAccessor()); + stringBuffer.append(TEXT_377); + } + } else if (genFeature.isListType()) { + if (delegateFeature.isWrappedFeatureMapType()) { + stringBuffer.append(TEXT_378); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_379); + stringBuffer.append(delegateFeature.getAccessorName()); + stringBuffer.append(TEXT_380); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_381); + } else { + stringBuffer.append(TEXT_382); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")); + stringBuffer.append(TEXT_383); + stringBuffer.append(delegateFeature.getAccessorName()); + stringBuffer.append(TEXT_384); + stringBuffer.append(genFeature.getQualifiedFeatureAccessor()); + stringBuffer.append(TEXT_385); + } + } else { + if (delegateFeature.isWrappedFeatureMapType()) { + stringBuffer.append(TEXT_386); + if (genFeature.isPrimitiveType()) { + stringBuffer.append(TEXT_387); + } + stringBuffer.append(TEXT_388); + stringBuffer.append(genFeature.getObjectType()); + stringBuffer.append(TEXT_389); + stringBuffer.append(delegateFeature.getAccessorName()); + stringBuffer.append(TEXT_390); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_391); + if (genFeature.isPrimitiveType()) { + stringBuffer.append(TEXT_392); + stringBuffer.append(genFeature.getPrimitiveValueFunction()); + stringBuffer.append(TEXT_393); + } + stringBuffer.append(TEXT_394); + } else { + stringBuffer.append(TEXT_395); + if (genFeature.isPrimitiveType()) { + stringBuffer.append(TEXT_396); + } + stringBuffer.append(TEXT_397); + stringBuffer.append(genFeature.getObjectType()); + stringBuffer.append(TEXT_398); + stringBuffer.append(delegateFeature.getAccessorName()); + stringBuffer.append(TEXT_399); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_400); + if (genFeature.isPrimitiveType()) { + stringBuffer.append(TEXT_401); + stringBuffer.append(genFeature.getPrimitiveValueFunction()); + stringBuffer.append(TEXT_402); + } + stringBuffer.append(TEXT_403); + } + } + } else { + stringBuffer.append(TEXT_404); + stringBuffer.append(genFeature.getFormattedName()); + stringBuffer.append(TEXT_405); + stringBuffer.append(genFeature.getFeatureKind()); + stringBuffer.append(TEXT_406); + //Class/getGenFeature.todo.override.javajetinc + } + } + stringBuffer.append(TEXT_407); + } + //Class/getGenFeature.override.javajetinc + } + if (isImplementation && !genModel.isReflectiveDelegation() && genFeature.isBasicGet()) { + stringBuffer.append(TEXT_408); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_409); + stringBuffer.append(genFeature.getAccessorName()); + stringBuffer.append(TEXT_410); + if (genFeature.isContainer()) { + stringBuffer.append(TEXT_411); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_412); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_413); + } else if (!genFeature.isVolatile()) { + if (genModel.isVirtualDelegation()) { + stringBuffer.append(TEXT_414); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_415); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_416); + } else { + stringBuffer.append(TEXT_417); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_418); + } + } else if (genFeature.hasDelegateFeature()) { GenFeature delegateFeature = genFeature.getDelegateFeature(); //BBBB + if (delegateFeature.isWrappedFeatureMapType()) { + stringBuffer.append(TEXT_419); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_420); + stringBuffer.append(delegateFeature.getAccessorName()); + stringBuffer.append(TEXT_421); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_422); + } else { + stringBuffer.append(TEXT_423); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_424); + stringBuffer.append(delegateFeature.getAccessorName()); + stringBuffer.append(TEXT_425); + stringBuffer.append(genFeature.getQualifiedFeatureAccessor()); + stringBuffer.append(TEXT_426); + } + } else { + stringBuffer.append(TEXT_427); + stringBuffer.append(genFeature.getFormattedName()); + stringBuffer.append(TEXT_428); + stringBuffer.append(genFeature.getFeatureKind()); + stringBuffer.append(TEXT_429); + //Class/basicGetGenFeature.todo.override.javajetinc + } + stringBuffer.append(TEXT_430); + //Class/basicGetGenFeature.override.javajetinc + } + if (isImplementation && !genModel.isReflectiveDelegation() && genFeature.isBasicSet()) { + stringBuffer.append(TEXT_431); + stringBuffer.append(genFeature.getAccessorName()); + stringBuffer.append(TEXT_432); + stringBuffer.append(genFeature.getImportedInternalType()); + stringBuffer.append(TEXT_433); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_434); + if (!genFeature.isVolatile()) { + if (genModel.isVirtualDelegation()) { + stringBuffer.append(TEXT_435); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_436); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_437); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_438); + } else { + stringBuffer.append(TEXT_439); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_440); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_441); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_442); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_443); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_444); + } + if (genFeature.isUnsettable()) { + if (genModel.isVirtualDelegation()) { + stringBuffer.append(TEXT_445); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_446); + } else if (genClass.isESetFlag(genFeature)) { + stringBuffer.append(TEXT_447); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_448); + stringBuffer.append(genClass.getESetFlagsField(genFeature)); + stringBuffer.append(TEXT_449); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_450); + stringBuffer.append(genClass.getESetFlagsField(genFeature)); + stringBuffer.append(TEXT_451); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_452); + } else { + stringBuffer.append(TEXT_453); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_454); + stringBuffer.append(genFeature.getUncapName()); + stringBuffer.append(TEXT_455); + stringBuffer.append(genFeature.getUncapName()); + stringBuffer.append(TEXT_456); + } + } + if (!genModel.isSuppressNotification()) { + stringBuffer.append(TEXT_457); + if (genFeature.isUnsettable()) { + stringBuffer.append(TEXT_458); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_459); + if (genModel.isVirtualDelegation()) { + stringBuffer.append(TEXT_460); + stringBuffer.append(genFeature.getCapName()); + } else { + stringBuffer.append(TEXT_461); + stringBuffer.append(genFeature.getCapName()); + } + stringBuffer.append(TEXT_462); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_463); + if (genModel.isVirtualDelegation()) { + stringBuffer.append(TEXT_464); + } else { + stringBuffer.append(TEXT_465); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_466); + } + stringBuffer.append(TEXT_467); + } else { + stringBuffer.append(TEXT_468); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_469); + if (genModel.isVirtualDelegation()) { + stringBuffer.append(TEXT_470); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_471); + stringBuffer.append(genFeature.getCapName()); + } else { + stringBuffer.append(TEXT_472); + stringBuffer.append(genFeature.getCapName()); + } + stringBuffer.append(TEXT_473); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_474); + } + stringBuffer.append(TEXT_475); + } + stringBuffer.append(TEXT_476); + } else if (genFeature.hasDelegateFeature()) { GenFeature delegateFeature = genFeature.getDelegateFeature(); //CCCC + if (delegateFeature.isWrappedFeatureMapType()) { + stringBuffer.append(TEXT_477); + stringBuffer.append(delegateFeature.getAccessorName()); + stringBuffer.append(TEXT_478); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_479); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_480); + } else { + stringBuffer.append(TEXT_481); + stringBuffer.append(delegateFeature.getAccessorName()); + stringBuffer.append(TEXT_482); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_483); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_484); + } + } else { + stringBuffer.append(TEXT_485); + stringBuffer.append(genFeature.getFormattedName()); + stringBuffer.append(TEXT_486); + stringBuffer.append(genFeature.getFeatureKind()); + stringBuffer.append(TEXT_487); + //Class/basicSetGenFeature.todo.override.javajetinc + } + stringBuffer.append(TEXT_488); + //Class/basicSetGenFeature.override.javajetinc + } + if (genFeature.isSet() && (isImplementation || !genFeature.isSuppressedSetVisibility())) { + if (isInterface) { + stringBuffer.append(TEXT_489); + stringBuffer.append(genClass.getQualifiedInterfaceName()); + stringBuffer.append(TEXT_490); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_491); + stringBuffer.append(genFeature.getFormattedName()); + stringBuffer.append(TEXT_492); + stringBuffer.append(genFeature.getFeatureKind()); + stringBuffer.append(TEXT_493); + stringBuffer.append(genFeature.getFormattedName()); + stringBuffer.append(TEXT_494); + stringBuffer.append(genFeature.getFeatureKind()); + stringBuffer.append(TEXT_495); + if (genFeature.isEnumType()) { + stringBuffer.append(TEXT_496); + stringBuffer.append(genFeature.getTypeGenEnum().getQualifiedName()); + } + if (genFeature.isUnsettable()) { + if (!genFeature.isSuppressedIsSetVisibility()) { + stringBuffer.append(TEXT_497); + stringBuffer.append(genFeature.getAccessorName()); + stringBuffer.append(TEXT_498); + } + if (!genFeature.isSuppressedUnsetVisibility()) { + stringBuffer.append(TEXT_499); + stringBuffer.append(genFeature.getAccessorName()); + stringBuffer.append(TEXT_500); + } + } + stringBuffer.append(TEXT_501); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_502); + } else { + stringBuffer.append(TEXT_503); + } + if (!isImplementation) { + stringBuffer.append(TEXT_504); + stringBuffer.append(genFeature.getAccessorName()); + stringBuffer.append(TEXT_505); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_506); + } else { + stringBuffer.append(TEXT_507); + stringBuffer.append(genFeature.getAccessorName()); + stringBuffer.append(TEXT_508); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_509); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_510); + if (genModel.isReflectiveDelegation()) { + stringBuffer.append(TEXT_511); + stringBuffer.append(genFeature.getQualifiedFeatureAccessor()); + stringBuffer.append(TEXT_512); + if (genFeature.isPrimitiveType()) { + stringBuffer.append(TEXT_513); + stringBuffer.append(genFeature.getObjectType()); + stringBuffer.append(TEXT_514); + } + stringBuffer.append(TEXT_515); + stringBuffer.append(genFeature.getCapName()); + if (genFeature.isPrimitiveType()) { + stringBuffer.append(TEXT_516); + } + stringBuffer.append(TEXT_517); + } else if (!genFeature.isVolatile()) { + if (genFeature.isContainer()) { GenFeature reverseFeature = genFeature.getReverse(); GenClass targetClass = reverseFeature.getGenClass(); + stringBuffer.append(TEXT_518); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_519); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_520); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_521); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.EcoreUtil")); + stringBuffer.append(TEXT_522); + stringBuffer.append(genFeature.getEObjectCast()); + stringBuffer.append(TEXT_523); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_524); + stringBuffer.append(genModel.getImportedName("java.lang.IllegalArgumentException")); + stringBuffer.append(TEXT_525); + stringBuffer.append(genModel.getNonNLS()); + stringBuffer.append(TEXT_526); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_527); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject")); + stringBuffer.append(TEXT_528); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_529); + stringBuffer.append(targetClass.getQualifiedFeatureID(reverseFeature)); + stringBuffer.append(TEXT_530); + stringBuffer.append(targetClass.getImportedInterfaceName()); + stringBuffer.append(TEXT_531); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject")); + stringBuffer.append(TEXT_532); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_533); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_534); + if (!genModel.isSuppressNotification()) { + stringBuffer.append(TEXT_535); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_536); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_537); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_538); + } + } else if (genFeature.isBidirectional() || genFeature.isEffectiveContains()) { + if (genModel.isVirtualDelegation()) { + stringBuffer.append(TEXT_539); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_540); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_541); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_542); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_543); + } + stringBuffer.append(TEXT_544); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_545); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_546); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_547); + if (!genFeature.isBidirectional()) { + stringBuffer.append(TEXT_548); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_549); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_550); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_551); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_552); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_553); + } else { GenFeature reverseFeature = genFeature.getReverse(); GenClass targetClass = reverseFeature.getGenClass(); + stringBuffer.append(TEXT_554); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_555); + stringBuffer.append(SDOGenUtil.getQualifiedInternalPropertyID(reverseFeature)); + stringBuffer.append(TEXT_556); + stringBuffer.append(targetClass.getImportedInterfaceName()); + stringBuffer.append(TEXT_557); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_558); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_559); + stringBuffer.append(SDOGenUtil.getQualifiedInternalPropertyID(reverseFeature)); + stringBuffer.append(TEXT_560); + stringBuffer.append(targetClass.getImportedInterfaceName()); + stringBuffer.append(TEXT_561); + } + stringBuffer.append(TEXT_562); + stringBuffer.append(genFeature.getAccessorName()); + stringBuffer.append(TEXT_563); + stringBuffer.append(genFeature.getInternalTypeCast()); + stringBuffer.append(TEXT_564); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_565); + if (genFeature.isUnsettable()) { + stringBuffer.append(TEXT_566); + if (genModel.isVirtualDelegation()) { + stringBuffer.append(TEXT_567); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_568); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_569); + } else if (genClass.isESetFlag(genFeature)) { + if (!genModel.isSuppressNotification()) { + stringBuffer.append(TEXT_570); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_571); + stringBuffer.append(genClass.getESetFlagsField(genFeature)); + stringBuffer.append(TEXT_572); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_573); + } + stringBuffer.append(TEXT_574); + stringBuffer.append(genClass.getESetFlagsField(genFeature)); + stringBuffer.append(TEXT_575); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_576); + } else { + if (!genModel.isSuppressNotification()) { + stringBuffer.append(TEXT_577); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_578); + stringBuffer.append(genFeature.getUncapName()); + stringBuffer.append(TEXT_579); + } + stringBuffer.append(TEXT_580); + stringBuffer.append(genFeature.getUncapName()); + stringBuffer.append(TEXT_581); + } + if (!genModel.isSuppressNotification()) { + stringBuffer.append(TEXT_582); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_583); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_584); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_585); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_586); + } + stringBuffer.append(TEXT_587); + } else { + if (!genModel.isSuppressNotification()) { + stringBuffer.append(TEXT_588); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_589); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_590); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_591); + } + } + } else { + if (genClass.isFlag(genFeature)) { + if (!genModel.isSuppressNotification()) { + stringBuffer.append(TEXT_592); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_593); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_594); + stringBuffer.append(genClass.getFlagsField(genFeature)); + stringBuffer.append(TEXT_595); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_596); + } + stringBuffer.append(TEXT_597); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_598); + stringBuffer.append(genClass.getFlagsField(genFeature)); + stringBuffer.append(TEXT_599); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_600); + stringBuffer.append(genClass.getFlagsField(genFeature)); + stringBuffer.append(TEXT_601); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_602); + } else { + if (!genModel.isVirtualDelegation() || genFeature.isPrimitiveType()) { + if (!genModel.isSuppressNotification()) { + stringBuffer.append(TEXT_603); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_604); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_605); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_606); + } + } + if (genFeature.isEnumType()) { + if (genModel.isVirtualDelegation()) { + stringBuffer.append(TEXT_607); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_608); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_609); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_610); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_611); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_612); + } else { + stringBuffer.append(TEXT_613); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_614); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_615); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_616); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_617); + } + } else { + if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) { + stringBuffer.append(TEXT_618); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_619); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_620); + stringBuffer.append(genFeature.getInternalTypeCast()); + stringBuffer.append(TEXT_621); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_622); + } else { + stringBuffer.append(TEXT_623); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_624); + stringBuffer.append(genFeature.getInternalTypeCast()); + stringBuffer.append(TEXT_625); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_626); + } + } + if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) { + stringBuffer.append(TEXT_627); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_628); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_629); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_630); + } + } + if (genFeature.isUnsettable()) { + if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) { + stringBuffer.append(TEXT_631); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_632); + } else if (genClass.isESetFlag(genFeature)) { + if (!genModel.isSuppressNotification()) { + stringBuffer.append(TEXT_633); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_634); + stringBuffer.append(genClass.getESetFlagsField(genFeature)); + stringBuffer.append(TEXT_635); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_636); + } + stringBuffer.append(TEXT_637); + stringBuffer.append(genClass.getESetFlagsField(genFeature)); + stringBuffer.append(TEXT_638); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_639); + } else { + if (!genModel.isSuppressNotification()) { + stringBuffer.append(TEXT_640); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_641); + stringBuffer.append(genFeature.getUncapName()); + stringBuffer.append(TEXT_642); + } + stringBuffer.append(TEXT_643); + stringBuffer.append(genFeature.getUncapName()); + stringBuffer.append(TEXT_644); + } + if (!genModel.isSuppressNotification()) { + stringBuffer.append(TEXT_645); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_646); + if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) { + stringBuffer.append(TEXT_647); + if (genFeature.isReferenceType()) { + stringBuffer.append(TEXT_648); + } else { + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_649); + } + stringBuffer.append(TEXT_650); + stringBuffer.append(genFeature.getCapName()); + } else { + stringBuffer.append(TEXT_651); + stringBuffer.append(genFeature.getCapName()); + } + stringBuffer.append(TEXT_652); + if (genClass.isFlag(genFeature)) { + stringBuffer.append(TEXT_653); + stringBuffer.append(genFeature.getCapName()); + } else { + stringBuffer.append(genFeature.getSafeName()); + } + stringBuffer.append(TEXT_654); + if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) { + stringBuffer.append(TEXT_655); + } else { + stringBuffer.append(TEXT_656); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_657); + } + stringBuffer.append(TEXT_658); + } + } else { + if (!genModel.isSuppressNotification()) { + stringBuffer.append(TEXT_659); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_660); + if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) { + stringBuffer.append(TEXT_661); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_662); + if (genFeature.isReferenceType()) { + stringBuffer.append(TEXT_663); + } else { + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_664); + } + stringBuffer.append(TEXT_665); + stringBuffer.append(genFeature.getCapName()); + } else { + stringBuffer.append(TEXT_666); + stringBuffer.append(genFeature.getCapName()); + } + stringBuffer.append(TEXT_667); + if (genClass.isFlag(genFeature)) { + stringBuffer.append(TEXT_668); + stringBuffer.append(genFeature.getCapName()); + } else { + stringBuffer.append(genFeature.getSafeName()); + } + stringBuffer.append(TEXT_669); + } + } + } + } else if (genFeature.hasDelegateFeature()) { GenFeature delegateFeature = genFeature.getDelegateFeature(); // DDDD + if (delegateFeature.isWrappedFeatureMapType()) { + stringBuffer.append(TEXT_670); + stringBuffer.append(delegateFeature.getAccessorName()); + stringBuffer.append(TEXT_671); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_672); + if (genFeature.isPrimitiveType()){ + stringBuffer.append(TEXT_673); + stringBuffer.append(genFeature.getObjectType()); + stringBuffer.append(TEXT_674); + } + stringBuffer.append(TEXT_675); + stringBuffer.append(genFeature.getCapName()); + if (genFeature.isPrimitiveType()){ + stringBuffer.append(TEXT_676); + } + stringBuffer.append(TEXT_677); + } else { + stringBuffer.append(TEXT_678); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")); + stringBuffer.append(TEXT_679); + stringBuffer.append(delegateFeature.getAccessorName()); + stringBuffer.append(TEXT_680); + stringBuffer.append(genFeature.getQualifiedFeatureAccessor()); + stringBuffer.append(TEXT_681); + if (genFeature.isPrimitiveType()) { + stringBuffer.append(TEXT_682); + stringBuffer.append(genFeature.getObjectType()); + stringBuffer.append(TEXT_683); + } + stringBuffer.append(TEXT_684); + stringBuffer.append(genFeature.getCapName()); + if (genFeature.isPrimitiveType()){ + stringBuffer.append(TEXT_685); + } + stringBuffer.append(TEXT_686); + } + } else { + stringBuffer.append(TEXT_687); + stringBuffer.append(genFeature.getFormattedName()); + stringBuffer.append(TEXT_688); + stringBuffer.append(genFeature.getFeatureKind()); + stringBuffer.append(TEXT_689); + //Class/setGenFeature.todo.override.javajetinc + } + stringBuffer.append(TEXT_690); + } + //Class/setGenFeature.override.javajetinc + } + if (isImplementation && !genModel.isReflectiveDelegation() && genFeature.isBasicUnset()) { + stringBuffer.append(TEXT_691); + stringBuffer.append(genFeature.getAccessorName()); + stringBuffer.append(TEXT_692); + if (!genFeature.isVolatile()) { + if (genModel.isVirtualDelegation()) { + stringBuffer.append(TEXT_693); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_694); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_695); + } else { + stringBuffer.append(TEXT_696); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_697); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_698); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_699); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_700); + } + if (genModel.isVirtualDelegation()) { + stringBuffer.append(TEXT_701); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_702); + } else if (genClass.isESetFlag(genFeature)) { + stringBuffer.append(TEXT_703); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_704); + stringBuffer.append(genClass.getESetFlagsField(genFeature)); + stringBuffer.append(TEXT_705); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_706); + stringBuffer.append(genClass.getESetFlagsField(genFeature)); + stringBuffer.append(TEXT_707); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_708); + } else { + stringBuffer.append(TEXT_709); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_710); + stringBuffer.append(genFeature.getUncapName()); + stringBuffer.append(TEXT_711); + stringBuffer.append(genFeature.getUncapName()); + stringBuffer.append(TEXT_712); + } + if (!genModel.isSuppressNotification()) { + stringBuffer.append(TEXT_713); + if (genFeature.isUnsettable()) { + stringBuffer.append(TEXT_714); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_715); + if (genModel.isVirtualDelegation()) { + stringBuffer.append(TEXT_716); + stringBuffer.append(genFeature.getCapName()); + } else { + stringBuffer.append(TEXT_717); + stringBuffer.append(genFeature.getCapName()); + } + stringBuffer.append(TEXT_718); + if (genModel.isVirtualDelegation()) { + stringBuffer.append(TEXT_719); + } else { + stringBuffer.append(TEXT_720); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_721); + } + stringBuffer.append(TEXT_722); + } else { + stringBuffer.append(TEXT_723); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_724); + if (genModel.isVirtualDelegation()) { + stringBuffer.append(TEXT_725); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_726); + stringBuffer.append(genFeature.getCapName()); + } else { + stringBuffer.append(TEXT_727); + stringBuffer.append(genFeature.getCapName()); + } + stringBuffer.append(TEXT_728); + } + stringBuffer.append(TEXT_729); + } + stringBuffer.append(TEXT_730); + } else { + stringBuffer.append(TEXT_731); + stringBuffer.append(genFeature.getFormattedName()); + stringBuffer.append(TEXT_732); + stringBuffer.append(genFeature.getFeatureKind()); + stringBuffer.append(TEXT_733); + //Class/basicUnsetGenFeature.todo.override.javajetinc + } + stringBuffer.append(TEXT_734); + //Class.basicUnsetGenFeature.override.javajetinc + } + if (genFeature.isUnset() && (isImplementation || !genFeature.isSuppressedUnsetVisibility())) { + if (isInterface) { + stringBuffer.append(TEXT_735); + stringBuffer.append(genClass.getQualifiedInterfaceName()); + stringBuffer.append(TEXT_736); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_737); + stringBuffer.append(genFeature.getFormattedName()); + stringBuffer.append(TEXT_738); + stringBuffer.append(genFeature.getFeatureKind()); + stringBuffer.append(TEXT_739); + if (!genFeature.isSuppressedIsSetVisibility()) { + stringBuffer.append(TEXT_740); + stringBuffer.append(genFeature.getAccessorName()); + stringBuffer.append(TEXT_741); + } + stringBuffer.append(TEXT_742); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_743); + if (!genFeature.isListType() && !genFeature.isSuppressedSetVisibility()) { + stringBuffer.append(TEXT_744); + stringBuffer.append(genFeature.getAccessorName()); + stringBuffer.append(TEXT_745); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_746); + } + stringBuffer.append(TEXT_747); + } else { + stringBuffer.append(TEXT_748); + } + if (!isImplementation) { + stringBuffer.append(TEXT_749); + stringBuffer.append(genFeature.getAccessorName()); + stringBuffer.append(TEXT_750); + } else { + stringBuffer.append(TEXT_751); + stringBuffer.append(genFeature.getAccessorName()); + stringBuffer.append(TEXT_752); + if (genModel.isReflectiveDelegation()) { + stringBuffer.append(TEXT_753); + stringBuffer.append(genFeature.getQualifiedFeatureAccessor()); + stringBuffer.append(TEXT_754); + } else if (!genFeature.isVolatile()) { + if (genFeature.isListType()) { + stringBuffer.append(TEXT_755); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.InternalEList")); + stringBuffer.append(TEXT_756); + stringBuffer.append(genFeature.getAccessorName()); + stringBuffer.append(TEXT_757); + } else if (genFeature.isBidirectional() || genFeature.isEffectiveContains()) { + if (genModel.isVirtualDelegation()) { + stringBuffer.append(TEXT_758); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_759); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_760); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_761); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_762); + } + stringBuffer.append(TEXT_763); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_764); + if (!genFeature.isBidirectional()) { + stringBuffer.append(TEXT_765); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_766); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_767); + } else { GenFeature reverseFeature = genFeature.getReverse(); GenClass targetClass = reverseFeature.getGenClass(); + stringBuffer.append(TEXT_768); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_769); + stringBuffer.append(SDOGenUtil.getQualifiedInternalPropertyID(reverseFeature)); + stringBuffer.append(TEXT_770); + stringBuffer.append(targetClass.getImportedInterfaceName()); + stringBuffer.append(TEXT_771); + } + stringBuffer.append(TEXT_772); + stringBuffer.append(genFeature.getAccessorName()); + stringBuffer.append(TEXT_773); + if (genModel.isVirtualDelegation()) { + stringBuffer.append(TEXT_774); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_775); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_776); + } else if (genClass.isESetFlag(genFeature)) { + if (!genModel.isSuppressNotification()) { + stringBuffer.append(TEXT_777); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_778); + stringBuffer.append(genClass.getESetFlagsField(genFeature)); + stringBuffer.append(TEXT_779); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_780); + } + stringBuffer.append(TEXT_781); + stringBuffer.append(genClass.getESetFlagsField(genFeature)); + stringBuffer.append(TEXT_782); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_783); + } else { + if (!genModel.isSuppressNotification()) { + stringBuffer.append(TEXT_784); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_785); + stringBuffer.append(genFeature.getUncapName()); + stringBuffer.append(TEXT_786); + } + stringBuffer.append(TEXT_787); + stringBuffer.append(genFeature.getUncapName()); + stringBuffer.append(TEXT_788); + } + if (!genModel.isSuppressNotification()) { + stringBuffer.append(TEXT_789); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_790); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_791); + } + stringBuffer.append(TEXT_792); + } else { + if (genClass.isFlag(genFeature)) { + if (!genModel.isSuppressNotification()) { + stringBuffer.append(TEXT_793); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_794); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_795); + stringBuffer.append(genClass.getFlagsField(genFeature)); + stringBuffer.append(TEXT_796); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_797); + } + } else if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) { + stringBuffer.append(TEXT_798); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_799); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_800); + } else { + if (!genModel.isSuppressNotification()) { + stringBuffer.append(TEXT_801); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_802); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_803); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_804); + } + } + if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) { + stringBuffer.append(TEXT_805); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_806); + } else if (genClass.isESetFlag(genFeature)) { + stringBuffer.append(TEXT_807); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_808); + stringBuffer.append(genClass.getESetFlagsField(genFeature)); + stringBuffer.append(TEXT_809); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_810); + } else { + if (!genModel.isSuppressNotification()) { + stringBuffer.append(TEXT_811); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_812); + stringBuffer.append(genFeature.getUncapName()); + stringBuffer.append(TEXT_813); + } + } + if (genFeature.isReferenceType()) { + stringBuffer.append(TEXT_814); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_815); + if (!genModel.isVirtualDelegation()) { + if (genClass.isESetFlag(genFeature)) { + stringBuffer.append(TEXT_816); + stringBuffer.append(genClass.getESetFlagsField(genFeature)); + stringBuffer.append(TEXT_817); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_818); + } else { + stringBuffer.append(TEXT_819); + stringBuffer.append(genFeature.getUncapName()); + stringBuffer.append(TEXT_820); + } + } + if (!genModel.isSuppressNotification()) { + stringBuffer.append(TEXT_821); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_822); + if (genModel.isVirtualDelegation()) { + stringBuffer.append(TEXT_823); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_824); + } else { + stringBuffer.append(TEXT_825); + stringBuffer.append(genFeature.getCapName()); + } + stringBuffer.append(TEXT_826); + if (genModel.isVirtualDelegation()) { + stringBuffer.append(TEXT_827); + } else { + stringBuffer.append(TEXT_828); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_829); + } + stringBuffer.append(TEXT_830); + } + } else { + if (genClass.isFlag(genFeature)) { + stringBuffer.append(TEXT_831); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_832); + stringBuffer.append(genClass.getFlagsField(genFeature)); + stringBuffer.append(TEXT_833); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_834); + stringBuffer.append(genClass.getFlagsField(genFeature)); + stringBuffer.append(TEXT_835); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_836); + } else if (!genModel.isVirtualDelegation() || genFeature.isPrimitiveType()) { + stringBuffer.append(TEXT_837); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_838); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_839); + } + if (!genModel.isVirtualDelegation() || genFeature.isPrimitiveType()) { + if (genClass.isESetFlag(genFeature)) { + stringBuffer.append(TEXT_840); + stringBuffer.append(genClass.getESetFlagsField(genFeature)); + stringBuffer.append(TEXT_841); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_842); + } else { + stringBuffer.append(TEXT_843); + stringBuffer.append(genFeature.getUncapName()); + stringBuffer.append(TEXT_844); + } + } + if (!genModel.isSuppressNotification()) { + stringBuffer.append(TEXT_845); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_846); + if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) { + stringBuffer.append(TEXT_847); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_848); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_849); + } else { + stringBuffer.append(TEXT_850); + stringBuffer.append(genFeature.getCapName()); + } + stringBuffer.append(TEXT_851); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_852); + if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) { + stringBuffer.append(TEXT_853); + } else { + stringBuffer.append(TEXT_854); + stringBuffer.append(genFeature.getCapName()); + stringBuffer.append(TEXT_855); + } + stringBuffer.append(TEXT_856); + } + } + } + } else if (genFeature.hasDelegateFeature()) { GenFeature delegateFeature = genFeature.getDelegateFeature(); //EEEE + if (delegateFeature.isWrappedFeatureMapType()) { + stringBuffer.append(TEXT_857); + stringBuffer.append(delegateFeature.getAccessorName()); + stringBuffer.append(TEXT_858); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_859); + } else { + stringBuffer.append(TEXT_860); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_861); + stringBuffer.append(delegateFeature.getAccessorName()); + stringBuffer.append(TEXT_862); + } + } else { + stringBuffer.append(TEXT_863); + stringBuffer.append(genFeature.getFormattedName()); + stringBuffer.append(TEXT_864); + stringBuffer.append(genFeature.getFeatureKind()); + stringBuffer.append(TEXT_865); + //Class/unsetGenFeature.todo.override.javajetinc + } + stringBuffer.append(TEXT_866); + } + //Class/unsetGenFeature.override.javajetinc + } + if (genFeature.isIsSet() && (isImplementation || !genFeature.isSuppressedIsSetVisibility())) { + if (isInterface) { + stringBuffer.append(TEXT_867); + stringBuffer.append(genClass.getQualifiedInterfaceName()); + stringBuffer.append(TEXT_868); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_869); + stringBuffer.append(genFeature.getFormattedName()); + stringBuffer.append(TEXT_870); + stringBuffer.append(genFeature.getFeatureKind()); + stringBuffer.append(TEXT_871); + stringBuffer.append(genFeature.getFormattedName()); + stringBuffer.append(TEXT_872); + stringBuffer.append(genFeature.getFeatureKind()); + stringBuffer.append(TEXT_873); + if (genFeature.isChangeable() && !genFeature.isSuppressedUnsetVisibility()) { + stringBuffer.append(TEXT_874); + stringBuffer.append(genFeature.getAccessorName()); + stringBuffer.append(TEXT_875); + } + stringBuffer.append(TEXT_876); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_877); + if (!genFeature.isListType() && genFeature.isChangeable() && !genFeature.isSuppressedSetVisibility()) { + stringBuffer.append(TEXT_878); + stringBuffer.append(genFeature.getAccessorName()); + stringBuffer.append(TEXT_879); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_880); + } + stringBuffer.append(TEXT_881); + } else { + stringBuffer.append(TEXT_882); + } + if (!isImplementation) { + stringBuffer.append(TEXT_883); + stringBuffer.append(genFeature.getAccessorName()); + stringBuffer.append(TEXT_884); + } else { + stringBuffer.append(TEXT_885); + stringBuffer.append(genFeature.getAccessorName()); + stringBuffer.append(TEXT_886); + if (genModel.isReflectiveDelegation()) { + stringBuffer.append(TEXT_887); + stringBuffer.append(genFeature.getQualifiedFeatureAccessor()); + stringBuffer.append(TEXT_888); + } else if (!genFeature.isVolatile()) { + if (genFeature.isListType()) { + if (genModel.isVirtualDelegation()) { + stringBuffer.append(TEXT_889); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_890); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_891); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_892); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_893); + } + stringBuffer.append(TEXT_894); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_895); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.InternalEList")); + stringBuffer.append(TEXT_896); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_897); + } else { + if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) { + stringBuffer.append(TEXT_898); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_899); + } else if (genClass.isESetFlag(genFeature)) { + stringBuffer.append(TEXT_900); + stringBuffer.append(genClass.getESetFlagsField(genFeature)); + stringBuffer.append(TEXT_901); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_902); + } else { + stringBuffer.append(TEXT_903); + stringBuffer.append(genFeature.getUncapName()); + stringBuffer.append(TEXT_904); + } + } + } else if (genFeature.hasDelegateFeature()) { GenFeature delegateFeature = genFeature.getDelegateFeature(); //FFFF + if (delegateFeature.isWrappedFeatureMapType()) { + stringBuffer.append(TEXT_905); + stringBuffer.append(delegateFeature.getAccessorName()); + stringBuffer.append(TEXT_906); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_907); + } else { + stringBuffer.append(TEXT_908); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")); + stringBuffer.append(TEXT_909); + stringBuffer.append(delegateFeature.getAccessorName()); + stringBuffer.append(TEXT_910); + stringBuffer.append(genFeature.getQualifiedFeatureAccessor()); + stringBuffer.append(TEXT_911); + } + } else { + stringBuffer.append(TEXT_912); + stringBuffer.append(genFeature.getFormattedName()); + stringBuffer.append(TEXT_913); + stringBuffer.append(genFeature.getFeatureKind()); + stringBuffer.append(TEXT_914); + //Class/isSetGenFeature.todo.override.javajetinc + } + stringBuffer.append(TEXT_915); + } + //Class/isSetGenFeature.override.javajetinc + } + //Class/genFeature.override.javajetinc + }// end output getter and setter interfaces or impls + for (Iterator i= (isImplementation ? genClass.getImplementedGenOperations() : genClass.getDeclaredGenOperations()).iterator(); i.hasNext();) { GenOperation genOperation = (GenOperation)i.next(); + if (isInterface) { + stringBuffer.append(TEXT_916); + if (genOperation.hasDocumentation()) { + stringBuffer.append(TEXT_917); + stringBuffer.append(genOperation.getDocumentation(genModel.getIndentation(stringBuffer))); + stringBuffer.append(TEXT_918); + } + 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_919); + stringBuffer.append(modelInfo); + } else { + stringBuffer.append(TEXT_920); + stringBuffer.append(modelInfo); + }} if (first) { + stringBuffer.append(TEXT_921); + }} + stringBuffer.append(TEXT_922); + } else { + stringBuffer.append(TEXT_923); + } + if (!isImplementation) { + stringBuffer.append(TEXT_924); + stringBuffer.append(genOperation.getImportedType()); + stringBuffer.append(TEXT_925); + stringBuffer.append(genOperation.getName()); + stringBuffer.append(TEXT_926); + stringBuffer.append(genOperation.getParameters()); + stringBuffer.append(TEXT_927); + stringBuffer.append(genOperation.getThrows()); + stringBuffer.append(TEXT_928); + } else { + stringBuffer.append(TEXT_929); + stringBuffer.append(genOperation.getImportedType()); + stringBuffer.append(TEXT_930); + stringBuffer.append(genOperation.getName()); + stringBuffer.append(TEXT_931); + stringBuffer.append(genOperation.getParameters()); + stringBuffer.append(TEXT_932); + stringBuffer.append(genOperation.getThrows()); + stringBuffer.append(TEXT_933); + if (genOperation.hasBody()) { + stringBuffer.append(TEXT_934); + 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_935); + stringBuffer.append(diagnostics); + stringBuffer.append(TEXT_936); + stringBuffer.append(diagnostics); + stringBuffer.append(TEXT_937); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.BasicDiagnostic")); + stringBuffer.append(TEXT_938); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.Diagnostic")); + stringBuffer.append(TEXT_939); + stringBuffer.append(opClass.getGenPackage().getImportedValidatorClassName()); + stringBuffer.append(TEXT_940); + stringBuffer.append(opClass.getGenPackage().getImportedValidatorClassName()); + stringBuffer.append(TEXT_941); + stringBuffer.append(opClass.getOperationID(genOperation)); + stringBuffer.append(TEXT_942); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.plugin.EcorePlugin")); + stringBuffer.append(TEXT_943); + stringBuffer.append(genOperation.getName()); + stringBuffer.append(TEXT_944); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.EObjectValidator")); + stringBuffer.append(TEXT_945); + stringBuffer.append(context); + stringBuffer.append(TEXT_946); + stringBuffer.append(genModel.getNonNLS()); + stringBuffer.append(genModel.getNonNLS(2)); + stringBuffer.append(TEXT_947); + } else { + stringBuffer.append(TEXT_948); + //Class/implementedGenOperation.todo.override.javajetinc + } + stringBuffer.append(TEXT_949); + } + //Class/implementedGenOperation.override.javajetinc + }//for + if (isImplementation && !genModel.isReflectiveDelegation() && genClass.implementsAny(genClass.getEInverseAddGenFeatures())) { + stringBuffer.append(TEXT_950); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject")); + stringBuffer.append(TEXT_951); + for (Iterator i=genClass.getEInverseAddGenFeatures().iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next(); + if (!genModel.isMinimalReflectiveMethods() || genClass.getImplementedGenFeatures().contains(genFeature)) { + stringBuffer.append(TEXT_952); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_953); + if (genFeature.isListType()) { + if (genFeature.isMapType() && genFeature.isEffectiveSuppressEMFTypes()) { + stringBuffer.append(TEXT_954); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.InternalEList")); + stringBuffer.append(TEXT_955); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.EMap")); + stringBuffer.append(TEXT_956); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_957); + } else { + stringBuffer.append(TEXT_958); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.InternalEList")); + stringBuffer.append(TEXT_959); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_960); + } + } else if (genFeature.isContainer()) { + stringBuffer.append(TEXT_961); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_962); + } else { + if (genClass.getImplementingGenModel(genFeature).isVirtualDelegation()) { + stringBuffer.append(TEXT_963); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_964); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_965); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_966); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_967); + } + stringBuffer.append(TEXT_968); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_969); + if (genFeature.isEffectiveContains()) { + stringBuffer.append(TEXT_970); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject")); + stringBuffer.append(TEXT_971); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_972); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_973); + } else { GenFeature reverseFeature = genFeature.getReverse(); GenClass targetClass = reverseFeature.getGenClass(); + stringBuffer.append(TEXT_974); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.InternalEObject")); + stringBuffer.append(TEXT_975); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_976); + stringBuffer.append(targetClass.getQualifiedFeatureID(reverseFeature)); + stringBuffer.append(TEXT_977); + stringBuffer.append(targetClass.getImportedInterfaceName()); + stringBuffer.append(TEXT_978); + } + stringBuffer.append(TEXT_979); + stringBuffer.append(genFeature.getAccessorName()); + stringBuffer.append(TEXT_980); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_981); + } + } + } + stringBuffer.append(TEXT_982); + if (genModel.isMinimalReflectiveMethods()) { + stringBuffer.append(TEXT_983); + } else { + stringBuffer.append(TEXT_984); + } + stringBuffer.append(TEXT_985); + } + if (isImplementation && !genModel.isReflectiveDelegation() && genClass.implementsAny(genClass.getEInverseRemoveGenFeatures())) { + stringBuffer.append(TEXT_986); + stringBuffer.append(genModel.getImportedName("java.lang.Object")); + stringBuffer.append(TEXT_987); + for (Iterator i=genClass.getEInverseRemoveGenFeatures().iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next(); + if (!genModel.isMinimalReflectiveMethods() || genClass.getImplementedGenFeatures().contains(genFeature)) { + stringBuffer.append(TEXT_988); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_989); + if (genFeature.isListType()) { + if (genFeature.isMapType() && genFeature.isEffectiveSuppressEMFTypes()) { + stringBuffer.append(TEXT_990); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.InternalEList")); + stringBuffer.append(TEXT_991); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.EMap")); + stringBuffer.append(TEXT_992); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_993); + } else if (genFeature.isWrappedFeatureMapType()) { + stringBuffer.append(TEXT_994); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_995); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_996); + } else { + stringBuffer.append(TEXT_997); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_998); + } + } else if (genFeature.isContainer()) { + stringBuffer.append(TEXT_999); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_1000); + } else if (genFeature.isUnsettable()) { + stringBuffer.append(TEXT_1001); + stringBuffer.append(genFeature.getAccessorName()); + stringBuffer.append(TEXT_1002); + } else { + stringBuffer.append(TEXT_1003); + stringBuffer.append(genFeature.getAccessorName()); + stringBuffer.append(TEXT_1004); + } + } + } + stringBuffer.append(TEXT_1005); + if (genModel.isMinimalReflectiveMethods()) { + stringBuffer.append(TEXT_1006); + } else { + stringBuffer.append(TEXT_1007); + } + stringBuffer.append(TEXT_1008); + } + if (isImplementation && !genModel.isReflectiveDelegation() && genClass.implementsAny(genClass.getEBasicRemoveFromContainerGenFeatures())) { + stringBuffer.append(TEXT_1009); + 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_1010); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_1011); + stringBuffer.append(targetClass.getQualifiedFeatureID(reverseFeature)); + stringBuffer.append(TEXT_1012); + stringBuffer.append(targetClass.getImportedInterfaceName()); + stringBuffer.append(TEXT_1013); + } + } + stringBuffer.append(TEXT_1014); + if (genModel.isMinimalReflectiveMethods()) { + stringBuffer.append(TEXT_1015); + } else { + stringBuffer.append(TEXT_1016); + } + stringBuffer.append(TEXT_1017); + } + if (isImplementation && !genModel.isReflectiveDelegation() && !genClass.getImplementedGenFeatures().isEmpty()) { + stringBuffer.append(TEXT_1018); + for (Iterator i=genClass.getAllGenFeatures().iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next(); + if (!genModel.isMinimalReflectiveMethods() || genClass.getImplementedGenFeatures().contains(genFeature)) { + stringBuffer.append(TEXT_1019); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_1020); + if (genFeature.isPrimitiveType()) { + if (genFeature.isBooleanType()) { + stringBuffer.append(TEXT_1021); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_1022); + } else { + stringBuffer.append(TEXT_1023); + stringBuffer.append(genFeature.getObjectType()); + stringBuffer.append(TEXT_1024); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_1025); + } + } else if (genFeature.isResolveProxies() && !genFeature.isListType()) { + stringBuffer.append(TEXT_1026); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_1027); + stringBuffer.append(genFeature.getAccessorName()); + stringBuffer.append(TEXT_1028); + } else if (genFeature.isMapType()) { + if (genFeature.isEffectiveSuppressEMFTypes()) { + stringBuffer.append(TEXT_1029); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.EMap")); + stringBuffer.append(TEXT_1030); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_1031); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_1032); + } else { + stringBuffer.append(TEXT_1033); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_1034); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_1035); + } + } else if (genFeature.isWrappedFeatureMapType()) { + stringBuffer.append(TEXT_1036); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_1037); + } else if (genFeature.isFeatureMapType()) { + stringBuffer.append(TEXT_1038); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_1039); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")); + stringBuffer.append(TEXT_1040); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_1041); + } else { + stringBuffer.append(TEXT_1042); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_1043); + } + } + } + stringBuffer.append(TEXT_1044); + if (genModel.isMinimalReflectiveMethods()) { + stringBuffer.append(TEXT_1045); + } else { + stringBuffer.append(TEXT_1046); + } + stringBuffer.append(TEXT_1047); + } + if (isImplementation && !genModel.isReflectiveDelegation() && genClass.implementsAny(genClass.getESetGenFeatures())) { + stringBuffer.append(TEXT_1048); + for (Iterator i=genClass.getESetGenFeatures().iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next(); + if (!genModel.isMinimalReflectiveMethods() || genClass.getImplementedGenFeatures().contains(genFeature)) { + stringBuffer.append(TEXT_1049); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_1050); + if (genFeature.isListType()) { + if (genFeature.isWrappedFeatureMapType()) { + stringBuffer.append(TEXT_1051); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_1052); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_1053); + } else if (genFeature.isFeatureMapType()) { + stringBuffer.append(TEXT_1054); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")); + stringBuffer.append(TEXT_1055); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_1056); + } else if (genFeature.isMapType()) { + if (genFeature.isEffectiveSuppressEMFTypes()) { + stringBuffer.append(TEXT_1057); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); + stringBuffer.append(TEXT_1058); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.EMap")); + stringBuffer.append(TEXT_1059); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_1060); + } else { + stringBuffer.append(TEXT_1061); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); + 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); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_1066); + stringBuffer.append(genModel.getImportedName("java.util.Collection")); + stringBuffer.append(TEXT_1067); + } + } else if (genFeature.isPrimitiveType()) { + stringBuffer.append(TEXT_1068); + stringBuffer.append(genFeature.getAccessorName()); + stringBuffer.append(TEXT_1069); + stringBuffer.append(genFeature.getObjectType()); + stringBuffer.append(TEXT_1070); + stringBuffer.append(genFeature.getPrimitiveValueFunction()); + stringBuffer.append(TEXT_1071); + } else { + stringBuffer.append(TEXT_1072); + stringBuffer.append(genFeature.getAccessorName()); + stringBuffer.append(TEXT_1073); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_1074); + } + stringBuffer.append(TEXT_1075); + } + } + stringBuffer.append(TEXT_1076); + if (genModel.isMinimalReflectiveMethods()) { + stringBuffer.append(TEXT_1077); + } else { + stringBuffer.append(TEXT_1078); + } + stringBuffer.append(TEXT_1079); + for (Iterator i=genClass.getESetGenFeatures().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()) { + 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.getGetAccessor()); + stringBuffer.append(TEXT_1086); + } + } else if (genFeature.isUnsettable()) { + stringBuffer.append(TEXT_1087); + stringBuffer.append(genFeature.getAccessorName()); + stringBuffer.append(TEXT_1088); + } else if (genFeature.isReferenceType()) { + stringBuffer.append(TEXT_1089); + stringBuffer.append(genFeature.getAccessorName()); + stringBuffer.append(TEXT_1090); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_1091); + } else { + stringBuffer.append(TEXT_1092); + stringBuffer.append(genFeature.getAccessorName()); + stringBuffer.append(TEXT_1093); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_1094); + } + stringBuffer.append(TEXT_1095); + } + } + stringBuffer.append(TEXT_1096); + if (genModel.isMinimalReflectiveMethods()) { + stringBuffer.append(TEXT_1097); + } else { + stringBuffer.append(TEXT_1098); + } + stringBuffer.append(TEXT_1099); + } + if (isImplementation && !genModel.isReflectiveDelegation() && !genClass.getImplementedGenFeatures().isEmpty()) { + stringBuffer.append(TEXT_1100); + for (Iterator i=genClass.getAllGenFeatures().iterator(); i.hasNext();) { GenFeature genFeature = (GenFeature)i.next(); + if (!genModel.isMinimalReflectiveMethods() || genClass.getImplementedGenFeatures().contains(genFeature)) { + stringBuffer.append(TEXT_1101); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_1102); + if (genFeature.isListType() && !genFeature.isUnsettable()) { + if (genFeature.isWrappedFeatureMapType()) { + if (genFeature.isVolatile()) { + stringBuffer.append(TEXT_1103); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_1104); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_1105); + } else { + stringBuffer.append(TEXT_1106); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_1107); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_1108); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_1109); + } + } else { + if (genClass.isField(genFeature)) { + stringBuffer.append(TEXT_1110); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_1111); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_1112); + } else { + if (genFeature.isField() && genClass.getImplementingGenModel(genFeature).isVirtualDelegation()) { + stringBuffer.append(TEXT_1113); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_1114); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_1115); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_1116); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_1117); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_1118); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_1119); + } else { + stringBuffer.append(TEXT_1120); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_1121); + } + } + } + } else if (genFeature.isUnsettable()) { + stringBuffer.append(TEXT_1122); + stringBuffer.append(genFeature.getAccessorName()); + stringBuffer.append(TEXT_1123); + } else if (genFeature.isResolveProxies()) { + if (genClass.isField(genFeature)) { + stringBuffer.append(TEXT_1124); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_1125); + } else { + if (genFeature.isField() && genClass.getImplementingGenModel(genFeature).isVirtualDelegation()) { + stringBuffer.append(TEXT_1126); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_1127); + } else { + stringBuffer.append(TEXT_1128); + stringBuffer.append(genFeature.getAccessorName()); + stringBuffer.append(TEXT_1129); + } + } + } else if (genFeature.isReferenceType()) { + if (genClass.isField(genFeature)) { + stringBuffer.append(TEXT_1130); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_1131); + } else { + if (genFeature.isField() && genClass.getImplementingGenModel(genFeature).isVirtualDelegation()) { + stringBuffer.append(TEXT_1132); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_1133); + } else { + stringBuffer.append(TEXT_1134); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_1135); + } + } + } else if (genFeature.isPrimitiveType() || genFeature.isEnumType()) { + if (genClass.isField(genFeature)) { + if (genClass.isFlag(genFeature)) { + stringBuffer.append(TEXT_1136); + stringBuffer.append(genClass.getFlagsField(genFeature)); + stringBuffer.append(TEXT_1137); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_1138); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_1139); + } else { + stringBuffer.append(TEXT_1140); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_1141); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_1142); + } + } else { + if (genFeature.isEnumType() && genFeature.isField() && genClass.getImplementingGenModel(genFeature).isVirtualDelegation()) { + stringBuffer.append(TEXT_1143); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_1144); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_1145); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_1146); + } else { + stringBuffer.append(TEXT_1147); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_1148); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_1149); + } + } + } else {//datatype + if (genClass.isField(genFeature)) { + stringBuffer.append(TEXT_1150); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_1151); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_1152); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_1153); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_1154); + } else { + if (genFeature.isField() && genClass.getImplementingGenModel(genFeature).isVirtualDelegation()) { + stringBuffer.append(TEXT_1155); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_1156); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_1157); + stringBuffer.append(genFeature.getImportedType()); + stringBuffer.append(TEXT_1158); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_1159); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_1160); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_1161); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_1162); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_1163); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_1164); + } else { + stringBuffer.append(TEXT_1165); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_1166); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_1167); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_1168); + stringBuffer.append(genFeature.getGetAccessor()); + stringBuffer.append(TEXT_1169); + } + } + } + } + } + stringBuffer.append(TEXT_1170); + if (genModel.isMinimalReflectiveMethods()) { + stringBuffer.append(TEXT_1171); + } else { + stringBuffer.append(TEXT_1172); + } + stringBuffer.append(TEXT_1173); + //Class/eIsSet.override.javajetinc + } + if (isImplementation && !genClass.getMixinGenFeatures().isEmpty()) { + stringBuffer.append(TEXT_1174); + for (Iterator m=genClass.getMixinGenClasses().iterator(); m.hasNext();) { GenClass mixinGenClass = (GenClass)m.next(); + stringBuffer.append(TEXT_1175); + stringBuffer.append(mixinGenClass.getImportedInterfaceName()); + stringBuffer.append(TEXT_1176); + for (Iterator f=mixinGenClass.getGenFeatures().iterator(); f.hasNext();) { GenFeature genFeature = (GenFeature)f.next(); + stringBuffer.append(TEXT_1177); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_1178); + stringBuffer.append(mixinGenClass.getQualifiedFeatureID(genFeature)); + stringBuffer.append(TEXT_1179); + } + stringBuffer.append(TEXT_1180); + } + stringBuffer.append(TEXT_1181); + for (Iterator m=genClass.getMixinGenClasses().iterator(); m.hasNext();) { GenClass mixinGenClass = (GenClass)m.next(); + stringBuffer.append(TEXT_1182); + stringBuffer.append(mixinGenClass.getImportedInterfaceName()); + stringBuffer.append(TEXT_1183); + for (Iterator f=mixinGenClass.getGenFeatures().iterator(); f.hasNext();) { GenFeature genFeature = (GenFeature)f.next(); + stringBuffer.append(TEXT_1184); + stringBuffer.append(mixinGenClass.getQualifiedFeatureID(genFeature)); + stringBuffer.append(TEXT_1185); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_1186); + } + stringBuffer.append(TEXT_1187); + } + stringBuffer.append(TEXT_1188); + } + if (isImplementation && genModel.isVirtualDelegation()) { String eVirtualValuesField = genClass.getEVirtualValuesField(); + if (eVirtualValuesField != null) { + stringBuffer.append(TEXT_1189); + stringBuffer.append(eVirtualValuesField); + stringBuffer.append(TEXT_1190); + stringBuffer.append(eVirtualValuesField); + stringBuffer.append(TEXT_1191); + } + { List eVirtualIndexBitFields = genClass.getEVirtualIndexBitFields(new ArrayList()); + if (!eVirtualIndexBitFields.isEmpty()) { List allEVirtualIndexBitFields = genClass.getAllEVirtualIndexBitFields(new ArrayList()); + stringBuffer.append(TEXT_1192); + for (int i = 0; i < allEVirtualIndexBitFields.size(); i++) { + stringBuffer.append(TEXT_1193); + stringBuffer.append(i); + stringBuffer.append(TEXT_1194); + stringBuffer.append(allEVirtualIndexBitFields.get(i)); + stringBuffer.append(TEXT_1195); + } + stringBuffer.append(TEXT_1196); + for (int i = 0; i < allEVirtualIndexBitFields.size(); i++) { + stringBuffer.append(TEXT_1197); + stringBuffer.append(i); + stringBuffer.append(TEXT_1198); + stringBuffer.append(allEVirtualIndexBitFields.get(i)); + stringBuffer.append(TEXT_1199); + } + stringBuffer.append(TEXT_1200); + } + } + } + if (isImplementation && !genModel.isReflectiveDelegation() && !genClass.getToStringGenFeatures().isEmpty()) { + stringBuffer.append(TEXT_1201); + { boolean first = true; + for (Iterator i=genClass.getToStringGenFeatures().iterator(); i.hasNext(); ) { GenFeature genFeature = (GenFeature)i.next(); + if (first) { first = false; + stringBuffer.append(TEXT_1202); + stringBuffer.append(genFeature.getName()); + stringBuffer.append(TEXT_1203); + stringBuffer.append(genModel.getNonNLS()); + } else { + stringBuffer.append(TEXT_1204); + stringBuffer.append(genFeature.getName()); + stringBuffer.append(TEXT_1205); + stringBuffer.append(genModel.getNonNLS()); + } + if (genFeature.isUnsettable() && !genFeature.isListType()) { + if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) { + stringBuffer.append(TEXT_1206); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_1207); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_1208); + stringBuffer.append(genModel.getNonNLS()); + } else { + if (genClass.isFlag(genFeature)) { + stringBuffer.append(TEXT_1209); + if (genClass.isESetFlag(genFeature)) { + stringBuffer.append(TEXT_1210); + stringBuffer.append(genClass.getESetFlagsField(genFeature)); + stringBuffer.append(TEXT_1211); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_1212); + } else { + stringBuffer.append(genFeature.getUncapName()); + stringBuffer.append(TEXT_1213); + } + stringBuffer.append(TEXT_1214); + stringBuffer.append(genClass.getFlagsField(genFeature)); + stringBuffer.append(TEXT_1215); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_1216); + stringBuffer.append(genModel.getNonNLS()); + } else { + stringBuffer.append(TEXT_1217); + if (genClass.isESetFlag(genFeature)) { + stringBuffer.append(TEXT_1218); + stringBuffer.append(genClass.getESetFlagsField(genFeature)); + stringBuffer.append(TEXT_1219); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_1220); + } else { + stringBuffer.append(genFeature.getUncapName()); + stringBuffer.append(TEXT_1221); + } + stringBuffer.append(TEXT_1222); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_1223); + stringBuffer.append(genModel.getNonNLS()); + } + } + } else { + if (genModel.isVirtualDelegation() && !genFeature.isPrimitiveType()) { + stringBuffer.append(TEXT_1224); + stringBuffer.append(genFeature.getUpperName()); + if (!genFeature.isListType() && !genFeature.isReferenceType()){ + stringBuffer.append(TEXT_1225); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_1226); + } + stringBuffer.append(TEXT_1227); + } else { + if (genClass.isFlag(genFeature)) { + stringBuffer.append(TEXT_1228); + stringBuffer.append(genClass.getFlagsField(genFeature)); + stringBuffer.append(TEXT_1229); + stringBuffer.append(genFeature.getUpperName()); + stringBuffer.append(TEXT_1230); + } else { + stringBuffer.append(TEXT_1231); + stringBuffer.append(genFeature.getSafeName()); + stringBuffer.append(TEXT_1232); + } + } + } + } + } + stringBuffer.append(TEXT_1233); + } + if (isImplementation && !genModel.isReflectiveDelegation() && genClass.isAbstract()) { + stringBuffer.append(TEXT_1234); + stringBuffer.append(genClass.getClassName()); + stringBuffer.append(TEXT_1235); + } + if (isImplementation && genClass.isMapEntry()) { GenFeature keyFeature = genClass.getMapEntryKeyFeature(); GenFeature valueFeature = genClass.getMapEntryValueFeature(); + stringBuffer.append(TEXT_1236); + if (keyFeature.isPrimitiveType()) { + stringBuffer.append(TEXT_1237); + stringBuffer.append(keyFeature.getObjectType()); + stringBuffer.append(TEXT_1238); + } else { + stringBuffer.append(TEXT_1239); + } + stringBuffer.append(TEXT_1240); + if (keyFeature.isListType()) { + stringBuffer.append(TEXT_1241); + stringBuffer.append(genModel.getImportedName("java.util.Collection")); + stringBuffer.append(TEXT_1242); + } else if (keyFeature.isPrimitiveType()) { + stringBuffer.append(TEXT_1243); + stringBuffer.append(keyFeature.getObjectType()); + stringBuffer.append(TEXT_1244); + stringBuffer.append(keyFeature.getPrimitiveValueFunction()); + stringBuffer.append(TEXT_1245); + } else { + stringBuffer.append(TEXT_1246); + stringBuffer.append(keyFeature.getImportedType()); + stringBuffer.append(TEXT_1247); + } + stringBuffer.append(TEXT_1248); + if (valueFeature.isPrimitiveType()) { + stringBuffer.append(TEXT_1249); + stringBuffer.append(valueFeature.getObjectType()); + stringBuffer.append(TEXT_1250); + } else { + stringBuffer.append(TEXT_1251); + } + stringBuffer.append(TEXT_1252); + if (valueFeature.isListType()) { + stringBuffer.append(TEXT_1253); + stringBuffer.append(genModel.getImportedName("java.util.Collection")); + stringBuffer.append(TEXT_1254); + } else if (valueFeature.isPrimitiveType()) { + stringBuffer.append(TEXT_1255); + stringBuffer.append(valueFeature.getObjectType()); + stringBuffer.append(TEXT_1256); + stringBuffer.append(valueFeature.getPrimitiveValueFunction()); + stringBuffer.append(TEXT_1257); + } else { + stringBuffer.append(TEXT_1258); + stringBuffer.append(valueFeature.getImportedType()); + stringBuffer.append(TEXT_1259); + } + stringBuffer.append(TEXT_1260); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.EMap")); + stringBuffer.append(TEXT_1261); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_1262); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.util.EMap")); + stringBuffer.append(TEXT_1263); + } + stringBuffer.append(TEXT_1264); + stringBuffer.append(isInterface ? " " + genClass.getInterfaceName() : genClass.getClassName()); + // TODO fix the space above + genModel.emitSortedImports(); + stringBuffer.append(TEXT_1265); + return stringBuffer.toString(); + } +} diff --git a/sdo-java/branches/sdo-1.1-incubating/tools/src/main/java/org/apache/tuscany/sdo/generate/templates/model/SDOFactoryClass.java b/sdo-java/branches/sdo-1.1-incubating/tools/src/main/java/org/apache/tuscany/sdo/generate/templates/model/SDOFactoryClass.java new file mode 100644 index 0000000000..4a86a29027 --- /dev/null +++ b/sdo-java/branches/sdo-1.1-incubating/tools/src/main/java/org/apache/tuscany/sdo/generate/templates/model/SDOFactoryClass.java @@ -0,0 +1,1132 @@ +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.*; +import org.eclipse.emf.codegen.util.CodeGenUtil; + +/** + * 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. + */ + 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 + " * " + NL + " * " + 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 + NL + "import commonj.sdo.helper.HelperContext;" + NL + "import org.apache.tuscany.sdo.helper.HelperContextImpl;"; + protected final String TEXT_10 = NL + "import org.apache.tuscany.sdo.helper.TypeHelperImpl;"; + protected final String TEXT_11 = NL; + protected final String TEXT_12 = NL; + protected final String TEXT_13 = NL + "/**" + NL + " * " + NL + " * The Factory for the model." + NL + " * It provides a create method for each non-abstract class of the model." + NL + " * "; + protected final String TEXT_14 = NL + " * @see "; + protected final String TEXT_15 = NL + " * patternVersion="; + protected final String TEXT_16 = ";"; + protected final String TEXT_17 = NL + " * @generated" + NL + " */"; + protected final String TEXT_18 = NL + "/**" + NL + " * " + NL + " * An implementation of the model Factory." + NL + " * Generator information:" + NL + " * patternVersion="; + protected final String TEXT_19 = ";"; + protected final String TEXT_20 = NL + " * " + NL + " * @generated" + NL + " */"; + protected final String TEXT_21 = NL + "public class "; + protected final String TEXT_22 = " extends "; + protected final String TEXT_23 = " implements "; + protected final String TEXT_24 = NL + "public interface "; + protected final String TEXT_25 = " extends "; + protected final String TEXT_26 = NL + "{"; + protected final String TEXT_27 = NL + "\t/**" + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\t"; + protected final String TEXT_28 = " copyright = \""; + protected final String TEXT_29 = "\";"; + protected final String TEXT_30 = NL; + protected final String TEXT_31 = NL; + protected final String TEXT_32 = NL + "\t/**" + NL + "\t * The singleton instance of the factory." + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\t"; + protected final String TEXT_33 = " INSTANCE = "; + protected final String TEXT_34 = ".init();" + NL; + protected final String TEXT_35 = NL + "\t/**" + NL + "\t * The singleton instance of the factory." + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\t"; + protected final String TEXT_36 = " eINSTANCE = "; + protected final String TEXT_37 = ".init();" + NL; + protected final String TEXT_38 = NL + "\t/**" + NL + "\t * The package namespace URI." + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\t"; + protected final String TEXT_39 = " NAMESPACE_URI = \""; + protected final String TEXT_40 = "\";"; + protected final String TEXT_41 = NL + NL + "\t/**" + NL + "\t * The package namespace name." + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\t"; + protected final String TEXT_42 = " NAMESPACE_PREFIX = \""; + protected final String TEXT_43 = "\";"; + protected final String TEXT_44 = NL + NL + "\t/**" + NL + "\t * The version of the generator pattern used to generate this class." + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\t"; + protected final String TEXT_45 = " PATTERN_VERSION = \""; + protected final String TEXT_46 = "\";" + NL; + protected final String TEXT_47 = "\t" + NL + "\t"; + protected final String TEXT_48 = "int "; + protected final String TEXT_49 = " = "; + protected final String TEXT_50 = ";"; + protected final String TEXT_51 = NL + "\t"; + protected final String TEXT_52 = NL + "\t/**" + NL + "\t * Creates an instance of the factory." + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_53 = "()" + NL + "\t{" + NL + "\t\tsuper(NAMESPACE_URI, NAMESPACE_PREFIX, \""; + protected final String TEXT_54 = "\");" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Registers the Factory instance so that it is available within the supplied scope." + NL + " * @argument scope a HelperContext instance that will make the types supported by this Factory available." + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void register(HelperContext scope) " + NL + "\t{" + NL + "\t\tif(scope == null) {" + NL + "\t\t\tthrow new IllegalArgumentException(\"Scope can not be null\");" + NL + "\t\t}" + NL + "" + NL + "\t\tif (((HelperContextImpl)scope).getExtendedMetaData().getPackage(NAMESPACE_URI) != null)" + NL + "\t\t\treturn;" + NL + " " + NL + "\t\t// Register this package with provided scope " + NL + "\t\t((HelperContextImpl)scope).getExtendedMetaData().putPackage(NAMESPACE_URI, this);" + NL + "\t\t" + NL + "\t\t//Register dependent packages with provided scope"; + protected final String TEXT_55 = NL + "\t\t"; + protected final String TEXT_56 = ".INSTANCE.register(scope);"; + protected final String TEXT_57 = NL + " }" + NL + "\t" + NL + "\t/**" + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_58 = " create(int typeNumber)" + NL + "\t{" + NL + "\t\tswitch (typeNumber)" + NL + "\t\t{"; + protected final String TEXT_59 = NL + "\t\t\tcase "; + protected final String TEXT_60 = ": return ("; + protected final String TEXT_61 = ")create"; + protected final String TEXT_62 = "();"; + protected final String TEXT_63 = NL + "\t\t\tdefault:" + NL + "\t\t\t\treturn super.create(typeNumber);" + NL + "\t\t}" + NL + "\t}" + NL; + protected final String TEXT_64 = NL + "\t/**" + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Object createFromString(int typeNumber, String initialValue)" + NL + "\t{" + NL + "\t\tswitch (typeNumber)" + NL + "\t\t{"; + protected final String TEXT_65 = NL + "\t\t\tcase "; + protected final String TEXT_66 = ":" + NL + "\t\t\t\treturn create"; + protected final String TEXT_67 = "FromString(initialValue);"; + protected final String TEXT_68 = NL + "\t\t\tdefault:" + NL + "\t\t\t\tthrow new IllegalArgumentException(\"The type number '\" + typeNumber + \"' is not a valid datatype\");"; + protected final String TEXT_69 = NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic String convertToString(int typeNumber, Object instanceValue)" + NL + "\t{" + NL + "\t\tswitch (typeNumber)" + NL + "\t\t{"; + protected final String TEXT_70 = NL + "\t\t\tcase "; + protected final String TEXT_71 = ":" + NL + "\t\t\t\treturn convert"; + protected final String TEXT_72 = "ToString(instanceValue);"; + protected final String TEXT_73 = NL + "\t\t\tdefault:" + NL + "\t\t\t\tthrow new IllegalArgumentException(\"The type number '\" + typeNumber + \"' is not a valid datatype\");"; + protected final String TEXT_74 = NL + "\t\t}" + NL + "\t}"; + protected final String TEXT_75 = NL + "\t/**" + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_76 = " create"; + protected final String TEXT_77 = "()" + NL + "\t{"; + protected final String TEXT_78 = NL + "\t\t"; + protected final String TEXT_79 = " "; + protected final String TEXT_80 = " = "; + protected final String TEXT_81 = "super.create("; + protected final String TEXT_82 = ");"; + protected final String TEXT_83 = NL + "\t\t"; + protected final String TEXT_84 = " "; + protected final String TEXT_85 = " = new "; + protected final String TEXT_86 = "()"; + protected final String TEXT_87 = "{}"; + protected final String TEXT_88 = ";"; + protected final String TEXT_89 = NL + "\t\treturn "; + protected final String TEXT_90 = ";" + NL + "\t}"; + protected final String TEXT_91 = NL + "\t" + NL + "\t// Following creates and initializes SDO metadata for the supported types."; + protected final String TEXT_92 = "\t"; + protected final String TEXT_93 = "\t" + NL + "\tprotected "; + protected final String TEXT_94 = " "; + protected final String TEXT_95 = "Type = null;" + NL + "" + NL + "\tpublic "; + protected final String TEXT_96 = " get"; + protected final String TEXT_97 = "()" + NL + "\t{" + NL + "\t\treturn "; + protected final String TEXT_98 = "Type;" + NL + "\t}" + NL; + protected final String TEXT_99 = "\t" + NL + "" + NL + "\tprivate static "; + protected final String TEXT_100 = " instance = null; " + NL + "\tpublic static "; + protected final String TEXT_101 = " init()" + NL + "\t{" + NL + "\t\tif (instance != null ) return instance;" + NL + "\t\tinstance = new "; + protected final String TEXT_102 = "();" + NL + "" + NL + "\t\t// Create package meta-data objects" + NL + "\t\tinstance.createMetaData();" + NL + "" + NL + "\t\t// Initialize created meta-data" + NL + "\t\tinstance.initializeMetaData();" + NL + "\t\t" + NL + "\t\t// Mark meta-data to indicate it can't be changed" + NL + "\t\t//the"; + protected final String TEXT_103 = ".freeze(); //FB do we need to freeze / should we freeze ????" + NL + "" + NL + "\t\treturn instance;" + 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_104 = "\t" + NL + "" + NL + "\t\t// Create types and their properties"; + 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 = "._INTERNAL_"; + protected final String TEXT_112 = "); "; + protected final String TEXT_113 = NL + NL + "\t\t// Create data types"; + protected final String TEXT_114 = NL + "\t\t"; + protected final String TEXT_115 = "Type = createType(true, "; + protected final String TEXT_116 = " );"; + protected final String TEXT_117 = 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_118 = NL + NL + "\t\t// Obtain other dependent packages"; + protected final String TEXT_119 = NL + "\t\t"; + protected final String TEXT_120 = " "; + protected final String TEXT_121 = " = ("; + protected final String TEXT_122 = ")"; + protected final String TEXT_123 = ".init();"; + protected final String TEXT_124 = NL + "\t\t"; + protected final String TEXT_125 = " property = null;" + NL + "" + NL + "\t\t// Add supertypes to types"; + protected final String TEXT_126 = NL + "\t\taddSuperType("; + protected final String TEXT_127 = "Type, "; + protected final String TEXT_128 = ".get"; + protected final String TEXT_129 = "());"; + protected final String TEXT_130 = NL + NL + "\t\t// Initialize types and properties"; + protected final String TEXT_131 = NL + "\t\tinitializeType("; + protected final String TEXT_132 = "Type, "; + protected final String TEXT_133 = ".class, \""; + protected final String TEXT_134 = "\", "; + protected final String TEXT_135 = ");"; + protected final String TEXT_136 = NL + "\t\tsetInstanceProperty ("; + protected final String TEXT_137 = "Type, \""; + protected final String TEXT_138 = "\", "; + protected final String TEXT_139 = ", "; + protected final String TEXT_140 = ");"; + protected final String TEXT_141 = NL + "\t\tproperty = getLocalProperty("; + protected final String TEXT_142 = "Type, "; + protected final String TEXT_143 = ");"; + protected final String TEXT_144 = NL + "\t\tinitializeProperty(property, "; + protected final String TEXT_145 = ", \""; + protected final String TEXT_146 = "\", "; + protected final String TEXT_147 = ", "; + protected final String TEXT_148 = ", "; + 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 = NL + "\t\tinitializeProperty(property, "; + protected final String TEXT_157 = ", \""; + protected final String TEXT_158 = "\", "; + protected final String TEXT_159 = ", "; + protected final String TEXT_160 = ", "; + 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 = NL + "\t\tsetInstanceProperty (property, \""; + protected final String TEXT_167 = "\", "; + protected final String TEXT_168 = ", "; + protected final String TEXT_169 = ");"; + protected final String TEXT_170 = NL; + protected final String TEXT_171 = NL + "\t\t// Initialize data types"; + protected final String TEXT_172 = NL + "\t\tinitializeType("; + protected final String TEXT_173 = "Type, "; + protected final String TEXT_174 = ".class, \""; + protected final String TEXT_175 = "\", "; + protected final String TEXT_176 = ", "; + protected final String TEXT_177 = ");"; + protected final String TEXT_178 = NL + "\t\tsetInstanceProperty ("; + protected final String TEXT_179 = "Type, \""; + protected final String TEXT_180 = "\", "; + protected final String TEXT_181 = ", "; + protected final String TEXT_182 = ");"; + protected final String TEXT_183 = NL; + protected final String TEXT_184 = NL + "\t\tcreateXSDMetaData("; + protected final String TEXT_185 = ");" + NL + "\t}" + NL + "\t " + NL + "\tprotected void createXSDMetaData("; + protected final String TEXT_186 = ")" + NL + "\t{" + NL + "\t\tsuper.initXSD();" + NL + "\t\t" + NL + "\t\t"; + protected final String TEXT_187 = " property = null;" + NL + "\t\t"; + protected final String TEXT_188 = NL + "\t\taddXSDMapping" + NL + "\t\t (new String[]" + NL + "\t\t\t {"; + protected final String TEXT_189 = NL + "\t\t\t "; + protected final String TEXT_190 = ", "; + protected final String TEXT_191 = NL + "\t\t\t }," + NL + "\t\t\t \""; + protected final String TEXT_192 = "\");" + NL; + protected final String TEXT_193 = 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\t(getLocalProperty("; + protected final String TEXT_215 = "Type, "; + protected final String TEXT_216 = ")," + NL + "\t\t\t new String[]" + NL + "\t\t\t {"; + protected final String TEXT_217 = NL + "\t\t\t "; + protected final String TEXT_218 = ", "; + protected final String TEXT_219 = NL + "\t\t\t });" + NL; + protected final String TEXT_220 = NL + " }" + NL + " "; + protected final String TEXT_221 = NL + "\t/**" + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_222 = " create"; + protected final String TEXT_223 = "FromString(String initialValue)" + NL + "\t{"; + protected final String TEXT_224 = NL + "\t\t"; + protected final String TEXT_225 = " result = "; + protected final String TEXT_226 = ".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_227 = NL + "\t\treturn result;"; + protected final String TEXT_228 = NL + "\t\treturn ("; + protected final String TEXT_229 = ")create"; + protected final String TEXT_230 = "FromString(initialValue);"; + protected final String TEXT_231 = NL + "\t\treturn ("; + protected final String TEXT_232 = ")"; + protected final String TEXT_233 = ".create"; + protected final String TEXT_234 = "FromString(initialValue);"; + protected final String TEXT_235 = NL + "\t\tif (initialValue == null) return null;" + NL + "\t\t"; + protected final String TEXT_236 = " result = new "; + protected final String TEXT_237 = "();" + NL + "\t\tfor ("; + protected final String TEXT_238 = " stringTokenizer = new "; + protected final String TEXT_239 = "(initialValue); stringTokenizer.hasMoreTokens(); )" + NL + "\t\t{" + NL + "\t\t\tString item = stringTokenizer.nextToken();"; + protected final String TEXT_240 = NL + "\t\t\tresult.add(create"; + protected final String TEXT_241 = "FromString(item));"; + protected final String TEXT_242 = NL + "\t\t\tresult.add("; + protected final String TEXT_243 = ".create"; + protected final String TEXT_244 = "FromString(item));"; + protected final String TEXT_245 = NL + "\t\t}" + NL + "\t\treturn result;"; + protected final String TEXT_246 = NL + "\t\tif (initialValue == null) return null;" + NL + "\t\t"; + protected final String TEXT_247 = " result = null;" + NL + "\t\tRuntimeException exception = null;"; + protected final String TEXT_248 = NL + "\t\ttry" + NL + "\t\t{"; + protected final String TEXT_249 = NL + "\t\t\tresult = ("; + protected final String TEXT_250 = ")create"; + protected final String TEXT_251 = "FromString(initialValue);"; + protected final String TEXT_252 = NL + "\t\t\tresult = ("; + protected final String TEXT_253 = ")"; + protected final String TEXT_254 = ".create"; + protected final String TEXT_255 = "FromString(initialValue);"; + protected final String TEXT_256 = NL + "\t\t\tif (result != null/* && Diagnostician.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_257 = NL + "\t\tif (result != null || exception == null) return result;" + NL + " " + NL + "\t\tthrow exception;"; + protected final String TEXT_258 = 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_259 = "();"; + protected final String TEXT_260 = NL + "\t\treturn ("; + protected final String TEXT_261 = ")super.createFromString("; + protected final String TEXT_262 = ", initialValue);"; + protected final String TEXT_263 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * " + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic String convert"; + protected final String TEXT_264 = "ToString(Object instanceValue)" + NL + "\t{"; + protected final String TEXT_265 = NL + "\t\treturn instanceValue == null ? null : instanceValue.toString();"; + protected final String TEXT_266 = NL + "\t\treturn convert"; + protected final String TEXT_267 = "ToString(instanceValue);"; + protected final String TEXT_268 = NL + "\t\treturn "; + protected final String TEXT_269 = ".convert"; + protected final String TEXT_270 = "ToString(instanceValue);"; + protected final String TEXT_271 = NL + "\t\tif (instanceValue == null) return null;" + NL + "\t\t"; + protected final String TEXT_272 = " list = ("; + protected final String TEXT_273 = ")instanceValue;" + NL + "\t\tif (list.isEmpty()) return \"\";" + NL + "\t\t"; + protected final String TEXT_274 = " result = new "; + protected final String TEXT_275 = "();" + NL + "\t\tfor ("; + protected final String TEXT_276 = " i = list.iterator(); i.hasNext(); )" + NL + "\t\t{"; + protected final String TEXT_277 = NL + "\t\t\tresult.append(convert"; + protected final String TEXT_278 = "ToString(i.next()));"; + protected final String TEXT_279 = NL + "\t\t\tresult.append("; + protected final String TEXT_280 = ".convert"; + protected final String TEXT_281 = "ToString(i.next()));"; + protected final String TEXT_282 = NL + "\t\t\tresult.append(' ');" + NL + "\t\t}" + NL + "\t\treturn result.substring(0, result.length() - 1);"; + protected final String TEXT_283 = NL + "\t\tif (instanceValue == null) return null;"; + protected final String TEXT_284 = NL + "\t\tif ("; + protected final String TEXT_285 = ".isInstance(instanceValue))" + NL + "\t\t{" + NL + "\t\t\ttry" + NL + "\t\t\t{"; + protected final String TEXT_286 = NL + "\t\t\t\tString value = convert"; + protected final String TEXT_287 = "ToString(instanceValue);"; + protected final String TEXT_288 = NL + "\t\t\t\tString value = "; + protected final String TEXT_289 = ".convert"; + protected final String TEXT_290 = "ToString(instanceValue);"; + protected final String TEXT_291 = 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_292 = NL + "\t\tthrow new IllegalArgumentException(\"Invalid value: '\"+instanceValue+\"' for datatype :"; + protected final String TEXT_293 = "\");"; + protected final String TEXT_294 = 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_295 = "();"; + protected final String TEXT_296 = NL + "\t\treturn super.convertToString("; + protected final String TEXT_297 = ", instanceValue);"; + protected final String TEXT_298 = NL + "\t}" + NL; + protected final String TEXT_299 = NL + "\t/**" + NL + "\t * Returns a new object of class '"; + protected final String TEXT_300 = "'." + NL + "\t * " + NL + "\t * " + NL + "\t * @return a new object of class '"; + protected final String TEXT_301 = "'." + NL + "\t * @generated" + NL + "\t */" + NL + "\t"; + protected final String TEXT_302 = " create"; + protected final String TEXT_303 = "();" + NL; + protected final String TEXT_304 = NL + " /**" + NL + " * Registers the types supported by this Factory within the supplied scope.argument" + NL + "\t * " + NL + "\t * " + NL + "\t * @param scope an instance of HelperContext used to manage the scoping of types." + NL + "\t * @generated" + NL + " */" + NL + " public void register(HelperContext scope);" + NL + " "; + protected final String TEXT_305 = NL + "\t/**" + NL + "\t * Returns an instance of data type '"; + protected final String TEXT_306 = "' corresponding the given literal." + NL + "\t * " + NL + "\t * " + 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_307 = " create"; + protected final String TEXT_308 = "(String literal);" + NL + "" + NL + "\t/**" + NL + "\t * Returns a literal representation of an instance of data type '"; + protected final String TEXT_309 = "'." + NL + "\t * " + NL + "\t * " + 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_310 = "("; + protected final String TEXT_311 = " instanceValue);" + NL; + protected final String TEXT_312 = NL + "} //"; + protected final String TEXT_313 = NL; + + public String generate(Object argument) + { + final StringBuffer stringBuffer = new StringBuffer(); + +/** + * + * 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 factoryPatternVersion = "1.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 (!isInterface || genModel.isSuppressInterfaces()) { + stringBuffer.append(TEXT_10); + } + stringBuffer.append(TEXT_11); + if (isImplementation) { + if (!genPackage.hasJavaLangConflict() && !genPackage.hasInterfaceImplConflict() && !genPackage.getClassPackageName().equals(genPackage.getInterfacePackageName())) genModel.addImport(genPackage.getInterfacePackageName() + ".*"); + } + genModel.markImportLocation(stringBuffer); + stringBuffer.append(TEXT_12); + if (isInterface) { + stringBuffer.append(TEXT_13); + if (!genModel.isSuppressEMFMetaData()) { + stringBuffer.append(TEXT_14); + stringBuffer.append(genPackage.getQualifiedPackageInterfaceName()); + } + if (genModel.isSuppressInterfaces()) { + stringBuffer.append(TEXT_15); + stringBuffer.append(factoryPatternVersion); + stringBuffer.append(TEXT_16); + stringBuffer.append(SDOGenUtil.printArguments(genPackage, genModel) ); + } + stringBuffer.append(TEXT_17); + } else { + stringBuffer.append(TEXT_18); + stringBuffer.append(factoryPatternVersion); + stringBuffer.append(TEXT_19); + stringBuffer.append(SDOGenUtil.printArguments(genPackage, genModel) ); + stringBuffer.append(TEXT_20); + } + if (isImplementation) { + stringBuffer.append(TEXT_21); + stringBuffer.append(genPackage.getFactoryClassName()); + stringBuffer.append(TEXT_22); + stringBuffer.append(genModel.getImportedName("org.apache.tuscany.sdo.impl.FactoryBase")); + if (!genModel.isSuppressInterfaces()) { + stringBuffer.append(TEXT_23); + stringBuffer.append(genPackage.getImportedFactoryInterfaceName()); + } + } else { + stringBuffer.append(TEXT_24); + stringBuffer.append(genPackage.getFactoryInterfaceName()); + if (!genModel.isSuppressEMFMetaData()) { + stringBuffer.append(TEXT_25); + stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.EFactory")); + } + } + stringBuffer.append(TEXT_26); + if (genModel.getCopyrightText() != null) { + stringBuffer.append(TEXT_27); + stringBuffer.append(publicStaticFinalFlag); + stringBuffer.append(genModel.getImportedName("java.lang.String")); + stringBuffer.append(TEXT_28); + stringBuffer.append(genModel.getCopyrightText()); + stringBuffer.append(TEXT_29); + stringBuffer.append(genModel.getNonNLS()); + stringBuffer.append(TEXT_30); + } + stringBuffer.append(TEXT_31); + if (isInterface && genModel.isSuppressEMFMetaData()) { + stringBuffer.append(TEXT_32); + stringBuffer.append(publicStaticFinalFlag); + stringBuffer.append(genPackage.getFactoryInterfaceName()); + stringBuffer.append(TEXT_33); + stringBuffer.append(genPackage.getQualifiedFactoryClassName()); + stringBuffer.append(TEXT_34); + } else if (isInterface && !genModel.isSuppressInterfaces()) { + stringBuffer.append(TEXT_35); + stringBuffer.append(publicStaticFinalFlag); + stringBuffer.append(genPackage.getFactoryInterfaceName()); + stringBuffer.append(TEXT_36); + stringBuffer.append(genPackage.getQualifiedFactoryClassName()); + stringBuffer.append(TEXT_37); + } + if (isImplementation) { + stringBuffer.append(TEXT_38); + stringBuffer.append(publicStaticFinalFlag); + stringBuffer.append(genModel.getImportedName("java.lang.String")); + stringBuffer.append(TEXT_39); + stringBuffer.append(genPackage.getNSURI()); + stringBuffer.append(TEXT_40); + stringBuffer.append(genModel.getNonNLS()); + stringBuffer.append(TEXT_41); + stringBuffer.append(publicStaticFinalFlag); + stringBuffer.append(genModel.getImportedName("java.lang.String")); + stringBuffer.append(TEXT_42); + stringBuffer.append(genPackage.getNSName()); + stringBuffer.append(TEXT_43); + stringBuffer.append(genModel.getNonNLS()); + stringBuffer.append(TEXT_44); + stringBuffer.append(publicStaticFinalFlag); + stringBuffer.append(genModel.getImportedName("java.lang.String")); + stringBuffer.append(TEXT_45); + stringBuffer.append(factoryPatternVersion); + stringBuffer.append(TEXT_46); + 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_47); + stringBuffer.append(publicStaticFinalFlag); + stringBuffer.append(TEXT_48); + stringBuffer.append(genPackage.getClassifierID(genClassifier)); + stringBuffer.append(TEXT_49); + stringBuffer.append(genIndex); + stringBuffer.append(TEXT_50); + genIndex++; + } } + stringBuffer.append(TEXT_51); + String factoryType = genModel.isSuppressEMFMetaData() ? genPackage.getFactoryClassName() : genPackage.getImportedFactoryInterfaceName(); + stringBuffer.append(TEXT_52); + stringBuffer.append(genPackage.getFactoryClassName()); + stringBuffer.append(TEXT_53); + stringBuffer.append(genPackage.getReflectionPackageName()); + stringBuffer.append(TEXT_54); + for (Iterator p=genPackage.getPackageInitializationDependencies().iterator(); p.hasNext();) { GenPackage dep = (GenPackage)p.next(); + stringBuffer.append(TEXT_55); + stringBuffer.append(dep.getImportedFactoryInterfaceName()); + stringBuffer.append(TEXT_56); + } + stringBuffer.append(TEXT_57); + stringBuffer.append(genModel.getImportedName("commonj.sdo.DataObject")); + stringBuffer.append(TEXT_58); + for (Iterator i=genPackage.getGenClasses().iterator(); i.hasNext();) { GenClass genClass = (GenClass)i.next(); + if (!genClass.isAbstract() && !genClass.isDynamic()) { + stringBuffer.append(TEXT_59); + stringBuffer.append(genClass.getClassifierID()); + stringBuffer.append(TEXT_60); + stringBuffer.append(genModel.getImportedName("commonj.sdo.DataObject")); + stringBuffer.append(TEXT_61); + stringBuffer.append(genClass.getName()); + stringBuffer.append(TEXT_62); + } + } + stringBuffer.append(TEXT_63); + if (!genPackage.getAllGenDataTypes().isEmpty()) { + stringBuffer.append(TEXT_64); + for (Iterator i=genPackage.getAllGenDataTypes().iterator(); i.hasNext();) { GenDataType genDataType = (GenDataType)i.next(); + if (genDataType.isSerializable()) { + stringBuffer.append(TEXT_65); + stringBuffer.append(genDataType.getClassifierID()); + stringBuffer.append(TEXT_66); + stringBuffer.append(genDataType.getName()); + stringBuffer.append(TEXT_67); + } + } + stringBuffer.append(TEXT_68); + stringBuffer.append(genModel.getNonNLS()); + stringBuffer.append(genModel.getNonNLS(2)); + stringBuffer.append(TEXT_69); + for (Iterator i=genPackage.getAllGenDataTypes().iterator(); i.hasNext();) { GenDataType genDataType = (GenDataType)i.next(); + if (genDataType.isSerializable()) { + stringBuffer.append(TEXT_70); + stringBuffer.append(genDataType.getClassifierID()); + stringBuffer.append(TEXT_71); + stringBuffer.append(genDataType.getName()); + stringBuffer.append(TEXT_72); + } + } + stringBuffer.append(TEXT_73); + stringBuffer.append(genModel.getNonNLS()); + stringBuffer.append(genModel.getNonNLS(2)); + stringBuffer.append(TEXT_74); + } + for (Iterator i=genPackage.getGenClasses().iterator(); i.hasNext();) { GenClass genClass = (GenClass)i.next(); + if (!genClass.isAbstract() && !genClass.isDynamic()) { + stringBuffer.append(TEXT_75); + stringBuffer.append(genClass.getImportedInterfaceName()); + stringBuffer.append(TEXT_76); + stringBuffer.append(genClass.getName()); + stringBuffer.append(TEXT_77); + if (genClass.isDynamic()) { + stringBuffer.append(TEXT_78); + stringBuffer.append(genClass.getImportedInterfaceName()); + stringBuffer.append(TEXT_79); + stringBuffer.append(genClass.getSafeUncapName()); + stringBuffer.append(TEXT_80); + stringBuffer.append(genClass.getCastFromEObject()); + stringBuffer.append(TEXT_81); + stringBuffer.append(genClass.getQualifiedClassifierAccessor()); + stringBuffer.append(TEXT_82); + } else { + stringBuffer.append(TEXT_83); + stringBuffer.append(genClass.getImportedClassName()); + stringBuffer.append(TEXT_84); + stringBuffer.append(genClass.getSafeUncapName()); + stringBuffer.append(TEXT_85); + stringBuffer.append(genClass.getImportedClassName()); + stringBuffer.append(TEXT_86); + if (genModel.isSuppressInterfaces() && !genPackage.getReflectionPackageName().equals(genPackage.getInterfacePackageName())) { + stringBuffer.append(TEXT_87); + } + stringBuffer.append(TEXT_88); + } + stringBuffer.append(TEXT_89); + stringBuffer.append(genClass.getSafeUncapName()); + stringBuffer.append(TEXT_90); + } + } + stringBuffer.append(TEXT_91); + for (Iterator i=genPackage.getOrderedGenClassifiers().iterator(); i.hasNext();) { GenClassifier genClassifier = (GenClassifier)i.next(); + stringBuffer.append(TEXT_92); + if (!genPackage.getClassifierID(genClassifier).equals("DOCUMENT_ROOT")) { + stringBuffer.append(TEXT_93); + stringBuffer.append(genModel.getImportedName("commonj.sdo.Type")); + stringBuffer.append(TEXT_94); + stringBuffer.append(genClassifier.getSafeUncapName()); + stringBuffer.append(TEXT_95); + stringBuffer.append(genModel.getImportedName("commonj.sdo.Type")); + stringBuffer.append(TEXT_96); + stringBuffer.append(genClassifier.getClassifierAccessorName()); + stringBuffer.append(TEXT_97); + stringBuffer.append(genClassifier.getSafeUncapName()); + stringBuffer.append(TEXT_98); + } } + 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); + stringBuffer.append(factoryType); + stringBuffer.append(TEXT_103); + if (!genPackage.getGenClasses().isEmpty()) { + stringBuffer.append(TEXT_104); + for (Iterator c=genPackage.getGenClasses().iterator(); c.hasNext();) { GenClass genClass = (GenClass)c.next(); + if (!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.getGenDataTypes().isEmpty()) { + stringBuffer.append(TEXT_113); + for (Iterator d=genPackage.getGenDataTypes().iterator(); d.hasNext();) { GenDataType genDataType = (GenDataType)d.next(); + stringBuffer.append(TEXT_114); + stringBuffer.append(genDataType.getSafeUncapName()); + stringBuffer.append(TEXT_115); + stringBuffer.append(genPackage.getClassifierID(genDataType)); + stringBuffer.append(TEXT_116); + } + } + stringBuffer.append(TEXT_117); + if (!genPackage.getPackageInitializationDependencies().isEmpty()) { + stringBuffer.append(TEXT_118); + for (Iterator p=genPackage.getPackageInitializationDependencies().iterator(); p.hasNext();) { GenPackage dep = (GenPackage)p.next(); + stringBuffer.append(TEXT_119); + stringBuffer.append(dep.getImportedFactoryClassName()); + stringBuffer.append(TEXT_120); + stringBuffer.append(genPackage.getPackageInstanceVariable(dep)); + stringBuffer.append(TEXT_121); + stringBuffer.append(dep.getImportedFactoryClassName()); + stringBuffer.append(TEXT_122); + stringBuffer.append(dep.getImportedFactoryClassName()); + stringBuffer.append(TEXT_123); + } + } + List annotationSources = genPackage.getAnnotationSources(); + annotationSources.remove(ExtendedMetaData.ANNOTATION_URI); + stringBuffer.append(TEXT_124); + stringBuffer.append(genModel.getImportedName("commonj.sdo.Property")); + stringBuffer.append(TEXT_125); + 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_126); + stringBuffer.append(genClass.getSafeUncapName()); + stringBuffer.append(TEXT_127); + stringBuffer.append(genPackage.getPackageInstanceVariable(baseGenClass.getGenPackage())); + stringBuffer.append(TEXT_128); + stringBuffer.append(baseGenClass.getClassifierAccessorName()); + stringBuffer.append(TEXT_129); + } + } + stringBuffer.append(TEXT_130); + for (Iterator i=genPackage.getGenClasses().iterator(); i.hasNext();) { GenClass genClass = (GenClass)i.next(); + if (!genClass.isDynamic()) { + stringBuffer.append(TEXT_131); + stringBuffer.append(genClass.getSafeUncapName()); + stringBuffer.append(TEXT_132); + stringBuffer.append(genClass.getImportedInterfaceName()); + stringBuffer.append(TEXT_133); + stringBuffer.append(genClass.getName()); + stringBuffer.append(TEXT_134); + stringBuffer.append(genClass.isAbstract()); + stringBuffer.append(TEXT_135); + 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_136); + stringBuffer.append(genClass.getSafeUncapName()); + stringBuffer.append(TEXT_137); + stringBuffer.append(annotationSource); + stringBuffer.append(TEXT_138); + stringBuffer.append(key); + stringBuffer.append(TEXT_139); + stringBuffer.append(value); + stringBuffer.append(genModel.getNonNLS(key + value)); + stringBuffer.append(TEXT_140); + } + } + } + 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_141); + stringBuffer.append(genClass.getSafeUncapName()); + stringBuffer.append(TEXT_142); + stringBuffer.append(genClass.getLocalFeatureIndex(genFeature)); + stringBuffer.append(TEXT_143); + if (genFeature.isReferenceType()) { GenFeature reverseGenFeature = genFeature.getReverse(); + String reverse = reverseGenFeature == null ? "null" : genPackage.getPackageInstanceVariable(reverseGenFeature.getGenPackage()) + ".get" + reverseGenFeature.getFeatureAccessorName() + "()"; + stringBuffer.append(TEXT_144); + stringBuffer.append(type); + stringBuffer.append(TEXT_145); + stringBuffer.append(genFeature.getName()); + stringBuffer.append(TEXT_146); + stringBuffer.append(genFeature.getDefaultValue()); + stringBuffer.append(TEXT_147); + stringBuffer.append(genFeature.getLowerBound()); + stringBuffer.append(TEXT_148); + stringBuffer.append(genFeature.getUpperBound()); + stringBuffer.append(TEXT_149); + stringBuffer.append(genFeature.getContainerClass()); + stringBuffer.append(TEXT_150); + stringBuffer.append(genFeature.getChangeableFlag().equals("IS_CHANGEABLE") ? "false" : "true"); + stringBuffer.append(TEXT_151); + stringBuffer.append(genFeature.getUnsettableFlag().equals("IS_UNSETTABLE") ? "true": "false"); + stringBuffer.append(TEXT_152); + stringBuffer.append(genFeature.getDerivedFlag().equals("IS_DERIVED") ? "true" : "false"); + stringBuffer.append(TEXT_153); + stringBuffer.append(genFeature.getContainmentFlag().equals("IS_COMPOSITE")? "true": "false"); + stringBuffer.append(TEXT_154); + stringBuffer.append(reverse); + stringBuffer.append(TEXT_155); + }else{ + stringBuffer.append(TEXT_156); + stringBuffer.append(type); + stringBuffer.append(TEXT_157); + stringBuffer.append(genFeature.getName()); + stringBuffer.append(TEXT_158); + stringBuffer.append(genFeature.getDefaultValue()); + stringBuffer.append(TEXT_159); + stringBuffer.append(genFeature.getLowerBound()); + stringBuffer.append(TEXT_160); + stringBuffer.append(genFeature.getUpperBound()); + stringBuffer.append(TEXT_161); + stringBuffer.append(genFeature.getContainerClass()); + stringBuffer.append(TEXT_162); + stringBuffer.append(genFeature.getChangeableFlag().equals("IS_CHANGEABLE") ? "false" : "true"); + stringBuffer.append(TEXT_163); + stringBuffer.append(genFeature.getUnsettableFlag().equals("IS_UNSETTABLE") ? "true": "false"); + stringBuffer.append(TEXT_164); + stringBuffer.append(genFeature.getDerivedFlag().equals("IS_DERIVED") ? "true" : "false"); + stringBuffer.append(TEXT_165); + } + 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_166); + stringBuffer.append(annotationSource); + stringBuffer.append(TEXT_167); + stringBuffer.append(key); + stringBuffer.append(TEXT_168); + stringBuffer.append(value); + stringBuffer.append(genModel.getNonNLS(key + value)); + stringBuffer.append(TEXT_169); + } + } + } + stringBuffer.append(TEXT_170); + } + } + } + if (!genPackage.getGenDataTypes().isEmpty()) { + stringBuffer.append(TEXT_171); + for (Iterator d=genPackage.getGenDataTypes().iterator(); d.hasNext();) { GenDataType genDataType = (GenDataType)d.next(); + stringBuffer.append(TEXT_172); + stringBuffer.append(genDataType.getSafeUncapName()); + stringBuffer.append(TEXT_173); + stringBuffer.append(genDataType.getImportedInstanceClassName()); + stringBuffer.append(TEXT_174); + stringBuffer.append(genDataType.getName()); + stringBuffer.append(TEXT_175); + stringBuffer.append(genDataType.getSerializableFlag().equals("IS_SERIALIZABLE") ? "true" : "false"); + stringBuffer.append(TEXT_176); + stringBuffer.append(genDataType.getGeneratedInstanceClassFlag().equals("IS_GENERATED_INSTANCE_CLASS") ? "true" : "false" ); + stringBuffer.append(TEXT_177); + 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_178); + stringBuffer.append(genDataType.getSafeUncapName()); + stringBuffer.append(TEXT_179); + stringBuffer.append(annotationSource); + stringBuffer.append(TEXT_180); + stringBuffer.append(key); + stringBuffer.append(TEXT_181); + stringBuffer.append(value); + stringBuffer.append(genModel.getNonNLS(key + value)); + stringBuffer.append(TEXT_182); + } + } + } + stringBuffer.append(TEXT_183); + } + } + stringBuffer.append(TEXT_184); + stringBuffer.append(SDOGenUtil.getDependentFactoryArgumentList(genPackage, false)); + stringBuffer.append(TEXT_185); + stringBuffer.append(SDOGenUtil.getDependentFactoryArgumentList(genPackage, true)); + stringBuffer.append(TEXT_186); + stringBuffer.append(genModel.getImportedName("commonj.sdo.Property")); + stringBuffer.append(TEXT_187); + String extendedMetaDataSource = ExtendedMetaData.ANNOTATION_URI; + EAnnotation packageAnnotation = genPackage.getEcorePackage().getEAnnotation(extendedMetaDataSource); + if (packageAnnotation != null){ + stringBuffer.append(TEXT_188); + 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_189); + stringBuffer.append(key); + stringBuffer.append(TEXT_190); + stringBuffer.append(value); + stringBuffer.append(k.hasNext() ? "," : ""); + stringBuffer.append(genModel.getNonNLS(key + value)); + } + stringBuffer.append(TEXT_191); + stringBuffer.append(packageAnnotation.getSource()); + stringBuffer.append(TEXT_192); + } + 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(genClassifier.getSafeUncapName()); + stringBuffer.append(TEXT_215); + stringBuffer.append(genClass.getLocalFeatureIndex(genFeature)); + stringBuffer.append(TEXT_216); + 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_217); + stringBuffer.append(key); + stringBuffer.append(TEXT_218); + stringBuffer.append(value); + stringBuffer.append(k.hasNext() ? "," : ""); + stringBuffer.append(genModel.getNonNLS(key + value)); + } + stringBuffer.append(TEXT_219); + } + } + } + } + stringBuffer.append(TEXT_220); + for (Iterator i=genPackage.getAllGenDataTypes().iterator(); i.hasNext();) { GenDataType genDataType = (GenDataType)i.next(); + if (genDataType.isSerializable()) { + stringBuffer.append(TEXT_221); + stringBuffer.append(genDataType.getObjectInstanceClassName()); + stringBuffer.append(TEXT_222); + stringBuffer.append(genDataType.getName()); + stringBuffer.append(TEXT_223); + if (genDataType instanceof GenEnum) { + stringBuffer.append(TEXT_224); + stringBuffer.append(((GenEnum)genDataType).getImportedInstanceClassName()); + stringBuffer.append(TEXT_225); + stringBuffer.append(((GenEnum)genDataType).getImportedInstanceClassName()); + stringBuffer.append(TEXT_226); + stringBuffer.append(genModel.getNonNLS()); + stringBuffer.append(genModel.getNonNLS(2)); + stringBuffer.append(genModel.getNonNLS(3)); + stringBuffer.append(TEXT_227); + } else if (genDataType.getBaseType() != null) { GenDataType genBaseType = genDataType.getBaseType(); + if (genBaseType.getGenPackage() == genPackage) { + stringBuffer.append(TEXT_228); + stringBuffer.append(genDataType.getObjectInstanceClassName()); + stringBuffer.append(TEXT_229); + stringBuffer.append(genBaseType.getName()); + stringBuffer.append(TEXT_230); + } else { + stringBuffer.append(TEXT_231); + stringBuffer.append(genDataType.getObjectInstanceClassName()); + stringBuffer.append(TEXT_232); + stringBuffer.append(SDOGenUtil.getFactoryImpl(genBaseType.getGenPackage())); + stringBuffer.append(TEXT_233); + stringBuffer.append(genBaseType.getName()); + stringBuffer.append(TEXT_234); + } + } else if (genDataType.getItemType() != null) { GenDataType genItemType = genDataType.getItemType(); + stringBuffer.append(TEXT_235); + stringBuffer.append(genModel.getImportedName("java.util.List")); + stringBuffer.append(TEXT_236); + stringBuffer.append(genModel.getImportedName("java.util.ArrayList")); + stringBuffer.append(TEXT_237); + stringBuffer.append(genModel.getImportedName("java.util.StringTokenizer")); + stringBuffer.append(TEXT_238); + stringBuffer.append(genModel.getImportedName("java.util.StringTokenizer")); + stringBuffer.append(TEXT_239); + if (genItemType.getGenPackage() == genPackage) { + stringBuffer.append(TEXT_240); + stringBuffer.append(genItemType.getName()); + stringBuffer.append(TEXT_241); + } else { + stringBuffer.append(TEXT_242); + stringBuffer.append(SDOGenUtil.getFactoryImpl(genItemType.getGenPackage())); + stringBuffer.append(TEXT_243); + stringBuffer.append(genItemType.getName()); + stringBuffer.append(TEXT_244); + } + stringBuffer.append(TEXT_245); + } else if (!genDataType.getMemberTypes().isEmpty()) { + stringBuffer.append(TEXT_246); + stringBuffer.append(genDataType.getObjectInstanceClassName()); + stringBuffer.append(TEXT_247); + for (Iterator j = genDataType.getMemberTypes().iterator(); j.hasNext(); ) { GenDataType genMemberType = (GenDataType)j.next(); + stringBuffer.append(TEXT_248); + if (genMemberType.getGenPackage() == genPackage) { + stringBuffer.append(TEXT_249); + stringBuffer.append(genDataType.getObjectInstanceClassName()); + stringBuffer.append(TEXT_250); + stringBuffer.append(genMemberType.getName()); + stringBuffer.append(TEXT_251); + } else { + stringBuffer.append(TEXT_252); + stringBuffer.append(genDataType.getObjectInstanceClassName()); + stringBuffer.append(TEXT_253); + stringBuffer.append(SDOGenUtil.getFactoryImpl(genMemberType.getGenPackage())); + stringBuffer.append(TEXT_254); + stringBuffer.append(genMemberType.getName()); + stringBuffer.append(TEXT_255); + } + stringBuffer.append(TEXT_256); + } + stringBuffer.append(TEXT_257); + } else if (genDataType.isArrayType()) { + stringBuffer.append(TEXT_258); + stringBuffer.append(genModel.getImportedName("java.lang.UnsupportedOperationException")); + stringBuffer.append(TEXT_259); + } else { + stringBuffer.append(TEXT_260); + stringBuffer.append(genDataType.getObjectInstanceClassName()); + stringBuffer.append(TEXT_261); + stringBuffer.append(genDataType.getClassifierID()); + stringBuffer.append(TEXT_262); + } + stringBuffer.append(TEXT_263); + stringBuffer.append(genDataType.getName()); + stringBuffer.append(TEXT_264); + if (genDataType instanceof GenEnum) { + stringBuffer.append(TEXT_265); + } else if (genDataType.getBaseType() != null) { GenDataType genBaseType = genDataType.getBaseType(); + if (genBaseType.getGenPackage() == genPackage) { + stringBuffer.append(TEXT_266); + stringBuffer.append(genBaseType.getName()); + stringBuffer.append(TEXT_267); + } else { + stringBuffer.append(TEXT_268); + stringBuffer.append(SDOGenUtil.getFactoryImpl(genBaseType.getGenPackage())); + stringBuffer.append(TEXT_269); + stringBuffer.append(genBaseType.getName()); + stringBuffer.append(TEXT_270); + } + } else if (genDataType.getItemType() != null) { GenDataType genItemType = genDataType.getItemType(); + stringBuffer.append(TEXT_271); + stringBuffer.append(genModel.getImportedName("java.util.List")); + stringBuffer.append(TEXT_272); + stringBuffer.append(genModel.getImportedName("java.util.List")); + stringBuffer.append(TEXT_273); + stringBuffer.append(genModel.getImportedName("java.lang.StringBuffer")); + stringBuffer.append(TEXT_274); + stringBuffer.append(genModel.getImportedName("java.lang.StringBuffer")); + stringBuffer.append(TEXT_275); + stringBuffer.append(genModel.getImportedName("java.util.Iterator")); + stringBuffer.append(TEXT_276); + if (genItemType.getGenPackage() == genPackage) { + stringBuffer.append(TEXT_277); + stringBuffer.append(genItemType.getName()); + stringBuffer.append(TEXT_278); + } else { + stringBuffer.append(TEXT_279); + stringBuffer.append(SDOGenUtil.getFactoryImpl(genItemType.getGenPackage())); + stringBuffer.append(TEXT_280); + stringBuffer.append(genItemType.getName()); + stringBuffer.append(TEXT_281); + } + stringBuffer.append(TEXT_282); + } else if (!genDataType.getMemberTypes().isEmpty()) { + stringBuffer.append(TEXT_283); + for (Iterator j = genDataType.getMemberTypes().iterator(); j.hasNext(); ) { GenDataType genMemberType = (GenDataType)j.next(); + stringBuffer.append(TEXT_284); + stringBuffer.append(SDOGenUtil.getQualifiedTypeAccessor(genMemberType)); + stringBuffer.append(TEXT_285); + if (genMemberType.getGenPackage() == genPackage) { + stringBuffer.append(TEXT_286); + stringBuffer.append(genMemberType.getName()); + stringBuffer.append(TEXT_287); + } else { + stringBuffer.append(TEXT_288); + stringBuffer.append(SDOGenUtil.getFactoryImpl(genMemberType.getGenPackage())); + stringBuffer.append(TEXT_289); + stringBuffer.append(genMemberType.getName()); + stringBuffer.append(TEXT_290); + } + stringBuffer.append(TEXT_291); + } + stringBuffer.append(TEXT_292); + stringBuffer.append(genDataType.getName()); + stringBuffer.append(TEXT_293); + } else if (genDataType.isArrayType()) { + stringBuffer.append(TEXT_294); + stringBuffer.append(genModel.getImportedName("java.lang.UnsupportedOperationException")); + stringBuffer.append(TEXT_295); + } else { + stringBuffer.append(TEXT_296); + stringBuffer.append(genDataType.getClassifierID()); + stringBuffer.append(TEXT_297); + } + stringBuffer.append(TEXT_298); + } + } + } else { + for (Iterator i=genPackage.getGenClasses().iterator(); i.hasNext();) { GenClass genClass = (GenClass)i.next(); + if (genClass.hasFactoryInterfaceCreateMethod()) { + stringBuffer.append(TEXT_299); + stringBuffer.append(genClass.getFormattedName()); + stringBuffer.append(TEXT_300); + stringBuffer.append(genClass.getFormattedName()); + stringBuffer.append(TEXT_301); + stringBuffer.append(genClass.getImportedInterfaceName()); + stringBuffer.append(TEXT_302); + stringBuffer.append(genClass.getName()); + stringBuffer.append(TEXT_303); + } + } + stringBuffer.append(TEXT_304); + if (genPackage.isDataTypeConverters()) { + for (Iterator i=genPackage.getAllGenDataTypes().iterator(); i.hasNext();) { GenDataType genDataType = (GenDataType)i.next(); + if (genDataType.isSerializable()) { + stringBuffer.append(TEXT_305); + stringBuffer.append(genDataType.getFormattedName()); + stringBuffer.append(TEXT_306); + stringBuffer.append(genDataType.getImportedInstanceClassName()); + stringBuffer.append(TEXT_307); + stringBuffer.append(genDataType.getName()); + stringBuffer.append(TEXT_308); + stringBuffer.append(genDataType.getFormattedName()); + stringBuffer.append(TEXT_309); + stringBuffer.append(genDataType.getName()); + stringBuffer.append(TEXT_310); + stringBuffer.append(genDataType.getImportedInstanceClassName()); + stringBuffer.append(TEXT_311); + } + } + } + } + stringBuffer.append(TEXT_312); + stringBuffer.append(isInterface ? genPackage.getFactoryInterfaceName() : genPackage.getFactoryClassName()); + genModel.emitSortedImports(); + stringBuffer.append(TEXT_313); + return stringBuffer.toString(); + } +} diff --git a/sdo-java/branches/sdo-1.1-incubating/tools/src/main/java/org/apache/tuscany/sdo/generate/util/SDOGenUtil.java b/sdo-java/branches/sdo-1.1-incubating/tools/src/main/java/org/apache/tuscany/sdo/generate/util/SDOGenUtil.java new file mode 100644 index 0000000000..062580f4b8 --- /dev/null +++ b/sdo-java/branches/sdo-1.1-incubating/tools/src/main/java/org/apache/tuscany/sdo/generate/util/SDOGenUtil.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 org.apache.tuscany.sdo.generate.util; + +import java.util.Iterator; + +import org.apache.tuscany.sdo.model.ModelFactory; +import org.apache.tuscany.sdo.model.impl.ModelFactoryImpl; +import org.eclipse.emf.codegen.ecore.genmodel.GenClass; +import org.eclipse.emf.codegen.ecore.genmodel.GenClassifier; +import org.eclipse.emf.codegen.ecore.genmodel.GenDataType; +import org.eclipse.emf.codegen.ecore.genmodel.GenDelegationKind; +import org.eclipse.emf.codegen.ecore.genmodel.GenFeature; +import org.eclipse.emf.codegen.ecore.genmodel.GenModel; +import org.eclipse.emf.codegen.ecore.genmodel.GenPackage; +import org.eclipse.emf.codegen.ecore.genmodel.impl.GenFeatureImpl; +import org.eclipse.emf.codegen.ecore.genmodel.impl.Literals; +import org.eclipse.emf.codegen.util.CodeGenUtil; +import org.eclipse.emf.ecore.EClassifier; +import org.eclipse.emf.ecore.EDataType; +import org.eclipse.emf.ecore.EcorePackage; + +import commonj.sdo.Type; + +public class SDOGenUtil { + + public static String getQualifiedTypeAccessor(GenClassifier genClassifier) + { + GenPackage genPackage = genClassifier.getGenPackage(); + return getFactoryImpl(genPackage) + ".get" + genClassifier.getClassifierAccessorName() + "()"; + } + + public static String getDependentFactoryArgumentList(GenPackage genPackage, boolean isFormalArguments) + { + StringBuffer result = new StringBuffer(); + for (Iterator iter = genPackage.getPackageInitializationDependencies().iterator(); iter.hasNext(); ) + { + GenPackage dep = (GenPackage)iter.next(); + if (isFormalArguments) + { + result.append(dep.getImportedFactoryClassName()); + result.append(" "); + } + result.append(genPackage.getPackageInstanceVariable(dep)); + if (iter.hasNext()) result.append(", "); + } + return result.toString(); + } + + public static String getFactoryImpl(GenPackage genPackage) + { + return "((" + genPackage.getImportedFactoryClassName() + ")" + + genPackage.getImportedFactoryInterfaceName() + ".INSTANCE)"; + } + + public static String getListKind(GenFeature genFeature, boolean suppressNotification ) + { + boolean unsettable = genFeature.isUnsettable(); + + if (suppressNotification) + { + return "ListKind.BASIC"; + } + else if (genFeature.isEffectiveContains()) + { + if (genFeature.isBidirectional()) + { + if (genFeature.isResolveProxies()) + { + if( unsettable ) + return "ListKind.CONTAINMENT_INVERSE_RESOLVING_UNSETTABLE"; + else + return "ListKind.CONTAINMENT_INVERSE_RESOLVING"; + } + else + { + if( unsettable ) + return "ListKind.CONTAINMENT_INVERSE_UNSETTABLE"; + else + return "ListKind.CONTAINMENT_INVERSE"; + } + } + else + { + if (genFeature.isResolveProxies()) + { + if( unsettable ) + return "ListKind.CONTAINMENT_RESOLVING_UNSETTABLE"; + else + return "ListKind.CONTAINMENT_RESOLVING"; + } + else + { + if( unsettable ) + return "ListKind.CONTAINMENT_UNSETTABLE"; + else + return "ListKind.CONTAINMENT"; + } + } + } + else if (genFeature.isReferenceType()) + { + if (genFeature.isBidirectional()) + { + GenFeature reverseFeature = genFeature.getReverse(); + if (genFeature.isResolveProxies()) + { + if (reverseFeature.isListType()) + { + if( unsettable ) + return "ListKind.NONCONTAINMENT_MANYINVERSE_RESOLVING_UNSETTABLE"; + else + return "ListKind.NONCONTAINMENT_MANYINVERSE_RESOLVING"; + } + else + { + if( unsettable ) + return "ListKind.NONCONTAINMENT_INVERSE_RESOLVING_UNSETTABLE"; + else + return "ListKind.NONCONTAINMENT_INVERSE_RESOLVING"; + } + } + else + { + if (reverseFeature.isListType()) + { + if( unsettable ) + return "ListKind.NONCONTAINMENT_MANYINVERSE_UNSETTABLE"; + else + return "ListKind.NONCONTAINMENT_MANYINVERSE"; + } + else + { + if( unsettable ) + return "ListKind.NONCONTAINMENT_INVERSE_UNSETTABLE"; + else + return "ListKind.NONCONTAINMENT_INVERSE"; + } + } + } + else + { + if (genFeature.isResolveProxies()) + { + if( unsettable ) + return "ListKind.NONCONTAINMENT_RESOLVING_UNSETTABLE"; + else + return "ListKind.NONCONTAINMENT_RESOLVING"; + } + else + { + if( unsettable ) + return "ListKind.NONCONTAINMENT_UNSETTABLE"; + else + return "ListKind.NONCONTAINMENT"; + } + } + } + else + { //datatype + if (genFeature.isUnique()) + { + if( unsettable ) + return "ListKind.DATATYPE_UNIQUE_UNSETTABLE"; + else + return "ListKind.DATATYPE_UNIQUE"; + } + else + { + if( unsettable ) + return "ListKind.DATATYPE_UNSETTABLE"; + else + return "ListKind.DATATYPE"; + } + } + } + + public static boolean hasChangeSummaryProperty(GenClass genClass) + { + return getChangeSummaryProperty(genClass) != null; + } + + public static String getQualifiedInternalPropertyID(GenFeature genFeature) + { + return genFeature.getGenClass().getImportedClassName() + ".INTERNAL_" + genFeature.getUpperName(); + } + + public static String getChangeSummaryProperty(GenClass genClass) + { + Type csType = ((ModelFactoryImpl)ModelFactory.INSTANCE).getChangeSummaryType(); + for (Iterator i = genClass.getGenFeatures().iterator(); i.hasNext(); ) + { + GenFeature genFeature = (GenFeature)i.next(); + EClassifier eClassifier = genFeature.getEcoreFeature().getEType(); + if (eClassifier instanceof Type) + { + Type type = (Type)eClassifier; + //if (csType == type)// this doesn't work when generating sdoModel.xsd + if (csType.getName().equals(type.getName()) && csType.getURI().equals(type.getURI())) + { + return genFeature.getUpperName(); + } + } + } + return null; + } + + public static String printArguments(GenPackage genPackage, GenModel genModel) { + StringBuffer result = new StringBuffer(); + if(!CodeGenUtil.capName(genPackage.getNSName()).equals(genPackage.getPrefix())) { + result.append(" -prefix " + genPackage.getPrefix()); + } + if (genModel.isSuppressInterfaces()) { + result.append(" -noInterfaces"); + } + if ( genModel.getFeatureDelegation() == GenDelegationKind.VIRTUAL_LITERAL) { + result.append(" -sparsePattern"); + } + if ("org.apache.tuscany.sdo.impl.StoreDataObjectImpl".equals(genModel.getRootExtendsClass())) { + result.append(" -storePattern"); + } + if (genModel.isSuppressNotification()) { + result.append(" -noNotification"); + } + if (genModel.isSuppressContainment()) { + result.append(" -noContainment"); + } + if (genModel.isArrayAccessors()) { + result.append(" -arrayAccessors"); + } + if (genModel.isSuppressUnsettable()) { + result.append(" -noUnsettable"); + } + + return result.toString(); + } + + /* + * EMF doesn't do what we want in all cases, so filter the cases we need to handle + * and drop through to EMF for all others. + */ + public static String getStaticDefaultValue(GenFeature genFeature) { + String result = "null"; + boolean defaultFound = false; + + String defaultString = genFeature.getEcoreFeature() + .getDefaultValueLiteral(); + EClassifier eType = genFeature.getEcoreFeature().getEType(); + if (eType instanceof EDataType) { + GenPackage genPackage = ((GenFeatureImpl) genFeature) + .findGenPackage(genFeature.getEcoreFeature().getEType().getEPackage()); + GenDataType gdt = null; + if (genPackage != null) { + for (Iterator iter = genPackage.getGenDataTypes().iterator(); iter + .hasNext() + && gdt == null;) { + GenDataType genDataType = (GenDataType) iter.next(); + if (eType.getName().equals(genDataType.getEcoreDataType().getName())) { + gdt = genDataType; + } + } + } + EClassifier eDataType = gdt.getEcoreDataType(); + if (eDataType.getEPackage() != EcorePackage.eINSTANCE + && defaultString != null) { + boolean replaced = false; + for (Iterator i = EcorePackage.eINSTANCE.getEClassifiers().iterator(); i + .hasNext();) { + EClassifier eClassifier = (EClassifier) i.next(); + if (eClassifier instanceof EDataType + && eClassifier.getInstanceClassName().equals( + eDataType.getInstanceClassName()) + && ((EDataType) eClassifier).isSerializable() + && eClassifier != EcorePackage.eINSTANCE.getEDate()) { + replaced = true; + eDataType = eClassifier; + break; + } + } + if (!replaced) { + result = "((" + genPackage.getFactoryClassName() + ")" + + genPackage.getFactoryInterfaceName() + "." + + genPackage.getFactoryInstanceName() + ")." + "create" + + gdt.getName() + "FromString(" + + Literals.toLiteral(defaultString) + ")"; + + + if (gdt.isPrimitiveType()) + { + result = "((" + gdt.getObjectInstanceClassName() + ")" + result + + ")." + gdt.getPrimitiveValueFunction() + "()"; + } else if (!gdt.isObjectType()) { + result = "(" + gdt.getImportedInstanceClassName() + ")" + result; + } + + defaultFound = true; + } + } + } + + if (!defaultFound) { + // the input didn't match any special case that we want to handle differently + // from EMF's default approach, so go ahead and get EMF to do it + result = genFeature.getStaticDefaultValue(); + } + + return result; + } +} -- cgit v1.2.3