WhiteBlackList.WhiteBlackListPrefix
, WhiteBlackList.WhiteBlackListWholeString
public abstract class WhiteBlackList extends Object
Modifier and Type | Class | Description |
---|---|---|
static class |
WhiteBlackList.WhiteBlackListLeafname |
Whitelist/blacklist for prefix strings.
|
static class |
WhiteBlackList.WhiteBlackListPrefix |
Whitelist/blacklist for prefix strings.
|
static class |
WhiteBlackList.WhiteBlackListWholeString |
Whitelist/blacklist for whole-strings matches.
|
Modifier and Type | Field | Description |
---|---|---|
protected Set<String> |
blacklist |
Blacklisted items (whole-string match)
|
protected Set<String> |
blacklistGlobs |
Blacklist glob strings.
|
protected List<Pattern> |
blacklistPatterns |
Blacklist regexp patterns.
|
protected List<String> |
blacklistPrefixes |
Blacklisted items (prefix match)
|
protected Set<String> |
whitelist |
Whitelisted items (whole-string match)
|
protected Set<String> |
whitelistGlobs |
Whitelist glob strings.
|
protected List<Pattern> |
whitelistPatterns |
Whitelist regexp patterns.
|
protected List<String> |
whitelistPrefixes |
Whitelisted items (prefix match)
|
Constructor | Description |
---|---|
WhiteBlackList() |
Constructor for deserialization.
|
Modifier and Type | Method | Description |
---|---|---|
abstract void |
addToBlacklist(String str) |
|
abstract void |
addToWhitelist(String str) |
|
static String |
classNameToClassfilePath(String className) |
Convert a class name to a classfile path.
|
static Pattern |
globToPattern(String glob) |
Convert a spec with a '*' glob character into a regular expression.
|
abstract boolean |
isBlacklisted(String str) |
|
boolean |
isSpecificallyWhitelisted(String str) |
|
boolean |
isSpecificallyWhitelistedAndNotBlacklisted(String str) |
|
abstract boolean |
isWhitelisted(String str) |
|
abstract boolean |
isWhitelistedAndNotBlacklisted(String str) |
|
static String |
normalizePackageOrClassName(String packageOrClassName) |
Remove initial and final '.' characters, if any.
|
static String |
normalizePath(String path) |
Remove initial and final '/' characters, if any.
|
static String |
packageNameToPath(String packageName) |
Convert a package name to a path.
|
static String |
pathToPackageName(String path) |
Convert a path to a package name.
|
void |
sortPrefixes() |
Need to sort prefixes to ensure correct whitelist/blacklist evaluation (see Issue #167).
|
String |
toString() |
|
abstract boolean |
whitelistHasPrefix(String str) |
|
boolean |
whitelistIsEmpty() |
protected Set<String> whitelistGlobs
protected Set<String> blacklistGlobs
protected transient List<Pattern> whitelistPatterns
public abstract void addToWhitelist(String str)
str
- The string to whitelist.public abstract void addToBlacklist(String str)
str
- The string to blacklist.public abstract boolean isWhitelistedAndNotBlacklisted(String str)
str
- The string to test.public abstract boolean isWhitelisted(String str)
str
- The string to test.public abstract boolean whitelistHasPrefix(String str)
str
- The string to test.public abstract boolean isBlacklisted(String str)
str
- The string to test.public static String normalizePath(String path)
path
- The path to normalize.public static String normalizePackageOrClassName(String packageOrClassName)
packageOrClassName
- The package or class name.public static String pathToPackageName(String path)
path
- The path.public static String packageNameToPath(String packageName)
packageName
- The package name.public static String classNameToClassfilePath(String className)
className
- The class name.public static Pattern globToPattern(String glob)
glob
- The glob string.public boolean whitelistIsEmpty()
public boolean isSpecificallyWhitelistedAndNotBlacklisted(String str)
str
- The string to test.public boolean isSpecificallyWhitelisted(String str)
str
- The string to test.public void sortPrefixes()
Copyright © 2018. All rights reserved.