Search in sources :

Example 1 with ClassifierFeatureHolder

use of org.osate.ba.aadlba.ClassifierFeatureHolder in project osate2 by osate.

the class ClassifierFeaturePropertyReferenceImpl method basicSetComponent.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public NotificationChain basicSetComponent(ClassifierFeatureHolder newComponent, NotificationChain msgs) {
    ClassifierFeatureHolder oldComponent = component;
    component = newComponent;
    if (eNotificationRequired()) {
        ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, AadlBaPackage.CLASSIFIER_FEATURE_PROPERTY_REFERENCE__COMPONENT, oldComponent, newComponent);
        if (msgs == null)
            msgs = notification;
        else
            msgs.add(notification);
    }
    return msgs;
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) ClassifierFeatureHolder(org.osate.ba.aadlba.ClassifierFeatureHolder)

Example 2 with ClassifierFeatureHolder

use of org.osate.ba.aadlba.ClassifierFeatureHolder in project osate2 by osate.

the class AadlBaParserVisitor method cloneValueConstant.

private ValueConstant cloneValueConstant(ValueConstant sourceValueConstant) {
    ValueConstant targetValueConstant = null;
    /*
		 * value_constant ::=
		 * boolean_literal
		 * | numeric_literal
		 * | string_literal
		 * | property_constant
		 * | property_reference
		 */
    if (sourceValueConstant instanceof BehaviorBooleanLiteral) {
        BehaviorBooleanLiteral sourceBbl = (BehaviorBooleanLiteral) sourceValueConstant;
        BehaviorBooleanLiteral targetBbl = _baFact.createBehaviorBooleanLiteral();
        targetBbl.setValue(sourceBbl.getValue());
        targetValueConstant = targetBbl;
    } else if (sourceValueConstant instanceof BehaviorRealLiteral) {
        BehaviorRealLiteral sourceBrl = (BehaviorRealLiteral) sourceValueConstant;
        BehaviorRealLiteral targetBrl = _baFact.createBehaviorRealLiteral();
        targetBrl.setValue(sourceBrl.getValue());
        targetBrl.setUnit(sourceBrl.getUnit());
        targetValueConstant = targetBrl;
    } else if (sourceValueConstant instanceof BehaviorIntegerLiteral) {
        BehaviorIntegerLiteral sourceIl = (BehaviorIntegerLiteral) sourceValueConstant;
        BehaviorIntegerLiteral targetIl = _baFact.createBehaviorIntegerLiteral();
        targetIl.setValue(sourceIl.getValue());
        targetIl.setUnit(sourceIl.getUnit());
        targetValueConstant = targetIl;
    } else if (sourceValueConstant instanceof BehaviorStringLiteral) {
        BehaviorStringLiteral sourceBsl = (BehaviorStringLiteral) sourceValueConstant;
        BehaviorStringLiteral targetBsl = _baFact.createBehaviorStringLiteral();
        targetBsl.setValue(sourceBsl.getValue());
        targetValueConstant = targetBsl;
    } else if (sourceValueConstant instanceof BehaviorPropertyConstant) {
        BehaviorPropertyConstant sourceBpc = (BehaviorPropertyConstant) sourceValueConstant;
        BehaviorPropertyConstant targetBpc = _baFact.createBehaviorPropertyConstant();
        targetBpc.setProperty(sourceBpc.getProperty());
        targetBpc.setPropertySet(sourceBpc.getPropertySet());
        targetValueConstant = targetBpc;
    } else if (sourceValueConstant instanceof PropertyReference) {
        PropertyReference sourcePr = (PropertyReference) sourceValueConstant;
        List<PropertyNameHolder> sourceProperties = sourcePr.getProperties();
        if (sourceValueConstant instanceof ClassifierFeaturePropertyReference) {
            ClassifierFeaturePropertyReference sourceCfpr = (ClassifierFeaturePropertyReference) sourceValueConstant;
            ClassifierFeaturePropertyReference targetCfpr = _baFact.createClassifierFeaturePropertyReference();
            targetCfpr.setComponent((ClassifierFeatureHolder) cloneHolder(sourceCfpr.getComponent()));
            targetCfpr.getProperties().addAll(clonePropertyNameHolderList(sourceProperties));
            targetValueConstant = targetCfpr;
        } else if (sourceValueConstant instanceof ClassifierPropertyReference) {
            ClassifierPropertyReference sourceCpr = (ClassifierPropertyReference) sourceValueConstant;
            ClassifierPropertyReference targetCpr = _baFact.createClassifierPropertyReference();
            targetCpr.setClassifier(sourceCpr.getClassifier());
            targetCpr.getProperties().addAll(clonePropertyNameHolderList(sourceProperties));
            targetValueConstant = targetCpr;
        } else if (sourceValueConstant instanceof PropertySetPropertyReference) {
            PropertySetPropertyReference sourcePspr = (PropertySetPropertyReference) sourceValueConstant;
            PropertySetPropertyReference targetPspr = _baFact.createPropertySetPropertyReference();
            targetPspr.setPropertySet(sourcePspr.getPropertySet());
            targetPspr.getProperties().addAll(clonePropertyNameHolderList(sourceProperties));
            targetValueConstant = targetPspr;
        }
    }
    targetValueConstant.setLocationReference(sourceValueConstant.getLocationReference());
    return targetValueConstant;
}
Also used : PropertyReference(org.osate.ba.aadlba.PropertyReference) DeclarativePropertyReference(org.osate.ba.declarative.DeclarativePropertyReference) PropertySetPropertyReference(org.osate.ba.aadlba.PropertySetPropertyReference) ClassifierFeaturePropertyReference(org.osate.ba.aadlba.ClassifierFeaturePropertyReference) ClassifierPropertyReference(org.osate.ba.aadlba.ClassifierPropertyReference) BehaviorPropertyConstant(org.osate.ba.aadlba.BehaviorPropertyConstant) ClassifierFeaturePropertyReference(org.osate.ba.aadlba.ClassifierFeaturePropertyReference) BehaviorStringLiteral(org.osate.ba.aadlba.BehaviorStringLiteral) ClassifierPropertyReference(org.osate.ba.aadlba.ClassifierPropertyReference) BehaviorRealLiteral(org.osate.ba.aadlba.BehaviorRealLiteral) ValueConstant(org.osate.ba.aadlba.ValueConstant) BehaviorBooleanLiteral(org.osate.ba.aadlba.BehaviorBooleanLiteral) ArrayList(java.util.ArrayList) List(java.util.List) BasicEList(org.eclipse.emf.common.util.BasicEList) ClassifierFeatureHolder(org.osate.ba.aadlba.ClassifierFeatureHolder) PropertySetPropertyReference(org.osate.ba.aadlba.PropertySetPropertyReference) BehaviorIntegerLiteral(org.osate.ba.aadlba.BehaviorIntegerLiteral)

