Class FWChecker

java.lang.Object
net.simplace.sim.check.FWChecker
Direct Known Subclasses:
DefaultChecker

public abstract class FWChecker extends Object
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 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 (null limits are ignored).
      Parameters:
      aSource - the variable
      aValue - the value
      aMin - lower limit, may be null
      aMax - upper limit, may be null
      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 written
      aSimFieldContainer - the owning component of the variable
      aSource - the writing component
      Returns:
      true if 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 written
      aContentType - content type of the variable
      aSource - the writing component
      Returns:
      true if 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, or null
      aForbiddenFields - forbidden parameter names, or null
      aJexlScript - the script
      Returns:
      true if the check passed