com.esri.adf.web.data.tasks
Class TaskParamDescriptor

java.lang.Object
  extended by java.beans.FeatureDescriptor
      extended by com.esri.adf.web.data.tasks.TaskParamDescriptor
All Implemented Interfaces:
TaskParamDescriptorModel, TaskParamValidatorModel, Serializable

public class TaskParamDescriptor
extends FeatureDescriptor
implements TaskParamDescriptorModel, TaskParamValidatorModel

The TaskParamDescriptor class provides metadata for the task parameters.

This is the out of box implementation of the TaskParamDescriptorModel interface and supports the rendering of parameters as labels, text boxes, checkboxes, radio buttons and dropdowns.

See Also:
Serialized Form

Field Summary
static String CHECKBOX_RENDERER_TYPE
          The checkbox renderer type.
static String LABEL_RENDERER_TYPE
          The label renderer type.
static String MULTIPLESELECT_RENDERER_TYPE
          The multiple select (listbox) renderer type.
static String MULTIPLESELECT_SEPARATOR
          Token used to split the multiple selection string.
static String RADIO_RENDERER_TYPE
          The radio button renderer type.
static String SELECT_RENDERER_TYPE
          The select (dropdown) renderer type.
static String TEXT_RENDERER_TYPE
          The textbox renderer type.
 
Constructor Summary
TaskParamDescriptor(Class taskClass, String paramName, String displayName)
           Creates a TaskParamDescriptor with a textbox renderer.
TaskParamDescriptor(Class taskClass, String paramName, String displayName, String selectMethodName)
          Creates a TaskParamDescriptor with a dropdown renderer.
TaskParamDescriptor(Class taskClass, String paramName, String displayName, String selectMethodName, boolean radioRendererType)
          Creates a TaskParamDescriptor with a radio button or a drop down renderer.
TaskParamDescriptor(Class taskClass, String paramName, String displayName, String readMethodName, String writeMethodName)
          Creates a TaskParamDescriptor with a text box renderer.
TaskParamDescriptor(Class taskClass, String paramName, String displayName, String readMethodName, String writeMethodName, String selectMethodName)
          Creates a TaskParamDescriptor with a dropdown renderer.
TaskParamDescriptor(Class taskClass, String paramName, String displayName, String readMethodName, String writeMethodName, String selectMethodName, boolean radioRendererType)
          Creates a TaskParamDescriptor with a radio button or a dropdown renderer.
TaskParamDescriptor(Class taskClass, String paramName, String displayName, String readMethodName, String writeMethodName, String selectMethodName, int selectSize)
          Creates a TaskParamDescriptor to render a list box with multiple selection
TaskParamDescriptor(String paramName, Class paramClass, Method readMethod, Method writeMethod, Method selectMethod)
          Creates a TaskParamDescriptor with a dropdown renderer.
 
Method Summary
 Element generateXML(Object task)
           Generates the XML content for this parameter.
 Class getParamClass()
          Returns the parameter Class.
 Object getParamValue(Object task)
           Returns the current value of the parameter for the given task.
 Method getReadMethod()
          Returns the read (getter) method of the parameter
 String getRendererType()
          Returns the renderer type of this parameter.
 Method getSelectMethod()
          Returns the select options method of the parameter
 TaskParamValidator getValidator()
          Returns the TaskParamValidator object which is used for validating this Task parameter's value.
 Method getWriteMethod()
          Returns the write (setter) method of the parameter
 boolean isDisabled()
          If true, this parameter will be disabled in the UI.
 void setDisabled(boolean disabled)
          If set to true, this parameter will be disabled in the UI.
 Object setParamValue(Object task, String strValue)
           Sets the parameter value on the task and returns the set value.
 void setRendererType(String rendererType)
          Sets the renderer type of this parameter.
 void setValidator(TaskParamValidator taskParamValidator)
          Sets the TaskParamValidator object to use for validating this Task parameter's value.
 String toString()
           
 
Methods inherited from class java.beans.FeatureDescriptor
attributeNames, getDisplayName, getName, getShortDescription, getValue, isExpert, isHidden, isPreferred, setDisplayName, setExpert, setHidden, setName, setPreferred, setShortDescription, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.esri.adf.web.data.tasks.TaskParamDescriptorModel
getDisplayName, getName
 

Field Detail

MULTIPLESELECT_SEPARATOR