Example 3 with ClassifierFeatureHolder

use of org.osate.ba.aadlba.ClassifierFeatureHolder in project osate2 by osate.

the class AadlBaParserVisitor method cloneHolder.

private ElementHolder cloneHolder(ElementHolder sourceElementHolder) {
    ElementHolder targetElementHolder = null;
    if (sourceElementHolder instanceof ClassifierFeatureHolder) {
        ClassifierFeatureHolder sourceCfh = (ClassifierFeatureHolder) sourceElementHolder;
        if (sourceElementHolder instanceof BehaviorVariableHolder) {
            // BehaviorVariableHolder
            targetElementHolder = _baFact.createBehaviorVariableHolder();
        } else if (sourceElementHolder instanceof FeatureHolder) {
            FeatureHolder sourceFeatureHolder = (FeatureHolder) sourceElementHolder;
            // FeatureHolder
            if (sourceFeatureHolder instanceof DataAccessHolder) {
                // DataAccessHolder
                targetElementHolder = _baFact.createDataAccessHolder();
            } else if (sourceFeatureHolder instanceof ParameterHolder) {
                // ParameterHolder
                targetElementHolder = _baFact.createParameterHolder();
            } else if (sourceFeatureHolder instanceof DataPortHolder) {
                targetElementHolder = _baFact.createDataPortHolder();
            } else if (sourceFeatureHolder instanceof EventDataPortHolder) {
                targetElementHolder = _baFact.createEventDataPortHolder();
            } else if (sourceFeatureHolder instanceof EventPortHolder) {
                targetElementHolder = _baFact.createEventPortHolder();
            } else if (sourceFeatureHolder instanceof SubprogramAccessHolder) {
                targetElementHolder = _baFact.createSubprogramAccessHolder();
            }
        } else // PrototypeHolder
        if (sourceElementHolder instanceof PrototypeHolder) {
            // DataAccessPrototypeHolder
            if (sourceElementHolder instanceof DataAccessPrototypeHolder) {
                targetElementHolder = _baFact.createDataAccessPrototypeHolder();
            } else if (sourceElementHolder instanceof FeaturePrototypeHolder) {
                targetElementHolder = _baFact.createFeaturePrototypeHolder();
            } else if (sourceElementHolder instanceof PortPrototypeHolder) {
                targetElementHolder = _baFact.createPortPrototypeHolder();
            } else if (sourceElementHolder instanceof SubprogramPrototypeHolder) {
                targetElementHolder = _baFact.createSubprogramPrototypeHolder();
            }
        } else // SubcomponentHolder
        if (sourceElementHolder instanceof SubcomponentHolder) {
            // DataSubcomponentHolder
            if (sourceElementHolder instanceof DataSubcomponentHolder) {
                targetElementHolder = _baFact.createDataSubcomponentHolder();
            } else if (sourceElementHolder instanceof SubprogramSubcomponentHolder) {
                targetElementHolder = _baFact.createSubprogramSubcomponentHolder();
            }
        }
        ClassifierFeatureHolder targetCfh = (ClassifierFeatureHolder) targetElementHolder;
        targetCfh.setClassifierFeature(sourceCfh.getClassifierFeature());
    }
    if (targetElementHolder != null) {
        targetElementHolder.setElement(sourceElementHolder.getElement());
    }
    return targetElementHolder;
}
Also used : DataAccessHolder(org.osate.ba.aadlba.DataAccessHolder) PortPrototypeHolder(org.osate.ba.aadlba.PortPrototypeHolder) ClassifierFeatureHolder(org.osate.ba.aadlba.ClassifierFeatureHolder) FeatureHolder(org.osate.ba.aadlba.FeatureHolder) FeaturePrototypeHolder(org.osate.ba.aadlba.FeaturePrototypeHolder) SubprogramSubcomponentHolder(org.osate.ba.aadlba.SubprogramSubcomponentHolder) ElementHolder(org.osate.ba.aadlba.ElementHolder) PropertyElementHolder(org.osate.ba.aadlba.PropertyElementHolder) ClassifierFeatureHolder(org.osate.ba.aadlba.ClassifierFeatureHolder) BehaviorVariableHolder(org.osate.ba.aadlba.BehaviorVariableHolder) EventPortHolder(org.osate.ba.aadlba.EventPortHolder) SubcomponentHolder(org.osate.ba.aadlba.SubcomponentHolder) DataSubcomponentHolder(org.osate.ba.aadlba.DataSubcomponentHolder) SubprogramSubcomponentHolder(org.osate.ba.aadlba.SubprogramSubcomponentHolder) EventDataPortHolder(org.osate.ba.aadlba.EventDataPortHolder) DataPortHolder(org.osate.ba.aadlba.DataPortHolder) DataSubcomponentHolder(org.osate.ba.aadlba.DataSubcomponentHolder) EventDataPortHolder(org.osate.ba.aadlba.EventDataPortHolder) DataAccessPrototypeHolder(org.osate.ba.aadlba.DataAccessPrototypeHolder) ParameterHolder(org.osate.ba.aadlba.ParameterHolder) SubprogramAccessHolder(org.osate.ba.aadlba.SubprogramAccessHolder) PrototypeHolder(org.osate.ba.aadlba.PrototypeHolder) PortPrototypeHolder(org.osate.ba.aadlba.PortPrototypeHolder) SubprogramPrototypeHolder(org.osate.ba.aadlba.SubprogramPrototypeHolder) DataAccessPrototypeHolder(org.osate.ba.aadlba.DataAccessPrototypeHolder) FeaturePrototypeHolder(org.osate.ba.aadlba.FeaturePrototypeHolder) SubprogramPrototypeHolder(org.osate.ba.aadlba.SubprogramPrototypeHolder)

