Package org.jfree.resourceloader

Examples of org.jfree.resourceloader.ResourceKey


      final String styleText = (String) styleValue;
      try
      {
        final LayoutProcess layoutProcess = getLayoutProcess();
        final byte[] bytes = styleText.getBytes("UTF-8");
        final ResourceKey baseKey =
                DocumentContextUtility.getBaseResource
                        (layoutProcess.getDocumentContext());
        final ResourceManager manager = layoutProcess.getResourceManager();
        final ResourceKey key = manager.createKey(bytes);
        final Resource resource = manager.create(key, baseKey, StyleRule.class);

        final CSSDeclarationRule rule =
                (CSSDeclarationRule) resource.getResource();
        if (rule != null)
View Full Code Here


  public ResourceKey createKey(final Object value, final Map factoryKeys)
      throws ResourceKeyCreationException
  {
    if (value instanceof File)
    {
      return new ResourceKey(FileResourceLoader.class.getName(), value, factoryKeys);
    }

    if (value instanceof String)
    {
      final File f = new File(String.valueOf(value));
      if (f.exists() && f.isFile())
      {
        return new ResourceKey(FileResourceLoader.class.getName(), f, factoryKeys);
      }
    }

    return null;
  }
View Full Code Here

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

    {
      return null;
    }

    final ZipEntryKey entryKey = (ZipEntryKey) value;
    final ResourceKey parentKey = entryKey.getZipFile().getKey();

    return new ResourceKey(parentKey, ZipResourceLoader.class.getName(),
        entryKey.getEntryName(), factoryKeys);
  }
View Full Code Here

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

                                              final Class[] type)
          throws FunctionEvaluationException
  {
    // ok, this is going to be expensive. Kids, you dont wanna try this at home ...
    final ResourceManager manager = process.getResourceManager();
    final ResourceKey baseKey = DocumentContextUtility.getBaseResource
            (process.getDocumentContext());
    try
    {
      final ResourceKey key;
      if (value instanceof ResourceKey)
      {
        key = (ResourceKey) value;
      }
      else if (baseKey == null)
View Full Code Here

  public static ResourceKey createURI(final String uri, final LayoutProcess layoutProcess)
  {
    try
    {
      final DocumentContext context = layoutProcess.getDocumentContext();
      final ResourceKey base = DocumentContextUtility.getBaseResource(context);
      final ResourceManager resourceManager =
              layoutProcess.getResourceManager();

      if (base != null)
      {
View Full Code Here

  }

  public InputStream getResourceAsStream(final ResourceManager caller) throws ResourceLoadingException
  {
    // again, this is going to hurt the performance.
    final ResourceKey parentKey = key.getParent();
    final ResourceData data = caller.load(parentKey);

    final ZipInputStream zin = new ZipInputStream(data.getResourceAsStream(caller));
    try
    {
View Full Code Here

  }

  public long getVersion(final ResourceManager caller)
          throws ResourceLoadingException
  {
    final ResourceKey parentKey = key.getParent();
    final ResourceData data = caller.load(parentKey);
    return data.getVersion(caller);
  }
View Full Code Here

    {
      throw new NullPointerException();
    }

    final StyleSheet parentStyle = getParentStyle();
    final ResourceKey source;
    final ResourceManager resourceManager;
    if (parentStyle == null)
    {
      source = null;
      resourceManager = null;
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.