Search in sources :

Example 1 with InstanceSwitch

use of org.osate.aadl2.instance.util.InstanceSwitch in project osate2 by osate.

the class AadlProcessingSwitch method process.

/**
 * Calls the package-specific switch
 */
@Override
public final void process(final Element theElement) {
    final EClass theEClass;
    /**
     * This checks to make sure we only invoke doSwitch with non-null
     * objects This is necessary as some feature retrieval methods may
     * return null
     */
    if (theElement == null) {
        return;
    }
    theEClass = theElement.eClass();
    if (aadl2Switch != null && (theEClass.eContainer() == Aadl2Package.eINSTANCE || theElement instanceof AnnexLibrary || theElement instanceof AnnexSubclause)) {
        aadl2Switch.doSwitch(theElement);
    } else if (instanceSwitch != null && theEClass.eContainer() == InstancePackage.eINSTANCE) {
        instanceSwitch.doSwitch(theElement);
    }
}
Also used : EClass(org.eclipse.emf.ecore.EClass) AnnexLibrary(org.osate.aadl2.AnnexLibrary) AnnexSubclause(org.osate.aadl2.AnnexSubclause)

Aggregations

EClass (org.eclipse.emf.ecore.EClass)1 AnnexLibrary (org.osate.aadl2.AnnexLibrary)1 AnnexSubclause (org.osate.aadl2.AnnexSubclause)1