public EventDrivenTransformationBuilder setScope(EMFScope scope) throws IncQueryException { this.engine = IncQueryEngine.on(scope); return this; }
/** * Initializes the pattern matcher within an existing EMF-IncQuery engine. * If the pattern matcher is already constructed in the engine, only a * light-weight reference is returned. The match set will be incrementally * refreshed upon updates. * * @param engine * the existing EMF-IncQuery engine in which this matcher will be * created. * @param querySpecification * the query specification for which the matcher is to be * constructed. * @throws IncQueryException * if an error occurs during pattern matcher creation */ public static GenericPatternMatcher on(IncQueryEngine engine, GenericQuerySpecification querySpecification) throws IncQueryException { // check if matcher already exists GenericPatternMatcher matcher = engine .getExistingMatcher(querySpecification); if (matcher == null) { matcher = new GenericPatternMatcher(engine, querySpecification); // do not have to "put" it into engine.matchers, // reportMatcherInitialized() will take care of it } return matcher; }
/** * Initializes a pattern-specification mapping with the contents of an existing {@link IncQueryEngine}. </p> * <p> * <strong>Warning</strong> It is assumed that each query specification in the engine has a unique fqn - if the * assumption fails, the resulting map is unspecified. * * @param engine */ public NameToSpecificationMap(IncQueryEngine engine) { this(); for (IncQueryMatcher<?> matcher : engine.getCurrentMatchers()) { IQuerySpecification<?> specification = matcher.getSpecification(); map.put(specification.getFullyQualifiedName(), specification); } }
public static EventDrivenTransformationBuilder forScope(EMFScope scope) throws IncQueryException { return forEngine(IncQueryEngine.on(scope)); }