Class ScriptType


  • public class ScriptType
    extends java.lang.Object
    A type of script supported by ZAP, which allows to customise and extend ZAP's functionalities through its scripts.
    Since:
    2.2.0
    See Also:
    ScriptWrapper
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String CAPABILITY_APPEND
      Script types with this capability can sensibly have requests appended to them.
    • Constructor Summary

      Constructors 
      Constructor Description
      ScriptType​(java.lang.String name, java.lang.String i18nKey, javax.swing.ImageIcon icon, boolean isEnableable)
      Constructs a ScriptType with the given data.
      ScriptType​(java.lang.String name, java.lang.String i18nKey, javax.swing.ImageIcon icon, boolean enableable, boolean enabledByDefault)
      Constructs a ScriptType with the given data.
      ScriptType​(java.lang.String name, java.lang.String i18nKey, javax.swing.ImageIcon icon, boolean enableable, boolean enabledByDefault, java.lang.String[] capabilities)
      Constructs a ScriptType with the given data.
      ScriptType​(java.lang.String name, java.lang.String i18nKey, javax.swing.ImageIcon icon, boolean isEnableable, java.lang.String[] capabilities)
      Constructs a ScriptType with the given data.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addCapability​(java.lang.String capability)
      Adds the given capability to this script type.
      java.lang.String getI18nKey()  
      javax.swing.ImageIcon getIcon()  
      java.lang.String getName()  
      boolean hasCapability​(java.lang.String capability)
      Tells whether or not this script type has the given capability.
      boolean isEnableable()
      Tells whether or not the scripts of this script type can be enabled/disabled.
      boolean isEnabledByDefault()
      Tells whether or not the scripts of this script type should be enabled by default.
      • Methods inherited from class java.lang.Object

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

      • CAPABILITY_APPEND

        public static final java.lang.String CAPABILITY_APPEND
        Script types with this capability can sensibly have requests appended to them. Typically this will just apply to Zest scripts.
        Since:
        2.4.0
        See Also:
        Constant Field Values
    • Constructor Detail

      • ScriptType

        public ScriptType​(java.lang.String name,
                          java.lang.String i18nKey,
                          javax.swing.ImageIcon icon,
                          boolean isEnableable)
        Constructs a ScriptType with the given data.
        Parameters:
        name - the (internal) name of the script type.
        i18nKey - the resource key for the internationalised name.
        icon - the icon of the script type.
        isEnableable - true if the scripts of the script type can be enabled, false otherwise.
        See Also:
        ScriptType(String, String, ImageIcon, boolean, boolean)
      • ScriptType

        public ScriptType​(java.lang.String name,
                          java.lang.String i18nKey,
                          javax.swing.ImageIcon icon,
                          boolean enableable,
                          boolean enabledByDefault)
        Constructs a ScriptType with the given data.
        Parameters:
        name - the (internal) name of the script type.
        i18nKey - the resource key for the internationalised name.
        icon - the icon of the script type.
        enableable - true if the scripts of the script type can be enabled, false otherwise.
        enabledByDefault - true if the scripts of the script type should be enabled by default, false otherwise. Ignored if enableable is false.
        Since:
        2.6.0
      • ScriptType

        public ScriptType​(java.lang.String name,
                          java.lang.String i18nKey,
                          javax.swing.ImageIcon icon,
                          boolean isEnableable,
                          java.lang.String[] capabilities)
        Constructs a ScriptType with the given data.
        Parameters:
        name - the (internal) name of the script type.
        i18nKey - the resource key for the internationalised name.
        icon - the icon of the script type.
        isEnableable - true if the scripts of the script type can be enabled, false otherwise.
        capabilities - the capabilities of the scripts of the script type.
        Since:
        2.4.0
        See Also:
        ScriptType(String, String, ImageIcon, boolean, boolean, String[])
      • ScriptType

        public ScriptType​(java.lang.String name,
                          java.lang.String i18nKey,
                          javax.swing.ImageIcon icon,
                          boolean enableable,
                          boolean enabledByDefault,
                          java.lang.String[] capabilities)
        Constructs a ScriptType with the given data.
        Parameters:
        name - the (internal) name of the script type.
        i18nKey - the resource key for the internationalised name.
        icon - the icon of the script type.
        enableable - true if the scripts of the script type can be enabled, false otherwise.
        enabledByDefault - true if the scripts should be enabled by default, false otherwise. Ignored if enableable is false.
        capabilities - the capabilities of the scripts of the script type.
        Since:
        2.6.0
    • Method Detail

      • getName

        public java.lang.String getName()
      • getI18nKey

        public java.lang.String getI18nKey()
      • getIcon

        public javax.swing.ImageIcon getIcon()
      • isEnableable

        public boolean isEnableable()
        Tells whether or not the scripts of this script type can be enabled/disabled.
        Returns:
        true if the scripts can be enabled/disabled, false otherwise.
        See Also:
        isEnabledByDefault()
      • isEnabledByDefault

        public boolean isEnabledByDefault()
        Tells whether or not the scripts of this script type should be enabled by default.

        Only meaningful if the script type is enableable.

        Returns:
        true if the scripts should be enabled by default, false otherwise.
        Since:
        2.6.0
      • addCapability

        public void addCapability​(java.lang.String capability)
        Adds the given capability to this script type.
        Parameters:
        capability - the new capability of the script type.
        Since:
        2.4.0
        See Also:
        hasCapability(String)