{
    "content": [
        {
            "type": "text",
            "text": "# Data::FormValidator::ConstraintsFactory (perldoc)\n\n## NAME\n\nData::FormValidator::ConstraintsFactory - Module to create constraints for HTML::FormValidator.\n\n## SYNOPSIS\n\nuse Data::FormValidator::ConstraintsFactory qw( :set :bool );\nconstraints => {\nparam1 => makeorconstraint(\nmakenumsetconstraint( -1, ( 1 .. 10 ) ),\nmakesetconstraint( 1, ( 20 .. 30 ) ),\n),\nprovince => makewordsetconstraint( 1, \"AB QC ON TN NU\" ),\nbid  => makerangeconstraint( 1, 1, 10 ),\n}\n\n## DESCRIPTION\n\nThis module contains functions to help generate complex constraints.\n\n## Sections\n\n- **NAME**\n- **DESCRIPTION**\n- **SYNOPSIS**\n- **BOOLEAN CONSTRAINTS**\n- **SET CONSTRAINTS**\n- **NUMERICAL LOGICAL CONSTRAINTS**\n- **OTHER CONSTRAINTS**\n- **SEE ALSO**\n- **AUTHOR**\n- **COPYRIGHT**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Data::FormValidator::ConstraintsFactory",
        "section": "",
        "mode": "perldoc",
        "summary": "Data::FormValidator::ConstraintsFactory - Module to create constraints for HTML::FormValidator.",
        "synopsis": "use Data::FormValidator::ConstraintsFactory qw( :set :bool );\nconstraints => {\nparam1 => makeorconstraint(\nmakenumsetconstraint( -1, ( 1 .. 10 ) ),\nmakesetconstraint( 1, ( 20 .. 30 ) ),\n),\nprovince => makewordsetconstraint( 1, \"AB QC ON TN NU\" ),\nbid  => makerangeconstraint( 1, 1, 10 ),\n}",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [
            {
                "name": "FormValidator",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/FormValidator/3/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 11,
                "subsections": []
            },
            {
                "name": "BOOLEAN CONSTRAINTS",
                "lines": 13,
                "subsections": []
            },
            {
                "name": "SET CONSTRAINTS",
                "lines": 25,
                "subsections": []
            },
            {
                "name": "NUMERICAL LOGICAL CONSTRAINTS",
                "lines": 22,
                "subsections": []
            },
            {
                "name": "OTHER CONSTRAINTS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Data::FormValidator::ConstraintsFactory - Module to create constraints for HTML::FormValidator.\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This module contains functions to help generate complex constraints.\n\nIf you are writing new code, take a look at Data::FormValidator::Constraints::MethodsFactory\ninstead. It's a modern alternative to what's here, offering improved names and syntax.\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use Data::FormValidator::ConstraintsFactory qw( :set :bool );\n\nconstraints => {\nparam1 => makeorconstraint(\nmakenumsetconstraint( -1, ( 1 .. 10 ) ),\nmakesetconstraint( 1, ( 20 .. 30 ) ),\n),\nprovince => makewordsetconstraint( 1, \"AB QC ON TN NU\" ),\nbid  => makerangeconstraint( 1, 1, 10 ),\n}\n",
                "subsections": []
            },
            "BOOLEAN CONSTRAINTS": {
                "content": "Those constraints are available by using the \":bool\" tag.\n\nmakenotconstraint( $c1 )\nThis will create a constraint that will return the negation of the result of constraint $c1.\n\nmakeorconstraint( @constraints )\nThis will create a constraint that will return the result of the first constraint that return an\nnon false result.\n\nmakeandconstraint( @constraints )\nThis will create a constraint that will return the result of the first constraint that return an\nnon false result only if all constraints returns a non-false results.\n",
                "subsections": []
            },
            "SET CONSTRAINTS": {
                "content": "Those constraints are available by using the \":set\" tag.\n\nmakesetconstraint( $res, @elements )\nThis will create a constraint that will return $res if the value is one of the @elements set, or\nthe negation of $res otherwise.\n\nThe \"eq\" operator is used for comparison.\n\nmakenumsetconstraint( $res, @elements )\nThis will create a constraint that will return $res if the value is one of the @elements set, or\nthe negation of $res otherwise.\n\nThe \"==\" operator is used for comparison.\n\nmakewordsetconstraint( $res, $set )\nThis will create a constraint that will return $res if the value is a word in $set, or the\nnegation of $res otherwise.\n\nmakecmpsetconstraint( $res, $cmp, @elements )\nThis will create a constraint that will return $res if the value is one of the @elements set, or\nthe negation of $res otherwise.\n\n$cmp is a function which takes two argument and should return true or false depending if the two\nelements are equal.\n",
                "subsections": []
            },
            "NUMERICAL LOGICAL CONSTRAINTS": {
                "content": "Those constraints are available by using the \":num\" tag.\n\nmakeclampconstraint( $res, $low, $high )\nThis will create a constraint that will return $res if the value is between $low and $high\nbounds included or its negation otherwise.\n\nmakeltconstraint( $res, $bound )\nThis will create a constraint that will return $res if the value is lower than $bound, or the\nnegation of $res otherwise.\n\nmakeleconstraint( $res, $bound )\nThis will create a constraint that will return $res if the value is lower or equal than $bound,\nor the negation of $res otherwise.\n\nmakegtconstraint( $res, $bound )\nThis will create a constraint that will return $res if the value is greater than $bound, or the\nnegation of $res otherwise.\n\nmakegeconstraint( $res, $bound )\nThis will create a constraint that will return $res if the value is greater or equal than\n$bound, or the negation of $res otherwise.\n",
                "subsections": []
            },
            "OTHER CONSTRAINTS": {
                "content": "makelengthconstraint($maxlength)\nThis will create a constraint that will return true if the value has a length of less than or\nequal to $maxlength\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "Data::FormValidator(3)\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Author: Francis J. Lacoste <francis.lacoste@iNsu.COM> Maintainer: Mark Stosberg\n<mark@summersault.com>\n",
                "subsections": []
            },
            "COPYRIGHT": {
                "content": "Copyright (c) 2000 iNsu Innovations Inc. All rights reserved.\n\nThis program is free software; you can redistribute it and/or modify it under the terms as perl\nitself.\n",
                "subsections": []
            }
        }
    }
}