| Bio-Phylo documentation | Contained in the Bio-Phylo distribution. |
Bio::Phylo::Unparsers::Json - Serializer used by Bio::Phylo::IO, no serviceable parts inside
This module turns the supplied object into a JSON string.
The json unparser is called by the Bio::Phylo::IO object. Look there to learn how to unparse objects.
Also see the manual: Bio::Phylo::Manual and http://rutgervos.blogspot.com.
To learn more about the JavaScript Object Notation (JSON) format, visit http://www.json.org.
If you use Bio::Phylo in published research, please cite it:
Rutger A Vos, Jason Caravas, Klaas Hartmann, Mark A Jensen and Chase Miller, 2011. Bio::Phylo - phyloinformatic analysis using Perl. BMC Bioinformatics 12:63. http://dx.doi.org/10.1186/1471-2105-12-63
$Id: Mrp.pm 1660 2011-04-02 18:29:40Z rvos $
| Bio-Phylo documentation | Contained in the Bio-Phylo distribution. |
# $Id: Mrp.pm 1660 2011-04-02 18:29:40Z rvos $ package Bio::Phylo::Unparsers::Json; use strict; use base 'Bio::Phylo::Unparsers::Abstract'; use Bio::Phylo::Util::CONSTANT qw'/looks_like/'; use Bio::Phylo::Util::Exceptions 'throw'; use Bio::Phylo::Util::Dependency qw'XML::XML2JSON';
sub _to_string { my $self = shift; my $obj = $self->{'PHYLO'}; if ( looks_like_implementor $obj, 'to_json' ) { return $obj->to_json; } else { throw 'ObjectMismatch' => "Can't make JSON string out of $obj"; } } # podinherit_insert_token
1;