/**
*
*
*
* $Id: FaceletTaglibExtensionImpl.java,v 1.1 2010/03/18 06:24:39 cbateman Exp $
*/
package org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.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.EObjectImpl;
import org.eclipse.emf.ecore.util.BasicFeatureMap;
import org.eclipse.emf.ecore.util.FeatureMap;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletTaglibExtension;
import org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.FaceletTaglibPackage;
/**
*
* An implementation of the model object 'Facelet Taglib Extension'.
*
*
* The following features are implemented:
*
* - {@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.FaceletTaglibExtensionImpl#getAny Any}
* - {@link org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.faceletTaglib.impl.FaceletTaglibExtensionImpl#getId Id}
*
*
*
* @generated
*/
public class FaceletTaglibExtensionImpl extends EObjectImpl implements FaceletTaglibExtension
{
/**
* The cached value of the '{@link #getAny() Any}' attribute list.
*
*
* @see #getAny()
* @generated
* @ordered
*/
protected FeatureMap any;
/**
* The default value of the '{@link #getId() Id}' attribute.
*
*
* @see #getId()
* @generated
* @ordered
*/
protected static final String ID_EDEFAULT = null;
/**
* The cached value of the '{@link #getId() Id}' attribute.
*
*
* @see #getId()
* @generated
* @ordered
*/
protected String id = ID_EDEFAULT;
/**
*
*
* @generated
*/
protected FaceletTaglibExtensionImpl()
{
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass()
{
return FaceletTaglibPackage.Literals.FACELET_TAGLIB_EXTENSION;
}
/**
*
*
* @generated
*/
public FeatureMap getAny()
{
if (any == null)
{
any = new BasicFeatureMap(this, FaceletTaglibPackage.FACELET_TAGLIB_EXTENSION__ANY);
}
return any;
}
/**
*
*
* @generated
*/
public String getId()
{
return id;
}
/**
*
*
* @generated
*/
public void setId(String newId)
{
String oldId = id;
id = newId;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FaceletTaglibPackage.FACELET_TAGLIB_EXTENSION__ID, oldId, id));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case FaceletTaglibPackage.FACELET_TAGLIB_EXTENSION__ANY:
return ((InternalEList>)getAny()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case FaceletTaglibPackage.FACELET_TAGLIB_EXTENSION__ANY:
if (coreType) return getAny();
return ((FeatureMap.Internal)getAny()).getWrapper();
case FaceletTaglibPackage.FACELET_TAGLIB_EXTENSION__ID:
return getId();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case FaceletTaglibPackage.FACELET_TAGLIB_EXTENSION__ANY:
((FeatureMap.Internal)getAny()).set(newValue);
return;
case FaceletTaglibPackage.FACELET_TAGLIB_EXTENSION__ID:
setId((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case FaceletTaglibPackage.FACELET_TAGLIB_EXTENSION__ANY:
getAny().clear();
return;
case FaceletTaglibPackage.FACELET_TAGLIB_EXTENSION__ID:
setId(ID_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case FaceletTaglibPackage.FACELET_TAGLIB_EXTENSION__ANY:
return any != null && !any.isEmpty();
case FaceletTaglibPackage.FACELET_TAGLIB_EXTENSION__ID:
return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id);
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public String toString()
{
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (any: "); //$NON-NLS-1$
result.append(any);
result.append(", id: "); //$NON-NLS-1$
result.append(id);
result.append(')');
return result.toString();
}
} //FaceletTaglibExtensionImpl