| [Xtext2.0] Validation [message #705166] |
Fri, 29 July 2011 10:15  |
Eclipse User |
|
|
|
Hello,
i have worked before with the validation package in the older version of xtext.
Since Version 2.0 it seems not so easy to write some simple check methods.
The example in the DomainmodelJavaValidator.java File looks like this:
@Check
public void checkGreetingsStartsWithCapital(Greeting greeting){
if(!Character.isUpperCase(greeting.getName().charAt(0))) {
warning("Name should start with a capital", MyDslPackage.Literals.GREETING__NAME);
}
}
In the old version is was possible to use this example but now
i have to put in an EStructuralFeature instead of a simple integer (MyDslPackage.Literals.GREETING__NAME).
i would guess that the error and warning methods were altered.
Can someone give me a new example for the simple warning above?
thank u
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03447 seconds