@SuppressWarnings("unchecked") private static List<ImportNormalizer> getNormalizers(IScope scope) throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { assertNotNull(scope); assertThat(scope, is(instanceOf(ImportScope.class))); ImportScope importScope = (ImportScope) scope; Field normalizersField = scope.getClass().getDeclaredField("normalizers"); normalizersField.setAccessible(true); Object normalizers = normalizersField.get(importScope); assertThat(normalizers, is(instanceOf(List.class))); assertThat((List<?>) normalizers, everyItem(is(instanceOf(ImportNormalizer.class)))); return (List<ImportNormalizer>) normalizers; }
public IScope scope_ActiveStateReferenceExpression_value(EObject context, EReference reference) { Statechart statechart = getStatechart(context); if (statechart == null) return IScope.NULLSCOPE; List<State> allStates = EcoreUtil2.getAllContentsOfType(statechart, State.class); IScope scope = Scopes.scopeFor(allStates, nameProvider, IScope.NULLSCOPE); return new ImportScope(getActiveStateNormalizer(context), scope, new EObjectDescriptionLookUp(Lists.newArrayList(scope.getAllElements())), reference.getEReferenceType(), false); }
protected ImportScope createImportScope(IScope parent, List<ImportNormalizer> namespaceResolvers, ISelectable importFrom, EClass type, boolean ignoreCase) { if (importFrom == null) throw new NullPointerException("importFrom"); return new ImportScope(namespaceResolvers, parent, importFrom, type, ignoreCase); }