Class StringScriptResource

java.lang.Object
com.adobe.granite.ui.clientlibs.script.StringScriptResource
All Implemented Interfaces:
ScriptResource

public class StringScriptResource extends Object implements ScriptResource
Simple ScriptResource based on strings.
  • Constructor Details

    • StringScriptResource

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

    • getName

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

      public Reader getReader() throws IOException
      Opens a reader to this resource
      Specified by:
      getReader in interface ScriptResource
      Returns:
      an open reader
      Throws:
      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