com.tonbeller.wcf.convert
Class BooleanConverter

java.lang.Object
  extended bycom.tonbeller.wcf.convert.NodeConverterBase
      extended bycom.tonbeller.wcf.convert.BooleanConverter
All Implemented Interfaces:
NodeConverter
Direct Known Subclasses:
CheckBoxConverter, RadioButtonConverter

public abstract class BooleanConverter
extends NodeConverterBase

Author:
av Converter for RadioButton and CheckBox.

Field Summary
static int FALSE
           
static int TRUE
           
static int UNKNOWN
           
 
Constructor Summary
BooleanConverter()
           
 
Method Summary
 void convert(Formatter fmt, java.util.Map params, java.util.Map fileParams, org.w3c.dom.Element elem, java.lang.Object bean)
          sets the selected attribute of the DOM element.
 void convert(Formatter fmt, java.lang.Object bean, org.w3c.dom.Element elem)
          sets the selected attribute of the checkbox from the bean
abstract  int isSelected(org.w3c.dom.Element elem, java.util.Map params)
          evaluates the http paramters.
 
Methods inherited from class com.tonbeller.wcf.convert.NodeConverterBase
checkRequired, getElementName, setElementName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNKNOWN

public static final int UNKNOWN
See Also:
Constant Field Values

TRUE

public static final int TRUE
See Also:
Constant Field Values

FALSE

public static final int FALSE
See Also:
Constant Field Values
Constructor Detail

BooleanConverter

public BooleanConverter()
Method Detail

convert

public void convert(Formatter fmt,
                    java.util.Map params,
                    java.util.Map fileParams,
                    org.w3c.dom.Element elem,
                    java.lang.Object bean)
             throws FormatException,
                    java.lang.IllegalAccessException,
                    java.lang.NoSuchMethodException,
                    java.lang.reflect.InvocationTargetException
sets the selected attribute of the DOM element. If a modelReference is specified, it must point to a boolean bean-property that will be updated.

Parameters:
fmt - Formatter for i18n string-object conversion
params - parameters of http request
elem - the target element.
bean - the target bean
Throws:
FormatException
java.lang.IllegalAccessException
java.lang.NoSuchMethodException
java.lang.reflect.InvocationTargetException

isSelected

public abstract int isSelected(org.w3c.dom.Element elem,
                               java.util.Map params)
evaluates the http paramters. Does not evaluate the selected attribute of the DOM Element.

Returns:
one of TRUE, FALSE, UNKNOWN

convert

public void convert(Formatter fmt,
                    java.lang.Object bean,
                    org.w3c.dom.Element elem)
             throws java.lang.IllegalAccessException,
                    java.lang.NoSuchMethodException,
                    java.lang.reflect.InvocationTargetException
sets the selected attribute of the checkbox from the bean

Throws:
java.lang.IllegalAccessException
java.lang.NoSuchMethodException
java.lang.reflect.InvocationTargetException