public static final String MULTIPLESELECT_SEPARATOR
Token used to split the multiple selection string.

See Also:
Constant Field Values

LABEL_RENDERER_TYPE

public static final String LABEL_RENDERER_TYPE
The label renderer type. Parameters with this renderer type are displayed as labels.

See Also:
Constant Field Values

TEXT_RENDERER_TYPE

public static final String TEXT_RENDERER_TYPE
The textbox renderer type. Parameters with this renderer type are displayed as textboxes.

See Also:
Constant Field Values

SELECT_RENDERER_TYPE

public static final String SELECT_RENDERER_TYPE
The select (dropdown) renderer type. Parameters with this renderer type are displayed as dropdown list boxes.

See Also:
Constant Field Values

MULTIPLESELECT_RENDERER_TYPE

public static final String MULTIPLESELECT_RENDERER_TYPE
The multiple select (listbox) renderer type. Parameters with this renderer type are displayed as area list boxes.

See Also:
Constant Field Values

CHECKBOX_RENDERER_TYPE

public static final String CHECKBOX_RENDERER_TYPE
The checkbox renderer type. Parameters with this renderer type are displayed as checkboxes.

See Also:
Constant Field Values

RADIO_RENDERER_TYPE

public static final String RADIO_RENDERER_TYPE
The radio button renderer type. Parameters with this renderer type are displayed as radio buttons.

See Also:
Constant Field Values
Constructor Detail

TaskParamDescriptor

public TaskParamDescriptor(Class taskClass,
                           String paramName,
                           String displayName,
                           String readMethodName,
                           String writeMethodName)
Creates a TaskParamDescriptor with a text box renderer.

Parameters:
taskClass - the task Class
paramName - the name of the parameter
displayName - the display text of the parameter
readMethodName - the read (getter) method name of the parameter
writeMethodName - the write (setter) method name of the parameter

TaskParamDescriptor

public TaskParamDescriptor(Class taskClass,
                           String paramName,
                           String displayName,
                           String readMethodName,
                           String writeMethodName,
                           String selectMethodName,
                           boolean radioRendererType)
Creates a TaskParamDescriptor with a radio button or a dropdown renderer.

Parameters:
taskClass - the task Class
paramName - the name of the parameter
displayName - the display text of the parameter
readMethodName - the read (getter) method name of the parameter
writeMethodName - the write (setter) method name of the parameter
selectMethodName - the select method name for this parameter
radioRendererType - if true, the parameter is displayed as radio buttons. Otherwise, it is displayed as a dropdown

TaskParamDescriptor

public TaskParamDescriptor(Class taskClass,
                           String paramName,
                           String displayName,
                           String readMethodName,
                           String writeMethodName,
                           String selectMethodName,
                           int selectSize)
Creates a TaskParamDescriptor to render a list box with multiple selection

Parameters:
taskClass - the task Class
paramName - the name of the parameter
displayName - the display text of the parameter
readMethodName - the read (getter) method name of the parameter
writeMethodName - the write (setter) method name of the parameter
selectMethodName - the select method name for this parameter
selectSize - define the height of the list box, it must be greater than one

TaskParamDescriptor

public TaskParamDescriptor(Class taskClass,
                           String paramName,
                           String displayName,
                           String readMethodName,
                           String writeMethodName,
                           String selectMethodName)
Creates a TaskParamDescriptor with a dropdown renderer.

Parameters:
taskClass - the task Class
paramName - the name of the parameter
displayName - the display text of the parameter
readMethodName - the read (getter) method name of the parameter
writeMethodName - the write (setter) method name of the parameter
selectMethodName - the select method name for this parameter

TaskParamDescriptor

public TaskParamDescriptor(Class taskClass,
                           String paramName,
                           String displayName)

Creates a TaskParamDescriptor with a textbox renderer.

If the param name is param, the setter method is assumed to be setParam(paramValue) and the getter method is assumed to be getParam() (or isParam() for booleans)

Parameters:
taskClass - the task Class
paramName - the name of the parameter
displayName - the display text of the parameter

TaskParamDescriptor

public TaskParamDescriptor(Class taskClass,
                           String paramName,
                           String displayName,
                           String selectMethodName,
                           boolean radioRendererType)
Creates a TaskParamDescriptor with a radio button or a drop down renderer.

If the param name is param, the setter method is assumed to be setParam(paramValue) and the getter method is assumed to be getParam() (or isParam() for booleans)