Aggregations

ClassifierFeatureHolder (org.osate.ba.aadlba.ClassifierFeatureHolder)3 ArrayList (java.util.ArrayList)1 List (java.util.List)1 BasicEList (org.eclipse.emf.common.util.BasicEList)1 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)1 BehaviorBooleanLiteral (org.osate.ba.aadlba.BehaviorBooleanLiteral)1 BehaviorIntegerLiteral (org.osate.ba.aadlba.BehaviorIntegerLiteral)1 BehaviorPropertyConstant (org.osate.ba.aadlba.BehaviorPropertyConstant)1 BehaviorRealLiteral (org.osate.ba.aadlba.BehaviorRealLiteral)1 BehaviorStringLiteral (org.osate.ba.aadlba.BehaviorStringLiteral)1 BehaviorVariableHolder (org.osate.ba.aadlba.BehaviorVariableHolder)1 ClassifierFeaturePropertyReference (org.osate.ba.aadlba.ClassifierFeaturePropertyReference)1 ClassifierPropertyReference (org.osate.ba.aadlba.ClassifierPropertyReference)1 DataAccessHolder (org.osate.ba.aadlba.DataAccessHolder)1 DataAccessPrototypeHolder (org.osate.ba.aadlba.DataAccessPrototypeHolder)1 DataPortHolder (org.osate.ba.aadlba.DataPortHolder)1 DataSubcomponentHolder (org.osate.ba.aadlba.DataSubcomponentHolder)1 ElementHolder (org.osate.ba.aadlba.ElementHolder)1 EventDataPortHolder (org.osate.ba.aadlba.EventDataPortHolder)1 EventPortHolder (org.osate.ba.aadlba.EventPortHolder)1