Overview | Package | Class | Tree | Deprecated | Index | Help
| SolarMetric Kodo JDO 2.5.8 generated on January 11 2004
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.solarmetric.kodo.query
Interface FilterListener

All Known Subinterfaces:
  JDBCFilterListener

All Known Implementing Classes:
  com.solarmetric.kodo.query.listen.StringContains, com.solarmetric.kodo.query.listen.WildcardMatch, com.solarmetric.kodo.query.listen.CaseInsContains, com.solarmetric.kodo.query.listen.CaseInsStarts, com.solarmetric.kodo.query.listen.CaseInsEnds, com.solarmetric.kodo.query.listen.ToUpperCase, com.solarmetric.kodo.query.listen.ToLowerCase

public interface FilterListener

A filter listener extends JDOQL filters with custom functionality.

Method Summary
`Object` | `evaluate(Object target, Object arg, Object candidate, PersistenceManagerImpl pm)` Evaluate the given expression.
`boolean` | `expectsArgument()` Return true if this extension expects an argument to act on.
`boolean` | `expectsTarget()` Return true if this extension expects a target to act on.
`String` | `getTag()` Return the tag that this extension listens for.
`boolean` | `isExpression()` Return true if this extension is an expression; i.e.

Method Detail

### getTag

    public String getTag()

  Return the tag that this extension listens for.

### expectsArgument

    public boolean expectsArgument()

  Return true if this extension expects an argument to act on. Some extensions may not need arguments; for example, an extension to switch a string to upper case might be of the form: `field.ext:toUpperCase ()`.

### expectsTarget

    public boolean expectsTarget()

  Return true if this extension expects a target to act on. Some extensions act on a field or object value; others stand alone. `field.ext:toUpperCase ()` acts on the target `field` but has no arguments, while another possible form, `ext:toUpperCase (field)` has no target but does have an argument.

### isExpression

    public boolean isExpression()

  Return true if this extension is an expression; i.e. if it evaluates to `true` or `false` on its own.

### evaluate

    public Object evaluate(Object target,
                           Object arg,
                           Object candidate,
                           PersistenceManagerImpl pm)

  Evaluate the given expression. This method is used when evaluating in-memory expressions. The method used when evaluating data store expressions will change depending on the data store in use.
  Parameters:
    `target` - the target object / field value to act on; will be null if this extension does not expect a target
    `arg` - the value of the argument given in the filter; will be null if this extension does not expect an argument
    `candidate` - the candidate object being evaluated
    `pm` - a persistence manager to use if needed
  Returns:
    the value of the extension for this candidate; if this extension is an expression, this method should return `Boolean.TRUE` or `Boolean.FALSE`
  Throws:
    `JDOUserException` - if this extension does not support in-memory operation

Overview | Package | Class | Tree | Deprecated | Index | Help
| SolarMetric Kodo JDO 2.5.8 generated on January 11 2004
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright 2001,2002,2003 SolarMetric, Inc. All Rights Reserved.