Logo Search packages:      
Sourcecode: libloader version File versions  Download package

ResourceKey org::jfree::resourceloader::loader::zip::ZipResourceLoader::deriveKey ( ResourceKey  parent,
String  path,
Map  factoryKeys 
) throws ResourceKeyCreationException [inline]

Derives a new resource key from the given key. If neither a path nor new factory-keys are given, the parent key is returned.

Parameters:
parent the parent
path the derived path (can be null).
factoryKeys the optional factory keys (can be null).
Returns:
the derived key.
Exceptions:
org.jfree.resourceloader.ResourceKeyCreationException if the key cannot be derived for any reason.

Implements org::jfree::resourceloader::ResourceLoader.

Definition at line 105 of file ZipResourceLoader.java.

References isSupportedKey().

  {
    if (isSupportedKey(parent) == false)
    {
      throw new ResourceKeyCreationException("Assertation: Unsupported parent key type");
    }

    String entry;
    if (path != null)
    {
      entry = LoaderUtils.mergePaths((String) parent.getIdentifier(), path);
    }
    else
    {
      entry = (String) parent.getIdentifier();
    }

    Map map;
    if (factoryKeys != null)
    {
      map = new HashMap();
      map.putAll(parent.getFactoryParameters());
      map.putAll(factoryKeys);
    }
    else
    {
      map = parent.getFactoryParameters();
    }
    return new ResourceKey(parent.getParent(), parent.getSchema(), entry, map);
  }


Generated by  Doxygen 1.6.0   Back to index