org.apache.directory.api.ldap.model.schema.comparators
Class WordComparator

java.lang.Object
  extended by org.apache.directory.api.ldap.model.schema.AbstractSchemaObject
      extended by org.apache.directory.api.ldap.model.schema.LoadableSchemaObject
          extended by org.apache.directory.api.ldap.model.schema.LdapComparator<String>
              extended by org.apache.directory.api.ldap.model.schema.comparators.WordComparator
All Implemented Interfaces:
Serializable, Comparator<String>, SchemaObject

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.

Author:
Apache Directory Project
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.directory.api.ldap.model.schema.AbstractSchemaObject
description, extensions, isEnabled, isObsolete, isReadOnly, locked, names, objectType, oid, schemaName, specification
 
Constructor Summary
WordComparator(String oid)
          The StringComparator constructor.
 
Method Summary
 int compare(String value, String assertion)
           
 
Methods inherited from class org.apache.directory.api.ldap.model.schema.LdapComparator
equals, setSchemaManager, toString
 
Methods inherited from class org.apache.directory.api.ldap.model.schema.LoadableSchemaObject
copy, getBytecode, getFqcn, isValid, setBytecode, setFqcn
 
Methods inherited from class org.apache.directory.api.ldap.model.schema.AbstractSchemaObject
addExtension, addExtension, addName, clear, compareOid, copy, getDescription, getExtensions, getName, getNames, getObjectType, getOid, getSchemaName, getSpecification, hashCode, isDisabled, isEnabled, isObsolete, isReadOnly, lock, setDescription, setEnabled, setExtensions, setNames, setNames, setObsolete, setOid, setReadOnly, setSchemaName, setSpecification, unlock
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WordComparator

public WordComparator(String oid)
The StringComparator constructor. Its OID is the StringMatch matching rule OID.

Method Detail

compare

public int compare(String value,
                   String assertion)
See Also:
Comparator.compare(java.lang.Object, java.lang.Object)


Copyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.