InterMine::Model::ClassDescriptor - represents a class in an InterMine model
use InterMine::Model::ClassDescriptor; ... my $cd = InterMine::Model::ClassDescriptor->create( "Gene" => ( model => $model, parents => ["BioEntity"] ) );
Objects of this class contain the metadata that describes a class in an InterMine model. Each class has a name, parent classes/interfaces and any number of attributes, references and collections.
InterMine class descriptors are sub classes of Moose::Meta::Class, and thus Class::MOP::Class. Please refer to these packages for further documentation.
The class constructor inherited from Moose::Meta::Class. Creates a new ClassDescriptor metaclass.
my $cd = InterMine::Model::ClassDescriptor->create( "Gene" => ( model => $model, parents => ["BioEntity"] ) );
Params: =over 4 =item model - the InterMine::Model that this class is a part of =item name - the class name =item parents - a list of the classes and interfaces that this classes extends =back
In most normal use cases, the typical user should NOT need to call this method. It is used internally when parsing the model to build up the list of classes.
unqualified_name
returns the (unqualified) name of the class this class descriptor represents.
$gene_meta->unqualified_name # "Gene"
package
This is the attribute inherited from Moose::Meta::Class, and returns the full qualified class name that perl refers to the class internally as.
$gene_meta->name # InterMine::genomic::FlyMine::Gene
Fields that belong to this class directly.
Add a field to the list
Get the full list of fields declared in this class.
Return the fields that are instances of InterMine::Model::Attribute. This is not to be confused with Class::MOP's get_all_attributes.
get_all_attributes
Return all the fields that are instances of InterMine::Model::Reference, but not the subclass InterMine::Model::Collection.
Return all the fields that are instances of InterMine::Model::Collection.
The map of fields for this class, including inherited fields. It has the following accessors:
Set a field in the map
Retrieve the named field.
Retrieve all fields as a list
Returns true if there is a field of this name
The names of the immediate ancestors of this class.
return a list of the ClassDescriptor objects for the classes/interfaces that this class directly extends
my @parent_cds = $cd->parental_class_descriptors();
Calling this method retrives the parents from the model and also sets up superclass relationships in Moose. It should not be called until the Model is completely parsed. It is called automatically once the model has been parsed.
The instantiation method inherited from Moose::Meta::Class. You should not normally need to use this directly. Instead call the make_new method in InterMine::Model.
make_new
The full inheritance list, including all ancestors in the model.
Add a field to the class. If there is already a field of the same name, it will not be added twice. Setting the boolean flag "own" marks this field as originating in this class
See also: InterMine::Model->_fix_class_descriptors
Returns true if and only if this class is a sub-class of the given class or is the same class
if ($cld->sub_class_of($other_cld)) { ... }
Returns true if this class is a superclass of the other one, or if it is the same class.
The stringification of a class-descriptor. By default, it stringifies to its unqualified_name.
Returns a string containing an XML representation of the descriptor
Moose::Meta::Class
FlyMine <support@flymine.org>
<support@flymine.org>
Please report any bugs or feature requests to support@flymine.org.
support@flymine.org
You can find documentation for this module with the perldoc command.
perldoc InterMine::Model::ClassDescriptor
You can also look for information at:
FlyMine
http://www.flymine.org
Copyright 2006,2007,2008,2009 FlyMine, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install InterMine::Model, copy and paste the appropriate command in to your terminal.
cpanm
cpanm InterMine::Model
CPAN shell
perl -MCPAN -e shell install InterMine::Model
For more information on module installation, please visit the detailed CPAN module installation guide.