Site hosted at byteslooser and Grasia! mirrors.


com.byteslooser.filters.parser.generic
Interface IRelationalOperandFactory

All Known Implementing Classes:
OperandFactory

public interface IRelationalOperandFactory

This interface allows to control the relational operands used in the parser

There are two sets of filter operands: logical operators, used to compose complex filters, and relational operators, used to define basic filter expressions.

By construction, the logical operators are built in in the FilterTextParser, which relies on this factory to provide information for the relational ones

Author:
Luis M Pena - byteslooser@gmail.com

Method Summary
 IRelationalOperand getDefaultOperand(Class<?> c, boolean nullOp, boolean rightId)
          Returns the default operand to apply on a given class
 IRelationalOperand getOperand(char c, String all, int index)
          Returns the operand that exists at the beginning of the substring all[index:]
 void setComparator(Class<?> c, Comparator<?> cmp)
          Defines a comparator for a given class.
 void setIgnoreCase(boolean ignore)
          Defines whether the created operand should be case insensitive.
 

Method Detail

getOperand

IRelationalOperand getOperand(char c,
                              String all,
                              int index)
Returns the operand that exists at the beginning of the substring all[index:]

Parameters:
c - the character at all[index]
all - the whole string
index - the position to start parsing
Returns:
null if the given position does not define a valid operand

getDefaultOperand

IRelationalOperand getDefaultOperand(Class<?> c,
                                     boolean nullOp,
                                     boolean rightId)
Returns the default operand to apply on a given class

Parameters:
c - the type's class
nullOp - true if the value to be associated to the operand is the null instance.
rightId - true if the comparison is against a second identifier

setComparator

void setComparator(Class<?> c,
                   Comparator<?> cmp)
Defines a comparator for a given class. This comparator must be propagated to the operands, to modify their behaviour when comparating objects of this class.


setIgnoreCase

void setIgnoreCase(boolean ignore)
Defines whether the created operand should be case insensitive. This comparator must be propagated to the operands, to modify their behaviour when comparating string objects.