public class WordComparator extends LdapComparator<String>
A comparator for Words/KeyWords. RFC 4517 par. 4.2.21 (KeywordMatch) and par. 4.2.32 is pretty vague about the definition of what is a word or a keyword ("...The precise definition of a word is implementation specific...) ("...The identification of keywords in the attribute value and the exactness of the match are both implementation specific...).
We will simply check that the assertion is present in the value at some place, after having deep trimmed the word.
For instance, the word " World " will be found in the value "Hello world!".
A word is defined by the following regexp : "(^|[^A-Za-z0-9])([A-Za-z0-9])*([^A-Za-z0-9]|$)". Anything that is not matched by this regexp will not be considered as a word.
Constructor and Description |
---|
WordComparator(String oid)
The StringComparator constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
compare(String value,
String assertion) |
equals, getNormalizer, hashCode, setSchemaManager, toString
copy, getBytecode, getFqcn, isValid, setBytecode, setFqcn
addExtension, addExtension, addName, clear, copy, getDescription, getExtension, getExtensions, getName, getNames, getObjectType, getOid, getSchemaName, getSpecification, hasExtension, isDisabled, isEnabled, isObsolete, lock, setDescription, setEnabled, setExtensions, setNames, setNames, setObsolete, setOid, setSchemaName, setSpecification, unlock
comparing, comparing, comparingDouble, comparingInt, comparingLong, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public WordComparator(String oid)
oid
- The Comparator's OIDCopyright © 2003–2020 The Apache Software Foundation. All rights reserved.