public FinderContext( Set<FlowElement> excludes ) { getExcludedElements().addAll( excludes ); }
public boolean isIgnored( FlowElement flowElement ) { return getIgnoredElements().contains( flowElement ); } }
public boolean isRequired( FlowElement flowElement ) { return getRequiredElements().contains( flowElement ); }
private boolean areCompatibleNodes( int node1, int node2 ) { Expression expression = matchGraph.getVertex( node1 ); FlowElement flowElement = elementGraph.getVertex( node2 ); boolean result; if( ( (ElementExpression) expression ).getCapture() == ElementCapture.Primary && !finderContext.getRequiredElements().isEmpty() ) result = finderContext.isRequired( flowElement ); else if( finderContext.isExcluded( flowElement ) || finderContext.isIgnored( flowElement ) ) result = false; else result = expression.applies( plannerContext, elementGraph.getElementGraph(), flowElement ); if( LOG.isDebugEnabled() && result ) LOG.debug( "compatible nodes: {}:{} matched {}:{}", node1, expression, node2, flowElement ); return result; }
if( finderContext.getRequiredElements().isEmpty() ) finderContext.getRequiredElements().addAll( anchoredElements ); finderContext.getMatchedElements().addAll( vertexMapping.values() ); finderContext.getMatchedScopes().addAll( getCapturedEdges( plannerContext, elementGraph, vertexMapping ) ); finderContext.getIgnoredElements().addAll( includedElements ); return new Match( matchExpression, elementGraph, mapping, finderContext.getMatchedElements(), finderContext.getMatchedScopes(), captureMap );
public Match findAllMatchesOnPrimary( PlannerContext plannerContext, ElementGraph elementGraph, Set<FlowElement> excludes ) { return findMatchesOnPrimary( new FinderContext( excludes ), plannerContext, elementGraph, false ); }
public Map<ElementExpression, FlowElement> findMapping( PlannerContext plannerContext, ElementGraph elementGraph ) { return findMapping( new FinderContext(), plannerContext, elementGraph ); }
public Match findFirstMatch( PlannerContext plannerContext, ElementGraph elementGraph, Set<FlowElement> exclusions ) { return findFirstMatch( new FinderContext( exclusions ), plannerContext, elementGraph ); }
public boolean isExcluded( FlowElement flowElement ) { return getExcludedElements().contains( flowElement ); }
public Match findMatchesOnPrimary( PlannerContext plannerContext, ElementGraph elementGraph, boolean firstOnly, Set<FlowElement> excludes ) { return findMatchesOnPrimary( new FinderContext( excludes ), plannerContext, elementGraph, firstOnly ); }
public Match findFirstMatch( PlannerContext plannerContext, ElementGraph elementGraph ) { return findFirstMatch( new FinderContext(), plannerContext, elementGraph ); }
public Match findAllMatchesOnPrimary( PlannerContext plannerContext, ElementGraph elementGraph ) { return findMatchesOnPrimary( new FinderContext(), plannerContext, elementGraph, false ); }