|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.ws.rs.core.Variant.VariantListBuilder
org.glassfish.jersey.message.internal.VariantListBuilder
public class VariantListBuilder
An implementation of VariantListBuilder.
| Constructor Summary | |
|---|---|
VariantListBuilder()
|
|
| Method Summary | |
|---|---|
VariantListBuilder |
add()
Add the current combination of metadata to the list of supported variants, after this method is called the current combination of metadata is emptied. |
List<Variant> |
build()
Add the current combination of metadata to the list of supported variants (provided the current combination of metadata is not empty) and build a list of representation variants from the current state of the builder. |
VariantListBuilder |
encodings(String... encodings)
Set the encoding(s) for this variant. |
VariantListBuilder |
languages(Locale... languages)
Set the language(s) for this variant. |
VariantListBuilder |
mediaTypes(MediaType... mediaTypes)
Set the media type(s) for this variant. |
| Methods inherited from class javax.ws.rs.core.Variant.VariantListBuilder |
|---|
newInstance |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public VariantListBuilder()
| Method Detail |
|---|
public List<Variant> build()
Variant.VariantListBuilder
build in class Variant.VariantListBuilderpublic VariantListBuilder add()
Variant.VariantListBuilder
If more than one value is supplied for one or more of the variant properties
then a variant will be generated for each possible combination. E.g.
in the following list would have five (4 + 1) members:
Listlist = VariantListBuilder.newInstance() .languages(Locale.ENGLISH, Locale.FRENCH).encodings("zip", "identity").add() .languages(Locale.GERMAN).mediaTypes(MediaType.TEXT_PLAIN_TYPE).add() .build()
Note that it is not necessary to call the add() method immediately before
the build method is called. E.g. the resulting list produced in the example above
would be identical to the list produced by the following code:
Listlist = VariantListBuilder.newInstance() .languages(Locale.ENGLISH, Locale.FRENCH).encodings("zip", "identity").add() .languages(Locale.GERMAN).mediaTypes(MediaType.TEXT_PLAIN_TYPE) .build()
add in class Variant.VariantListBuilderpublic VariantListBuilder languages(Locale... languages)
Variant.VariantListBuilder
languages in class Variant.VariantListBuilderlanguages - the available languages.
public VariantListBuilder encodings(String... encodings)
Variant.VariantListBuilder
encodings in class Variant.VariantListBuilderencodings - the available encodings.
public VariantListBuilder mediaTypes(MediaType... mediaTypes)
Variant.VariantListBuilder
mediaTypes in class Variant.VariantListBuildermediaTypes - the available mediaTypes. If specific charsets
are supported they should be included as parameters of the respective
media type.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||