Class StringScriptResource

    • Constructor Summary

      Constructors 
      Constructor Description
      StringScriptResource​(java.lang.String source, java.lang.String name)
      Creates a simple script resource based on a string.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getName()
      Gets the name (path) of the resource
      java.io.Reader getReader()
      Opens a reader to this resource
      long getSize()
      Returns the size of this resource
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StringScriptResource

        public StringScriptResource​(@Nonnull
                                    java.lang.String source,
                                    @Nonnull
                                    java.lang.String name)
        Creates a simple script resource based on a string.
        Parameters:
        source - The source code
        name - the name of this source
    • Method Detail

      • getName

        public java.lang.String getName()
        Gets the name (path) of the resource
        Specified by:
        getName in interface ScriptResource
        Returns:
        the name
      • getReader

        public java.io.Reader getReader()
                                 throws java.io.IOException
        Opens a reader to this resource
        Specified by:
        getReader in interface ScriptResource
        Returns:
        an open reader
        Throws:
        java.io.IOException - if an error occurs
      • getSize

        public long getSize()
        Returns the size of this resource
        Specified by:
        getSize in interface ScriptResource
        Returns:
        the size or -1 if not known