jbpm-form-modeler-ui 6.0.0.CR4

org.jbpm.formModeler.core.processing.fieldHandlers
Class NumericFieldHandler

java.lang.Object
  extended by org.jbpm.formModeler.core.processing.AbstractFieldHandler
      extended by org.jbpm.formModeler.core.processing.DefaultFieldHandler
          extended by org.jbpm.formModeler.core.processing.fieldHandlers.NumericFieldHandler
All Implemented Interfaces:
FieldHandler
Direct Known Subclasses:
CurrencyFieldHandler

@Named(value="org.jbpm.formModeler.core.processing.fieldHandlers.NumericFieldHandler")
public class NumericFieldHandler
extends DefaultFieldHandler

Handler for numeric text input


Nested Class Summary
 class NumericFieldHandler.EmptyNumberException
           
 
Field Summary
static boolean DEFAULT_MAX_VALUE
           
static String NUMERIC_FROM_SUFFIX
           
static String NUMERIC_TO_SUFFIX
           
 
Constructor Summary
NumericFieldHandler()
           
 
Method Summary
 boolean acceptsPropertyName(String propName)
           
protected  String[] buildParamValue(Object value, String pattern)
          Builds a correct paramValue for a given inputValue.
 String[] getCompatibleClassNames()
          Determine the list of class types this field can generate.
 Map getParamValue(String inputName, Object objectValue, String pattern)
          Determine the value as a parameter map for a given input value.
 Object getTheValue(org.jbpm.formModeler.api.model.Field field, String[] paramValue, String desiredClassName)
           
 Object getValue(org.jbpm.formModeler.api.model.Field field, String inputName, Map parametersMap, Map filesMap, String desiredClassName, Object previousValue)
          Read a parameter value (normally from a request), and translate it to an object with desired class (that must be one of the returned by this handler)
 boolean isEmpty(Object value)
           
 
Methods inherited from class org.jbpm.formModeler.core.processing.DefaultFieldHandler
getFieldHandlersManager, getFormManager, getFormProcessor, getFormStatusManager, getFunctionsProvider, getName, getNamespaceManager, getReplacementManager, shouldPersist
 
Methods inherited from class org.jbpm.formModeler.core.processing.AbstractFieldHandler
checkBooleanParameter, getFieldName, getHumanName, getPageToIncludeForDisplaying, getPageToIncludeForRendering, getPageToIncludeForSearching, initialize, isEvaluable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NUMERIC_FROM_SUFFIX

public static final String NUMERIC_FROM_SUFFIX
See Also:
Constant Field Values

NUMERIC_TO_SUFFIX

public static final String NUMERIC_TO_SUFFIX
See Also:
Constant Field Values

DEFAULT_MAX_VALUE

public static final boolean DEFAULT_MAX_VALUE
See Also:
Constant Field Values
Constructor Detail

NumericFieldHandler

public NumericFieldHandler()
Method Detail

getValue

public Object getValue(org.jbpm.formModeler.api.model.Field field,
                       String inputName,
                       Map parametersMap,
                       Map filesMap,
                       String desiredClassName,
                       Object previousValue)
                throws Exception
Read a parameter value (normally from a request), and translate it to an object with desired class (that must be one of the returned by this handler)

Returns:
a object with desired class
Throws:
NumericFieldHandler.EmptyNumberException
Exception

getTheValue

public Object getTheValue(org.jbpm.formModeler.api.model.Field field,
                          String[] paramValue,
                          String desiredClassName)
                   throws Exception
Throws:
Exception

getParamValue

public Map getParamValue(String inputName,
                         Object objectValue,
                         String pattern)
Determine the value as a parameter map for a given input value. This is like the inverse operation of getValue()

Parameters:
objectValue - Object value to represent
pattern - Pattern to apply if any
Returns:
a Map representing the parameter values expected inside a request that would cause the form to generate given object value as a result.

buildParamValue

protected String[] buildParamValue(Object value,
                                   String pattern)
Builds a correct paramValue for a given inputValue.

Parameters:
value - Object value to build its paramValue
pattern - pattern to apply if any
Returns:
a String[] with the paramValue on it or null if the value received is null

acceptsPropertyName

public boolean acceptsPropertyName(String propName)

getCompatibleClassNames

public String[] getCompatibleClassNames()
Determine the list of class types this field can generate. That is, normally, a field can generate multiple outputs (an input text can generate Strings, Integers, ...)

Returns:
the set of class types that can be generated by this handler.

isEmpty

public boolean isEmpty(Object value)

jbpm-form-modeler-ui 6.0.0.CR4

Copyright © 2001-2013 JBoss by Red Hat. All Rights Reserved.