Class 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
    • 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)  
    • Constructor Detail

      • DirectoryResourceLoader

        public DirectoryResourceLoader()
        Default-Constructor.
    • 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 interface org.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 interface org.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 interface org.pentaho.reporting.libraries.resourceloader.ResourceLoader
        Parameters:
        parent - the parent
        path - 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 interface org.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 interface org.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 interface org.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 interface org.pentaho.reporting.libraries.resourceloader.ResourceLoader
        Throws:
        org.pentaho.reporting.libraries.resourceloader.ResourceException
      • isSupportedDeserializer

        public boolean isSupportedDeserializer​(String data)
        Specified by:
        isSupportedDeserializer in interface org.pentaho.reporting.libraries.resourceloader.ResourceLoader
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object