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, java.io.Serializable

public class TaskParamDescriptor
extends java.beans.FeatureDescriptor
implements TaskParamDescriptorModel

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 java.lang.String CHECKBOX_RENDERER_TYPE
          The checkbox renderer type.
static java.lang.String LABEL_RENDERER_TYPE
          The label renderer type.
static java.lang.String RADIO_RENDERER_TYPE
          The radio button renderer type.
static java.lang.String SELECT_RENDERER_TYPE
          The select (dropdown) renderer type.
static java.lang.String TEXT_RENDERER_TYPE
          The textbox renderer type.
 
Constructor Summary
TaskParamDescriptor(java.lang.Class taskClass, java.lang.String paramName, java.lang.String displayName)
           Creates a TaskParamDescriptor with a textbox renderer.
TaskParamDescriptor(java.lang.Class taskClass, java.lang.String paramName, java.lang.String displayName, java.lang.String selectMethodName)
          Creates a TaskParamDescriptor with a dropdown renderer.
TaskParamDescriptor(java.lang.Class taskClass, java.lang.String paramName, java.lang.String displayName, java.lang.String selectMethodName, boolean radioRendererType)
          Creates a TaskParamDescriptor with a radio button or a dropdown renderer.
TaskParamDescriptor(java.lang.Class taskClass, java.lang.String paramName, java.lang.String displayName, java.lang.String readMethodName, java.lang.String writeMethodName)
          Creates a TaskParamDescriptor with a textbox renderer.
TaskParamDescriptor(java.lang.Class taskClass, java.lang.String paramName, java.lang.String displayName, java.lang.String readMethodName, java.lang.String writeMethodName, java.lang.String selectMethodName)
          Creates a TaskParamDescriptor with a dropdown renderer.
TaskParamDescriptor(java.lang.Class taskClass, java.lang.String paramName, java.lang.String displayName, java.lang.String readMethodName, java.lang.String writeMethodName, java.lang.String selectMethodName, boolean radioRendererType)
          Creates a TaskParamDescriptor with a radio button or a dropdown renderer.
TaskParamDescriptor(java.lang.String paramName, java.lang.Class paramClass, java.lang.reflect.Method readMethod, java.lang.reflect.Method writeMethod, java.lang.reflect.Method selectMethod)
          Creates a TaskParamDescriptor with a dropdown renderer.
 
Method Summary
 org.w3c.dom.Element generateXML(java.lang.Object task)
           Generates the XML content for this parameter.
 java.lang.Class getParamClass()
          Returns the parameter Class.
 java.lang.Object getParamValue(java.lang.Object task)
           Returns the current value of the parameter for the given task.
 java.lang.reflect.Method getReadMethod()
          Returns the read (getter) method of the parameter
 java.lang.String getRendererType()
          Returns the renderer type of this parameter.
 java.lang.reflect.Method getSelectMethod()
          Returns the select options method of the parameter
 java.lang.reflect.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.
 java.lang.Object setParamValue(java.lang.Object task, java.lang.String strVal)
           Sets the parameter value on the task and returns the set value.
 void setRendererType(java.lang.String rendererType)
          Sets the renderer type of this parameter.
 java.lang.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

LABEL_RENDERER_TYPE

public static final java.lang.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 java.lang.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 java.lang.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

CHECKBOX_RENDERER_TYPE

public static final java.lang.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 java.lang.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(java.lang.Class taskClass,
                           java.lang.String paramName,
                           java.lang.String displayName,
                           java.lang.String readMethodName,
                           java.lang.String writeMethodName)
Creates a TaskParamDescriptor with a textbox 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(java.lang.Class taskClass,
                           java.lang.String paramName,
                           java.lang.String displayName,
                           java.lang.String readMethodName,
                           java.lang.String writeMethodName,
                           java.lang.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(java.lang.Class taskClass,
                           java.lang.String paramName,
                           java.lang.String displayName,
                           java.lang.String readMethodName,
                           java.lang.String writeMethodName,
                           java.lang.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(java.lang.Class taskClass,
                           java.lang.String paramName,
                           java.lang.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(java.lang.Class taskClass,
                           java.lang.String paramName,
                           java.lang.String displayName,
                           java.lang.String selectMethodName,
                           boolean radioRendererType)
Creates a TaskParamDescriptor with a radio button or 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
radioRendererType - if true, the parameter is displayed as radio buttons. Otherwise, it is displayed as a dropdown

TaskParamDescriptor

public TaskParamDescriptor(java.lang.Class taskClass,
                           java.lang.String paramName,
                           java.lang.String displayName,
                           java.lang.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(java.lang.String paramName,
                           java.lang.Class paramClass,
                           java.lang.reflect.Method readMethod,
                           java.lang.reflect.Method writeMethod,
                           java.lang.reflect.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 java.lang.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 java.lang.reflect.Method getReadMethod()
Returns the read (getter) method of the parameter

Returns:
the read (getter) method of the parameter

getWriteMethod

public java.lang.reflect.Method getWriteMethod()
Returns the write (setter) method of the parameter

Returns:
the write (setter) method of the parameter

getSelectMethod

public java.lang.reflect.Method getSelectMethod()
Returns the select options method of the parameter

Returns:
the select options method of the parameter

getRendererType

public java.lang.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(java.lang.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

setParamValue

public java.lang.Object setParamValue(java.lang.Object task,
                                      java.lang.String strVal)
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
strVal - the string representation of the parameter value to be set
Returns:
the set parameter value

getParamValue

public java.lang.Object getParamValue(java.lang.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 org.w3c.dom.Element generateXML(java.lang.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 java.lang.String toString()
Overrides:
toString in class java.lang.Object