|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectEDU.utwente.CoCompose.lang.ModelVisitor
EDU.utwente.CoCompose.translate.GenerateImplementationVisitor
translate.JavaImplementationVisitor
Generates Java implementation for a CoCompose model.
Field Summary |
Fields inherited from class EDU.utwente.CoCompose.translate.GenerateImplementationVisitor |
constraintCheck, Indent, OUTPUT_DIR |
Fields inherited from class EDU.utwente.CoCompose.lang.ModelVisitor |
log |
Constructor Summary | |
JavaImplementationVisitor()
Constructs a JavaImplementationVisitor. |
Method Summary | |
protected void |
conceptAsClass(Concept concept,
java.lang.String form)
Implements the concept as a Class. |
protected void |
conceptAsConstructorMethod(Concept concept,
java.lang.String form)
Implements the concept as a ConstructorMethod. |
protected void |
conceptAsInterface(Concept concept)
Implements the concept as an Interface. |
protected void |
conceptAsMethod(Concept concept,
java.lang.String form)
Implements the concept as a Method. |
protected void |
conceptAsOther(Concept concept,
java.lang.String form)
Implements the concept as another form. |
protected java.lang.String |
getImplementation(Implementation impl)
Checks and returns the implementation content, if check ok. |
protected java.lang.String |
getImplPart(java.lang.String attr,
java.lang.String impl)
Retrieves the right part from the implementation. |
protected java.lang.String |
getPointerAttribute(java.lang.String attr,
java.lang.String impl)
Gets the pointer attribute part of the implementation for the given entity. |
java.lang.String |
getTargetLanguage()
Returns the target language this GenerateImplementationVisitor supports. |
protected void |
moveImports()
Moves the import declarations in the implementations to the right place. |
protected void |
removeExtraNewlines()
Removes superfluous newlines in the implementations. |
protected void |
substVars()
Substitutes predefined variables. |
void |
visitConcept(Concept concept)
Generates implementation for a Concept object. |
void |
visitModel(Model model)
Visits a Model object. |
protected void |
weavePointers(Model model)
Weaves the designated implementations into the pointers. |
protected void |
weavePointers(Model model,
java.lang.Object entity)
Weaves the designated implementations into the pointers for the given concept. |
protected void |
writeImplementation(Model model,
java.lang.String outdir)
Writes the implementation of the model. |
Methods inherited from class EDU.utwente.CoCompose.translate.GenerateImplementationVisitor |
dumpImplementation, getForms, getImpl, getImpl, getImplementation, getImpls, indent, removeForm, setForm, setImpl, setImpl, visitComposite, visitImplementation, visitImplementationGenerator, writeFile |
Methods inherited from class EDU.utwente.CoCompose.lang.ModelVisitor |
getUpdate, run, setErrorReporter, setLogger, setUpdate, startModel, visitAbstractConcept, visitCompositePartConcept, visitCompositeRole, visitConstrainedConcept, visitImplementationRolePart, visitLink, visitPublishedConcept, visitSolutionPattern, visitSolutionRole |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JavaImplementationVisitor()
Method Detail |
protected java.lang.String getImplementation(Implementation impl) throws CoComposeException
getImplementation
in class GenerateImplementationVisitor
impl
- - the implementation to check
CoComposeException
- if check not okprotected void conceptAsClass(Concept concept, java.lang.String form)
concept
- The concept to implement.form
- The exact concept form.protected void conceptAsInterface(Concept concept)
concept
- The concept to implement.protected void conceptAsMethod(Concept concept, java.lang.String form)
concept
- The concept to implement.form
- The exact concept form.protected void conceptAsConstructorMethod(Concept concept, java.lang.String form)
concept
- The concept to implement.form
- The form to implement the concept as.protected void conceptAsOther(Concept concept, java.lang.String form)
concept
- The concept to implement.form
- The form to implement the concept as.protected void weavePointers(Model model) throws CoComposeException
model
- The source model to read the pointers from.
CoComposeException
- if weaving failed.protected void weavePointers(Model model, java.lang.Object entity) throws CoComposeException
model
- The source model to read the pointers from.entity
- The entity of which to adapt the implementation.
CoComposeException
- if weaving failed.protected void substVars() throws CoComposeException
CoComposeException
- if substituting failed.protected java.lang.String getImplPart(java.lang.String attr, java.lang.String impl) throws CoComposeException
attr
- The pointer attributes, if any.impl
- The current implementation.
CoComposeException
- if the part could not be found.protected java.lang.String getPointerAttribute(java.lang.String attr, java.lang.String impl) throws CoComposeException
attr
- The pointer attribute identifier.impl
- The implementation to get the attribute part for.
CoComposeException
- if the part could not be found.protected void moveImports()
protected void removeExtraNewlines()
protected void writeImplementation(Model model, java.lang.String outdir) throws CoComposeException
model
- The model to write the implementation for.outdir
- The directory to save the implementation files.
CoComposeException
- if writing the implementation failed.public java.lang.String getTargetLanguage()
getTargetLanguage
in class GenerateImplementationVisitor
public void visitModel(Model model) throws CoComposeException
visitModel
in class GenerateImplementationVisitor
model
- The model to visit.
CoComposeException
- if visiting operation failed.public void visitConcept(Concept concept) throws CoComposeException
visitConcept
in class GenerateImplementationVisitor
concept
- The concept to visit.
CoComposeException
- if generating implementation failed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |