public final class EnumType extends Namespace
name, namespaceType, otherProps
Modifier and Type | Method and Description |
---|---|
protected JSType |
computeJSType(JSTypes commonTypes)
When defining an enum such as
/** @enum {number} * /
var X = { ONE: 1, TWO: 2 };
the properties of the object literal are constant.
|
boolean |
enumLiteralHasKey(String name) |
JSType |
getDeclaredProp(QualifiedName qname)
Get the declared type of the given property
|
JSType |
getEnumeratedType() |
JSType |
getProp(QualifiedName qname)
Get the inferred type of the given property
|
JSType |
getPropType() |
JSTypeExpression |
getTypeExpr() |
JSTypeExpression |
getTypeExprForErrorReporting() |
boolean |
hasConstantProp(QualifiedName qname)
Return whether this type contains a constant property
|
boolean |
hasProp(QualifiedName qname)
Return whether this type contains a required property
|
boolean |
isResolved() |
static EnumType |
make(String name,
JSTypeExpression typeExpr,
Collection<String> props) |
boolean |
mayHaveProp(QualifiedName qname)
Return whether this type contains any form of property
|
String |
toString() |
addNamespace, addProperty, addTypedef, addUndeclaredProperty, copyWindowProperties, getDeclaration, getName, getPropDeclaredType, getSubnamespace, hasProp, hasSubnamespace, isDefined, toJSType
public static EnumType make(String name, JSTypeExpression typeExpr, Collection<String> props)
public boolean isResolved()
public JSType getEnumeratedType()
public JSType getPropType()
public JSTypeExpression getTypeExpr()
public JSTypeExpression getTypeExprForErrorReporting()
protected JSType computeJSType(JSTypes commonTypes)
computeJSType
in class Namespace
public JSType getProp(QualifiedName qname)
public JSType getDeclaredProp(QualifiedName qname)
public boolean mayHaveProp(QualifiedName qname)
public boolean hasProp(QualifiedName qname)
public boolean hasConstantProp(QualifiedName qname)
public boolean enumLiteralHasKey(String name)
Copyright © 2009–2023 Google. All rights reserved.