| /** |
| */ |
| package org.w3._1999.xhtml.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.w3._1999.xhtml.BodyType; |
| import org.w3._1999.xhtml.DirType; |
| import org.w3._1999.xhtml.HeadType; |
| import org.w3._1999.xhtml.HtmlType; |
| import org.w3._1999.xhtml.XhtmlPackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Html Type</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.w3._1999.xhtml.impl.HtmlTypeImpl#getHead <em>Head</em>}</li> |
| * <li>{@link org.w3._1999.xhtml.impl.HtmlTypeImpl#getBody <em>Body</em>}</li> |
| * <li>{@link org.w3._1999.xhtml.impl.HtmlTypeImpl#getDir <em>Dir</em>}</li> |
| * <li>{@link org.w3._1999.xhtml.impl.HtmlTypeImpl#getId <em>Id</em>}</li> |
| * <li>{@link org.w3._1999.xhtml.impl.HtmlTypeImpl#getLang <em>Lang</em>}</li> |
| * <li>{@link org.w3._1999.xhtml.impl.HtmlTypeImpl#getLang1 <em>Lang1</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class HtmlTypeImpl extends MinimalEObjectImpl.Container implements HtmlType { |
| /** |
| * The cached value of the '{@link #getHead() <em>Head</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getHead() |
| * @generated |
| * @ordered |
| */ |
| protected HeadType head; |
| |
| /** |
| * The cached value of the '{@link #getBody() <em>Body</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getBody() |
| * @generated |
| * @ordered |
| */ |
| protected BodyType body; |
| |
| /** |
| * The default value of the '{@link #getDir() <em>Dir</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDir() |
| * @generated |
| * @ordered |
| */ |
| protected static final DirType DIR_EDEFAULT = DirType.LTR; |
| |
| /** |
| * The cached value of the '{@link #getDir() <em>Dir</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDir() |
| * @generated |
| * @ordered |
| */ |
| protected DirType dir = DIR_EDEFAULT; |
| |
| /** |
| * This is true if the Dir attribute has been set. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| * @ordered |
| */ |
| protected boolean dirESet; |
| |
| /** |
| * 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 #getLang() <em>Lang</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getLang() |
| * @generated |
| * @ordered |
| */ |
| protected static final String LANG_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getLang() <em>Lang</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getLang() |
| * @generated |
| * @ordered |
| */ |
| protected String lang = LANG_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getLang1() <em>Lang1</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getLang1() |
| * @generated |
| * @ordered |
| */ |
| protected static final String LANG1_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getLang1() <em>Lang1</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getLang1() |
| * @generated |
| * @ordered |
| */ |
| protected String lang1 = LANG1_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected HtmlTypeImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return XhtmlPackage.eINSTANCE.getHtmlType(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public HeadType getHead() { |
| return head; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetHead(HeadType newHead, NotificationChain msgs) { |
| HeadType oldHead = head; |
| head = newHead; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, XhtmlPackage.HTML_TYPE__HEAD, oldHead, newHead); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setHead(HeadType newHead) { |
| if (newHead != head) { |
| NotificationChain msgs = null; |
| if (head != null) |
| msgs = ((InternalEObject)head).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - XhtmlPackage.HTML_TYPE__HEAD, null, msgs); |
| if (newHead != null) |
| msgs = ((InternalEObject)newHead).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - XhtmlPackage.HTML_TYPE__HEAD, null, msgs); |
| msgs = basicSetHead(newHead, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, XhtmlPackage.HTML_TYPE__HEAD, newHead, newHead)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public BodyType getBody() { |
| return body; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetBody(BodyType newBody, NotificationChain msgs) { |
| BodyType oldBody = body; |
| body = newBody; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, XhtmlPackage.HTML_TYPE__BODY, oldBody, newBody); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setBody(BodyType newBody) { |
| if (newBody != body) { |
| NotificationChain msgs = null; |
| if (body != null) |
| msgs = ((InternalEObject)body).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - XhtmlPackage.HTML_TYPE__BODY, null, msgs); |
| if (newBody != null) |
| msgs = ((InternalEObject)newBody).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - XhtmlPackage.HTML_TYPE__BODY, null, msgs); |
| msgs = basicSetBody(newBody, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, XhtmlPackage.HTML_TYPE__BODY, newBody, newBody)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public DirType getDir() { |
| return dir; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setDir(DirType newDir) { |
| DirType oldDir = dir; |
| dir = newDir == null ? DIR_EDEFAULT : newDir; |
| boolean oldDirESet = dirESet; |
| dirESet = true; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, XhtmlPackage.HTML_TYPE__DIR, oldDir, dir, !oldDirESet)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void unsetDir() { |
| DirType oldDir = dir; |
| boolean oldDirESet = dirESet; |
| dir = DIR_EDEFAULT; |
| dirESet = false; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.UNSET, XhtmlPackage.HTML_TYPE__DIR, oldDir, DIR_EDEFAULT, oldDirESet)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean isSetDir() { |
| return dirESet; |
| } |
| |
| /** |
| * <!-- 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, XhtmlPackage.HTML_TYPE__ID, oldId, id)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getLang() { |
| return lang; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setLang(String newLang) { |
| String oldLang = lang; |
| lang = newLang; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, XhtmlPackage.HTML_TYPE__LANG, oldLang, lang)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getLang1() { |
| return lang1; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setLang1(String newLang1) { |
| String oldLang1 = lang1; |
| lang1 = newLang1; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, XhtmlPackage.HTML_TYPE__LANG1, oldLang1, lang1)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case XhtmlPackage.HTML_TYPE__HEAD: |
| return basicSetHead(null, msgs); |
| case XhtmlPackage.HTML_TYPE__BODY: |
| return basicSetBody(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 XhtmlPackage.HTML_TYPE__HEAD: |
| return getHead(); |
| case XhtmlPackage.HTML_TYPE__BODY: |
| return getBody(); |
| case XhtmlPackage.HTML_TYPE__DIR: |
| return getDir(); |
| case XhtmlPackage.HTML_TYPE__ID: |
| return getId(); |
| case XhtmlPackage.HTML_TYPE__LANG: |
| return getLang(); |
| case XhtmlPackage.HTML_TYPE__LANG1: |
| return getLang1(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case XhtmlPackage.HTML_TYPE__HEAD: |
| setHead((HeadType)newValue); |
| return; |
| case XhtmlPackage.HTML_TYPE__BODY: |
| setBody((BodyType)newValue); |
| return; |
| case XhtmlPackage.HTML_TYPE__DIR: |
| setDir((DirType)newValue); |
| return; |
| case XhtmlPackage.HTML_TYPE__ID: |
| setId((String)newValue); |
| return; |
| case XhtmlPackage.HTML_TYPE__LANG: |
| setLang((String)newValue); |
| return; |
| case XhtmlPackage.HTML_TYPE__LANG1: |
| setLang1((String)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case XhtmlPackage.HTML_TYPE__HEAD: |
| setHead((HeadType)null); |
| return; |
| case XhtmlPackage.HTML_TYPE__BODY: |
| setBody((BodyType)null); |
| return; |
| case XhtmlPackage.HTML_TYPE__DIR: |
| unsetDir(); |
| return; |
| case XhtmlPackage.HTML_TYPE__ID: |
| setId(ID_EDEFAULT); |
| return; |
| case XhtmlPackage.HTML_TYPE__LANG: |
| setLang(LANG_EDEFAULT); |
| return; |
| case XhtmlPackage.HTML_TYPE__LANG1: |
| setLang1(LANG1_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case XhtmlPackage.HTML_TYPE__HEAD: |
| return head != null; |
| case XhtmlPackage.HTML_TYPE__BODY: |
| return body != null; |
| case XhtmlPackage.HTML_TYPE__DIR: |
| return isSetDir(); |
| case XhtmlPackage.HTML_TYPE__ID: |
| return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id); |
| case XhtmlPackage.HTML_TYPE__LANG: |
| return LANG_EDEFAULT == null ? lang != null : !LANG_EDEFAULT.equals(lang); |
| case XhtmlPackage.HTML_TYPE__LANG1: |
| return LANG1_EDEFAULT == null ? lang1 != null : !LANG1_EDEFAULT.equals(lang1); |
| } |
| 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(" (dir: "); |
| if (dirESet) result.append(dir); else result.append("<unset>"); |
| result.append(", id: "); |
| result.append(id); |
| result.append(", lang: "); |
| result.append(lang); |
| result.append(", lang1: "); |
| result.append(lang1); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //HtmlTypeImpl |