Package ghidra.app.script

# Class ScriptInfo

java.lang.Object
ghidra.app.script.ScriptInfo

public class ScriptInfo extends Object
This class parses the meta-data about a script.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `DELIMITTER`
  The delimiter used in categories and menu paths.
  `static final String[]`
  `METADATA`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getAuthor()`
  Returns the script author information.
  `String[]`
  `getCategory()`
  Returns the script category path.
  `String`
  `getDescription()`
  Returns the script description.
  `String`
  `getErrorMessage()`
  `String`
  `getImportPackage()`
  Returns the script imports
  `KeyStroke`
  `getKeyBinding()`
  Returns the script key binding.
  `String`
  `getKeyBindingErrorMessage()`
  `String[]`
  `getMenuPath()`
  Returns the script menu path.
  `String`
  `getMenuPathAsString()`
  Returns the script menu path as a string.
  `String`
  `getName()`
  Returns the name of the script.
  `ResourceFile`
  `getSourceFile()`
  Returns the script source file.
  `Icon`
  `getToolBarImage(boolean scaled)`
  Returns the script tool bar icon.
  `String`
  `getToolTipText()`
  Returns a string designed to be used as a tool tip for describing this script
  `boolean`
  `hasErrors()`
  `boolean`
  `isCategory(String[] otherCategory)`
  Returns true if 'cat' is a category.
  `boolean`
  `isCompileErrors()`
  Returns true if the script has compile errors.
  `boolean`
  `isDuplicate()`
  Returns true if this script is a duplicate.
  `void`
  `refresh()`
  Setting the toolbar image to null forces it to be reloaded on the next request.
  `void`
  `setCompileErrors(boolean b)`
  Sets whether the script has compile errors.
  `void`
  `setDuplicate(boolean isDuplicate)`
  Sets whether the script is a duplicate.
  `String`
  `toString()`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### DELIMITTER

    public static final String DELIMITTER
    The delimiter used in categories and menu paths.
    See Also:
      - Constant Field Values

  - ### METADATA

    public static final String[] METADATA

- ## Method Details

  - ### refresh

    public void refresh()
    Setting the toolbar image to null forces it to be reloaded on the next request.

  - ### getName

    public String getName()
    Returns the name of the script. The name of the script is the file name.
    Returns:
      the name of the script

  - ### getSourceFile

    public ResourceFile getSourceFile()
    Returns the script source file.
    Returns:
      the script source file

  - ### getAuthor

    public String getAuthor()
    Returns the script author information.
    Returns:
      the script author information.

  - ### isCompileErrors

    public boolean isCompileErrors()
    Returns true if the script has compile errors.
    Returns:
      true if the script has compile errors

  - ### setCompileErrors

    public void setCompileErrors(boolean b)
    Sets whether the script has compile errors.
    Parameters:
      `b` - true if the script has compile errors

  - ### isDuplicate

    public boolean isDuplicate()
    Returns true if this script is a duplicate. When two or more scripts exists with the same name, this is considered a duplicate script.
    Returns:
      true if this script is a duplicate

  - ### setDuplicate

    public void setDuplicate(boolean isDuplicate)
    Sets whether the script is a duplicate.
    Parameters:
      `isDuplicate` - true if the script is a duplicate

  - ### getDescription

    public String getDescription()
    Returns the script description.
    Returns:
      the script description

  - ### isCategory

    public boolean isCategory(String[] otherCategory)
    Returns true if 'cat' is a category.
    Parameters:
      `otherCategory` - the script category
    Returns:
      true if 'cat' is a category

  - ### getCategory

    public String[] getCategory()
    Returns the script category path.
    Returns:
      the script category path

  - ### getMenuPath

    public String[] getMenuPath()
    Returns the script menu path.
    Returns:
      the script menu path

  - ### getMenuPathAsString

    public String getMenuPathAsString()
    Returns the script menu path as a string. For example,"Path1->Path2->Path3".
    Returns:
      the script menu path as a string

  - ### getKeyBinding

    public KeyStroke getKeyBinding()
    Returns the script key binding.
    Returns:
      the script key binding

  - ### getKeyBindingErrorMessage

    public String getKeyBindingErrorMessage()
    Returns:
      an error resulting from parsing keybinding metadata

  - ### getToolBarImage

    public Icon getToolBarImage(boolean scaled)
    Returns the script tool bar icon.
    Parameters:
      `scaled` - true if the icon should be scaled to 16x16.
    Returns:
      the script tool bar icon

  - ### getImportPackage

    public String getImportPackage()
    Returns the script imports
    Returns:
      the script imports

  - ### getToolTipText

    public String getToolTipText()
    Returns a string designed to be used as a tool tip for describing this script
    Returns:
      a string designed to be used as a tool tip

  - ### hasErrors

    public boolean hasErrors()
    Returns:
      true if the script either has compiler errors, or is a duplicate

  - ### getErrorMessage

    public String getErrorMessage()
    Returns:
      a generic error message

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`