本文整理汇总了Java中org.eclipse.emf.ecore.resource.Resource.Diagnostic.toString方法的典型用法代码示例。如果您正苦于以下问题:Java Diagnostic.toString方法的具体用法?Java Diagnostic.toString怎么用?Java Diagnostic.toString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.emf.ecore.resource.Resource.Diagnostic
的用法示例。
在下文中一共展示了Diagnostic.toString方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: extendWithPreconditions
import org.eclipse.emf.ecore.resource.Resource.Diagnostic; //导入方法依赖的package包/类
public static void extendWithPreconditions(ATLModel atlModel, List<String> preconditions, IAtlFileLoader loader) throws PreconditionParseError {
if ( preconditions.size() > 0 ) {
String text = "library preconditions;";
int idx = 0;
for (String pre : preconditions) {
text = text + "\n-- @precondition \n" + "helper def: precondition_" + idx + " : Boolean = " + pre + ";";
idx++;
}
Resource r = loader.load(text);
String[] messages = new String[r.getErrors().size()];
int i = 0;
for (Diagnostic diagnostic : r.getErrors()) {
messages[i] = diagnostic.toString();
i++;
}
if ( r.getErrors().size() > 0 )
throw new PreconditionParseError(messages);
atlModel.extendWithPreconditions(r);
}
}
示例2: compile
import org.eclipse.emf.ecore.resource.Resource.Diagnostic; //导入方法依赖的package包/类
@Override
public R compile(String path) throws EclecticException, IOException {
XtextResource r = parse(path, new FileInputStream(path));
TaoTransformation t = (TaoTransformation) r.getContents().get(0);
// TODO: DUPLICATED WITH KOANFRONTEND: MERGE
if ( r.getErrors().size() > 0 ) {
String str = "";
EList<Diagnostic> errors = r.getErrors();
for (Diagnostic diagnostic : errors) {
str = str + diagnostic.toString() + "\n";
}
throw new EclecticException("Syntax errors: " + str);
}
FrontendUtil.setFilePathToElements(path, t);
return next.compile(t);
}
示例3: compile
import org.eclipse.emf.ecore.resource.Resource.Diagnostic; //导入方法依赖的package包/类
@Override
public R compile(String path) throws EclecticException, IOException {
XtextResource r = parse(path, new FileInputStream(path));
MappingTransformation t = (MappingTransformation) r.getContents().get(0);
// TODO: DUPLICATED WITH KOANFRONTEND: MERGE
if ( r.getErrors().size() > 0 ) {
String str = "";
EList<Diagnostic> errors = r.getErrors();
for (Diagnostic diagnostic : errors) {
str = str + diagnostic.toString() + "\n";
}
throw new EclecticException("Syntax errors: " + str);
}
FrontendUtil.setFilePathToElements(path, t);
return next.compile(t);
}
示例4: compile
import org.eclipse.emf.ecore.resource.Resource.Diagnostic; //导入方法依赖的package包/类
@Override
public R compile(String path) throws EclecticException {
XtextResource r = parse(path, null);
AttributionTransformation t = (AttributionTransformation) r.getContents().get(0);
// TODO: DUPLICATED WITH KOANFRONTEND: MERGE
if ( r.getErrors().size() > 0 ) {
String str = "";
EList<Diagnostic> errors = r.getErrors();
for (Diagnostic diagnostic : errors) {
str = str + diagnostic.toString() + "\n";
}
throw new EclecticException("Syntax errors: " + str);
}
FrontendUtil.setFilePathToElements(path, t);
return next.compile(t);
}
示例5: compile
import org.eclipse.emf.ecore.resource.Resource.Diagnostic; //导入方法依赖的package包/类
@Override
public R compile(String path) throws EclecticException, IOException {
XtextResource r = parse(path, new FileInputStream(path));
ChainTransformation t = (ChainTransformation) r.getContents().get(0);
// TODO: DUPLICATED WITH KOANFRONTEND: MERGE
if ( r.getErrors().size() > 0 ) {
String str = "";
EList<Diagnostic> errors = r.getErrors();
for (Diagnostic diagnostic : errors) {
str = str + diagnostic.toString() + "\n";
}
throw new EclecticException("Syntax errors: " + str);
}
FrontendUtil.setFilePathToElements(path, t);
return next.compile(t);
}
示例6: compile
import org.eclipse.emf.ecore.resource.Resource.Diagnostic; //导入方法依赖的package包/类
public R compile(String path, InputStream qoolS) throws EclecticException {
XtextResource r = parse(path, qoolS);
QoolTransformation t = (QoolTransformation) r.getContents().get(0);
// TODO: DUPLICATED WITH KOANFRONTEND: MERGE
if ( r.getErrors().size() > 0 ) {
String str = "";
EList<Diagnostic> errors = r.getErrors();
for (Diagnostic diagnostic : errors) {
str = str + diagnostic.toString() + "\n";
}
throw new EclecticException("Syntax errors: " + str);
}
// Set the path. For the moment I traverse every element so as not
// to implement a complicated getFile() method
FrontendUtil.setFilePathToElements(path, t);
return next.compile(t);
}
示例7: compile
import org.eclipse.emf.ecore.resource.Resource.Diagnostic; //导入方法依赖的package包/类
@Override
public R compile(String path) throws EclecticException, IOException {
XtextResource r = parse(path, new FileInputStream(path));
KoanTransformation t = (KoanTransformation) r.getContents().get(0);
if ( r.getErrors().size() > 0 ) {
String str = "";
EList<Diagnostic> errors = r.getErrors();
for (Diagnostic diagnostic : errors) {
str = str + diagnostic.toString() + "\n";
}
throw new EclecticException("Syntax errors: " + str);
}
// Set the path. For the moment I traverse every element so as not
// to implement a complicated getFile() method
path = new File(path).getName();
t.setFile(path);
TreeIterator<EObject> contents = t.eAllContents();
while ( contents.hasNext() ) {
EObject o = contents.next();
if ( o instanceof LocatedElement ) {
((LocatedElement) o).setFile(path);
}
}
return next.compile(t);
}
示例8: compile
import org.eclipse.emf.ecore.resource.Resource.Diagnostic; //导入方法依赖的package包/类
@Override
public R compile(String path) throws EclecticException, IOException {
XtextResource r = parse(path, new FileInputStream(path));
ScriptedTransformation t = (ScriptedTransformation) r.getContents().get(0);
// TODO: DUPLICATED WITH KOANFRONTEND: MERGE
if ( r.getErrors().size() > 0 ) {
String str = "";
EList<Diagnostic> errors = r.getErrors();
for (Diagnostic diagnostic : errors) {
str = str + diagnostic.toString() + "\n";
}
throw new EclecticException("Syntax errors: " + str);
}
// Set the path. For the moment I traverse every element so as not
// to implement a complicated getFile() method
path = new File(path).getName();
t.setFile(path);
TreeIterator<EObject> contents = t.eAllContents();
while ( contents.hasNext() ) {
EObject o = contents.next();
if ( o instanceof LocatedElement ) {
((LocatedElement) o).setFile(path);
}
}
return next.compile(t);
}