Class ValidatorUtils
java.lang.Object
org.apache.commons.validator.util.ValidatorUtils
Basic utility methods.
The use of FastHashMap is deprecated and will be replaced in a future release.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.commons.collections.FastHashMap
copyFastHashMap
(org.apache.commons.collections.FastHashMap fastHashMap) Deprecated.This method is not part of Validator's public API.Makes a deep copy of aMap
if the values areMsg
,Arg
, orVar
.static String
getValueAsString
(Object bean, String property) Convenience method for getting a value from a bean property as aString
.static String
Replace part of aString
with another value.
-
Constructor Details
-
ValidatorUtils
public ValidatorUtils()
-
-
Method Details
-
copyFastHashMap
@Deprecated public static org.apache.commons.collections.FastHashMap copyFastHashMap(org.apache.commons.collections.FastHashMap fastHashMap) Deprecated.This method is not part of Validator's public API. Validator will use it internally until FastHashMap references are removed. Use copyMap() instead.Makes a deep copy of aFastHashMap
if the values areMsg
,Arg
, orVar
. Otherwise it is a shallow copy.- Parameters:
fastHashMap
-FastHashMap
to copy.- Returns:
- FastHashMap A copy of the
FastHashMap
that was passed in.
-
copyMap
Makes a deep copy of aMap
if the values areMsg
,Arg
, orVar
. Otherwise, it is a shallow copy.- Parameters:
map
- The source Map to copy.- Returns:
- A copy of the
Map
that was passed in.
-
getValueAsString
Convenience method for getting a value from a bean property as aString
. If the property is aString[]
orCollection
and it is empty, an emptyString
"" is returned. Otherwise, property.toString() is returned. This method may returnnull
if there was an error retrieving the property.- Parameters:
bean
- The bean object.property
- The name of the property to access.- Returns:
- The value of the property.
-
replace
Replace part of a
String
with another value.- Parameters:
value
-String
to perform the replacement on.key
- The name of the constant.replaceValue
- The value of the constant.- Returns:
- The modified value.
-