public interface Selector
Modifier and Type | Interface and Description |
---|---|
static class |
Selector.Runner
Deprecated.
This class is no longer necessary. It was originally intended
to allow more customization to how selectors are executed against a model,
but this has proven unnecessary.
|
static class |
Selector.ShapeMatch
Represents a selector match found in the model.
|
Modifier and Type | Field and Description |
---|---|
static Selector |
IDENTITY
A selector that always returns all provided values.
|
Modifier and Type | Method and Description |
---|---|
default void |
consumeMatches(Model model,
java.util.function.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 Selector |
fromNode(Node node)
Creates a Selector from a
Node . |
java.util.stream.Stream<Selector.ShapeMatch> |
matches(Model model)
Returns a stream of
Selector.ShapeMatch objects for each match found in
a model. |
static Selector |
parse(java.lang.String expression)
Parses a selector expression.
|
default Selector.Runner |
runner()
Deprecated.
|
default java.util.Set<Shape> |
select(Model model)
Matches a selector to a model.
|
java.util.stream.Stream<Shape> |
shapes(Model model)
Returns a stream of shapes in a model that match the selector.
|
static final Selector IDENTITY
static Selector parse(java.lang.String expression)
expression
- Expression to parse.Selector
.static Selector fromNode(Node node)
Node
.node
- Node to parse.SourceException
- on error.default java.util.Set<Shape> select(Model model)
model
- Model used to resolve shapes with.default void consumeMatches(Model model, java.util.function.Consumer<Selector.ShapeMatch> shapeMatchConsumer)
model
- Model to select shapes from.shapeMatchConsumer
- Receives each matched shape and the vars available when the shape was matched.java.util.stream.Stream<Shape> shapes(Model model)
model
- Model to match the selector against.java.util.stream.Stream<Selector.ShapeMatch> matches(Model model)
Selector.ShapeMatch
objects for each match found in
a model.model
- Model to match the selector against.ShapeMatch
objects.@Deprecated default Selector.Runner runner()
Runner
, used to customize how a selector is
executed.