Top Description Fields Constructors Methods
org.easymock.bytebuddy.implementation.bytecode.assign.primitive

public Class VoidAwareAssigner

extends Object
implements Assigner
Class Inheritance
All Implemented Interfaces
org.easymock.bytebuddy.implementation.bytecode.assign.Assigner
Annotations
@Enhance
Imports
org.easymock.bytebuddy.build.HashCodeAndEqualsPlugin, org.easymock.bytebuddy.description.type.TypeDescription, org.easymock.bytebuddy.implementation.bytecode.Removal, .StackManipulation, org.easymock.bytebuddy.implementation.bytecode.assign.Assigner, org.easymock.bytebuddy.implementation.bytecode.constant.DefaultValue

This assigner is able to handle the void type. This means:
  1. If a void type is assigned to the void it will consider this a trivial operation.
  2. If a void type is assigned to a non-void type, it will pop the top value from the stack.
  3. If a non-void type is assigned to a void type, it will load the target type's default value only if this was configured at the assigner's construction.
  4. If two non-void types are subject of the assignment, it will delegate the assignment to its chained assigner.

Field Summary

Modifier and TypeField and Description
private final Assigner
chained

An assigner that is capable of handling assignments that do not involve void types.

Constructor Summary

AccessConstructor and Description
public
VoidAwareAssigner(Assigner
A chained assigner which will be queried by this assigner to handle assignments that do not involve a void type.
chained
)

Creates a new assigner that is capable of handling void types.

Method Summary

Modifier and TypeMethod and Description
public StackManipulation
assign(TypeDescription.Generic
The original type that is to be transformed into the targetType.
source
,
TypeDescription.Generic
The target type into which the sourceType is to be converted.
target
,
Assigner.Typing
A hint whether the assignment should consider the runtime type of the source type, i.e. if type down or cross castings are allowed. If this hint is set, this is also an indication that void to non-void assignments are permitted.
typing
)

Implements org.easymock.bytebuddy.implementation.bytecode.assign.Assigner.assign.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

chainedback to summary
private final Assigner chained

An assigner that is capable of handling assignments that do not involve void types.

Constructor Detail

VoidAwareAssignerback to summary
public VoidAwareAssigner(Assigner chained)

Creates a new assigner that is capable of handling void types.

Parameters
chained:Assigner

A chained assigner which will be queried by this assigner to handle assignments that do not involve a void type.

Method Detail

assignback to summary
public StackManipulation assign(TypeDescription.Generic source, TypeDescription.Generic target, Assigner.Typing typing)

Implements org.easymock.bytebuddy.implementation.bytecode.assign.Assigner.assign.

Parameters
source:TypeDescription.Generic

Doc from org.easymock.bytebuddy.implementation.bytecode.assign.Assigner.assign.

The original type that is to be transformed into the targetType.

target:TypeDescription.Generic

Doc from org.easymock.bytebuddy.implementation.bytecode.assign.Assigner.assign.

The target type into which the sourceType is to be converted.

typing:Assigner.Typing

Doc from org.easymock.bytebuddy.implementation.bytecode.assign.Assigner.assign.

A hint whether the assignment should consider the runtime type of the source type, i.e. if type down or cross castings are allowed. If this hint is set, this is also an indication that void to non-void assignments are permitted.

Returns:StackManipulation

Doc from org.easymock.bytebuddy.implementation.bytecode.assign.Assigner.assign.

A stack manipulation that transforms the sourceType into the targetType if this is possible. An illegal stack manipulation otherwise.