Class TemplatizedType
- java.lang.Object
-
- com.google.javascript.rhino.jstype.JSType
-
- com.google.javascript.rhino.jstype.ObjectType
-
- com.google.javascript.rhino.jstype.ProxyObjectType
-
- com.google.javascript.rhino.jstype.TemplatizedType
-
public final class TemplatizedType extends ProxyObjectType
An object type with declared template types, such asArray<string>
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.javascript.rhino.jstype.JSType
JSType.HasPropertyKind, JSType.Nullability, JSType.SubtypingMode, JSType.TypePair
-
-
Field Summary
-
Fields inherited from class com.google.javascript.rhino.jstype.JSType
templateTypeMap
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Iterable<ObjectType>
getCtorExtendedInterfaces()
Gets the interfaces extended by the interface associated with this type.java.lang.Iterable<ObjectType>
getCtorImplementedInterfaces()
Gets the interfaces implemented by the ctor associated with this type.JSType
getPropertyType(java.lang.String propertyName)
Gets the property type of the property whose name is given.ObjectType
getReferencedType()
TemplateTypeMap
getTemplateTypeMap()
Returns the template type map associated with this type.com.google.common.collect.ImmutableList<JSType>
getTemplateTypes()
Gets the declared default element type.boolean
hasAnyTemplateTypesInternal()
TemplatizedType
toMaybeTemplatizedType()
Downcasts this to a TemplatizedType, or returns null if this is not a templatized type.<T> T
visit(Visitor<T> visitor)
Visit this type with the given visitor.-
Methods inherited from class com.google.javascript.rhino.jstype.ProxyObjectType
canBeCalled, collapseUnion, findPropertyTypeWithoutConsideringTemplateTypes, getConstructor, getImplicitPrototype, getJSDocInfo, getOwnerFunction, getPropertyKind, getReferenceName, getTemplateParamCount, getTypeOfThis, isAllType, isCheckedUnknownType, isConstructor, isDict, isInstanceType, isInterface, isNativeObjectType, isNominalType, isNoObjectType, isNoResolvedType, isNoType, isNullable, isOrdinaryFunction, isStruct, isStructuralType, isUnknownType, isVoidable, loosenTypecheckingDueToForwardReferencedSupertype, matchConstraint, matchesNumberContext, matchesObjectContext, matchesStringContext, matchesSymbolContext, removeProperty, setJSDocInfo, setPropertyJSDocInfo, setValidator, testForEquality, toMaybeEnumElementType, toMaybeEnumType, toMaybeFunctionType, toMaybeRecordType, toMaybeTemplateType, toMaybeUnionType, visitReferenceType
-
Methods inherited from class com.google.javascript.rhino.jstype.ObjectType
cast, clearCachedValues, createDelegateSuffix, defineDeclaredProperty, defineInferredProperty, defineSynthesizedProperty, findClosestDefinition, getClosestDefiningType, getDisplayName, getEnumeratedTypeOfEnumObject, getImplicitPrototypeChain, getNormalizedReferenceName, getOwnPropertyDefSite, getOwnPropertyJSDocInfo, getOwnPropertyKind, getOwnPropertyNames, getOwnSlot, getPossibleToBooleanOutcomes, getPropertiesCount, getPropertyDefSite, getPropertyJSDocInfo, getPropertyNames, getPropertyNode, getPropertyTypeMap, getRawType, getSlot, getSuperClassConstructor, hasCachedValues, hasOwnProperty, hasReferenceName, isFunctionPrototypeType, isObject, isPropertyInExterns, isPropertyTypeDeclared, isPropertyTypeInferred, setPropertyNode
-
Methods inherited from class com.google.javascript.rhino.jstype.JSType
areIdentical, areSimilar, assertFunctionType, assertObjectType, autobox, autoboxesTo, canCastTo, canTestForEqualityWith, canTestForShallowEqualityWith, containsReferenceAncestor, dereference, differsFrom, equals, findPropertyType, getEnumeratedTypeOfEnumElement, getGreatestSubtype, getLeastSupertype, getPropertyKind, getRestrictedTypeGivenOutcome, getTypeParameters, getTypesUnderEquality, getTypesUnderInequality, getTypesUnderShallowEquality, getTypesUnderShallowInequality, getUnionMembers, hasAnyTemplateTypes, hasDisplayName, hashCode, hasProperty, isArrayType, isBigIntObjectType, isBigIntOrNumber, isBigIntValueType, isBooleanObjectType, isBooleanValueType, isBoxableScalar, isDateType, isEmptyType, isEnumElementType, isEnumType, isExplicitlyVoidable, isFunctionType, isGlobalThisType, isLiteralObject, isNamedType, isNominalConstructorOrInterface, isNullType, isNumber, isNumberObjectType, isNumberValueType, isObjectType, isOnlyBigInt, isRawTypeOfTemplatizedType, isRecordType, isRegexpType, isResolved, isSomeUnknownType, isString, isStringObjectType, isStringValueType, isStructuralInterface, isSubtype, isSubtype, isSubtypeOf, isSubtypeOf, isSubtypeWithoutStructuralTyping, isSuccessfullyResolved, isSymbol, isSymbolObjectType, isSymbolValueType, isTemplateType, isTemplatizedType, isUnionType, isUnresolved, isUnresolvedOrResolvedUnknown, isUnsuccessfullyResolved, isVoidType, mergeSupertypeTemplateTypes, resolve, restrictByNotNull, restrictByNotNullOrUndefined, restrictByNotUndefined, toAnnotationString, toMaybeFunctionType, toMaybeNamedType, toMaybeObjectType, toObjectType, toString
-
-
-
-
Method Detail
-
getCtorImplementedInterfaces
public java.lang.Iterable<ObjectType> getCtorImplementedInterfaces()
Description copied from class:ObjectType
Gets the interfaces implemented by the ctor associated with this type. Intended to be overridden by subclasses.- Overrides:
getCtorImplementedInterfaces
in classProxyObjectType
-
getCtorExtendedInterfaces
public java.lang.Iterable<ObjectType> getCtorExtendedInterfaces()
Description copied from class:ObjectType
Gets the interfaces extended by the interface associated with this type. Intended to be overridden by subclasses.- Overrides:
getCtorExtendedInterfaces
in classProxyObjectType
-
visit
public <T> T visit(Visitor<T> visitor)
Description copied from class:JSType
Visit this type with the given visitor.- Overrides:
visit
in classProxyObjectType
- Returns:
- the value returned by the visitor
- See Also:
Visitor
-
toMaybeTemplatizedType
public TemplatizedType toMaybeTemplatizedType()
Description copied from class:JSType
Downcasts this to a TemplatizedType, or returns null if this is not a templatized type.- Overrides:
toMaybeTemplatizedType
in classProxyObjectType
-
getTemplateTypes
public com.google.common.collect.ImmutableList<JSType> getTemplateTypes()
Description copied from class:ObjectType
Gets the declared default element type.- Overrides:
getTemplateTypes
in classProxyObjectType
- See Also:
TemplatizedType
-
getPropertyType
public JSType getPropertyType(java.lang.String propertyName)
Description copied from class:ObjectType
Gets the property type of the property whose name is given. If the underlying object does not have this property, the Unknown type is returned to indicate that no information is available on this property. This gets overridden by FunctionType for lazily-resolved call() and bind() functions.- Overrides:
getPropertyType
in classObjectType
- Returns:
- the property's type or
UnknownType
. This method never returnsnull
.
-
getTemplateTypeMap
public TemplateTypeMap getTemplateTypeMap()
Description copied from class:JSType
Returns the template type map associated with this type.- Overrides:
getTemplateTypeMap
in classProxyObjectType
-
hasAnyTemplateTypesInternal
public boolean hasAnyTemplateTypesInternal()
- Overrides:
hasAnyTemplateTypesInternal
in classProxyObjectType
-
getReferencedType
public ObjectType getReferencedType()
- Returns:
- The referenced ObjectType wrapped by this TemplatizedType.
-
-