org.xerial.util.bean.impl
Class BeanBindingProcess

java.lang.Object
  extended by org.xerial.util.bean.impl.BeanBindingProcess
All Implemented Interfaces:
TreeVisitor

public class BeanBindingProcess
extends Object
implements TreeVisitor

Tree-structured data to object binding process implementation

Author:
leo

Constructor Summary
BeanBindingProcess(Class beanClass)
           
BeanBindingProcess(Object bean)
           
BeanBindingProcess(Object bean, BindRuleGenerator bindRuleGenerator)
           
 
Method Summary
static Object convertToBasicType(Class targetType, Object input)
           
 Object convertType(Class targetType, Object value)
           
 void finish(TreeWalker walker)
          When the tree visit has finished
protected
<T> BeanBinderSet
getBindRuleSet(Class<T> beanClass)
           
 Object getContextBean(int level)
           
 Object getResultBean()
           
static BeanUpdator getUpdator(BeanBinderSet bindRuleSet, String ruleName)
           
 void init(TreeWalker walker)
          Initialize the visitor here
 void leaveNode(String nodeName, String nodeValue, TreeWalker walker)
          When leaving a node
 void visitNode(String nodeName, TreeWalker walker)
          When found a node
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanBindingProcess

public BeanBindingProcess(Class beanClass)
                   throws BeanException
Throws:
BeanException

BeanBindingProcess

public BeanBindingProcess(Object bean)

BeanBindingProcess

public BeanBindingProcess(Object bean,
                          BindRuleGenerator bindRuleGenerator)
Method Detail

getResultBean

public Object getResultBean()

getContextBean

public Object getContextBean(int level)

finish

public void finish(TreeWalker walker)
            throws XerialException
Description copied from interface: TreeVisitor
When the tree visit has finished

Specified by:
finish in interface TreeVisitor
Throws:
XerialException

init

public void init(TreeWalker walker)
          throws XerialException
Description copied from interface: TreeVisitor
Initialize the visitor here

Specified by:
init in interface TreeVisitor
Throws:
XerialException

getBindRuleSet

protected <T> BeanBinderSet getBindRuleSet(Class<T> beanClass)
                                throws BeanException
Throws:
BeanException

visitNode

public void visitNode(String nodeName,
                      TreeWalker walker)
               throws XerialException
Description copied from interface: TreeVisitor
When found a node

Specified by:
visitNode in interface TreeVisitor
Parameters:
nodeName - the found node name
Throws:
XerialException

leaveNode

public void leaveNode(String nodeName,
                      String nodeValue,
                      TreeWalker walker)
               throws XerialException
Description copied from interface: TreeVisitor
When leaving a node

Specified by:
leaveNode in interface TreeVisitor
Parameters:
nodeName - the node name to leave
Throws:
XerialException

getUpdator

public static BeanUpdator getUpdator(BeanBinderSet bindRuleSet,
                                     String ruleName)
                              throws BeanException
Throws:
BeanException

convertType

public Object convertType(Class targetType,
                          Object value)
                   throws BeanException
Throws:
BeanException

convertToBasicType

public static Object convertToBasicType(Class targetType,
                                        Object input)
                                 throws BeanException
Throws:
BeanException


Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.1 Japan License.