|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.restlet.gwt.util.Engine
public abstract class Engine
Facade to the engine implementating the Restlet API. Note that this is an SPI class that is not intended for public usage.
Field Summary | |
---|---|
static java.lang.String |
MAJOR_NUMBER
Major version number. |
static java.lang.String |
MINOR_NUMBER
Minor version number. |
static java.lang.String |
RELEASE_NUMBER
Release number. |
static java.lang.String |
VERSION
Complete version. |
Constructor Summary | |
---|---|
Engine()
|
Method Summary | |
---|---|
abstract void |
copyResponseHeaders(java.lang.Iterable<Parameter> headers,
Response response)
Copies the given header parameters into the given Response . |
abstract org.restlet.gwt.engine.Helper<Client> |
createHelper(Client client)
Creates a new helper for a given client connector. |
abstract java.lang.String |
formatCookie(Cookie cookie)
Formats the given Cookie to a String |
abstract java.lang.String |
formatCookieSetting(CookieSetting cookieSetting)
Formats the given CookieSetting to a String |
abstract java.lang.String |
formatDimensions(java.util.Collection<Dimension> dimensions)
Formats the given Set of Dimensions to a String for the HTTP Vary header. |
abstract java.lang.String |
formatUserAgent(java.util.List<Product> products)
Formats the given List of Products to a String. |
static Engine |
getInstance()
Returns the registered Restlet engine. |
abstract Variant |
getPreferredVariant(ClientInfo client,
java.util.List<Variant> variants,
Language defaultLanguage)
Returns the best variant representation for a given resource according the the client preferences. A default language is provided in case the variants don't match the client preferences. |
static int |
hashCode(java.lang.Object... objects)
Computes the hash code of a set of objects. |
abstract void |
parse(Form form,
Representation representation)
Parses a representation into a form. |
abstract void |
parse(Form form,
java.lang.String parametersString,
CharacterSet characterSet,
boolean decode,
char separator)
Parses a parameters string to parse into a given form. |
abstract MediaType |
parseContentType(java.lang.String contentType)
Parses the given Content Type. |
abstract Cookie |
parseCookie(java.lang.String cookie)
Parses the given String to a Cookie |
abstract CookieSetting |
parseCookieSetting(java.lang.String cookieSetting)
Parses the given String to a CookieSetting |
abstract java.util.List<Product> |
parseUserAgent(java.lang.String userAgent)
Parses the given user agent String to a list of Product instances. |
static void |
setInstance(Engine engine)
Sets the registered Restlet engine. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String MAJOR_NUMBER
public static final java.lang.String MINOR_NUMBER
public static final java.lang.String RELEASE_NUMBER
public static final java.lang.String VERSION
Constructor Detail |
---|
public Engine()
Method Detail |
---|
public static Engine getInstance()
public static int hashCode(java.lang.Object... objects)
objects
- the objects to compute the hashCode
public static void setInstance(Engine engine)
engine
- The registered Restlet engine.public abstract void copyResponseHeaders(java.lang.Iterable<Parameter> headers, Response response)
Response
.
headers
- The headers to copy.response
- The response to update. Must contain a Representation
to copy the representation headers in it.public abstract org.restlet.gwt.engine.Helper<Client> createHelper(Client client)
client
- The client to help.
public abstract java.lang.String formatCookie(Cookie cookie) throws java.lang.IllegalArgumentException
cookie
-
java.lang.IllegalArgumentException
- Thrown if the Cookie contains illegal valuespublic abstract java.lang.String formatCookieSetting(CookieSetting cookieSetting) throws java.lang.IllegalArgumentException
cookieSetting
-
java.lang.IllegalArgumentException
- Thrown if the CookieSetting contains illegal valuespublic abstract java.lang.String formatDimensions(java.util.Collection<Dimension> dimensions)
dimensions
- the dimensions to format.
public abstract java.lang.String formatUserAgent(java.util.List<Product> products) throws java.lang.IllegalArgumentException
products
- The list of products to format.
java.lang.IllegalArgumentException
- Thrown if the List of Products contains illegal valuespublic abstract Variant getPreferredVariant(ClientInfo client, java.util.List<Variant> variants, Language defaultLanguage)
client
- The client preferences.variants
- The list of variants to compare.defaultLanguage
- The default language.
public abstract void parse(Form form, Representation representation)
form
- The target form.representation
- The representation to parse.public abstract void parse(Form form, java.lang.String parametersString, CharacterSet characterSet, boolean decode, char separator)
form
- The target form.parametersString
- The parameters string to parse.characterSet
- The supported character encoding.decode
- Indicates if the parameters should be decoded using the given
character set.separator
- The separator character to append between parameters.public abstract MediaType parseContentType(java.lang.String contentType) throws java.lang.IllegalArgumentException
contentType
- the Content Type as String
java.lang.IllegalArgumentException
- if the String can not be parsed.public abstract Cookie parseCookie(java.lang.String cookie) throws java.lang.IllegalArgumentException
cookie
-
java.lang.IllegalArgumentException
- Thrown if the String can not be parsed as Cookie.public abstract CookieSetting parseCookieSetting(java.lang.String cookieSetting) throws java.lang.IllegalArgumentException
cookieSetting
-
java.lang.IllegalArgumentException
- Thrown if the String can not be parsed as CookieSetting.public abstract java.util.List<Product> parseUserAgent(java.lang.String userAgent) throws java.lang.IllegalArgumentException
userAgent
-
java.lang.IllegalArgumentException
- Thrown if the String can not be parsed as a list of Product
instances.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |