public class Compiler.Ctx extends Object implements Compiler.ICtx
Constructor and Description |
---|
Ctx()
Build empty context.
|
Ctx(Compiler.ICtx prev)
Create child context linking to previous context.
|
Ctx(Compiler.ICtx locals,
Compiler.ICtx ctx)
Create child context linking to ctx as previous context and adding all local mapping from the
locals context.
|
Ctx(Compiler.ICtx prev,
Map<String,Object> vars) |
Ctx(Compiler.ICtx prev,
Map<String,Object> vars,
boolean roCtx)
Make context based on parent context and map of value mappings.
|
Ctx(Map<String,Object> vars) |
public Ctx(Compiler.ICtx prev, Map<String,Object> vars)
public Ctx(Compiler.ICtx prev, Map<String,Object> vars, boolean roCtx)
If roCtx is true will be created context with empty mappings with parentcontext as described above.
prev
- Parent contextvars
- Variable mappingsroCtx
- make extra child context.public Ctx()
public Ctx(Compiler.ICtx prev)
public Ctx(Compiler.ICtx locals, Compiler.ICtx ctx)
protected void initCtxSettings()
public Map<String,Map<Object,Object>> getPropsMap()
getPropsMap
in interface Compiler.ICtx
public Map<Object,Object> getProps(String name, Backtrace bt)
getProps
in interface Compiler.ICtx
public Object getProp(String name, Object prop, Backtrace bt)
getProp
in interface Compiler.ICtx
public void putProp(String name, Object pkey, Object pval)
putProp
in interface Compiler.ICtx
name
- variable namepkey
- property keypval
- property valuepublic void putProps(String name, Object... pobjs)
putProps
in interface Compiler.ICtx
name
- of variablepobjs
- list of pairs (property name, property value)public void putProps(String name, Map<Object,Object> newProps)
putProps
in interface Compiler.ICtx
public void onMissingVar(String varname)
onMissingVar
in interface Compiler.ICtx
public void setMissHandler(Compiler.IMissHandler handler)
public Compiler.IMissHandler getMissHandler()
public Object get(String name, Backtrace bt)
get
in interface Compiler.ICtx
protected Compiler.ICtx findCtxFor(String name)
protected Compiler.ICtx findCtxOrLocal(String name)
protected Compiler.ICtx findCtxOrGlobal(String name)
public boolean contains(String name)
contains
in interface Compiler.ICtx
public void put(String name, Object expr)
put
in interface Compiler.ICtx
public Compiler getCompiler()
getCompiler
in interface Compiler.ICtx
public String toString()
public String toStringSelf()
toStringSelf
in interface Compiler.ICtx
public String toStringShort()
toStringShort
in interface Compiler.ICtx
public Compiler.ICtx getPrev()
getPrev
in interface Compiler.ICtx
public Compiler.ICtx getLevel0()
getLevel0
in interface Compiler.ICtx
public Map<String,Object> getMappings()
getMappings
in interface Compiler.ICtx
public void replace(String name, Object value)
replace
in interface Compiler.ICtx
public void greplace(String name, Object value)
greplace
in interface Compiler.ICtx
public List<Compiler.ICtx> getParentContexts()
getParentContexts
in interface Compiler.ICtx
public Map<String,Object> findMatches(String patternStr)
findMatches
in interface Compiler.ICtx
public void addMatches(Map<String,Object> matches, String pattern)
addMatches
in interface Compiler.ICtx
public void remove(String name)
remove
in interface Compiler.ICtx
Copyright © 2022. All rights reserved.