Package org.eclipse.jetty.webapp
Class ClasspathPattern
- java.lang.Object
- 
- java.util.AbstractCollection<E>
- 
- java.util.AbstractSet<java.lang.String>
- 
- org.eclipse.jetty.webapp.ClasspathPattern
 
 
 
- 
- All Implemented Interfaces:
- java.lang.Iterable<java.lang.String>,- java.util.Collection<java.lang.String>,- java.util.Set<java.lang.String>
 
 public class ClasspathPattern extends java.util.AbstractSet<java.lang.String>Classpath classes list performs pattern matching of a class name against an internal array of classpath pattern entries. A class pattern is a string of one of the forms:- 'org.package.SomeClass' will match a specific class
- 'org.package.' will match a specific package hierarchy
- 'org.package.SomeClass$NestedClass ' will match a nested class exactly otherwise. Nested classes are matched by their containing class. (eg. org.example.MyClass matches org.example.MyClass$AnyNestedClass)
- 'file:///some/location/' - A file system directory from which the class was loaded
- 'file:///some/location.jar' - The URI of a jar file from which the class was loaded
- 'jrt:/modulename' - A Java9 module name
- Any of the above patterns preceded by '-' will exclude rather than include the match.
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classClasspathPattern.ByClassstatic classClasspathPattern.ByLocationstatic classClasspathPattern.ByLocationOrModulestatic classClasspathPattern.ByModulestatic classClasspathPattern.ByPackagestatic classClasspathPattern.ByPackageOrName
 - 
Constructor SummaryConstructors Constructor Description ClasspathPattern()ClasspathPattern(java.lang.String pattern)ClasspathPattern(java.lang.String[] patterns)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(java.lang.String pattern)booleanadd(java.lang.String... pattern)protected booleanadd(org.eclipse.jetty.webapp.ClasspathPattern.Entry entry)voidclear()booleanexclude(java.lang.String name)booleanexclude(java.lang.String... name)java.lang.String[]getPatterns()booleaninclude(java.lang.String name)booleaninclude(java.lang.String... name)java.util.Iterator<java.lang.String>iterator()booleanmatch(java.lang.Class<?> clazz)Match the class name against the patternbooleanmatch(java.lang.String name)Match the class name against the patternbooleanmatch(java.lang.String name, java.net.URL url)protected org.eclipse.jetty.webapp.ClasspathPattern.EntrynewEntry(java.lang.String pattern)protected org.eclipse.jetty.webapp.ClasspathPattern.EntrynewEntry(java.lang.String name, boolean inclusive)booleanremove(java.lang.Object o)intsize()- 
Methods inherited from class java.util.AbstractCollectionaddAll, contains, containsAll, isEmpty, retainAll, toArray, toArray, toString
 
- 
 
- 
- 
- 
Method Detail- 
includepublic boolean include(java.lang.String name) 
 - 
includepublic boolean include(java.lang.String... name) 
 - 
excludepublic boolean exclude(java.lang.String name) 
 - 
excludepublic boolean exclude(java.lang.String... name) 
 - 
addpublic boolean add(java.lang.String pattern) - Specified by:
- addin interface- java.util.Collection<java.lang.String>
- Specified by:
- addin interface- java.util.Set<java.lang.String>
- Overrides:
- addin class- java.util.AbstractCollection<java.lang.String>
 
 - 
addpublic boolean add(java.lang.String... pattern) 
 - 
newEntryprotected org.eclipse.jetty.webapp.ClasspathPattern.Entry newEntry(java.lang.String pattern) 
 - 
newEntryprotected org.eclipse.jetty.webapp.ClasspathPattern.Entry newEntry(java.lang.String name, boolean inclusive)
 - 
addprotected boolean add(org.eclipse.jetty.webapp.ClasspathPattern.Entry entry) 
 - 
removepublic boolean remove(java.lang.Object o) - Specified by:
- removein interface- java.util.Collection<java.lang.String>
- Specified by:
- removein interface- java.util.Set<java.lang.String>
- Overrides:
- removein class- java.util.AbstractCollection<java.lang.String>
 
 - 
clearpublic void clear() - Specified by:
- clearin interface- java.util.Collection<java.lang.String>
- Specified by:
- clearin interface- java.util.Set<java.lang.String>
- Overrides:
- clearin class- java.util.AbstractCollection<java.lang.String>
 
 - 
iteratorpublic java.util.Iterator<java.lang.String> iterator() - Specified by:
- iteratorin interface- java.util.Collection<java.lang.String>
- Specified by:
- iteratorin interface- java.lang.Iterable<java.lang.String>
- Specified by:
- iteratorin interface- java.util.Set<java.lang.String>
- Specified by:
- iteratorin class- java.util.AbstractCollection<java.lang.String>
 
 - 
sizepublic int size() - Specified by:
- sizein interface- java.util.Collection<java.lang.String>
- Specified by:
- sizein interface- java.util.Set<java.lang.String>
- Specified by:
- sizein class- java.util.AbstractCollection<java.lang.String>
 
 - 
getPatternspublic java.lang.String[] getPatterns() - Returns:
- array of classpath patterns
 
 - 
matchpublic boolean match(java.lang.String name) Match the class name against the pattern- Parameters:
- name- name of the class to match
- Returns:
- true if class matches the pattern
 
 - 
matchpublic boolean match(java.lang.Class<?> clazz) Match the class name against the pattern- Parameters:
- clazz- A class to try to match
- Returns:
- true if class matches the pattern
 
 - 
matchpublic boolean match(java.lang.String name, java.net.URL url)
 
- 
 
-