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, unboxesTo
cast, 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, visit
autobox, 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, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
isBottom, isConstructor, isEquivalentTo, isFunctionType, isInterface, isSubtypeOf, restrictByNotNullOrUndefined, toMaybeFunctionType, toMaybeObjectType
private 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()
ObjectType
getReferenceName
in class PrototypeObjectType
null
if this is an anonymous
objectpublic boolean hasReferenceName()
ObjectType
hasReferenceName
in class PrototypeObjectType
public ObjectType getImplicitPrototype()
ObjectType
[[Prototype]]
property).getImplicitPrototype
in class PrototypeObjectType
public FunctionType getConstructor()
ObjectType
getConstructor
in interface ObjectTypeI
getConstructor
in class PrototypeObjectType
null
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 PrototypeObjectType
name
- 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 PrototypeObjectType
forAnnotations
- Whether this is for use in code generator
annotations. Otherwise, it's for warnings.boolean isTheObjectType()
isTheObjectType
in class JSType
public boolean isInstanceType()
JSType
InstanceObjectType
.isInstanceType
in class JSType
public boolean isArrayType()
isArrayType
in class JSType
public boolean isStringObjectType()
isStringObjectType
in class JSType
public boolean isBooleanObjectType()
isBooleanObjectType
in class JSType
public boolean isNumberObjectType()
isNumberObjectType
in class JSType
public boolean isDateType()
isDateType
in class JSType
public boolean isRegexpType()
isRegexpType
in class JSType
public boolean isNominalType()
JSType
isNominalType
in class JSType
public int hashCode()
public java.lang.Iterable<ObjectType> getCtorImplementedInterfaces()
ObjectType
getCtorImplementedInterfaces
in class PrototypeObjectType
public java.lang.Iterable<ObjectType> getCtorExtendedInterfaces()
ObjectType
getCtorExtendedInterfaces
in class PrototypeObjectType