Class LibraryRegistry


  • public class LibraryRegistry
    extends java.lang.Object
    A registry of available scripting libraries. Plug-ins can register script libraries for use by other plug-ins. Although it is always possible to access scripts from other loaded plug-ins whether they are registered or not, registering a library has some additional benefits. First, it clearly identifies that the code is intended for use by other parties. Second, it makes the library documentation available in the built-in API browser. And finally, registered libraries are pre-loaded into the debugger so that break points can be set in them even if they haven't been used by any scripts yet.
    Author:
    Chris Jennings
    See Also:
    libutils script library
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String[] getLibraries()
      Returns an array of all registered libraries.
      static java.lang.String[] getStandardLibraries()
      Returns an array of all of the standard, built-in libraries.
      static boolean isRegistered​(java.lang.String libraryName)
      Returns true if the specified library has been registered, If the library has not been registered, but it can be loaded successfully, then it will be registered immediately, returning true.
      static void register​(java.lang.String libraryName)
      Registers a script library for use by plug-ins.
      static void register​(java.lang.String... libraryNames)
      Registers multiple libraries.
      • Methods inherited from class java.lang.Object

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

      • register

        public static void register​(java.lang.String libraryName)
                             throws java.io.IOException
        Registers a script library for use by plug-ins.
        Parameters:
        libraryName - the library name (as passed to useLibrary)
        Throws:
        java.io.IOException - if an I/O occurs while reading the library
      • register

        public static void register​(java.lang.String... libraryNames)
                             throws java.io.IOException
        Registers multiple libraries. The libraries are registered one at a time as if register(java.lang.String) was called for each in turn.
        Parameters:
        libraryNames - the libraries to register
        Throws:
        java.io.IOException - if an I/O occurs while reading a library
      • isRegistered

        public static boolean isRegistered​(java.lang.String libraryName)
        Returns true if the specified library has been registered, If the library has not been registered, but it can be loaded successfully, then it will be registered immediately, returning true. Otherwise, returns false.
        Parameters:
        libraryName - the name of the library to check
        Returns:
        true if the library is registered
      • getLibraries

        public static java.lang.String[] getLibraries()
        Returns an array of all registered libraries.
        Returns:
        a possibly empty array of library names
      • getStandardLibraries

        public static java.lang.String[] getStandardLibraries()
        Returns an array of all of the standard, built-in libraries.
        Returns:
        a possibly empty array of library names