Package org.codehaus.groovy.classgen.asm

# Class AssertionWriter

java.lang.Object
org.codehaus.groovy.classgen.asm.AssertionWriter

public class AssertionWriter extends Object
Emits bytecode for Groovy `assert` statements.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AssertionWriter(WriterController wc)`
  Creates an assertion writer for the supplied controller.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `disableTracker()`
  Temporarily disables power-assert value tracking.
  `void`
  `record(Expression expression)`
  Records the current stack value for the supplied expression position.
  `void`
  `record(Token token)`
  Records the current stack value for the supplied token position.
  `void`
  `reenableTracker()`
  Restores power-assert value tracking after a previous disable.
  `void`
  `writeAssertStatement(AssertStatement statement)`
  Emits bytecode for an `assert` statement.

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

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

- ## Constructor Details

  - ### AssertionWriter

    public AssertionWriter(WriterController wc)
    Creates an assertion writer for the supplied controller.
    Parameters:
      `wc` - the active writer controller

- ## Method Details

  - ### writeAssertStatement

    public void writeAssertStatement(AssertStatement statement)
    Emits bytecode for an `assert` statement.
    Parameters:
      `statement` - the assertion statement

  - ### disableTracker

    public void disableTracker()
    Temporarily disables power-assert value tracking.

  - ### reenableTracker

    public void reenableTracker()
    Restores power-assert value tracking after a previous disable.

  - ### record

    public void record(Token token)
    Records the current stack value for the supplied token position.
    Parameters:
      `token` - the token whose source position should be recorded

  - ### record

    public void record(Expression expression)
    Records the current stack value for the supplied expression position.
    Parameters:
      `expression` - the expression whose source position should be recorded