[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[news.eclipse.technology.gmt] Re: oaw: beginner questions
|
Sven Efftinge a écrit :
> Hi Yannick,
>
> I think I don't understand what your problem is.
> You are talking about a code generator based on Xpand, aren't you?
> What do you mean by "parsing" associations and classes?
> Why don't you write everything to the FILE the first time you open it?
>
> regards,
> Sven
>
Well I want to write a java code generator with oAW from a UML2 model.
With Topcased project I created a UML2 model using UML2:Packages,
association, classes, interfaces and so on.
In my generator, I create a java file (FILE ....java) for each class and
interface.
My problem is that there might have some information in associations
related to some class/interface. And "associations" tags are not
children of class/interface but siblings.
Here's a quick xml look-alike:
<model>
<package>
<association>
...
</association>
<class>
...
</class
<interface>
...
</interface>
<association>
...
</association>
<interface>
...
</interface>
</package
</model>
Once I expand a class or interface, I don't know how to go back to
parent node and get associations. In that case I proceed in 2 steps:
1) I read all association tags and store information (I use a java
extension)
2) for each class/interface I write normal code and I check if there are
some stored information related this class/interface. If there are, I
write those additionnal information. If not, I add nothing. (again with
java extension)
I hope this is easier to understand.