org.apache.commons.validator

Class ValidatorUtil


public class ValidatorUtil
extends java.lang.Object

Basic utility methods.

Field Summary

static java.lang.String
REGEXP_DELIMITER
Deprecated. Use "/" directly.
protected static Log
log
Deprecated. Subclasses should use their own logging instance.

Method Summary

static FastHashMap
copyFastHashMap(FastHashMap map)
Makes a deep copy of a FastHashMap if the values are String, Msg, Arg, or Var.
static java.lang.String
getDelimitedRegExp(java.lang.String regexp)
Deprecated. Use "/" directly.
static java.lang.String
getValueAsString(java.lang.Object bean, java.lang.String property)
Convenience method for getting a value from a bean property as a String.
static java.lang.String
replace(java.lang.String value, java.lang.String key, java.lang.String replaceValue)
Replace part of a String with another value.

Field Details

REGEXP_DELIMITER

public static final java.lang.String REGEXP_DELIMITER

Deprecated. Use "/" directly.

Delimiter to put around a regular expression following Perl 5 syntax.

Field Value:
"/"


log

protected static Log log

Deprecated. Subclasses should use their own logging instance.

Logger.

Method Details

copyFastHashMap

public static FastHashMap copyFastHashMap(FastHashMap map)
Makes a deep copy of a FastHashMap if the values are String, Msg, Arg, or Var. Otherwise it is a shallow copy.

Parameters:
map - FastHashMap to copy.

Returns:
FastHashMap A copy of the FastHashMap that was passed in.


getDelimitedRegExp

public static java.lang.String getDelimitedRegExp(java.lang.String regexp)

Deprecated. Use "/" directly.

Adds a '/' on either side of the regular expression.


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 a String.


replace

public static java.lang.String replace(java.lang.String value,
                                       java.lang.String key,
                                       java.lang.String replaceValue)
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.


Copyright (c) 2001-2004 Apache Software Foundation