Class DefaultRuleTransformer
java.lang.Object
net.simplace.sim.io.FWSimIOAdapter
net.simplace.sim.io.resources.FWSimInputAdapter
net.simplace.sim.io.resources.FWSimResourceTransformer
net.simplace.sim.transformers.DefaultRuleTransformer
- All Implemented Interfaces:
FWSimFieldContainer
Transforms the cache of a source resource line by line with rules: for each data line of the source, the values are
set to the source variables in a copy of the variable map, and each header variable of the transformer is
calculated by its rule (or copied from the source column of the same name if it has no rule). The result has the
same keys as the source.
- Author:
- Andreas Enders
-
Nested Class Summary
Nested classes/interfaces inherited from class FWSimIOAdapter
FWSimIOAdapter.FREQUENCE -
Field Summary
Fields inherited from class FWSimResourceTransformer
iFieldMap, iIntColumnMap, iLastInputValuesMap, iLastProjectID, iLastUniqueID, iPoolName, iSourceNameFields inherited from class FWSimInputAdapter
iJexlScript, iShouldCacheToDBFields inherited from class FWSimIOAdapter
iArrayMode, iFieldcount, iFrequence, iHeaderVariables, iInterface, iJexlRule, iKeyMap, iName, iOrderNumber, iProcessTime, iResourceElement, iSession, iSourceKey -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for instantiation via reflection (documentation).DefaultRuleTransformer(FWSimSession aSession, Integer aOrderNumber) Creates the transformer without element (seeFWSimResourceTransformer(FWSimSession, Integer)).DefaultRuleTransformer(FWSimSession aSession, org.jdom2.Element aResourceElement, Integer aOrderNumber) Creates the transformer from itstransformelement. -
Method Summary
Modifier and TypeMethodDescriptionHashMap<String, FWSimVariable<?>> The transformer has no own input variables; returns the (empty) input map.Returnsres.getData(FWSimVarMap aVarMap) Calculates the transformed cache from the cache of the source resource, line by line.voidupdateFields(FWObservable aObservable) Nothing to take over from the form.Methods inherited from class FWSimResourceTransformer
addVariable, createFormFields, createResourceTransformer, createResourceTransformer, createResourceTransformer, createResourceTransformer, createSimTransformer, fillVarMap, getCreateFormXML, getEditFormXML, getSourceResourceCache, getVariable, isUpdated, toDocXML, toXMLMethods inherited from class FWSimInputAdapter
getInputVariables, getJexlScript, getOutputVariables, getVarMap, isTransformer, setFrequenceAndRule, shouldCacheToDB, toHTMLTablestringMethods inherited from class FWSimIOAdapter
addProcessTime, checkCondition, createFormFields, finalize, getFieldMap, getFrequence, getHeaderVariables, getHeaderXML, getInterface, getJexlRule, getKeyMap, getName, getOrderNumber, isArrayMode, isConditionCheck, removeVariable, setInterface, setOrderNumber, toString, writeHeaderList
-
Constructor Details
-
DefaultRuleTransformer
public DefaultRuleTransformer(FWSimSession aSession, org.jdom2.Element aResourceElement, Integer aOrderNumber) Creates the transformer from itstransformelement.- Parameters:
aSession- the sessionaResourceElement- thetransformelementaOrderNumber- order number of the transformer
-
DefaultRuleTransformer
Creates the transformer without element (seeFWSimResourceTransformer(FWSimSession, Integer)).- Parameters:
aSession- the sessionaOrderNumber- order number of the transformer
-
DefaultRuleTransformer
public DefaultRuleTransformer()Constructor for instantiation via reflection (documentation).
-
-
Method Details
-
createVariables
The transformer has no own input variables; returns the (empty) input map.- Specified by:
createVariablesin interfaceFWSimFieldContainer- Overrides:
createVariablesin classFWSimIOAdapter- Returns:
- the variables, keyed by name
- See Also:
-
getData
Calculates the transformed cache from the cache of the source resource, line by line.- Specified by:
getDatain classFWSimInputAdapter- Parameters:
aVarMap- variable map of the simulation (e.g. for the key values of the rule)- Returns:
- the cache containing the data read
- Throws:
MissingSimResourceException- declared; a missing source cache currently leads to aNullPointerException- See Also:
-
getContentType
Returnsres.- Specified by:
getContentTypein interfaceFWSimFieldContainer- Overrides:
getContentTypein classFWSimInputAdapter- Returns:
- the content type of the variables of this container (e.g.
sys,mgm) - See Also:
-
updateFields
Nothing to take over from the form.- Specified by:
updateFieldsin classFWSimResourceTransformer- Parameters:
aObservable- the form data- See Also:
-