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 TypeMethodDescriptionvoidadd(LocalizationBuilder builder) Add aLocalizationBuilderto the context.voidAdd 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.booleanReturn true if the source is enabled.voidSets the parent.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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 aLocalizationBuilderto 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:VFSSourceReturns an input stream for the specified path.- Specified by:
getInputStreamin interfaceVFSSource- Parameters:
path- the requested path- Returns:
- the input stream or null if not found
-
getDetails
Description copied from interface:VFSSourceReturn details for the json view.- Specified by:
getDetailsin interfaceVFSSource
-
isEnabled
public boolean isEnabled()Description copied from interface:VFSSourceReturn true if the source is enabled. Disabled sources will not be accessible. -
getParent
Description copied from interface:VFSSourceGets the parent. -
setParent
Description copied from interface:VFSSourceSets the parent.
-