Class LocalizationContext
java.lang.Object
com.tccc.kos.commons.core.localization.LocalizationContext
- All Implemented Interfaces:
VFSSource
A context to facilitate the aggregation of language files that are
packaged in kabs using a standard
LocalizationDescriptorFragment
in a kab descriptor. The context will merge all the described namespaces
together and manage a VFS view of the aggregated language data suitable
for a ui to load.- Version:
- 2024-03-22
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(LocalizationBuilder builder) Add aLocalizationBuilder
to the context.void
Add a kab to the context.Return details for the json view.getInputStream
(String path) Returns an input stream for the specified path.Return the list of available locales in the contextGets the parent.getPath()
Return the path to where this is mounted in vfs.boolean
Return true if the source is enabled.void
Sets the parent.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.tccc.kos.commons.core.vfs.VFSSource
getBasePath, getFullPath, onUnmount
-
Constructor Details
-
LocalizationContext
public LocalizationContext()
-
-
Method Details
-
getPath
Return the path to where this is mounted in vfs. -
add
Add a kab to the context. Any localization information in the descriptor will be merged into the context and associated locale files will be mounted into the internal vfs.- Parameters:
kab
- the kab file to add to the context
-
add
Add aLocalizationBuilder
to the context. Any localization information in the builder will be merged into the context and associated locale files will be mounted into the internal vfs.- Parameters:
builder
- the builder to add to the context
-
getLocales
Return the list of available locales in the context -
getInputStream
Description copied from interface:VFSSource
Returns an input stream for the specified path.- Specified by:
getInputStream
in interfaceVFSSource
- Parameters:
path
- the requested path- Returns:
- the input stream or null if not found
-
getDetails
Description copied from interface:VFSSource
Return details for the json view.- Specified by:
getDetails
in interfaceVFSSource
-
isEnabled
public boolean isEnabled()Description copied from interface:VFSSource
Return true if the source is enabled. Disabled sources will not be accessible. -
getParent
Description copied from interface:VFSSource
Gets the parent. -
setParent
Description copied from interface:VFSSource
Sets the parent.
-