Class SearchableAttributeNumericBase
- All Implemented Interfaces:
SearchableAttributeValue
- Direct Known Subclasses:
SearchableAttributeFloatValue,SearchableAttributeLongValue
Contains common logic for validation along with a template method for retrieving a validation Pattern.
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
-
Field Summary
Fields inherited from class org.kuali.rice.kew.docsearch.SearchableAttributeBase
ojbConcreteClass -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract PatternReturns a Pattern object used for validating the format of number Strings.booleanisPassesDefaultValidation(String valueEntered) is the given value valid for searching against this attribute?Methods inherited from class org.kuali.rice.kew.docsearch.SearchableAttributeBase
getDocumentId, getOjbConcreteClass, getRouteHeader, getSearchableAttributeKey, getSearchableAttributeValueId, setDocumentId, setOjbConcreteClass, setRouteHeader, setSearchableAttributeKey, setSearchableAttributeValueIdMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.kuali.rice.kew.docsearch.SearchableAttributeValue
allowsCaseInsensitivity, allowsRangeSearches, allowsWildcards, getAttributeDataType, getAttributeTableName, getSearchableAttributeDisplayValue, getSearchableAttributeValue, isRangeValid, setupAttributeValue, setupAttributeValue, toDocumentAttribute
-
Constructor Details
-
SearchableAttributeNumericBase
public SearchableAttributeNumericBase()
-
-
Method Details
-
getDefaultValidationPattern
Returns a Pattern object used for validating the format of number Strings.Patterns 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
- Returns:
- the Pattern used for validating number Strings.
-
isPassesDefaultValidation
is the given value valid for searching against this attribute?This method detects the binary operators defined by
SearchOperator.BETWEEN,SearchOperator.AND, andSearchOperator.ORand 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.
- Parameters:
valueEntered-- Returns:
- true if the valueEntered is considered valid
-