public final class RawNominalType extends Namespace
name, namespaceType, otherProps
Modifier and Type | Method and Description |
---|---|
void |
addClassProperty(String pname,
Node defSite,
JSType type,
boolean isConstant)
Add a new non-optional declared property to instances of this class
|
void |
addCtorProperty(String pname,
Node defSite,
JSType type,
boolean isConstant)
Add a new non-optional declared property to this class's constructor
|
boolean |
addInterfaces(com.google.common.collect.ImmutableSet<NominalType> interfaces) |
void |
addPropertyWhichMayNotBeOnAllInstances(String pname,
JSType type) |
void |
addProtoProperty(String pname,
Node defSite,
JSType type,
boolean isConstant)
Add a new declared prototype property to this class
|
boolean |
addSuperClass(NominalType superClass) |
void |
addUndeclaredClassProperty(String pname,
JSType type,
Node defSite)
Add a new undeclared property to instances of this class
|
void |
addUndeclaredCtorProperty(String pname,
Node defSite)
Add a new undeclared property to this class's constructor
|
void |
addUndeclaredProtoProperty(String pname,
Node defSite)
Add a new undeclared prototype property to this class
|
protected JSType |
computeJSType(JSTypes commonTypes) |
void |
finalize() |
Set<String> |
getAllOwnProps() |
NominalType |
getAsNominalType() |
FunctionType |
getConstructorFunction() |
JSType |
getCtorPropDeclaredType(String pname) |
Node |
getDefSite() |
JSType |
getInstanceAsJSType() |
JSType |
getInstancePropDeclaredType(String pname) |
JSType |
getInstanceWithNullability(boolean includeNull) |
com.google.common.collect.ImmutableSet<NominalType> |
getInterfaces() |
NominalType |
getSuperClass() |
boolean |
hasCtorProp(String pname) |
boolean |
isClass() |
boolean |
isDict() |
boolean |
isFinalized() |
boolean |
isInterface() |
boolean |
isStruct() |
static RawNominalType |
makeDictClass(Node defSite,
String name,
com.google.common.collect.ImmutableList<String> typeParameters) |
static RawNominalType |
makeNominalInterface(Node defSite,
String name,
com.google.common.collect.ImmutableList<String> typeParameters) |
static RawNominalType |
makeStructClass(Node defSite,
String name,
com.google.common.collect.ImmutableList<String> typeParameters) |
static RawNominalType |
makeStructuralInterface(Node defSite,
String name,
com.google.common.collect.ImmutableList<String> typeParameters) |
static RawNominalType |
makeUnrestrictedClass(Node defSite,
String name,
com.google.common.collect.ImmutableList<String> typeParameters) |
boolean |
mayHaveOwnProp(String pname) |
boolean |
mayHaveProp(String pname) |
void |
setCtorFunction(FunctionType ctorFn) |
String |
toString() |
addNamespace, addProperty, addTypedef, addUndeclaredProperty, copyWindowProperties, getDeclaration, getName, getPropDeclaredType, getSubnamespace, hasProp, hasSubnamespace, isDefined, toJSType
public static RawNominalType makeUnrestrictedClass(Node defSite, String name, com.google.common.collect.ImmutableList<String> typeParameters)
public static RawNominalType makeStructClass(Node defSite, String name, com.google.common.collect.ImmutableList<String> typeParameters)
public static RawNominalType makeDictClass(Node defSite, String name, com.google.common.collect.ImmutableList<String> typeParameters)
public static RawNominalType makeNominalInterface(Node defSite, String name, com.google.common.collect.ImmutableList<String> typeParameters)
public static RawNominalType makeStructuralInterface(Node defSite, String name, com.google.common.collect.ImmutableList<String> typeParameters)
public Node getDefSite()
public boolean isClass()
public boolean isInterface()
public boolean isStruct()
public boolean isDict()
public boolean isFinalized()
public FunctionType getConstructorFunction()
public void setCtorFunction(FunctionType ctorFn)
public boolean addSuperClass(NominalType superClass)
public boolean addInterfaces(com.google.common.collect.ImmutableSet<NominalType> interfaces)
public NominalType getSuperClass()
public com.google.common.collect.ImmutableSet<NominalType> getInterfaces()
public boolean mayHaveOwnProp(String pname)
public boolean mayHaveProp(String pname)
public void addPropertyWhichMayNotBeOnAllInstances(String pname, JSType type)
public void addClassProperty(String pname, Node defSite, JSType type, boolean isConstant)
public void addUndeclaredClassProperty(String pname, JSType type, Node defSite)
public void addProtoProperty(String pname, Node defSite, JSType type, boolean isConstant)
public void addUndeclaredProtoProperty(String pname, Node defSite)
public boolean hasCtorProp(String pname)
public void addCtorProperty(String pname, Node defSite, JSType type, boolean isConstant)
public void addUndeclaredCtorProperty(String pname, Node defSite)
protected JSType computeJSType(JSTypes commonTypes)
computeJSType
in class Namespace
public NominalType getAsNominalType()
public JSType getInstanceAsJSType()
public JSType getInstanceWithNullability(boolean includeNull)
Copyright © 2009–2023 Google. All rights reserved.