public class FlexibleConneg extends StrictConneg
Constructor and Description |
---|
FlexibleConneg(Request request,
MetadataService metadataService)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected <T extends Metadata> |
canAdd(T metadata,
java.util.List<T> undesired)
Returns true if the metadata can be added.
|
protected java.util.List<Preference<CharacterSet>> |
getCharacterSetPrefs()
Returns the enriched list of character set preferences.
|
protected java.util.List<Preference<Encoding>> |
getEncodingPrefs()
Returns the enriched list of encoding preferences.
|
protected <T extends Metadata> |
getEnrichedPreferences(java.util.List<Preference<T>> userPreferences,
T defaultValue,
T allValue)
Returns an enriched list of preferences.
|
protected java.util.List<Preference<Language>> |
getLanguagePrefs()
Returns the enriched list of language preferences.
|
protected java.util.List<Preference<MediaType>> |
getMediaTypePrefs()
Returns the enriched list of media type preferences.
|
scoreAnnotation, scoreCharacterSet, scoreEncodings, scoreLanguages, scoreMediaType, scoreMetadata, scoreMetadata, scoreVariant
getPreferredVariant, getRequest
public FlexibleConneg(Request request, MetadataService metadataService)
request
- The request including client preferences.metadataService
- The metadata service used to get default metadata values.protected <T extends Metadata> boolean canAdd(T metadata, java.util.List<T> undesired)
T
- metadata
- The metadata to add.undesired
- The list of prohibited metadata.protected java.util.List<Preference<CharacterSet>> getCharacterSetPrefs()
getCharacterSetPrefs
in class StrictConneg
protected java.util.List<Preference<Encoding>> getEncodingPrefs()
getEncodingPrefs
in class StrictConneg
protected <T extends Metadata> java.util.List<Preference<T>> getEnrichedPreferences(java.util.List<Preference<T>> userPreferences, T defaultValue, T allValue)
T
- userPreferences
- The user preferences to enrich.defaultValue
- The default value.allValue
- The ALL value.protected java.util.List<Preference<Language>> getLanguagePrefs()
getLanguagePrefs
in class StrictConneg
protected java.util.List<Preference<MediaType>> getMediaTypePrefs()
getMediaTypePrefs
in class StrictConneg
Copyright © 2005-2024 Restlet.