|
|
|
|
|
|
|
Re: [xbase] how to define an array [message #901407 is a reply to message #901373] |
Sat, 11 August 2012 22:28 |
Christoph Keimel Messages: 482 Registered: December 2010 Location: Germany |
Senior Member |
|
|
Hi Christian,
here is my test code. The experiment was to introduce an invariant on a class in score. The error arrises in line 18.
package de.emsw.model.company
import org.eclipse.emf.ecore.EDiagnosticChain
import org.eclipse.emf.ecore.EMap
import org.eclipse.emf.common.util.BasicDiagnostic
import org.eclipse.emf.common.util.Diagnostic
import java.util.ArrayList
class CompanyElement {
String name
String comment
op boolean hasName(EDiagnosticChain diagnostics, EMap<Object, Object> context) {
if (name == null || name == "") {
if (diagnostics != null) {
diagnostics.add(new BasicDiagnostic(Diagnostic::ERROR,
"de.emsw.model.company", //CompanyValidator::DIAGNOSTIC_SOURCE,
0, //CompanyValidator::COMPANY_ELEMENT__HAS_NAME,
"The name may not be emtpy.",
new ArrayList<Object>(this)))
}
} else true
}
}
Eclipse Build id: 20120614-1722
EMF Version: 2.8.0.v20120608-0554
XCore Version: 1.0.0.v20120612-0950
Greetings
Christoph
|
|
|
Re: [xbase] how to define an array [message #901429 is a reply to message #901407] |
Sun, 12 August 2012 06:30 |
|
Hi,
seems you never did what i asked you to do
String name
String comment
op boolean hasName(EDiagnosticChain diagnostics, EMap<Object, Object> context) {
if (name == null || name == "") {
if (diagnostics != null) {
diagnostics.add(new BasicDiagnostic(Diagnostic::ERROR,
"de.emsw.model.company", //CompanyValidator::DIAGNOSTIC_SOURCE,
0, //CompanyValidator::COMPANY_ELEMENT__HAS_NAME,
"The name may not be emtpy.",
<Object>newArrayList(this)))
}
} else true
}
}
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
|
Powered by
FUDForum. Page generated in 0.03393 seconds