Package org.jfree.resourceloader

Examples of org.jfree.resourceloader.ResourceKey


    }
  }

  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

    }
  }

  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

        if (docUrl != null)
        {
          return new StaticTextToken(String.valueOf(docUrl));
        }

        final ResourceKey baseKey =
            DocumentContextUtility.getBaseResource(process.getDocumentContext());
        final ResourceManager resourceManager =
            DocumentContextUtility.getResourceManager(process.getDocumentContext());
        final URL url = resourceManager.toURL(baseKey);
        if (url != null)
View Full Code Here

          if (docUrl != null)
          {
            return new StaticTextToken(String.valueOf(docUrl));
          }

          final ResourceKey baseKey =
              DocumentContextUtility.getBaseResource(process.getDocumentContext());
          final ResourceManager resourceManager =
              DocumentContextUtility.getResourceManager(process.getDocumentContext());
          final URL url = resourceManager.toURL(baseKey);
          if (url != null)
View Full Code Here

        if (docUrl != null)
        {
          return new StaticTextToken(String.valueOf(docUrl));
        }

        final ResourceKey baseKey =
            DocumentContextUtility.getBaseResource(process.getDocumentContext());
        final ResourceManager resourceManager =
            DocumentContextUtility.getResourceManager(process.getDocumentContext());
        final URL url = resourceManager.toURL(baseKey);
        if (url != null)
View Full Code Here

    this.officeStylesCollection = parseStylesXml();
  }

  private OfficeStylesCollection parseStylesXml ()
  {
    final ResourceKey contextKey = getRootHandler().getContext();
    final ResourceManager resourceManager = getRootHandler().getResourceManager();

    try
    {
      final ResourceKey key =
          resourceManager.deriveKey(contextKey, "styles.xml");
      final Resource resource =
          resourceManager.create(key, contextKey, OfficeStylesCollection.class);
      final OfficeStylesCollection styles =
          (OfficeStylesCollection) resource.getResource();
View Full Code Here

    {
      return new OfficeDocument();
    }

    // we may have to parse an existing content.xml.
    final ResourceKey contextKey = getRootHandler().getContext();
    final ResourceManager resourceManager = getRootHandler().getResourceManager();
    try
    {
      final ResourceKey key =
          resourceManager.deriveKey(contextKey, "content.xml");
      final Resource resource =
          resourceManager.create(key, contextKey, JFreeReport.class);
      final OfficeDocument report = (OfficeDocument) resource.getResource();
      if (report != null)
View Full Code Here

      final XMLReader reader = parser.getXMLReader();
      final XmlFactoryModule[] rootHandlers = getModules();
      final ResourceDataInputSource input = new ResourceDataInputSource(data, manager);

      final ResourceKey contextKey;
      final long version;
      final ResourceKey targetKey = data.getKey();
      if (context == null)
      {
        contextKey = targetKey;
        version = data.getVersion(manager);
      }
      else
      {
        contextKey = context;
        version = -1;
      }

      final MultiplexRootElementHandler handler =
          new MultiplexRootElementHandler(manager, targetKey,
              contextKey, version, rootHandlers);

      final DefaultConfiguration parserConfiguration = handler.getParserConfiguration();
      final URL value = manager.toURL(contextKey);
      if (value != null)
      {
        parserConfiguration.setConfigProperty(CONTENTBASE_KEY, value.toExternalForm());
      }

      configureReader(reader, handler);
      reader.setContentHandler(handler);
      reader.setDTDHandler(handler);
      reader.setEntityResolver(handler.getEntityResolver());
      reader.setErrorHandler(getErrorHandler());

      final Map parameters = targetKey.getFactoryParameters();
      final Iterator it = parameters.keySet().iterator();
      while (it.hasNext())
      {
        final Object o = it.next();
        if (o instanceof FactoryParameterKey)
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.