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.ICtxpublic Map<Object,Object> getProps(String name, Backtrace bt)
getProps in interface Compiler.ICtxpublic Object getProp(String name, Object prop, Backtrace bt)
getProp in interface Compiler.ICtxpublic void putProp(String name, Object pkey, Object pval)
putProp in interface Compiler.ICtxname - variable namepkey - property keypval - property valuepublic void putProps(String name, Object... pobjs)
putProps in interface Compiler.ICtxname - of variablepobjs - list of pairs (property name, property value)public void putProps(String name, Map<Object,Object> newProps)
putProps in interface Compiler.ICtxpublic void onMissingVar(String varname)
onMissingVar in interface Compiler.ICtxpublic void setMissHandler(Compiler.IMissHandler handler)
public Compiler.IMissHandler getMissHandler()
public Object get(String name, Backtrace bt)
get in interface Compiler.ICtxprotected 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.ICtxpublic void put(String name, Object expr)
put in interface Compiler.ICtxpublic Compiler getCompiler()
getCompiler in interface Compiler.ICtxpublic String toString()
public String toStringSelf()
toStringSelf in interface Compiler.ICtxpublic String toStringShort()
toStringShort in interface Compiler.ICtxpublic Compiler.ICtx getPrev()
getPrev in interface Compiler.ICtxpublic Compiler.ICtx getLevel0()
getLevel0 in interface Compiler.ICtxpublic Map<String,Object> getMappings()
getMappings in interface Compiler.ICtxpublic void replace(String name, Object value)
replace in interface Compiler.ICtxpublic void greplace(String name, Object value)
greplace in interface Compiler.ICtxpublic List<Compiler.ICtx> getParentContexts()
getParentContexts in interface Compiler.ICtxpublic Map<String,Object> findMatches(String patternStr)
findMatches in interface Compiler.ICtxpublic void addMatches(Map<String,Object> matches, String pattern)
addMatches in interface Compiler.ICtxpublic void remove(String name)
remove in interface Compiler.ICtxCopyright © 2022. All rights reserved.