public abstract class Namespace extends Object
Modifier and Type | Field and Description |
---|---|
protected String |
name |
protected JSType |
namespaceType |
protected com.google.javascript.jscomp.newtypes.PersistentMap<String,com.google.javascript.jscomp.newtypes.Property> |
otherProps |
Constructor and Description |
---|
Namespace() |
Modifier and Type | Method and Description |
---|---|
void |
addNamespace(QualifiedName qname,
Namespace ns) |
void |
addProperty(String pname,
Node defSite,
JSType type,
boolean isConstant)
Add a new non-optional declared property to this namespace
|
void |
addTypedef(QualifiedName qname,
Typedef td) |
void |
addUndeclaredProperty(String pname,
Node defSite,
JSType t,
boolean isConstant)
Add a new undeclared property to this namespace
|
protected abstract JSType |
computeJSType(JSTypes commonTypes) |
void |
copyWindowProperties(JSTypes commonTypes,
RawNominalType win) |
Declaration |
getDeclaration(QualifiedName qname) |
String |
getName() |
JSType |
getPropDeclaredType(String pname) |
Namespace |
getSubnamespace(QualifiedName qname) |
boolean |
hasProp(String pname) |
boolean |
hasSubnamespace(QualifiedName qname) |
boolean |
isDefined(QualifiedName qname) |
JSType |
toJSType(JSTypes commonTypes) |
String |
toString() |
protected com.google.javascript.jscomp.newtypes.PersistentMap<String,com.google.javascript.jscomp.newtypes.Property> otherProps
protected String name
protected JSType namespaceType
public final String getName()
public final boolean isDefined(QualifiedName qname)
public void addNamespace(QualifiedName qname, Namespace ns)
public final Declaration getDeclaration(QualifiedName qname)
public final void addTypedef(QualifiedName qname, Typedef td)
public final Namespace getSubnamespace(QualifiedName qname)
public final boolean hasSubnamespace(QualifiedName qname)
public final boolean hasProp(String pname)
public final void addProperty(String pname, Node defSite, JSType type, boolean isConstant)
public final void addUndeclaredProperty(String pname, Node defSite, JSType t, boolean isConstant)
public final void copyWindowProperties(JSTypes commonTypes, RawNominalType win)
Copyright © 2009–2023 Google. All rights reserved.