… | |
… | |
515 | |
515 | |
516 | This setting has no effect on C<decode>. |
516 | This setting has no effect on C<decode>. |
517 | |
517 | |
518 | =item $json = $json->allow_tags ([$enable]) |
518 | =item $json = $json->allow_tags ([$enable]) |
519 | |
519 | |
520 | =item $enabled = $json->allow_tags |
520 | =item $enabled = $json->get_allow_tags |
521 | |
521 | |
522 | See L<OBJECT SERIALISATION> for details. |
522 | See L<OBJECT SERIALISATION> for details. |
523 | |
523 | |
524 | If C<$enable> is true (or missing), then C<encode>, upon encountering a |
524 | If C<$enable> is true (or missing), then C<encode>, upon encountering a |
525 | blessed object, will check for the availability of the C<FREEZE> method on |
525 | blessed object, will check for the availability of the C<FREEZE> method on |
… | |
… | |
534 | in C<decode>, as if tags were not part of the grammar. |
534 | in C<decode>, as if tags were not part of the grammar. |
535 | |
535 | |
536 | =item $json = $json->filter_json_object ([$coderef->($hashref)]) |
536 | =item $json = $json->filter_json_object ([$coderef->($hashref)]) |
537 | |
537 | |
538 | When C<$coderef> is specified, it will be called from C<decode> each |
538 | When C<$coderef> is specified, it will be called from C<decode> each |
539 | time it decodes a JSON object. The only argument is a reference to the |
539 | time it decodes a JSON object. The only argument is a reference to |
540 | newly-created hash. If the code references returns a single scalar (which |
540 | the newly-created hash. If the code reference returns a single scalar |
541 | need not be a reference), this value (i.e. a copy of that scalar to avoid |
541 | (which need not be a reference), this value (or rather a copy of it) is |
542 | aliasing) is inserted into the deserialised data structure. If it returns |
542 | inserted into the deserialised data structure. If it returns an empty |
543 | an empty list (NOTE: I<not> C<undef>, which is a valid scalar), the |
543 | list (NOTE: I<not> C<undef>, which is a valid scalar), the original |
544 | original deserialised hash will be inserted. This setting can slow down |
544 | deserialised hash will be inserted. This setting can slow down decoding |
545 | decoding considerably. |
545 | considerably. |
546 | |
546 | |
547 | When C<$coderef> is omitted or undefined, any existing callback will |
547 | When C<$coderef> is omitted or undefined, any existing callback will |
548 | be removed and C<decode> will not change the deserialised hash in any |
548 | be removed and C<decode> will not change the deserialised hash in any |
549 | way. |
549 | way. |
550 | |
550 | |