@ThreadSafe public final class TypeRegistry extends Object implements TypeManager
| Modifier and Type | Class and Description |
|---|---|
static class |
TypeRegistry.TypeCompatibility |
| Constructor and Description |
|---|
TypeRegistry() |
TypeRegistry(Set<Type> types,
FeaturesConfig featuresConfig) |
| Modifier and Type | Method and Description |
|---|---|
void |
addParametricType(ParametricType parametricType) |
void |
addType(Type type) |
boolean |
canCoerce(Type fromType,
Type toType) |
Optional<Type> |
coerceTypeBase(Type sourceType,
String resultTypeBase)
coerceTypeBase and isCovariantParametrizedType defines all hand-coded rules for type coercion.
|
Optional<Type> |
getCommonSuperType(Type firstType,
Type secondType) |
Type |
getParameterizedType(String baseTypeName,
List<TypeSignatureParameter> typeParameters) |
Collection<ParametricType> |
getParametricTypes() |
Type |
getType(TypeSignature signature) |
List<Type> |
getTypes() |
static boolean |
isCovariantTypeBase(String typeBase) |
boolean |
isTypeOnlyCoercion(Type source,
Type result) |
MethodHandle |
resolveOperator(OperatorType operatorType,
List<? extends Type> argumentTypes) |
void |
setFunctionRegistry(FunctionRegistry functionRegistry) |
public TypeRegistry()
@Inject public TypeRegistry(Set<Type> types, FeaturesConfig featuresConfig)
public void setFunctionRegistry(FunctionRegistry functionRegistry)
public Type getType(TypeSignature signature)
getType in interface TypeManagerpublic Type getParameterizedType(String baseTypeName, List<TypeSignatureParameter> typeParameters)
getParameterizedType in interface TypeManagerpublic List<Type> getTypes()
getTypes in interface TypeManagerpublic boolean isTypeOnlyCoercion(Type source, Type result)
isTypeOnlyCoercion in interface TypeManagerpublic Optional<Type> getCommonSuperType(Type firstType, Type secondType)
getCommonSuperType in interface TypeManagerpublic boolean canCoerce(Type fromType, Type toType)
canCoerce in interface TypeManagerpublic void addType(Type type)
public void addParametricType(ParametricType parametricType)
public Collection<ParametricType> getParametricTypes()
getParametricTypes in interface TypeManagerpublic Optional<Type> coerceTypeBase(Type sourceType, String resultTypeBase)
coerceTypeBase in interface TypeManagerpublic static boolean isCovariantTypeBase(String typeBase)
public MethodHandle resolveOperator(OperatorType operatorType, List<? extends Type> argumentTypes)
resolveOperator in interface TypeManagerCopyright © 2012–2019. All rights reserved.