Top Description Inners Fields Constructors Methods
org.eclipse.jetty.ee10.webapp

public Class ClassMatcher

extends AbstractSet<String>
Class Inheritance
Imports
java.io.IOException, java.net.URI, .URISyntaxException, .URL, java.nio.file.Files, .Path, .Paths, java.util.AbstractSet, .ArrayList, .Arrays, .HashMap, .HashSet, .Iterator, .List, .Map, .Set, java.util.function.Predicate, .Supplier, org.eclipse.jetty.util.IncludeExcludeSet, .Index, .StringUtil, .TypeUtil, .URIUtil

A matcher for classes based on package and/or location and/or module/

Performs pattern matching of a class against a set of pattern entries. A class pattern is a string of one of the forms:

When class is initialized from a classpath pattern string, entries in this string should be separated by ':' (semicolon) or ',' (comma).

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
public static class
public static class
public static class
public static class
public static class
private static class
public static class
private static class
private static class
private static class

Field Summary

Modifier and TypeField and Description
private final Map<String, ClassMatcher.Entry>
private final IncludeExcludeSet<ClassMatcher.Entry, URI>
private final IncludeExcludeSet<ClassMatcher.Entry, String>

Constructor Summary

AccessConstructor and Description
private
private
public
public
public
ClassMatcher(String... patterns)

public

Method Summary

Modifier and TypeMethod and Description
public boolean
add(String
element to be added to this set
pattern
)

Overrides java.util.AbstractCollection.add.

Implements java.util.Set.add, java.util.Collection.add.

Adds the specified element to this set if it is not already present (optional operation).

public boolean
add(String...
element to be added to this set
pattern
)

Overrides java.util.AbstractCollection.add.

Implements java.util.Set.add, java.util.Collection.add.

Adds the specified element to this set if it is not already present (optional operation).

protected boolean
add(ClassMatcher.Entry
element to be added to this set
entry
)

Overrides java.util.AbstractCollection.add.

Implements java.util.Set.add, java.util.Collection.add.

Adds the specified element to this set if it is not already present (optional operation).

private void
addAll(String[]
array of classpath patterns
classes
)

Add array of classpath patterns.

public ClassMatcher
public void
clear()

Overrides java.util.AbstractCollection.clear.

Implements java.util.Set.clear, java.util.Collection.clear.

Removes all of the elements from this set (optional operation).

pack-priv static boolean

Returns:

true if the class is not excluded but is included, or there are no inclusions. False otherwise.
combine
(IncludeExcludeSet<ClassMatcher.Entry, String>
configured inclusions and exclusions by name
names
,
String
the name to check
name
,
IncludeExcludeSet<ClassMatcher.Entry, URI>
configured inclusions and exclusions by location
locations
,
Supplier<URI>
the location of the class (can be null)
location
)

Match a class against inclusions and exclusions by name and location.

public boolean
public boolean
exclude(String... name)

public String[]
getExclusions()

Returns: array of excluded classpath patterns (without '-' prefix)

public String[]
getInclusions()

Returns: array of inclusive classpath patterns

public String[]
getPatterns()

Returns: array of classpath patterns

public boolean
public boolean
include(String... name)

public Iterator<String>
iterator()

Implements abstract java.util.AbstractCollection.iterator.

Implements java.util.Set.iterator, java.util.Collection.iterator.

Returns an iterator over the elements in this set.

public boolean

Returns:

true if class matches the pattern
match
(String
name of the class to match
name
)

Match the class name against the pattern

public boolean

Returns:

true if class matches the pattern
match
(Class<?>
A class to try to match
clazz
)

Match the class name against the pattern

public boolean
match(String name, URL url)

protected ClassMatcher.Entry
newEntry(String pattern)

protected ClassMatcher.Entry
newEntry(String name, boolean inclusive)

public boolean
remove(Object
object to be removed from this set, if present
o
)

Overrides java.util.AbstractCollection.remove.

Implements java.util.Set.remove, java.util.Collection.remove.

Removes the specified element from this set if it is present (optional operation).

private void
setAll(String[]
array of classpath patterns
classes
)

Initialize the matcher by parsing each classpath pattern in an array

public int
size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.Set.size, java.util.Collection.size.

Returns the number of elements in this set (its cardinality).

Inherited from java.util.AbstractSet:
equalshashCoderemoveAll