/******************************************************************************* * Copyright (c) 2006-2012 * Software Technology Group, Dresden University of Technology * DevBoost GmbH, Berlin, Amtsgericht Charlottenburg, HRB 140026 * * 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: * Software Technology Group - TU Dresden, Germany; * DevBoost GmbH - Berlin, Germany * - initial API and implementation ******************************************************************************/ /** * <copyright> * </copyright> * * $Id$ */ package org.oasisopen.names.tc.opendocument.xmlns.text.impl; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.EObjectImpl; import org.oasisopen.names.tc.opendocument.xmlns.text.SectionSourceType; import org.oasisopen.names.tc.opendocument.xmlns.text.TextPackage; import org.w3.xlink.ShowType1; import org.w3.xlink.TypeType; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Section Source Type</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link org.oasisopen.names.tc.opendocument.xmlns.text.impl.SectionSourceTypeImpl#getFilterName <em>Filter Name</em>}</li> * <li>{@link org.oasisopen.names.tc.opendocument.xmlns.text.impl.SectionSourceTypeImpl#getHref <em>Href</em>}</li> * <li>{@link org.oasisopen.names.tc.opendocument.xmlns.text.impl.SectionSourceTypeImpl#getSectionName <em>Section Name</em>}</li> * <li>{@link org.oasisopen.names.tc.opendocument.xmlns.text.impl.SectionSourceTypeImpl#getShow <em>Show</em>}</li> * <li>{@link org.oasisopen.names.tc.opendocument.xmlns.text.impl.SectionSourceTypeImpl#getType <em>Type</em>}</li> * </ul> * </p> * * @generated */ public class SectionSourceTypeImpl extends EObjectImpl implements SectionSourceType { /** * The default value of the '{@link #getFilterName() <em>Filter Name</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getFilterName() * @generated * @ordered */ protected static final String FILTER_NAME_EDEFAULT = null; /** * The cached value of the '{@link #getFilterName() <em>Filter Name</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getFilterName() * @generated * @ordered */ protected String filterName = FILTER_NAME_EDEFAULT; /** * The default value of the '{@link #getHref() <em>Href</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getHref() * @generated * @ordered */ protected static final String HREF_EDEFAULT = null; /** * The cached value of the '{@link #getHref() <em>Href</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getHref() * @generated * @ordered */ protected String href = HREF_EDEFAULT; /** * The default value of the '{@link #getSectionName() <em>Section Name</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getSectionName() * @generated * @ordered */ protected static final String SECTION_NAME_EDEFAULT = null; /** * The cached value of the '{@link #getSectionName() <em>Section Name</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getSectionName() * @generated * @ordered */ protected String sectionName = SECTION_NAME_EDEFAULT; /** * The default value of the '{@link #getShow() <em>Show</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getShow() * @generated * @ordered */ protected static final ShowType1 SHOW_EDEFAULT = ShowType1.EMBED; /** * The cached value of the '{@link #getShow() <em>Show</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getShow() * @generated * @ordered */ protected ShowType1 show = SHOW_EDEFAULT; /** * This is true if the Show attribute has been set. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ protected boolean showESet; /** * The default value of the '{@link #getType() <em>Type</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getType() * @generated * @ordered */ protected static final TypeType TYPE_EDEFAULT = TypeType.SIMPLE; /** * The cached value of the '{@link #getType() <em>Type</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getType() * @generated * @ordered */ protected TypeType type = TYPE_EDEFAULT; /** * This is true if the Type attribute has been set. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ protected boolean typeESet; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected SectionSourceTypeImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return TextPackage.eINSTANCE.getSectionSourceType(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getFilterName() { return filterName; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setFilterName(String newFilterName) { String oldFilterName = filterName; filterName = newFilterName; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, TextPackage.SECTION_SOURCE_TYPE__FILTER_NAME, oldFilterName, filterName)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getHref() { return href; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setHref(String newHref) { String oldHref = href; href = newHref; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, TextPackage.SECTION_SOURCE_TYPE__HREF, oldHref, href)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getSectionName() { return sectionName; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setSectionName(String newSectionName) { String oldSectionName = sectionName; sectionName = newSectionName; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, TextPackage.SECTION_SOURCE_TYPE__SECTION_NAME, oldSectionName, sectionName)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public ShowType1 getShow() { return show; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setShow(ShowType1 newShow) { ShowType1 oldShow = show; show = newShow == null ? SHOW_EDEFAULT : newShow; boolean oldShowESet = showESet; showESet = true; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, TextPackage.SECTION_SOURCE_TYPE__SHOW, oldShow, show, !oldShowESet)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void unsetShow() { ShowType1 oldShow = show; boolean oldShowESet = showESet; show = SHOW_EDEFAULT; showESet = false; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.UNSET, TextPackage.SECTION_SOURCE_TYPE__SHOW, oldShow, SHOW_EDEFAULT, oldShowESet)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public boolean isSetShow() { return showESet; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public TypeType getType() { return type; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setType(TypeType newType) { TypeType oldType = type; type = newType == null ? TYPE_EDEFAULT : newType; boolean oldTypeESet = typeESet; typeESet = true; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, TextPackage.SECTION_SOURCE_TYPE__TYPE, oldType, type, !oldTypeESet)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void unsetType() { TypeType oldType = type; boolean oldTypeESet = typeESet; type = TYPE_EDEFAULT; typeESet = false; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.UNSET, TextPackage.SECTION_SOURCE_TYPE__TYPE, oldType, TYPE_EDEFAULT, oldTypeESet)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public boolean isSetType() { return typeESet; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case TextPackage.SECTION_SOURCE_TYPE__FILTER_NAME: return getFilterName(); case TextPackage.SECTION_SOURCE_TYPE__HREF: return getHref(); case TextPackage.SECTION_SOURCE_TYPE__SECTION_NAME: return getSectionName(); case TextPackage.SECTION_SOURCE_TYPE__SHOW: return getShow(); case TextPackage.SECTION_SOURCE_TYPE__TYPE: return getType(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case TextPackage.SECTION_SOURCE_TYPE__FILTER_NAME: setFilterName((String)newValue); return; case TextPackage.SECTION_SOURCE_TYPE__HREF: setHref((String)newValue); return; case TextPackage.SECTION_SOURCE_TYPE__SECTION_NAME: setSectionName((String)newValue); return; case TextPackage.SECTION_SOURCE_TYPE__SHOW: setShow((ShowType1)newValue); return; case TextPackage.SECTION_SOURCE_TYPE__TYPE: setType((TypeType)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case TextPackage.SECTION_SOURCE_TYPE__FILTER_NAME: setFilterName(FILTER_NAME_EDEFAULT); return; case TextPackage.SECTION_SOURCE_TYPE__HREF: setHref(HREF_EDEFAULT); return; case TextPackage.SECTION_SOURCE_TYPE__SECTION_NAME: setSectionName(SECTION_NAME_EDEFAULT); return; case TextPackage.SECTION_SOURCE_TYPE__SHOW: unsetShow(); return; case TextPackage.SECTION_SOURCE_TYPE__TYPE: unsetType(); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case TextPackage.SECTION_SOURCE_TYPE__FILTER_NAME: return FILTER_NAME_EDEFAULT == null ? filterName != null : !FILTER_NAME_EDEFAULT.equals(filterName); case TextPackage.SECTION_SOURCE_TYPE__HREF: return HREF_EDEFAULT == null ? href != null : !HREF_EDEFAULT.equals(href); case TextPackage.SECTION_SOURCE_TYPE__SECTION_NAME: return SECTION_NAME_EDEFAULT == null ? sectionName != null : !SECTION_NAME_EDEFAULT.equals(sectionName); case TextPackage.SECTION_SOURCE_TYPE__SHOW: return isSetShow(); case TextPackage.SECTION_SOURCE_TYPE__TYPE: return isSetType(); } 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(" (filterName: "); result.append(filterName); result.append(", href: "); result.append(href); result.append(", sectionName: "); result.append(sectionName); result.append(", show: "); if (showESet) result.append(show); else result.append("<unset>"); result.append(", type: "); if (typeESet) result.append(type); else result.append("<unset>"); result.append(')'); return result.toString(); } } //SectionSourceTypeImpl