public class ContextPattern extends Object implements ContextMatcher, Serializable
Modifier and Type | Class and Description |
---|---|
static class |
ContextPattern.Element
An element of the context pattern.
|
Modifier and Type | Method and Description |
---|---|
static ContextPattern |
any()
Create a context pattern matching any context.
|
ContextPattern |
append(Class<?> type)
Append a type element to this pattern with multiplicity
Multiplicity.ONE . |
ContextPattern |
append(ContextElementMatcher match)
Append an element to this pattern with multiplicity
Multiplicity.ONE . |
ContextPattern |
append(ContextElementMatcher match,
Multiplicity mult)
Append an element to this pattern.
|
ContextPattern |
append(ContextPattern toAppend)
Append a context pattern to this pattern.
|
ContextPattern |
appendDotStar()
Return a pattern matching any context of which the current pattern matches a prefix.
|
static ContextPattern |
empty()
Create an empty context pattern.
|
boolean |
equals(Object o) |
int |
hashCode() |
ContextMatch |
matches(InjectionContext context)
Attempt to match this context matcher against the specified context.
|
static ContextPattern |
subsequence(Class<?>... types)
Create a context matcher matching any context with the specified subsequence.
|
static ContextPattern |
subsequence(ContextElementMatcher... matchers)
Create a context matcher matching any context with a subequence matching the provided matchers.
|
String |
toString() |
public static ContextPattern empty()
public static ContextPattern any()
public static ContextPattern subsequence(Class<?>... types)
types
- The subsequence to match.types
(with the default
qualifier matchers) is a subsequence.public static ContextPattern subsequence(ContextElementMatcher... matchers)
matchers
- The matchers to match a subsequence.types
(with the default
qualifier matchers) is a subsequence.public ContextPattern append(ContextElementMatcher match, Multiplicity mult)
match
- The element matcher.mult
- The multiplicity of this element.public ContextPattern append(ContextElementMatcher match)
Multiplicity.ONE
.match
- The element matcher.public ContextPattern append(Class<?> type)
Multiplicity.ONE
.type
- The type to match, passed to ContextElements.matchType(Class)
.public ContextPattern append(ContextPattern toAppend)
toAppend
- The pattern to append.toAppend
.public ContextPattern appendDotStar()
.*
regular expression token.public ContextMatch matches(InjectionContext context)
ContextMatcher
ContextMatch
describing the result.matches
in interface ContextMatcher
context
- The context to match.null
if the matcher does not match.Copyright © 2016 GroupLens Research. All rights reserved.