UMMF::UML::MetaMetaModel::Builder - Constructs a Model from an input stream.
use UMMF::UML::MetaMetaModel::Factory; use UMMF::UML::MetaMetaModel::Builder; my $factory = UMMF::UML::MetaMetaModel::Factory->new(...); my $builder = UMMF::UML::MetaMetaModel::Builder->new('factory' => $factory); my $parser = SomeModelParser->new(...); $parser->parse($builder);
Typically a model parser constructs one of these for handling parsing events.
This class manages creation of Models by managing scoping contexts for Model and Namespace during parsing of a meta-model or model description.
Once all the objects are created, the links between the ModelElements are finalized.
UMMF::UML::Import::MetaMetaModel uses this class during parsing of the UML meta-model specificiation file.
None exported.
Kurt Stephens, kstephens@users.sourceforge.net 2003/04/14
UMMF::UML::MetaModel.
$Revision: 1.21 $
$self->begin_Model(%opts);
Begins a new Model in the current Namespace.
Model is a Namespace, so a new Namespace context is started.
If a Model has not been created yet $self->model_top_level is set to the new Model.
my $model = $self->model;
Returns the current Model.
my $model = $self->model_top_level;
Returns the top-level Model, i.e. the first Model created by $self->begin_Model().
my $model = $self->end_Model();
Terminates the current Model context, and resumes the previous Model and Namespace context.
Calls $self->finish_Model($model);
my $ns = $self->begin_Namespace($ns);
Begins a new Namespace context.
my $ns = $self->end_Namespace();
Returns current namespace after restoring previous Namespace context.
my $pkg = $self->begin_Package($name);
Creates a new Package and begins a new Namespace context using the new Package.
my $pkg = $self->end_Package();
Terminates the current Package context, and resumes the previous Namespace context.
$self->add_Usage(@ns);
Added Usage Dependencies for the current Namespace.
Each @ns is a fully-qualified ModelElement name.
$self->Generalization_parent(\@model_element_name);
Begins a new Generalization parent context.
Classifiers created within this new Generalization parent context will specialize each of the @model_element by name, by default; i.e. no generalization parents are specified in the messages to $self->begin_Classifier().
This allows a short-hand notation for causing all Classifiers in a group to speciailize a set of other Classifiers.
Restores the previous Generalization parent context.
my $cls = $self->begin_Classifier($name, $meta, $gens);
Creates a new Classifier and begins a new Namespace context using the new Classifier.
If $name contains '/', $cls->isAbstract will be true. (nmemonic: '/' implies leaning text: italics).
$meta defaults to 'Class';
$meta
'Class'
$gens defaults to the curren Generalization_parent context.
$gens
my $cls->end_Classifier(@opts);
Terminates the current Classifier context, and resumes the previous Namespace context.
If $opts[1] is true, this quickly creates an empty Classifier before hand.
my $x = add_Attribute(\%x);
Adds a new Attribute to the current Classifier.
%x should have the same structure as an Attribute object would have.
%x
$self->add_EnumerationLiteral($name);
Adds a new EnumerationLiteral to the current Classifier, which must be an Enumeration.
my $x = add_Association(\%x);
Adds a new Association between two or more participant Classifiers.
%x should have the same structure as an Association object.
If an AssociationEnd's participant is '.' the current Namespace is used.
Each AssociationEnd's targetScope defaults to 'instance'.
Participant resolution is elided until finish_Association.
finish_Association
my $obj = $self->create($name, @args);
Requests a new object of the $name type from the factory.
Subclasses can intercept all object creation here.
$self->flush($name);
Notifies the factory that all objects of the $name type have been created and can be vivified.
UMMF::UML::MetaMetaModel::FactoryBoot uses this notification to do magic finalizations of the constructed UML Model. This is only used for the initial bootstrapping of UMMF.
UMMF::UML::MetaMetaModel::FactoryBoot
my $self->finish_Model($model);
Completes constrution of the Model by completing the Usages, Generalizations, Attributes and Associations created so far.
The
To install UMMF, copy and paste the appropriate command in to your terminal.
cpanm
cpanm UMMF
CPAN shell
perl -MCPAN -e shell install UMMF
For more information on module installation, please visit the detailed CPAN module installation guide.