Class FWChecker
java.lang.Object
net.simplace.sim.check.FWChecker
- Direct Known Subclasses:
DefaultChecker
Base class of custom checkers for check level CUSTOM:
FWCheckHelper delegates its checks to an instance of
the class given in the solution (attribute class). Subclasses need a constructor without parameters.- Author:
- Andreas Enders
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract NumbercheckLimits(FWSimVariable<?> aSource, Number aValue, Number aMin, Number aMax) Checks a value against its limits (nulllimits are ignored).protected abstract booleancheckParametersInScript(Collection<String> aAllowedFields, Collection<String> aForbiddenFields, String aJexlScript) Checks the parameters of a script: they must be in the allowed fields (if given) and not in the forbidden fields.protected abstract booleancheckSource(FWSimVariable<?> aTarget, FWSimFieldContainer aSimFieldContainer, FWSimFieldContainer aSource) Checks whether a variable may be written by the given component.protected abstract booleancheckWriteProtectionOnContentType(FWSimVariable<?> aTarget, FWSimVariable.CONTENT_TYPE aContentType, FWSimFieldContainer aSource) Checks whether the content type of a variable allows the given component to write it.
-
Constructor Details
-
FWChecker
public FWChecker()
-
-
Method Details
-
checkLimits
protected abstract Number checkLimits(FWSimVariable<?> aSource, Number aValue, Number aMin, Number aMax) throws SimValueOutOfRangeException Checks a value against its limits (nulllimits are ignored).- Parameters:
aSource- the variableaValue- the valueaMin- lower limit, may benullaMax- upper limit, may benull- Returns:
- the value to use (e.g. the value itself or a limit)
- Throws:
SimValueOutOfRangeException- to reject the value
-
checkSource
protected abstract boolean checkSource(FWSimVariable<?> aTarget, FWSimFieldContainer aSimFieldContainer, FWSimFieldContainer aSource) throws SimLinkInvalidException Checks whether a variable may be written by the given component.- Parameters:
aTarget- the variable writtenaSimFieldContainer- the owning component of the variableaSource- the writing component- Returns:
trueif writing is allowed- Throws:
SimLinkInvalidException- to reject the write access
-
checkWriteProtectionOnContentType
protected abstract boolean checkWriteProtectionOnContentType(FWSimVariable<?> aTarget, FWSimVariable.CONTENT_TYPE aContentType, FWSimFieldContainer aSource) throws SimLinkInvalidException Checks whether the content type of a variable allows the given component to write it.- Parameters:
aTarget- the variable writtenaContentType- content type of the variableaSource- the writing component- Returns:
trueif writing is allowed- Throws:
SimLinkInvalidException- to reject the write access
-
checkParametersInScript
protected abstract boolean checkParametersInScript(Collection<String> aAllowedFields, Collection<String> aForbiddenFields, String aJexlScript) Checks the parameters of a script: they must be in the allowed fields (if given) and not in the forbidden fields.- Parameters:
aAllowedFields- allowed parameter names, ornullaForbiddenFields- forbidden parameter names, ornullaJexlScript- the script- Returns:
trueif the check passed
-