public static function buildValidation(array $schema, $name = null)
    {
        $validation = new NestedValidation($name);

        foreach ($schema as $key => $value) {

            if (!is_array($value)) {
                trigger_error('parsing error', E_USER_ERROR);
            }

            if (self::isNestedValidation($value)) {
                $validation->addValidation(self::buildValidation($value, $key));
            } else {
                $validation->addValidation(self::buildKeyValidation($value, $key));
            }

        }
        return $validation;
    }