From 195774c489a1a671aca514b0afa88332bf9c6ee3 Mon Sep 17 00:00:00 2001 From: lresende Date: Tue, 10 Nov 2009 19:20:12 +0000 Subject: Moving SDO tags git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@834617 13f79535-47bb-0310-9956-ffa450edef68 --- .../test/java/com/example/subgroup/impl/AImpl.java | 310 ++++++++++++++++++ .../test/java/com/example/subgroup/impl/BImpl.java | 256 +++++++++++++++ .../java/com/example/subgroup/impl/BprimeImpl.java | 264 ++++++++++++++++ .../example/subgroup/impl/SubgroupFactoryImpl.java | 352 +++++++++++++++++++++ 4 files changed, 1182 insertions(+) create mode 100644 sdo-java/tags/1.0-incubating-beta1/sdo/tools/src/test/java/com/example/subgroup/impl/AImpl.java create mode 100644 sdo-java/tags/1.0-incubating-beta1/sdo/tools/src/test/java/com/example/subgroup/impl/BImpl.java create mode 100644 sdo-java/tags/1.0-incubating-beta1/sdo/tools/src/test/java/com/example/subgroup/impl/BprimeImpl.java create mode 100644 sdo-java/tags/1.0-incubating-beta1/sdo/tools/src/test/java/com/example/subgroup/impl/SubgroupFactoryImpl.java (limited to 'sdo-java/tags/1.0-incubating-beta1/sdo/tools/src/test/java/com/example/subgroup/impl') diff --git a/sdo-java/tags/1.0-incubating-beta1/sdo/tools/src/test/java/com/example/subgroup/impl/AImpl.java b/sdo-java/tags/1.0-incubating-beta1/sdo/tools/src/test/java/com/example/subgroup/impl/AImpl.java new file mode 100644 index 0000000000..4fb06e51c2 --- /dev/null +++ b/sdo-java/tags/1.0-incubating-beta1/sdo/tools/src/test/java/com/example/subgroup/impl/AImpl.java @@ -0,0 +1,310 @@ +/** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package com.example.subgroup.impl; + +import com.example.subgroup.A; +import com.example.subgroup.B; +import com.example.subgroup.SubgroupFactory; + +import commonj.sdo.Sequence; +import commonj.sdo.Type; + +import org.apache.tuscany.sdo.impl.DataObjectBase; + +/** + * + * An implementation of the model object 'A'. + * + *

+ * The following features are implemented: + *

+ *

+ * + * @generated + */ +public class AImpl extends DataObjectBase implements A +{ + + public final static int GE1_GROUP = -1; + + public final static int GE1 = 0; + + public final static int SDO_PROPERTY_COUNT = 1; + + public final static int EXTENDED_PROPERTY_COUNT = -1; + + + /** + * The internal feature id for the 'Ge1 Group' attribute list. + * + * + * @generated + * @ordered + */ + public final static int INTERNAL_GE1_GROUP = 0; + + /** + * The internal feature id for the 'Ge1' containment reference. + * + * + * @generated + * @ordered + */ + public final static int INTERNAL_GE1 = 1; + + /** + * The number of properties for this type. + * + * + * @generated + * @ordered + */ + public final static int INTERNAL_PROPERTY_COUNT = 2; + + protected int internalConvertIndex(int internalIndex) + { + switch (internalIndex) + { + case INTERNAL_GE1_GROUP: return GE1_GROUP; + case INTERNAL_GE1: return GE1; + } + return super.internalConvertIndex(internalIndex); + } + + + /** + * The cached value of the '{@link #getGe1Group() Ge1 Group}' attribute list. + * + * + * @see #getGe1Group() + * @generated + * @ordered + */ + + protected Sequence ge1Group = null; + + /** + * + * + * @generated + */ + public AImpl() + { + super(); + } + + /** + * + * + * @generated + */ + public Type getType() + { + return ((SubgroupFactoryImpl)SubgroupFactory.INSTANCE).getA(); + } + + /** + * + * + * @generated + */ + public Sequence getGe1Group() + { + if (ge1Group == null) + { + ge1Group = createSequence(INTERNAL_GE1_GROUP); + } + return ge1Group; + } + /** + * + * + * @generated + */ + public B getGe1() + { + return (B)get(getGe1Group(), getType(), INTERNAL_GE1); + } + /** + * + * + * @generated + */ + public ChangeContext basicSetGe1(B newGe1, ChangeContext changeContext) + { + return basicAdd(getGe1Group(), getType(), GE1, newGe1, changeContext); + } + + /** + * + * + * @generated + */ + public void setGe1(B newGe1) + { + set(getGe1Group(), getType(), INTERNAL_GE1, newGe1); + } + + /** + * + * + * @generated + */ + public ChangeContext basicUnsetGe1(ChangeContext changeContext) + { + // TODO: implement this method to unset the contained 'Ge1' containment reference + // -> this method is automatically invoked to keep the containment relationship in synch + // -> do not modify other features + // -> return changeContext, after adding any generated Notification to it (if it is null, a NotificationChain object must be created first) + // Ensure that you remove @generated or mark it @generated NOT + throw new UnsupportedOperationException(); + } + + /** + * + * + * @generated + */ + public void unsetGe1() + { + unset(getGe1Group(), getType(), GE1); + } + + /** + * + * + * @generated + */ + public boolean isSetGe1() + { + return isSet(getGe1Group(), getType(), GE1); + } + + /** + * + * + * @generated + */ + public ChangeContext inverseRemove(Object otherEnd, int propertyIndex, ChangeContext changeContext) + { + switch (propertyIndex) + { + case GE1_GROUP: + return removeFromSequence(getGe1Group(), otherEnd, changeContext); + case GE1: + return basicUnsetGe1(changeContext); + } + return super.inverseRemove(otherEnd, propertyIndex, changeContext); + } + + /** + * + * + * @generated + */ + public Object get(int propertyIndex, boolean resolve) + { + switch (propertyIndex) + { + case GE1_GROUP: + // XXX query introduce coreType as an argument? -- semantic = if true -- coreType - return the core EMF object if value is a non-EMF wrapper/view + //if (coreType) + return getGe1Group(); + case GE1: + return getGe1(); + } + return super.get(propertyIndex, resolve); + } + + /** + * + * + * @generated + */ + public void set(int propertyIndex, Object newValue) + { + switch (propertyIndex) + { + case GE1_GROUP: + setSequence(getGe1Group(), newValue); + return; + case GE1: + setGe1((B)newValue); + return; + } + super.set(propertyIndex, newValue); + } + + /** + * + * + * @generated + */ + public void unset(int propertyIndex) + { + switch (propertyIndex) + { + case GE1_GROUP: + unsetSequence(getGe1Group()); + return; + case GE1: + unsetGe1(); + return; + } + super.unset(propertyIndex); + } + + /** + * + * + * @generated + */ + public boolean isSet(int propertyIndex) + { + switch (propertyIndex) + { + case GE1_GROUP: + return ge1Group != null && !isSequenceEmpty(getGe1Group()); + case GE1: + return isSetGe1(); + } + return super.isSet(propertyIndex); + } + + /** + * + * + * @generated + */ + public String toString() + { + if (isProxy(this)) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (ge1Group: "); + result.append(ge1Group); + result.append(')'); + return result.toString(); + } + +} //AImpl diff --git a/sdo-java/tags/1.0-incubating-beta1/sdo/tools/src/test/java/com/example/subgroup/impl/BImpl.java b/sdo-java/tags/1.0-incubating-beta1/sdo/tools/src/test/java/com/example/subgroup/impl/BImpl.java new file mode 100644 index 0000000000..e15776ecc0 --- /dev/null +++ b/sdo-java/tags/1.0-incubating-beta1/sdo/tools/src/test/java/com/example/subgroup/impl/BImpl.java @@ -0,0 +1,256 @@ +/** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package com.example.subgroup.impl; + +import com.example.subgroup.B; +import com.example.subgroup.SubgroupFactory; + +import commonj.sdo.Type; + +import org.apache.tuscany.sdo.impl.DataObjectBase; + +/** + * + * An implementation of the model object 'B'. + * + *

+ * The following features are implemented: + *

+ *

+ * + * @generated + */ +public class BImpl extends DataObjectBase implements B +{ + + public final static int IM_IN_TYPE_B = 0; + + public final static int SDO_PROPERTY_COUNT = 1; + + public final static int EXTENDED_PROPERTY_COUNT = 0; + + + /** + * The internal feature id for the 'Im In Type B' attribute. + * + * + * @generated + * @ordered + */ + public final static int INTERNAL_IM_IN_TYPE_B = 0; + + /** + * The number of properties for this type. + * + * + * @generated + * @ordered + */ + public final static int INTERNAL_PROPERTY_COUNT = 1; + + protected int internalConvertIndex(int internalIndex) + { + switch (internalIndex) + { + case INTERNAL_IM_IN_TYPE_B: return IM_IN_TYPE_B; + } + return super.internalConvertIndex(internalIndex); + } + + + /** + * The default value of the '{@link #getImInTypeB() Im In Type B}' attribute. + * + * + * @see #getImInTypeB() + * @generated + * @ordered + */ + protected static final String IM_IN_TYPE_B_DEFAULT_ = null; + + /** + * The cached value of the '{@link #getImInTypeB() Im In Type B}' attribute. + * + * + * @see #getImInTypeB() + * @generated + * @ordered + */ + protected String imInTypeB = IM_IN_TYPE_B_DEFAULT_; + + /** + * This is true if the Im In Type B attribute has been set. + * + * + * @generated + * @ordered + */ + protected boolean imInTypeB_set_ = false; + + /** + * + * + * @generated + */ + public BImpl() + { + super(); + } + + /** + * + * + * @generated + */ + public Type getType() + { + return ((SubgroupFactoryImpl)SubgroupFactory.INSTANCE).getB(); + } + + /** + * + * + * @generated + */ + public String getImInTypeB() + { + return imInTypeB; + } + /** + * + * + * @generated + */ + public void setImInTypeB(String newImInTypeB) + { + String oldImInTypeB = imInTypeB; + imInTypeB = newImInTypeB; + boolean oldImInTypeB_set_ = imInTypeB_set_; + imInTypeB_set_ = true; + if (isNotifying()) + notify(ChangeKind.SET, IM_IN_TYPE_B, oldImInTypeB, imInTypeB, !oldImInTypeB_set_); + } + + /** + * + * + * @generated + */ + public void unsetImInTypeB() + { + String oldImInTypeB = imInTypeB; + boolean oldImInTypeB_set_ = imInTypeB_set_; + imInTypeB = IM_IN_TYPE_B_DEFAULT_; + imInTypeB_set_ = false; + if (isNotifying()) + notify(ChangeKind.UNSET, IM_IN_TYPE_B, oldImInTypeB, IM_IN_TYPE_B_DEFAULT_, oldImInTypeB_set_); + } + + /** + * + * + * @generated + */ + public boolean isSetImInTypeB() + { + return imInTypeB_set_; + } + + /** + * + * + * @generated + */ + public Object get(int propertyIndex, boolean resolve) + { + switch (propertyIndex) + { + case IM_IN_TYPE_B: + return getImInTypeB(); + } + return super.get(propertyIndex, resolve); + } + + /** + * + * + * @generated + */ + public void set(int propertyIndex, Object newValue) + { + switch (propertyIndex) + { + case IM_IN_TYPE_B: + setImInTypeB((String)newValue); + return; + } + super.set(propertyIndex, newValue); + } + + /** + * + * + * @generated + */ + public void unset(int propertyIndex) + { + switch (propertyIndex) + { + case IM_IN_TYPE_B: + unsetImInTypeB(); + return; + } + super.unset(propertyIndex); + } + + /** + * + * + * @generated + */ + public boolean isSet(int propertyIndex) + { + switch (propertyIndex) + { + case IM_IN_TYPE_B: + return isSetImInTypeB(); + } + return super.isSet(propertyIndex); + } + + /** + * + * + * @generated + */ + public String toString() + { + if (isProxy(this)) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (imInTypeB: "); + if (imInTypeB_set_) result.append(imInTypeB); else result.append(""); + result.append(')'); + return result.toString(); + } + +} //BImpl diff --git a/sdo-java/tags/1.0-incubating-beta1/sdo/tools/src/test/java/com/example/subgroup/impl/BprimeImpl.java b/sdo-java/tags/1.0-incubating-beta1/sdo/tools/src/test/java/com/example/subgroup/impl/BprimeImpl.java new file mode 100644 index 0000000000..4ea390e6fc --- /dev/null +++ b/sdo-java/tags/1.0-incubating-beta1/sdo/tools/src/test/java/com/example/subgroup/impl/BprimeImpl.java @@ -0,0 +1,264 @@ +/** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package com.example.subgroup.impl; + +import com.example.subgroup.Bprime; +import com.example.subgroup.SubgroupFactory; + +import commonj.sdo.Type; + +/** + * + * An implementation of the model object 'Bprime'. + * + *

+ * The following features are implemented: + *

+ *

+ * + * @generated + */ +public class BprimeImpl extends BImpl implements Bprime +{ + + public final static int IM_IN_TYPE_BPRIME = BImpl.SDO_PROPERTY_COUNT + 0; + + public final static int SDO_PROPERTY_COUNT = BImpl.SDO_PROPERTY_COUNT + 1; + + public final static int EXTENDED_PROPERTY_COUNT = BImpl.EXTENDED_PROPERTY_COUNT - 0; + + + /** + * The internal feature id for the 'Im In Type B' attribute. + * + * + * @generated + * @ordered + */ + public final static int INTERNAL_IM_IN_TYPE_B = BImpl.IM_IN_TYPE_B; + + /** + * The internal feature id for the 'Im In Type Bprime' attribute. + * + * + * @generated + * @ordered + */ + public final static int INTERNAL_IM_IN_TYPE_BPRIME = BImpl.INTERNAL_PROPERTY_COUNT + 0; + + /** + * The number of properties for this type. + * + * + * @generated + * @ordered + */ + public final static int INTERNAL_PROPERTY_COUNT = BImpl.INTERNAL_PROPERTY_COUNT + 1; + + protected int internalConvertIndex(int internalIndex) + { + switch (internalIndex) + { + case INTERNAL_IM_IN_TYPE_B: return IM_IN_TYPE_B; + case INTERNAL_IM_IN_TYPE_BPRIME: return IM_IN_TYPE_BPRIME; + } + return super.internalConvertIndex(internalIndex); + } + + + /** + * The default value of the '{@link #getImInTypeBprime() Im In Type Bprime}' attribute. + * + * + * @see #getImInTypeBprime() + * @generated + * @ordered + */ + protected static final String IM_IN_TYPE_BPRIME_DEFAULT_ = null; + + /** + * The cached value of the '{@link #getImInTypeBprime() Im In Type Bprime}' attribute. + * + * + * @see #getImInTypeBprime() + * @generated + * @ordered + */ + protected String imInTypeBprime = IM_IN_TYPE_BPRIME_DEFAULT_; + + /** + * This is true if the Im In Type Bprime attribute has been set. + * + * + * @generated + * @ordered + */ + protected boolean imInTypeBprime_set_ = false; + + /** + * + * + * @generated + */ + public BprimeImpl() + { + super(); + } + + /** + * + * + * @generated + */ + public Type getType() + { + return ((SubgroupFactoryImpl)SubgroupFactory.INSTANCE).getBprime(); + } + + /** + * + * + * @generated + */ + public String getImInTypeBprime() + { + return imInTypeBprime; + } + /** + * + * + * @generated + */ + public void setImInTypeBprime(String newImInTypeBprime) + { + String oldImInTypeBprime = imInTypeBprime; + imInTypeBprime = newImInTypeBprime; + boolean oldImInTypeBprime_set_ = imInTypeBprime_set_; + imInTypeBprime_set_ = true; + if (isNotifying()) + notify(ChangeKind.SET, IM_IN_TYPE_BPRIME, oldImInTypeBprime, imInTypeBprime, !oldImInTypeBprime_set_); + } + + /** + * + * + * @generated + */ + public void unsetImInTypeBprime() + { + String oldImInTypeBprime = imInTypeBprime; + boolean oldImInTypeBprime_set_ = imInTypeBprime_set_; + imInTypeBprime = IM_IN_TYPE_BPRIME_DEFAULT_; + imInTypeBprime_set_ = false; + if (isNotifying()) + notify(ChangeKind.UNSET, IM_IN_TYPE_BPRIME, oldImInTypeBprime, IM_IN_TYPE_BPRIME_DEFAULT_, oldImInTypeBprime_set_); + } + + /** + * + * + * @generated + */ + public boolean isSetImInTypeBprime() + { + return imInTypeBprime_set_; + } + + /** + * + * + * @generated + */ + public Object get(int propertyIndex, boolean resolve) + { + switch (propertyIndex) + { + case IM_IN_TYPE_BPRIME: + return getImInTypeBprime(); + } + return super.get(propertyIndex, resolve); + } + + /** + * + * + * @generated + */ + public void set(int propertyIndex, Object newValue) + { + switch (propertyIndex) + { + case IM_IN_TYPE_BPRIME: + setImInTypeBprime((String)newValue); + return; + } + super.set(propertyIndex, newValue); + } + + /** + * + * + * @generated + */ + public void unset(int propertyIndex) + { + switch (propertyIndex) + { + case IM_IN_TYPE_BPRIME: + unsetImInTypeBprime(); + return; + } + super.unset(propertyIndex); + } + + /** + * + * + * @generated + */ + public boolean isSet(int propertyIndex) + { + switch (propertyIndex) + { + case IM_IN_TYPE_BPRIME: + return isSetImInTypeBprime(); + } + return super.isSet(propertyIndex); + } + + /** + * + * + * @generated + */ + public String toString() + { + if (isProxy(this)) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (imInTypeBprime: "); + if (imInTypeBprime_set_) result.append(imInTypeBprime); else result.append(""); + result.append(')'); + return result.toString(); + } + +} //BprimeImpl diff --git a/sdo-java/tags/1.0-incubating-beta1/sdo/tools/src/test/java/com/example/subgroup/impl/SubgroupFactoryImpl.java b/sdo-java/tags/1.0-incubating-beta1/sdo/tools/src/test/java/com/example/subgroup/impl/SubgroupFactoryImpl.java new file mode 100644 index 0000000000..26670e6221 --- /dev/null +++ b/sdo-java/tags/1.0-incubating-beta1/sdo/tools/src/test/java/com/example/subgroup/impl/SubgroupFactoryImpl.java @@ -0,0 +1,352 @@ +/** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package com.example.subgroup.impl; + +import commonj.sdo.helper.HelperContext; +import org.apache.tuscany.sdo.helper.TypeHelperImpl; + +import com.example.subgroup.*; + +import commonj.sdo.DataObject; +import commonj.sdo.Property; +import commonj.sdo.Type; + +import org.apache.tuscany.sdo.SDOFactory; + +import org.apache.tuscany.sdo.impl.FactoryBase; + +import org.apache.tuscany.sdo.model.ModelFactory; + +import org.apache.tuscany.sdo.model.impl.ModelFactoryImpl; + +import org.apache.tuscany.sdo.util.SDOUtil; + +/** + * + * An implementation of the model Factory. + * Generator information: + * patternVersion=1.1; -prefix Subgroup + * + * @generated + */ +public class SubgroupFactoryImpl extends FactoryBase implements SubgroupFactory +{ + + /** + * The package namespace URI. + * + * + * @generated + */ + public static final String NAMESPACE_URI = "http://example.com/subgroup"; + + /** + * The package namespace name. + * + * + * @generated + */ + public static final String NAMESPACE_PREFIX = "sg"; + + /** + * The version of the generator pattern used to generate this class. + * + * + * @generated + */ + public static final String PATTERN_VERSION = "1.1"; + + public static final int A = 1; + public static final int B = 2; + public static final int BPRIME = 3; + + /** + * Creates an instance of the factory. + * + * + * @generated + */ + public SubgroupFactoryImpl() + { + super(NAMESPACE_URI, NAMESPACE_PREFIX, "com.example.subgroup"); + } + + /** + * Registers the Factory instance so that it is available within the supplied scope. + * @argument scope a HelperContext instance that will make the types supported by this Factory available. + * + * + * @generated + */ + public void register(HelperContext scope) { + if(scope == null) { + throw new IllegalArgumentException("Scope can not be null"); + } + TypeHelperImpl th = (TypeHelperImpl)scope.getTypeHelper(); + th.getExtendedMetaData().putPackage(NAMESPACE_URI, this); + } + + /** + * + * + * @generated + */ + public DataObject create(int typeNumber) + { + switch (typeNumber) + { + case A: return (DataObject)createA(); + case B: return (DataObject)createB(); + case BPRIME: return (DataObject)createBprime(); + default: + return super.create(typeNumber); + } + } + + /** + * + * + * @generated + */ + public A createA() + { + AImpl a = new AImpl(); + return a; + } + /** + * + * + * @generated + */ + public B createB() + { + BImpl b = new BImpl(); + return b; + } + /** + * + * + * @generated + */ + public Bprime createBprime() + { + BprimeImpl bprime = new BprimeImpl(); + return bprime; + } + + // Following creates and initializes SDO metadata for the supported types. + protected Type aType = null; + + public Type getA() + { + return aType; + } + + protected Type bType = null; + + public Type getB() + { + return bType; + } + + protected Type bprimeType = null; + + public Type getBprime() + { + return bprimeType; + } + + + private static boolean isInited = false; + + public static SubgroupFactoryImpl init() + { + if (isInited) return (SubgroupFactoryImpl)FactoryBase.getStaticFactory(SubgroupFactoryImpl.NAMESPACE_URI); + SubgroupFactoryImpl theSubgroupFactoryImpl = new SubgroupFactoryImpl(); + isInited = true; + + // Initialize simple dependencies + SDOUtil.registerStaticTypes(SDOFactory.class); + SDOUtil.registerStaticTypes(ModelFactory.class); + + // Create package meta-data objects + theSubgroupFactoryImpl.createMetaData(); + + // Initialize created meta-data + theSubgroupFactoryImpl.initializeMetaData(); + + // Mark meta-data to indicate it can't be changed + //theSubgroupFactoryImpl.freeze(); //FB do we need to freeze / should we freeze ???? + + return theSubgroupFactoryImpl; + } + + private boolean isCreated = false; + + public void createMetaData() + { + if (isCreated) return; + isCreated = true; + + // Create types and their properties + aType = createType(false, A); + createProperty(true, aType,AImpl.INTERNAL_GE1_GROUP); + createProperty(false, aType,AImpl.INTERNAL_GE1); + bType = createType(false, B); + createProperty(true, bType,BImpl.INTERNAL_IM_IN_TYPE_B); + bprimeType = createType(false, BPRIME); + createProperty(true, bprimeType,BprimeImpl.INTERNAL_IM_IN_TYPE_BPRIME); + } + + private boolean isInitialized = false; + + public void initializeMetaData() + { + if (isInitialized) return; + isInitialized = true; + + // Obtain other dependent packages + ModelFactoryImpl theModelPackageImpl = (ModelFactoryImpl)FactoryBase.getStaticFactory(ModelFactoryImpl.NAMESPACE_URI); + Property property = null; + + // Add supertypes to types + addSuperType(bprimeType, bType); + + // Initialize types and properties + initializeType(aType, A.class, "A", false); + property = getProperty(aType, AImpl.INTERNAL_GE1_GROUP); + initializeProperty(property, getSequence(), "ge1Group", null, 1, 1, A.class, false, false, false); + + property = getProperty(aType, AImpl.INTERNAL_GE1); + initializeProperty(property, this.getB(), "ge1", null, 1, 1, A.class, false, true, true, true , null); + + initializeType(bType, B.class, "B", false); + property = getProperty(bType, BImpl.INTERNAL_IM_IN_TYPE_B); + initializeProperty(property, theModelPackageImpl.getString(), "imInTypeB", null, 1, 1, B.class, false, true, false); + + initializeType(bprimeType, Bprime.class, "Bprime", false); + property = getProperty(bprimeType, BprimeImpl.INTERNAL_IM_IN_TYPE_BPRIME); + initializeProperty(property, theModelPackageImpl.getString(), "imInTypeBprime", null, 1, 1, Bprime.class, false, true, false); + + createXSDMetaData(theModelPackageImpl); + } + + protected void createXSDMetaData(ModelFactoryImpl theModelPackageImpl) + { + super.initXSD(); + + Property property = null; + + + addXSDMapping + (aType, + new String[] + { + "name", "A", + "kind", "elementOnly" + }); + + addXSDMapping + (getProperty(aType, AImpl.INTERNAL_GE1_GROUP), + new String[] + { + "kind", "group", + "name", "ge1:group", + "namespace", "##targetNamespace" + }); + + addXSDMapping + (getProperty(aType, AImpl.INTERNAL_GE1), + new String[] + { + "kind", "element", + "name", "ge1", + "namespace", "##targetNamespace", + "group", "ge1:group" + }); + + addXSDMapping + (bType, + new String[] + { + "name", "B", + "kind", "elementOnly" + }); + + addXSDMapping + (getProperty(bType, BImpl.INTERNAL_IM_IN_TYPE_B), + new String[] + { + "kind", "element", + "name", "imInTypeB", + "namespace", "##targetNamespace" + }); + + addXSDMapping + (bprimeType, + new String[] + { + "name", "Bprime", + "kind", "elementOnly" + }); + + addXSDMapping + (getProperty(bprimeType, BprimeImpl.INTERNAL_IM_IN_TYPE_BPRIME), + new String[] + { + "kind", "element", + "name", "imInTypeBprime", + "namespace", "##targetNamespace" + }); + + property = createGlobalProperty + ("a", + this.getA(), + new String[] + { + "kind", "element", + "name", "a", + "namespace", "##targetNamespace" + }); + + property = createGlobalProperty + ("ge1", + this.getB(), + new String[] + { + "kind", "element", + "name", "ge1", + "namespace", "##targetNamespace" + }); + + property = createGlobalProperty + ("se1", + this.getBprime(), + new String[] + { + "kind", "element", + "name", "se1", + "namespace", "##targetNamespace", + "affiliation", "ge1" + }); + + } + +} //SubgroupFactoryImpl -- cgit v1.2.3