to.etc.domui.component.lookup
Class LookupNumberControl<T extends java.lang.Number>
java.lang.Object
to.etc.domui.component.lookup.AbstractLookupControlImpl
to.etc.domui.component.lookup.LookupNumberControl<T>
- All Implemented Interfaces:
- ILookupControlInstance
public class LookupNumberControl<T extends java.lang.Number>
- extends AbstractLookupControlImpl
Base utility class when lookups of custom numeric conditions should be implemented.
Provides buitin expression parser and range checks, only custom conditions have to be implemented in descendant classes.
- Author:
- Vladimir Mijic
Created on Feb 11, 2010
Constructor Summary |
LookupNumberControl(java.lang.Class<T> valueType,
Text<java.lang.String> node,
java.lang.String propertyName,
java.lang.Number minValue,
java.lang.Number maxValue,
boolean monetary)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UNARY_OPS
public static final java.util.Set<QOperation> UNARY_OPS
BINARY_OPS
public static final java.util.Set<QOperation> BINARY_OPS
LookupNumberControl
public LookupNumberControl(java.lang.Class<T> valueType,
Text<java.lang.String> node,
java.lang.String propertyName,
java.lang.Number minValue,
java.lang.Number maxValue,
boolean monetary)
isMonetary
public final boolean isMonetary()
- T if this control handles a monetary amount.
- Returns:
appendCriteria
protected ILookupControlInstance.AppendCriteriaResult appendCriteria(QCriteria<?> crit,
QOperation op,
T val)
throws java.lang.Exception
- Throws:
java.lang.Exception
checkNumber
protected void checkNumber(T value)
appendCriteria
public ILookupControlInstance.AppendCriteriaResult appendCriteria(QCriteria<?> crit)
throws java.lang.Exception
- Description copied from interface:
ILookupControlInstance
- Evaluate the contents of the input for this lookup line; if the user has
added data there then add the values to the query.
- Specified by:
appendCriteria
in interface ILookupControlInstance
- Specified by:
appendCriteria
in class AbstractLookupControlImpl
- Returns:
- see
ILookupControlInstance.AppendCriteriaResult
- Throws:
java.lang.Exception
scanOperation
protected QOperation scanOperation()
- Checks the current position for a supported operation. If OK the appropriate operation code is
returned and the current pos is advanced after it.
- Returns:
parseNumber
protected T parseNumber(java.lang.String in)
- This delivers a number of the same type as the property by scanning the input string. I use
the monetary amount scanner to allow for max flexibility in input, and the resulting BigDecimal
will be converted to the appropriate type afterwards.
- Parameters:
in
-
- Returns: