class InstanceObjectType extends PrototypeObjectType
JSType.EqCache, JSType.ImplCache, JSType.MatchStatus, JSType.TypePair| Modifier and Type | Field and Description |
|---|---|
private FunctionType |
constructor |
private static long |
serialVersionUID |
ALPHA, registry, templateTypeMap| Constructor and Description |
|---|
InstanceObjectType(JSTypeRegistry registry,
FunctionType constructor) |
InstanceObjectType(JSTypeRegistry registry,
FunctionType constructor,
boolean isNativeType) |
| Modifier and Type | Method and Description |
|---|---|
(package private) boolean |
defineProperty(java.lang.String name,
JSType type,
boolean inferred,
Node propertyNode)
Defines a property.
|
FunctionType |
getConstructor()
Gets this object's constructor.
|
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.
|
ObjectType |
getImplicitPrototype()
Gets the implicit prototype (a.k.a.
|
java.lang.String |
getReferenceName()
Gets the reference name for this object.
|
int |
hashCode()
If this is equal to a NamedType object, its hashCode must be equal
to the hashCode of the NamedType object.
|
boolean |
hasReferenceName()
Returns true if the object is named.
|
boolean |
isArrayType() |
boolean |
isBooleanObjectType() |
boolean |
isDateType() |
boolean |
isInstanceType()
Whether this type is an Instance object of some constructor.
|
boolean |
isNominalType()
Whether this type is a nominal type (a named instance object or
a named enum).
|
boolean |
isNumberObjectType() |
boolean |
isRegexpType() |
boolean |
isStringObjectType() |
(package private) boolean |
isTheObjectType() |
(package private) java.lang.String |
toStringHelper(boolean forAnnotations) |
canBeCalled, getOwnerFunction, getPropertyMap, hasCachedValues, isAnonymous, isNativeObjectType, isPrettyPrint, isSubtype, isSubtype, isSubtype, matchConstraint, matchesNumberContext, matchesObjectContext, matchesStringContext, matchRecordTypeConstraint, removeProperty, resolveInternal, setImplicitPrototype, setOwnerFunction, setPrettyPrint, setPropertyJSDocInfo, setPropertyNode, unboxesTocast, checkStructuralEquivalenceHelper, clearCachedValues, collectPropertyNames, createDelegateSuffix, defineDeclaredProperty, defineInferredProperty, defineSynthesizedProperty, detectImplicitPrototypeCycle, detectInheritanceCycle, findPropertyType, getDisplayName, getJSDocInfo, getNormalizedReferenceName, getOwnPropertyJSDocInfo, getOwnPropertyNames, getOwnSlot, getParentScope, getPossibleToBooleanOutcomes, getPropertiesCount, getPropertyNames, getPropertyNode, getPropertyType, getPropertyTypeMap, getRootNode, getSlot, getTemplateTypes, getTypeOfThis, hasOwnDeclaredProperty, hasOwnProperty, hasProperty, isFunctionPrototypeType, isImplicitPrototype, isObject, isPropertyInExterns, isPropertyTypeDeclared, isPropertyTypeInferred, isStructuralSubtype, isStructuralType, isUnknownType, setJSDocInfo, testForEquality, visit, visitautobox, autoboxesTo, canCastTo, canTestForEqualityWith, canTestForShallowEqualityWith, checkEquivalenceHelper, checkEquivalenceHelper, collapseUnion, dereference, differsFrom, equals, extendTemplateTypeMap, filterNoResolvedType, getGreatestSubtype, getGreatestSubtype, getLeastSupertype, getLeastSupertype, getNativeType, getRestrictedTypeGivenToBooleanOutcome, getTemplateTypeMap, getTypesUnderEquality, getTypesUnderInequality, getTypesUnderShallowEquality, getTypesUnderShallowInequality, hasAnyTemplateTypes, hasAnyTemplateTypesInternal, hasDisplayName, isAllType, isBooleanValueType, isBottom, isCheckedUnknownType, isConstructor, isDict, isEmptyType, isEnumElementType, isEnumType, isEquivalent, isEquivalentTo, isEquivalentTo, isExemptFromTemplateTypeInvariance, isExplicitlyVoidable, isFunctionType, isGlobalThisType, isInterface, isNamedType, isNominalConstructor, isNoObjectType, isNoResolvedType, isNoType, isNullable, isNullType, isNumber, isNumberValueType, isOrdinaryFunction, isRecordType, isResolved, isString, isStringValueType, isStruct, isStructuralInterface, isSubtypeHelper, isSubtypeOf, isSubtypeWithoutStructuralTyping, isTemplateType, isTemplatizedType, isUnionType, isVoidable, isVoidType, matchesInt32Context, matchesUint32Context, resolve, restrictByNotNullOrUndefined, safeResolve, setResolvedTypeInternal, setValidator, testForEqualityHelper, toAnnotationString, toDebugHashCodeString, toMaybeEnumElementType, toMaybeEnumType, toMaybeFunctionType, toMaybeFunctionType, toMaybeNamedType, toMaybeObjectType, toMaybeRecordType, toMaybeTemplateType, toMaybeTemplatizedType, toMaybeUnionType, toNonNullAnnotationString, toObjectType, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitisBottom, isConstructor, isEquivalentTo, isFunctionType, isInterface, isSubtypeOf, restrictByNotNullOrUndefined, toMaybeFunctionType, toMaybeObjectTypeprivate static final long serialVersionUID
private final FunctionType constructor
InstanceObjectType(JSTypeRegistry registry, FunctionType constructor)
InstanceObjectType(JSTypeRegistry registry, FunctionType constructor, boolean isNativeType)
public java.lang.String getReferenceName()
ObjectTypegetReferenceName in class PrototypeObjectTypenull if this is an anonymous
objectpublic boolean hasReferenceName()
ObjectTypehasReferenceName in class PrototypeObjectTypepublic ObjectType getImplicitPrototype()
ObjectType[[Prototype]] property).getImplicitPrototype in class PrototypeObjectTypepublic FunctionType getConstructor()
ObjectTypegetConstructor in interface ObjectTypeIgetConstructor in class PrototypeObjectTypenull if it is a native
object (constructed natively v.s. by instantiation of a function)boolean defineProperty(java.lang.String name,
JSType type,
boolean inferred,
Node propertyNode)
ObjectType
For clarity, callers should prefer ObjectType.defineDeclaredProperty(java.lang.String, com.google.javascript.rhino.jstype.JSType, com.google.javascript.rhino.Node) and
ObjectType.defineInferredProperty(java.lang.String, com.google.javascript.rhino.jstype.JSType, com.google.javascript.rhino.Node).
defineProperty in class PrototypeObjectTypename - the property's nametype - the typeinferred - true if this property's type is inferredpropertyNode - the node that represents the definition of property.
Depending on the actual sub-type the node type might be different.
The general idea is to have an estimate of where in the source code
this property is defined.java.lang.String toStringHelper(boolean forAnnotations)
toStringHelper in class PrototypeObjectTypeforAnnotations - Whether this is for use in code generator
annotations. Otherwise, it's for warnings.boolean isTheObjectType()
isTheObjectType in class JSTypepublic boolean isInstanceType()
JSTypeInstanceObjectType.isInstanceType in class JSTypepublic boolean isArrayType()
isArrayType in class JSTypepublic boolean isStringObjectType()
isStringObjectType in class JSTypepublic boolean isBooleanObjectType()
isBooleanObjectType in class JSTypepublic boolean isNumberObjectType()
isNumberObjectType in class JSTypepublic boolean isDateType()
isDateType in class JSTypepublic boolean isRegexpType()
isRegexpType in class JSTypepublic boolean isNominalType()
JSTypeisNominalType in class JSTypepublic int hashCode()
public java.lang.Iterable<ObjectType> getCtorImplementedInterfaces()
ObjectTypegetCtorImplementedInterfaces in class PrototypeObjectTypepublic java.lang.Iterable<ObjectType> getCtorExtendedInterfaces()
ObjectTypegetCtorExtendedInterfaces in class PrototypeObjectType