protected function getItemSanityCheck($itemName)
    {
        $model = $this->getFile()->getModelFromStructAttribute($this->getAttribute());
        $sanityCheck = 'false';
        if ($model instanceof Struct && !$model->isList() && ($model->isStruct() || ($model->isArray() && $model->getInheritanceStruct() instanceof Struct))) {
            $sanityCheck = sprintf('!$%s instanceof %s', $itemName, $this->getFile()->getStructAttributeType($this->getAttribute(), true));
        } else {
            $type = AbstractModelFile::getPhpType($this->getFile()->getStructAttributeType($this->getAttribute()));
            if ($rule = $this->getRules()->getRule($type)) {
                $sanityCheck = $rule->testConditions($itemName, null, true);
            }
        }
        return $sanityCheck;
    }