blob: 891d331ef328f49219d6f0d467497ce0ac8ea8b4 [file] [log] [blame]
/**
* Copyright (c) 2011, 2015 - Lunifera GmbH (Gross Enzersdorf, Austria), Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
* 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:
* Florian Pirchner - Initial implementation
*/
package org.eclipse.osbp.ecview.core.common.model.binding.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.osbp.ecview.core.common.model.binding.BindingPackage;
import org.eclipse.osbp.ecview.core.common.model.binding.YBeanValueBindingEndpoint;
import org.eclipse.osbp.ecview.core.common.model.core.YElement;
import org.eclipse.osbp.ecview.core.common.model.core.util.BindingIdUtil;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>YBean Value Binding Endpoint</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.osbp.ecview.core.common.model.binding.impl.YBeanValueBindingEndpointImpl#getBean <em>Bean</em>}</li>
* <li>{@link org.eclipse.osbp.ecview.core.common.model.binding.impl.YBeanValueBindingEndpointImpl#getPropertyPath <em>Property Path</em>}</li>
* </ul>
*
* @generated
*/
public class YBeanValueBindingEndpointImpl extends YValueBindingEndpointImpl implements YBeanValueBindingEndpoint {
/**
* The default value of the '{@link #getBean() <em>Bean</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getBean()
* @generated
* @ordered
*/
protected static final Object BEAN_EDEFAULT = null;
/**
* The cached value of the '{@link #getBean() <em>Bean</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getBean()
* @generated
* @ordered
*/
protected Object bean = BEAN_EDEFAULT;
/**
* The default value of the '{@link #getPropertyPath() <em>Property Path</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPropertyPath()
* @generated
* @ordered
*/
protected static final String PROPERTY_PATH_EDEFAULT = null;
/**
* The cached value of the '{@link #getPropertyPath() <em>Property Path</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPropertyPath()
* @generated
* @ordered
*/
protected String propertyPath = PROPERTY_PATH_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected YBeanValueBindingEndpointImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return BindingPackage.Literals.YBEAN_VALUE_BINDING_ENDPOINT;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Object getBean() {
return bean;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setBean(Object newBean) {
Object oldBean = bean;
bean = newBean;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BindingPackage.YBEAN_VALUE_BINDING_ENDPOINT__BEAN, oldBean, bean));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getPropertyPath() {
return propertyPath;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setPropertyPath(String newPropertyPath) {
String oldPropertyPath = propertyPath;
propertyPath = newPropertyPath;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BindingPackage.YBEAN_VALUE_BINDING_ENDPOINT__PROPERTY_PATH, oldPropertyPath, propertyPath));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case BindingPackage.YBEAN_VALUE_BINDING_ENDPOINT__BEAN:
return getBean();
case BindingPackage.YBEAN_VALUE_BINDING_ENDPOINT__PROPERTY_PATH:
return getPropertyPath();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case BindingPackage.YBEAN_VALUE_BINDING_ENDPOINT__BEAN:
setBean(newValue);
return;
case BindingPackage.YBEAN_VALUE_BINDING_ENDPOINT__PROPERTY_PATH:
setPropertyPath((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case BindingPackage.YBEAN_VALUE_BINDING_ENDPOINT__BEAN:
setBean(BEAN_EDEFAULT);
return;
case BindingPackage.YBEAN_VALUE_BINDING_ENDPOINT__PROPERTY_PATH:
setPropertyPath(PROPERTY_PATH_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case BindingPackage.YBEAN_VALUE_BINDING_ENDPOINT__BEAN:
return BEAN_EDEFAULT == null ? bean != null : !BEAN_EDEFAULT.equals(bean);
case BindingPackage.YBEAN_VALUE_BINDING_ENDPOINT__PROPERTY_PATH:
return PROPERTY_PATH_EDEFAULT == null ? propertyPath != null : !PROPERTY_PATH_EDEFAULT.equals(propertyPath);
}
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(" (bean: ");
result.append(bean);
result.append(", propertyPath: ");
result.append(propertyPath);
result.append(')');
return result.toString();
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated NOT
*/
public boolean isBindsElement(YElement element) {
return false;
}
@Override
public String getBindingIdString() {
// returns a string of pattern "beanvalue/{classname}/{path}"
return BindingIdUtil.getBeanValueId(getBean().getClass().getName(), getPropertyPath());
}
} //YBeanValueBindingEndpointImpl