JSORB::Reflector::Class - Automatic JSORB namespace/interface construction


JSORB documentation Contained in the JSORB distribution.

Index


Code Index:

NAME

Top

JSORB::Reflector::Class - Automatic JSORB namespace/interface construction

DESCRIPTION

Top

This uses Moose/Class::MOP introspection to build a JSORB namespace. It fully respects inheritance and will reflect all applicable methods of the class.

NOTE ABOUT REFLECTION

The automated reflector will NOT reflect methods in Moose::Object. This is because this rarely makes sense for it to do so. If you have a particular use case in which this does make sense, then you are free to specifically request the method by building the procedure list yourself.

BUGS

Top

All complex software has bugs lurking in it, and this module is no exception. If you find a bug please either email me, or add the bug to cpan-RT.

AUTHOR

Top

Stevan Little <stevan.little@iinteractive.com>

COPYRIGHT AND LICENSE

Top


JSORB documentation Contained in the JSORB distribution.

package JSORB::Reflector::Class;
use Moose;

our $VERSION   = '0.04';
our $AUTHORITY = 'cpan:STEVAN';

extends 'JSORB::Reflector::Package';

has '+introspector' => (isa => 'Class::MOP::Class');

has '+procedure_class_name' => (
    default => sub { 'JSORB::Method' },
);

sub build_procedure_list {
    my $self = shift;
    return [ 
        map { 
            $_->package_name eq 'Moose::Object'
                ? ()
                : +{ name => $_->name } 
        } $self->introspector->get_all_methods
    ]
}

__PACKAGE__->meta->make_immutable;

no Moose; 1;

__END__