|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--EDU.utwente.CoCompose.translate.Implementation
Represents an implementation for a Concept. It links to a file containing the actual implementation, such as a Java source file.
Constructor Summary | |
Implementation()
Constructs an Implementation. |
Method Summary | |
void |
accept(ModelVisitor visitor)
Accepts a ModelVisitor. |
void |
adapt(java.util.Hashtable adapted)
Adapts the concept data used in the implementation (content & constraints). |
void |
addConstraint(AbstractConcept concept,
java.util.Collection conceptForms)
Adds a constraint for a concept referred to in this implementation. |
void |
clearConstraints()
Clears all constraints. |
protected void |
constraintsToXML(org.xml.sax.helpers.DefaultHandler handler)
Creates the constraints table XML using a SAX DefaultHandler. |
void |
copyAttributes(Implementation fromImplementation)
Copies the attributes from the given implementation to self. |
void |
copyConstraints(Implementation fromImplementation)
Copies the constraints from the given implementation. |
static java.beans.PropertyChangeEvent |
CreateRenameEvent(AbstractConcept source,
AbstractConcept target)
Creates a constrained concept renaming event for this. |
protected AbstractConcept |
findLocalConcept(AbstractConcept fromConcept,
Model inModel,
AbstractConcept instantiatedBy)
Attempts to find the local equivalent/copy of the given concept in the given model. |
Concept |
getConcept()
Gets the concept to which this implementation belongs. |
java.lang.String |
getConceptForm()
Gets the target language construct form for this implementation. |
java.util.Hashtable |
getConstraints()
Gets the concept form constraints table. |
java.lang.String |
getContent()
Gets the implementation content. |
java.lang.String |
getContentWithoutTags()
Gets the implementation content without concept tags. |
java.lang.String |
getLanguage()
Gets the language in which this implementation is expressed. |
Model |
getModel()
Gets the model for this implementation from the concept. |
void |
propertyChange(java.beans.PropertyChangeEvent evt)
This method gets called when a property is changed. |
void |
removeConstraint(AbstractConcept concept)
Removes the constraint referring to the given concept. |
protected AbstractConcept |
searchLocalConcept(AbstractConcept fromConcept,
Model inModel,
AbstractConcept instantiatedBy)
Searches the local equivalent/copy of the given concept in the given model. |
void |
setConcept(Concept concept)
Sets the concept to which this implementation belongs. |
void |
setConceptForm(java.lang.String conceptForm)
Sets the target language construct form for this implementation. |
void |
setContent(java.lang.String content)
Sets the implementation content. |
void |
setLanguage(java.lang.String language)
Sets the language in which this implementation is expressed. |
protected java.lang.String |
stringReplace(java.lang.String source,
java.util.Hashtable nameTable,
boolean withoutTag)
Replaces names in source string and returns the new string. |
void |
toXML(org.xml.sax.helpers.DefaultHandler handler)
Create XML from this object using a SAX DefaultHandler. |
protected void |
unsubscribeAll()
Unsubscribes from all AbstractConcepts on which we depend. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Implementation()
Method Detail |
protected void constraintsToXML(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.protected java.lang.String stringReplace(java.lang.String source, java.util.Hashtable nameTable, boolean withoutTag)
source
- the source string.nameTable
- the Hashtable<String |-> String> of old names mapping to new names.withoutTag
- if true, the new names will be put in without tag signs.protected void unsubscribeAll()
protected AbstractConcept findLocalConcept(AbstractConcept fromConcept, Model inModel, AbstractConcept instantiatedBy) throws CoComposeException
fromConcept
- the concept to look forinModel
- the model to look ininstantiatedBy
- the local concept must be instantiated by this concept.CoComposeException
- - if more than one concept dependency was foundprotected AbstractConcept searchLocalConcept(AbstractConcept fromConcept, Model inModel, AbstractConcept instantiatedBy) throws CoComposeException
fromConcept
- the concept to look forinModel
- the model to look ininstantiatedBy
- the local concept must be instantiated by this conceptCoComposeException
- - if more than one concept dependency was foundpublic static java.beans.PropertyChangeEvent CreateRenameEvent(AbstractConcept source, AbstractConcept target)
source
- the old constrained concepttarget
- the new constrained conceptpublic java.lang.String getLanguage()
public void setLanguage(java.lang.String language)
language
- the implementation language.public java.lang.String getContent()
public java.lang.String getContentWithoutTags()
public void setContent(java.lang.String content)
content
- the implementation content.public java.lang.String getConceptForm()
public void setConceptForm(java.lang.String conceptForm)
conceptForm
- the target language construct form.public Concept getConcept()
public void setConcept(Concept concept)
concept
- the concept that owns this implementation.public void addConstraint(AbstractConcept concept, java.util.Collection conceptForms)
concept
- the concept to which the constraints refers.conceptForms
- the Collection<String> of concepts form of which one is assumed
for the given concept (the actual constraint).public void removeConstraint(AbstractConcept concept)
concept
- the concept for which to remove the constraint.public void clearConstraints()
public java.util.Hashtable getConstraints()
public Model getModel()
public void copyAttributes(Implementation fromImplementation)
fromImplementation
- the implementation to copy from.public void copyConstraints(Implementation fromImplementation) throws CoComposeException
fromImplementation
- the implementation to copy from.CoComposeException
- - if a source concept for a constraint could not
be found in the current model.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 adapt(java.util.Hashtable adapted)
adapted
- A table of the form: Hashtable<oldConcept:Concept |-> newConcept:Concept>public void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange
in interface java.beans.PropertyChangeListener
evt
- the event describing which property from what object has been
changed.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: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |