Mercurial > pub > Impl
view Lib/IMPL/Class/Property/Accessor.pm @ 197:6b1dda998839
Added IMPL::declare, IMPL::require, to simplify module definitions
IMPL::Transform now admires object inheritance while searching for the transformation
Added HTTP some exceptions
IMPL::Web::Application::RestResource almost implemented
author | sergey |
---|---|
date | Thu, 19 Apr 2012 02:10:02 +0400 |
parents | 4d0e1962161c |
children | 6253872024a4 |
line wrap: on
line source
package IMPL::Class::Property::Accessor; use strict; use parent qw(IMPL::Class::Property::Base); sub factoryParams { $_[0]->SUPER::factoryParams, qw($field); } sub RemapFactoryParams { my ($self,$propInfo) = @_; return $self->SUPER::RemapFactoryParams($propInfo),$propInfo->Name; } sub GenerateGet { 'return $this->get($field);'; } sub GenerateSet { 'return $this->set($field,@_);'; } sub GenerateSetList { 'my $val = IMPL::Object::List->new( (@_ == 1 and UNIVERSAL::isa($_[0], \'ARRAY\') ) ? $_[0] : [@_] ); $this->set($field,$val); return( wantarray ? @{ $val } : $val );'; } sub GenerateGetList { 'my $val = $this->get($field); $this->set($field,$val = IMPL::Object::List->new()) unless $val; return( wantarray ? @{ $val } : $val );'; } 1;