Class ReturnTypeChecker


  • public class ReturnTypeChecker
    extends java.lang.Object
    Author:
    Emmanuel Duchastenier
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void checkReturnType​(SExpression expression, java.lang.Object result, java.util.Map<java.lang.String,​java.lang.Object> context)
      Check if the declared return type is compatible with the real Expression evaluation return type.
      static boolean isConvertible​(java.lang.String targetType, java.lang.String sourceType)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ReturnTypeChecker

        public ReturnTypeChecker()
    • Method Detail

      • checkReturnType

        public void checkReturnType​(SExpression expression,
                                    java.lang.Object result,
                                    java.util.Map<java.lang.String,​java.lang.Object> context)
                             throws SExpressionEvaluationException
        Check if the declared return type is compatible with the real Expression evaluation return type. If the result of the Expression evaluation is null, then this method returns true.
        Parameters:
        expression - the evaluated expression
        result - the expression result to check
        Throws:
        SExpressionEvaluationException - if the condition is not fulfilled, does nothing otherwise
      • isConvertible

        public static boolean isConvertible​(java.lang.String targetType,
                                            java.lang.String sourceType)