Class Configurator

java.lang.Object
org.apache.groovy.contracts.generation.Configurator

public final class Configurator extends Object

Handles -ea and -da runtime input arguments for enabling and disabling contract elements.

  • Field Details

    • DISABLED_ASSERTIONS

      public static final String DISABLED_ASSERTIONS
      JVM argument prefix that disables assertions.
      See Also:
    • ENABLED_ASSERTIONS

      public static final String ENABLED_ASSERTIONS
      JVM argument prefix that enables assertions.
      See Also:
    • PACKAGE_PREFIX

      public static final String PACKAGE_PREFIX
      Separator between assertion flags and package or class names.
      See Also:
    • ENABLE_PACKAGE_ASSERTIONS

      public static final String ENABLE_PACKAGE_ASSERTIONS
      JVM argument prefix that enables assertions for a package or class.
      See Also:
    • DISABLE_PACKAGE_ASSERTIONS

      public static final String DISABLE_PACKAGE_ASSERTIONS
      JVM argument prefix that disables assertions for a package or class.
      See Also:
    • PACKAGE_POSTFIX

      public static final String PACKAGE_POSTFIX
      Suffix used by the JVM to denote package-wide assertion configuration.
      See Also:
  • Constructor Details

    • Configurator

      public Configurator()
  • Method Details

    • checkAssertionsEnabled

      public static boolean checkAssertionsEnabled(String className)
      This static method is used within generated code to check whether assertions have been disabled for the current class or not.
      Parameters:
      className - the class name to look up in the assertion configuration
      Returns:
      whether assertion checking is enabled or not