Class SerializerSet
Serializers that can be looked up by media type.
 Description
Provides the following features:- 
      Finds serializers based on HTTP Accept header values.
- Sets common properties on all serializers in a single method call.
- Clones existing groups and all serializers within the group in a single method call.
Match ordering
Serializers are matched againstAdding new entries will cause the entries to be prepended to the group. This allows for previous serializers to be overridden through subsequent calls.
 For example, calling g.append(S1.
 will result in the order 
Example:
   
Notes:
- This class is thread safe and reusable.
See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classBuilder class.static classAn identifier that the previous entries in this group should be inherited.static classAn identifier that the previous entries in this group should not be inherited.
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedSerializerSet(SerializerSet.Builder builder) Constructor.
- 
Method SummaryModifier and TypeMethodDescriptioncopy()Creates a copy of this serializer group.static SerializerSet.Buildercreate()Static creator.static SerializerSet.BuilderStatic creator.getSerializer(String acceptHeader) Same asgetSerializerMatch(String)but returns just the matched serializer.getSerializer(MediaType mediaType) Same asgetSerializerMatch(MediaType)but returns just the matched serializer.getSerializerMatch(String acceptHeader) Searches the group for a serializer that can handle the specifiedAccept value.getSerializerMatch(MediaType mediaType) Same asgetSerializerMatch(String)but matches using aMediaTypeinstance.Returns a copy of the serializers in this group.getStreamSerializer(String acceptHeader) Same asgetSerializer(String), but casts it to anOutputStreamSerializer.getStreamSerializer(MediaType mediaType) Same asgetSerializer(MediaType), but casts it to aOutputStreamSerializer.Returns the media types that all serializers in this group can handle.getWriterSerializer(String acceptHeader) Same asgetSerializer(String), but casts it to aWriterSerializer.getWriterSerializer(MediaType mediaType) Same asgetSerializer(MediaType), but casts it to aWriterSerializer.booleanisEmpty()Returnstrue if this group contains no serializers.
- 
Constructor Details- 
SerializerSetConstructor.- Parameters:
- builder- The builder for this bean.
 
 
- 
- 
Method Details- 
createStatic creator.- Parameters:
- beanStore- The bean store to use for creating beans.
- Returns:
- A new builder for this object.
 
- 
createStatic creator.- Returns:
- A new builder for this object.
 
- 
copyCreates a copy of this serializer group.- Returns:
- A new copy of this serializer group.
 
- 
getSerializerMatchSearches the group for a serializer that can handle the specifiedAccept value.The accept value complies with the syntax described in RFC2616, Section 14.1, as described below:Accept = "Accept" ":" #( media-range [ accept-params ] ) media-range = ( "*\/*" | ( type "/" "*" ) | ( type "/" subtype ) ) *( ";" parameter ) accept-params = ";" "q" "=" qvalue *( accept-extension ) accept-extension = ";" token [ "=" ( token | quoted-string ) ] The returned object includes both the serializer and media type that matched. - Parameters:
- acceptHeader- The HTTP- Accept header string.
- Returns:
- The serializer and media type that matched the accept header, or null if no match was made.
 
- 
getSerializerMatchSame asgetSerializerMatch(String)but matches using aMediaTypeinstance.- Parameters:
- mediaType- The HTTP media type.
- Returns:
- The serializer and media type that matched the media type, or null if no match was made.
 
- 
getSerializerSame asgetSerializerMatch(String)but returns just the matched serializer.- Parameters:
- acceptHeader- The HTTP- Accept header string.
- Returns:
- The serializer that matched the accept header, or null if no match was made.
 
- 
getSerializerSame asgetSerializerMatch(MediaType)but returns just the matched serializer.- Parameters:
- mediaType- The HTTP media type.
- Returns:
- The serializer that matched the accept header, or null if no match was made.
 
- 
getWriterSerializerSame asgetSerializer(String), but casts it to aWriterSerializer.- Parameters:
- acceptHeader- The HTTP- Accept header string.
- Returns:
- The serializer that matched the accept header, or null if no match was made.
 
- 
getWriterSerializerSame asgetSerializer(MediaType), but casts it to aWriterSerializer.- Parameters:
- mediaType- The HTTP media type.
- Returns:
- The serializer that matched the accept header, or null if no match was made.
 
- 
getStreamSerializerSame asgetSerializer(String), but casts it to anOutputStreamSerializer.- Parameters:
- acceptHeader- The HTTP- Accept header string.
- Returns:
- The serializer that matched the accept header, or null if no match was made.
 
- 
getStreamSerializerSame asgetSerializer(MediaType), but casts it to aOutputStreamSerializer.- Parameters:
- mediaType- The HTTP media type.
- Returns:
- The serializer that matched the accept header, or null if no match was made.
 
- 
getSupportedMediaTypesReturns the media types that all serializers in this group can handle.Entries are ordered in the same order as the serializers in the group. - Returns:
- An unmodifiable list of media types.
 
- 
getSerializersReturns a copy of the serializers in this group.- Returns:
- An unmodifiable list of serializers in this group.
 
- 
isEmptyReturnstrue if this group contains no serializers.- Returns:
- true if this group contains no serializers.
 
 
-