com.stellent.cis.common.bean
Class ParamBean

java.lang.Object
  extended by com.stellent.cis.common.bean.ParamBean
All Implemented Interfaces:
IParamBean, java.io.Serializable

public class ParamBean
extends java.lang.Object
implements IParamBean

See Also:
Serialized Form

Field Summary
protected static java.lang.String ERROR_EITHER_FIELD_REQUIRED
           
protected static java.lang.String ERROR_FIELD_REQUIRED
           
protected static java.lang.String ERROR_NUMBER_INVALID
           
protected static java.lang.String ERROR_PROPERTY_ON_FIELD
           
protected  java.util.ResourceBundle m_bundle
           
protected  java.lang.String m_bundleName
           
protected static java.util.ResourceBundle s_res
           
 
Fields inherited from interface com.stellent.cis.common.bean.IParamBean
LABEL_PREFIX
 
Constructor Summary
ParamBean()
           
 
Method Summary
protected  java.lang.String getErrorMessage(java.lang.String error)
          Get an error message.
protected  java.lang.String getErrorMessage(java.lang.String error, java.util.ResourceBundle bundle)
          Get the error message from the given resource bundle.
protected  java.lang.String getErrorMessage(java.lang.String error, java.lang.String field)
          Get the error message for the given field
protected  java.lang.String getErrorMessage(java.lang.String error, java.lang.String[] props)
          Get the error message for the given field
protected  ParameterValidationException getException(ParameterValidationException exp)
          Construct a new validation exception if the exception passed in is null; otherwise, just return the exception
 java.lang.String getFieldName(java.lang.String field)
          Get the localized name of the given field
 java.util.ResourceBundle getResourceBundle()
          Get the resource bundle associated with this parameter bean
 void populateData(java.util.Map data)
          Populate this bean
 void setResourceBundle(java.lang.String bundleName)
          Set the name of the resource bundle for this parameter bean
 void setResourceBundle(java.lang.String bundleName, java.util.Locale locale)
          Set the name of the resource bundle for this parameter bean
 void validate()
          Validate the parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

s_res

protected static final transient java.util.ResourceBundle s_res

ERROR_FIELD_REQUIRED

protected static final java.lang.String ERROR_FIELD_REQUIRED
See Also:
Constant Field Values

ERROR_NUMBER_INVALID

protected static final java.lang.String ERROR_NUMBER_INVALID
See Also:
Constant Field Values

ERROR_PROPERTY_ON_FIELD

protected static final java.lang.String ERROR_PROPERTY_ON_FIELD
See Also:
Constant Field Values

ERROR_EITHER_FIELD_REQUIRED

protected static final java.lang.String ERROR_EITHER_FIELD_REQUIRED
See Also:
Constant Field Values

m_bundleName

protected java.lang.String m_bundleName

m_bundle

protected transient java.util.ResourceBundle m_bundle
Constructor Detail

ParamBean

public ParamBean()
Method Detail

populateData

public void populateData(java.util.Map data)
Populate this bean

Specified by:
populateData in interface IParamBean
Parameters:
data -
Throws:
java.lang.IllegalArgumentException - if an error occurs during data population

validate

public void validate()
              throws ParameterValidationException
Validate the parameters.

Specified by:
validate in interface IParamBean
Throws:
ParameterValidationException - if the parameters are invalid

getResourceBundle

public java.util.ResourceBundle getResourceBundle()
Get the resource bundle associated with this parameter bean

Specified by:
getResourceBundle in interface IParamBean
Returns:

getFieldName

public java.lang.String getFieldName(java.lang.String field)
Get the localized name of the given field

Specified by:
getFieldName in interface IParamBean
Parameters:
field -
Returns:

setResourceBundle

public void setResourceBundle(java.lang.String bundleName)
Set the name of the resource bundle for this parameter bean

Specified by:
setResourceBundle in interface IParamBean
Parameters:
bundleName -

setResourceBundle

public void setResourceBundle(java.lang.String bundleName,
                              java.util.Locale locale)
Set the name of the resource bundle for this parameter bean

Specified by:
setResourceBundle in interface IParamBean
Parameters:
bundleName -

getErrorMessage

protected java.lang.String getErrorMessage(java.lang.String error)
Get an error message. Looks in param bean resource bundle and local resource bundle if not found

Parameters:
error -
Returns:

getErrorMessage

protected java.lang.String getErrorMessage(java.lang.String error,
                                           java.lang.String field)
Get the error message for the given field

Parameters:
error -
field -
Returns:

getErrorMessage

protected java.lang.String getErrorMessage(java.lang.String error,
                                           java.lang.String[] props)
Get the error message for the given field

Parameters:
error -
props -
Returns:

getErrorMessage

protected java.lang.String getErrorMessage(java.lang.String error,
                                           java.util.ResourceBundle bundle)
Get the error message from the given resource bundle.

Parameters:
error -
bundle -
Returns:
the error message or null if not found

getException

protected ParameterValidationException getException(ParameterValidationException exp)
Construct a new validation exception if the exception passed in is null; otherwise, just return the exception

Parameters:
exp -
Returns: