blob: c3edc642dda654665345f9a1d6ec8ffc1905a01e [file] [log] [blame]
/**
*
* Copyright (c) 2011, 2016 - 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:
* Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation
*
*/
package org.eclipse.osbp.ecview.extension.model.visibility.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddable;
import org.eclipse.osbp.ecview.core.common.model.visibility.impl.YVisibilityProcessorImpl;
import org.eclipse.osbp.ecview.extension.model.visibility.YSubTypeVisibilityProcessor;
import org.eclipse.osbp.ecview.extension.model.visibility.YVisibilityPackage;
/**
* <!-- begin-user-doc --> An implementation of the model object '
* <em><b>YSub Type Visibility Processor</b></em>'. <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.osbp.ecview.extension.model.visibility.impl.YSubTypeVisibilityProcessorImpl#getTypeQualifiedName <em>Type Qualified Name</em>}</li>
* <li>{@link org.eclipse.osbp.ecview.extension.model.visibility.impl.YSubTypeVisibilityProcessorImpl#getType <em>Type</em>}</li>
* <li>{@link org.eclipse.osbp.ecview.extension.model.visibility.impl.YSubTypeVisibilityProcessorImpl#getTarget <em>Target</em>}</li>
* </ul>
*
* @generated
*/
public class YSubTypeVisibilityProcessorImpl extends YVisibilityProcessorImpl
implements YSubTypeVisibilityProcessor {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
public static final String copyright = "All rights reserved by Loetz GmbH und CoKG Heidelberg 2015.\n\nContributors:\n Florian Pirchner - initial API and implementation";
/**
* The default value of the '{@link #getTypeQualifiedName() <em>Type Qualified Name</em>}' attribute.
* <!-- begin-user-doc --> <!--
* end-user-doc -->
* @see #getTypeQualifiedName()
* @generated
* @ordered
*/
protected static final String TYPE_QUALIFIED_NAME_EDEFAULT = null;
/**
* The cached value of the '{@link #getTypeQualifiedName() <em>Type Qualified Name</em>}' attribute.
* <!-- begin-user-doc --> <!--
* end-user-doc -->
* @see #getTypeQualifiedName()
* @generated
* @ordered
*/
protected String typeQualifiedName = TYPE_QUALIFIED_NAME_EDEFAULT;
/**
* The cached value of the '{@link #getType() <em>Type</em>}' attribute.
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @see #getType()
* @generated
* @ordered
*/
protected Class<?> type;
/**
* The cached value of the '{@link #getTarget() <em>Target</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTarget()
* @generated
* @ordered
*/
protected YEmbeddable target;
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
protected YSubTypeVisibilityProcessorImpl() {
super();
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return YVisibilityPackage.Literals.YSUB_TYPE_VISIBILITY_PROCESSOR;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
public String getTypeQualifiedName() {
return typeQualifiedName;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
public void setTypeQualifiedName(String newTypeQualifiedName) {
String oldTypeQualifiedName = typeQualifiedName;
typeQualifiedName = newTypeQualifiedName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, YVisibilityPackage.YSUB_TYPE_VISIBILITY_PROCESSOR__TYPE_QUALIFIED_NAME, oldTypeQualifiedName, typeQualifiedName));
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
public Class<?> getType() {
return type;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
public void setType(Class<?> newType) {
Class<?> oldType = type;
type = newType;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, YVisibilityPackage.YSUB_TYPE_VISIBILITY_PROCESSOR__TYPE, oldType, type));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public YEmbeddable getTarget() {
if (target != null && target.eIsProxy()) {
InternalEObject oldTarget = (InternalEObject)target;
target = (YEmbeddable)eResolveProxy(oldTarget);
if (target != oldTarget) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, YVisibilityPackage.YSUB_TYPE_VISIBILITY_PROCESSOR__TARGET, oldTarget, target));
}
}
return target;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public YEmbeddable basicGetTarget() {
return target;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setTarget(YEmbeddable newTarget) {
YEmbeddable oldTarget = target;
target = newTarget;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, YVisibilityPackage.YSUB_TYPE_VISIBILITY_PROCESSOR__TARGET, oldTarget, target));
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case YVisibilityPackage.YSUB_TYPE_VISIBILITY_PROCESSOR__TYPE_QUALIFIED_NAME:
return getTypeQualifiedName();
case YVisibilityPackage.YSUB_TYPE_VISIBILITY_PROCESSOR__TYPE:
return getType();
case YVisibilityPackage.YSUB_TYPE_VISIBILITY_PROCESSOR__TARGET:
if (resolve) return getTarget();
return basicGetTarget();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case YVisibilityPackage.YSUB_TYPE_VISIBILITY_PROCESSOR__TYPE_QUALIFIED_NAME:
setTypeQualifiedName((String)newValue);
return;
case YVisibilityPackage.YSUB_TYPE_VISIBILITY_PROCESSOR__TYPE:
setType((Class<?>)newValue);
return;
case YVisibilityPackage.YSUB_TYPE_VISIBILITY_PROCESSOR__TARGET:
setTarget((YEmbeddable)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case YVisibilityPackage.YSUB_TYPE_VISIBILITY_PROCESSOR__TYPE_QUALIFIED_NAME:
setTypeQualifiedName(TYPE_QUALIFIED_NAME_EDEFAULT);
return;
case YVisibilityPackage.YSUB_TYPE_VISIBILITY_PROCESSOR__TYPE:
setType((Class<?>)null);
return;
case YVisibilityPackage.YSUB_TYPE_VISIBILITY_PROCESSOR__TARGET:
setTarget((YEmbeddable)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case YVisibilityPackage.YSUB_TYPE_VISIBILITY_PROCESSOR__TYPE_QUALIFIED_NAME:
return TYPE_QUALIFIED_NAME_EDEFAULT == null ? typeQualifiedName != null : !TYPE_QUALIFIED_NAME_EDEFAULT.equals(typeQualifiedName);
case YVisibilityPackage.YSUB_TYPE_VISIBILITY_PROCESSOR__TYPE:
return type != null;
case YVisibilityPackage.YSUB_TYPE_VISIBILITY_PROCESSOR__TARGET:
return target != null;
}
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(" (typeQualifiedName: ");
result.append(typeQualifiedName);
result.append(", type: ");
result.append(type);
result.append(')');
return result.toString();
}
@Override
public boolean matchesType(Class<?> className) {
if(className == null) {
return false;
}
return className.getName().equals(getTypeQualifiedName());
}
} // YSubTypeVisibilityProcessorImpl