org.springframework.extensions.webscripts
Class NegotiatedFormat
java.lang.Object
org.springframework.extensions.webscripts.NegotiatedFormat
public final class NegotiatedFormat
- extends Object
Map between media type and format
This class is immutable.
- Author:
- davidc
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NegotiatedFormat
public NegotiatedFormat(MediaType mediaType,
String format)
- Construct
- Parameters:
mediaType
- format
-
getMediaType
public MediaType getMediaType()
- Returns:
- media type
getFormat
public String getFormat()
- Returns:
- format
negotiateFormat
public static String negotiateFormat(String accept,
NegotiatedFormat[] negotiatedFormats)
- Negotiate Format - given a list of accepted media types, return the format that's
most suitable
- Parameters:
accept
- comma-seperated list of accepted media typesnegotiatedFormats
- list of available formats
- Returns:
- most suitable format (or null, if none)
Copyright © 2009 SpringSource, Inc. All Rights Reserved.