Package org.jfree.resourceloader

Examples of org.jfree.resourceloader.ResourceKey


  public ResourceKey createKey(Object value, Map factoryKeys)
      throws ResourceKeyCreationException
  {
    if (value instanceof URL)
    {
      return new ResourceKey
          (URLResourceLoader.class.getName(), value, factoryKeys);
    }
    if (value instanceof String)
    {
      String valueString = (String) value;
      // the 'file' schema is defined to have double-slashes, but the JDK
      // ignores RFC 1738 in that case. So we have to check for these beasts
      // directly ..
      if (valueString.indexOf("://") >= 0 ||
          valueString.startsWith("file:/"))
      {
        try
        {
          return new ResourceKey(URLResourceLoader.class.getName(),
              new URL(valueString), factoryKeys);

        }
        catch (MalformedURLException mfue)
        {
View Full Code Here


      }
      else
      {
        map = parent.getFactoryParameters();
      }
      return new ResourceKey(parent.getSchema(), url, map);
    }
    catch (MalformedURLException e)
    {
      throw new ResourceKeyCreationException("Malformed value: " + path);
    }
View Full Code Here

    }
  }

  public void put(final Resource resource)
  {
    final ResourceKey source = resource.getSource();
    final String ext = CacheUtility.externalizeKey(source);
    if (ext == null)
    {
      return;
    }
View Full Code Here

    factoryCache.putInCache(ext, resource);
  }

  public void remove(final Resource resource)
  {
    final ResourceKey source = resource.getSource();
    final String ext = CacheUtility.externalizeKey(source);
    if (ext == null)
    {
      return;
    }
View Full Code Here

    if (value instanceof String)
    {
      String valueString = (String) value;
      if (valueString.startsWith("res://"))
      {
        return new ResourceKey(ClassloaderResourceLoader.class.getName(),
            value, factoryKeys);
      }
    }

    //throw new ResourceKeyCreationException("Unsupported identifier.");
View Full Code Here

    }
    else
    {
      map = parent.getFactoryParameters();
    }
    return new ResourceKey(parent.getSchema(), resource, map);
  }
View Full Code Here

    if (value instanceof byte[] == false)
    {
      return null;
    }

    return new ResourceKey(RawResourceLoader.class.getName(), value, factoryKeys);
  }
View Full Code Here

    if (factoryKeys == null) return parent;

    HashMap map = new HashMap();
    map.putAll(parent.getFactoryParameters());
    map.putAll(factoryKeys);
    return new ResourceKey(parent.getSchema(), parent.getIdentifier(), map);
  }
View Full Code Here

    }
  }

  public void put(final Resource resource)
  {
    final ResourceKey source = resource.getSource();
    try
    {
      factoryCache.put(new Element(source, resource));
    }
    catch(Exception e)
View Full Code Here

    }
  }

  public void remove(final Resource resource)
  {
    final ResourceKey source = resource.getSource();

    factoryCache.remove(source);
  }
View Full Code Here

TOP

Related Classes of org.jfree.resourceloader.ResourceKey

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.