com.ashridgetech.jamda.uml
Interface Model.ElementFactory

All Known Implementing Classes:
AbstractElementFactory
Enclosing interface:
Model

public static interface Model.ElementFactory

A factory object responsible for creating the correct ModelElement subclass object for a NSUML MModelElement encountered during loading. It is also responsible for creating a copy of itself set up to create elements in a specific Model. This saves having separate factory-factories, and is an example of the GoF Prototype pattern.

Version:
1.0
Author:
paulb

Method Summary
 Model.ElementFactory createCopy(Model model)
          Create the correct ElementFactory for model.
 ModelElement createElement(ru.novosoft.uml.foundation.core.MModelElement me, ModelElement parent)
          Create the correct ModelElement for me.
 

Method Detail

createElement

public ModelElement createElement(ru.novosoft.uml.foundation.core.MModelElement me,
                                  ModelElement parent)
Create the correct ModelElement for me.

Parameters:
me - the model element being loaded
parent - the element which will contain the new ModelElement
Returns:
the new ModelElement, or null if this ElementFactory cannot create one for me
See Also:
Model.Model(ru.novosoft.uml.model_management.MModel, java.util.List, java.util.List), Model.createElement(ru.novosoft.uml.foundation.core.MModelElement, com.ashridgetech.jamda.uml.ModelElement)

createCopy

public Model.ElementFactory createCopy(Model model)
Create the correct ElementFactory for model.

Parameters:
model - the model being loaded
Returns:
the new ElementFactory. If the ElementFactory needs no knowledge of the Model to which it belongs, then this could be the same instance, but this is probably a rare situation. This method will be called before the Model is fully initialised, so it should not do anything with the Model other than store a reference to it.
See Also:
Model.Model(ru.novosoft.uml.model_management.MModel, java.util.List, java.util.List), Model.getDefaultElementFactoryList()


Copyright © 2003 Ashridge Technologies Ltd. All Rights Reserved.