NAME
Fukurama::Class::Attribute::OOStandard - Plugin for code attributes
VERSION
Version 0.01 (alpha)
SYNOPSIS
package MyClass;
use Fukurama::Class::Attributes;
sub my_sub : Method(static|boolean|string,hashref) {
my $class = $_[0];
my $string = $_[1];
my $hashref = $_[2];
return 1;
}
DESCRIPTION
This plugin for Fukurama::Class::Attributes provides code attributes to declare and check method an constructor definitions at compiletime and parameter and return value checks at runtime.
CONFIG
You can define the check-level which describes how the module will check your declarations for methods and constructors. The following levels are allowed:
- $Fukurama::Class::Attributes::OOStandard::CHECK_LEVEL = $Fukurama::Class::Attributes::OOStandard::LEVEL_CHECK_NONE
-
There is no check. This level is recommended for production.
- $Fukurama::Class::Attributes::OOStandard::CHECK_LEVEL = $Fukurama::Class::Attributes::OOStandard::LEVEL_CHECK_SYNTAX
-
All registration processes are executed and the definitions of the code attributes would be checked at compiletime. This level is only for the sake of completeness.
- $Fukurama::Class::Attributes::OOStandard::CHECK_LEVEL = $Fukurama::Class::Attributes::OOStandard::LEVEL_CHECK_FORCE_INHERITATION
-
If you define a code attribute at the parent class, you have to define the same or extended in child class. You can only extend optional parameters and thighten the method access level. All other woud fail at compiletime.
- $Fukurama::Class::Attributes::OOStandard::CHECK_LEVEL = $Fukurama::Class::Attributes::OOStandard::LEVEL_CHECK_FORCE_ATTRIBUTES
-
The default behavior. You have to define code attributes for all methods in your class, except perl internals.
The runtime check for parameter and return values can be disabled by saying:
$Fukurama::Class::Attributes::OOStandard::DISABLE_RUNTIME_CHECK = 1;
This is recommended for production.
EXPORT
-
METHODS
- Constructor( subroutine_data:\HASH ) return:VOID
-
Code attribute, which defines a constructor subroutine.
- Method( subroutine_data:\HASH ) return:VOID
-
Code Attribute, which defines a method.
- check_inheritation( method_name:STRING, parent_class:CLASS, child_class:CLASS, inheritation_type:STRING ) return:VOID
-
Helper method to compare every method declarations for code attributes in your class whith all in the parent methods.
AUTHOR, BUGS, SUPPORT, ACKNOWLEDGEMENTS, COPYRIGHT & LICENSE
see perldoc of Fukurama::Class