public class RegexpBlacklistEidValidator extends Object implements EidValidator
User EID "validation" by checking
for matches in a configurable blacklist, entries in which
are treated as regular expressions.| Constructor and Description |
|---|
RegexpBlacklistEidValidator() |
| Modifier and Type | Method and Description |
|---|---|
Collection<String> |
getEidBlacklist()
Access the String representation of blacklisted User EID
regexps configured on this object.
|
int |
getRegexpFlags()
Access the configured set of
Pattern matching
flags. |
protected boolean |
isBlackListedEid(String eid)
Encapsulates the logic for actually checking a user EID
against the configured blacklist.
|
protected boolean |
isMinimallyValidEid(String eid)
As implemented requires that the given ID be non-null
and non-whitespace.
|
boolean |
isSearchableEid(String eid)
Requires minimally valid and non-blacklisted EIDs.
|
void |
setEidBlacklist(Collection<String> eidBlacklist)
Converts the given collection of Strings into a collection
of s and caches the latter for evaluation
by
isSearchableEid(String). |
void |
setRegexpFlags(int regexpFlags)
Assign a bitmask for
Pattern matching behaviors. |
public boolean isSearchableEid(String eid)
isMinimallyValidEid(String)
and isBlackListedEid(String). Theoretically, then,
a subclass could override isMinimallyValidEid(String)
to, for example, allow any non-null EID but allow any
EID not described by the current blacklist.isSearchableEid in interface EidValidatorprotected boolean isMinimallyValidEid(String eid)
eid - and EID to testtrue unless the given String is
null or entirely whitespaceprotected boolean isBlackListedEid(String eid)
falsetrue if the eid matches a configured
blacklist pattern. false otherwise (e.g.
if no configured blacklist).public Collection<String> getEidBlacklist()
setEidBlacklist(Collection)public void setEidBlacklist(Collection<String> eidBlacklist)
isSearchableEid(String). Configure {link Pattern}
evaluation flags with setRegexpFlags(int).eidBlacklist - a collection of Strings to be compiled
into Patterns. May be null, which
will have the same semantics as an empty collection.public int getRegexpFlags()
Pattern matching
flags. Defaults to zero.Pattern matching flagsPattern.compile(String, int)public void setRegexpFlags(int regexpFlags)
Pattern matching behaviors.
Be sure to set this property prior to invoking
setEidBlacklist(Collection). The cached Patterns
will not be recompiled as a side-effect of
invoking this method.regexpFlags - Copyright © 2005–2019 Sakai Project Contributor see (see NOTICE.txt). All rights reserved.