Interface Selector
public interface Selector
Matches a set of shapes using a selector expression.
- 
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classDeprecated.This class is no longer necessary.static final classRepresents a selector match found in the model.static final classStarting environment context object used when evaluating a selector. - 
Field Summary
Fields - 
Method Summary
Modifier and TypeMethodDescriptiondefault voidconsumeMatches(Model model, Consumer<Selector.ShapeMatch> shapeMatchConsumer) Matches a selector to a set of shapes and receives each matched shape with the variables that were set when the shape was matched.default voidconsumeMatches(Model model, Selector.StartingContext context, Consumer<Selector.ShapeMatch> shapeMatchConsumer) Matches a selector to a set of shapes and receives each matched shape with the variables that were set when the shape was matched.static SelectorCreates a Selector from aNode.default Stream<Selector.ShapeMatch>Returns a stream ofSelector.ShapeMatchobjects for each match found in a model.default Stream<Selector.ShapeMatch>matches(Model model, Selector.StartingContext startingContext) Returns a stream ofSelector.ShapeMatchobjects for each match found in a model.static SelectorParses a selector expression.default Selector.Runnerrunner()Deprecated.Matches a selector to a model.select(Model model, Selector.StartingContext context) Matches a selector to a model.Returns a stream of shapes in a model that match the selector.shapes(Model model, Selector.StartingContext context) Returns a stream of shapes in a model that match the selector. 
- 
Field Details
- 
IDENTITY
A selector that always returns all provided values. 
 - 
 - 
Method Details
- 
parse
Parses a selector expression.- Parameters:
 expression- Expression to parse.- Returns:
 - Returns the parsed 
Selector. 
 - 
fromNode
Creates a Selector from aNode.- Parameters:
 node- Node to parse.- Returns:
 - Returns the created selector.
 - Throws:
 SourceException- on error.
 - 
select
Matches a selector to a model.- Parameters:
 model- Model used to resolve shapes with.- Returns:
 - Returns the matching shapes.
 
 - 
select
Matches a selector to a model.- Parameters:
 model- Model used to resolve shapes with.context- Selector starting environment context.- Returns:
 - Returns the matching shapes.
 
 - 
consumeMatches
Matches a selector to a set of shapes and receives each matched shape with the variables that were set when the shape was matched.- Parameters:
 model- Model to select shapes from.shapeMatchConsumer- Receives each matched shape and the vars available when the shape was matched.
 - 
consumeMatches
default void consumeMatches(Model model, Selector.StartingContext context, Consumer<Selector.ShapeMatch> shapeMatchConsumer) Matches a selector to a set of shapes and receives each matched shape with the variables that were set when the shape was matched.- Parameters:
 model- Model to select shapes from.context- Selector starting environment context.shapeMatchConsumer- Receives each matched shape and the vars available when the shape was matched.
 - 
shapes
Returns a stream of shapes in a model that match the selector.- Parameters:
 model- Model to match the selector against.- Returns:
 - Returns a stream of matching shapes.
 
 - 
shapes
Returns a stream of shapes in a model that match the selector.- Parameters:
 model- Model to match the selector against.context- Selector starting environment context.- Returns:
 - Returns a stream of matching shapes.
 
 - 
matches
Returns a stream ofSelector.ShapeMatchobjects for each match found in a model.- Parameters:
 model- Model to match the selector against.- Returns:
 - Returns a stream of 
ShapeMatchobjects. 
 - 
matches
Returns a stream ofSelector.ShapeMatchobjects for each match found in a model.- Parameters:
 model- Model to match the selector against.startingContext- Selector starting environment context.- Returns:
 - Returns a stream of 
ShapeMatchobjects. 
 - 
runner
Deprecated.Creates a SelectorRunner, used to customize how a selector is executed.- Returns:
 - Returns the created runner.
 
 
 -