/usr/share/perl5/GO/Handlers/base.pm is in libgo-perl 0.15-1.
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 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 | # $Id: base.pm,v 1.5 2004/11/24 02:28:00 cmungall Exp $
#
# This GO module is maintained by Chris Mungall <cjm@fruitfly.org>
#
# see also - http://www.geneontology.org
# - http://www.godatabase.org/dev
#
# You may distribute this module under the same terms as perl itself
=head1 NAME
GO::Handlers::base - default handler
=head1 SYNOPSIS
use GO::Handlers::base
=cut
=head1 DESCRIPTION
Default Handler, other handlers inherit from this class
this class catches events (start, end and body) and allows the
subclassing module to intercept these. unintercepted events get pushed
into a tree
See GO::Parser for details on parser/handler architecture
=head1 PUBLIC METHODS -
=cut
package GO::Handlers::base;
use strict;
use Exporter;
use Carp;
use GO::Model::Root;
use vars qw(@ISA @EXPORT_OK @EXPORT);
use base qw(Data::Stag::Writer Exporter);
@EXPORT_OK = qw(lookup);
sub EMITS { () }
sub CONSUMES {
qw(
header
source
term
typedef
prod
)
}
sub is_transform { 0 }
=head2 strictorder
Usage - $handler->strictorder(1);
Returns -
Args -
boolean accessor; if set, then terms passed must be in order
=cut
sub strictorder {
my $self = shift;
$self->{_strictorder} = shift if @_;
return $self->{_strictorder};
}
sub proddb {
my $self = shift;
$self->{_proddb} = shift if @_;
return $self->{_proddb};
}
sub ontology_type {
my $self = shift;
$self->{_ontology_type} = shift if @_;
return $self->{_ontology_type};
}
sub root_to_be_added {
my $self = shift;
$self->{_root_to_be_added} = shift if @_;
return $self->{_root_to_be_added};
}
# DEPRECATED
sub messages {
my $self = shift;
$self->{_messages} = shift if @_;
return $self->{_messages};
}
*error_list = \&messages;
sub message {
my $self = shift;
push(@{$self->messages},
shift);
}
sub lookup {
my $tree = shift;
my $k = shift;
# use Data::Dumper;
# print Dumper $tree;
# confess;
if (!ref($tree)) {
confess($tree);
}
my @v = map {$_->[1]} grep {$_->[0] eq $k} @$tree;
if (wantarray) {
return @v;
}
$v[0];
}
#sub print {
# my $self = shift;
# print "@_";
#}
sub print {shift->addtext(@_)}
sub printf {
my $self = shift;
my $fmt = shift;
$self->addtext(sprintf($fmt, @_));
}
sub throw {
my $self = shift;
my @msg = @_;
confess("@msg");
}
sub warn {
my $self = shift;
my @msg = @_;
warn("@msg");
}
sub dbxref2str {
my $self = shift;
my $dbxref = shift;
return
$dbxref->sget_dbname . ':' . $dbxref->sget_acc;
}
sub xslt {
my $self = shift;
$self->{_xslt} = shift if @_;
return $self->{_xslt};
}
1;
|