An assigner implementation that considers generic type assignability.
Important Note
This implementation does not currently support method variables and their type inference.
| Modifier and Type | Class and Description |
|---|---|
| protected static class | GenericTypeAwareAssigner.IsAssignableToVisitor
A visitor for generic types that determines assignability of such types. |
| Modifier and Type | Field and Description |
|---|---|
| public static final GenericTypeAwareAssigner | INSTANCE
The singleton instance. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public StackManipulation | assign(TypeDescription.
The original type that is to be transformed into the source,targetType.The target type into which the target,sourceType is to be converted.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 typingvoid to non-void assignments are permitted.Implements net. |
| public static GenericTypeAwareAssigner | |
| public static GenericTypeAwareAssigner[] |
| INSTANCE | back to summary |
|---|---|
| public static final GenericTypeAwareAssigner INSTANCE The singleton instance. | |
| GenericTypeAwareAssigner | back to summary |
|---|---|
| private GenericTypeAwareAssigner() | |
| assign | back to summary |
|---|---|
| public StackManipulation assign(TypeDescription. Implements net.
| |
| valueOf | back to summary |
|---|---|
| public static GenericTypeAwareAssigner valueOf(String name) | |
| values | back to summary |
|---|---|
| public static GenericTypeAwareAssigner[] values() | |
| Modifier and Type | Class and Description |
|---|---|
| protected static class | GenericTypeAwareAssigner.IsAssignableToVisitor.OfGenericArray
A visitor for determining assignability of a generic array type. |
| protected abstract static class | GenericTypeAwareAssigner.IsAssignableToVisitor.OfManifestType
An implementation of a assignability visitor that is applicable for any non-wildcard type. |
| protected static class | GenericTypeAwareAssigner.IsAssignableToVisitor.OfNonGenericType
A visitor for determining assignability of a non-generic type. |
| protected static class | GenericTypeAwareAssigner.IsAssignableToVisitor.OfParameterizedType
A visitor for determining the assignability of a parameterized type. |
| protected abstract static class | GenericTypeAwareAssigner.IsAssignableToVisitor.OfSimpleType
A visitor for determining assignability of a type in a type hierarchy, i.e. a non-generic or parameterized type. |
| protected static class | GenericTypeAwareAssigner.IsAssignableToVisitor.OfWildcard
A visitor to determine the assignability of a wildcard type. |
| Modifier and Type | Field and Description |
|---|---|
| private final boolean | polymorphic
|
| private final TypeDescription. | typeDescription
The type to which another type is being assigned. |
| Access | Constructor and Description |
|---|---|
| public | IsAssignableToVisitor(TypeDescription.
The type to which another type is being assigned. typeDescriptionCreates a new visitor to determine assignability of the supplied type. |
| protected | IsAssignableToVisitor(TypeDescription.
The type to which another type is being assigned. typeDescription,true if the assignment is polymorphic.Creates a new visitor to determine assignability of the supplied type. |
| polymorphic | back to summary |
|---|---|
| private final boolean polymorphic
| |
| typeDescription | back to summary |
|---|---|
| private final TypeDescription. The type to which another type is being assigned. | |
| IsAssignableToVisitor | back to summary |
|---|---|
| public IsAssignableToVisitor(TypeDescription. Creates a new visitor to determine assignability of the supplied type.
| |
| IsAssignableToVisitor | back to summary |
|---|---|
| protected IsAssignableToVisitor(TypeDescription. Creates a new visitor to determine assignability of the supplied type.
| |
| onGenericArray | back to summary |
|---|---|
| public Boolean onGenericArray(TypeDescription. Implements net. Doc from net. Visits a generic array type (
| |
| onNonGenericType | back to summary |
|---|---|
| public Boolean onNonGenericType(TypeDescription. Implements net. Doc from net. Visits a non-generic type (
| |
| onParameterizedType | back to summary |
|---|---|
| public Boolean onParameterizedType(TypeDescription. Implements net. Doc from net. Visits a parameterized type (
| |
| onTypeVariable | back to summary |
|---|---|
| public Boolean onTypeVariable(TypeDescription. Implements net. Doc from net. Visits a type variable (
| |
| onWildcard | back to summary |
|---|---|
| public Boolean onWildcard(TypeDescription. Implements net. Doc from net. Visits a wildcard (
| |
| Access | Constructor and Description |
|---|---|
| protected | OfGenericArray(TypeDescription.
The type being assigned to another type. typeDescription,true if the assignment is polymorphic.Creates a new visitor. |
| Modifier and Type | Method and Description |
|---|---|
| public Boolean | onGenericArray(TypeDescription.
The generic array type. genericArrayImplements net. Sort#GENERIC_ARRAY).
|
| public Boolean | onNonGenericType(TypeDescription.
The non-generic type. typeDescriptionImplements net. Sort#NON_GENERIC).
|
| public Boolean | onParameterizedType(TypeDescription.
The generic array type. parameterizedTypeImplements net. Sort#PARAMETERIZED).
|
| OfGenericArray | back to summary |
|---|---|
| protected OfGenericArray(TypeDescription. Creates a new visitor.
| |
| onGenericArray | back to summary |
|---|---|
| public Boolean onGenericArray(TypeDescription. Implements net. Doc from net. Visits a generic array type (
| |
| onNonGenericType | back to summary |
|---|---|
| public Boolean onNonGenericType(TypeDescription. Implements net. Doc from net. Visits a non-generic type (
| |
| onParameterizedType | back to summary |
|---|---|
| public Boolean onParameterizedType(TypeDescription. Implements net. Doc from net. Visits a parameterized type (
| |
| Modifier and Type | Field and Description |
|---|---|
| protected final boolean | polymorphic
|
| protected final TypeDescription. | typeDescription
The type being assigned to another type. |
| Access | Constructor and Description |
|---|---|
| protected | OfManifestType(TypeDescription.
The type being assigned to another type. typeDescription,true if the assignment is polymorphic.Creates a new visitor for a manifest type. |
| Modifier and Type | Method and Description |
|---|---|
| public Boolean | onTypeVariable(TypeDescription.
The generic array type. typeVariableImplements net. Sort#VARIABLE, Sort#VARIABLE_SYMBOLIC).
|
| public Boolean | onWildcard(TypeDescription.
The wildcard. wildcardImplements net. Sort#WILDCARD).
|
| polymorphic | back to summary |
|---|---|
| protected final boolean polymorphic
| |
| typeDescription | back to summary |
|---|---|
| protected final TypeDescription. The type being assigned to another type. | |
| OfManifestType | back to summary |
|---|---|
| protected OfManifestType(TypeDescription. Creates a new visitor for a manifest type.
| |
| onTypeVariable | back to summary |
|---|---|
| public Boolean onTypeVariable(TypeDescription. Implements net. Doc from net. Visits a type variable (
| |
| onWildcard | back to summary |
|---|---|
| public Boolean onWildcard(TypeDescription. Implements net. Doc from net. Visits a wildcard (
| |
| Access | Constructor and Description |
|---|---|
| protected | OfNonGenericType(TypeDescription.
The type being assigned to another type. typeDescription,true if the assignment is polymorphic.Creates a new visitor. |
| Modifier and Type | Method and Description |
|---|---|
| public Boolean | onGenericArray(TypeDescription.
The generic array type. genericArrayImplements net. Sort#GENERIC_ARRAY).
|
| OfNonGenericType | back to summary |
|---|---|
| protected OfNonGenericType(TypeDescription. Creates a new visitor.
| |
| onGenericArray | back to summary |
|---|---|
| public Boolean onGenericArray(TypeDescription. Implements net. Doc from net. Visits a generic array type (
| |
| Access | Constructor and Description |
|---|---|
| protected | OfParameterizedType(TypeDescription.
The type being assigned to another type. typeDescription,true if the assignment is polymorphic.Creates a new visitor. |
| Modifier and Type | Method and Description |
|---|---|
| public Boolean | onGenericArray(TypeDescription.
The generic array type. genericArrayImplements net. Sort#GENERIC_ARRAY).
|
| OfParameterizedType | back to summary |
|---|---|
| protected OfParameterizedType(TypeDescription. Creates a new visitor.
| |
| onGenericArray | back to summary |
|---|---|
| public Boolean onGenericArray(TypeDescription. Implements net. Doc from net. Visits a generic array type (
| |
| Access | Constructor and Description |
|---|---|
| protected | OfSimpleType(TypeDescription.
The type being assigned to another type. typeDescription,true if the assignment is polymorphic.Creates a new visitor. |
| Modifier and Type | Method and Description |
|---|---|
| public Boolean | onNonGenericType(TypeDescription.
The non-generic type. typeDescriptionImplements net. Sort#NON_GENERIC).
|
| public Boolean | onParameterizedType(TypeDescription.
The generic array type. parameterizedTypeImplements net. Sort#PARAMETERIZED).
|
| OfSimpleType | back to summary |
|---|---|
| protected OfSimpleType(TypeDescription. Creates a new visitor.
| |
| onNonGenericType | back to summary |
|---|---|
| public Boolean onNonGenericType(TypeDescription. Implements net. Doc from net. Visits a non-generic type (
| |
| onParameterizedType | back to summary |
|---|---|
| public Boolean onParameterizedType(TypeDescription. Implements net. Doc from net. Visits a parameterized type (
| |
| Modifier and Type | Field and Description |
|---|---|
| private final TypeDescription. | wildcard
The wildcard type being assigned to another type. |
| Access | Constructor and Description |
|---|---|
| protected | OfWildcard(TypeDescription.
The wildcard type being assigned to another type. wildcardCreates a visitor for a wildcard type assignment. |
| wildcard | back to summary |
|---|---|
| private final TypeDescription. The wildcard type being assigned to another type. | |
| OfWildcard | back to summary |
|---|---|
| protected OfWildcard(TypeDescription. Creates a visitor for a wildcard type assignment.
| |
| onGenericArray | back to summary |
|---|---|
| public Boolean onGenericArray(TypeDescription. Implements net. Doc from net. Visits a generic array type (
| |
| onNonGenericType | back to summary |
|---|---|
| public Boolean onNonGenericType(TypeDescription. Implements net. Doc from net. Visits a non-generic type (
| |
| onParameterizedType | back to summary |
|---|---|
| public Boolean onParameterizedType(TypeDescription. Implements net. Doc from net. Visits a parameterized type (
| |
| onTypeVariable | back to summary |
|---|---|
| public Boolean onTypeVariable(TypeDescription. Implements net. Doc from net. Visits a type variable (
| |
| onWildcard | back to summary |
|---|---|
| public Boolean onWildcard(TypeDescription. Implements net. Doc from net. Visits a wildcard (
| |