Class Configurator
java.lang.Object
org.apache.groovy.contracts.generation.Configurator
Handles -ea and -da runtime input arguments for enabling and
disabling contract elements.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringJVM argument prefix that disables assertions for a package or class.static final StringJVM argument prefix that disables assertions.static final StringJVM argument prefix that enables assertions for a package or class.static final StringJVM argument prefix that enables assertions.static final StringSuffix used by the JVM to denote package-wide assertion configuration.static final StringSeparator between assertion flags and package or class names. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancheckAssertionsEnabled(String className) This static method is used within generated code to check whether assertions have been disabled for the current class or not.
-
Field Details
-
DISABLED_ASSERTIONS
JVM argument prefix that disables assertions.- See Also:
-
ENABLED_ASSERTIONS
JVM argument prefix that enables assertions.- See Also:
-
PACKAGE_PREFIX
Separator between assertion flags and package or class names.- See Also:
-
ENABLE_PACKAGE_ASSERTIONS
JVM argument prefix that enables assertions for a package or class.- See Also:
-
DISABLE_PACKAGE_ASSERTIONS
JVM argument prefix that disables assertions for a package or class.- See Also:
-
PACKAGE_POSTFIX
Suffix used by the JVM to denote package-wide assertion configuration.- See Also:
-
-
Constructor Details
-
Configurator
public Configurator()
-
-
Method Details
-
checkAssertionsEnabled
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
-