Class LibraryRegistry
- java.lang.Object
-
- ca.cgjennings.apps.arkham.plugins.LibraryRegistry
-
public class LibraryRegistry extends java.lang.ObjectA 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 booleanisRegistered(java.lang.String libraryName)Returnstrueif 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, returningtrue.static voidregister(java.lang.String libraryName)Registers a script library for use by plug-ins.static voidregister(java.lang.String... libraryNames)Registers multiple libraries.
-
-
-
Method Detail
-
register
public static void register(java.lang.String libraryName) throws java.io.IOExceptionRegisters a script library for use by plug-ins.- Parameters:
libraryName- the library name (as passed touseLibrary)- 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.IOExceptionRegisters multiple libraries. The libraries are registered one at a time as ifregister(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)
Returnstrueif 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, returningtrue. Otherwise, returnsfalse.- Parameters:
libraryName- the name of the library to check- Returns:
trueif 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
-
-