org.omg.bpmn.bpmn2.impl.TextAnnotationImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of org.omg.bpmn.model Show documentation
Show all versions of org.omg.bpmn.model Show documentation
Ecore and generated code for org.omg.bpmn2
The newest version!
/*
* Copyright (c) 2012 - 2024 Data In Motion and others.
* All rights reserved.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Mark Hoffmann - initial API and implementation
*/
package org.omg.bpmn.bpmn2.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.omg.bpmn.bpmn2.Bpmn2Package;
import org.omg.bpmn.bpmn2.TextAnnotation;
/**
*
* An implementation of the model object 'Text Annotation'.
*
*
* The following features are implemented:
*
*
* - {@link org.omg.bpmn.bpmn2.impl.TextAnnotationImpl#getText Text}
* - {@link org.omg.bpmn.bpmn2.impl.TextAnnotationImpl#getTextFormat Text Format}
*
*
* @generated
*/
public class TextAnnotationImpl extends ArtifactImpl implements TextAnnotation {
/**
* The default value of the '{@link #getText() Text}' attribute.
*
*
* @see #getText()
* @generated
* @ordered
*/
protected static final String TEXT_EDEFAULT = null;
/**
* The cached value of the '{@link #getText() Text}' attribute.
*
*
* @see #getText()
* @generated
* @ordered
*/
protected String text = TEXT_EDEFAULT;
/**
* The default value of the '{@link #getTextFormat() Text Format}' attribute.
*
*
* @see #getTextFormat()
* @generated
* @ordered
*/
protected static final String TEXT_FORMAT_EDEFAULT = "text/plain";
/**
* The cached value of the '{@link #getTextFormat() Text Format}' attribute.
*
*
* @see #getTextFormat()
* @generated
* @ordered
*/
protected String textFormat = TEXT_FORMAT_EDEFAULT;
/**
*
*
* @generated
*/
protected TextAnnotationImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return Bpmn2Package.eINSTANCE.getTextAnnotation();
}
/**
*
*
* @generated
*/
@Override
public String getText() {
return text;
}
/**
*
*
* @generated
*/
@Override
public void setText(String newText) {
String oldText = text;
text = newText;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.TEXT_ANNOTATION__TEXT, oldText, text));
}
/**
*
*
* @generated
*/
@Override
public String getTextFormat() {
return textFormat;
}
/**
*
*
* @generated
*/
@Override
public void setTextFormat(String newTextFormat) {
String oldTextFormat = textFormat;
textFormat = newTextFormat;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.TEXT_ANNOTATION__TEXT_FORMAT, oldTextFormat, textFormat));
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case Bpmn2Package.TEXT_ANNOTATION__TEXT:
return getText();
case Bpmn2Package.TEXT_ANNOTATION__TEXT_FORMAT:
return getTextFormat();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case Bpmn2Package.TEXT_ANNOTATION__TEXT:
setText((String)newValue);
return;
case Bpmn2Package.TEXT_ANNOTATION__TEXT_FORMAT:
setTextFormat((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case Bpmn2Package.TEXT_ANNOTATION__TEXT:
setText(TEXT_EDEFAULT);
return;
case Bpmn2Package.TEXT_ANNOTATION__TEXT_FORMAT:
setTextFormat(TEXT_FORMAT_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case Bpmn2Package.TEXT_ANNOTATION__TEXT:
return TEXT_EDEFAULT == null ? text != null : !TEXT_EDEFAULT.equals(text);
case Bpmn2Package.TEXT_ANNOTATION__TEXT_FORMAT:
return TEXT_FORMAT_EDEFAULT == null ? textFormat != null : !TEXT_FORMAT_EDEFAULT.equals(textFormat);
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuilder result = new StringBuilder(super.toString());
result.append(" (text: ");
result.append(text);
result.append(", textFormat: ");
result.append(textFormat);
result.append(')');
return result.toString();
}
} //TextAnnotationImpl