EDU.utwente.CoCompose.translate
Class ImplementationGenerator

java.lang.Object
  |
  +--EDU.utwente.CoCompose.translate.ImplementationGenerator

public class ImplementationGenerator
extends java.lang.Object

Represents an implementation generator for a Composite. It links to the files containing the implementation generator declaration and the actual implementation generator class.

Version:
0.1.18, 22 November 2003
Author:
Dennis Wagelaar

Constructor Summary
ImplementationGenerator()
          Constructs an ImplementationGenerator.
 
Method Summary
 void accept(ModelVisitor visitor)
          Accepts a ModelVisitor.
 void addRolePart(ImplementationRolePart rolepart)
          Adds a role part to the implementation generator.
 void copyAttributes(ImplementationGenerator fromImplementation)
          Copies the attributes from the given implementation generator to self.
 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.
 java.lang.String getLanguage()
          Gets the language in which this solution pattern is expressed.
 Model getModel()
          Retrieves the model context.
 java.util.Set getRoleForms(java.lang.String roleName, Logger logger)
          Gets the possible concept forms for a concept filling a role part of this implementation generator.
 java.util.Enumeration getRoleParts()
          Gets the implementation generator role parts.
 java.util.Enumeration getRoleParts(java.lang.String roleName)
          Gets the implementation generator role parts for a given role name.
 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 setLanguage(java.lang.String language)
          Sets the language in which this solution pattern is expressed.
 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
 

Constructor Detail

ImplementationGenerator

public ImplementationGenerator()
Constructs an ImplementationGenerator.
Method Detail

getLanguage

public java.lang.String getLanguage()
Gets the language in which this solution pattern is expressed.
Returns:
The solution pattern language.

setLanguage

public void setLanguage(java.lang.String language)
Sets the language in which this solution pattern is expressed.
Parameters:
language - The solution pattern language.

getFilename

public java.lang.String getFilename()
Gets the name of the file that contains the actual solution pattern.
Returns:
The file name.

setFilename

public void setFilename(java.lang.String filename)
                 throws CoComposeException
Sets the name of the file that contains the actual solution pattern.
Parameters:
filename - The file name.
Throws:
CoComposeException - if the file specified by the filename could not be parsed.

getComposite

public Composite getComposite()
Gets the composite to which this solution pattern belongs.
Returns:
The composite that owns this solution pattern.

setComposite

public void setComposite(Composite composite)
Sets the composite to which this solution pattern belongs.
Parameters:
composite - The composite that owns this solution pattern.

getModel

public Model getModel()
Retrieves the model context.
Returns:
The model.

getRoleParts

public java.util.Enumeration getRoleParts()
Gets the implementation generator role parts.
Returns:
An enumeration of ImplementationRolePart objects.

getRoleParts

public java.util.Enumeration getRoleParts(java.lang.String roleName)
Gets the implementation generator role parts for a given role name.
Parameters:
roleName - the role name of the role parts.
Returns:
An enumeration of ImplementationRolePart objects.

addRolePart

public void addRolePart(ImplementationRolePart rolepart)
Adds a role part to the implementation generator.
Parameters:
rolepart - The role part to add.

copyAttributes

public void copyAttributes(ImplementationGenerator fromImplementation)
                    throws CoComposeException
Copies the attributes from the given implementation generator to self. It doesn't copy the composite link.
Parameters:
fromImplementation - The implementation generator to copy from.
Throws:
CoComposeException - if the copy could not be made.

getRoleForms

public java.util.Set getRoleForms(java.lang.String roleName,
                                  Logger logger)
Gets the possible concept forms for a concept filling a role part of this implementation generator.
Parameters:
roleName - The role name of the role to get the construct forms for.
logger - The object to log to.
Returns:
The set of possible concept forms for the given role.

toXML

public void toXML(org.xml.sax.helpers.DefaultHandler handler)
           throws org.xml.sax.SAXException
Create XML from this object using a SAX DefaultHandler.
Parameters:
handler - The SAX DefaultHandler.
Throws:
org.xml.sax.SAXException - if an XML handler error occurs.

accept

public void accept(ModelVisitor visitor)
            throws CoComposeException
Accepts a ModelVisitor.
Parameters:
visitor - The visitor object to accept.
Throws:
CoComposeException - if visiting operation failed.