| /******************************************************************************* |
| * Copyright (c) 2007 IBM Corporation and others. |
| * 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: |
| * IBM Corporation - initial API and implementation |
| *******************************************************************************/ |
| package org.eclipse.jst.javaee.web.internal.impl; |
| |
| import java.math.BigInteger; |
| |
| 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.javaee.web.ErrorPage; |
| |
| import org.eclipse.jst.javaee.web.internal.metadata.WebPackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Error Page</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.jst.javaee.web.internal.impl.ErrorPageImpl#getErrorCode <em>Error Code</em>}</li> |
| * <li>{@link org.eclipse.jst.javaee.web.internal.impl.ErrorPageImpl#getExceptionType <em>Exception Type</em>}</li> |
| * <li>{@link org.eclipse.jst.javaee.web.internal.impl.ErrorPageImpl#getLocation <em>Location</em>}</li> |
| * <li>{@link org.eclipse.jst.javaee.web.internal.impl.ErrorPageImpl#getId <em>Id</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class ErrorPageImpl extends EObjectImpl implements ErrorPage { |
| /** |
| * The default value of the '{@link #getErrorCode() <em>Error Code</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getErrorCode() |
| * @generated |
| * @ordered |
| */ |
| protected static final BigInteger ERROR_CODE_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getErrorCode() <em>Error Code</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getErrorCode() |
| * @generated |
| * @ordered |
| */ |
| protected BigInteger errorCode = ERROR_CODE_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getExceptionType() <em>Exception Type</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getExceptionType() |
| * @generated |
| * @ordered |
| */ |
| protected static final String EXCEPTION_TYPE_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getExceptionType() <em>Exception Type</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getExceptionType() |
| * @generated |
| * @ordered |
| */ |
| protected String exceptionType = EXCEPTION_TYPE_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getLocation() <em>Location</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getLocation() |
| * @generated |
| * @ordered |
| */ |
| protected static final String LOCATION_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getLocation() <em>Location</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getLocation() |
| * @generated |
| * @ordered |
| */ |
| protected String location = LOCATION_EDEFAULT; |
| |
| /** |
| * 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; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected ErrorPageImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return WebPackage.Literals.ERROR_PAGE; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public BigInteger getErrorCode() { |
| return errorCode; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setErrorCode(BigInteger newErrorCode) { |
| BigInteger oldErrorCode = errorCode; |
| errorCode = newErrorCode; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, WebPackage.ERROR_PAGE__ERROR_CODE, oldErrorCode, errorCode)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getExceptionType() { |
| return exceptionType; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setExceptionType(String newExceptionType) { |
| String oldExceptionType = exceptionType; |
| exceptionType = newExceptionType; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, WebPackage.ERROR_PAGE__EXCEPTION_TYPE, oldExceptionType, exceptionType)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getLocation() { |
| return location; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setLocation(String newLocation) { |
| String oldLocation = location; |
| location = newLocation; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, WebPackage.ERROR_PAGE__LOCATION, oldLocation, location)); |
| } |
| |
| /** |
| * <!-- 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, WebPackage.ERROR_PAGE__ID, oldId, id)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case WebPackage.ERROR_PAGE__ERROR_CODE: |
| return getErrorCode(); |
| case WebPackage.ERROR_PAGE__EXCEPTION_TYPE: |
| return getExceptionType(); |
| case WebPackage.ERROR_PAGE__LOCATION: |
| return getLocation(); |
| case WebPackage.ERROR_PAGE__ID: |
| return getId(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case WebPackage.ERROR_PAGE__ERROR_CODE: |
| setErrorCode((BigInteger)newValue); |
| return; |
| case WebPackage.ERROR_PAGE__EXCEPTION_TYPE: |
| setExceptionType((String)newValue); |
| return; |
| case WebPackage.ERROR_PAGE__LOCATION: |
| setLocation((String)newValue); |
| return; |
| case WebPackage.ERROR_PAGE__ID: |
| setId((String)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case WebPackage.ERROR_PAGE__ERROR_CODE: |
| setErrorCode(ERROR_CODE_EDEFAULT); |
| return; |
| case WebPackage.ERROR_PAGE__EXCEPTION_TYPE: |
| setExceptionType(EXCEPTION_TYPE_EDEFAULT); |
| return; |
| case WebPackage.ERROR_PAGE__LOCATION: |
| setLocation(LOCATION_EDEFAULT); |
| return; |
| case WebPackage.ERROR_PAGE__ID: |
| setId(ID_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case WebPackage.ERROR_PAGE__ERROR_CODE: |
| return ERROR_CODE_EDEFAULT == null ? errorCode != null : !ERROR_CODE_EDEFAULT.equals(errorCode); |
| case WebPackage.ERROR_PAGE__EXCEPTION_TYPE: |
| return EXCEPTION_TYPE_EDEFAULT == null ? exceptionType != null : !EXCEPTION_TYPE_EDEFAULT.equals(exceptionType); |
| case WebPackage.ERROR_PAGE__LOCATION: |
| return LOCATION_EDEFAULT == null ? location != null : !LOCATION_EDEFAULT.equals(location); |
| case WebPackage.ERROR_PAGE__ID: |
| return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id); |
| } |
| 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(" (errorCode: "); //$NON-NLS-1$ |
| result.append(errorCode); |
| result.append(", exceptionType: "); //$NON-NLS-1$ |
| result.append(exceptionType); |
| result.append(", location: "); //$NON-NLS-1$ |
| result.append(location); |
| result.append(", id: "); //$NON-NLS-1$ |
| result.append(id); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //ErrorPageImpl |