File Coverage

blib/lib/Spreadsheet/XLSX/Reader/LibXML/Cell.pm
Criterion Covered Total %
statement 26 49 53.0
branch 0 14 0.0
condition n/a
subroutine 9 14 64.2
pod 2 3 66.6
total 37 80 46.2


line stmt bran cond sub pod time code
1             package Spreadsheet::XLSX::Reader::LibXML::Cell;
2             our $AUTHORITY = 'cpan:JANDREW';
3 1     1   660831 use version; our $VERSION = qv('v0.38.18');
  1         2  
  1         9  
4             ###LogSD warn "You uncovered internal logging statements for Spreadsheet::XLSX::Reader::LibXML::Cell-$VERSION";
5              
6             $| = 1;
7 1     1   121 use 5.010;
  1         3  
8 1     1   5 use Moose;
  1         2  
  1         6  
9 1     1   6992 use MooseX::StrictConstructor;
  1         29980  
  1         7  
10 1     1   9177 use MooseX::HasDefaults::RO;
  1         7206  
  1         4  
11 1         13 use Types::Standard qw(
12             Str InstanceOf HashRef
13             Enum HasMethods ArrayRef
14             Int Maybe CodeRef
15             is_Object
16 1     1   9191 );
  1         1  
17 1     1   1695 use lib '../../../../../lib';
  1         2  
  1         7  
18             ###LogSD use Log::Shiras::Telephone;
19             ###LogSD use Log::Shiras::UnhideDebug;
20             ###LogSD with 'Log::Shiras::LogSpace';
21 1         17 use Spreadsheet::XLSX::Reader::LibXML::Types qw(
22             CellID
23 1     1   942 );
  1         5  
