pl.bristleback.server.bristle.binding.resolvers
Interface BindingEngine

All Known Implementing Classes:
DefaultBindingEngine

public interface BindingEngine

Classes implementing this interface are responsible for binding token data into object, using previously created binding information wrapper. Binding engines should specify what kind of token they are able process, because of token implementations incompatibility (JSONToken and MapToken). Binding engine is set individually for every binding operation. If it is not specified by user on Bind annotation, default binder implementation is provided. Default implementation of binding engine can be changed from DefaultBindingEngine by setting correspondent property in jwebsocket.xml.

Author:
Wojciech Niemiec
See Also:
Bristleback configuration

Method Summary
<T> BindingResult<T>
bind(T object, org.jwebsocket.token.Token token, NestedFieldInformation beanInformation)
          Performs binding operation, processing fields from token into object of given type.
 

Method Detail

bind

<T> BindingResult<T> bind(T object,
                          org.jwebsocket.token.Token token,
                          NestedFieldInformation beanInformation)
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.

Type Parameters:
T - type of returned object.
Parameters:
object - object instance.
token - token with data.
beanInformation - fields to bind and validation information wrapper.
Returns:
binding result wrapper, containing object and validation errors.


Copyright © 2011. All Rights Reserved.