Class DirectoryResourceLoader
- java.lang.Object
-
- org.pentaho.reporting.libraries.docbundle.bundleloader.DirectoryResourceLoader
-
- All Implemented Interfaces:
org.pentaho.reporting.libraries.resourceloader.ResourceLoader
public class DirectoryResourceLoader extends Object implements org.pentaho.reporting.libraries.resourceloader.ResourceLoader
A resource-loader that marks directories as a valid resource. This is a backend-loader for resource-bundles that are loaded from a directory and cannot be used as standalone resource-loader.- Author:
- Thomas Morgner
-
-
Constructor Summary
Constructors Constructor Description DirectoryResourceLoader()
Default-Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.pentaho.reporting.libraries.resourceloader.ResourceKey
createKey(Object value, Map factoryKeys)
Creates a new resource key from the given object and the factory keys.org.pentaho.reporting.libraries.resourceloader.ResourceKey
deriveKey(org.pentaho.reporting.libraries.resourceloader.ResourceKey parent, String path, Map factoryKeys)
Derives a new resource key from the given key.org.pentaho.reporting.libraries.resourceloader.ResourceKey
deserialize(org.pentaho.reporting.libraries.resourceloader.ResourceKey bundleKey, String stringKey)
boolean
equals(Object obj)
int
hashCode()
boolean
isSupportedDeserializer(String data)
boolean
isSupportedKey(org.pentaho.reporting.libraries.resourceloader.ResourceKey key)
Checks, whether this resource loader implementation was responsible for creating this key.org.pentaho.reporting.libraries.resourceloader.ResourceData
load(org.pentaho.reporting.libraries.resourceloader.ResourceKey key)
String
serialize(org.pentaho.reporting.libraries.resourceloader.ResourceKey bundleKey, org.pentaho.reporting.libraries.resourceloader.ResourceKey key)
URL
toURL(org.pentaho.reporting.libraries.resourceloader.ResourceKey key)
-
-
-
Method Detail
-
isSupportedKey
public boolean isSupportedKey(org.pentaho.reporting.libraries.resourceloader.ResourceKey key)
Checks, whether this resource loader implementation was responsible for creating this key.- Specified by:
isSupportedKey
in interfaceorg.pentaho.reporting.libraries.resourceloader.ResourceLoader
- Parameters:
key
-- Returns:
-
createKey
public org.pentaho.reporting.libraries.resourceloader.ResourceKey createKey(Object value, Map factoryKeys) throws org.pentaho.reporting.libraries.resourceloader.ResourceKeyCreationException
Creates a new resource key from the given object and the factory keys.- Specified by:
createKey
in interfaceorg.pentaho.reporting.libraries.resourceloader.ResourceLoader
- Parameters:
value
-factoryKeys
-- Returns:
- the created key or null, if the value object was not supported.
- Throws:
org.pentaho.reporting.libraries.resourceloader.ResourceKeyCreationException
- if creating the key failed.
-
deriveKey
public org.pentaho.reporting.libraries.resourceloader.ResourceKey deriveKey(org.pentaho.reporting.libraries.resourceloader.ResourceKey parent, String path, Map factoryKeys) throws org.pentaho.reporting.libraries.resourceloader.ResourceKeyCreationException
Derives a new resource key from the given key. If neither a path nor new factory-keys are given, the parent key is returned.- Specified by:
deriveKey
in interfaceorg.pentaho.reporting.libraries.resourceloader.ResourceLoader
- Parameters:
parent
- the parentpath
- the derived path (can be null).factoryKeys
- the optional factory keys (can be null).- Returns:
- the derived key.
- Throws:
org.pentaho.reporting.libraries.resourceloader.ResourceKeyCreationException
- if the key cannot be derived for any reason.
-
toURL
public URL toURL(org.pentaho.reporting.libraries.resourceloader.ResourceKey key)
- Specified by:
toURL
in interfaceorg.pentaho.reporting.libraries.resourceloader.ResourceLoader
-
load
public org.pentaho.reporting.libraries.resourceloader.ResourceData load(org.pentaho.reporting.libraries.resourceloader.ResourceKey key) throws org.pentaho.reporting.libraries.resourceloader.ResourceLoadingException
- Specified by:
load
in interfaceorg.pentaho.reporting.libraries.resourceloader.ResourceLoader
- Throws:
org.pentaho.reporting.libraries.resourceloader.ResourceLoadingException
-
deserialize
public org.pentaho.reporting.libraries.resourceloader.ResourceKey deserialize(org.pentaho.reporting.libraries.resourceloader.ResourceKey bundleKey, String stringKey) throws org.pentaho.reporting.libraries.resourceloader.ResourceKeyCreationException
- Specified by:
deserialize
in interfaceorg.pentaho.reporting.libraries.resourceloader.ResourceLoader
- Throws:
org.pentaho.reporting.libraries.resourceloader.ResourceKeyCreationException
-
serialize
public String serialize(org.pentaho.reporting.libraries.resourceloader.ResourceKey bundleKey, org.pentaho.reporting.libraries.resourceloader.ResourceKey key) throws org.pentaho.reporting.libraries.resourceloader.ResourceException
- Specified by:
serialize
in interfaceorg.pentaho.reporting.libraries.resourceloader.ResourceLoader
- Throws:
org.pentaho.reporting.libraries.resourceloader.ResourceException
-
isSupportedDeserializer
public boolean isSupportedDeserializer(String data)
- Specified by:
isSupportedDeserializer
in interfaceorg.pentaho.reporting.libraries.resourceloader.ResourceLoader
-
-