pl.bristleback.server.bristle.binding.resolvers
Class DefaultBindingEngine

java.lang.Object
  extended by pl.bristleback.server.bristle.binding.resolvers.DefaultBindingEngine
All Implemented Interfaces:
BindingEngine

public class DefaultBindingEngine
extends java.lang.Object
implements BindingEngine

Basic implementation of BindingEngine interface, binds raw and complex objects, lists, maps (with string as key) and arrays. Takes MapToken token as parameter, which is default token passed by framework to action classes performAction() method.

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

Author:
Wojciech Niemiec

Constructor Summary
DefaultBindingEngine()
           
 
Method Summary
<T> BindingResult<T>
bind(T object, org.jwebsocket.token.Token token, NestedFieldInformation rootInformation)
          Performs binding operation, processing fields from token into object of given type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultBindingEngine

public DefaultBindingEngine()
Method Detail

bind

public <T> BindingResult<T> bind(T object,
                                 org.jwebsocket.token.Token token,
                                 NestedFieldInformation rootInformation)
Description copied from interface: BindingEngine
Performs binding operation, processing fields from token into object of given type. Fields and validation elements are wrapped into NestedFieldInformation object. Validation errors should be added to returning BindingResult object. Any other exception, like class cast exception, should be thrown as they are considered as programmer mistakes.

Specified by:
bind in interface BindingEngine
Type Parameters:
T - type of returned object.
Parameters:
object - object instance.
token - token with data.
rootInformation - fields to bind and validation information wrapper.
Returns:
binding result wrapper, containing object and validation errors.


Copyright © 2011. All Rights Reserved.