public abstract class SearchableAttributeNumericBase extends SearchableAttributeBase
Contains common logic for validation along with a template method for retrieving a validation Pattern.
ojbConcreteClass
Constructor and Description |
---|
SearchableAttributeNumericBase() |
Modifier and Type | Method and Description |
---|---|
protected abstract Pattern |
getDefaultValidationPattern()
Returns a Pattern object used for validating the format of number Strings.
|
boolean |
isPassesDefaultValidation(String valueEntered)
is the given value valid for searching against this attribute?
|
getDocumentId, getOjbConcreteClass, getRouteHeader, getSearchableAttributeKey, getSearchableAttributeValueId, setDocumentId, setOjbConcreteClass, setRouteHeader, setSearchableAttributeKey, setSearchableAttributeValueId
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
allowsCaseInsensitivity, allowsRangeSearches, allowsWildcards, getAttributeDataType, getAttributeTableName, getSearchableAttributeDisplayValue, getSearchableAttributeValue, isRangeValid, setupAttributeValue, setupAttributeValue, toDocumentAttribute
public SearchableAttributeNumericBase()
protected abstract Pattern getDefaultValidationPattern()
Pattern
s are immutable and thus safe for concurrent use, so it makes sense to return
a pre-compiled static instance.
The pattern should only match valid String representations of the numeric type
public boolean isPassesDefaultValidation(String valueEntered)
This method detects the binary operators defined by
SearchOperator.BETWEEN
,
SearchOperator.AND
, and
SearchOperator.OR
and validates their operands by recursing on them.
It also strips off other valid numeric operators before parsing the leaf operands.
A Pattern which is provided by the template method getDefaultValidationPattern()
is used for parsing
the numeric strings themselves.
Note that the parsing of expressions done here is very rudimentary, this method is mostly focused on validating that any operands are valid numeric strings for the attribute type.
valueEntered
- Copyright © 2005–2016 The Kuali Foundation. All rights reserved.