当前位置: 首页>>代码示例>>Java>>正文


Java Diagnostic.toString方法代码示例

本文整理汇总了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);
	}
}
 
开发者ID:anatlyzer,项目名称:anatlyzer,代码行数:24,代码来源:AnalyserUtils.java

示例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);
}
 
开发者ID:jesusc,项目名称:eclectic,代码行数:20,代码来源:TaoFrontend.java

示例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);
}
 
开发者ID:jesusc,项目名称:eclectic,代码行数:20,代码来源:MappingsFrontend.java

示例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);
}
 
开发者ID:jesusc,项目名称:eclectic,代码行数:20,代码来源:AttributionFrontend.java

示例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);
}
 
开发者ID:jesusc,项目名称:eclectic,代码行数:20,代码来源:ChainFrontend.java

示例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);
}
 
开发者ID:jesusc,项目名称:eclectic,代码行数:22,代码来源:QoolFrontend.java

示例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);
}
 
开发者ID:jesusc,项目名称:eclectic,代码行数:30,代码来源:KoanFrontend.java

示例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);
}
 
开发者ID:jesusc,项目名称:eclectic,代码行数:31,代码来源:ScriptFrontend.java


注:本文中的org.eclipse.emf.ecore.resource.Resource.Diagnostic.toString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。