0
|
1 # $Id: EventHandlerI.pm,v 1.5 2002/10/22 07:45:14 lapp Exp $
|
|
2 #
|
|
3 # BioPerl module for Bio::Event::EventHandlerI
|
|
4 #
|
|
5 # Cared for by Jason Stajich <jason@bioperl.org>
|
|
6 #
|
|
7 # Copyright Jason Stajich
|
|
8 #
|
|
9 # You may distribute this module under the same terms as perl itself
|
|
10
|
|
11 # POD documentation - main docs before the code
|
|
12
|
|
13 =head1 NAME
|
|
14
|
|
15 Bio::Event::EventHandlerI - An Event Handler Interface
|
|
16
|
|
17 =head1 SYNOPSIS
|
|
18
|
|
19 # do not use this module directly
|
|
20 # See Bio::SearchIO::SearchResultEventHandler for an example of
|
|
21 # implementation.
|
|
22
|
|
23 =head1 DESCRIPTION
|
|
24
|
|
25 This interface describes the basic methods required for a
|
|
26 EventHandlers. These are essentially SAX methods.
|
|
27
|
|
28 =head1 FEEDBACK
|
|
29
|
|
30 =head2 Mailing Lists
|
|
31
|
|
32 User feedback is an integral part of the evolution of this and other
|
|
33 Bioperl modules. Send your comments and suggestions preferably to
|
|
34 the Bioperl mailing list. Your participation is much appreciated.
|
|
35
|
|
36 bioperl-l@bioperl.org - General discussion
|
|
37 http://bioperl.org/MailList.shtml - About the mailing lists
|
|
38
|
|
39 =head2 Reporting Bugs
|
|
40
|
|
41 Report bugs to the Bioperl bug tracking system to help us keep track
|
|
42 of the bugs and their resolution. Bug reports can be submitted via
|
|
43 email or the web:
|
|
44
|
|
45 bioperl-bugs@bioperl.org
|
|
46 http://bugzilla.bioperl.org/
|
|
47
|
|
48 =head1 AUTHOR - Jason Stajich
|
|
49
|
|
50 Email jason@bioperl.org
|
|
51
|
|
52 Describe contact details here
|
|
53
|
|
54 =head1 CONTRIBUTORS
|
|
55
|
|
56 Additional contributors names and emails here
|
|
57
|
|
58 =head1 APPENDIX
|
|
59
|
|
60 The rest of the documentation details each of the object methods.
|
|
61 Internal methods are usually preceded with a _
|
|
62
|
|
63 =cut
|
|
64
|
|
65
|
|
66 # Let the code begin...
|
|
67
|
|
68
|
|
69 package Bio::Event::EventHandlerI;
|
|
70 use vars qw(@ISA);
|
|
71 use strict;
|
|
72 use Bio::Root::RootI;
|
|
73 use Carp;
|
|
74
|
|
75 @ISA = qw(Bio::Root::RootI);
|
|
76
|
|
77 =head2 will_handle
|
|
78
|
|
79 Title : will_handle
|
|
80 Usage : if( $handler->will_handle($event_type) ) { ... }
|
|
81 Function: Tests if this event builder knows how to process a specific event
|
|
82 Returns : boolean
|
|
83 Args : event type name
|
|
84
|
|
85
|
|
86 =cut
|
|
87
|
|
88 sub will_handle{
|
|
89 my ($self,$type) = @_;
|
|
90 $self->throw_not_implemented();
|
|
91 }
|
|
92
|
|
93 =head2 SAX methods
|
|
94
|
|
95 =cut
|
|
96
|
|
97 =head2 start_document
|
|
98
|
|
99 Title : start_document
|
|
100 Usage : $eventgenerator->start_document();
|
|
101 Function: Handle a start document event
|
|
102 Returns : none
|
|
103 Args : none
|
|
104
|
|
105
|
|
106 =cut
|
|
107
|
|
108 sub start_document{
|
|
109 my ($self,@args) = @_;
|
|
110 $self->throw_not_implemented;
|
|
111 }
|
|
112
|
|
113 =head2 end_document
|
|
114
|
|
115 Title : end_document
|
|
116 Usage : $eventgenerator->end_document();
|
|
117 Function: Handle an end document event
|
|
118 Returns : none
|
|
119 Args : none
|
|
120
|
|
121
|
|
122 =cut
|
|
123
|
|
124 sub end_document{
|
|
125 my ($self,@args) = @_;
|
|
126 $self->throw_not_implemented;
|
|
127 }
|
|
128
|
|
129 =head2 start_element
|
|
130
|
|
131 Title : start_element
|
|
132 Usage : $eventgenerator->start_element
|
|
133 Function: Handles a start element event
|
|
134 Returns : none
|
|
135 Args : hashref with at least 2 keys 'Data' and 'Name'
|
|
136
|
|
137
|
|
138 =cut
|
|
139
|
|
140 sub start_element{
|
|
141 my ($self,@args) = @_;
|
|
142 $self->throw_not_implemented;
|
|
143 }
|
|
144
|
|
145 =head2 end_element
|
|
146
|
|
147 Title : start_element
|
|
148 Usage : $eventgenerator->end_element
|
|
149 Function: Handles an end element event
|
|
150 Returns : none
|
|
151 Args : hashref with at least 2 keys 'Data' and 'Name'
|
|
152
|
|
153
|
|
154 =cut
|
|
155
|
|
156 sub end_element{
|
|
157 my ($self,@args) = @_;
|
|
158 $self->throw_not_implemented;
|
|
159 }
|
|
160
|
|
161
|
|
162 =head2 in_element
|
|
163
|
|
164 Title : in_element
|
|
165 Usage : if( $eventgenerator->in_element($element) ) {}
|
|
166 Function: Test if we are in a particular element
|
|
167 This is different than 'within' because 'in' tests only
|
|
168 if one has reached a specific element.
|
|
169 Returns : boolean
|
|
170 Args : string element name
|
|
171
|
|
172
|
|
173 =cut
|
|
174
|
|
175 sub in_element{
|
|
176 my ($self,@args) = @_;
|
|
177 $self->throw_not_implemented;
|
|
178
|
|
179 }
|
|
180
|
|
181 =head2 within_element
|
|
182
|
|
183 Title : within_element
|
|
184 Usage : if( $eventgenerator->within_element($element) ) {}
|
|
185 Function: Test if we are within a particular element
|
|
186 This is different than 'in' because within can be tested
|
|
187 for a whole block.
|
|
188 Returns : boolean
|
|
189 Args : string element name
|
|
190
|
|
191
|
|
192 =cut
|
|
193
|
|
194 sub within_element{
|
|
195 my ($self,@args) = @_;
|
|
196 $self->throw_not_implemented;
|
|
197 }
|
|
198
|
|
199 =head2 characters
|
|
200
|
|
201 Title : characters
|
|
202 Usage : $eventgenerator->characters($str)
|
|
203 Function: Send a character events
|
|
204 Returns : none
|
|
205 Args : string
|
|
206
|
|
207
|
|
208 =cut
|
|
209
|
|
210 sub characters{
|
|
211 my ($self,@args) = @_;
|
|
212 $self->throw_not_implemented;
|
|
213 }
|
|
214
|
|
215 1;
|