Most programmers will not need to use the following methods. They are provided for those writing interpreters or other execution environments.
See also: Design FAQ
Each class loader maintains a default assertion status, a boolean value that determines whether assertions are, by default, enabled or disabled in new classes that are subsequently initialized by the class loader. A newly created class loader's default assertion status is false (disabled). It can be changed at any time by invoking a new method in class ClassLoader:
If, at the time that a class is loaded, its class loader has been given specific instructions regarding the assertion status of the class's package name or its class name (via either of the two new methods in ClassLoader described below), those instructions take precedence over the class loader's default assertion status. Otherwise, the class's assertions are enabled or disabled as specified by its class loader's default assertion status.
The following method allows the invoker to set a per-package default assertion status. Note that a per-package default actually applies to a package and any subpackages.
The following method is used to set assertion status on a per-class basis:
The following method clears any assertion status settings associated with a class loader: