Class HttpAcceptLanguageParser
java.lang.Object
ch.tocco.nice2.textresources.api.locale.HttpAcceptLanguageParser
Parser for the Accept-Language HTTP Header value.
Example: "da, en-gb;q=0.8, en;q=0.7"
See http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
-
Method Summary
Modifier and TypeMethodDescriptionparseIgnorePrio
(String acceptLanguage) Ingores the numbers but keeps the order.parseIgnorePrioNoEx
(String acceptLanguage) Like parseIgnorePrio() but ignores any invalid entry thrown as IllegalArgumentException.
-
Method Details
-
parseIgnorePrio
Ingores the numbers but keeps the order.- Parameters:
acceptLanguage
- (may be null)- Returns:
- Ordered Set, may be empty
- Throws:
IllegalArgumentException
- on first parse or validation error
-
parseIgnorePrioNoEx
Like parseIgnorePrio() but ignores any invalid entry thrown as IllegalArgumentException.- Parameters:
acceptLanguage
- (may be null)- Returns:
- Ordered Set, may be empty
-