openArchitectureWare.org

oAW has moved to Eclipse.

At this site you will find information about the outdated version openArchitectureWare 4, only.
Please read our letter of intent for further information.

 

 Forum Index > openArchitectureWare > openArchitectureWare 4.x Support New Topic Post Reply
 Extensions with Java
 |  Printable Version
nabil
 Wednesday, April 16 2008 @ 01:56 PM CEST (Read 384 times)  


Status: offline

Registered: 04/11/08
Posts: 6

Hello

My name is nabil, I'm an enginner in 'SOFTEAM Objecteering software' in paris, and I work in about openarchitectureware 4.2 for code generation in Java

I try use Extensions whith Java, the class is :

package help;

[b]import data.*;

public class EntityHelper{
        public static String className(Entity e) {
        return e.getName()+"Implementation";
        }
        public static String classFileName (Entity e) {
        return className(e)+ ".java";
        }[/b]}

and file of extension is :

import data;
[b]import metamodel;

String className(Entity e): 
JAVA help.EntityHelper.className(data.Entity);
        
String classFileName(Entity e): 
JAVA help.EntityHelper.classFileName(data.Entity)[/b];

But, when I execute the woorkflow,I have always a problem which I can't resolve,The problem is 'argument type mutch'.

I don't see what I do wrong

Thanks.


 
Profile Email
Quote
Karsten Thoms
 Wednesday, April 16 2008 @ 02:15 PM CEST  
Forum

Status: offline

Registered: 07/20/05
Posts: 1859

Hi Nabil!

I assume the class Entity is really in package "data". Then the definition of your JAVA extension is right in principle. The argument must state the full qualified type names (here data.Entity). This would not explain the argument type mismatch problem.

But I wouldn't code this type of helper functions in Java anyway, since they are more easily defined in Xtend:

import data;
import metamodel;

String className(Entity e): e.name+"Implementation";
        
String classFileName(Entity e): e.className()+".java";


If you want to solve the type argument problem anyway you could try to debug this. You could define an exception breakpoint for the exception you get. You have to switch the launch configuration to debug in Java. Therefore open the Debug dialog and check the "Java debug" option.

Perhaps you could provide us some stack trace are other helpful information.

Hope this helps,
~Karsten

PS: Sorry for demanding to enter your issue again as a forum post. But this way other people having similar problems can read possible solutions, too.


 
Profile Email Website
Quote
Content generated in: 0.05 seconds
New Topic Post Reply



 All times are CEST. The time is now 09:44 AM.
Normal Topic Normal Topic
Locked Topic Locked Topic
Sticky Topic Sticky Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Anonymous users can post 
Filtered HTML Allowed 
Censored Content