org.gcube.data.oai.tmplugin.requests
Class RequestBinder

java.lang.Object
  extended by org.gcube.data.oai.tmplugin.requests.RequestBinder
All Implemented Interfaces:
Serializable

public class RequestBinder
extends Object
implements Serializable

Binds requests to Elements and vice versa.

Author:
Fabio Simeoni
See Also:
Serialized Form

Constructor Summary
RequestBinder()
           
 
Method Summary
<T extends Request>
T
bind(Element element, Class<T> type)
          Binds an Element to a Request.
 Element bind(Request request)
          Binds a Request to an Element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequestBinder

public RequestBinder()
Method Detail

bind

public <T extends Request> T bind(Element element,
                                  Class<T> type)
                       throws Exception
Binds an Element to a Request.

Parameters:
element - the element
type - the Class of a Request subtype
Returns:
the instance
Throws:
Exception - if the binding fails

bind

public Element bind(Request request)
             throws Exception
Binds a Request to an Element.

Parameters:
request - the request
Returns:
the element
Throws:
Exception - if the binding fails


Copyright © 2012. All Rights Reserved.