public final class TargetSelector
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
TargetSelector.Result<TNode>
Query result struct
|
| Modifier and Type | Method and Description |
|---|---|
static ITargetSelector |
parse(IAnnotationHandle annotation,
ISelectorContext context)
Parse a target selector from the supplied annotation
|
static java.util.Set<ITargetSelector> |
parse(java.lang.Iterable<?> selectors,
ISelectorContext context)
Parse a collection of target selector representations (strings,
annotations, class literals) into selectors.
|
static java.util.Set<ITargetSelector> |
parse(java.lang.Iterable<?> selectors,
ISelectorContext context,
java.util.Set<ITargetSelector> parsed)
Parse a collection of target selector representations (strings,
annotations, class literals) into selectors and store them in the
provided collection.
|
static ITargetSelector |
parse(java.lang.String string,
ISelectorContext context)
Parse a target selector from a string
|
static ITargetSelector |
parseAndValidate(IAnnotationHandle annotation,
ISelectorContext context)
Parse a target selector from the supplied annotation and perform
validation
|
static java.util.Set<ITargetSelector> |
parseAndValidate(java.lang.Iterable<?> selectors,
ISelectorContext context)
Parse a collection of target selector representations (strings,
annotations, class literals) into selectors.
|
static ITargetSelector |
parseAndValidate(java.lang.String string,
ISelectorContext context)
Parse a target selector from a string and perform validation
|
static java.lang.String |
parseName(java.lang.String name,
ISelectorContext context)
Parse a target selector from the supplied name, and then return the name
of the match.
|
static void |
register(java.lang.Class<? extends ITargetSelectorDynamic> type,
java.lang.String namespace)
Register a dynamic target selector class.
|
static <TNode> TargetSelector.Result<TNode> |
run(ITargetSelector selector,
java.lang.Iterable<ElementNode<TNode>> nodes)
Run query on supplied target nodes
|
static <TNode> TargetSelector.Result<TNode> |
run(java.lang.Iterable<ITargetSelector> selector,
java.lang.Iterable<ElementNode<TNode>> nodes)
Run query on supplied target nodes
|
public static void register(java.lang.Class<? extends ITargetSelectorDynamic> type, java.lang.String namespace)
ITargetSelectorDynamic.SelectorId annotation for registration to
succeed.type - ITargetSelectorDynamic to registernamespace - namespace for SelectorIdpublic static ITargetSelector parseAndValidate(IAnnotationHandle annotation, ISelectorContext context) throws InvalidSelectorException
annotation - Annotation to parse target selector fromcontext - Context to use for reference mappingInvalidSelectorExceptionpublic static ITargetSelector parseAndValidate(java.lang.String string, ISelectorContext context) throws InvalidSelectorException
string - String to parse target selector fromcontext - Context to use for reference mappingInvalidSelectorExceptionpublic static java.util.Set<ITargetSelector> parseAndValidate(java.lang.Iterable<?> selectors, ISelectorContext context) throws InvalidSelectorException
selectors - Selectors to parsecontext - Selection contextInvalidSelectorExceptionpublic static java.util.Set<ITargetSelector> parse(java.lang.Iterable<?> selectors, ISelectorContext context)
selectors - Selectors to parsecontext - Selection contextpublic static java.util.Set<ITargetSelector> parse(java.lang.Iterable<?> selectors, ISelectorContext context, java.util.Set<ITargetSelector> parsed)
selectors - Selectors to parsecontext - Selection contextparsed - Collection to add parsed selectors to, initialised as a
LinkedHashSet if nullpublic static ITargetSelector parse(IAnnotationHandle annotation, ISelectorContext context)
annotation - String to parse target selector fromcontext - Context to use for reference mappingpublic static ITargetSelector parse(java.lang.String string, ISelectorContext context)
string - String to parse target selector fromcontext - Context to use for reference mappingpublic static java.lang.String parseName(java.lang.String name,
ISelectorContext context)
name - Name to parsecontext - Mixin contextpublic static <TNode> TargetSelector.Result<TNode> run(ITargetSelector selector, java.lang.Iterable<ElementNode<TNode>> nodes)
TNode - Node typeselector - Target selectornodes - Node collection to enumeratepublic static <TNode> TargetSelector.Result<TNode> run(java.lang.Iterable<ITargetSelector> selector, java.lang.Iterable<ElementNode<TNode>> nodes)
TNode - Node typeselector - Target selectornodes - Node collection to enumerate