Hello Erick,
This is my two cents. This very unsual case can happen only when the
ServerResource is not annotated. The ServerResource is able to describe
all supported variants via the "getVariants" collection (for example in
the initialization method) and generally implements the get(Variant)
method. The set of variants can be technically updated with
Representation instances. I don't see clearly use-cases, except in order
to avoid some calls of methods (considering also the cost of
instantiating the representations).
>Is it possible to set the Variant to a Representation, thus avoiding a
call to get method?
yes, this is possible.
Best regards,
Thierry Boileau
> I'm digging through the source code of ServerResource (trying to
> understand it more) and was wondering what use-case would require this
> logic:
>
> if (variant instanceof Representation) {
> result = (Representation) variant;
> } else {
> result = get(variant);
> }
>
> Is it possible to set the Variant to a Representation, thus avoiding a
> call to get method?
>
> Thanks
> --
> Erick Fleming
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2446739