NAME
Data::TreeValidator::Branch - A branch of tree validation
DESCRIPTION
Represents a branch in the tree, ie something that has child nodes. Almost all your validation specifications will have at least one tree (unless it really only takes a single piece of input).
METHODS
children
Returns a list of all child nodes of this branch
child_names
Returns the names of all child nodes for this branch
add_child($name => $value)
Adds a child to the branch, with the name $name
and value $value
child($name)
Returns the child with name $name
, or undef
process($input)
Takes the input in $input
and validates it against this branch. The general process here is to enumerate over each child of this branch, and fetch the corresponding data from $input
and process that.
Returns a Data::TreeValidator:::Result::Branch, which can be inspected to determine if the branch validated, and for clean data.
AUTHOR
Oliver Charles
COPYRIGHT AND LICENSE
This software is copyright (c) 2012 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.