Class ValidatorUtils
- java.lang.Object
-
- org.apache.commons.validator.util.ValidatorUtils
-
public class ValidatorUtils extends java.lang.ObjectBasic utility methods.The use of FastHashMap is deprecated and will be replaced in a future release.
- Version:
- $Revision: 1713452 $
-
-
Field Summary
Fields Modifier and Type Field Description private static org.apache.commons.logging.LogLOG
-
Constructor Summary
Constructors Constructor Description ValidatorUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static org.apache.commons.collections.FastHashMapcopyFastHashMap(org.apache.commons.collections.FastHashMap map)Deprecated.This method is not part of Validator's public API.static java.util.Map<java.lang.String,java.lang.Object>copyMap(java.util.Map<java.lang.String,java.lang.Object> map)Makes a deep copy of aMapif the values areMsg,Arg, orVar.static java.lang.StringgetValueAsString(java.lang.Object bean, java.lang.String property)Convenience method for getting a value from a bean property as aString.static java.lang.Stringreplace(java.lang.String value, java.lang.String key, java.lang.String replaceValue)Replace part of aStringwith another value.
-
-
-
Method Detail
-
replace
public static java.lang.String replace(java.lang.String value, java.lang.String key, java.lang.String replaceValue)Replace part of a
Stringwith another value.- Parameters:
value-Stringto perform the replacement on.key- The name of the constant.replaceValue- The value of the constant.- Returns:
- The modified value.
-
getValueAsString
public static java.lang.String getValueAsString(java.lang.Object bean, java.lang.String property)Convenience method for getting a value from a bean property as aString. If the property is aString[]orCollectionand it is empty, an emptyString"" is returned. Otherwise, property.toString() is returned. This method may returnnullif 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.
-
copyFastHashMap
public static org.apache.commons.collections.FastHashMap copyFastHashMap(org.apache.commons.collections.FastHashMap map)
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 aFastHashMapif the values areMsg,Arg, orVar. Otherwise it is a shallow copy.- Parameters:
map-FastHashMapto copy.- Returns:
- FastHashMap A copy of the
FastHashMapthat was passed in.
-
copyMap
public static java.util.Map<java.lang.String,java.lang.Object> copyMap(java.util.Map<java.lang.String,java.lang.Object> map)
Makes a deep copy of aMapif the values areMsg,Arg, orVar. Otherwise, it is a shallow copy.- Parameters:
map- The source Map to copy.- Returns:
- A copy of the
Mapthat was passed in.
-
-