public TestStepContext getTestStepContext(final EObject eObject) { TestStepContext _xifexpression = null; if ((eObject instanceof TestStepContext)) { _xifexpression = ((TestStepContext)eObject); } else { _xifexpression = EcoreUtil2.<TestStepContext>getContainerOfType(eObject, TestStepContext.class); } return _xifexpression; }
public boolean shouldForceStatementMode(final EObject targetElement) { return (((targetElement != null) && (!((targetElement instanceof XAnnotation) || (targetElement instanceof XtendExecutable)))) && (EcoreUtil2.<XtendExecutable>getContainerOfType(targetElement, XtendExecutable.class) != null)); } }
private boolean isPrivateAPICaller(JvmIdentifiableElement element) { JvmMember featureContainer = EcoreUtil2.getContainerOfType(element, JvmMember.class); while (featureContainer != null) { if (this.annotations.findAnnotation(featureContainer, PrivateAPI.class.getName()) != null) { return true; } featureContainer = EcoreUtil2.getContainerOfType(featureContainer.eContainer(), JvmMember.class); } return false; }
protected AbstractRule getRule(EObject currentGrammarElement) { AbstractRule rule = null; if (currentGrammarElement instanceof RuleCall) rule = ((RuleCall) currentGrammarElement).getRule(); if (currentGrammarElement instanceof AbstractRule) rule = (AbstractRule) currentGrammarElement; if (currentGrammarElement instanceof Action) rule = EcoreUtil2.getContainerOfType(currentGrammarElement, AbstractRule.class); if (rule == null) throw new IllegalStateException(); return rule; }
/** * Returns the file header comment at the beginning of the text corresponding * to the pattern model containing the given pattern. * The comment text is escaped, so it does not include stars in multi-line comments. * * @since 1.3 */ public String getFileComment(final Pattern pattern) { final PatternModel patternModel = EcoreUtil2.<PatternModel>getContainerOfType(pattern, PatternModel.class); return this.getFileComment(patternModel); }
/** * @since 1.3 */ @Override public IInputKey getInferredType(Expression var) { final Pattern containingPattern = EcoreUtil2.getContainerOfType(var, Pattern.class); TypeInformation information = collectConstraints(containingPattern); return information.getType(var); }
@Override public boolean filter(AbstractElement grammarElement) { if (grammarElement.eContainer() instanceof AbstractRule) return false; if (EcoreUtil2.getContainerOfType(grammarElement.eContainer(), Assignment.class) != null) return true; return false; }
@Check public void checkActionInUnorderedGroup(final Action action) { if (EcoreUtil2.getContainerOfType(action, UnorderedGroup.class) != null) error( "Actions may not be used in unordered groups.", action, null, ValidationMessageAcceptor.INSIGNIFICANT_INDEX, INVALID_ACTION_USAGE); }
public String getContextName(Action ctx) { ParserRule rule = EcoreUtil2.getContainerOfType(ctx, ParserRule.class); return rule.getName() + "_" + getUniqueActionName(ctx); }
public Set<TemplateVariable> getEnclosingMacroParameters(final EObject object) { final Macro container = EcoreUtil2.<Macro>getContainerOfType(object, Macro.class); if ((container != null)) { return this.amlModelUtil.getReferenceableVariables(container.getTemplate()); } return Collections.<TemplateVariable>unmodifiableSet(CollectionLiterals.<TemplateVariable>newHashSet()); }
public Iterable<EnvironmentVariable> getEnvParams(final EObject object) { final TclModel root = EcoreUtil2.<TclModel>getContainerOfType(object, TclModel.class); if (((root != null) && (root.getEnvironmentVariables() != null))) { return root.getEnvironmentVariables(); } return Collections.<EnvironmentVariable>unmodifiableSet(CollectionLiterals.<EnvironmentVariable>newHashSet()); }
public IScope scope_TabMenu_panel(TabMenu tabMenu, EReference eReference) { Page containingPage = EcoreUtil2.getContainerOfType(tabMenu, Page.class); List<XmadslComposite> elements = PomElementCollector.getNSXmadslComposite(containingPage); return new SimpleScope(Scopes.scopedElementsFor(elements)); }
public IScope scope_TabSetting_excludedElements(TabSetting tabSetting, EReference eReference) { LogicItem containingLogicItem = (LogicItem)EcoreUtil2.getContainerOfType(tabSetting,LogicItem.class); Collection<EObject> elements = new ArrayList<EObject>(); GuiElement guiElement = containingLogicItem.getGuiElement(); if (guiElement instanceof Composite) { Composite composite = (Composite)guiElement; elements = PomElementCollector.getAllGuiElementsOfComposite(composite); } return new SimpleScope(Scopes.scopedElementsFor(elements, customPomDslNameProvider)); }
public Template getMacroTemplate(final StepContentElement contentElement) { final TestStep containingTestStep = EcoreUtil2.<TestStep>getContainerOfType(contentElement, TestStep.class); if ((containingTestStep != null)) { final Macro macro = this.findMacroDefinition(containingTestStep, this.getMacroContext(containingTestStep)); Template _template = null; if (macro!=null) { _template=macro.getTemplate(); } return _template; } return null; }
public final IScope scope_CallOutputParameter_attribute(CallableStatement callableStatement, EReference reference) { QueryOperation queryOperation = EcoreUtil2.getContainerOfType(callableStatement, QueryOperation.class); List<EObject> outParametersScope = Lists.newArrayList(); if (queryOperation.getType() instanceof ComplexType) { ComplexType complexType = (ComplexType) queryOperation.getType(); outParametersScope.addAll(complexType.getAllAttributes()); } return new SimpleScope(scopedElementsFor(Iterables.concat(outParametersScope, getInputParameters(callableStatement)))); }
public IScope scope_Codetemplate_context(Codetemplate template, EReference reference) { Codetemplates root = EcoreUtil2.getContainerOfType(template, Codetemplates.class); if (root != null && root.getLanguage() != null) { Grammar grammar = root.getLanguage(); if (!grammar.eIsProxy()) { LinkedHashSet<AbstractRule> usedRules = Sets.newLinkedHashSet(); new UsedRulesFinder(usedRules).compute(grammar); return Scopes.scopeFor(Iterables.filter(usedRules, ParserRule.class)); } } return IScope.NULLSCOPE; }
public IScope scope_ColumnInfo_columns(ColumnInfo columnOrder, EReference eReference) { LogicItem containingLogicItem = (LogicItem)EcoreUtil2.getContainerOfType(columnOrder,LogicItem.class); Table table = (Table)containingLogicItem.getGuiElement(); return new SimpleScope(Scopes.scopedElementsFor(table.getColumns(), customPomDslNameProvider)); }
@Override protected void doGetElements(JvmType type, List<IEObjectDescription> result) { if (type instanceof JvmDeclaredType) { JvmDeclaredType declarator = innermost; while(declarator != null) { if (declarator != type && EcoreUtil.isAncestor(declarator, type)) { doGetDescriptions(type, declarator, 0, result); } declarator = EcoreUtil2.getContainerOfType(declarator.eContainer(), JvmDeclaredType.class); } } super.doGetElements(type, result); }
public final IScope scope_DataBaseConstraint_attributes(DataBaseConstraint dataBaseConstraint, EReference eReference) { Dao dao = EcoreUtil2.getContainerOfType(dataBaseConstraint, Dao.class); return new SimpleScope(scopedElementsFor(dao.getEntity().getAllAttributes())); }
@Check public void checkConstructorArgumentsAreValid(XFeatureCall featureCall) { JvmIdentifiableElement feature = featureCall.getFeature(); if (feature != null && !feature.eIsProxy() && feature instanceof JvmConstructor) { JvmType containerType = EcoreUtil2.getContainerOfType(logicalContainerProvider.getNearestLogicalContainer(featureCall), JvmType.class); for(XExpression argument: featureCall.getFeatureCallArguments()) { checkIsValidConstructorArgument(argument, containerType); } } }