Package org.restlet.engine.application
Class Conneg
java.lang.Object
org.restlet.engine.application.Conneg
- Direct Known Subclasses:
StrictConneg
Content negotiation algorithm.
- Author:
- Jerome Louvel
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetPreferredVariant(List<? extends Variant> variants) Returns the best variant representation for a given resource according the the client preferences.
A default language is provided in case the variants don't match the client preferences.Returns the request including client preferences.abstract floatscoreVariant(Variant variant) Scores a variant relatively to enriched client preferences.
-
Constructor Details
-
Conneg
Constructor.- Parameters:
request- The request including client preferences.metadataService- The metadata service used to get default metadata values.
-
-
Method Details
-
getRequest
Returns the request including client preferences.- Returns:
- The request including client preferences.
-
getPreferredVariant
Returns the best variant representation for a given resource according the the client preferences.
A default language is provided in case the variants don't match the client preferences.- Parameters:
variants- The list of variants to compare.- Returns:
- The preferred variant.
- See Also:
-
scoreVariant
Scores a variant relatively to enriched client preferences.- Parameters:
variant- The variant to score.- Returns:
- The enriched client preferences.
-