Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sun.jersey.core.spi.factory
Class VariantListBuilderImpl

    java.lang.Object
      javax.ws.rs.core.Variant.VariantListBuilder
          com.sun.jersey.core.spi.factory.VariantListBuilderImpl

    public class VariantListBuilderImpl

extends Variant.VariantListBuilder

An implementation of `Variant.VariantListBuilder`.

Author:
  Paul.Sandoz@Sun.Com

Constructor Summary
`VariantListBuilderImpl()`

Method Summary
`Variant.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.
`java.util.List<Variant>` | `build()` Build a list of representation variants from the current state of the builder.
`Variant.VariantListBuilder` | `encodings(java.lang.String... encodings)` Set the encoding[s] for this variant.
`Variant.VariantListBuilder` | `languages(java.util.Locale... languages)` Set the language[s] for this variant.
`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

### VariantListBuilderImpl

    public VariantListBuilderImpl()

Method Detail

### build

    public java.util.List<Variant> build()

  Description copied from class: `Variant.VariantListBuilder`
  Build a list of representation variants from the current state of the builder. After this method is called the builder is reset to an empty state.

  Specified by:
    `build` in class `Variant.VariantListBuilder`
  Returns:
    a list of representation variants

### add

    public Variant.VariantListBuilder add()

  Description copied from class: `Variant.VariantListBuilder`
  Add the current combination of metadata to the list of supported variants, after this method is called the current combination of metadata is emptied. 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 four members:

      List list = VariantListBuilder.newInstance().languages("en","fr")
         .encodings("zip", "identity").add().build()

  Specified by:
    `add` in class `Variant.VariantListBuilder`
  Returns:
    the updated builder

### languages

    public Variant.VariantListBuilder languages(java.util.Locale... languages)

  Description copied from class: `Variant.VariantListBuilder`
  Set the language[s] for this variant.

  Specified by:
    `languages` in class `Variant.VariantListBuilder`
  Parameters:
    `languages` - the available languages
  Returns:
    the updated builder

### encodings

    public Variant.VariantListBuilder encodings(java.lang.String... encodings)

  Description copied from class: `Variant.VariantListBuilder`
  Set the encoding[s] for this variant.

  Specified by:
    `encodings` in class `Variant.VariantListBuilder`
  Parameters:
    `encodings` - the available encodings
  Returns:
    the updated builder

### mediaTypes

    public Variant.VariantListBuilder mediaTypes(MediaType... mediaTypes)

  Description copied from class: `Variant.VariantListBuilder`
  Set the media type[s] for this variant.

  Specified by:
    `mediaTypes` in class `Variant.VariantListBuilder`
  Parameters:
    `mediaTypes` - the available mediaTypes. If specific charsets are supported they should be included as parameters of the respective media type.
  Returns:
    the updated builder

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2011 Oracle Corporation. All Rights Reserved.