public class TextLoadMgr
extends java.lang.Object
As per its name, this class manages the process of loading text data from a multitude of possible sources. TextLoadMgr maintains a list of TextLoaderFactory instances and uses the TextLoader provided by the first TextLoaderFactory that returns a non-null TextLoader instance.
Every TemplateManager maintains an internal TextLoadMgr instance.
After a TextLoader is first obtained, TextLoadMgr keeps the TextLoader in HashMap cache for later requests to the same Path.
Constructor and Description |
---|
TextLoadMgr() |
Modifier and Type | Method and Description |
---|---|
TextSource |
getSource(Path path) |
TextLoadMgr |
register(TextLoaderFactory factory)
This needs to be invoked at least once so that the TextLoadMgr has a factory that can
generate TextLoaders to obtain text data.
|
void |
resetCache()
Clears the internal Map object that caches TextLoaders.
|
void |
setCache(java.util.Map cache)
Allows one to provide a custom Map implementation for the TextLoader cache.
|
void |
unregister(TextLoaderFactory factory)
Unregisters the given factory so that it is no longer used to obtain TextLoaders.
|
public TextLoadMgr register(TextLoaderFactory factory)
public void unregister(TextLoaderFactory factory)
public void resetCache()
public void setCache(java.util.Map cache)
cache
- The new cache.public TextSource getSource(Path path)