public class CollectionLiteralsTypeComputer extends AbstractTypeComputer
| Constructor and Description |
|---|
CollectionLiteralsTypeComputer() |
deferredBindTypeArgument, findDeclaredType, findDeclaredType, getCommonSuperType, getPrimitiveVoid, getRawTypeForName, getRawTypeForName, getTypeForNamepublic void computeType(XSetLiteral literal, ITypeComputationState state)
XbaseTypeComputer.public void computeType(XListLiteral literal, ITypeComputationState state)
XbaseTypeComputer.protected LightweightTypeReference getCommonSuperType(List<LightweightTypeReference> types, ITypeComputationState state)
null for those.
Computes the common super type for the given list of types. The list may not be empty.getCommonSuperType in class AbstractTypeComputerprotected void computeType(XSetLiteral literal, JvmGenericType setType, JvmGenericType mapType, ITypeExpectation expectation, ITypeComputationState state)
protected void setUnboundCollectionType(XCollectionLiteral literal, JvmGenericType collectionType, ITypeExpectation expectation, LightweightTypeReference elementTypeExpectation, ITypeComputationState state)
protected void refineElementTypeExpectation(XCollectionLiteral literal, LightweightTypeReference expectation, ITypeComputationState state)
protected boolean isMapLiteral(LightweightTypeReference expectation, LightweightTypeReference elementType)
protected boolean isMapExpectation(LightweightTypeReference expectation)
protected void computeType(XListLiteral literal, JvmGenericType listType, ITypeExpectation expectation, ITypeComputationState state)
protected void computeArrayLiteralType(XListLiteral literal, LightweightTypeReference expectedArrayType, ITypeExpectation expectation, ITypeComputationState state)
protected ITypeComputationResult computeTypes(XExpression element, LightweightTypeReference expectation, ITypeComputationState state)
protected void handleCollectionTypeNotAvailable(XCollectionLiteral literal, ITypeComputationState state, Class<?> clazz)
protected LightweightTypeReference createNormalizedPairType(LightweightTypeReference pairType, LightweightTypeReference mapType, ITypeReferenceOwner owner)
protected LightweightTypeReference createCollectionTypeReference(JvmGenericType collectionType, LightweightTypeReference elementType, LightweightTypeReference expectedType, ITypeReferenceOwner owner)
protected LightweightTypeReference createMapTypeReference(JvmGenericType mapType, LightweightTypeReference pairType, LightweightTypeReference expectation, ITypeReferenceOwner owner)
protected boolean matchesExpectation(LightweightTypeReference elementType, LightweightTypeReference expectation)
protected LightweightTypeReference getMapExpectation(LightweightTypeReference expectation)
Map, the resolved super type is returned.
This allows to query for the type arguments that are available on the expectation.protected LightweightTypeReference normalizeElementType(LightweightTypeReference collectionElementType, LightweightTypeReference expectedCollectionType, ITypeReferenceOwner owner)
Collection<CharSequence> may yield a type List<CharSequence> for the literal
['a'] even though it would be List<? extends String> if no expectation was given.protected boolean isIterableExpectation(LightweightTypeReference expectation)
protected boolean isExpectedType(LightweightTypeReference expectation, Class<?> clazz)
protected boolean isSubtypeButNotSynonym(LightweightTypeReference expectation, Class<?> clazz)
LightweightTypeReference.isSubtypeOf(Class) but does not accept synonym types as subtypes.protected LightweightTypeReference normalizeFunctionTypeReference(LightweightTypeReference type)
protected LightweightTypeReference doNormalizeElementType(LightweightTypeReference actual, LightweightTypeReference expected)
protected List<LightweightTypeReference> computeCollectionTypeCandidates(XCollectionLiteral literal, JvmGenericType collectionType, LightweightTypeReference elementTypeExpectation, ITypeComputationState state)
protected LightweightTypeReference getElementOrComponentType(LightweightTypeReference iterableOrArray, ITypeComputationState state)
protected LightweightTypeReference getElementOrComponentType(LightweightTypeReference iterableOrArray, ITypeReferenceOwner owner)
ElementOrComponentTypeComputer.compute(LightweightTypeReference, ITypeReferenceOwner).
Clients may override.Copyright © 2015. All Rights Reserved.