NAME

Fukurama::Class::Tree - Helper-class to register class-handler

VERSION

Version 0.01 (alpha)

SYNOPSIS

 my $BUILD_HANDLER = sub {
 	my $classname = $_[0];
 	my $classdef = $_[1];
 
	no strict 'refs';
	 
 	$classdef->{'implements'} = \@{$classname . '::INTERFACES'};
 	return;
 };
 my $CHECK_HANDLER = sub {
 	my $classname = $_[0];
 	my $classdef = $_[1];
 
 	my $paths = $classdef->{'implements'};
 	return if(ref($paths) ne 'ARRAY');
	# Do what ever you want (for interfaces, see Fukurama::Class::Implements)
	# ...
	return;
 };
 Fukurama::Class::Tree->register_build_handler($BUILD_HANDLER);
 Fukurama::Class::Tree->register_check_handler($CHECK_HANDLER);

DESCRIPTION

This module register class-definitions, read the inheritation-trees and execute checks to the registered class-defintions. You can register handler to create you own class defintions and handler to check something at this classes. It's a central helper class for most of Fukurama::Class - modules.

CONFIG

-

EXPORT

-

METHODS

get_all_subs( class:STRING ) return:STRING()

Get all methods from the given class.

get_class_subs( class:STRING ) return:STRING[]

Get all methods for the given class. It omit all special-methods. See is_special_sub().

get_inheritation_path( class:STRING ) return:[ STRING[] ]

Return all inheritation class-paths for the given class. For example, if a class MyClass (multiple-)inherit from ParentA and ParentB, it will return these two inheritation-class-paths. If the given class doesn't use any multi inheritation, you will get an arrayref with one classpath and these classpath will be an array of all parents and grandparents etc. the given class.

is_special_sub( subname:STRING ) return:BOOLEAN

Check, if the given subroutine(-name) is from an special method which is used perl "magically". For example it returns true for import(), unimport(), DESTROY() etc.

register_build_handler( handler:CODE ) return:VOID

Register a handler subroutine to build your own class-defintion. For example you can implement an own syntax to define interface-implementations. The build-handler takes two parameters: the name and the definition-hash (which you can extend) for each loaded class.

register_check_handler( handler:CODE ) return:VOID

Register a handler subroutine to check the classes. For example you can check an self-defined interface syntax. The check-handler takes two parameters: the name and the definition-hash, which was build via bild-handler, for each loaded class.

run_check() return:VOID

Helper method for static perl (see Fukurama::Class > BUGS) This method will find all loades classes, run all registered build-handler for each loaded class and, when this is finished, it runs all registered check-handler (even for each loaded class).

AUTHOR, BUGS, SUPPORT, ACKNOWLEDGEMENTS, COPYRIGHT & LICENSE

see perldoc of Fukurama::Class