NAME

Data::TreeValidator::Leaf - Represents a single leaf node in the validation tree specification

DESCRIPTION

Represents a leaf in a tree, that is - a single atomic value. At some point all branches will reduce to these nodes.

METHODS

constraints

Returns an array of all constraints for this leaf.

add_constraint

Adds a constraint to this leaf, at the end of the list

transformations

Returns an array of all transformations for this leaf.

add_transformation

Adds a transformation for this leaf, at the end of the list

process($input)

Takes $input, and matches it against all the constraints for this leaf. If they all pass (that is, none throw exceptions), then $input is passed through all leaf transformations.

AT the end of processing, a Data::TreeValidator::Result::Leaf object is returned. This can be inspected to determine if validation was sucessful, and obtain clean data.

AUTHOR

Oliver Charles

COPYRIGHT AND LICENSE

This software is copyright (c) 2010 by Oliver Charles <oliver.g.charles@googlemail.com>.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.