/usr/share/perl5/TM/Materialized/JTM.pm is in libtm-perl 1.56-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | package TM::Materialized::JTM;
# $Id: JTM.pm,v 1.1 2010/04/09 09:57:17 az Exp $
use strict;
use Class::Trait qw(TM::Serializable::JTM);
use TM::Materialized::Stream;
use base qw (TM::Materialized::Stream);
use vars qw($VERSION);
$VERSION = qw(('$Revision: 1.2 $'))[1];
=pod
=head1 NAME
TM::Materialized::JTM - Topic Maps, trait for JSON Topic Map instances.
=head1 SYNOPSIS
use TM::Materialized::JTM;
my $tm=TM::Materialized::JTM(file=>"somefile.jtm");
$tm->sync_in;
...
# map was modified, now save the changes
$tm->sync_out;
=head1 DESCRIPTION
This package provides map parsing and creating functionality for JTM (JSON Topic Map) instances.
The JSON Topic Map format is defined here: L<http://www.cerny-online.com/jtm/1.0/>.
=head1 INTERFACE
=head2 Methods
=over
=item B<Constructor>
I<$tm> = TM::Materialized::JTM->new (...);
The constructor expects a hash as described in L<TM::Materialized::Stream>, with one additional
key/value parameter:
=over
=item * B<format> (choices: C<"json">, C<"yaml">)
This option controls whether the JTM data is treated as being in JSON format
or in YAML (which is a superset of JSON). This applies to both reading and writing of
map data.
The default value is C<"json">.
=back
=cut
sub new
{
my ($class,%options)=@_;
$options{psis}=$TM::PSI::topicmaps;
$options{format}||="json";
return bless $class->SUPER::new(%options), $class;
}
=pod
=item B<format>
I<$tm>->format('json');
I<$curformat>=I<$tm>->format;
This method gets or sets the format parameter for future operations. Possible choices: C<"json">, C<"yaml">.
=cut
sub format
{
my ($self,$format)=@_;
$self->{format}=$format if ($format=~/^(json|yaml)$/);
return $self->{format};
}
=pod
=back
=head1 SEE ALSO
L<TM::Serializable::JTM>
=head1 AUTHOR INFORMATION
Copyright 2010, Alexander Zangerl, All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl
itself. http://www.perl.com/perl/misc/Artistic.html
=cut
1;
|