org.restlet.service
Class ConverterService

java.lang.Object
  extended by org.restlet.service.Service
      extended by org.restlet.service.ConverterService

Deprecated. Since 1.1 with no replacement as it doesn't fit well with content negotiation. Most users prefer to handle those conversion in Resource subclasses.

@Deprecated
public class ConverterService
extends Service

Service converting message entities into higher-level objects. As the default implementation doesn't do any convertion by default, you have to subclass it and update the Application's "converterService" property with your own instance.

Once this done, any Restlet or Resource that is part of this application can easily convert from representations to objects and the other way around. You just have to use the getEntityAsObject() method to convert a message's representation into a higher-level object and the setEntity(Object) method to convert a higher-level object into a representation.

Author:
Jerome Louvel
See Also:
Message.getEntityAsObject(), Message.setEntity(Object)

Constructor Summary
ConverterService()
          Deprecated.  
 
Method Summary
 java.lang.Object toObject(Representation representation)
          Deprecated. Converts a representation into a higher-level object.
 Representation toRepresentation(java.lang.Object object)
          Deprecated. Converts a higher-level object into a representation.
 
Methods inherited from class org.restlet.service.Service
isEnabled, isStarted, isStopped, setEnabled, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConverterService

public ConverterService()
Deprecated. 
Method Detail

toObject

public java.lang.Object toObject(Representation representation)
Deprecated. 
Converts a representation into a higher-level object. Returns null by default.

Parameters:
representation - The representation to convert.
Returns:
A higher-level object.

toRepresentation

public Representation toRepresentation(java.lang.Object object)
Deprecated. 
Converts a higher-level object into a representation. Returns null by default.

Parameters:
object - The higher-level object.
Returns:
A representation.


Copyright © 2005-2008 Noelios Technologies.