|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectproper.util.Includer
public class Includer
This class is used to check a field name against a "white list" field names.
It can also contain wildcards like "bla*", "*bla" or "*bla*". This can be
done case-sensitive or -insensitive.
But instead of using only this simple matching scheme you can also use
Perl 5 regular expressions. For this it uses the matches
method of the String class.
It is basically an Excluder with a wrapper around, s.t. java can distinguish
between the Includer and Excluder class (handy for polymorphism).
Excluder
,
String.matches(String)
Constructor Summary | |
---|---|
Includer(java.lang.String l)
initializes the object with a comma separated list of field names (case-insensitive!) |
|
Includer(java.lang.String l,
boolean casesensitive)
initializes the object with a comma separated list of field names (case-sensitive!) |
|
Includer(java.lang.String l,
boolean casesensitive,
boolean regexp)
initializes the object with a comma separated list of field names (case-sensitive!) |
|
Includer(java.util.Vector l)
initializes the object with a given list of names (case-insensitive!) |
|
Includer(java.util.Vector l,
boolean casesensitive)
initializes the object with a given list of names |
|
Includer(java.util.Vector l,
boolean casesensitive,
boolean regexp)
initializes the object with a given list of names |
Method Summary | |
---|---|
boolean |
contains(java.lang.String s)
checks whether the given String is in the list included |
boolean |
contains(java.lang.String s,
boolean regexp)
checks whether the given String is in the list included if regexp is TRUE the given String is assumed to be a regular Expression and that the list contains only normal strings |
boolean |
getCaseSensitive()
returns the case-sensitive state |
java.util.Vector |
getList()
returns the white list |
boolean |
getRegExp()
returns the regular expression state |
int |
matchIndex(java.lang.String s)
returns the index in the list where the first match was encountered |
int |
matchIndex(java.lang.String s,
boolean regexp)
returns the index in the list where the first match was encountered; if regexp is TRUE the given String is assumed to be a regular Expression and that the list contains only normal strings |
java.lang.String |
toString()
returns a string representation of the list |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Includer(java.util.Vector l)
l
- contains field names (wildcard * is allowed)public Includer(java.util.Vector l, boolean casesensitive)
l
- contains field names (wildcard * is allowed)casesensitive
- whether to be case-sensitive or notpublic Includer(java.util.Vector l, boolean casesensitive, boolean regexp)
l
- contains field names (wildcard * is allowed)casesensitive
- whether to be case-sensitive or notregexp
- whether to use perl 5 regexp instead of the simple
"*"-matchingpublic Includer(java.lang.String l)
l
- a string containing field names, separated by commapublic Includer(java.lang.String l, boolean casesensitive)
l
- a string containing field names, separated by commacasesensitive
- whether to be case-sensitive or notpublic Includer(java.lang.String l, boolean casesensitive, boolean regexp)
l
- a string containing field names, separated by commacasesensitive
- whether to be case-sensitive or notregexp
- whether to use perl 5 regexp instead of the simple
"*"-matchingMethod Detail |
---|
public java.util.Vector getList()
getList
in interface CluderInterface
public boolean getCaseSensitive()
getCaseSensitive
in interface CluderInterface
public boolean getRegExp()
public int matchIndex(java.lang.String s)
matchIndex
in interface CluderInterface
public int matchIndex(java.lang.String s, boolean regexp)
matchIndex
in interface CluderInterface
regexp
- whether the given string is a regular expression
or notpublic boolean contains(java.lang.String s)
contains
in interface CluderInterface
public boolean contains(java.lang.String s, boolean regexp)
contains
in interface CluderInterface
regexp
- whether the given string is a regular expression
or notpublic java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |