org.pentaho.reporting.libraries.resourceloader
public final class ResourceManager extends Object
See Also: ResourceData ResourceLoader ResourceFactory
| Field Summary | |
|---|---|
| static String | BUNDLE_CACHE_PROVIDER_KEY |
| static String | BUNDLE_LOADER_PREFIX |
| static String | DATA_CACHE_PROVIDER_KEY |
| static String | FACTORY_CACHE_PROVIDER_KEY |
| static String | FACTORY_TYPE_PREFIX |
| static String | LOADER_PREFIX |
| Constructor Summary | |
|---|---|
| ResourceManager()
Default Constructor. | |
| ResourceManager(ResourceManagerBackend resourceManagerBackend) | |
| ResourceManager(ResourceManager parent, ResourceManagerBackend backend) | |
| Method Summary | |
|---|---|
| Resource | create(ResourceKey key, ResourceKey context, Class target) |
| Resource | create(ResourceKey key, ResourceKey context) |
| Resource | create(ResourceKey key, ResourceKey context, Class[] target) |
| Resource | createDirectly(Object keyValue, Class target) |
| ResourceKey | createKey(Object data)
Creates a ResourceKey that carries no Loader-Parameters from the given object.
|
| ResourceKey | createKey(Object data, Map parameters)
Creates a ResourceKey that carries the given Loader-Parameters contained in the optional map.
|
| ResourceKey | deriveKey(ResourceKey parent, String path)
Derives a new key from the given resource-key. |
| ResourceKey | deriveKey(ResourceKey parent, String path, Map parameters)
Derives a new key from the given resource-key. |
| ResourceKey | deserialize(ResourceKey bundleKey, String serializedKey)
Converts a serialized version of a ResourceKey into an actual ResourceKey
by locating the proper ResourceLoader that can perform the deserialization.
|
| ResourceManagerBackend | getBackend() |
| ResourceBundleDataCache | getBundleCache() |
| ResourceDataCache | getDataCache() |
| ResourceFactoryCache | getFactoryCache() |
| ResourceData | load(ResourceKey key) |
| ResourceData | loadRawData(ResourceKey key) |
| ResourceBundleData | loadResourceBundle(ResourceKey key)
Tries to find the first resource-bundle-loader that would be able to process the key.
|
| void | registerBundleDataCache() |
| void | registerBundleLoader(ResourceBundleLoader loader) |
| void | registerDataCache() |
| void | registerDefaultFactories() |
| void | registerDefaultLoaders() |
| void | registerDefaults() |
| void | registerFactory(ResourceFactory factory) |
| void | registerFactoryCache() |
| void | registerLoader(ResourceLoader loader) |
| String | serialize(ResourceKey bundleKey, ResourceKey key)
Creates a String version of the ResourceKey that can be deserialized with the
deserialize() method.
|
| void | setBundleCache(ResourceBundleDataCache bundleCache) |
| void | setDataCache(ResourceDataCache dataCache) |
| void | setFactoryCache(ResourceFactoryCache factoryCache) |
| void | shutDown() |
| URL | toURL(ResourceKey key)
Tries to convert the resource-key into an URL. |
Parameters: data the key-data
Returns: the generated resource-key, never null.
Throws: ResourceKeyCreationException if the key-creation failed.
Parameters: data the key-data parameters an optional map of parameters.
Returns: the generated resource-key, never null.
Throws: ResourceKeyCreationException if the key-creation failed.
Parameters: parent the parent key, must never be null path the relative path, that is used to derive the key.
Returns: the derived key.
Throws: ResourceKeyCreationException if deriving the key failed.
Parameters: parent the parent key, or null to interpret the path as absolute key. path the relative path, that is used to derive the key. parameters a optional map containing resource-key parameters.
Returns: the derived key.
Throws: ResourceKeyCreationException if deriving the key failed.
ResourceKey into an actual ResourceKey
by locating the proper ResourceLoader that can perform the deserialization.
Parameters: serializedKey the String serialized key to be deserialized
Returns: the ResourceKey that has been deserialized
Throws: ResourceKeyCreationException indicates an error trying to create the ResourceKey
from the deserialized version
Parameters: key the resource-key.
Returns: the resourceloader for that key, or null, if no resource-loader is able to process the key.
Throws: ResourceLoadingException if an error occured.
ResourceKey that can be deserialized with the
deserialize() method.
Parameters: bundleKey the key to the bundle containing the resource, or null if no bundle exists. key the key to be serialized
Throws: ResourceException indicates an error trying to serialize the key NullPointerException indicates the supplied key is null
Parameters: key the resource-key
Returns: the URL for the key, or null if there is no such key.