Package jadex.commons

Class LazyResource


  • public class LazyResource
    extends java.lang.Object
    Representation of data loaded on first access. Used, e.g., for component type icons.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.Class<?> clazz
      The reference class for using correct package and class loader.
      protected byte[] data
      The resource, if already loaded.
      protected java.io.IOException exception
      The exception, if already failed.
      protected java.lang.String path
      The resource path (relative to clazz or absolute).
    • Constructor Summary

      Constructors 
      Constructor Description
      LazyResource​(java.lang.Class<?> clazz, java.lang.String path)
      Create a lazy resource.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      byte[] getData()
      Get the resource contents.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • clazz

        protected java.lang.Class<?> clazz
        The reference class for using correct package and class loader.
      • path

        protected java.lang.String path
        The resource path (relative to clazz or absolute).
      • data

        protected byte[] data
        The resource, if already loaded.
      • exception

        protected java.io.IOException exception
        The exception, if already failed.
    • Constructor Detail

      • LazyResource

        public LazyResource​(java.lang.Class<?> clazz,
                            java.lang.String path)
        Create a lazy resource.
    • Method Detail

      • getData

        public byte[] getData()
                       throws java.io.IOException
        Get the resource contents.
        Throws:
        java.io.IOException