24             ###LogSD with 'Log::Shiras::LogSpace';
25             ###LogSD sub get_class_space{ 'Workbook' }
26              
27             #########1 Public Attributes 3#########4#########5#########6#########7#########8#########9
28              
29             has error_inst =>(
30             isa => InstanceOf[ 'Spreadsheet::XLSX::Reader::LibXML::Error' ],
31             clearer => '_clear_error_inst',
32             reader => '_get_error_inst',
33             required => 1,
34             handles =>[ qw(
35             error set_error clear_error set_warnings if_warn
36             ) ],
37             );
38              
39             has cell_xml_value =>(
40             isa => Maybe[Str],
41             reader => 'xml_value',
42             predicate => 'has_xml_value',
43             #~ default => '',
44             );
45              
46             has cell_unformatted =>(
47             isa => Maybe[Str],
48             reader => '_unformatted',
49             predicate => 'has_unformatted',
50             #~ default => '',
51             );
52              
53             has rich_text =>(
54             isa => ArrayRef,
55             reader => 'get_rich_text',
56             predicate => 'has_rich_text',
57             );
58              
59             has cell_font =>(
60             isa => HashRef,
61             reader => 'get_font',
62             predicate => 'has_font',
63             );
64              
65             has cell_border =>(
66             isa => HashRef,
67             reader => 'get_border',
68             predicate => 'has_border',
69             );
70            
71             has cell_style =>(
72             isa => HashRef,
73             reader => 'get_style',
74             predicate => 'has_style',
75             );
76            
77             has cell_fill =>(
78             isa => HashRef,
79             reader => 'get_fill',
80             predicate => 'has_fill',
81             );
82            
83             has cell_alignment =>(
84             isa => HashRef,
85             reader => 'get_alignment',
86             predicate => 'has_alignment',
87             );
88              
89             has cell_type =>(
90             isa => Enum[qw( Text Numeric Date Custom )],
91             reader => 'type',
92             writer => '_set_cell_type',
93             predicate => 'has_type',
94             );
95              
96             has cell_encoding =>(
97             isa => Str,
98             reader => 'encoding',
99             predicate => 'has_encoding',
100             );
101              
102             has cell_merge =>(
103             isa => Str,
104             reader => 'merge_range',
105             predicate => 'is_merged',
106             );
107              
108             has cell_formula =>(
109             isa => Str,
110             reader => 'formula',
111             predicate => 'has_formula',
112             );
113            
114             has cell_row =>(
115             isa => Int,
116             reader => 'row',
117             predicate => 'has_row',
118             );
119            
120             has cell_col =>(
121             isa => Int,
122             reader => 'col',
123             predicate => 'has_col',
124             );
125              
126             has r =>(
127             isa => CellID,
128             reader => 'cell_id',
129             predicate => 'has_cell_id',
130             );
131              
132             has cell_hyperlink =>(
133             isa => ArrayRef,
134             reader => 'get_hyperlink',
135             predicate => 'has_hyperlink',
136             );
137              
138             has cell_hidden =>(
139             isa => Enum[qw( sheet column row 0 )],
140             reader => 'is_hidden',
141             default => 0,
142             );
143              
144             has cell_coercion =>(
145             isa => HasMethods[ 'assert_coerce', 'display_name' ],
146             reader => 'get_coercion',
147             writer => 'set_coercion',
148             predicate => 'has_coercion',
149             clearer => 'clear_coercion',
150             handles =>{
151             coercion_name => 'display_name',#
152             },
153             );
154              
155             #########1 Public Methods 3#########4#########5#########6#########7#########8#########9
156              
157             sub unformatted{
158 0     0 1   my( $self, ) = @_;
159             ###LogSD my $phone = Log::Shiras::Telephone->new( name_space =>
160             ###LogSD $self->get_all_space . '::unformatted', );
161             ###LogSD $phone->talk( level => 'debug', message => [
162             ###LogSD "Attempting to return the unformatted value of the cell" ] );
163             ###LogSD $phone->talk( level => 'trace', message => [ "Cell:", $self ] );
164            
165             # check if empty
166 0 0         return undef if !defined $self->has_unformatted;
167            
168             # get the value
169 0           my $unformatted = $self->_unformatted;
170             ###LogSD $phone->talk( level => 'debug', message => [ "unformatted:", $unformatted ] );
171 0           return $unformatted;
172             }
173              
174             sub value{
175 0     0 1   my( $self, ) = @_;
176             ###LogSD my $phone = Log::Shiras::Telephone->new( name_space =>
177             ###LogSD $self->get_all_space . '::value', );
178             ###LogSD $phone->talk( level => 'debug', message => [
179             ###LogSD 'Reached the -value- function' ] );
180             ###LogSD $phone->talk( level => 'trace', message => [ "Cell:", $self ] );
181 0 0         my $unformatted = defined $self->has_xml_value ? $self->xml_value : undef;
182             #~ my $unformatted = $self->unformatted;
183 0           return $self->_return_value_only(
184             $unformatted,
185             $self->get_coercion,
186             $self->_get_error_inst,
187             ###LogSD $self->get_log_space,
188             );
189             }
190              
191             #########1 Private Attributes 3#########4#########5#########6#########7#########8#########9
192              
193              
194              
195             #########1 Private Methods 3#########4#########5#########6#########7#########8#########9
196              
197             after 'set_coercion' => sub{
198             my ( $self, ) = @_;
199             ###LogSD my $phone = Log::Shiras::Telephone->new( name_space =>
200             ###LogSD $self->get_all_space . '::set_coercion', );
201             ###LogSD $phone->talk( level => 'debug', message =>[
202             ###LogSD "Setting 'cell_type' to custom since the coercion has been set" ] );
203             $self->_set_cell_type( 'Custom' );
204             };
205              
206             sub _return_value_only{
207 0     0     my ( $self, $unformatted, $coercion, $error_inst, $log_space ) = @_;# To be used by GetCell too
208             ###LogSD my $phone = Log::Shiras::Telephone->new( name_space =>
209             ###LogSD $self->get_all_space . '::hidden::_return_value_only', );
210             ###LogSD $phone->talk( level => 'debug', message =>[
211             ###LogSD "Returning the coerced value of -" . ( defined $unformatted ? $unformatted : '') . '-',
212             ###LogSD ($coercion ? ( '..using coercion:' , $coercion ) : ''), ] );
213 0           my $formatted = $unformatted;
214 0 0         if( !$coercion ){
    0          
    0          
215             ###LogSD $phone->talk( level => 'debug', message => [
216             ###LogSD "No coercion passed" ] );
217 0           return $unformatted;
218             }elsif( !defined $unformatted ){
219 0           $error_inst->set_error( "The cell does not have a value" );
220             }elsif( $unformatted eq '' ){
221 0           $error_inst->set_error( "The cell has the empty string for a value" );
222             }else{
223             ###LogSD $phone->talk( level => 'debug', message => [
224             ###LogSD "Attempting to return the value of the cell formatted to " .
225             ###LogSD (($coercion) ? $coercion->display_name : 'No conversion available' ) ] );
226 0           my $sig_warn = $SIG{__WARN__};
227 0     0     $SIG{__WARN__} = sub{};
228 0           eval '$formatted = $coercion->assert_coerce( $unformatted )';
229 0 0         $error_inst->set_error( $@ ) if( $@ );
230 0           $SIG{__WARN__} = $sig_warn;
231             }
232 0 0         $formatted =~ s/\\//g if $formatted;
233             ###LogSD $phone->talk( level => 'debug', message => [
234             ###LogSD "Format is:", $coercion->display_name,
235             ###LogSD "Returning the formated value: " .
236             ###LogSD ( $formatted ? $formatted : '' ), ] );
237 0           return $formatted;
238             }
239              
240             #########1 Private Methods 3#########4#########5#########6#########7#########8#########9
241              
242             sub DEMOLISH{
243 0     0 0   my ( $self ) = @_;
244             ###LogSD my $phone = Log::Shiras::Telephone->new( name_space =>
245             ###LogSD $self->get_all_space . '::hidden::DEMOLISH', );
246             ###LogSD $phone->talk( level => 'debug', message => [
247             ###LogSD "clearing the cell for cell-ID:" . $self->cell_id, ] );
248             #~ print "Clearing coercion\n";
249 0           $self->clear_coercion;
250             #~ print "Clearing error instance\n";
251 0           $self->_clear_error_inst;
252             }
253              
254             #########1 Phinish 3#########4#########5#########6#########7#########8#########9
255              
256 1     1   1830 no Moose;
  1         2  
  1         10  
