Overview | Package | Class | Tree | Deprecated | Index | Help
| Hyperic HQ Plugin API v. 4.4.0.2
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.hyperic.hq.ui.servlet
Class ParameterizedServlet

    java.lang.Object
      javax.servlet.GenericServlet
          javax.servlet.http.HttpServlet
              org.hyperic.hq.ui.servlet.ParameterizedServlet

All Implemented Interfaces:
  java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

Direct Known Subclasses:
  ImageServlet

    public abstract class ParameterizedServlet

extends javax.servlet.http.HttpServlet

This class contains some utility methods for parsing parameters.

See Also:
  Serialized Form

Constructor Summary
`ParameterizedServlet()`

Method Summary
`protected java.lang.IllegalArgumentException` | `invalidParamErr(java.lang.String paramName, java.lang.String param)` Return an IllegalArgumentException for an invalid parameter.
`protected java.lang.IllegalArgumentException` | `invalidParamErr(java.lang.String paramName, java.lang.String param, java.util.List optionList)` Return an IllegalArgumentException for an invalid parameter.
`protected void` | `invalidParamWarn(java.lang.String paramName, java.lang.String param, double value)` Log a warning about an invalid parameter.
`protected void` | `invalidParamWarn(java.lang.String paramName, java.lang.String param, int value)` Log a warning about an invalid parameter.
`protected void` | `invalidParamWarn(java.lang.String paramName, java.lang.String param, long value)` Log a warning about an invalid parameter.
`protected void` | `invalidParamWarn(java.lang.String paramName, java.lang.String param, java.lang.String value)` Log a warning about an invalid parameter.
`protected void` | `invalidParamWarn(java.lang.String paramName, java.lang.String param, java.lang.String value, java.util.List optionList)` Log a warning about an invalid parameter.
`protected boolean` | `parseBooleanParameter(javax.servlet.http.HttpServletRequest request, java.lang.String paramName, boolean defaultValue)` Parse a boolean parameter.
`protected double` | `parseDoubleParameter(javax.servlet.http.HttpServletRequest request, java.lang.String paramName, double defaultValue)` Parse a double parameter.
`protected int` | `parseIntParameter(javax.servlet.http.HttpServletRequest request, java.lang.String paramName, int defaultValue)` Parse a int parameter.
`protected long` | `parseLongParameter(javax.servlet.http.HttpServletRequest request, java.lang.String paramName, long defaultValue)` Parse a long parameter.
`protected boolean` | `parseRequiredBooleanParameter(javax.servlet.http.HttpServletRequest request, java.lang.String paramName)` Parse a required boolean parameter.
`protected double` | `parseRequiredDoubleParameter(javax.servlet.http.HttpServletRequest request, java.lang.String paramName)` Parse a required double parameter.
`protected int` | `parseRequiredIntParameter(javax.servlet.http.HttpServletRequest request, java.lang.String paramName)` Parse a required int parameter.
`protected long` | `parseRequiredLongParameter(javax.servlet.http.HttpServletRequest request, java.lang.String paramName)` Parse a required long parameter.
`protected java.lang.String` | `parseRequiredStringParameter(javax.servlet.http.HttpServletRequest request, java.lang.String paramName)` Parse a required string parameter.
`protected java.lang.String` | `parseRequiredStringParameter(javax.servlet.http.HttpServletRequest request, java.lang.String paramName, java.lang.String[] options)` Parse a required string parameter, ensuring that it is equal to one of the passed-in `options`.
`protected java.lang.String` | `parseStringParameter(javax.servlet.http.HttpServletRequest request, java.lang.String paramName, java.lang.String defaultValue)` Parse a string parameter.
`protected java.lang.String` | `parseStringParameter(javax.servlet.http.HttpServletRequest request, java.lang.String paramName, java.lang.String defaultValue, java.lang.String[] options)` Parse a string parameter, ensuring that it is equal to one of the passed-in `options`.
`protected java.lang.IllegalArgumentException` | `requiredParamErr(java.lang.String paramName)` Return an IllegalArgumentException for a required parameter.

Methods inherited from class javax.servlet.http.HttpServlet
`doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service`

