Class Converter
- java.lang.Object
-
- org.restlet.ext.jaxrs.internal.util.Converter
-
@Deprecated public class Converter extends java.lang.ObjectDeprecated.Will be removed in next minor release.This utility class converts Restlet objects to it correponding JAX-RS objects and vice versa.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringCHARSET_PARAMDeprecated.Paramater in the JAX-RS MediaType for the charset.
-
Constructor Summary
Constructors Modifier Constructor Description privateConverter()Deprecated.
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static java.lang.StringgetCharset(javax.ws.rs.core.MediaType mediaType)Deprecated.Returns the charset of the MediaType as Stringstatic javax.ws.rs.core.MediaTypegetMediaTypeWithoutParams(javax.ws.rs.core.MediaType mediaType)Deprecated.Creates a MediaType without any parameters.static MediaTypegetMediaTypeWithoutParams(MediaType mediaType)Deprecated.Creates a MediaType without any parameters.static CharacterSetgetRestletCharacterSet(javax.ws.rs.core.MediaType mediaType)Deprecated.Returns the Charset of the MediaType as Stringstatic FormtoForm(javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> mmap)Deprecated.Copies the data in theMultivaluedMapto theForm.static FormtoFormEncoded(java.lang.String queryString)Deprecated.Converts the given query String to a Form, but do not decode the data.static javax.ws.rs.core.CacheControltoJaxRsCacheControl(java.util.List<CacheDirective> cacheDirectives)Deprecated.static javax.ws.rs.core.CookietoJaxRsCookie(Cookie restletCookie)Deprecated.Converts a Restlet Cookie to a JAX-RS Cookiestatic javax.ws.rs.core.EntityTagtoJaxRsEntityTag(Tag restletEntityTag)Deprecated.Converts a Restlet-EntityTag to a JAX-RS-EntityTagstatic javax.ws.rs.core.MediaTypetoJaxRsMediaType(MediaType restletMediaType)Deprecated.Convert a Restlet MediaType to a JAX-RS MediaType.static javax.ws.rs.core.MediaTypetoJaxRsMediaType(MediaType restletMediaType, CharacterSet restletCharacterSet)Deprecated.Convert a Restlet MediaType to a JAX-RS MediaType.static javax.ws.rs.core.NewCookietoJaxRsNewCookie(CookieSetting cookieSetting)Deprecated.Converts the Restlet CookieSettings to a JAX-RS NewCookie.static javax.ws.rs.core.VarianttoJaxRsVariant(Variant restletVariant)Deprecated.Converts the given Restlet Variant to a JAX-RS Variantstatic LanguagetoLanguage(java.lang.String locale)Deprecated.static LanguagetoLanguage(java.util.Locale locale)Deprecated.static java.lang.StringtoLanguageString(java.util.Locale locale)Deprecated.static java.util.LocaletoLocale(java.lang.String language)Deprecated.Converts a locale String to a RestletLanguage.static java.util.LocaletoLocale(Language language)Deprecated.Converts aLocaleto a RestletLanguage.static java.util.Map<java.lang.String,java.lang.String>toMap(Series<Parameter> parameters)Deprecated.static java.util.List<CacheDirective>toRestletCacheDirective(javax.ws.rs.core.CacheControl cacheControl)Deprecated.static CookietoRestletCookie(javax.ws.rs.core.Cookie jaxRsCookie)Deprecated.Converts a JAX-RS Cookie to a Restlet Cookiestatic CookieSettingtoRestletCookieSetting(javax.ws.rs.core.NewCookie newCookie)Deprecated.Converts the Restlet JAX-RS NewCookie to a CookieSettings.static MediaTypetoRestletMediaType(javax.ws.rs.core.MediaType jaxRsMediaType)Deprecated.Convert a JAX-RS MediaType to a Restlet MediaType.static FormtoRestletSeries(java.util.Map<java.lang.String,java.lang.String> parameters)Deprecated.static TagtoRestletTag(javax.ws.rs.core.EntityTag jaxRsEntityTag)Deprecated.Converts a JAX-RS-EntityTag to a Restlet-EntityTagstatic java.util.List<Variant>toRestletVariants(java.util.Collection<javax.ws.rs.core.Variant> jaxRsVariants)Deprecated.Converts the given JAX-RS Variants to Restlet Variants.
-
-
-
Field Detail
-
CHARSET_PARAM
private static final java.lang.String CHARSET_PARAM
Deprecated.Paramater in the JAX-RS MediaType for the charset. See MIME specification.- See Also:
- Constant Field Values
-
-
Method Detail
-
getCharset
public static java.lang.String getCharset(javax.ws.rs.core.MediaType mediaType)
Deprecated.Returns the charset of the MediaType as String- Parameters:
mediaType- JaxRs-MediaType- Returns:
- the charset
-
getMediaTypeWithoutParams
public static javax.ws.rs.core.MediaType getMediaTypeWithoutParams(javax.ws.rs.core.MediaType mediaType)
Deprecated.Creates a MediaType without any parameters.- Parameters:
mediaType- A MediaType, perhaps with parameters.- Returns:
- Creates a MediaType without any parameters.
-
getMediaTypeWithoutParams
public static MediaType getMediaTypeWithoutParams(MediaType mediaType)
Deprecated.Creates a MediaType without any parameters.- Parameters:
mediaType- A MediaType, perhaps with parameters.- Returns:
- Creates a MediaType without any parameters.
-
getRestletCharacterSet
public static CharacterSet getRestletCharacterSet(javax.ws.rs.core.MediaType mediaType)
Deprecated.Returns the Charset of the MediaType as String- Parameters:
mediaType- JaxRs-MediaType- Returns:
- the charset
-
toForm
public static Form toForm(javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> mmap)
Deprecated.Copies the data in theMultivaluedMapto theForm.- Parameters:
mmap-- Returns:
- the converted Http headers or null, if null was given.
-
toFormEncoded
public static Form toFormEncoded(java.lang.String queryString)
Deprecated.Converts the given query String to a Form, but do not decode the data.- Parameters:
queryString-- Returns:
- the encoded form
-
toJaxRsCacheControl
public static javax.ws.rs.core.CacheControl toJaxRsCacheControl(java.util.List<CacheDirective> cacheDirectives)
Deprecated.- Parameters:
cacheDirectives-- Returns:
- the converted JAX-RS
CacheControl
-
toJaxRsCookie
public static javax.ws.rs.core.Cookie toJaxRsCookie(Cookie restletCookie)
Deprecated.Converts a Restlet Cookie to a JAX-RS Cookie- Parameters:
restletCookie- the Restlet Cookie- Returns:
- the JAX-RS Cookie
-
toJaxRsEntityTag
public static javax.ws.rs.core.EntityTag toJaxRsEntityTag(Tag restletEntityTag)
Deprecated.Converts a Restlet-EntityTag to a JAX-RS-EntityTag- Parameters:
restletEntityTag- the Restlet-EntityTag to convert.- Returns:
- The corresponding JAX-RS-Entity-Tag
-
toJaxRsMediaType
public static javax.ws.rs.core.MediaType toJaxRsMediaType(MediaType restletMediaType)
Deprecated.Convert a Restlet MediaType to a JAX-RS MediaType.- Parameters:
restletMediaType- the MediaType to convert.restletCharacterSet- the CharacterSet for the MediaType; may be null.- Returns:
- the converted MediaType
-
toJaxRsMediaType
public static javax.ws.rs.core.MediaType toJaxRsMediaType(MediaType restletMediaType, CharacterSet restletCharacterSet)
Deprecated.Convert a Restlet MediaType to a JAX-RS MediaType.- Parameters:
restletMediaType- the MediaType to convert.restletCharacterSet- the CharacterSet for the MediaType; may be null.- Returns:
- the converted MediaType
-
toJaxRsNewCookie
public static javax.ws.rs.core.NewCookie toJaxRsNewCookie(CookieSetting cookieSetting) throws java.lang.IllegalArgumentException
Deprecated.Converts the Restlet CookieSettings to a JAX-RS NewCookie.- Parameters:
cookieSetting-- Returns:
- the JAX-RS NewCookie
- Throws:
java.lang.IllegalArgumentException
-
toJaxRsVariant
public static javax.ws.rs.core.Variant toJaxRsVariant(Variant restletVariant) throws java.lang.IllegalArgumentException
Deprecated.Converts the given Restlet Variant to a JAX-RS Variant- Parameters:
restletVariant-- Returns:
- the JAX-RS Variant
- Throws:
java.lang.IllegalArgumentException- If the given Variant does not contain exactly one language and one
-
toLanguage
public static Language toLanguage(java.util.Locale locale)
Deprecated.- Parameters:
locale-- Returns:
- the Restlet Language
-
toLanguage
public static Language toLanguage(java.lang.String locale)
Deprecated.- Parameters:
locale-- Returns:
- the Restlet Language
-
toLanguageString
public static java.lang.String toLanguageString(java.util.Locale locale)
Deprecated.- Parameters:
locale-- Returns:
- the language string
- See Also:
toLanguage(Locale)
-
toLocale
public static java.util.Locale toLocale(Language language)
Deprecated.Converts aLocaleto a RestletLanguage.- Parameters:
language-- Returns:
- the Locale
- See Also:
toLocale(String),Locale
-
toLocale
public static java.util.Locale toLocale(java.lang.String language)
Deprecated.Converts a locale String to a RestletLanguage.- Parameters:
language-- Returns:
- the Locale
- See Also:
toLocale(Language),Locale
-
toMap
public static java.util.Map<java.lang.String,java.lang.String> toMap(Series<Parameter> parameters)
Deprecated.- Parameters:
parameters-- Returns:
- the Map
-
toRestletCacheDirective
public static java.util.List<CacheDirective> toRestletCacheDirective(javax.ws.rs.core.CacheControl cacheControl)
Deprecated.- Parameters:
cacheControl-- Returns:
- the converted
CacheDirective
-
toRestletCookie
public static Cookie toRestletCookie(javax.ws.rs.core.Cookie jaxRsCookie)
Deprecated.Converts a JAX-RS Cookie to a Restlet Cookie- Parameters:
jaxRsCookie- the JAX-RS Cookie- Returns:
- the Restlet Cookie
-
toRestletCookieSetting
public static CookieSetting toRestletCookieSetting(javax.ws.rs.core.NewCookie newCookie) throws java.lang.IllegalArgumentException
Deprecated.Converts the Restlet JAX-RS NewCookie to a CookieSettings.- Parameters:
newCookie-- Returns:
- the converted CookieSetting
- Throws:
java.lang.IllegalArgumentException
-
toRestletMediaType
public static MediaType toRestletMediaType(javax.ws.rs.core.MediaType jaxRsMediaType)
Deprecated.Convert a JAX-RS MediaType to a Restlet MediaType.- Parameters:
jaxRsMediaType-- Returns:
- the converted MediaType
-
toRestletSeries
public static Form toRestletSeries(java.util.Map<java.lang.String,java.lang.String> parameters)
Deprecated.- Parameters:
parameters-- Returns:
- a form with the given parameters. Will never return null.
-
toRestletTag
public static Tag toRestletTag(javax.ws.rs.core.EntityTag jaxRsEntityTag)
Deprecated.Converts a JAX-RS-EntityTag to a Restlet-EntityTag- Parameters:
jaxRsEntityTag- the JAX-RS-EntityTag to convert.- Returns:
- The corresponding Restlet-Entity-Tag
-
toRestletVariants
public static java.util.List<Variant> toRestletVariants(java.util.Collection<javax.ws.rs.core.Variant> jaxRsVariants)
Deprecated.Converts the given JAX-RS Variants to Restlet Variants.- Parameters:
jaxRsVariants-- Returns:
- the List of Restlet Variants
-
-