|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectEDU.utwente.CoCompose.translate.SolutionPattern
Represents a solution pattern for a Composite. It links to a file containing the actual solution pattern; i.e. a CoCompose model XML file.
Field Summary | |
protected Logger |
log
Cached Logger object. |
Constructor Summary | |
SolutionPattern()
Constructs a SolutionPattern. |
Method Summary | |
void |
accept(ModelVisitor visitor)
Accepts a ModelVisitor. |
void |
apply(Model model,
Logger logger)
Applies the solution pattern for the composite in the given model. |
protected void |
applyDP(Model model,
Composite composite)
Applies the solution pattern default part. |
protected void |
applyRP(Model model,
Composite composite,
CompositeRole role,
Concept concept)
Applies the solution pattern role part for the given concept. |
void |
copyAttributes(SolutionPattern fromSolution)
Copies the attributes from the given solution pattern to self. |
protected void |
determineFilledBy(Model model,
Composite composite,
Model solutionModel)
Determines the FilledBy property for each SolutionRole, if possible. |
protected SolutionRole |
findSolutionRole(java.lang.String name)
Attempts to find the SolutionRole with the given name within the solution pattern. |
Composite |
getComposite()
Gets the composite to which this solution pattern belongs. |
java.lang.String |
getFilename()
Gets the name of the file that contains the actual solution pattern. |
protected java.util.Set |
getNamespaces(Model model)
Gets the namespaces present in the given model. |
protected PublishedConcept |
getPublished(AbstractConcept concept)
Retrieves the PublishedConcept that represents the given concept, if any. |
protected void |
linkAbstractConcept(Model model,
Model solModel,
AbstractConcept concept,
AbstractConcept solConcept,
AbstractConcept instantiatedBy)
Links a new AbstractConcept according to the links in the solution model. |
protected void |
linkComposite(Model model,
Model solModel,
Composite composite,
Composite solComposite,
AbstractConcept instantiatedBy)
Links a new Composite according to the links in the solution model. |
protected void |
linkPublished(Model model,
Composite composite,
PublishedConcept published,
AbstractConcept concept)
Links the solution pattern published concept into the model for the given concept. |
protected void |
linkRP(Model model,
CompositeRole role,
Concept concept)
Links the solution pattern role part into the model for the given concept. |
protected Model |
loadSolutionModel()
Loads the solution pattern model and returns it. |
protected void |
migrateImplementationConstraints(Model model,
AbstractConcept source,
AbstractConcept target)
Migrates concept implementation constraints from the source concept to the target concept. |
protected void |
migratePublished(Model model,
PublishedConcept published,
Model solutionModel)
Migrates the implementation constraints from the given published concept to the implementing concept. |
void |
setComposite(Composite composite)
Sets the composite to which this solution pattern belongs. |
void |
setFilename(java.lang.String filename)
Sets the name of the file that contains the actual solution pattern. |
void |
toXML(org.xml.sax.helpers.DefaultHandler handler)
Create XML from this object using a SAX DefaultHandler. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Logger log
Constructor Detail |
public SolutionPattern()
Method Detail |
protected SolutionRole findSolutionRole(java.lang.String name) throws CoComposeException
name
- - the SolutionRole name
CoComposeException
- if the SolutionRole is not foundprotected java.util.Set getNamespaces(Model model)
model
- - the model to look in.
protected void linkAbstractConcept(Model model, Model solModel, AbstractConcept concept, AbstractConcept solConcept, AbstractConcept instantiatedBy) throws CoComposeException
model
- - the target model.solModel
- - the source (solution pattern) model.concept
- - the AbstractConcept to make links for.solConcept
- - the source AbstractConcept to read the links from.instantiatedBy
- - the concepts to link should be instantiated by
the role part for this. Ignored if null.
CoComposeException
- - if one of the links could not be made.protected void linkComposite(Model model, Model solModel, Composite composite, Composite solComposite, AbstractConcept instantiatedBy) throws CoComposeException
model
- - the target model.solModel
- - the source (solution pattern) model.composite
- - the Composite to make links for.solComposite
- - the source Composite to read the links from.instantiatedBy
- - the concepts to link should be instantiated by
the role part for this. Ignored if null.
CoComposeException
- - if one of the links could not be made.protected void determineFilledBy(Model model, Composite composite, Model solutionModel) throws CoComposeException
model
- - the model to solve to.composite
- - the composite being flattened.solutionModel
- - the model containing the solution pattern.
CoComposeException
- - if a solution role could not be found.protected void applyDP(Model model, Composite composite) throws CoComposeException
model
- - the model to solve to.composite
- - the composite being flattened.
CoComposeException
- - if the default part could not be applied.protected void applyRP(Model model, Composite composite, CompositeRole role, Concept concept) throws CoComposeException
model
- - the model to solve to.composite
- - the composite being flattened.role
- - the role for which the role part will be applied.concept
- - the concept filling the role.
CoComposeException
- - if the role part could not be applied.protected void linkRP(Model model, CompositeRole role, Concept concept) throws CoComposeException
model
- - the model to solve to.role
- - the role for which the role part will be applied.concept
- - the concept filling the role.
CoComposeException
- - if the role part could not be applied.protected void linkPublished(Model model, Composite composite, PublishedConcept published, AbstractConcept concept) throws CoComposeException
model
- - the model to solve to.composite
- - the composite being flattened.published
- - the published concept to be replaced.concept
- - the concept linked to the published concept.
CoComposeException
- - if linking failed.protected void migratePublished(Model model, PublishedConcept published, Model solutionModel) throws CoComposeException
model
- - the model to solve to.published
- - the published concept from which to migrate.solutionModel
- - the model containing the solution pattern.
CoComposeException
- - if migration failed.protected void migrateImplementationConstraints(Model model, AbstractConcept source, AbstractConcept target) throws CoComposeException
model
- - the model that is being transformed.source
- - the source concept to migrate from.target
- - the target concept.
CoComposeException
- - if migration failed.protected Model loadSolutionModel() throws CoComposeException
CoComposeException
- - if the model could not be loaded.protected PublishedConcept getPublished(AbstractConcept concept)
concept
- the concept that is represented by a published concept.
public java.lang.String getFilename()
public void setFilename(java.lang.String filename)
filename
- - the file name.public Composite getComposite()
public void setComposite(Composite composite)
composite
- - the composite that owns this solution pattern.public void copyAttributes(SolutionPattern fromSolution)
fromSolution
- - the solution pattern to copy from.public void toXML(org.xml.sax.helpers.DefaultHandler handler) throws org.xml.sax.SAXException
handler
- - the SAX DefaultHandler.
org.xml.sax.SAXException
- - if an XML handler error occurs.public void apply(Model model, Logger logger) throws CoComposeException
model
- - the model context for the composite.logger
- - the object to log to.
CoComposeException
- - if the solution pattern cannot be applied.public void accept(ModelVisitor visitor) throws CoComposeException
visitor
- - the visitor object to accept.
CoComposeException
- - if visiting operation failed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |