/** | |
* | |
* Copyright (c) 2009 Hatha Systems. | |
* 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: | |
* Nikolai Mansourov (Hatha Systems) - initial API and implementation | |
* Gabriel Barbier (Mia-Software) - minor evolutions for version 1.1 | |
* | |
* $Id$ | |
*/ | |
package org.eclipse.gmt.modisco.omg.kdm.kdm.impl; | |
import org.eclipse.emf.common.notify.Notification; | |
import org.eclipse.emf.ecore.EClass; | |
import org.eclipse.emf.ecore.impl.ENotificationImpl; | |
import org.eclipse.gmt.modisco.omg.kdm.core.impl.ElementImpl; | |
import org.eclipse.gmt.modisco.omg.kdm.kdm.Audit; | |
import org.eclipse.gmt.modisco.omg.kdm.kdm.KdmPackage; | |
/** | |
* <!-- begin-user-doc --> | |
* An implementation of the model object '<em><b>Audit</b></em>'. | |
* <!-- end-user-doc --> | |
* <p> | |
* The following features are implemented: | |
* <ul> | |
* <li>{@link org.eclipse.gmt.modisco.omg.kdm.kdm.impl.AuditImpl#getDescription <em>Description</em>}</li> | |
* <li>{@link org.eclipse.gmt.modisco.omg.kdm.kdm.impl.AuditImpl#getAuthor <em>Author</em>}</li> | |
* <li>{@link org.eclipse.gmt.modisco.omg.kdm.kdm.impl.AuditImpl#getDate <em>Date</em>}</li> | |
* </ul> | |
* </p> | |
* | |
* @generated | |
*/ | |
public class AuditImpl extends ElementImpl implements Audit { | |
/** | |
* The default value of the '{@link #getDescription() <em>Description</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getDescription() | |
* @generated | |
* @ordered | |
*/ | |
protected static final String DESCRIPTION_EDEFAULT = null; | |
/** | |
* The cached value of the '{@link #getDescription() <em>Description</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getDescription() | |
* @generated | |
* @ordered | |
*/ | |
protected String description = DESCRIPTION_EDEFAULT; | |
/** | |
* The default value of the '{@link #getAuthor() <em>Author</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getAuthor() | |
* @generated | |
* @ordered | |
*/ | |
protected static final String AUTHOR_EDEFAULT = null; | |
/** | |
* The cached value of the '{@link #getAuthor() <em>Author</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getAuthor() | |
* @generated | |
* @ordered | |
*/ | |
protected String author = AUTHOR_EDEFAULT; | |
/** | |
* The default value of the '{@link #getDate() <em>Date</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getDate() | |
* @generated | |
* @ordered | |
*/ | |
protected static final String DATE_EDEFAULT = null; | |
/** | |
* The cached value of the '{@link #getDate() <em>Date</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getDate() | |
* @generated | |
* @ordered | |
*/ | |
protected String date = DATE_EDEFAULT; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
protected AuditImpl() { | |
super(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
protected EClass eStaticClass() { | |
return KdmPackage.Literals.AUDIT; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public String getDescription() { | |
return description; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setDescription(String newDescription) { | |
String oldDescription = description; | |
description = newDescription; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, KdmPackage.AUDIT__DESCRIPTION, oldDescription, description)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public String getAuthor() { | |
return author; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setAuthor(String newAuthor) { | |
String oldAuthor = author; | |
author = newAuthor; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, KdmPackage.AUDIT__AUTHOR, oldAuthor, author)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public String getDate() { | |
return date; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setDate(String newDate) { | |
String oldDate = date; | |
date = newDate; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, KdmPackage.AUDIT__DATE, oldDate, date)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public Object eGet(int featureID, boolean resolve, boolean coreType) { | |
switch (featureID) { | |
case KdmPackage.AUDIT__DESCRIPTION: | |
return getDescription(); | |
case KdmPackage.AUDIT__AUTHOR: | |
return getAuthor(); | |
case KdmPackage.AUDIT__DATE: | |
return getDate(); | |
} | |
return super.eGet(featureID, resolve, coreType); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eSet(int featureID, Object newValue) { | |
switch (featureID) { | |
case KdmPackage.AUDIT__DESCRIPTION: | |
setDescription((String)newValue); | |
return; | |
case KdmPackage.AUDIT__AUTHOR: | |
setAuthor((String)newValue); | |
return; | |
case KdmPackage.AUDIT__DATE: | |
setDate((String)newValue); | |
return; | |
} | |
super.eSet(featureID, newValue); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eUnset(int featureID) { | |
switch (featureID) { | |
case KdmPackage.AUDIT__DESCRIPTION: | |
setDescription(DESCRIPTION_EDEFAULT); | |
return; | |
case KdmPackage.AUDIT__AUTHOR: | |
setAuthor(AUTHOR_EDEFAULT); | |
return; | |
case KdmPackage.AUDIT__DATE: | |
setDate(DATE_EDEFAULT); | |
return; | |
} | |
super.eUnset(featureID); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public boolean eIsSet(int featureID) { | |
switch (featureID) { | |
case KdmPackage.AUDIT__DESCRIPTION: | |
return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description); | |
case KdmPackage.AUDIT__AUTHOR: | |
return AUTHOR_EDEFAULT == null ? author != null : !AUTHOR_EDEFAULT.equals(author); | |
case KdmPackage.AUDIT__DATE: | |
return DATE_EDEFAULT == null ? date != null : !DATE_EDEFAULT.equals(date); | |
} | |
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(" (description: "); //$NON-NLS-1$ | |
result.append(description); | |
result.append(", author: "); //$NON-NLS-1$ | |
result.append(author); | |
result.append(", date: "); //$NON-NLS-1$ | |
result.append(date); | |
result.append(')'); | |
return result.toString(); | |
} | |
} //AuditImpl |