Class FWParameterContext
java.lang.Object
net.simplace.core.jexl.FWParameterContext
- All Implemented Interfaces:
org.apache.commons.jexl3.JexlContext
- Direct Known Subclasses:
MapParameterContext, SimVarMapParameterContext
public abstract class FWParameterContext
extends Object
implements org.apache.commons.jexl3.JexlContext
Source of the parameter values for
FWParameterResolver: the values of the pipeline map (GUI, pipelines,
data readers) or of a simulation variable map, plus the special parameters, which are the same for all sources.
As JexlContext it provides the variables of JEXL expressions (control attributes, rules). Names may use
__ instead of . (as produced by JexlRuleScript from ${a.b}).
Assignments within an expression only change a local variable of this context, never the source.
Special parameters (see getSpecialText(String)):
- directories:
_WORKDIR_,_DATADIR_,_PROJECTSDIR_(also_PROJECTDIR_),_OUTPUTDIR_(fromFWSimEngine),_CACHEDIR_(fromFilePathHelper),_TEMPDIR_(alsoTEMPDIR; a new random temporary directory, which is stored as parameterTEMPDIRand reused) - time:
_DATE_,_DATETIME_,_MILLIS_ - runtime:
_MAX_MEMORY_,_FREE_MEMORY_(both in MB),_PROCESSORS_ LOCAL: language of the current locale (en, de or fr; otherwise de)_PROJECTLINES_: first-last project line (simulations only)$name$: Java runtime property,SETTINGS...: system setting
- Author:
- Andreas Enders
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.commons.jexl3.JexlContext
org.apache.commons.jexl3.JexlContext.AnnotationProcessor, org.apache.commons.jexl3.JexlContext.CancellationHandle, org.apache.commons.jexl3.JexlContext.ClassNameResolver, org.apache.commons.jexl3.JexlContext.ModuleProcessor, org.apache.commons.jexl3.JexlContext.NamespaceFunctor, org.apache.commons.jexl3.JexlContext.NamespaceResolver, org.apache.commons.jexl3.JexlContext.OptionsHandle, org.apache.commons.jexl3.JexlContext.PragmaProcessor, org.apache.commons.jexl3.JexlContext.ThreadLocal -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract booleanprotected Objectprotected abstract Objectprotected Integer[]getSpecialText(String aName) Resolves a special parameter (see class description).protected abstract Stringbooleanstatic booleanisSpecialName(String aName) resolveText(String aName) voidprotected abstract voidStores the temporary directory created by_TEMPDIR_in the source.protected static StringtoParameterName(String aJexlName)
-
Field Details
-
TEMPDIR
name of the parameter that keeps the temporary directory of_TEMPDIR_- See Also:
-
-
Constructor Details
-
FWParameterContext
public FWParameterContext()
-
-
Method Details
-
getText
-
getObject
-
contains
- Parameters:
aName- parameter name- Returns:
trueif the source has the parameter
-
store
-
getProjectLines
- Returns:
- the project lines of the current simulation, or
nulloutside of simulations
-
getLogSource
- Returns:
- the object named as source in log messages
-
isSpecialName
- Parameters:
aName- parameter name- Returns:
trueif the name is reserved for special parameters: it starts with_,$orSETTINGS, or isTEMPDIRorLOCAL
-
getSpecialText
-
resolveText
-
has
- Specified by:
hasin interfaceorg.apache.commons.jexl3.JexlContext
-
get
-
set
-
toParameterName
-