public abstract class Namespace extends Object implements Serializable
| Modifier and Type | Field and Description |
|---|---|
protected JSTypes |
commonTypes |
protected Node |
defSite |
protected String |
name |
protected JSType |
namespaceType |
protected com.google.javascript.jscomp.newtypes.PersistentMap<String,com.google.javascript.jscomp.newtypes.Property> |
otherProps |
| Modifier | Constructor and Description |
|---|---|
protected |
Namespace(JSTypes commonTypes,
String name,
Node defSite) |
| 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() |
void |
copyWindowProperties(JSTypes commonTypes,
RawNominalType win) |
Declaration |
getDeclaration(QualifiedName qname) |
Node |
getDefSite() |
String |
getName() |
JSType |
getPropDeclaredType(String pname) |
Namespace |
getSubnamespace(QualifiedName qname) |
boolean |
hasStaticProp(String pname) |
boolean |
hasSubnamespace(QualifiedName qname) |
boolean |
isDefined(QualifiedName qname) |
JSType |
toJSType() |
String |
toString() |
protected com.google.javascript.jscomp.newtypes.PersistentMap<String,com.google.javascript.jscomp.newtypes.Property> otherProps
protected final String name
protected final JSTypes commonTypes
protected JSType namespaceType
protected final Node defSite
protected abstract JSType computeJSType()
public final String getName()
public Node getDefSite()
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 hasStaticProp(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 JSType toJSType()
public final void copyWindowProperties(JSTypes commonTypes, RawNominalType win)
Copyright © 2009-2017 Google. All Rights Reserved.