| /** |
| * Copyright (c) 2007 Oracle Corporation |
| * |
| * $Id: BooleanValueImpl.java,v 1.2 2010/04/27 17:40:10 gkessler Exp $ |
| */ |
| package org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.internal.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.eclipse.jst.jsf.common.metadata.traittypes.traittypes.BooleanValue; |
| import org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.TraitTypesPackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Boolean Value</b></em>'. |
| * |
| * Only String value of 'true' in xml will result in isTrue() being true. |
| * All other String values will result in false. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.jst.jsf.common.metadata.traittypes.traittypes.internal.impl.BooleanValueImpl#isTrue <em>True</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class BooleanValueImpl extends EObjectImpl implements BooleanValue { |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public static final String copyright = "Copyright (c) 2007 Oracle Corporation"; //$NON-NLS-1$ |
| |
| /** |
| * The default value of the '{@link #isTrue() <em>True</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isTrue() |
| * @generated |
| * @ordered |
| */ |
| protected static final boolean TRUE_EDEFAULT = false; |
| |
| /** |
| * The cached value of the '{@link #isTrue() <em>True</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isTrue() |
| * @generated |
| * @ordered |
| */ |
| protected boolean true_ = TRUE_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected BooleanValueImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected EClass eStaticClass() { |
| return TraitTypesPackage.Literals.BOOLEAN_VALUE; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean isTrue() { |
| return true_; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setTrue(boolean newTrue) { |
| boolean oldTrue = true_; |
| true_ = newTrue; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, TraitTypesPackage.BOOLEAN_VALUE__TRUE, oldTrue, true_)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case TraitTypesPackage.BOOLEAN_VALUE__TRUE: |
| return isTrue() ? Boolean.TRUE : Boolean.FALSE; |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case TraitTypesPackage.BOOLEAN_VALUE__TRUE: |
| setTrue(((Boolean)newValue).booleanValue()); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case TraitTypesPackage.BOOLEAN_VALUE__TRUE: |
| setTrue(TRUE_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case TraitTypesPackage.BOOLEAN_VALUE__TRUE: |
| return true_ != TRUE_EDEFAULT; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String toString() { |
| if (eIsProxy()) return super.toString(); |
| |
| StringBuffer result = new StringBuffer(super.toString()); |
| result.append(" (isTrue(): "); //$NON-NLS-1$ |
| result.append(true_); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //BooleanValueImpl |