diff --git a/plugins/org.eclipse.emf.codegen.ecore/src/org/eclipse/emf/codegen/ecore/templates/model/ValidatorClass.java b/plugins/org.eclipse.emf.codegen.ecore/src/org/eclipse/emf/codegen/ecore/templates/model/ValidatorClass.java index a9ae064c1..0adc97144 100644 --- a/plugins/org.eclipse.emf.codegen.ecore/src/org/eclipse/emf/codegen/ecore/templates/model/ValidatorClass.java +++ b/plugins/org.eclipse.emf.codegen.ecore/src/org/eclipse/emf/codegen/ecore/templates/model/ValidatorClass.java @@ -627,7 +627,7 @@ public String generate(Object argument) final StringBuffer stringBuffer = new StringBuffer(); /** - * Copyright (c) 2002-2011 IBM Corporation and others. + * Copyright (c) 2002-2013 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/plugins/org.eclipse.emf.codegen.ecore/templates/model/ValidatorClass.javajet b/plugins/org.eclipse.emf.codegen.ecore/templates/model/ValidatorClass.javajet index 910a86126..f57d33a03 100644 --- a/plugins/org.eclipse.emf.codegen.ecore/templates/model/ValidatorClass.javajet +++ b/plugins/org.eclipse.emf.codegen.ecore/templates/model/ValidatorClass.javajet @@ -1,7 +1,7 @@ <%@ jet package="org.eclipse.emf.codegen.ecore.templates.model" imports="java.util.* org.eclipse.emf.codegen.ecore.genmodel.* org.eclipse.emf.codegen.util.CodeGenUtil" class="ValidatorClass"%> <% /** - * Copyright (c) 2002-2011 IBM Corporation and others. + * Copyright (c) 2002-2013 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -656,5 +656,6 @@ public class <%=genPackage.getValidatorClassName()%> extends <%=genModel.getImpo } <%}%> +<%@ include file="ValidatorClass/insert.javajetinc" fail="silent" %> } //<%=genPackage.getValidatorClassName()%> <%genModel.emitSortedImports();%> diff --git a/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/impl/MinimalEObjectImpl.java b/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/impl/MinimalEObjectImpl.java index 0c905fad8..10a06ccc4 100644 --- a/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/impl/MinimalEObjectImpl.java +++ b/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/impl/MinimalEObjectImpl.java @@ -1,786 +1,780 @@ -/** - * Copyright (c) 2009 Ed Merks and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ed Merks - Initial API and implementation - */ -package org.eclipse.emf.ecore.impl; - - -import java.util.Arrays; - -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.impl.BasicNotifierImpl; -import org.eclipse.emf.common.notify.impl.NotificationImpl; -import org.eclipse.emf.common.util.ArrayDelegatingEList; -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.BasicEMap; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.util.EContentsEList; -import org.eclipse.emf.ecore.util.ECrossReferenceEList; - - -/** - * A space compact implementation of the model object 'EObject'. - * @since 2.5 - */ -public class MinimalEObjectImpl extends BasicEObjectImpl implements EStructuralFeature.Internal.DynamicValueHolder -{ - public static class Container extends MinimalEObjectImpl - { - public static class Dynamic extends Container - { - public static final class BasicEMapEntry extends Dynamic implements BasicEMap.Entry - { - protected int hash = -1; - protected EStructuralFeature keyFeature; - protected EStructuralFeature valueFeature; - - /** - * Creates a dynamic EObject. - */ - public BasicEMapEntry() - { - super(); - } - - /** - * Creates a dynamic EObject. - */ - public BasicEMapEntry(EClass eClass) - { - super(eClass); - } - - @SuppressWarnings("unchecked") - public K getKey() - { - return (K)eGet(keyFeature); - } - - public void setKey(Object key) - { - eSet(keyFeature, key); - } - - public int getHash() - { - if (hash == -1) - { - Object theKey = getKey(); - hash = (theKey == null ? 0 : theKey.hashCode()); - } - return hash; - } - - public void setHash(int hash) - { - this.hash = hash; - } - - @SuppressWarnings("unchecked") - public V getValue() - { - return (V)eGet(valueFeature); - } - - public V setValue(V value) - { - @SuppressWarnings("unchecked") V result = (V)eGet(valueFeature); - eSet(valueFeature, value); - return result; - } - - @Override - public void eSetClass(EClass eClass) - { - super.eSetClass(eClass); - keyFeature = eClass.getEStructuralFeature("key"); - valueFeature = eClass.getEStructuralFeature("value"); - } - } - - protected EClass eClass; - protected Object[] eSettings; - - public Dynamic() - { - super(); - } - - public Dynamic(EClass eClass) - { - super(); - eSetClass(eClass); - } - - @Override - public EClass eClass() - { - return eClass; - } - - @Override - protected EClass eDynamicClass() - { - return eClass(); - } - - @Override - public void eSetClass(EClass eClass) - { - this.eClass = eClass; - } - - @Override - protected boolean eHasSettings() - { - return eSettings != null; - } - - @Override - protected Object[] eBasicSettings() - { - return eSettings; - } - - @Override - protected void eBasicSetSettings(Object[] settings) - { - this.eSettings = settings; - } - } - - protected InternalEObject eContainer; - - public Container() - { - super(); - } - - @Override - public InternalEObject eInternalContainer() - { - return eContainer; - } - - @Override - protected void eBasicSetContainer(InternalEObject newContainer) - { - eContainer = newContainer; - } - } - - /** - * The {@link #eFlags bit flag} for {@link #eDeliver()}. - */ - private static final int NO_DELIVER = 1 << 0; - - /** - * The {@link #eFlags bit flag} for indicating that a dynamic {@link #eContainer() container} field is allocated. - * A derived implementation wishing to allocate a static container field - * should override {@link #eInternalContainer()} and {@link #eBasicSetContainer(InternalEObject)}. - */ - private static final int CONTAINER = 1 << 1; - - /** - * The {@link #eFlags bit flag} for indicating that a dynamic {@link #eAdapters() adapters} field is allocated. - * A derived implementation wishing to allocate a static adapter field - * should override {@link #eBasicHasAdapters()}, {@link #eBasicAdapterArray()}, and {@link #eBasicSetAdapterArray(Adapter[])}. - */ - private static final int ADAPTER = 1 << 2; - - /** - * The {@link #eFlags bit flag} for indicating that a dynamic {@link BasicNotifierImpl.EObservableAdapterList.Listener adapter list listener} field is allocated. - */ - private static final int ADAPTER_LISTENER = 1 << 3; - - /** - * The {@link #eFlags bit flag} for indicating that a dynamic {@link #eClass() class} field is allocated. - * A derived implementation wishing to allocate a static class field - * should override {@link #eDynamicClass()} and {@link #eSetClass(EClass)}. - */ - private static final int CLASS = 1 << 4; - - /** - * The {@link #eFlags bit flag} for indicating that a dynamic {@link #eSettings() settings} field is allocated. - * A derived implementation wishing to allocate a static settings field - * should override {@link #eHasSettings()}, {@link #eBasicSettings()}, and {@link #eBasicSetSettings(Object[])}. - */ - private static final int SETTING = 1 << 5; - - /** - * The {@link #eFlags bit flag} for indicating that a dynamic {@link #eProxyURI() proxy URI} field is allocated. - * A derived implementation wishing to allocate a static proxy URI field - * should override {@link #eIsProxy()}, {@link #eProxyURI()}, and {@link #eSetProxyURI(URI)}. - */ - private static final int PROXY = 1 << 6; - - /** - * The {@link #eFlags bit flag} for indicating that a dynamic {@link #eResource() resource} field is allocated. - * A derived implementation wishing to allocate a static resource field - * should override {@link #eDirectResource()} and {@link #eSetDirectResource(Resource.Internal)}. - */ - private static final int RESOURCE = 1 << 7; - - /** - * A bit mask for all the bit flags representing fields. - */ - private static final int FIELD_MASK = CONTAINER | ADAPTER | ADAPTER_LISTENER | CLASS | SETTING | PROXY | RESOURCE; - - /** - * A bit flag field with bits for - * {@link #NO_DELIVER}, - * {@link #CONTAINER}, - * {@link #ADAPTER}, - * {@link #ADAPTER_LISTENER}, - * {@link #CLASS}, - * {@link #SETTING}, - * {@link #PROXY}, - * and - * {@link #RESOURCE}. - * The high order 16 bits are used to represent the {@link #eContainerFeatureID() container feature ID}, - * a derived implementation wishing to allocate a static container feature ID field - * should override {@link #eContainerFeatureID()} and {@link #eBasicSetContainerFeatureID(int)}. - * @see #NO_DELIVER - * @see #CONTAINER - * @see #ADAPTER - * @see #ADAPTER_LISTENER - * @see #CLASS - * @see #SETTING - * @see #PROXY - * @see #RESOURCE - */ - private int eFlags; - - /** - * The storage location for dynamic fields. - */ - private Object eStorage; - - /** - * Creates a minimal EObject. - */ - protected MinimalEObjectImpl() - { - super(); - } - - @Override - protected EPropertiesHolder eProperties() - { - throw new UnsupportedOperationException(); - } - - @Override - protected EPropertiesHolder eBasicProperties() - { - throw new UnsupportedOperationException(); - } - - @Override - protected BasicEList eBasicAdapters() - { - throw new UnsupportedOperationException(); - } - - private final boolean hasField(int field) - { - return (eFlags & field) != 0; - } - - private final Object getField(int field) - { - if (hasField(field)) - { - int fieldIndex = fieldIndex(field); - return fieldIndex == -1 ? eStorage : ((Object[])eStorage)[fieldIndex]; - } - else - { - return null; - } - } - - private final void setField(int field, Object value) - { - if (hasField(field)) - { - if (value == null) - { - removeField(field); - } - else - { - int fieldIndex = fieldIndex(field); - if (fieldIndex == -1) - { - eStorage = value; - } - else - { - ((Object[])eStorage)[fieldIndex] = value; - } - } - } - else if (value != null) - { - addField(field, value); - } - } - - private final int fieldIndex(int field) - { - int result = 0; - for (int bit = CONTAINER; bit < field; bit <<= 1) - { - if ((eFlags & bit) != 0) - { - ++result; - } - } - if (result == 0) - { - for (int bit = field <<= 1; bit <= RESOURCE; bit <<= 1) - { - if ((eFlags & bit) != 0) - { - return 0; - } - } - return -1; - } - else - { - return result; - } - } - - private final void addField(int field, Object value) - { - int fieldCount = Integer.bitCount(eFlags & FIELD_MASK); - if (fieldCount == 0) - { - eStorage = value; - } - else - { - Object[] result; - if (fieldCount == 1) - { - result = new Object[2]; - int fieldIndex = fieldIndex(field); - if (fieldIndex == 0) - { - result[0] = value; - result[1] = eStorage; - } - else - { - result[0] = eStorage; - result[1] = value; - } - } - else - { - result = new Object[fieldCount + 1]; - Object[] oldStorage = (Object[])eStorage; - for (int bit = CONTAINER, sourceIndex = 0, targetIndex = 0; bit <= RESOURCE; bit <<= 1) - { - if (bit == field) - { - result[targetIndex++] = value; - } - else if ((eFlags & bit) != 0) - { - result[targetIndex++] = oldStorage[sourceIndex++]; - } - } - } - eStorage = result; - } - eFlags |= field; - } - - private final void removeField(int field) - { - int fieldCount = Integer.bitCount(eFlags & FIELD_MASK); - if (fieldCount == 1) - { - eStorage = null; - } - else - { - Object[] oldStorage = (Object[])eStorage; - if (fieldCount == 2) - { - int fieldIndex = fieldIndex(field); - eStorage = oldStorage[fieldIndex == 0 ? 1 : 0]; - } - else - { - Object[] result = new Object[fieldCount - 1]; - for (int bit = CONTAINER, sourceIndex = 0, targetIndex = 0; bit <= RESOURCE; bit <<= 1) - { - if (bit == field) - { - sourceIndex++; - } - else if ((eFlags & bit) != 0) - { - result[targetIndex++] = oldStorage[sourceIndex++]; - } - } - eStorage = result; - } - } - eFlags &= ~field; - } - - @Override - public EList eAdapters() - { - class ArrayDelegatingAdapterList extends ArrayDelegatingEList implements BasicNotifierImpl.EObservableAdapterList - { - private static final long serialVersionUID = 1L; - - @Override - protected Object[] newData(int capacity) - { - return new Adapter[capacity]; - } - - @Override - public Object[] data() - { - return eBasicAdapterArray(); - } - - @Override - public void setData(Object[] data) - { - ++modCount; - if (data != null) - { - Adapter[] eContainerAdapterArray = eContainerAdapterArray(); - if (Arrays.equals(data, eContainerAdapterArray)) - { - eBasicSetAdapterArray(eContainerAdapterArray); - return; - } - } - eBasicSetAdapterArray((Adapter[])data); - } - - @Override - protected void didAdd(int index, Adapter newAdapter) - { - newAdapter.setTarget(MinimalEObjectImpl.this); - Listener[] listeners = eBasicAdapterListeners(); - if (listeners != null) - { - for (Listener listener : listeners) - { - listener.added(MinimalEObjectImpl.this, newAdapter); - } - } - } - - @Override - protected void didRemove(int index, Adapter oldAdapter) - { - Listener[] listeners = eBasicAdapterListeners(); - if (listeners != null) - { - for (Listener listener : listeners) - { - listener.removed(MinimalEObjectImpl.this, oldAdapter); - } - } - Adapter adapter = oldAdapter; - if (eDeliver()) - { - Notification notification = - new NotificationImpl(Notification.REMOVING_ADAPTER, oldAdapter, null, index) - { - @Override - public Object getNotifier() - { - return MinimalEObjectImpl.this; - } - }; - adapter.notifyChanged(notification); - } - if (adapter instanceof Adapter.Internal) - { - ((Adapter.Internal)adapter).unsetTarget(MinimalEObjectImpl.this); - } - else if (adapter.getTarget() == MinimalEObjectImpl.this) - { - adapter.setTarget(null); - } - } - - public void addListener(Listener listener) - { - Listener[] listeners = eBasicAdapterListeners(); - if (listeners == null) - { - listeners = new Listener [] { listener }; - } - else - { - Listener[] newListeners = new Listener[listeners.length + 1]; - System.arraycopy(listeners, 0, newListeners, 0, listeners.length); - newListeners[listeners.length] = listener; - listeners = newListeners; - } - eBasicSetAdapterListeners(listeners); - } - - public void removeListener(Listener listener) - { - Listener[] listeners = eBasicAdapterListeners(); - if (listeners != null) - { - for (int i = 0; i < listeners.length; ++i) - { - if (listeners[i] == listener) - { - if (listeners.length == 1) - { - listeners = null; - } - else - { - Listener[] newListeners = new Listener[listeners.length - 1]; - System.arraycopy(listeners, 0, newListeners, 0, i); - if (i != newListeners.length) - { - System.arraycopy(listeners, i + 1, newListeners, i, newListeners.length - i); - } - listeners = newListeners; - } - eBasicSetAdapterListeners(listeners); - break; - } - } - } - } - } - return new ArrayDelegatingAdapterList(); - } - - @Override - protected Adapter[] eBasicAdapterArray() - { - return (Adapter[])getField(ADAPTER); - } - - protected void eBasicSetAdapterArray(Adapter[] eAdapters) - { - setField(ADAPTER, eAdapters); - } - - @Override - protected boolean eBasicHasAdapters() - { - return hasField(ADAPTER); - } - - /** - * @since 2.9 - */ - protected EObservableAdapterList.Listener[] eBasicAdapterListeners() - { - return (EObservableAdapterList.Listener[])getField(ADAPTER_LISTENER); - } - - /** - * @since 2.9 - */ - protected void eBasicSetAdapterListeners(EObservableAdapterList.Listener[] eAdapterListeners) - { - setField(ADAPTER_LISTENER, eAdapterListeners); - } - - @Override - public boolean eDeliver() - { - return (eFlags & NO_DELIVER) == 0; - } - - @Override - public void eSetDeliver(boolean deliver) - { - if (deliver) - { - eFlags &= ~NO_DELIVER; - } - else - { - eFlags |= NO_DELIVER; - } - } - - @Override - public boolean eIsProxy() - { - return hasField(PROXY); - } - - @Override - public URI eProxyURI() - { - return (URI)getField(PROXY); - } - - @Override - public void eSetProxyURI(URI uri) - { - setField(PROXY, uri); - } - - @Override - public InternalEObject eInternalContainer() - { - return (InternalEObject)getField(CONTAINER); - } - - protected void eBasicSetContainer(InternalEObject newContainer) - { - setField(CONTAINER, newContainer); - } - - @Override - public int eContainerFeatureID() - { - return eFlags >> 16; - } - - protected void eBasicSetContainerFeatureID(int newContainerFeatureID) - { - eFlags = newContainerFeatureID << 16 | (eFlags & 0x00FF); - } - - @Override - protected void eBasicSetContainer(InternalEObject newContainer, int newContainerFeatureID) - { - eBasicSetContainerFeatureID(newContainerFeatureID); - eBasicSetContainer(newContainer); - } - - @Override - protected EClass eDynamicClass() - { - return (EClass)getField(CLASS); - } - - @Override - public EClass eClass() - { - EClass eClass = eDynamicClass(); - return eClass == null ? eStaticClass() : eClass; - } - - @Override - public void eSetClass(EClass eClass) - { - setField(CLASS, eClass); - } - - @Override - protected boolean eHasSettings() - { - return hasField(SETTING); - } - - protected Object[] eBasicSettings() - { - return (Object[])getField(SETTING); - } - - protected void eBasicSetSettings(Object[] settings) - { - setField(SETTING, settings); - } - - @Override - protected EStructuralFeature.Internal.DynamicValueHolder eSettings() - { - if (!eHasSettings()) - { - int size = eClass().getFeatureCount() - eStaticFeatureCount(); - if (size != 0) - { - eBasicSetSettings(new Object [size]); - } - } - - return this; - } - - @Override - public Resource.Internal eDirectResource() - { - return (Resource.Internal)getField(RESOURCE); - } - - @Override - protected void eSetDirectResource(Resource.Internal resource) - { - setField(RESOURCE, resource); - } - - @Override - public EList eContents() - { - return EContentsEList.createEContentsEList(this); - } - - @Override - public EList eCrossReferences() - { - return ECrossReferenceEList.createECrossReferenceEList(this); - } - - Object[] eDynamicSettings() - { - Object[] settings = eBasicSettings(); - if (settings == null) - { - eSettings(); - settings = eBasicSettings(); - } - return settings; - } - - public Object dynamicGet(int dynamicFeatureID) - { - Object[] settings = eDynamicSettings(); - return settings[dynamicFeatureID]; - } - - public void dynamicSet(int dynamicFeatureID, Object newValue) - { - Object[] settings = eDynamicSettings(); - settings[dynamicFeatureID] = newValue; - } - - public void dynamicUnset(int dynamicFeatureID) - { - Object[] settings = eDynamicSettings(); - settings[dynamicFeatureID] = null; - } -} +/** + * Copyright (c) 2009 Ed Merks and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ed Merks - Initial API and implementation + */ +package org.eclipse.emf.ecore.impl; + + +import java.util.Arrays; + +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.impl.BasicNotifierImpl; +import org.eclipse.emf.common.notify.impl.NotificationImpl; +import org.eclipse.emf.common.util.ArrayDelegatingEList; +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.BasicEMap; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.util.EContentsEList; +import org.eclipse.emf.ecore.util.ECrossReferenceEList; + + +/** + * A space compact implementation of the model object 'EObject'. + * @since 2.5 + */ +public class MinimalEObjectImpl extends BasicEObjectImpl implements EStructuralFeature.Internal.DynamicValueHolder +{ + public static class Container extends MinimalEObjectImpl + { + public static class Dynamic extends Container + { + public static final class BasicEMapEntry extends Dynamic implements BasicEMap.Entry + { + protected int hash = -1; + protected EStructuralFeature keyFeature; + protected EStructuralFeature valueFeature; + + /** + * Creates a dynamic EObject. + */ + public BasicEMapEntry() + { + super(); + } + + /** + * Creates a dynamic EObject. + */ + public BasicEMapEntry(EClass eClass) + { + super(eClass); + } + + @SuppressWarnings("unchecked") + public K getKey() + { + return (K)eGet(keyFeature); + } + + public void setKey(Object key) + { + eSet(keyFeature, key); + } + + public int getHash() + { + if (hash == -1) + { + Object theKey = getKey(); + hash = (theKey == null ? 0 : theKey.hashCode()); + } + return hash; + } + + public void setHash(int hash) + { + this.hash = hash; + } + + @SuppressWarnings("unchecked") + public V getValue() + { + return (V)eGet(valueFeature); + } + + public V setValue(V value) + { + @SuppressWarnings("unchecked") V result = (V)eGet(valueFeature); + eSet(valueFeature, value); + return result; + } + + @Override + public void eSetClass(EClass eClass) + { + super.eSetClass(eClass); + keyFeature = eClass.getEStructuralFeature("key"); + valueFeature = eClass.getEStructuralFeature("value"); + } + } + + protected EClass eClass; + protected Object[] eSettings; + + public Dynamic() + { + super(); + } + + public Dynamic(EClass eClass) + { + super(); + eSetClass(eClass); + } + + @Override + public EClass eClass() + { + return eClass; + } + + @Override + protected EClass eDynamicClass() + { + return eClass(); + } + + @Override + public void eSetClass(EClass eClass) + { + this.eClass = eClass; + } + + @Override + protected boolean eHasSettings() + { + return eSettings != null; + } + + @Override + protected Object[] eBasicSettings() + { + return eSettings; + } + + @Override + protected void eBasicSetSettings(Object[] settings) + { + this.eSettings = settings; + } + } + + protected InternalEObject eContainer; + + public Container() + { + super(); + } + + @Override + public InternalEObject eInternalContainer() + { + return eContainer; + } + + @Override + protected void eBasicSetContainer(InternalEObject newContainer) + { + eContainer = newContainer; + } + } + + /** + * The {@link #eFlags bit flag} for {@link #eDeliver()}. + */ + private static final int NO_DELIVER = 1 << 0; + + /** + * The {@link #eFlags bit flag} for indicating that a dynamic {@link #eContainer() container} field is allocated. + * A derived implementation wishing to allocate a static container field + * should override {@link #eInternalContainer()} and {@link #eBasicSetContainer(InternalEObject)}. + */ + private static final int CONTAINER = 1 << 1; + + /** + * The {@link #eFlags bit flag} for indicating that a dynamic {@link #eAdapters() adapters} field is allocated. + * A derived implementation wishing to allocate a static adapter field + * should override {@link #eBasicHasAdapters()}, {@link #eBasicAdapterArray()}, and {@link #eBasicSetAdapterArray(Adapter[])}. + */ + private static final int ADAPTER = 1 << 2; + + /** + * The {@link #eFlags bit flag} for indicating that a dynamic {@link BasicNotifierImpl.EObservableAdapterList.Listener adapter list listener} field is allocated. + */ + private static final int ADAPTER_LISTENER = 1 << 3; + + /** + * The {@link #eFlags bit flag} for indicating that a dynamic {@link #eClass() class} field is allocated. + * A derived implementation wishing to allocate a static class field + * should override {@link #eDynamicClass()} and {@link #eSetClass(EClass)}. + */ + private static final int CLASS = 1 << 4; + + /** + * The {@link #eFlags bit flag} for indicating that a dynamic {@link #eSettings() settings} field is allocated. + * A derived implementation wishing to allocate a static settings field + * should override {@link #eHasSettings()}, {@link #eBasicSettings()}, and {@link #eBasicSetSettings(Object[])}. + */ + private static final int SETTING = 1 << 5; + + /** + * The {@link #eFlags bit flag} for indicating that a dynamic {@link #eProxyURI() proxy URI} field is allocated. + * A derived implementation wishing to allocate a static proxy URI field + * should override {@link #eIsProxy()}, {@link #eProxyURI()}, and {@link #eSetProxyURI(URI)}. + */ + private static final int PROXY = 1 << 6; + + /** + * The {@link #eFlags bit flag} for indicating that a dynamic {@link #eResource() resource} field is allocated. + * A derived implementation wishing to allocate a static resource field + * should override {@link #eDirectResource()} and {@link #eSetDirectResource(Resource.Internal)}. + */ + private static final int RESOURCE = 1 << 7; + + /** + * A bit mask for all the bit flags representing fields. + */ + private static final int FIELD_MASK = CONTAINER | ADAPTER | ADAPTER_LISTENER | CLASS | SETTING | PROXY | RESOURCE; + + /** + * A bit flag field with bits for + * {@link #NO_DELIVER}, + * {@link #CONTAINER}, + * {@link #ADAPTER}, + * {@link #ADAPTER_LISTENER}, + * {@link #CLASS}, + * {@link #SETTING}, + * {@link #PROXY}, + * and + * {@link #RESOURCE}. + * The high order 16 bits are used to represent the {@link #eContainerFeatureID() container feature ID}, + * a derived implementation wishing to allocate a static container feature ID field + * should override {@link #eContainerFeatureID()} and {@link #eBasicSetContainerFeatureID(int)}. + * @see #NO_DELIVER + * @see #CONTAINER + * @see #ADAPTER + * @see #ADAPTER_LISTENER + * @see #CLASS + * @see #SETTING + * @see #PROXY + * @see #RESOURCE + */ + private int eFlags; + + /** + * The storage location for dynamic fields. + */ + private Object eStorage; + + /** + * Creates a minimal EObject. + */ + protected MinimalEObjectImpl() + { + super(); + } + + @Override + protected EPropertiesHolder eProperties() + { + throw new UnsupportedOperationException(); + } + + @Override + protected EPropertiesHolder eBasicProperties() + { + throw new UnsupportedOperationException(); + } + + @Override + protected BasicEList eBasicAdapters() + { + throw new UnsupportedOperationException(); + } + + private final boolean hasField(int field) + { + return (eFlags & field) != 0; + } + + private final Object getField(int field) + { + if (hasField(field)) + { + int fieldIndex = fieldIndex(field); + return fieldIndex == -1 ? eStorage : ((Object[])eStorage)[fieldIndex]; + } + else + { + return null; + } + } + + private final void setField(int field, Object value) + { + if (hasField(field)) + { + if (value == null) + { + removeField(field); + } + else + { + int fieldIndex = fieldIndex(field); + if (fieldIndex == -1) + { + eStorage = value; + } + else + { + ((Object[])eStorage)[fieldIndex] = value; + } + } + } + else if (value != null) + { + addField(field, value); + } + } + + private final int fieldIndex(int field) + { + int result = 0; + for (int bit = CONTAINER; bit < field; bit <<= 1) + { + if ((eFlags & bit) != 0) + { + ++result; + } + } + if (result == 0) + { + for (int bit = field <<= 1; bit <= RESOURCE; bit <<= 1) + { + if ((eFlags & bit) != 0) + { + return 0; + } + } + return -1; + } + else + { + return result; + } + } + + private final void addField(int field, Object value) + { + int fieldCount = Integer.bitCount(eFlags & FIELD_MASK); + if (fieldCount == 0) + { + eStorage = value; + } + else + { + Object[] result; + if (fieldCount == 1) + { + result = new Object[2]; + int fieldIndex = fieldIndex(field); + if (fieldIndex == 0) + { + result[0] = value; + result[1] = eStorage; + } + else + { + result[0] = eStorage; + result[1] = value; + } + } + else + { + result = new Object[fieldCount + 1]; + Object[] oldStorage = (Object[])eStorage; + for (int bit = CONTAINER, sourceIndex = 0, targetIndex = 0; bit <= RESOURCE; bit <<= 1) + { + if (bit == field) + { + result[targetIndex++] = value; + } + else if ((eFlags & bit) != 0) + { + result[targetIndex++] = oldStorage[sourceIndex++]; + } + } + } + eStorage = result; + } + eFlags |= field; + } + + private final void removeField(int field) + { + int fieldCount = Integer.bitCount(eFlags & FIELD_MASK); + if (fieldCount == 1) + { + eStorage = null; + } + else + { + Object[] oldStorage = (Object[])eStorage; + if (fieldCount == 2) + { + int fieldIndex = fieldIndex(field); + eStorage = oldStorage[fieldIndex == 0 ? 1 : 0]; + } + else + { + Object[] result = new Object[fieldCount - 1]; + for (int bit = CONTAINER, sourceIndex = 0, targetIndex = 0; bit <= RESOURCE; bit <<= 1) + { + if (bit == field) + { + sourceIndex++; + } + else if ((eFlags & bit) != 0) + { + result[targetIndex++] = oldStorage[sourceIndex++]; + } + } + eStorage = result; + } + } + eFlags &= ~field; + } + + @Override + public EList eAdapters() + { + class ArrayDelegatingAdapterList extends ArrayDelegatingEList implements BasicNotifierImpl.EObservableAdapterList + { + private static final long serialVersionUID = 1L; + + @Override + protected Object[] newData(int capacity) + { + return new Adapter[capacity]; + } + + @Override + public Object[] data() + { + return eBasicAdapterArray(); + } + + @Override + public void setData(Object[] data) + { + ++modCount; + if (data != null) + { + Adapter[] eContainerAdapterArray = eContainerAdapterArray(); + if (Arrays.equals(data, eContainerAdapterArray)) + { + eBasicSetAdapterArray(eContainerAdapterArray); + return; + } + } + eBasicSetAdapterArray((Adapter[])data); + } + + @Override + protected void didAdd(int index, Adapter newAdapter) + { + newAdapter.setTarget(MinimalEObjectImpl.this); + Listener[] listeners = eBasicAdapterListeners(); + if (listeners != null) + { + for (Listener listener : listeners) + { + listener.added(MinimalEObjectImpl.this, newAdapter); + } + } + } + + @Override + protected void didRemove(int index, Adapter oldAdapter) + { + Listener[] listeners = eBasicAdapterListeners(); + if (listeners != null) + { + for (Listener listener : listeners) + { + listener.removed(MinimalEObjectImpl.this, oldAdapter); + } + } + Adapter adapter = oldAdapter; + if (eDeliver()) + { + Notification notification = + new NotificationImpl(Notification.REMOVING_ADAPTER, oldAdapter, null, index) + { + @Override + public Object getNotifier() + { + return MinimalEObjectImpl.this; + } + }; + adapter.notifyChanged(notification); + } + if (adapter instanceof Adapter.Internal) + { + ((Adapter.Internal)adapter).unsetTarget(MinimalEObjectImpl.this); + } + else if (adapter.getTarget() == MinimalEObjectImpl.this) + { + adapter.setTarget(null); + } + } + + public void addListener(Listener listener) + { + Listener[] listeners = eBasicAdapterListeners(); + if (listeners == null) + { + listeners = new Listener [] { listener }; + } + else + { + Listener[] newListeners = new Listener[listeners.length + 1]; + System.arraycopy(listeners, 0, newListeners, 0, listeners.length); + newListeners[listeners.length] = listener; + listeners = newListeners; + } + eBasicSetAdapterListeners(listeners); + } + + public void removeListener(Listener listener) + { + Listener[] listeners = eBasicAdapterListeners(); + if (listeners != null) + { + for (int i = 0; i < listeners.length; ++i) + { + if (listeners[i] == listener) + { + if (listeners.length == 1) + { + listeners = null; + } + else + { + Listener[] newListeners = new Listener[listeners.length - 1]; + System.arraycopy(listeners, 0, newListeners, 0, i); + if (i != newListeners.length) + { + System.arraycopy(listeners, i + 1, newListeners, i, newListeners.length - i); + } + listeners = newListeners; + } + eBasicSetAdapterListeners(listeners); + break; + } + } + } + } + } + return new ArrayDelegatingAdapterList(); + } + + @Override + protected Adapter[] eBasicAdapterArray() + { + return (Adapter[])getField(ADAPTER); + } + + protected void eBasicSetAdapterArray(Adapter[] eAdapters) + { + setField(ADAPTER, eAdapters); + } + + @Override + protected boolean eBasicHasAdapters() + { + return hasField(ADAPTER); + } + + protected EObservableAdapterList.Listener[] eBasicAdapterListeners() + { + return (EObservableAdapterList.Listener[])getField(ADAPTER_LISTENER); + } + + protected void eBasicSetAdapterListeners(EObservableAdapterList.Listener[] eAdapterListeners) + { + setField(ADAPTER_LISTENER, eAdapterListeners); + } + + @Override + public boolean eDeliver() + { + return (eFlags & NO_DELIVER) == 0; + } + + @Override + public void eSetDeliver(boolean deliver) + { + if (deliver) + { + eFlags &= ~NO_DELIVER; + } + else + { + eFlags |= NO_DELIVER; + } + } + + @Override + public boolean eIsProxy() + { + return hasField(PROXY); + } + + @Override + public URI eProxyURI() + { + return (URI)getField(PROXY); + } + + @Override + public void eSetProxyURI(URI uri) + { + setField(PROXY, uri); + } + + @Override + public InternalEObject eInternalContainer() + { + return (InternalEObject)getField(CONTAINER); + } + + protected void eBasicSetContainer(InternalEObject newContainer) + { + setField(CONTAINER, newContainer); + } + + @Override + public int eContainerFeatureID() + { + return eFlags >> 16; + } + + protected void eBasicSetContainerFeatureID(int newContainerFeatureID) + { + eFlags = newContainerFeatureID << 16 | (eFlags & 0x00FF); + } + + @Override + protected void eBasicSetContainer(InternalEObject newContainer, int newContainerFeatureID) + { + eBasicSetContainerFeatureID(newContainerFeatureID); + eBasicSetContainer(newContainer); + } + + @Override + protected EClass eDynamicClass() + { + return (EClass)getField(CLASS); + } + + @Override + public EClass eClass() + { + EClass eClass = eDynamicClass(); + return eClass == null ? eStaticClass() : eClass; + } + + @Override + public void eSetClass(EClass eClass) + { + setField(CLASS, eClass); + } + + @Override + protected boolean eHasSettings() + { + return hasField(SETTING); + } + + protected Object[] eBasicSettings() + { + return (Object[])getField(SETTING); + } + + protected void eBasicSetSettings(Object[] settings) + { + setField(SETTING, settings); + } + + @Override + protected EStructuralFeature.Internal.DynamicValueHolder eSettings() + { + if (!eHasSettings()) + { + int size = eClass().getFeatureCount() - eStaticFeatureCount(); + if (size != 0) + { + eBasicSetSettings(new Object [size]); + } + } + + return this; + } + + @Override + public Resource.Internal eDirectResource() + { + return (Resource.Internal)getField(RESOURCE); + } + + @Override + protected void eSetDirectResource(Resource.Internal resource) + { + setField(RESOURCE, resource); + } + + @Override + public EList eContents() + { + return EContentsEList.createEContentsEList(this); + } + + @Override + public EList eCrossReferences() + { + return ECrossReferenceEList.createECrossReferenceEList(this); + } + + Object[] eDynamicSettings() + { + Object[] settings = eBasicSettings(); + if (settings == null) + { + eSettings(); + settings = eBasicSettings(); + } + return settings; + } + + public Object dynamicGet(int dynamicFeatureID) + { + Object[] settings = eDynamicSettings(); + return settings[dynamicFeatureID]; + } + + public void dynamicSet(int dynamicFeatureID, Object newValue) + { + Object[] settings = eDynamicSettings(); + settings[dynamicFeatureID] = newValue; + } + + public void dynamicUnset(int dynamicFeatureID) + { + Object[] settings = eDynamicSettings(); + settings[dynamicFeatureID] = null; + } +} diff --git a/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/impl/MinimalEStoreEObjectImpl.java b/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/impl/MinimalEStoreEObjectImpl.java index 3ed8da854..f6b746f90 100644 --- a/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/impl/MinimalEStoreEObjectImpl.java +++ b/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/impl/MinimalEStoreEObjectImpl.java @@ -51,7 +51,7 @@ public MinimalEStoreEObjectImpl(EClass eClass) @Override public abstract InternalEObject.EStore eStore(); - + protected boolean eIsCaching() { return true; diff --git a/plugins/org.eclipse.emf.gwt.common/pom.xml b/plugins/org.eclipse.emf.gwt.common/pom.xml new file mode 100644 index 000000000..2d02850e6 --- /dev/null +++ b/plugins/org.eclipse.emf.gwt.common/pom.xml @@ -0,0 +1,24 @@ + + + 4.0.0 + org.eclipse.emf.gwt.common + + org.eclipse + emf-gwt + 2.9.0-SNAPSHOT + ../../releng/org.eclipse.emf.gwt.parent/pom.xml + + + + + + src + + **/*.java + **/*.gwt.xml + + + + + \ No newline at end of file diff --git a/plugins/org.eclipse.emf.gwt.ecore.change/pom.xml b/plugins/org.eclipse.emf.gwt.ecore.change/pom.xml new file mode 100644 index 000000000..9fdab79f0 --- /dev/null +++ b/plugins/org.eclipse.emf.gwt.ecore.change/pom.xml @@ -0,0 +1,37 @@ + + + 4.0.0 + org.eclipse.emf.gwt.ecore.change + + org.eclipse + emf-gwt + 2.9.0-SNAPSHOT + ../../releng/org.eclipse.emf.gwt.parent/pom.xml + + + + + org.eclipse + org.eclipse.emf.gwt.common + 2.9.0-SNAPSHOT + + + org.eclipse + org.eclipse.emf.gwt.ecore + 2.9.0-SNAPSHOT + + + + + + + src + + **/*.java + **/*.gwt.xml + + + + + \ No newline at end of file diff --git a/plugins/org.eclipse.emf.gwt.ecore.edit/pom.xml b/plugins/org.eclipse.emf.gwt.ecore.edit/pom.xml new file mode 100644 index 000000000..66391ec16 --- /dev/null +++ b/plugins/org.eclipse.emf.gwt.ecore.edit/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + org.eclipse.emf.gwt.ecore.edit + + org.eclipse + emf-gwt + 2.9.0-SNAPSHOT + ../../releng/org.eclipse.emf.gwt.parent/pom.xml + + + + + org.eclipse + org.eclipse.emf.gwt.common + 2.9.0-SNAPSHOT + + + org.eclipse + org.eclipse.emf.gwt.ecore + 2.9.0-SNAPSHOT + + + org.eclipse + org.eclipse.emf.gwt.ecore.change + 2.9.0-SNAPSHOT + + + org.eclipse + org.eclipse.emf.gwt.edit + 2.9.0-SNAPSHOT + + + org.eclipse + org.eclipse.emf.gwt.edit.ui + 2.9.0-SNAPSHOT + + + + + + + src + + **/*.java + **/*.gwt.xml + + + + + + \ No newline at end of file diff --git a/plugins/org.eclipse.emf.gwt.ecore/model/Ecore.ecore b/plugins/org.eclipse.emf.gwt.ecore/model/Ecore.ecore index 049c5eacf..bdb776650 100644 --- a/plugins/org.eclipse.emf.gwt.ecore/model/Ecore.ecore +++ b/plugins/org.eclipse.emf.gwt.ecore/model/Ecore.ecore @@ -359,6 +359,16 @@ + + +
+ + + + +
+ +
diff --git a/plugins/org.eclipse.emf.gwt.ecore/pom.xml b/plugins/org.eclipse.emf.gwt.ecore/pom.xml new file mode 100644 index 000000000..5961443f4 --- /dev/null +++ b/plugins/org.eclipse.emf.gwt.ecore/pom.xml @@ -0,0 +1,32 @@ + + + 4.0.0 + org.eclipse.emf.gwt.ecore + + org.eclipse + emf-gwt + 2.9.0-SNAPSHOT + ../../releng/org.eclipse.emf.gwt.parent/pom.xml + + + + + org.eclipse + org.eclipse.emf.gwt.common + 2.9.0-SNAPSHOT + + + + + + + src + + **/*.java + **/*.gwt.xml + + + + + \ No newline at end of file diff --git a/plugins/org.eclipse.emf.gwt.ecore/src/org/eclipse/emf/ecore/EcorePackage.java b/plugins/org.eclipse.emf.gwt.ecore/src/org/eclipse/emf/ecore/EcorePackage.java index 00bb9c86d..40c762dfd 100644 --- a/plugins/org.eclipse.emf.gwt.ecore/src/org/eclipse/emf/ecore/EcorePackage.java +++ b/plugins/org.eclipse.emf.gwt.ecore/src/org/eclipse/emf/ecore/EcorePackage.java @@ -2867,6 +2867,26 @@ public interface EcorePackage extends EPackage */ int ETYPE_PARAMETER_OPERATION_COUNT = ENAMED_ELEMENT_OPERATION_COUNT + 0; + /** + * The meta object id for the 'EBig Decimal' data type. + * + * + * @see java.math.BigDecimal + * @see org.eclipse.emf.ecore.impl.EcorePackageImpl#getEBigDecimal() + * @generated + */ + int EBIG_DECIMAL = 20; + + /** + * The meta object id for the 'EBig Integer' data type. + * + * + * @see java.math.BigInteger + * @see org.eclipse.emf.ecore.impl.EcorePackageImpl#getEBigInteger() + * @generated + */ + int EBIG_INTEGER = 21; + /** * The meta object id for the 'EE List' data type. * @@ -2875,7 +2895,7 @@ public interface EcorePackage extends EPackage * @see org.eclipse.emf.ecore.impl.EcorePackageImpl#getEEList() * @generated */ - int EE_LIST = 31; + int EE_LIST = 33; /** * The meta object id for the 'EResource' data type. @@ -2885,7 +2905,7 @@ public interface EcorePackage extends EPackage * @see org.eclipse.emf.ecore.impl.EcorePackageImpl#getEResource() * @generated */ - int ERESOURCE = 44; + int ERESOURCE = 46; /** * The meta object id for the 'EResource Set' data type. @@ -2895,7 +2915,7 @@ public interface EcorePackage extends EPackage * @see org.eclipse.emf.ecore.impl.EcorePackageImpl#getEResourceSet() * @generated */ - int ERESOURCE_SET = 45; + int ERESOURCE_SET = 47; /** * The meta object id for the 'EBoolean Object' data type. @@ -2905,7 +2925,7 @@ public interface EcorePackage extends EPackage * @see org.eclipse.emf.ecore.impl.EcorePackageImpl#getEBooleanObject() * @generated */ - int EBOOLEAN_OBJECT = 21; + int EBOOLEAN_OBJECT = 23; /** * The meta object id for the 'ECharacter Object' data type. @@ -2915,7 +2935,7 @@ public interface EcorePackage extends EPackage * @see org.eclipse.emf.ecore.impl.EcorePackageImpl#getECharacterObject() * @generated */ - int ECHARACTER_OBJECT = 26; + int ECHARACTER_OBJECT = 28; /** * The meta object id for the 'EDate' data type. @@ -2925,7 +2945,7 @@ public interface EcorePackage extends EPackage * @see org.eclipse.emf.ecore.impl.EcorePackageImpl#getEDate() * @generated */ - int EDATE = 27; + int EDATE = 29; /** * The meta object id for the 'EDiagnostic Chain' data type. @@ -2935,7 +2955,7 @@ public interface EcorePackage extends EPackage * @see org.eclipse.emf.ecore.impl.EcorePackageImpl#getEDiagnosticChain() * @generated */ - int EDIAGNOSTIC_CHAIN = 28; + int EDIAGNOSTIC_CHAIN = 30; /** * The meta object id for the 'EDouble Object' data type. @@ -2945,7 +2965,7 @@ public interface EcorePackage extends EPackage * @see org.eclipse.emf.ecore.impl.EcorePackageImpl#getEDoubleObject() * @generated */ - int EDOUBLE_OBJECT = 30; + int EDOUBLE_OBJECT = 32; /** * The meta object id for the 'EFloat Object' data type. @@ -2955,7 +2975,7 @@ public interface EcorePackage extends EPackage * @see org.eclipse.emf.ecore.impl.EcorePackageImpl#getEFloatObject() * @generated */ - int EFLOAT_OBJECT = 36; + int EFLOAT_OBJECT = 38; /** * The meta object id for the 'EInteger Object' data type. @@ -2965,7 +2985,7 @@ public interface EcorePackage extends EPackage * @see org.eclipse.emf.ecore.impl.EcorePackageImpl#getEIntegerObject() * @generated */ - int EINTEGER_OBJECT = 38; + int EINTEGER_OBJECT = 40; /** * The meta object id for the 'EBoolean' data type. @@ -2974,7 +2994,7 @@ public interface EcorePackage extends EPackage * @see org.eclipse.emf.ecore.impl.EcorePackageImpl#getEBoolean() * @generated */ - int EBOOLEAN = 20; + int EBOOLEAN = 22; /** * The meta object id for the 'EByte Object' data type. @@ -2984,7 +3004,7 @@ public interface EcorePackage extends EPackage * @see org.eclipse.emf.ecore.impl.EcorePackageImpl#getEByteObject() * @generated */ - int EBYTE_OBJECT = 24; + int EBYTE_OBJECT = 26; /** * The meta object id for the 'EByte' data type. @@ -2993,7 +3013,7 @@ public interface EcorePackage extends EPackage * @see org.eclipse.emf.ecore.impl.EcorePackageImpl#getEByte() * @generated */ - int EBYTE = 22; + int EBYTE = 24; /** * The meta object id for the 'EByte Array' data type. @@ -3002,7 +3022,7 @@ public interface EcorePackage extends EPackage * @see org.eclipse.emf.ecore.impl.EcorePackageImpl#getEByteArray() * @generated */ - int EBYTE_ARRAY = 23; + int EBYTE_ARRAY = 25; /** * The meta object id for the 'EChar' data type. @@ -3011,7 +3031,7 @@ public interface EcorePackage extends EPackage * @see org.eclipse.emf.ecore.impl.EcorePackageImpl#getEChar() * @generated */ - int ECHAR = 25; + int ECHAR = 27; /** * The meta object id for the 'EDouble' data type. @@ -3020,7 +3040,7 @@ public interface EcorePackage extends EPackage * @see org.eclipse.emf.ecore.impl.EcorePackageImpl#getEDouble() * @generated */ - int EDOUBLE = 29; + int EDOUBLE = 31; /** * The meta object id for the 'EFloat' data type. @@ -3029,7 +3049,7 @@ public interface EcorePackage extends EPackage * @see org.eclipse.emf.ecore.impl.EcorePackageImpl#getEFloat() * @generated */ - int EFLOAT = 35; + int EFLOAT = 37; /** * The meta object id for the 'EInt' data type. @@ -3038,7 +3058,7 @@ public interface EcorePackage extends EPackage * @see org.eclipse.emf.ecore.impl.EcorePackageImpl#getEInt() * @generated */ - int EINT = 37; + int EINT = 39; /** * The meta object id for the 'EJava Class' data type. @@ -3048,7 +3068,7 @@ public interface EcorePackage extends EPackage * @see org.eclipse.emf.ecore.impl.EcorePackageImpl#getEJavaClass() * @generated */ - int EJAVA_CLASS = 39; + int EJAVA_CLASS = 41; /** * The meta object id for the 'EJava Object' data type. @@ -3058,7 +3078,7 @@ public interface EcorePackage extends EPackage * @see org.eclipse.emf.ecore.impl.EcorePackageImpl#getEJavaObject() * @generated */ - int EJAVA_OBJECT = 40; + int EJAVA_OBJECT = 42; /** * The meta object id for the 'ELong Object' data type. @@ -3068,7 +3088,7 @@ public interface EcorePackage extends EPackage * @see org.eclipse.emf.ecore.impl.EcorePackageImpl#getELongObject() * @generated */ - int ELONG_OBJECT = 42; + int ELONG_OBJECT = 44; /** * The meta object id for the 'EMap' data type. @@ -3078,7 +3098,7 @@ public interface EcorePackage extends EPackage * @see org.eclipse.emf.ecore.impl.EcorePackageImpl#getEMap() * @generated */ - int EMAP = 43; + int EMAP = 45; /** * The meta object id for the 'EShort Object' data type. @@ -3088,7 +3108,7 @@ public interface EcorePackage extends EPackage * @see org.eclipse.emf.ecore.impl.EcorePackageImpl#getEShortObject() * @generated */ - int ESHORT_OBJECT = 47; + int ESHORT_OBJECT = 49; /** * The meta object id for the 'ELong' data type. @@ -3097,7 +3117,7 @@ public interface EcorePackage extends EPackage * @see org.eclipse.emf.ecore.impl.EcorePackageImpl#getELong() * @generated */ - int ELONG = 41; + int ELONG = 43; /** * The meta object id for the 'EShort' data type. @@ -3106,7 +3126,7 @@ public interface EcorePackage extends EPackage * @see org.eclipse.emf.ecore.impl.EcorePackageImpl#getEShort() * @generated */ - int ESHORT = 46; + int ESHORT = 48; /** * The meta object id for the 'ETree Iterator' data type. @@ -3116,7 +3136,7 @@ public interface EcorePackage extends EPackage * @see org.eclipse.emf.ecore.impl.EcorePackageImpl#getETreeIterator() * @generated */ - int ETREE_ITERATOR = 49; + int ETREE_ITERATOR = 51; /** @@ -3127,7 +3147,7 @@ public interface EcorePackage extends EPackage * @see org.eclipse.emf.ecore.impl.EcorePackageImpl#getEInvocationTargetException() * @generated */ - int EINVOCATION_TARGET_EXCEPTION = 50; + int EINVOCATION_TARGET_EXCEPTION = 52; /** * The meta object id for the 'EFeature Map Entry' data type. @@ -3137,7 +3157,7 @@ public interface EcorePackage extends EPackage * @see org.eclipse.emf.ecore.impl.EcorePackageImpl#getEFeatureMapEntry() * @generated */ - int EFEATURE_MAP_ENTRY = 34; + int EFEATURE_MAP_ENTRY = 36; /** @@ -3148,7 +3168,7 @@ public interface EcorePackage extends EPackage * @see org.eclipse.emf.ecore.impl.EcorePackageImpl#getEEnumerator() * @generated */ - int EENUMERATOR = 32; + int EENUMERATOR = 34; /** @@ -3159,7 +3179,7 @@ public interface EcorePackage extends EPackage * @see org.eclipse.emf.ecore.impl.EcorePackageImpl#getEFeatureMap() * @generated */ - int EFEATURE_MAP = 33; + int EFEATURE_MAP = 35; /** * The meta object id for the 'EString' data type. @@ -3169,7 +3189,7 @@ public interface EcorePackage extends EPackage * @see org.eclipse.emf.ecore.impl.EcorePackageImpl#getEString() * @generated */ - int ESTRING = 48; + int ESTRING = 50; /** @@ -4680,6 +4700,30 @@ public interface EcorePackage extends EPackage */ EReference getETypeParameter_EBounds(); + /** + * Returns the meta object for data type '{@link java.math.BigDecimal EBig Decimal}'. + * + * + * @return the meta object for data type 'EBig Decimal'. + * @see java.math.BigDecimal + * @model instanceClass="java.math.BigDecimal" + * extendedMetaData="baseType='http://www.w3.org/2001/XMLSchema#decimal'" + * @generated + */ + EDataType getEBigDecimal(); + + /** + * Returns the meta object for data type '{@link java.math.BigInteger EBig Integer}'. + * + * + * @return the meta object for data type 'EBig Integer'. + * @see java.math.BigInteger + * @model instanceClass="java.math.BigInteger" + * extendedMetaData="baseType='http://www.w3.org/2001/XMLSchema#integer'" + * @generated + */ + EDataType getEBigInteger(); + /** * Returns the meta object for data type '{@link org.eclipse.emf.common.util.EList EE List}'. * @@ -6204,6 +6248,24 @@ interface Literals */ EReference ETYPE_PARAMETER__EBOUNDS = eINSTANCE.getETypeParameter_EBounds(); + /** + * The meta object literal for the 'EBig Decimal' data type. + * + * + * @see org.eclipse.emf.ecore.impl.EcorePackageImpl#getEBoolean() + * @generated + */ + EDataType EBIG_DECIMAL = eINSTANCE.getEBigDecimal(); + + /** + * The meta object literal for the 'EBig Integer' data type. + * + * + * @see org.eclipse.emf.ecore.impl.EcorePackageImpl#getEBoolean() + * @generated + */ + EDataType EBIG_INTEGER = eINSTANCE.getEBigInteger(); + /** * The meta object literal for the 'EBoolean' data type. * diff --git a/plugins/org.eclipse.emf.gwt.ecore/src/org/eclipse/emf/ecore/impl/EcoreFactoryImpl.java b/plugins/org.eclipse.emf.gwt.ecore/src/org/eclipse/emf/ecore/impl/EcoreFactoryImpl.java index 39cad3558..909c3e2c6 100644 --- a/plugins/org.eclipse.emf.gwt.ecore/src/org/eclipse/emf/ecore/impl/EcoreFactoryImpl.java +++ b/plugins/org.eclipse.emf.gwt.ecore/src/org/eclipse/emf/ecore/impl/EcoreFactoryImpl.java @@ -12,6 +12,8 @@ package org.eclipse.emf.ecore.impl; +import java.math.BigDecimal; +import java.math.BigInteger; import java.util.Date; import java.util.Map; @@ -104,6 +106,10 @@ public Object createFromString(EDataType eDataType, String initialValue) { switch (eDataType.getClassifierID()) { + case EcorePackage.EBIG_DECIMAL: + return createEBigDecimalFromString(eDataType, initialValue); + case EcorePackage.EBIG_INTEGER: + return createEBigIntegerFromString(eDataType, initialValue); case EcorePackage.EBOOLEAN: return createEBooleanFromString(eDataType, initialValue); case EcorePackage.EBOOLEAN_OBJECT: @@ -161,6 +167,10 @@ public String convertToString(EDataType eDataType, Object instanceValue) { switch (eDataType.getClassifierID()) { + case EcorePackage.EBIG_DECIMAL: + return convertEBigDecimalToString(eDataType, instanceValue); + case EcorePackage.EBIG_INTEGER: + return convertEBigIntegerToString(eDataType, instanceValue); case EcorePackage.EBOOLEAN: return convertEBooleanToString(eDataType, instanceValue); case EcorePackage.EBOOLEAN_OBJECT: @@ -553,6 +563,42 @@ public ETypeParameter createETypeParameter() return eTypeParameter; } + /** + * + * + * @generated + */ + public BigDecimal createEBigDecimalFromString(EDataType eDataType, String initialValue) { + return initialValue == null ? null : new BigDecimal(initialValue); + } + + /** + * + * + * @generated + */ + public String convertEBigDecimalToString(EDataType eDataType, Object instanceValue) { + return instanceValue == null ? null : instanceValue.toString(); + } + + /** + * + * + * @generated + */ + public BigInteger createEBigIntegerFromString(EDataType eDataType, String initialValue) { + return initialValue == null ? null : new BigInteger(initialValue); + } + + /** + * + * + * @generated + */ + public String convertEBigIntegerToString(EDataType eDataType, Object instanceValue) { + return instanceValue == null ? null : instanceValue.toString(); + } + /** * * diff --git a/plugins/org.eclipse.emf.gwt.ecore/src/org/eclipse/emf/ecore/impl/EcorePackageImpl.java b/plugins/org.eclipse.emf.gwt.ecore/src/org/eclipse/emf/ecore/impl/EcorePackageImpl.java index da45bee9e..5eab6f7c9 100644 --- a/plugins/org.eclipse.emf.gwt.ecore/src/org/eclipse/emf/ecore/impl/EcorePackageImpl.java +++ b/plugins/org.eclipse.emf.gwt.ecore/src/org/eclipse/emf/ecore/impl/EcorePackageImpl.java @@ -15,6 +15,8 @@ import com.google.gwt.user.client.rpc.IsSerializable; import java.io.IOException; +import java.math.BigDecimal; +import java.math.BigInteger; import java.util.ArrayList; import java.util.Date; import java.util.Map; @@ -229,6 +231,20 @@ private EcorePackageImpl() */ private EClass eTypeParameterEClass = null; + /** + * + * + * @generated + */ + private EDataType eBigDecimalEDataType = null; + + /** + * + * + * @generated + */ + private EDataType eBigIntegerEDataType = null; + /** * * @@ -779,6 +795,34 @@ public Object newArrayInstance(int size) return new ETypeParameter[size]; } }); + Reflect.register + (BigDecimal.class, + new Reflect.Helper() + { + public boolean isInstance(Object instance) + { + return instance instanceof BigDecimal; + } + + public Object newArrayInstance(int size) + { + return new BigDecimal[size]; + } + }); + Reflect.register + (BigInteger.class, + new Reflect.Helper() + { + public boolean isInstance(Object instance) + { + return instance instanceof BigInteger; + } + + public Object newArrayInstance(int size) + { + return new BigInteger[size]; + } + }); Reflect.register (Boolean.class, new Reflect.Helper() @@ -1258,6 +1302,20 @@ public static class WhiteList implements IsSerializable, EBasicWhiteList */ protected ETypeParameter eTypeParameter; + /** + * + * + * @generated + */ + protected BigDecimal eBigDecimal; + + /** + * + * + * @generated + */ + protected BigInteger eBigInteger; + /** * * @@ -2557,6 +2615,26 @@ public EReference getETypeParameter_EBounds() return (EReference)eTypeParameterEClass.getEStructuralFeatures().get(0); } + /** + * + * + * @generated + */ + public EDataType getEBigDecimal() + { + return eBigDecimalEDataType; + } + + /** + * + * + * @generated + */ + public EDataType getEBigInteger() + { + return eBigIntegerEDataType; + } + /** * * @@ -3317,6 +3395,8 @@ public void createPackageContents() createEReference(eTypeParameterEClass, ETYPE_PARAMETER__EBOUNDS); // Create data types + eBigDecimalEDataType = createEDataType(EBIG_DECIMAL); + eBigIntegerEDataType = createEDataType(EBIG_INTEGER); eBooleanEDataType = createEDataType(EBOOLEAN); eBooleanObjectEDataType = createEDataType(EBOOLEAN_OBJECT); eByteEDataType = createEDataType(EBYTE); @@ -3651,6 +3731,8 @@ public void initializePackageContents() initEReference(getETypeParameter_EBounds(), this.getEGenericType(), null, "eBounds", null, 0, -1, ETypeParameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); // Initialize data types + initEDataType(eBigDecimalEDataType, BigDecimal.class, "EBigDecimal", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); + initEDataType(eBigIntegerEDataType, BigInteger.class, "EBigInteger", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); initEDataType(eBooleanEDataType, boolean.class, "EBoolean", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); initEDataType(eBooleanObjectEDataType, Boolean.class, "EBooleanObject", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); initEDataType(eByteEDataType, byte.class, "EByte", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); @@ -3791,6 +3873,20 @@ protected void createEcoreAnnotations() protected void createExtendedMetaDataAnnotations() { String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData"; + addAnnotation + (eBigDecimalEDataType, + source, + new String[] + { + "baseType", "http://www.w3.org/2001/XMLSchema#decimal" + }); + addAnnotation + (eBigIntegerEDataType, + source, + new String[] + { + "baseType", "http://www.w3.org/2001/XMLSchema#integer" + }); addAnnotation (eBooleanEDataType, source, diff --git a/plugins/org.eclipse.emf.gwt.ecore/src/org/eclipse/emf/ecore/util/EcoreValidator.java b/plugins/org.eclipse.emf.gwt.ecore/src/org/eclipse/emf/ecore/util/EcoreValidator.java index 115565723..71fb81709 100644 --- a/plugins/org.eclipse.emf.gwt.ecore/src/org/eclipse/emf/ecore/util/EcoreValidator.java +++ b/plugins/org.eclipse.emf.gwt.ecore/src/org/eclipse/emf/ecore/util/EcoreValidator.java @@ -11,6 +11,8 @@ */ package org.eclipse.emf.ecore.util; +import java.math.BigDecimal; +import java.math.BigInteger; import java.util.ArrayList; import java.util.Collection; import java.util.Date; @@ -435,6 +437,10 @@ protected boolean validate(int classifierID, Object value, DiagnosticChain diagn return validateEGenericType((EGenericType)value, diagnostics, context); case EcorePackage.ETYPE_PARAMETER: return validateETypeParameter((ETypeParameter)value, diagnostics, context); + case EcorePackage.EBIG_DECIMAL: + return validateEBigDecimal((BigDecimal)value, diagnostics, context); + case EcorePackage.EBIG_INTEGER: + return validateEBigInteger((BigInteger)value, diagnostics, context); case EcorePackage.EBOOLEAN: return validateEBoolean((Boolean)value, diagnostics, context); case EcorePackage.EBOOLEAN_OBJECT: @@ -4142,6 +4148,24 @@ public boolean validateETypeParameter(ETypeParameter eTypeParameter, DiagnosticC return result; } + /** + * + * + * @generated + */ + public boolean validateEBigDecimal(BigDecimal eBigDecimal, DiagnosticChain diagnostics, Map context) { + return true; + } + + /** + * + * + * @generated + */ + public boolean validateEBigInteger(BigInteger eBigInteger, DiagnosticChain diagnostics, Map context) { + return true; + } + /** * * diff --git a/plugins/org.eclipse.emf.gwt.edit.ui/pom.xml b/plugins/org.eclipse.emf.gwt.edit.ui/pom.xml new file mode 100644 index 000000000..3bb675f5f --- /dev/null +++ b/plugins/org.eclipse.emf.gwt.edit.ui/pom.xml @@ -0,0 +1,48 @@ + + + 4.0.0 + org.eclipse.emf.gwt.edit.ui + + org.eclipse + emf-gwt + 2.9.0-SNAPSHOT + ../../releng/org.eclipse.emf.gwt.parent/pom.xml + + + + + org.eclipse + org.eclipse.emf.gwt.common + 2.9.0-SNAPSHOT + + + org.eclipse + org.eclipse.emf.gwt.ecore + 2.9.0-SNAPSHOT + + + org.eclipse + org.eclipse.emf.gwt.ecore.change + 2.9.0-SNAPSHOT + + + org.eclipse + org.eclipse.emf.gwt.edit + 2.9.0-SNAPSHOT + + + + + + + src + + **/*.java + **/*.gwt.xml + + + + + + \ No newline at end of file diff --git a/plugins/org.eclipse.emf.gwt.edit/pom.xml b/plugins/org.eclipse.emf.gwt.edit/pom.xml new file mode 100644 index 000000000..36de19ebd --- /dev/null +++ b/plugins/org.eclipse.emf.gwt.edit/pom.xml @@ -0,0 +1,43 @@ + + + 4.0.0 + org.eclipse.emf.gwt.edit + + org.eclipse + emf-gwt + 2.9.0-SNAPSHOT + ../../releng/org.eclipse.emf.gwt.parent/pom.xml + + + + + org.eclipse + org.eclipse.emf.gwt.common + 2.9.0-SNAPSHOT + + + org.eclipse + org.eclipse.emf.gwt.ecore + 2.9.0-SNAPSHOT + + + org.eclipse + org.eclipse.emf.gwt.ecore.change + 2.9.0-SNAPSHOT + + + + + + + src + + **/*.java + **/*.gwt.xml + + + + + + \ No newline at end of file diff --git a/plugins/org.eclipse.emf.gwt/pom.xml b/plugins/org.eclipse.emf.gwt/pom.xml new file mode 100644 index 000000000..64e16a257 --- /dev/null +++ b/plugins/org.eclipse.emf.gwt/pom.xml @@ -0,0 +1,12 @@ + + + 4.0.0 + org.eclipse.emf.gwt + + org.eclipse + emf-gwt + 2.9.0-SNAPSHOT + ../../releng/org.eclipse.emf.gwt.parent/pom.xml + + \ No newline at end of file diff --git a/releng/org.eclipse.emf.gwt.parent/pom.xml b/releng/org.eclipse.emf.gwt.parent/pom.xml new file mode 100644 index 000000000..963584169 --- /dev/null +++ b/releng/org.eclipse.emf.gwt.parent/pom.xml @@ -0,0 +1,123 @@ + + + + 4.0.0 + org.eclipse + emf-gwt + pom + 2.9.0-SNAPSHOT + + + 2.5.1-rc1 + 1.7.5 + UTF-8 + /maven_repo/deploy/github + github + + + + ../../plugins/org.eclipse.emf.gwt.common + ../../plugins/org.eclipse.emf.gwt.ecore + ../../plugins/org.eclipse.emf.gwt.ecore.change + ../../plugins/org.eclipse.emf.gwt.edit + ../../plugins/org.eclipse.emf.gwt.edit.ui + ../../plugins/org.eclipse.emf.gwt.ecore.edit + + + + + com.google.gwt + gwt-user + ${gwtVersion} + provided + + + com.google.appengine + appengine + ${appEngineVersion} + pom + + + com.google.appengine + appengine-api-1.0-sdk + ${appEngineVersion} + + + + + src + + + + com.github.github + site-maven-plugin + 0.7 + + + Maven artifacts for ${project.version} + + true + + ${repository.directory} + + refs/heads/master + + **/* + + + maven-repository + + nloke + + + + + + site + + deploy + + + + + + + + + org.codehaus.mojo + gwt-maven-plugin + ${gwtVersion} + + + + resources + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.5 + 1.5 + + + + + + + + + github-release + file://${repository.directory}/release + + + github-snapshot + file://${repository.directory}/snapshot + + + +