Package org.pentaho.reporting.libraries.resourceloader

Examples of org.pentaho.reporting.libraries.resourceloader.ResourceKeyData


   *                                      deserialization of the <code>ResourceKey</code>
   */
  public ResourceKey deserialize(final ResourceKey bundleKey,
                                 final String stringKey) throws ResourceKeyCreationException
  {
    final ResourceKeyData resourceKeyData = ResourceKeyUtils.parse(stringKey);

    // Validate the data
    if (INNER_SCHEMA.equals(resourceKeyData.getSchema()) == false)
    {
      throw new ResourceKeyCreationException("Serialized version of key does not contain correct schema");
    }

    return new ResourceKey(bundleKey, resourceKeyData.getSchema(),
        resourceKeyData.getIdentifier(), resourceKeyData.getFactoryParameters());
  }
View Full Code Here


        resourceKeyData.getIdentifier(), resourceKeyData.getFactoryParameters());
  }

  public boolean isSupportedDeserializer(final String data) throws ResourceKeyCreationException
  {
    final ResourceKeyData resourceKeyData = ResourceKeyUtils.parse(data);

    // Validate the data
    return (INNER_SCHEMA.equals(resourceKeyData.getSchema()));
  }
View Full Code Here

  }

  public ResourceKey deserialize(final ResourceKey bundleKey, final String stringKey) throws ResourceKeyCreationException
  {
    // Parse the data
    final ResourceKeyData keyData = ResourceKeyUtils.parse(stringKey);

    // Validate the data
    if (SCHEMA_NAME.equals(keyData.getSchema()) == false)
    {
      throw new ResourceKeyCreationException("Serialized version of key does not contain correct schema");
    }

    // Create a new file based on the path provided
    final File file = new File(keyData.getIdentifier());
    return new ResourceKey(SCHEMA_NAME, file, keyData.getFactoryParameters());
  }
View Full Code Here

   * Parses the input string and returns a newly created ResourceKey based on the string data
   */
  public ResourceKey deserialize(final ResourceKey bundleKey, String stringKey) throws ResourceKeyCreationException
  {
    // Parse the data
    final ResourceKeyData keyData = ResourceKeyUtils.parse(stringKey);

    // Validate the data
    if (SCHEMA_NAME.equals(keyData.getSchema()) == false)
    {
      throw new ResourceKeyCreationException("Serialized version of key does not contain correct schema");
    }

    final String identifier = keyData.getIdentifier();
    final char[] chars = identifier.toCharArray();
    final byte[] data = new byte[chars.length];
    for (int i = 0; i < chars.length; i++)
    {
      data[i] = (byte) chars[i];
    }
    return createKey(data, keyData.getFactoryParameters());
  }
View Full Code Here

   * Parses the input string and returns a newly created ResourceKey based on the string data
   */
  public ResourceKey deserialize(final ResourceKey bundleKey, String stringKey) throws ResourceKeyCreationException
  {
    // Parse the data
    final ResourceKeyData keyData = ResourceKeyUtils.parse(stringKey);

    // Validate the data
    if (SCHEMA_NAME.equals(keyData.getSchema()) == false)
    {
      throw new ResourceKeyCreationException("Serialized version of key does not contain correct schema");
    }

    // Create and return a new key
    return createKey(keyData.getIdentifier(), keyData.getFactoryParameters());
  }
View Full Code Here

   * Parses the input string and returns a newly created ResourceKey based on the string data
   */
  public ResourceKey deserialize(final ResourceKey bundleKey, String stringKey) throws ResourceKeyCreationException
  {
    // Parse the data
    ResourceKeyData keyData = ResourceKeyUtils.parse(stringKey);

    // Validate the data
    if (SCHEMA_NAME.equals(keyData.getSchema()) == false)
    {
      throw new ResourceKeyCreationException("Serialized version of key does not contain correct schema");
    }

    // Create and return a new key
    try
    {
      return createKey(new URL(keyData.getIdentifier()), keyData.getFactoryParameters());
    }
    catch (MalformedURLException mfue)
    {
      throw new ResourceKeyCreationException("Malformed value: " + keyData.getIdentifier());
    }
  }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.libraries.resourceloader.ResourceKeyData

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.