org.pentaho.reporting.libraries.resourceloader
Class DefaultResourceManagerBackend
java.lang.Object
org.pentaho.reporting.libraries.resourceloader.DefaultResourceManagerBackend
- All Implemented Interfaces:
- ResourceManagerBackend
public class DefaultResourceManagerBackend
- extends java.lang.Object
- implements ResourceManagerBackend
Todo: Document Me
- Author:
- Thomas Morgner
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultResourceManagerBackend
public DefaultResourceManagerBackend()
createKey
public ResourceKey createKey(java.lang.Object data,
java.util.Map parameters)
throws ResourceKeyCreationException
- Specified by:
createKey
in interface ResourceManagerBackend
- Throws:
ResourceKeyCreationException
deriveKey
public ResourceKey deriveKey(ResourceKey parent,
java.lang.String path,
java.util.Map parameters)
throws ResourceKeyCreationException
- Derives a new key from the given resource-key. Only keys for a hierarchical storage system (like file-systems or
URLs) can have derived keys. Since LibLoader 0.3.0 only hierarchical keys can be derived. For that, the deriving
path must be given as String.
The optional parameter-map will be applied to the derived key after the parent's parameters have been copied to
the new key.
Before trying to derive the key, the system tries to interpret the path as absolute key-value.
- Specified by:
deriveKey
in interface ResourceManagerBackend
- 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.
toURL
public java.net.URL toURL(ResourceKey key)
- Specified by:
toURL
in interface ResourceManagerBackend
create
public Resource create(ResourceManager frontEnd,
ResourceData data,
ResourceKey context,
java.lang.Class[] target)
throws ResourceLoadingException,
ResourceCreationException
- Specified by:
create
in interface ResourceManagerBackend
- Throws:
ResourceLoadingException
ResourceCreationException
isResourceUnchanged
public boolean isResourceUnchanged(ResourceManager frontEnd,
Resource resource)
throws ResourceLoadingException
- Specified by:
isResourceUnchanged
in interface ResourceManagerBackend
- Throws:
ResourceLoadingException
loadResourceBundle
public ResourceBundleData loadResourceBundle(ResourceManager frontEnd,
ResourceKey key)
throws ResourceLoadingException
- Tries to find the first resource-bundle-loader that would be able to process the key.
- Specified by:
loadResourceBundle
in interface ResourceManagerBackend
- 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.
loadRawData
public ResourceData loadRawData(ResourceManager frontEnd,
ResourceKey key)
throws ResourceLoadingException,
UnrecognizedLoaderException
- Specified by:
loadRawData
in interface ResourceManagerBackend
- Throws:
ResourceLoadingException
UnrecognizedLoaderException
registerDefaultFactories
public void registerDefaultFactories()
- Specified by:
registerDefaultFactories
in interface ResourceManagerBackend
registerDefaultLoaders
public void registerDefaultLoaders()
- Specified by:
registerDefaultLoaders
in interface ResourceManagerBackend
registerBundleLoader
public void registerBundleLoader(ResourceBundleLoader loader)
- Specified by:
registerBundleLoader
in interface ResourceManagerBackend
registerLoader
public void registerLoader(ResourceLoader loader)
- Specified by:
registerLoader
in interface ResourceManagerBackend
registerFactory
public void registerFactory(ResourceFactory factory)
- Specified by:
registerFactory
in interface ResourceManagerBackend