com.endeca.portal.attributes.filter
Class IncludedPropertyFilter

java.lang.Object
  extended by com.endeca.portal.attributes.filter.IncludedPropertyFilter
All Implemented Interfaces:
BPCFilter

public class IncludedPropertyFilter
extends java.lang.Object
implements BPCFilter

A BasePropertyContainer filter that uses a specified property of the BPC object to determine whether it should be included. If the specified property is found on the BPC object and it's a boolean, then it's value is used for filtering. The filter will return true if the value of the property is true. If the property is not found, the filter will return the default value (which can be configured).

Author:
Endeca Technologies, Inc

Field Summary
static java.lang.String DEFAULT_PROPERTY_NAME
          Default property name to mark whether a BPC is included.
 
Constructor Summary
IncludedPropertyFilter()
          Default constructor.
IncludedPropertyFilter(java.lang.String propertyName)
          Constructor that allows specifying the propertyName parameter.
IncludedPropertyFilter(java.lang.String propertyName, boolean includeByDefault)
          Full constructor.
 
Method Summary
 java.lang.String getPropertyName()
           
 boolean isIncludeByDefault()
           
 void setIncludeByDefault(boolean includeByDefault)
           
 void setPropertyName(java.lang.String propertyName)
           
 boolean test(BasePropertyContainer bpc)
          Checks whether the BPC contains the property as specified by the propertyName parameter of this filter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PROPERTY_NAME

public static final java.lang.String DEFAULT_PROPERTY_NAME
Default property name to mark whether a BPC is included.

See Also:
Constant Field Values
Constructor Detail

IncludedPropertyFilter

public IncludedPropertyFilter()
Default constructor. Sets the propertyName to DEFAULT_PROPERTY_NAME and the includeByDefault to false


IncludedPropertyFilter

public IncludedPropertyFilter(java.lang.String propertyName)
Constructor that allows specifying the propertyName parameter. Sets includeByDefault to false;

Parameters:
propertyName -

IncludedPropertyFilter

public IncludedPropertyFilter(java.lang.String propertyName,
                              boolean includeByDefault)
Full constructor. Allows to specify both the propertyName and includeByDefault parameters.

Parameters:
propertyName -
includeByDefault -
Method Detail

setPropertyName

public void setPropertyName(java.lang.String propertyName)
Parameters:
propertyName - the propertyName to set

getPropertyName

public java.lang.String getPropertyName()
Returns:
the propertyName

setIncludeByDefault

public void setIncludeByDefault(boolean includeByDefault)
Parameters:
includeByDefault - the includeByDefault to set

isIncludeByDefault

public boolean isIncludeByDefault()
Returns:
the includeByDefault

test

public boolean test(BasePropertyContainer bpc)
Checks whether the BPC contains the property as specified by the propertyName parameter of this filter. If it does and it's a boolean, returns the value of that property. Otherwise, returns the value of the includeByDefault parameter for this filter.

Specified by:
test in interface BPCFilter
Parameters:
bpc -
Returns:
true if the BPC should be included, false if the BPC should be filtered out.
See Also:
BPCFilter