public function setExpression(Expression $expression)
    {
        $expectedType = $this->getExpressionType();
        
        if (ReflectionUtils::isInstanceOf($expression, $expectedType) === true) {
            $this->expression = $expression;
        } else {
            $procClass = get_class($this);
            $givenType = get_class($expression);
            $msg = "The ${procClass} Expression Processor only processes ${expectedType} Expression objects, ${givenType} given.";
            throw new InvalidArgumentException($msg);
        }
        
        $this->expression = $expression;
    }
public function setExpression(Expression $expression)
    {
        $expectedType = $this->getExpressionType();
        
        if (ReflectionUtils::isInstanceOf($expression, $expectedType) === true) {
            $this->expression = $expression;
        } else {
            $procClass = get_class($this);
            $givenType = get_class($expression);
            $msg = "The ${procClass} Expression Processor only processes ${expectedType} Expression objects, ${givenType} given.";
            throw new InvalidArgumentException($msg);
        }
        
        $this->expression = $expression;
    }
public function setExpression ( Expression $ expression ) { $ expectedType = $ this -> getExpressionType ( ) ; if ( ReflectionUtils :: isInstanceOf ( $ expression , $ expectedType ) === true ) { $ this -> expression = $ expression ; } else { $ procClass = get_class ( $ this ) ; $ givenType = get_class ( $ expression ) ; $ msg = "The ${procClass} Expression Processor only processes ${expectedType} Expression objects, ${givenType} given." ; throw new InvalidArgumentException ( $ msg ) ; } $ this -> expression = $ expression ; }
Set the QTI Data Model Expression to be processed.

@param \qtism\data\expressions\Expression $expression A QTI Data Model Expression object.
@throws \InvalidArgumentException If $expression is not a subclass nor implements the Expression type returned by the getExpressionType method.
Set the QTI Data Model Expression to be processed .