257             __PACKAGE__->meta->make_immutable;
258            
259             1;
260              
261             #########1 Documentation 3#########4#########5#########6#########7#########8#########9
262             __END__
263              
264             =head1 NAME
265              
266             Spreadsheet::XLSX::Reader::LibXML::Cell - XLSX Cell data class
267              
268             =head1 SYNOPSIS
269              
270             See the SYNOPSIS in the L<Workbook class|Spreadsheet::XLSX::Reader::LibXML/SYNOPSIS>
271            
272             =head1 DESCRIPTION
273              
274             This is the class that contains cell data. There are no XML parsing actions taken in the
275             background of this class. All data has been pre-coalated/built from the L<Worksheet
276             |Spreadsheet::XLSX::Reader::LibXML::Worksheet> class. In general the Worksheet class
277             will populate the attributes of this class when it is generated. If you want to use it
278             as a standalone class just fill in the L<Attributes|/Attributes> below. It should be
279             noted that the Worksheet class also L<pre-converts
280             |Spreadsheet::XLSX::Reader::LibXML::FmtDefault/change_output_encoding( $string )> the
281             unformatted value as well.
282              
283             =head2 Primary Methods
284              
285             These are methods used to transform data stored in the L<Attributes|/Attributes>
286             (not just return it directly). All methods are object methods and should be implemented
287             on the instance.
288              
289             B<Example:>
290              
291             my $unformatted_value = $cell_intance->unformatted;
292              
293             =head3 unformatted
294              
295             =over
296              
297             B<Definition:> Returns the unformatted value of the cell
298              
299             B<Accepts:>Nothing
300              
301             B<Returns:> the raw L<Excel visible|/xml_value> cell value
302              
303             =back
304              
305             =head3 has_unformatted
306              
307             =over
308              
309             B<Definition:> This is a predicate method to determine if the cell had any value stored in it.
310             Sometimes this class will be generated by the
311             L<Worksheet|Spreadsheet::XLSX::Reader::LibXML::Worksheet> class when there is cell formatting but
312             no value. Ex. Merged cells store the value in the left upper corner of the merged area but have
313             cell specific formatting for all cells in the merge area.
314              
315             B<Accepts:>Nothing
316              
317             B<Returns:> True if the cell holds an unformatted value (even if it is just a space or empty string)
318              
319             =back
320              
321             =head3 value
322              
323             =over
324              
325             B<Definition:> Returns the formatted value of the cell transformed from the
326             L<unformatted|/unformatted> string. This method uses the conversion stored in the
327             L<cell_coercion|/cell_coercion> attribute. If there is no format/conversion set
328             then this will return the unformatted value. Any failures to process this value can be
329             retrieved with L<$self-E<gt>error|/error>.
330              
331             B<Accepts:>Nothing
332              
333             B<Returns:> the cell value processed by the set conversion
334              
335             =back
336              
337             =head3 xml_value
338              
339             =over
340              
341             B<Definition:> L<Tux|https://metacpan.org/author/HMBRAND>Pointed out with a test case that the
342             underlying xml and the visible unformatted data (in the formula bar of the excel application) can
343             differ even when no formal format is applied. I'm not sure where this performance comes from but
344             I suspect legacy behaviour inheritance. In any case the variation appears to occur only in the
345             case of stored scientific notiation at very detailed precision. To support the access of both
346             I have left the 'unformatted' representing the visible data in the spreadsheet with the 'xml_value'
347             method returning the stored value in xml. I would welcome any additional nuance that you are aware
348             of in this area L<SUPPORT|/SUPPORT>.
349              
350             B<Accepts:>Nothing
351              
352             B<Returns:> the raw xml cell value
353              
354             =back
355              
356             =head3 has_xml_value
357              
358             =over
359              
360             B<Definition:> This is a predicate method to determine if the cell had any value stored in it.
361             This method and L<has_unformatted|/has_unformatted> should return exactly the same result in all
362             cases. See that method for more explanation.
363              
364             B<Accepts:>Nothing
365              
366             B<Returns:> True if the cell xml holds a value (even if it is just a space or empty string)
367              
368             =back
369              
370             =head2 Attributes
371              
372             This class is just a storage of coallated information about the requested cell stored
373             in the following attributes. For more information on attributes see
374             L<Moose::Manual::Attributes>. The meta data about the cell can be retrieved from each
375             attribute using the 'attribute methods'.
376              
377             =head3 error_inst
378              
379             =over
380              
381             B<Definition:> This attribute holds an 'error' object instance. In general
382             the package shares a reference for this instance accross the workbook with all
383             worksheets and all cells so any set or get action should return the latest error state
384             from anywhere. (not just the instance you are working on)
385              
386             B<Default:> a L<Spreadsheet::XLSX::Reader::LibXML::Error> instance with the
387             attributes set as;
388            
389             ( should_warn => 0 )
390              
391             B<Range:> The minimum list of methods to implement for your own instance is;
392              
393             error set_error clear_error set_warnings if_warn
394              
395             B<attribute methods> Methods provided to adjust this attribute
396              
397             =over
398              
399             B<get_error_inst>
400              
401             =over
402              
403             B<Definition:> returns this instance
404              
405             =back
406              
407             B<error>
408              
409             =over
410              
411             B<Definition:> Used to get the most recently logged error
412              
413             =back
414              
415             B<set_error>
416              
417             =over
418              
419             B<Definition:> used to set a new error string
420            
421             =back
422              
423             B<clear_error>
424              
425             =over
426              
427             B<Definition:> used to clear the current error string in this attribute
428            
429             =back
430              
431             B<set_warnings>
432              
433             =over
434              
435             B<Definition:> used to turn on or off real time warnings when errors are set.
436             This is a delegated method from the error instance.
437            
438             =back
439              
440             B<if_warn>
441              
442             =over
443              
444             B<Definition:> a method mostly used to extend this package and see if warnings
445             should be emitted.
446            
447             =back
448              
449             =back
450              
451             =back
452              
453             =head3 cell_unformatted
454              
455             =over
456              
457             B<Definition:> This holds the unformatted value of the cell (if any)
458              
459             B<Default:> undef
460              
461             B<Range:> a string
462              
463             B<attribute methods> Methods provided to adjust this attribute
464            
465             =over
466              
467             B<unformatted>
468              
469             =over
470              
471             B<Definition:> returns the attribute value
472            
473             =back
474            
475             =over
476              
477             B<has_unformatted>
478              
479             =over
480              
481             B<Definition:> a predicate method to determine if any value is in the cell
482            
483             =back
484              
485             =back
486              
487             =back
488              
489             =back
490              
491             =head3 rich_text
492              
493             =over
494              
495             B<Definition:> This attribute hold a rich text data structure like
496             L<Spreadsheet::ParseExcel::Cell/get_rich_text()> with the exception that it
497             doesn't bless each hashref into an object. The hashref's are also organized
498             per the Excel xlsx information in the the sharedStrings.xml file. In general
499             this is an arrayref of arrayrefs where the second level contains two positions.
500             The first position is the place (from zero) where the formatting is implemented.
501             The second position is a hashref of the formatting values. The format is inforce
502             until the next start place is identified.
503              
504             =over
505              
506             B<note:> It is important to understand that Excel can store two formats for the
507             same cell and often they don't agree. For example using the attribute L<cell_font
508             |/cell_font> will not always contain the same value as specific fonts (or any font)
509             listed in the rich text array.
510             f
511             =back
512              
513             B<Default:> undef = no rich text defined for this cell
514              
515             B<Range:> an array ref of rich_text positions and definitions
516              
517             B<attribute methods> Methods provided to adjust this attribute
518            
519             =over
520              
521             B<get_rich_text>
522              
523             =over
524              
525             B<Definition:> returns the attribute value
526            
527             =back
528              
529             B<has_rich_text>
530              
531             =over
532              
533             B<Definition:> Indicates if the attribute has anything stored
534            
535             =back
536              
537             =back
538              
539             =back
540              
541             =back
542              
543             =head3 cell_font
544              
545             =over
546              
547             B<Definition:> This holds the font assigned to the cell
548              
549             B<Default:> undef
550              
551             B<Range:> a hashref of definitions for the font
552              
553             B<attribute methods> Methods provided to adjust this attribute
554            
555             =over
556              
557             B<get_font>
558              
559             =over
560              
561             B<Definition:> returns the attribute value
562            
563             =back
564              
565             B<has_font>
566              
567             =over
568              
569             B<Definition:> Indicates if the attribute has anything stored
570            
571             =back
572              
573             =back
574              
575             =back
576              
577             =head3 cell_border
578              
579             =over
580              
581             B<Definition:> This holds the border settings assigned to the cell
582              
583             B<Default:> undef
584              
585             B<Range:> a hashref of border definitions
586              
587             B<attribute methods> Methods provided to adjust this attribute
588            
589             =over
590              
591             B<get_border>
592              
593             =over
594              
595             B<Definition:> returns the attribute value
596            
597             =back
598              
599             B<has_border>
600              
601             =over
602              
603             B<Definition:> Indicates if the attribute has anything stored
604            
605             =back
606              
607             =back
608              
609             =back
610              
611             =head3 cell_style
612              
613             =over
614              
615             B<Definition:> This holds the border settings assigned to the cell
616              
617             B<Default:> undef
618              
619             B<Range:> a hashref of style definitions
620              
621             B<attribute methods> Methods provided to adjust this attribute
622            
623             =over
624              
625             B<get_style>
626              
627             =over
628              
629             B<Definition:> returns the attribute value
630            
631             =back
632              
633             B<has_style>
634              
635             =over
636              
637             B<Definition:> Indicates if the attribute has anything stored
638            
639             =back
640            
641             =back
642            
643             =back
644              
645             =head3 cell_fill
646              
647             =over
648              
649             B<Definition:> This holds the fill settings assigned to the cell
650              
651             B<Default:> undef
652              
653             B<Range:> a hashref of style definitions
654              
655             B<attribute methods> Methods provided to adjust this attribute
656            
657             =over
658              
659             B<get_fill>
660              
661             =over
662              
663             B<Definition:> returns the attribute value
664            
665             =back
666              
667             B<has_fill>
668              
669             =over
670              
671             B<Definition:> Indicates if the attribute has anything stored
672            
673             =back
674            
675             =back
676            
677             =back
678              
679             =head3 cell_type
680              
681             =over
682              
683             B<Definition:> This holds the type of data stored in the cell. In general it
684             follows the convention of L<ParseExcel
685             |Spreadsheet::ParseExcel/ChkType($self, $is_numeric, $format_index)> (Date, Numeric,
686             or Text) however, since custom coercions will change data to some possible non excel
687             standard state this also allows a 'Custom' type representing any cell with a custom
688             conversion assigned to it (by you either at the worksheet level or here).
689              
690             B<Default:> Text
691              
692             B<Range:> Text = Strings, Numeric = Real Numbers, Date = Real Numbers with an
693             assigned Date conversion, Custom = any stored value with a custom conversion
694              
695             B<attribute methods> Methods provided to adjust this attribute
696            
697             =over
698              
699             B<type>
700              
701             =over
702              
703             B<Definition:> returns the attribute value
704            
705             =back
706              
707             B<has_type>
708              
709             =over
710              
711             B<Definition:> Indicates if the attribute has anything stored (Always true)
712            
713             =back
714            
715             =back
716            
717             =back
718              
719             =head3 cell_encoding
720              
721             =over
722              
723             B<Definition:> This holds the byte encodeing of the data stored in the cell
724              
725             B<Default:> Unicode
726              
727             B<Range:> Traditional encoding options
728              
729             B<attribute methods> Methods provided to adjust this attribute
730            
731             =over
732              
733             B<encoding>
734              
735             =over
736              
737             B<Definition:> returns the attribute value
738            
739             =back
740              
741             B<has_encoding>
742              
743             =over
744              
745             B<Definition:> Indicates if the attribute has anything stored
746            
747             =back
748            
749             =back
750            
751             =back
752              
753             =head3 cell_merge
754              
755             =over
756              
757             B<Definition:> if the cell is part of a group of merged cells this will
758             store the upper left and lower right cell ID's in a string concatenated
759             with a ':'
760              
761             B<Default:> undef
762              
763             B<Range:> two cell ID's
764              
765             B<attribute methods> Methods provided to adjust this attribute
766            
767             =over
768              
769             B<merge_range>
770              
771             =over
772              
773             B<Definition:> returns the attribute value
774            
775             =back
776              
777             B<is_merged>
778              
779             =over
780              
781             B<Definition:> Indicates if the attribute has anything stored
782            
783             =back
784            
785             =back
786            
787             =back
788              
789             =head3 cell_formula
790              
791             =over
792              
793             B<Definition:> if the cell value (unformatted) is calculated based on a
794             formula the Excel formula string is stored in this attribute.
795              
796             B<Default:> undef
797              
798             B<Range:> Excel formula string
799              
800             B<attribute methods> Methods provided to adjust this attribute
801            
802             =over
803              
804             B<formula>
805              
806             =over
807              
808             B<Definition:> returns the attribute value
809            
810             =back
811              
812             B<has_formula>
813              
814             =over
815              
816             B<Definition:> Indicates if the attribute has anything stored
817            
818             =back
819            
820             =back
821            
822             =back
823              
824             =head3 cell_row
825              
826             =over
827              
828             B<Definition:> This is the sheet row that the cell was read from
829              
830             B<Range:> the minimum row to the maximum row
831              
832             B<attribute methods> Methods provided to adjust this attribute
833            
834             =over
835              
836             B<row>
837              
838             =over
839              
840             B<Definition:> returns the attribute value
841            
842             =back
843              
844             B<has_row>
845              
846             =over
847              
848             B<Definition:> Indicates if the attribute has anything stored
849            
850             =back
851            
852             =back
853            
854             =back
855              
856             =head3 cell_col
857              
858             =over
859              
860             B<Definition:> This is the sheet column that the cell was read from
861              
862             B<Range:> the minimum column to the maximum column
863              
864             B<attribute methods> Methods provided to adjust this attribute
865            
866             =over
867              
868             B<col>
869              
870             =over
871              
872             B<Definition:> returns the attribute value
873            
874             =back
875              
876             B<has_col>
877              
878             =over
879              
880             B<Definition:> Indicates if the attribute has anything stored
881            
882             =back
883            
884             =back
885            
886             =back
887              
888             =head3 r
889              
890             =over
891              
892             B<Definition:> This is the cell ID of the cell
893              
894             B<attribute methods> Methods provided to adjust this attribute
895            
896             =over
897              
898             B<cell_id>
899              
900             =over
901              
902             B<Definition:> returns the attribute value
903            
904             =back
905              
906             B<has_cell_id>
907              
908             =over
909              
910             B<Definition:> Indicates if the attribute has anything stored
911            
912             =back
913            
914             =back
915            
916             =back
917              
918             =head3 cell_hyperlink
919              
920             =over
921              
922             B<Definition:> This stores any hyperlink from the cell
923              
924             B<attribute methods> Methods provided to adjust this attribute
925            
926             =over
927              
928             B<get_hyperlink>
929              
930             =over
931              
932             B<Definition:> returns the attribute value
933            
934             =back
935              
936             B<has_hyperlink>
937              
938             =over
939              
940             B<Definition:> Indicates if the attribute has anything stored
941            
942             =back
943            
944             =back
945            
946             =back
947              
948             =head3 cell_coercion
949              
950             =over
951              
952             B<Definition:> This attribute holds the tranformation code to turn an
953             unformatted value into a formatted value.
954              
955             B<Default:> a L<Type::Tiny> instance with sub types set to assign different
956             inbound data types to different coercions for the target outcome of formatted
957             data.
958              
959             B<Range:> If you wish to set this with your own code it must have two
960             methods. First, 'assert_coerce' which will be applied when transforming
961             the unformatted value. Second, 'display_name' which will be used to self
962             identify. For an example of how to build a custom format see
963             L<Spreadsheet::XLSX::Reader::LibXML::Worksheet/custom_formats>.
964              
965             B<attribute methods> Methods provided to adjust this attribute
966            
967             =over
968              
969             B<get_coercion>
970              
971             =over
972              
973             B<Definition:> returns this instance
974            
975             =back
976              
977             B<clear_coercion>
978              
979             =over
980              
981             B<Definition:> used to clear the this attribute
982            
983             =back
984              
985             B<set_coercion>
986              
987             =over
988              
989             B<Definition:> used to set a new coercion instance. Implementation of this
990             method will also switch the cell type to 'Custom'.
991            
992             =back
993              
994             B<has_coercion>
995              
996             =over
997              
998             B<Definition:> Indicate if any coecion code is applied
999            
1000             =back
1001              
1002             B<coercion_name>
1003              
1004             =over
1005              
1006             B<Definition:> calls 'display_name' on the code in the background
1007            
1008             =back
1009            
1010             =back
1011            
1012             =back
1013              
1014             =head3 cell_hidden
1015              
1016             =over
1017              
1018             B<Definition:> if the cell would not be visible when this file is parsed by a the
1019             Microsoft Excel application then this attribute is true.
1020              
1021             B<Default:> 0 = Not hidden
1022              
1023             B<Range:> sheet = the sheet is hidden, column = the column is hidden, row = the row is hidden.
1024             When two or more of these conditions is true the leftmost in the list is displayed.
1025              
1026             B<attribute methods> Methods provided to adjust this attribute
1027            
1028             =over
1029              
1030             B<is_hidden>
1031              
1032             =over
1033              
1034             B<Definition:> returns the attribute value
1035            
1036             =back
1037            
1038             =back
1039            
1040             =back
1041              
1042             =head1 SUPPORT
1043              
1044             =over
1045              
1046             L<github Spreadsheet::XLSX::Reader::LibXML/issues
1047             |https://github.com/jandrew/Spreadsheet-XLSX-Reader-LibXML/issues>
1048              
1049             =back
1050              
1051             =head1 TODO
1052              
1053             =over
1054              
1055             B<1.> Return the merge range in array and hash formats
1056              
1057             B<2.> Add calc chain values
1058              
1059             B<3.> Have unformatted return '' (the empty string) rather than undef for null?
1060              
1061             =back
1062              
1063             =head1 AUTHOR
1064              
1065             =over
1066              
1067             Jed Lund
1068              
1069             jandrew@cpan.org
1070              
1071             =back
1072              
1073             =head1 COPYRIGHT
1074              
1075             This program is free software; you can redistribute
1076             it and/or modify it under the same terms as Perl itself.
1077              
1078             The full text of the license can be found in the
1079             LICENSE file included with this module.
1080              
1081             This software is copyrighted (c) 2014, 2015 by Jed
1082              
1083             =head1 DEPENDENCIES
1084              
1085             =over
1086              
1087             L<version> 0.77
1088              
1089             L<perl 5.010|perl/5.10.0>
1090              
1091             L<Moose>
1092              
1093             L<MooseX::StrictConstructor>
1094              
1095             L<MooseX::HasDefaults::RO>
1096              
1097             L<Type::Tiny> - 1.000>
1098              
1099             L<Spreadsheet::XLSX::Reader::LibXML::Types>
1100              
1101             =back
1102              
1103             =head1 SEE ALSO
1104              
1105             =over
1106              
1107             L<Spreadsheet::ParseExcel> - Excel 2003 and earlier
1108              
1109             L<Spreadsheet::XLSX> - 2007+
1110              
1111             L<Spreadsheet::ParseXLSX> - 2007+
1112              
1113             L<Log::Shiras|https://github.com/jandrew/Log-Shiras>
1114              
1115             =over
1116              
1117             All lines in this package that use Log::Shiras are commented out
1118              
1119             =back
1120              
1121             =back
1122              
1123             =cut
1124              
1125             #########1#########2 main pod documentation end 5#########6#########7#########8#########9