Methods inherited from class javax.servlet.GenericServlet
`destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ParameterizedServlet

    public ParameterizedServlet()

Method Detail

### parseBooleanParameter

    protected boolean parseBooleanParameter(javax.servlet.http.HttpServletRequest request,
                                            java.lang.String paramName,
                                            boolean defaultValue)

  Parse a boolean parameter.

  Parameters:
    `request` - the servlet request
    `paramName` - the name of the parameter to parse
    `defaultValue` - the default value for the parameter
  Returns:
    the value of the parsed parameter or the default if the parameter didn't exist

### parseRequiredBooleanParameter

    protected boolean parseRequiredBooleanParameter(javax.servlet.http.HttpServletRequest request,
                                                    java.lang.String paramName)

  Parse a required boolean parameter.

  Parameters:
    `request` - the servlet request
    `paramName` - the parameter name
  Returns:
    the value of the parsed parameter
  Throws:
    `java.lang.IllegalArgumentException` - if the parameter didn't exist

### parseDoubleParameter

    protected double parseDoubleParameter(javax.servlet.http.HttpServletRequest request,
                                          java.lang.String paramName,
                                          double defaultValue)

  Parse a double parameter.

  Parameters:
    `request` - the servlet request
    `paramName` - the name of the parameter to parse
    `defaultValue` - the default value for the parameter
  Returns:
    the value of the parsed parameter or the default if the parameter didn't exist

### parseRequiredDoubleParameter

    protected double parseRequiredDoubleParameter(javax.servlet.http.HttpServletRequest request,
                                                  java.lang.String paramName)

  Parse a required double parameter.

  Parameters:
    `request` - the servlet request
    `paramName` - the parameter name
  Returns:
    the value of the parsed parameter
  Throws:
    `java.lang.IllegalArgumentException` - if the parameter didn't exist

### parseIntParameter

    protected int parseIntParameter(javax.servlet.http.HttpServletRequest request,
                                    java.lang.String paramName,
                                    int defaultValue)

  Parse a int parameter.

  Parameters:
    `request` - the servlet request
    `paramName` - the name of the parameter to parse
    `defaultValue` - the default value for the parameter
  Returns:
    the value of the parsed parameter or the default if the parameter didn't exist

### parseRequiredIntParameter

    protected int parseRequiredIntParameter(javax.servlet.http.HttpServletRequest request,
                                            java.lang.String paramName)

  Parse a required int parameter.

  Parameters:
    `request` - the servlet request
    `paramName` - the parameter name
  Returns:
    the value of the parsed parameter
  Throws:
    `java.lang.IllegalArgumentException` - if the parameter didn't exist

### parseLongParameter

    protected long parseLongParameter(javax.servlet.http.HttpServletRequest request,
                                      java.lang.String paramName,
                                      long defaultValue)

  Parse a long parameter.

  Parameters:
    `request` - the servlet request
    `paramName` - the name of the parameter to parse
    `defaultValue` - the default value for the parameter
  Returns:
    the value of the parsed parameter or the default if the parameter didn't exist

### parseRequiredLongParameter

    protected long parseRequiredLongParameter(javax.servlet.http.HttpServletRequest request,
                                              java.lang.String paramName)

  Parse a required long parameter.

  Parameters:
    `request` - the servlet request
    `paramName` - the parameter name
  Returns:
    the value of the parsed parameter
  Throws:
    `java.lang.IllegalArgumentException` - if the parameter didn't exist

### parseStringParameter

    protected java.lang.String parseStringParameter(javax.servlet.http.HttpServletRequest request,
                                                    java.lang.String paramName,
                                                    java.lang.String defaultValue)

  Parse a string parameter.

  Parameters:
    `request` - the servlet request
    `paramName` - the name of the parameter to parse
    `defaultValue` - the default value for the parameter
  Returns:
    the value of the parsed parameter or the default if the parameter didn't exist

### parseStringParameter

    protected java.lang.String parseStringParameter(javax.servlet.http.HttpServletRequest request,
                                                    java.lang.String paramName,
                                                    java.lang.String defaultValue,
                                                    java.lang.String[] options)

  Parse a string parameter, ensuring that it is equal to one of the passed-in `options`.

  Parameters:
    `request` - the servlet request
    `paramName` - the name of the parameter to parse
    `defaultValue` - the default value for the parameter
    `options` - the list of valid values for this parameter
  Returns:
    the value of the parsed parameter or the default if the parameter didn't exist

### parseRequiredStringParameter

    protected java.lang.String parseRequiredStringParameter(javax.servlet.http.HttpServletRequest request,
                                                            java.lang.String paramName)

  Parse a required string parameter.

  Parameters:
    `request` - the servlet request
    `paramName` - the parameter name
  Returns:
    the value of the parsed parameter
  Throws:
    `java.lang.IllegalArgumentException` - if the parameter didn't exist

### parseRequiredStringParameter

    protected java.lang.String parseRequiredStringParameter(javax.servlet.http.HttpServletRequest request,
                                                            java.lang.String paramName,
                                                            java.lang.String[] options)

  Parse a required string parameter, ensuring that it is equal to one of the passed-in `options`.

  Parameters:
    `request` - the servlet request
    `paramName` - the parameter name
    `options` - the list of valid values for this parameter
  Returns:
    the value of the parsed parameter
  Throws:
    `java.lang.IllegalArgumentException` - if the parameter didn't exist

### requiredParamErr

    protected java.lang.IllegalArgumentException requiredParamErr(java.lang.String paramName)

  Return an IllegalArgumentException for a required parameter.

  Parameters:
    `paramName` - the name of the parameter
  Returns:
    an `IllegalArgumentException`

### invalidParamErr

    protected java.lang.IllegalArgumentException invalidParamErr(java.lang.String paramName,
                                                                 java.lang.String param)

  Return an IllegalArgumentException for an invalid parameter.

  Parameters:
    `paramName` - the name of the parameter
    `param` - the value of the parameter
  Returns:
    an `IllegalArgumentException`

### invalidParamErr

    protected java.lang.IllegalArgumentException invalidParamErr(java.lang.String paramName,
                                                                 java.lang.String param,
                                                                 java.util.List optionList)

  Return an IllegalArgumentException for an invalid parameter.

  Parameters:
    `paramName` - the name of the parameter
    `param` - the value of the parameter
    `optionList` - the list of valid options for this parameter
  Returns:
    an `IllegalArgumentException`

### invalidParamWarn

    protected void invalidParamWarn(java.lang.String paramName,
                                    java.lang.String param,
                                    double value)

  Log a warning about an invalid parameter.

  Parameters:
    `paramName` - the name of the parameter
    `param` - the value of the parameter
    `value` - the default value

### invalidParamWarn

    protected void invalidParamWarn(java.lang.String paramName,
                                    java.lang.String param,
                                    int value)

  Log a warning about an invalid parameter.

  Parameters:
    `paramName` - the name of the parameter
    `param` - the value of the parameter
    `value` - the default value

### invalidParamWarn

    protected void invalidParamWarn(java.lang.String paramName,
                                    java.lang.String param,
                                    long value)

  Log a warning about an invalid parameter.

  Parameters:
    `paramName` - the name of the parameter
    `param` - the value of the parameter
    `value` - the default value

### invalidParamWarn

    protected void invalidParamWarn(java.lang.String paramName,
                                    java.lang.String param,
                                    java.lang.String value)

  Log a warning about an invalid parameter.

  Parameters:
    `paramName` - the name of the parameter
    `param` - the value of the parameter
    `value` - the default value

### invalidParamWarn

    protected void invalidParamWarn(java.lang.String paramName,
                                    java.lang.String param,
                                    java.lang.String value,
                                    java.util.List optionList)

  Log a warning about an invalid parameter.

  Parameters:
    `paramName` - the name of the parameter
    `param` - the value of the parameter
    `value` - the default value
    `optionList` - the list of valid options for this parameter

Overview | Package | Class | Tree | Deprecated | Index | Help
| Hyperic HQ Plugin API v. 4.4.0.2
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004-2006 Hyperic, Inc. support@hyperic.net, All Rights Reserved.