Fetching contributors…
Cannot retrieve contributors at this time
167 lines (115 sloc) 3.31 KB
# $Id$
# BioPerl module for Bio::CorbaServer::Annotation
# Cared for by Jason Stajich <>
# Copyright Jason Stajich
# You may distribute this module under the same terms as perl itself
# POD documentation - main docs before the code
=head1 NAME
Bio::CorbaServer::Annotation - An Annotation object
Give standard usage here
Describe the object here
=head2 Mailing Lists
User feedback is an integral part of the evolution of this and other
Bioperl modules. Send your comments and suggestions preferably to
the Bioperl mailing list. Your participation is much appreciated. - General discussion - About the mailing lists
=head2 Reporting Bugs
Report bugs to the Bioperl bug tracking system to help us keep track
of the bugs and their resolution. Bug reports can be submitted via
the web:
=head1 AUTHOR - Jason Stajich
Describe contact details here
Additional contributors names and emails here
The rest of the documentation details each of the object methods.
Internal methods are usually preceded with a _
# Let the code begin...
package Bio::CorbaServer::Annotation;
use vars qw(@ISA);
use strict;
use Bio::CorbaServer::Base;
@ISA = qw( POA_bsane::Annotation Bio::CorbaServer::Base );
=head2 new
Title : new
Usage : my $obj = new Bio::CorbaServer::Annotation();
Function: Builds a new Bio::CorbaServer::Annotation object
Returns : Bio::CorbaServer::Annotation
Args :
sub new {
my($class,@args) = @_;
my $self = $class->SUPER::new(@args);
$self->{'_value'}) = $self->_rearrange([qw(NAME BASIS VALUE)],@args);
return $self;
=head2 bsane::Annotation methods
=head2 get_name
Title : get_name
Usage : my $name = $annotation->get_name()
Function: Returns the general type of the annotation
Returns : string
Args : none
sub get_name{
my ($self) = @_;
return $self->{'_name'};
=head2 get_basis
Title : get_basis
Usage : my $basis = $annotation->get_basis();
Function: Returns the basis for an annotation
valid types are
Returns : numeric representing one of the above
Args : none
sub get_basis{
my ($self) = @_;
return 0 if ! defined $self->{'_basis'} || $self->{'_basis'} !~ /^[0-4]/;
return $self->{'_basis'} ;
=head2 get_value
Title : get_name
Usage : my $name = $annotation->get_value()
Function: Returns the data for the annotation
Returns : any
Args : none
Note : Not sure this will really work in perl
sub get_value{
my ($self) = @_;
unless ( defined $self->{'_value'} ) {
return new CORBA::Any( new CORBA::TypeCode("IDL:CORBA/Null:1.0"),
my $rc = $self->{'_value'};
if( ref($rc) ) {
if( $rc->can('as_text') ) {
$rc = $rc->as_text();
} else {
$self->warn("Not sure how to handle object of type $rc in get_value");
$rc = '';
return new CORBA::Any( new CORBA::TypeCode("IDL:CORBA/String:1.0"),