Package no.hasmac.jsonld.lang
Class LanguageTag
java.lang.Object
no.hasmac.jsonld.lang.LanguageTag
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Collection
<LanguageTag.Extension> private String
private Collection
<String> private Collection
<String> private String
private String
private Collection
<String> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addExtension
(LanguageTag.Extension extension) protected void
addLanguageExtension
(String languageExtension) protected void
addPrivateUse
(String privateTag) protected void
addVariant
(String variant) static LanguageTag
Creates a language tag by parsing the given string as defined by RFC 5646.boolean
Collection of extension sub-tags.Language as shortest ISO 639 code or reserved code for future use or registered language subtag code.Collection of ISO 639 codes.Collection of private sub-tags.Region as ISO 3166-1 or UN M.49 codeScript as ISO 15924 code.Collection of registered variant codes.int
hashCode()
static boolean
isWellFormed
(String languageTag) Language tags are used to help identify languages and are defined byRFC 5646
protected void
setLanguage
(String language) protected void
protected void
toString()
-
Field Details
-
language
-
languageExtensions
-
script
-
region
-
extensions
-
variants
-
privateUse
-
-
Constructor Details
-
LanguageTag
LanguageTag()
-
-
Method Details
-
isWellFormed
Language tags are used to help identify languages and are defined byRFC 5646
- Parameters:
languageTag
- to check- Returns:
true
if the provided value is well-formed language tag- See Also:
-
create
Creates a language tag by parsing the given string as defined by RFC 5646.- Parameters:
languageTag
- the string to be parsed into a language tag- Returns:
- The new language tag
- Throws:
IllegalArgumentException
- if the given string is not well-formed
-
getLanguage
Language as shortest ISO 639 code or reserved code for future use or registered language subtag code.- Returns:
- the language code
-
getLanguageExtensions
Collection of ISO 639 codes.- Returns:
- the extension codes
-
getScript
Script as ISO 15924 code.- Returns:
- the script name code
-
getRegion
Region as ISO 3166-1 or UN M.49 code- Returns:
- the region code
-
getVariants
Collection of registered variant codes.- Returns:
- the variant codes
-
getExtensions
Collection of extension sub-tags.- Returns:
- a collection of sub-tags
-
getPrivateUse
Collection of private sub-tags.- Returns:
- a collection of private sub-tags
-
setLanguage
-
addLanguageExtension
-
setScript
-
setRegion
-
addVariant
-
addExtension
-
addPrivateUse
-
hashCode
public int hashCode() -
equals
-
toString
-