Package net.simplace.sim.check
Class FWCheckHelper
java.lang.Object
net.simplace.sim.check.FWCheckHelper
Checks the setting of values and other tasks in the system due to 4 different checking levels.
Main idea of the levels is explained in
FWCheckHelper.CHECK_LEVEL
.- Author:
- Andreas Enders
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionFWCheckHelper
(FWCheckHelper.CHECK_LEVEL aLevel, String aCustomCheckerClassName, FWSimSession aSession) -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkCondition
(Boolean aCheckResult, String aMessage, FWSimFieldContainer aInstance) Called from inside the FWSimFieldContainer to log the initialization Errors.checkLimits
(FWSimVariable<?> aSource, Number aValue, Number aMin, Number aMax) Returns false if aValue is NaN or outside limits.boolean
checkOnlyMode
(String aSimulationID) boolean
checkParametersInScript
(Collection<String> aAllowedFields, Collection<String> aForbiddenFields, String aJexlScript, FWSimFieldContainer aSource) Returns false if the content type makes the variable write protectedboolean
checkResource
(Map<String, FWSimInputAdapter> aResourceCreators, FWSimVarMap aVarMap, Map<String, FWSimResourceCache> aResourcesCacheMap) boolean
checkSource
(FWSimVariable<?> aTarget, FWSimFieldContainer aSimFieldContainer, FWSimFieldContainer aSource) Returns false if the owning container: .boolean
checkWriteProtectionOnContentType
(FWSimVariable<?> aTarget, FWSimVariable.CONTENT_TYPE aContentType, FWSimFieldContainer aSource) Returns false if the content type makes the variable write protectedvoid
finalize()
boolean
void
setCheckLevel
(FWCheckHelper.CHECK_LEVEL aCheckLevel)
-
Constructor Details
-
FWCheckHelper
public FWCheckHelper(FWCheckHelper.CHECK_LEVEL aLevel, String aCustomCheckerClassName, FWSimSession aSession) - Parameters:
aLevel
-aCustomCheckerClassName
-aSession
-
-
-
Method Details
-
getCheckLevel
- Returns:
- the checkLevel
-
setCheckLevel
- Parameters:
aCheckLevel
- the checkLevel to set
-
checkLimits
public Number checkLimits(FWSimVariable<?> aSource, Number aValue, Number aMin, Number aMax) throws SimValueOutOfRangeException Returns false if aValue is NaN or outside limits. Limits that are null are ignored.- Parameters:
aSource
-aValue
-aMin
-aMax
-- Returns:
- if limits are checked valid - if level < LAZY no check is performed (return true)
- Throws:
SimValueOutOfRangeException
-
checkSource
public boolean checkSource(FWSimVariable<?> aTarget, FWSimFieldContainer aSimFieldContainer, FWSimFieldContainer aSource) throws SimLinkInvalidException Returns false if the owning container: .- Parameters:
aTarget
-aSimFieldContainer
- is same as the writing sourceaSource
-- Returns:
- if check is valid - if level < LAZY no check is performed (return true)
- Throws:
SimLinkInvalidException
-
checkWriteProtectionOnContentType
public boolean checkWriteProtectionOnContentType(FWSimVariable<?> aTarget, FWSimVariable.CONTENT_TYPE aContentType, FWSimFieldContainer aSource) throws SimLinkInvalidException Returns false if the content type makes the variable write protected- Parameters:
aTarget
-aContentType
-aSource
-- Returns:
- if check is valid - if level < LAZY no check is performed (return true)
- Throws:
SimLinkInvalidException
-
checkResource
public boolean checkResource(Map<String, FWSimInputAdapter> aResourceCreators, FWSimVarMap aVarMap, Map<String, FWSimResourceCache> aResourcesCacheMap) -
isConditionCheck
public boolean isConditionCheck() -
checkCondition
Called from inside the FWSimFieldContainer to log the initialization Errors.- Parameters:
aCheckResult
-aMessage
-aInstance
-
-
checkOnlyMode
-
checkParametersInScript
public boolean checkParametersInScript(Collection<String> aAllowedFields, Collection<String> aForbiddenFields, String aJexlScript, FWSimFieldContainer aSource) Returns false if the content type makes the variable write protected- Parameters:
aAllowedFields
-aForbiddenFields
-aJexlScript
-aContentType
-aSource
-- Returns:
- if check is valid - if level < LAZY no check is performed (return true)
-
finalize
public void finalize()
-