Interface PhonScript

All Superinterfaces:
Appendable, CharSequence, IExtendable
All Known Implementing Classes:
BasicScript, LazyQueryScript, QueryScript

public interface PhonScript extends IExtendable, Appendable, CharSequence

Interface for Phon runtime scripts. Scripts are written in ECMAScript and use the Rhino engine directly (instead of using the JSR.)

Phon scripts may also have parameters defined which can be setup using either a comment at the beginning of the file or by implementing the setup_params function in the script.

  • Method Details

    • getScript

      String getScript()
      Get the script text.
      Returns:
      script
    • resetContext

      PhonScriptContext resetContext()
      Reset context
    • getContext

      PhonScriptContext getContext()
      Get a script context for this script. The context is used to compile and evaulate the script.
      Returns:
      the script context
    • getPackageImports

      List<String> getPackageImports()
      Get required packages that should be imported when the scope is created. These packages will also be available to any script imported using the require() function.
      Returns:
      the list of packages that should be available to this script and any dependencies
    • addPackageImport

      boolean addPackageImport(String pkgImport)
    • removePackageImport

      boolean removePackageImport(String pkgImport)
    • getClassImports

      List<String> getClassImports()
      Get a list of classes that should be imported when the scope is created. These classes will also be availble to any script imported using the require() function.
      Returns:
      the list of classes that should be availble to this script and any dependencies
    • addClassImport

      boolean addClassImport(String classImport)
    • removeClassImport

      boolean removeClassImport(String classImport)
    • getRequirePaths

      List<URI> getRequirePaths()
      Get the list of URLs that should be available for script loading using the require function.
      Returns:
      list of javascript library folders
    • addRequirePath

      boolean addRequirePath(URI uri)
    • removeRequirePath

      boolean removeRequirePath(URI uri)
    • append

      PhonScript append(boolean arg0)
    • append

      PhonScript append(char c)
      Specified by:
      append in interface Appendable
    • append

      PhonScript append(char[] str, int offset, int len)
    • append

      PhonScript append(char[] str)
    • append

      PhonScript append(CharSequence s, int start, int end)
      Specified by:
      append in interface Appendable
    • append

      Specified by:
      append in interface Appendable
    • append

      PhonScript append(double d)
    • append

      PhonScript append(float f)
    • append

      PhonScript append(int i)
    • append

      PhonScript append(long lng)
    • append

      PhonScript append(Object obj)
    • append

      PhonScript append(String str)
    • append

    • appendCodePoint

      PhonScript appendCodePoint(int codePoint)
    • capacity

      int capacity()
    • charAt

      char charAt(int index)
      Specified by:
      charAt in interface CharSequence
    • codePointAt

      int codePointAt(int index)
    • codePointBefore

      int codePointBefore(int index)
    • codePointCount

      int codePointCount(int beginIndex, int endIndex)
    • delete

      PhonScript delete(int start, int end)
    • deleteCharAt

      PhonScript deleteCharAt(int index)
    • ensureCapacity

      void ensureCapacity(int minimumCapacity)
    • getChars

      void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)
    • indexOf

      int indexOf(String str, int fromIndex)
    • indexOf

      int indexOf(String str)
    • insert

      PhonScript insert(int offset, boolean b)
    • insert

      PhonScript insert(int offset, char c)
    • insert

      PhonScript insert(int index, char[] str, int offset, int len)
    • insert

      PhonScript insert(int offset, char[] str)
    • insert

      PhonScript insert(int dstOffset, CharSequence s, int start, int end)
    • insert

      PhonScript insert(int dstOffset, CharSequence s)
    • insert

      PhonScript insert(int offset, double d)
    • insert

      PhonScript insert(int offset, float f)
    • insert

      PhonScript insert(int offset, int i)
    • insert

      PhonScript insert(int offset, long l)
    • insert

      PhonScript insert(int offset, Object obj)
    • insert

      PhonScript insert(int offset, String str)
    • lastIndexOf

      int lastIndexOf(String str, int fromIndex)
    • lastIndexOf

      int lastIndexOf(String str)
    • length

      int length()
      Specified by:
      length in interface CharSequence
    • offsetByCodePoints

      int offsetByCodePoints(int index, int codePointOffset)
    • replace

      PhonScript replace(int start, int end, String str)
    • reverse

      PhonScript reverse()
    • setCharAt

      void setCharAt(int index, char ch)
    • setLength

      void setLength(int newLength)
    • subSequence

      CharSequence subSequence(int start, int end)
      Specified by:
      subSequence in interface CharSequence
    • substring

      String substring(int start, int end)
    • substring

      String substring(int start)
    • trimToSize

      void trimToSize()