public class I18nFile extends Object
I18nRepository
, bound to a specific locale settings. If parent repository has no multiple
locale support this class locale
field is always null.
If locale
argument is provided to constructor, it should be based only on language and optional country, encoded
with ISO 639 alpha-2, respective ISO 3166 alpha-2; script, variant and extension are empty. Constructor throws illegal
argument exception if locale
argument has variant, script or extension.
Modifier and Type | Field and Description |
---|---|
private File |
file
The file path.
|
private Locale |
locale
Locale settings this file belongs to, always null if parent repository has no support for multiple locale.
|
Constructor and Description |
---|
I18nFile(File file)
Construct not locale sensitive I18N file instance.
|
I18nFile(File file,
Locale locale)
Construct I18N file instance bound to specified locale settings.
|
Modifier and Type | Method and Description |
---|---|
File |
getFile()
Get path of the underlying filesystem file.
|
String |
getLanguageTag()
Convenient method to retrieve locale language tag, possible null.
|
Locale |
getLocale()
Get bound locale settings or null, if parent repository has no multiple locale support.
|
String |
getName()
Convenient method to retrieve file name.
|
private final File file
private final Locale locale
I18nFile(File file) throws IllegalArgumentException
file
- underlying filesystem file path.IllegalArgumentException
I18nFile(File file, Locale locale) throws IllegalArgumentException
file
- underlying filesystem file path,locale
- locale settings.IllegalArgumentException
- if locale
argument is null or has variant, script or extension.public File getFile()
file
public String getName()
file
public Locale getLocale()
locale
Copyright © 2018. All rights reserved.