Package org.codehaus.groovy.classgen.asm

# Class UnaryExpressionHelper

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

Direct Known Subclasses:
  `StaticTypesUnaryExpressionHelper`

public class UnaryExpressionHelper extends Object
A helper class used to generate bytecode for unary expressions. AST transformations willing to use a custom unary expression helper may set the `WriterControllerFactory` node metadata on a class node to provide a custom `WriterController` which would in turn use a custom expression helper.

See Also:
  - `BinaryExpressionHelper`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final WriterController`
  `controller`
  The controller coordinating all bytecode writers for the current class.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `UnaryExpressionHelper(WriterController controller)`
  Creates an unary expression helper with the given controller.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `writeBitwiseNegate(BitwiseNegationExpression expression)`
  Generates bytecode for a bitwise negation expression.
  `void`
  `writeNotExpression(NotExpression expression)`
  Generates bytecode for a logical not expression.
  `void`
  `writeUnaryMinus(UnaryMinusExpression expression)`
  Generates bytecode for a unary minus expression.
  `void`
  `writeUnaryPlus(UnaryPlusExpression expression)`
  Generates bytecode for a unary plus expression.

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

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

- ## Field Details

  - ### controller

    protected final WriterController controller
    The controller coordinating all bytecode writers for the current class.

- ## Constructor Details

  - ### UnaryExpressionHelper

    public UnaryExpressionHelper(WriterController controller)
    Creates an unary expression helper with the given controller.
    Parameters:
      `controller` - the writer controller

- ## Method Details

  - ### writeUnaryPlus

    public void writeUnaryPlus(UnaryPlusExpression expression)
    Generates bytecode for a unary plus expression.
    Parameters:
      `expression` - the unary plus expression

  - ### writeUnaryMinus

    public void writeUnaryMinus(UnaryMinusExpression expression)
    Generates bytecode for a unary minus expression.
    Parameters:
      `expression` - the unary minus expression

  - ### writeBitwiseNegate

    public void writeBitwiseNegate(BitwiseNegationExpression expression)
    Generates bytecode for a bitwise negation expression.
    Parameters:
      `expression` - the bitwise negation expression

  - ### writeNotExpression

    public void writeNotExpression(NotExpression expression)
    Generates bytecode for a logical not expression.
    Parameters:
      `expression` - the not expression