Add ARM files
[dh-make-perl] / dev / arm / libperl-critic-perl / libperl-critic-perl-1.088 / lib / Perl / Critic / Exception / Configuration / Option.pm
1 ##############################################################################
2 #      $URL: http://perlcritic.tigris.org/svn/perlcritic/trunk/Perl-Critic/lib/Perl/Critic/Exception/Configuration/Option.pm $
3 #     $Date: 2008-07-03 10:19:10 -0500 (Thu, 03 Jul 2008) $
4 #   $Author: clonezone $
5 # $Revision: 2489 $
6 ##############################################################################
7
8 package Perl::Critic::Exception::Configuration::Option;
9
10 use 5.006001;
11 use strict;
12 use warnings;
13
14 our $VERSION = '1.088';
15
16 #-----------------------------------------------------------------------------
17
18 use Perl::Critic::Exception::Fatal::Internal;
19
20 use Exception::Class (   # this must come after "use P::C::Exception::*"
21     'Perl::Critic::Exception::Configuration::Option' => {
22         isa         => 'Perl::Critic::Exception::Configuration',
23         description => 'A problem with an option in the Perl::Critic configuration, whether from a file or a command line or some other source.',
24         fields      => [ qw{ option_name option_value message_suffix } ],
25     },
26 );
27
28 #-----------------------------------------------------------------------------
29
30 sub message {
31     my $self = shift;
32
33     return $self->full_message();
34 }
35
36 #-----------------------------------------------------------------------------
37
38 sub error {
39     my $self = shift;
40
41     return $self->full_message();
42 }
43
44 #-----------------------------------------------------------------------------
45
46 ## no critic (Subroutines::RequireFinalReturn)
47 sub full_message {
48     Perl::Critic::Exception::Fatal::Internal->throw(
49         'Subclass failed to override abstract method.'
50     );
51 }
52 ## use critic
53
54
55 1;
56
57 __END__
58
59 #-----------------------------------------------------------------------------
60
61 =pod
62
63 =for stopwords
64
65 =head1 NAME
66
67 Perl::Critic::Exception::Configuration::Option - A problem with an option in the L<Perl::Critic> configuration.
68
69 =head1 DESCRIPTION
70
71 A representation of a problem found with an option in the
72 configuration of L<Perl::Critic>, whether from a F<.perlcriticrc>,
73 another profile file, or command line.
74
75 This is an abstract class.  It should never be instantiated.
76
77
78 =head1 METHODS
79
80 =over
81
82 =item C<option_name()>
83
84 The name of the option that was found to be in error.
85
86
87 =item C<option_value()>
88
89 The value of the option that was found to be in error.
90
91
92 =item C<message_suffix()>
93
94 Any text that should be applied to end of the standard message for
95 this kind of exception.
96
97
98 =item C<message()>
99
100 =item C<error()>
101
102 Overridden to call C<full_message()>.  I.e. any message string in the
103 superclass is ignored.
104
105
106 =item C<full_message()>
107
108 Overridden to turn it into an abstract method to force subclasses to
109 implement it.
110
111
112 =back
113
114
115 =head1 SEE ALSO
116
117 L<Perl::Critic::Exception::Configuration::Option::Global>
118 L<Perl::Critic::Exception::Configuration::Option::Policy>
119
120
121 =head1 AUTHOR
122
123 Elliot Shank <perl@galumph.com>
124
125 =head1 COPYRIGHT
126
127 Copyright (c) 2007-2008 Elliot Shank.  All rights reserved.
128
129 This program is free software; you can redistribute it and/or modify
130 it under the same terms as Perl itself.  The full text of this license
131 can be found in the LICENSE file included with this module.
132
133 =cut
134
135 # Local Variables:
136 #   mode: cperl
137 #   cperl-indent-level: 4
138 #   fill-column: 78
139 #   indent-tabs-mode: nil
140 #   c-indentation-style: bsd
141 # End:
142 # ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround :