Class TrueFilter

java.lang.Object
org.dspace.content.logic.TrueFilter
All Implemented Interfaces:
Filter, LogicalStatement, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware

public class TrueFilter extends Object implements Filter
Extremely simple filter that always returns true! Useful to pass to methods that expect a filter, in order to effectively say "all items". This could be configured in Spring XML but it is more stable and reliable to have it hard-coded here so that any broken configuration doesn't silently break parts of DSpace that expect it to work.
Author:
Kim Shepherd
  • Constructor Details

    • TrueFilter

      public TrueFilter()
  • Method Details

    • getResult

      public boolean getResult(Context context, Item item) throws LogicalStatementException
      Description copied from interface: Filter
      Get the result of logical evaluation for an item
      Specified by:
      getResult in interface Filter
      Specified by:
      getResult in interface LogicalStatement
      Parameters:
      context - DSpace context
      item - Item to evaluate
      Returns:
      boolean
      Throws:
      LogicalStatementException
    • setBeanName

      public void setBeanName(String name)
      Specified by:
      setBeanName in interface org.springframework.beans.factory.BeanNameAware
    • getName

      public String getName()
      Description copied from interface: Filter
      Get the name of a filter. This can be used by filters which make use of BeanNameAware to return the bean name.
      Specified by:
      getName in interface Filter
      Returns:
      the id/name of this spring bean