pl.bristleback.server.bristle.binding
Class ObjectBinder<T>

java.lang.Object
  extended by pl.bristleback.server.bristle.binding.ObjectBinder<T>

public class ObjectBinder<T>
extends java.lang.Object

This class wraps single binding operation. Object binders should be placed in action class and marked with Bind annotation. Together with Bind annotation, it determines all details of the binding. Object binders should not be instantiated by user, instead it is processed and injected into action class by BindingsProcessor implementation. T represents type of object to bind.

Created on: 2011-02-15 21:21:39

Author:
Wojciech Niemiec

Constructor Summary
ObjectBinder()
           
 
Method Summary
 T bind(org.jwebsocket.token.Token token)
          Performs bindings operation, copying data from token to object using instructions given by corresponding Bind annotation.
 void bind(T object, org.jwebsocket.token.Token token)
          Performs bindings operation, copying data from token to object using instructions given by corresponding Bind annotation.
 BindingResult<T> bindWithResult(T object, org.jwebsocket.token.Token token)
          Performs bindings operation, copying data from token to object using instructions given by corresponding Bind annotation.
 java.lang.Class<T> getBeanClass()
           
 BindingEngine getEngine()
           
 NestedFieldInformation getRootBean()
           
 void setBeanClass(java.lang.Class<T> beanClass)
           
 void setEngine(BindingEngine engine)
           
 void setRootBean(NestedFieldInformation rootBean)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectBinder

public ObjectBinder()
Method Detail

bind

public void bind(T object,
                 org.jwebsocket.token.Token token)
Performs bindings operation, copying data from token to object using instructions given by corresponding Bind annotation. Throws BindingException if any validation error occurs.

Parameters:
object - object to bind.
token - property values.

bind

public T bind(org.jwebsocket.token.Token token)
Performs bindings operation, copying data from token to object using instructions given by corresponding Bind annotation. This version of bind method creates and returns new object instead of settings fields on parameter. Throws BindingException if any validation error occurs.

Parameters:
token - property values.
Returns:
object passed as parameter, in case of invocation chain usage.

bindWithResult

public BindingResult<T> bindWithResult(T object,
                                       org.jwebsocket.token.Token token)
Performs bindings operation, copying data from token to object using instructions given by corresponding Bind annotation. Returns binding result object instead of passed object or binding exception.

Parameters:
object - object to bind.
token - property values.
Returns:
binding result wrapper.

getEngine

public BindingEngine getEngine()

setEngine

public void setEngine(BindingEngine engine)

getBeanClass

public java.lang.Class<T> getBeanClass()

setBeanClass

public void setBeanClass(java.lang.Class<T> beanClass)

getRootBean

public NestedFieldInformation getRootBean()

setRootBean

public void setRootBean(NestedFieldInformation rootBean)


Copyright © 2011. All Rights Reserved.