Class VoidAwareAssigner
java.lang.Object
net.bytebuddy.implementation.bytecode.assign.primitive.VoidAwareAssigner
- All Implemented Interfaces:
Assigner
This assigner is able to handle the
void type. This means:
- If a
voidtype is assigned to thevoidit will consider this a trivial operation. - If a
voidtype is assigned to a non-voidtype, it will pop the top value from the stack. - If a non-
voidtype is assigned to avoidtype, it will load the target type's default value only if this was configured at the assigner's construction. - If two non-
voidtypes are subject of the assignment, it will delegate the assignment to its chained assigner.
-
Nested Class Summary
Nested classes/interfaces inherited from interface Assigner
Assigner.EqualTypesOnly, Assigner.Refusing, Assigner.Typing -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AssignerAn assigner that is capable of handling assignments that do not involvevoidtypes.Fields inherited from interface Assigner
DEFAULT, GENERICS_AWARE -
Constructor Summary
ConstructorsConstructorDescriptionVoidAwareAssigner(Assigner chained) Creates a new assigner that is capable of handling void types. -
Method Summary
Modifier and TypeMethodDescriptionassign(TypeDescription.Generic source, TypeDescription.Generic target, Assigner.Typing typing)
-
Field Details
-
chained
An assigner that is capable of handling assignments that do not involvevoidtypes.
-
-
Constructor Details
-
VoidAwareAssigner
Creates a new assigner that is capable of handling void types.- Parameters:
chained- A chained assigner which will be queried by this assigner to handle assignments that do not involve avoidtype.
-
-
Method Details
-
assign
public StackManipulation assign(TypeDescription.Generic source, TypeDescription.Generic target, Assigner.Typing typing) - Specified by:
assignin interfaceAssigner- Parameters:
source- The original type that is to be transformed into thetargetType.target- The target type into which thesourceTypeis to be converted.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 thatvoidto non-voidassignments are permitted.- Returns:
- A stack manipulation that transforms the
sourceTypeinto thetargetTypeif this is possible. An illegal stack manipulation otherwise.
-