blob: 26f62d2e254dac6c910690b107cf50044874b9d4 [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 v1.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.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.WriteLines;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Write Lines</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.rcptt.ecl.data.commands.impl.WriteLinesImpl#getUri <em>Uri</em>}</li>
* <li>{@link org.eclipse.rcptt.ecl.data.commands.impl.WriteLinesImpl#isAppend <em>Append</em>}</li>
* <li>{@link org.eclipse.rcptt.ecl.data.commands.impl.WriteLinesImpl#getEncode <em>Encode</em>}</li>
* </ul>
*
* @generated
*/
public class WriteLinesImpl extends CommandImpl implements WriteLines {
/**
* The default value of the '{@link #getUri() <em>Uri</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getUri()
* @generated
* @ordered
*/
protected static final String URI_EDEFAULT = "UTF-8";
/**
* The cached value of the '{@link #getUri() <em>Uri</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getUri()
* @generated
* @ordered
*/
protected String uri = URI_EDEFAULT;
/**
* The default value of the '{@link #isAppend() <em>Append</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isAppend()
* @generated
* @ordered
*/
protected static final boolean APPEND_EDEFAULT = false;
/**
* The cached value of the '{@link #isAppend() <em>Append</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isAppend()
* @generated
* @ordered
*/
protected boolean append = APPEND_EDEFAULT;
/**
* The default value of the '{@link #getEncode() <em>Encode</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getEncode()
* @generated
* @ordered
*/
protected static final String ENCODE_EDEFAULT = null;
/**
* The cached value of the '{@link #getEncode() <em>Encode</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getEncode()
* @generated
* @ordered
*/
protected String encode = ENCODE_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected WriteLinesImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return CommandsPackage.Literals.WRITE_LINES;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getUri() {
return uri;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setUri(String newUri) {
String oldUri = uri;
uri = newUri;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, CommandsPackage.WRITE_LINES__URI, oldUri, uri));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isAppend() {
return append;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setAppend(boolean newAppend) {
boolean oldAppend = append;
append = newAppend;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, CommandsPackage.WRITE_LINES__APPEND, oldAppend, append));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getEncode() {
return encode;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setEncode(String newEncode) {
String oldEncode = encode;
encode = newEncode;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, CommandsPackage.WRITE_LINES__ENCODE, oldEncode, encode));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case CommandsPackage.WRITE_LINES__URI:
return getUri();
case CommandsPackage.WRITE_LINES__APPEND:
return isAppend();
case CommandsPackage.WRITE_LINES__ENCODE:
return getEncode();
}
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.WRITE_LINES__URI:
setUri((String)newValue);
return;
case CommandsPackage.WRITE_LINES__APPEND:
setAppend((Boolean)newValue);
return;
case CommandsPackage.WRITE_LINES__ENCODE:
setEncode((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case CommandsPackage.WRITE_LINES__URI:
setUri(URI_EDEFAULT);
return;
case CommandsPackage.WRITE_LINES__APPEND:
setAppend(APPEND_EDEFAULT);
return;
case CommandsPackage.WRITE_LINES__ENCODE:
setEncode(ENCODE_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case CommandsPackage.WRITE_LINES__URI:
return URI_EDEFAULT == null ? uri != null : !URI_EDEFAULT.equals(uri);
case CommandsPackage.WRITE_LINES__APPEND:
return append != APPEND_EDEFAULT;
case CommandsPackage.WRITE_LINES__ENCODE:
return ENCODE_EDEFAULT == null ? encode != null : !ENCODE_EDEFAULT.equals(encode);
}
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(" (uri: ");
result.append(uri);
result.append(", append: ");
result.append(append);
result.append(", encode: ");
result.append(encode);
result.append(')');
return result.toString();
}
} //WriteLinesImpl