Top Description Fields Constructors Methods
org.eclipse.jetty.util

public Class UriPatternPredicate

extends Object
implements Predicate<URI>
Class Inheritance
All Implemented Interfaces
java.util.function.Predicate
Imports
java.net.URI, java.util.ArrayList, .List, java.util.function.Predicate, java.util.regex.Pattern

Predicate for matching URI against a provided Regex Pattern

If the pattern is null and isNullInclusive is true, then all URIs will match.

A pattern is a set of acceptable URI names. Each acceptable name is a regex. Each regex can be separated by either a "," or a "|". If you use a "|" this or's together the URI name patterns. This means that ordering of the matches is unimportant to you. If instead, you want to match particular names, and you want to match them in order, you should separate the regexs with "," instead.

Eg "aaa-.*\\.jar|bbb-.*\\.jar" Will iterate over the jar names and match in any order.

Eg "aaa-*\\.jar,bbb-.*\\.jar" Will iterate over the jar names, matching all those starting with "aaa-" first, then "bbb-".

Field Summary

Modifier and TypeField and Description
private final boolean
private final List<Pattern>

Constructor Summary

AccessConstructor and Description
public
UriPatternPredicate(String regex, boolean isNullInclusive)

public
UriPatternPredicate(Pattern pattern, boolean isNullInclusive)

Method Summary

Modifier and TypeMethod and Description
private boolean
match(Pattern pattern, URI uri)

public boolean
test(URI
the input argument
uri
)

Implements java.util.function.Predicate.test.

Evaluates this predicate on the given argument.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

isNullInclusiveback to summary
private final boolean isNullInclusive
subPatternsback to summary
private final List<Pattern> subPatterns

Constructor Detail

UriPatternPredicateback to summary
public UriPatternPredicate(String regex, boolean isNullInclusive)
UriPatternPredicateback to summary
public UriPatternPredicate(Pattern pattern, boolean isNullInclusive)

Method Detail

matchback to summary
private boolean match(Pattern pattern, URI uri)
testback to summary
public boolean test(URI uri)

Implements java.util.function.Predicate.test.

Doc from java.util.function.Predicate.test.

Evaluates this predicate on the given argument.

Parameters
uri:URI

the input argument

Returns:boolean

true if the input argument matches the predicate, otherwise false

Annotations
@Override