org.restlet.gwt.resource
Class Variant

java.lang.Object
  extended by org.restlet.gwt.resource.Variant
Direct Known Subclasses:
Representation

public class Variant
extends java.lang.Object

Descriptor for available representations of a resource. It contains all the important metadata about a representation but is not able to actually serve the representation's content itself. For this, you need to use the Representation subclass.

Author:
Jerome Louvel

Constructor Summary
Variant()
          Default constructor.
Variant(MediaType mediaType)
          Constructor.
 
Method Summary
 CharacterSet getCharacterSet()
          Returns the character set or null if not applicable.
 java.util.List<Encoding> getEncodings()
          Returns the modifiable list of encodings applied to the entity-body.
 Reference getIdentifier()
          Returns an optional identifier.
 java.util.List<Language> getLanguages()
          Returns the modifiable list of languages.
 MediaType getMediaType()
          Returns the media type.
 void setCharacterSet(CharacterSet characterSet)
          Sets the character set or null if not applicable.
 void setEncodings(java.util.List<Encoding> encodings)
          Sets the list of encodings applied to the entity-body.
 void setIdentifier(Reference identifier)
          Sets the optional identifier.
 void setIdentifier(java.lang.String identifierUri)
          Sets the identifier from a URI string.
 void setLanguages(java.util.List<Language> languages)
          Sets the list of languages.
 void setMediaType(MediaType mediaType)
          Sets the media type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Variant

public Variant()
Default constructor.


Variant

public Variant(MediaType mediaType)
Constructor.

Parameters:
mediaType - The media type.
Method Detail

getCharacterSet

public CharacterSet getCharacterSet()
Returns the character set or null if not applicable.

Returns:
The character set or null if not applicable.

getEncodings

public java.util.List<Encoding> getEncodings()
Returns the modifiable list of encodings applied to the entity-body. Creates a new instance if no one has been set. An "IllegalArgumentException" exception is thrown when adding a null encoding to this list.

Returns:
The list of encodings applied to the entity-body.

getIdentifier

public Reference getIdentifier()
Returns an optional identifier. This is useful when the representation is accessible from a location separate from the representation's resource URI, for example when content negotiation occurs.

Returns:
The identifier.

getLanguages

public java.util.List<Language> getLanguages()
Returns the modifiable list of languages. Creates a new instance if no one has been set. An "IllegalArgumentException" exception is thrown when adding a null language to this list.

Returns:
The list of languages.

getMediaType

public MediaType getMediaType()
Returns the media type.

Returns:
The media type.

setCharacterSet

public void setCharacterSet(CharacterSet characterSet)
Sets the character set or null if not applicable.

Parameters:
characterSet - The character set or null if not applicable.

setEncodings

public void setEncodings(java.util.List<Encoding> encodings)
Sets the list of encodings applied to the entity-body.

Parameters:
encodings - The list of encodings applied to the entity-body.

setIdentifier

public void setIdentifier(Reference identifier)
Sets the optional identifier. This is useful when the representation is accessible from a location separate from the representation's resource URI, for example when content negotiation occurs.

Parameters:
identifier - The identifier.

setIdentifier

public void setIdentifier(java.lang.String identifierUri)
Sets the identifier from a URI string.

Parameters:
identifierUri - The identifier to parse.

setLanguages

public void setLanguages(java.util.List<Language> languages)
Sets the list of languages.

Parameters:
languages - The list of languages.

setMediaType

public void setMediaType(MediaType mediaType)
Sets the media type.

Parameters:
mediaType - The media type.


Copyright © 2005-2008 Noelios Technologies.