Parameters:
taskClass - the task Class
paramName - the name of the parameter
displayName - the display text of the parameter
selectMethodName - the select method name for this parameter
radioRendererType - if true, the parameter is displayed as radio buttons. Otherwise, it is displayed as a drop down

TaskParamDescriptor

public TaskParamDescriptor(Class taskClass,
                           String paramName,
                           String displayName,
                           String selectMethodName)
Creates a TaskParamDescriptor with a dropdown renderer.

If the param name is param, the setter method is assumed to be setParam(paramValue) and the getter method is assumed to be getParam() (or isParam() for booleans)

Parameters:
taskClass - the task Class
paramName - the name of the parameter
displayName - the display text of the parameter
selectMethodName - the select method name for this parameter

TaskParamDescriptor

public TaskParamDescriptor(String paramName,
                           Class paramClass,
                           Method readMethod,
                           Method writeMethod,
                           Method selectMethod)
Creates a TaskParamDescriptor with a dropdown renderer.

Parameters:
paramName - the name of the parameter
paramClass - the parameter Class
readMethod - the read (getter) method of the parameter
writeMethod - the write (setter) method of the parameter
selectMethod - the select options method of the parameter
Method Detail

getParamClass

public Class getParamClass()
Returns the parameter Class. For ex., if the parameter is of type int, this method returns the Integer class.

Returns:
the parameter Class

getReadMethod

public Method getReadMethod()
Returns the read (getter) method of the parameter

Returns:
the read (getter) method of the parameter

getWriteMethod

public Method getWriteMethod()
Returns the write (setter) method of the parameter

Returns:
the write (setter) method of the parameter

getSelectMethod

public Method getSelectMethod()
Returns the select options method of the parameter

Returns:
the select options method of the parameter

getRendererType

public String getRendererType()
Returns the renderer type of this parameter. (e.g. TEXT_RENDERER_TYPE, SELECT_RENDERER_TYPE, etc.)

Specified by:
getRendererType in interface TaskParamDescriptorModel
Returns:
the renderer type of this parameter

setRendererType

public void setRendererType(String rendererType)
Sets the renderer type of this parameter. (e.g. TEXT_RENDERER_TYPE, SELECT_RENDERER_TYPE, etc.)


isDisabled

public boolean isDisabled()
If true, this parameter will be disabled in the UI.

Returns:
if true, this parameter will be disabled in the UI

setDisabled

public void setDisabled(boolean disabled)
If set to true, this parameter will be disabled in the UI.

Parameters:
disabled - if set to true, this parameter will be disabled in the UI

setValidator

public void setValidator(TaskParamValidator taskParamValidator)
Sets the TaskParamValidator object to use for validating this Task parameter's value. Default value is null, indicating that the value will not be validated.

Specified by:
setValidator in interface TaskParamValidatorModel
Parameters:
taskParamValidator - a TaskParamValidator object.

getValidator

public TaskParamValidator getValidator()
Returns the TaskParamValidator object which is used for validating this Task parameter's value. Default value is null, indicating that the value will not be validated.

Returns:
a TaskParamValidator object.

setParamValue

public Object setParamValue(Object task,
                            String strValue)
Description copied from interface: TaskParamDescriptorModel

Sets the parameter value on the task and returns the set value. This method should convert the string input to the appropriate parameter type before setting the parameter.

Specified by:
setParamValue in interface TaskParamDescriptorModel
Parameters:
task - the task object on which to set the parameter value
strValue - the string representation of the parameter value to be set
Returns:
the set parameter value

getParamValue

public Object getParamValue(Object task)
Description copied from interface: TaskParamDescriptorModel

Returns the current value of the parameter for the given task.

Specified by:
getParamValue in interface TaskParamDescriptorModel
Parameters:
task - the task object
Returns:
the parameter value

generateXML

public Element generateXML(Object task)
Description copied from interface: TaskParamDescriptorModel

Generates the XML content for this parameter. This XML is then transformed by the XSL used by the task control to generate the appropriate markup.

Note that if you implement this method and generate custom XML, you'll also need to provide the XSL that transforms this XML into the appropriate markup. The XSL file that the task control should use can be specified by using the xslFile attribute of the task tag.

Specified by:
generateXML in interface TaskParamDescriptorModel
Parameters:
task - the task object
Returns:
the generated XML Element

toString

public String toString()
Overrides:
toString in class Object