Spring LDAP Framework

org.springframework.ldap.filter
Class PresentFilter

java.lang.Object
  extended by org.springframework.ldap.filter.AbstractFilter
      extended by org.springframework.ldap.filter.PresentFilter
All Implemented Interfaces:
Filter

public class PresentFilter
extends AbstractFilter

Filter that allows the user to check for the existence of a attribute. For an attribute to be 'present' it must contain a value. Attributes that do not contain a value are 'NOT present'. To filter on attributes that are 'NOT present' use the NotPresentFilter or use this filter in combination with a NotFilter .

 PresentFilter filter = new PresentFilter("foo*");
 System.out.println(filter.encode());
 
would result in:
  (foo=*)
 

Author:
Jordan Hein

Constructor Summary
PresentFilter(String attribute)
          Creates a new instance of a present filter for a particular attribute.
 
Method Summary
 StringBuffer encode(StringBuffer buff)
          Encodes the filter to a StringBuffer.
 
Methods inherited from class org.springframework.ldap.filter.AbstractFilter
encode, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.springframework.ldap.filter.Filter
equals, hashCode
 

Constructor Detail

PresentFilter

public PresentFilter(String attribute)
Creates a new instance of a present filter for a particular attribute.

Parameters:
attribute - the attribute expected to be present (ie, contains a value).
Method Detail

encode

public StringBuffer encode(StringBuffer buff)
Description copied from interface: Filter
Encodes the filter to a StringBuffer.

Specified by:
encode in interface Filter
Specified by:
encode in class AbstractFilter
Parameters:
buff - The StringBuffer to encode the filter to
Returns:
The same StringBuffer as was given

Spring LDAP Framework

Copyright © 2006-2009 The Spring LDAP Framework. All Rights Reserved.