blob: 1a3ada9f14270fb3fce2b1f41822a73527004702 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2009, 2019 Xored Software Inc and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-v20.html
*
* Contributors:
* Xored Software Inc - initial API and implementation and/or initial documentation
*******************************************************************************/
package org.eclipse.rcptt.ecl.data.commands.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.rcptt.ecl.core.impl.CommandImpl;
import org.eclipse.rcptt.ecl.data.commands.CommandsPackage;
import org.eclipse.rcptt.ecl.data.commands.ExcludeRows;
import org.eclipse.rcptt.ecl.data.commands.RowMatchMode;
import org.eclipse.rcptt.ecl.data.objects.Table;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Exclude Rows</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.rcptt.ecl.data.commands.impl.ExcludeRowsImpl#getTable <em>Table</em>}</li>
* <li>{@link org.eclipse.rcptt.ecl.data.commands.impl.ExcludeRowsImpl#getColumn <em>Column</em>}</li>
* <li>{@link org.eclipse.rcptt.ecl.data.commands.impl.ExcludeRowsImpl#getValue <em>Value</em>}</li>
* <li>{@link org.eclipse.rcptt.ecl.data.commands.impl.ExcludeRowsImpl#getMatch <em>Match</em>}</li>
* </ul>
*
* @generated
*/
public class ExcludeRowsImpl extends CommandImpl implements ExcludeRows {
/**
* The cached value of the '{@link #getTable() <em>Table</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTable()
* @generated
* @ordered
*/
protected Table table;
/**
* The default value of the '{@link #getColumn() <em>Column</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getColumn()
* @generated
* @ordered
*/
protected static final String COLUMN_EDEFAULT = null;
/**
* The cached value of the '{@link #getColumn() <em>Column</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getColumn()
* @generated
* @ordered
*/
protected String column = COLUMN_EDEFAULT;
/**
* The default value of the '{@link #getValue() <em>Value</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getValue()
* @generated
* @ordered
*/
protected static final String VALUE_EDEFAULT = null;
/**
* The cached value of the '{@link #getValue() <em>Value</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getValue()
* @generated
* @ordered
*/
protected String value = VALUE_EDEFAULT;
/**
* The default value of the '{@link #getMatch() <em>Match</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMatch()
* @generated
* @ordered
*/
protected static final RowMatchMode MATCH_EDEFAULT = RowMatchMode.EXACT;
/**
* The cached value of the '{@link #getMatch() <em>Match</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMatch()
* @generated
* @ordered
*/
protected RowMatchMode match = MATCH_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ExcludeRowsImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return CommandsPackage.Literals.EXCLUDE_ROWS;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Table getTable() {
if (table != null && table.eIsProxy()) {
InternalEObject oldTable = (InternalEObject)table;
table = (Table)eResolveProxy(oldTable);
if (table != oldTable) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, CommandsPackage.EXCLUDE_ROWS__TABLE, oldTable, table));
}
}
return table;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Table basicGetTable() {
return table;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setTable(Table newTable) {
Table oldTable = table;
table = newTable;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, CommandsPackage.EXCLUDE_ROWS__TABLE, oldTable, table));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getColumn() {
return column;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setColumn(String newColumn) {
String oldColumn = column;
column = newColumn;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, CommandsPackage.EXCLUDE_ROWS__COLUMN, oldColumn, column));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getValue() {
return value;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setValue(String newValue) {
String oldValue = value;
value = newValue;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, CommandsPackage.EXCLUDE_ROWS__VALUE, oldValue, value));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public RowMatchMode getMatch() {
return match;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setMatch(RowMatchMode newMatch) {
RowMatchMode oldMatch = match;
match = newMatch == null ? MATCH_EDEFAULT : newMatch;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, CommandsPackage.EXCLUDE_ROWS__MATCH, oldMatch, match));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case CommandsPackage.EXCLUDE_ROWS__TABLE:
if (resolve) return getTable();
return basicGetTable();
case CommandsPackage.EXCLUDE_ROWS__COLUMN:
return getColumn();
case CommandsPackage.EXCLUDE_ROWS__VALUE:
return getValue();
case CommandsPackage.EXCLUDE_ROWS__MATCH:
return getMatch();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case CommandsPackage.EXCLUDE_ROWS__TABLE:
setTable((Table)newValue);
return;
case CommandsPackage.EXCLUDE_ROWS__COLUMN:
setColumn((String)newValue);
return;
case CommandsPackage.EXCLUDE_ROWS__VALUE:
setValue((String)newValue);
return;
case CommandsPackage.EXCLUDE_ROWS__MATCH:
setMatch((RowMatchMode)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case CommandsPackage.EXCLUDE_ROWS__TABLE:
setTable((Table)null);
return;
case CommandsPackage.EXCLUDE_ROWS__COLUMN:
setColumn(COLUMN_EDEFAULT);
return;
case CommandsPackage.EXCLUDE_ROWS__VALUE:
setValue(VALUE_EDEFAULT);
return;
case CommandsPackage.EXCLUDE_ROWS__MATCH:
setMatch(MATCH_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case CommandsPackage.EXCLUDE_ROWS__TABLE:
return table != null;
case CommandsPackage.EXCLUDE_ROWS__COLUMN:
return COLUMN_EDEFAULT == null ? column != null : !COLUMN_EDEFAULT.equals(column);
case CommandsPackage.EXCLUDE_ROWS__VALUE:
return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value);
case CommandsPackage.EXCLUDE_ROWS__MATCH:
return match != MATCH_EDEFAULT;
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (column: ");
result.append(column);
result.append(", value: ");
result.append(value);
result.append(", match: ");
result.append(match);
result.append(')');
return result.toString();
}
} //ExcludeRowsImpl