Class Symbol
- java.lang.Object
-
- org.sonar.plugins.javascript.api.symbols.Symbol
-
@Beta public class Symbol extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSymbol.Kind
-
Constructor Summary
Constructors Constructor Description Symbol(String name, Symbol.Kind kind, Scope scope)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddType(Type type)voidaddTypes(Set<Type> type)voidaddUsage(IdentifierTree identifierTree, Usage.Kind usageKind)booleanexternal()booleanis(Symbol.Kind kind)booleanisVariable()Symbol.Kindkind()Stringname()Scopescope()SymbolsetExternal(boolean external)voidsetKind(Symbol.Kind kind)StringtoString()TypeSettypes()Collection<Usage>usages()
-
-
-
Constructor Detail
-
Symbol
public Symbol(String name, Symbol.Kind kind, Scope scope)
-
-
Method Detail
-
addUsage
public void addUsage(IdentifierTree identifierTree, Usage.Kind usageKind)
-
usages
public Collection<Usage> usages()
-
setExternal
public Symbol setExternal(boolean external)
-
scope
public Scope scope()
-
name
public String name()
-
external
public boolean external()
- Returns:
- true if symbol is coming from global project context and/or is created implicitly by interpreter (e.g. "window" for browser environment or "arguments" for each function scope)
-
is
public boolean is(Symbol.Kind kind)
-
kind
public Symbol.Kind kind()
-
setKind
public void setKind(Symbol.Kind kind)
-
addType
public void addType(Type type)
-
types
public TypeSet types()
-
isVariable
public boolean isVariable()
- Returns:
- true if symbol created with var, let or const keywords or implicitly
-
-