adapforms.form.parser
Class BeanConvertion

java.lang.Object
  extended by adapforms.form.parser.BeanConvertion

 class BeanConvertion
extends java.lang.Object

Converts a JavaBean into a BeanType, which can be used as a form element in a BeanElement instance.

The conversion process looks for all properties (matching public get- and set-methods) of the bean, and converts them into form elements according to the property type:
- String properties become TextElement instances.
- int and Integer properties become IntegerElement instances.
- Date properties become DateElement instances.
- boolean and Boolean properties become ToggleElement instances.
- Enum-type properties become ChoiceElement instances (single-choice).
- All other types will be ignored

Annotations can be used to control the translation process. See AdapFormsProperty and AdapFormsType..

Author:
Henrik Gammelmark, geemark@cs.au.dk

Constructor Summary
BeanConvertion()
           
 
Method Summary
static BeanType typeFromBean(java.lang.Class<java.lang.Object> type)
          Create a bean type given the class of the bean.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanConvertion

BeanConvertion()
Method Detail

typeFromBean

public static BeanType typeFromBean(java.lang.Class<java.lang.Object> type)
                             throws ParserException
Create a bean type given the class of the bean.

Throws:
ParserException - If the type was not a bean, or no usable properties were found.