blob: 327e86f2c10ba6550def1d2da22f543063e5e5a9 [file] [log] [blame]
/**
* Copyright (c) 2011, 2015 - Lunifera GmbH (Gross Enzersdorf, Austria), Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
* 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:
* Florian Pirchner - Initial implementation
*/
package org.eclipse.osbp.ecview.semantic.uimodel.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
import org.eclipse.osbp.ecview.semantic.uimodel.UiErrorCode;
import org.eclipse.osbp.ecview.semantic.uimodel.UiI18nInfo;
import org.eclipse.osbp.ecview.semantic.uimodel.UiI18nInfoable;
import org.eclipse.osbp.ecview.semantic.uimodel.UiModelPackage;
import org.eclipse.osbp.ecview.semantic.uimodel.UiRegexpValidator;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Ui Regexp Validator</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.osbp.ecview.semantic.uimodel.impl.UiRegexpValidatorImpl#getId <em>Id</em>}</li>
* <li>{@link org.eclipse.osbp.ecview.semantic.uimodel.impl.UiRegexpValidatorImpl#getName <em>Name</em>}</li>
* <li>{@link org.eclipse.osbp.ecview.semantic.uimodel.impl.UiRegexpValidatorImpl#getI18nInfo <em>I1 8n Info</em>}</li>
* <li>{@link org.eclipse.osbp.ecview.semantic.uimodel.impl.UiRegexpValidatorImpl#getRegExpression <em>Reg Expression</em>}</li>
* <li>{@link org.eclipse.osbp.ecview.semantic.uimodel.impl.UiRegexpValidatorImpl#getErrorCode <em>Error Code</em>}</li>
* </ul>
*
* @generated
*/
public class UiRegexpValidatorImpl extends MinimalEObjectImpl.Container implements UiRegexpValidator {
/**
* The default value of the '{@link #getId() <em>Id</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getId()
* @generated
* @ordered
*/
protected static final String ID_EDEFAULT = null;
/**
* The cached value of the '{@link #getId() <em>Id</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getId()
* @generated
* @ordered
*/
protected String id = ID_EDEFAULT;
/**
* The default value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected static final String NAME_EDEFAULT = null;
/**
* The cached value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected String name = NAME_EDEFAULT;
/**
* The cached value of the '{@link #getI18nInfo() <em>I1 8n Info</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getI18nInfo()
* @generated
* @ordered
*/
protected UiI18nInfo i18nInfo;
/**
* The default value of the '{@link #getRegExpression() <em>Reg Expression</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getRegExpression()
* @generated
* @ordered
*/
protected static final String REG_EXPRESSION_EDEFAULT = null;
/**
* The cached value of the '{@link #getRegExpression() <em>Reg Expression</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getRegExpression()
* @generated
* @ordered
*/
protected String regExpression = REG_EXPRESSION_EDEFAULT;
/**
* The cached value of the '{@link #getErrorCode() <em>Error Code</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getErrorCode()
* @generated
* @ordered
*/
protected UiErrorCode errorCode;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected UiRegexpValidatorImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return UiModelPackage.Literals.UI_REGEXP_VALIDATOR;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getId() {
return id;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setId(String newId) {
String oldId = id;
id = newId;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, UiModelPackage.UI_REGEXP_VALIDATOR__ID, oldId, id));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getName() {
return name;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setName(String newName) {
String oldName = name;
name = newName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, UiModelPackage.UI_REGEXP_VALIDATOR__NAME, oldName, name));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public UiI18nInfo getI18nInfo() {
if (i18nInfo != null && i18nInfo.eIsProxy()) {
InternalEObject oldI18nInfo = (InternalEObject)i18nInfo;
i18nInfo = (UiI18nInfo)eResolveProxy(oldI18nInfo);
if (i18nInfo != oldI18nInfo) {
InternalEObject newI18nInfo = (InternalEObject)i18nInfo;
NotificationChain msgs = oldI18nInfo.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - UiModelPackage.UI_REGEXP_VALIDATOR__I18N_INFO, null, null);
if (newI18nInfo.eInternalContainer() == null) {
msgs = newI18nInfo.eInverseAdd(this, EOPPOSITE_FEATURE_BASE - UiModelPackage.UI_REGEXP_VALIDATOR__I18N_INFO, null, msgs);
}
if (msgs != null) msgs.dispatch();
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, UiModelPackage.UI_REGEXP_VALIDATOR__I18N_INFO, oldI18nInfo, i18nInfo));
}
}
return i18nInfo;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public UiI18nInfo basicGetI18nInfo() {
return i18nInfo;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetI18nInfo(UiI18nInfo newI18nInfo, NotificationChain msgs) {
UiI18nInfo oldI18nInfo = i18nInfo;
i18nInfo = newI18nInfo;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, UiModelPackage.UI_REGEXP_VALIDATOR__I18N_INFO, oldI18nInfo, newI18nInfo);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setI18nInfo(UiI18nInfo newI18nInfo) {
if (newI18nInfo != i18nInfo) {
NotificationChain msgs = null;
if (i18nInfo != null)
msgs = ((InternalEObject)i18nInfo).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - UiModelPackage.UI_REGEXP_VALIDATOR__I18N_INFO, null, msgs);
if (newI18nInfo != null)
msgs = ((InternalEObject)newI18nInfo).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - UiModelPackage.UI_REGEXP_VALIDATOR__I18N_INFO, null, msgs);
msgs = basicSetI18nInfo(newI18nInfo, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, UiModelPackage.UI_REGEXP_VALIDATOR__I18N_INFO, newI18nInfo, newI18nInfo));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getRegExpression() {
return regExpression;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setRegExpression(String newRegExpression) {
String oldRegExpression = regExpression;
regExpression = newRegExpression;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, UiModelPackage.UI_REGEXP_VALIDATOR__REG_EXPRESSION, oldRegExpression, regExpression));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public UiErrorCode getErrorCode() {
if (errorCode != null && errorCode.eIsProxy()) {
InternalEObject oldErrorCode = (InternalEObject)errorCode;
errorCode = (UiErrorCode)eResolveProxy(oldErrorCode);
if (errorCode != oldErrorCode) {
InternalEObject newErrorCode = (InternalEObject)errorCode;
NotificationChain msgs = oldErrorCode.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - UiModelPackage.UI_REGEXP_VALIDATOR__ERROR_CODE, null, null);
if (newErrorCode.eInternalContainer() == null) {
msgs = newErrorCode.eInverseAdd(this, EOPPOSITE_FEATURE_BASE - UiModelPackage.UI_REGEXP_VALIDATOR__ERROR_CODE, null, msgs);
}
if (msgs != null) msgs.dispatch();
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, UiModelPackage.UI_REGEXP_VALIDATOR__ERROR_CODE, oldErrorCode, errorCode));
}
}
return errorCode;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public UiErrorCode basicGetErrorCode() {
return errorCode;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetErrorCode(UiErrorCode newErrorCode, NotificationChain msgs) {
UiErrorCode oldErrorCode = errorCode;
errorCode = newErrorCode;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, UiModelPackage.UI_REGEXP_VALIDATOR__ERROR_CODE, oldErrorCode, newErrorCode);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setErrorCode(UiErrorCode newErrorCode) {
if (newErrorCode != errorCode) {
NotificationChain msgs = null;
if (errorCode != null)
msgs = ((InternalEObject)errorCode).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - UiModelPackage.UI_REGEXP_VALIDATOR__ERROR_CODE, null, msgs);
if (newErrorCode != null)
msgs = ((InternalEObject)newErrorCode).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - UiModelPackage.UI_REGEXP_VALIDATOR__ERROR_CODE, null, msgs);
msgs = basicSetErrorCode(newErrorCode, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, UiModelPackage.UI_REGEXP_VALIDATOR__ERROR_CODE, newErrorCode, newErrorCode));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case UiModelPackage.UI_REGEXP_VALIDATOR__I18N_INFO:
return basicSetI18nInfo(null, msgs);
case UiModelPackage.UI_REGEXP_VALIDATOR__ERROR_CODE:
return basicSetErrorCode(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case UiModelPackage.UI_REGEXP_VALIDATOR__ID:
return getId();
case UiModelPackage.UI_REGEXP_VALIDATOR__NAME:
return getName();
case UiModelPackage.UI_REGEXP_VALIDATOR__I18N_INFO:
if (resolve) return getI18nInfo();
return basicGetI18nInfo();
case UiModelPackage.UI_REGEXP_VALIDATOR__REG_EXPRESSION:
return getRegExpression();
case UiModelPackage.UI_REGEXP_VALIDATOR__ERROR_CODE:
if (resolve) return getErrorCode();
return basicGetErrorCode();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case UiModelPackage.UI_REGEXP_VALIDATOR__ID:
setId((String)newValue);
return;
case UiModelPackage.UI_REGEXP_VALIDATOR__NAME:
setName((String)newValue);
return;
case UiModelPackage.UI_REGEXP_VALIDATOR__I18N_INFO:
setI18nInfo((UiI18nInfo)newValue);
return;
case UiModelPackage.UI_REGEXP_VALIDATOR__REG_EXPRESSION:
setRegExpression((String)newValue);
return;
case UiModelPackage.UI_REGEXP_VALIDATOR__ERROR_CODE:
setErrorCode((UiErrorCode)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case UiModelPackage.UI_REGEXP_VALIDATOR__ID:
setId(ID_EDEFAULT);
return;
case UiModelPackage.UI_REGEXP_VALIDATOR__NAME:
setName(NAME_EDEFAULT);
return;
case UiModelPackage.UI_REGEXP_VALIDATOR__I18N_INFO:
setI18nInfo((UiI18nInfo)null);
return;
case UiModelPackage.UI_REGEXP_VALIDATOR__REG_EXPRESSION:
setRegExpression(REG_EXPRESSION_EDEFAULT);
return;
case UiModelPackage.UI_REGEXP_VALIDATOR__ERROR_CODE:
setErrorCode((UiErrorCode)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case UiModelPackage.UI_REGEXP_VALIDATOR__ID:
return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id);
case UiModelPackage.UI_REGEXP_VALIDATOR__NAME:
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
case UiModelPackage.UI_REGEXP_VALIDATOR__I18N_INFO:
return i18nInfo != null;
case UiModelPackage.UI_REGEXP_VALIDATOR__REG_EXPRESSION:
return REG_EXPRESSION_EDEFAULT == null ? regExpression != null : !REG_EXPRESSION_EDEFAULT.equals(regExpression);
case UiModelPackage.UI_REGEXP_VALIDATOR__ERROR_CODE:
return errorCode != null;
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) {
if (baseClass == UiI18nInfoable.class) {
switch (derivedFeatureID) {
case UiModelPackage.UI_REGEXP_VALIDATOR__I18N_INFO: return UiModelPackage.UI_I1_8N_INFOABLE__I18N_INFO;
default: return -1;
}
}
return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) {
if (baseClass == UiI18nInfoable.class) {
switch (baseFeatureID) {
case UiModelPackage.UI_I1_8N_INFOABLE__I18N_INFO: return UiModelPackage.UI_REGEXP_VALIDATOR__I18N_INFO;
default: return -1;
}
}
return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (id: ");
result.append(id);
result.append(", name: ");
result.append(name);
result.append(", regExpression: ");
result.append(regExpression);
result.append(')');
return result.toString();
}
} //UiRegexpValidatorImpl