| Tree::Simple::Visitor::LoadClassHierarchy(3pm) | User Contributed Perl Documentation | Tree::Simple::Visitor::LoadClassHierarchy(3pm) |
Tree::Simple::Visitor::LoadClassHierarchy - A Visitor for loading class hierarchies into a Tree::Simple hierarchy
use Tree::Simple::Visitor::LoadClassHierarchy;
# create an visitor
my $visitor = Tree::Simple::Visitor::LoadClassHierarchy->new();
# set class as an instance, or
$visitor->setClass($class);
# as a package name
$visitor->setClass("My::Class");
# pass our visitor to the tree
$tree->accept($visitor);
# the $tree now mirrors the inheritance hierarchy of the $class
This visitor will traverse a class's inheritance hierarchy (through the @ISA arrays) and create a Tree::Simple hierarchy which mirrors it.
NOTE: Methods are sorted ascii-betically before they are added to the tree. This allows a more predictable hierarchy.
The $tree argument which is passed to "visit" must be a leaf node. This is because this Visitor will create all the sub-nodes for this tree. If the tree is not a leaf, an exception is thrown. We do not require the tree to be a root though, and this Visitor will not affect any nodes above the $tree argument.
<https://github.com/ronsavage/Tree-Simple-VisitorFactory>
Bugs should be reported via the CPAN bug tracker at
<https://github.com/ronsavage/Tree-Simple-VisitorFactory/issues>
See the CODE COVERAGE section in Tree::Simple::VisitorFactory for more information.
These Visitor classes are all subclasses of Tree::Simple::Visitor, which can be found in the Tree::Simple module, you should refer to that module for more information.
stevan little, <stevan@iinteractive.com>
Copyright 2004, 2005 by Infinity Interactive, Inc.
<http://www.iinteractive.com>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| 2022-11-19 | perl v5.36.0 |