public interface Assigner
A
to another type B
if possible.
An assigner is for example responsible for type casting, auto boxing or unboxing or for the widening of primitive types.
Modifier and Type | Interface and Description |
---|---|
static class |
Assigner.EqualTypesOnly
An assigner that only allows to assign types if they are equal to another.
|
static class |
Assigner.Refusing
An assigner that does not allow any assignments.
|
Modifier and Type | Field and Description |
---|---|
static Assigner |
DEFAULT
A default assigner that can handle
void , primitive types and references. |
static boolean |
DYNAMICALLY_TYPED
Indicates to an
Assigner that a value should be casted at runtime. |
static boolean |
STATICALLY_TYPED
Indicates to an
Assigner that a value should be typed statically. |
Modifier and Type | Method and Description |
---|---|
StackManipulation |
assign(TypeDescription sourceType,
TypeDescription targetType,
boolean dynamicallyTyped) |
static final Assigner DEFAULT
void
, primitive types and references.static final boolean STATICALLY_TYPED
Assigner
that a value should be typed statically.static final boolean DYNAMICALLY_TYPED
Assigner
that a value should be casted at runtime.StackManipulation assign(TypeDescription sourceType, TypeDescription targetType, boolean dynamicallyTyped)
sourceType
- The original type that is to be transformed into the targetType
.targetType
- The target type into which the sourceType
is to be converted.dynamicallyTyped
- 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.sourceType
into the targetType
if this
is possible. An illegal stack manipulation otherwise.Copyright © 2014–2015. All rights reserved.