concept Representation in category restlet

appears as: Representation
Restlet in Action

This is an excerpt from Manning's book Restlet in Action.

It’s now time to put those features in action with an example. The following listing creates an instance of ClientResource pointing to the resource at the http://localhost:8111/ URI. You then attempt to retrieve a representation of this resource by invoking the get() method, which returns an instance of the Representation class that you can display on the console thanks to a shortcut method, write(OutputStream).

All those possibilities are based on the org.restlet.representation package introduced in chapter 1 and a set of Restlet extensions. In this section we explore this package, starting with root Variant and RepresentationInfo classes used to describe representation variants. We then continue with the abstract Representation class and the various subclasses provided to deal with byte and character content.

Let’s continue our overview of Restlet representations with the abstract Representation class itself, the superclass of all concrete representations. Figure 4.2 gives an overview of this class, its parent RepresentationInfo class, and its main properties and methods.

Figure 4.2. The abstract Representation class is the superclass of all Restlet representations.