2 package Moose::Meta::Method::Accessor;
9 use base 'Moose::Meta::Method',
10 'Class::MOP::Method::Accessor';
12 # multiple inheritance is terrible
14 goto &Class::MOP::Method::Accessor::new;
18 goto &Class::MOP::Method::Accessor::_new;
23 return $self->associated_attribute
24 if ref($self) && defined($self->associated_attribute);
25 return $self->SUPER::_error_thrower;
32 $self->SUPER::_compile_code(@args);
36 'Could not create writer for '
37 . "'" . $self->associated_attribute->name . "' "
44 sub _eval_environment {
46 return $self->associated_attribute->_eval_environment;
49 sub _instance_is_inlinable {
51 return $self->associated_attribute->associated_class->instance_metaclass->is_inlinable;
54 sub _generate_reader_method {
56 $self->_instance_is_inlinable ? $self->_generate_reader_method_inline(@_)
57 : $self->SUPER::_generate_reader_method(@_);
60 sub _generate_writer_method {
62 $self->_instance_is_inlinable ? $self->_generate_writer_method_inline(@_)
63 : $self->SUPER::_generate_writer_method(@_);
66 sub _generate_accessor_method {
68 $self->_instance_is_inlinable ? $self->_generate_accessor_method_inline(@_)
69 : $self->SUPER::_generate_accessor_method(@_);
72 sub _generate_predicate_method {
74 $self->_instance_is_inlinable ? $self->_generate_predicate_method_inline(@_)
75 : $self->SUPER::_generate_predicate_method(@_);
78 sub _generate_clearer_method {
80 $self->_instance_is_inlinable ? $self->_generate_clearer_method_inline(@_)
81 : $self->SUPER::_generate_clearer_method(@_);
84 sub _writer_value_needs_copy {
85 shift->associated_attribute->_writer_value_needs_copy(@_);
89 shift->associated_attribute->_inline_tc_code(@_);
92 sub _inline_check_coercion {
93 shift->associated_attribute->_inline_check_coercion(@_);
96 sub _inline_check_constraint {
97 shift->associated_attribute->_inline_check_constraint(@_);
100 sub _inline_check_lazy {
101 shift->associated_attribute->_inline_check_lazy(@_);
104 sub _inline_store_value {
105 shift->associated_attribute->_inline_instance_set(@_) . ';';
108 sub _inline_get_old_value_for_trigger {
109 shift->associated_attribute->_inline_get_old_value_for_trigger(@_);
112 sub _inline_trigger {
113 shift->associated_attribute->_inline_trigger(@_);
117 shift->associated_attribute->_inline_instance_get(@_);
121 shift->associated_attribute->_inline_instance_has(@_);
126 # ABSTRACT: A Moose Method metaclass for accessors
134 This class is a subclass of L<Class::MOP::Method::Accessor> that
135 provides additional Moose-specific functionality, all of which is
138 To understand this class, you should read the the
139 L<Class::MOP::Method::Accessor> documentation.
143 See L<Moose/BUGS> for details on reporting bugs.