| /******************************************************************************* |
| * Copyright (c) 2022 CEA LIST. |
| * |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License 2.0 |
| * which accompanies this distribution, and is available at |
| * https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Contributors: |
| * Saadia Dhouib (CEA LIST) saadia.dhouib@cea.fr |
| * Fadwa Tmar (CEA LIST) fadwa.tmar@cea.fr |
| *******************************************************************************/ |
| /** |
| */ |
| package org.eclipse.papyrus.opcua.opcuaprofile.OPC_UA_Library.impl; |
| |
| import java.lang.String; |
| |
| 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.MinimalEObjectImpl; |
| |
| import org.eclipse.papyrus.opcua.opcuaprofile.OPC_UA_Library.BaseDataType; |
| import org.eclipse.papyrus.opcua.opcuaprofile.OPC_UA_Library.OPC_UA_LibraryPackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Base Data Type</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.papyrus.opcua.opcuaprofile.OPC_UA_Library.impl.BaseDataTypeImpl#getNodeId <em>Node Id</em>}</li> |
| * <li>{@link org.eclipse.papyrus.opcua.opcuaprofile.OPC_UA_Library.impl.BaseDataTypeImpl#getNamespaceUri <em>Namespace Uri</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class BaseDataTypeImpl extends MinimalEObjectImpl.Container implements BaseDataType { |
| /** |
| * The default value of the '{@link #getNodeId() <em>Node Id</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getNodeId() |
| * @generated |
| * @ordered |
| */ |
| protected static final String NODE_ID_EDEFAULT = "i=24"; |
| |
| /** |
| * The cached value of the '{@link #getNodeId() <em>Node Id</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getNodeId() |
| * @generated |
| * @ordered |
| */ |
| protected String nodeId = NODE_ID_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getNamespaceUri() <em>Namespace Uri</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getNamespaceUri() |
| * @generated |
| * @ordered |
| */ |
| protected static final String NAMESPACE_URI_EDEFAULT = "http://opcfoundation.org/UA/"; |
| |
| /** |
| * The cached value of the '{@link #getNamespaceUri() <em>Namespace Uri</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getNamespaceUri() |
| * @generated |
| * @ordered |
| */ |
| protected String namespaceUri = NAMESPACE_URI_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected BaseDataTypeImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return OPC_UA_LibraryPackage.Literals.BASE_DATA_TYPE; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getNodeId() { |
| return nodeId; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setNodeId(String newNodeId) { |
| String oldNodeId = nodeId; |
| nodeId = newNodeId; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, OPC_UA_LibraryPackage.BASE_DATA_TYPE__NODE_ID, oldNodeId, nodeId)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getNamespaceUri() { |
| return namespaceUri; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setNamespaceUri(String newNamespaceUri) { |
| String oldNamespaceUri = namespaceUri; |
| namespaceUri = newNamespaceUri; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, OPC_UA_LibraryPackage.BASE_DATA_TYPE__NAMESPACE_URI, oldNamespaceUri, namespaceUri)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case OPC_UA_LibraryPackage.BASE_DATA_TYPE__NODE_ID: |
| return getNodeId(); |
| case OPC_UA_LibraryPackage.BASE_DATA_TYPE__NAMESPACE_URI: |
| return getNamespaceUri(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case OPC_UA_LibraryPackage.BASE_DATA_TYPE__NODE_ID: |
| setNodeId((String)newValue); |
| return; |
| case OPC_UA_LibraryPackage.BASE_DATA_TYPE__NAMESPACE_URI: |
| setNamespaceUri((String)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case OPC_UA_LibraryPackage.BASE_DATA_TYPE__NODE_ID: |
| setNodeId(NODE_ID_EDEFAULT); |
| return; |
| case OPC_UA_LibraryPackage.BASE_DATA_TYPE__NAMESPACE_URI: |
| setNamespaceUri(NAMESPACE_URI_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case OPC_UA_LibraryPackage.BASE_DATA_TYPE__NODE_ID: |
| return NODE_ID_EDEFAULT == null ? nodeId != null : !NODE_ID_EDEFAULT.equals(nodeId); |
| case OPC_UA_LibraryPackage.BASE_DATA_TYPE__NAMESPACE_URI: |
| return NAMESPACE_URI_EDEFAULT == null ? namespaceUri != null : !NAMESPACE_URI_EDEFAULT.equals(namespaceUri); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String toString() { |
| if (eIsProxy()) return super.toString(); |
| |
| StringBuilder result = new StringBuilder(super.toString()); |
| result.append(" (NodeId: "); |
| result.append(nodeId); |
| result.append(", NamespaceUri: "); |
| result.append(namespaceUri); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //BaseDataTypeImpl |