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


Java IReporter.getMessages方法代码示例

本文整理汇总了Java中org.eclipse.wst.validation.internal.provisional.core.IReporter.getMessages方法的典型用法代码示例。如果您正苦于以下问题:Java IReporter.getMessages方法的具体用法?Java IReporter.getMessages怎么用?Java IReporter.getMessages使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.wst.validation.internal.provisional.core.IReporter的用法示例。


在下文中一共展示了IReporter.getMessages方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: validate

import org.eclipse.wst.validation.internal.provisional.core.IReporter; //导入方法依赖的package包/类
private List validate(String html) throws CoreException {
	IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject("test");
	if (!project.exists()) {
		project.create(new NullProgressMonitor());
		project.open(new NullProgressMonitor());
	}
	// Add tsconfig.json in order to the project has angular nature
	IFile tsconfigJson = project.getFile("tsconfig.json");
	if (!tsconfigJson.exists()) {
		tsconfigJson.create(IOUtils.toInputStream("{}"), 1, new NullProgressMonitor());
	}
	IFile file = project.getFile("test.html");
	if (file.exists()) {
		file.setContents(IOUtils.toInputStream(html), 1, new NullProgressMonitor());
	} else {
		file.create(IOUtils.toInputStream(html), 1, new NullProgressMonitor());
	}

	HTMLValidator validator = new HTMLValidator();
	ValidationResult result = validator.validate(file, 1, new ValidationState(), new NullProgressMonitor());
	IReporter reporter = result.getReporter(new NullProgressMonitor());
	return reporter.getMessages();

}
 
开发者ID:angelozerr,项目名称:angular-eclipse,代码行数:25,代码来源:HTMLAngularValidatorTest.java

示例2: missingEndObject

import org.eclipse.wst.validation.internal.provisional.core.IReporter; //导入方法依赖的package包/类
@Test
public void missingEndObject() throws Exception {
	IReporter reporter = validate("{");
	List messages = reporter.getMessages();
	Assert.assertEquals(1, messages.size());
	LocalizedMessage msg = (LocalizedMessage) messages.get(0);
	assertMessage(msg, "Missing end object", 1, 1);
}
 
开发者ID:angelozerr,项目名称:eclipse-wtp-json,代码行数:9,代码来源:JSONSyntaxValidatorHelperTest.java

示例3: missingEndArray

import org.eclipse.wst.validation.internal.provisional.core.IReporter; //导入方法依赖的package包/类
@Test
public void missingEndArray() throws Exception {
	IReporter reporter = validate("[");
	List messages = reporter.getMessages();
	Assert.assertEquals(1, messages.size());
	LocalizedMessage msg = (LocalizedMessage) messages.get(0);
	assertMessage(msg, "Missing end array", 1, 1);
}
 
开发者ID:angelozerr,项目名称:eclipse-wtp-json,代码行数:9,代码来源:JSONSyntaxValidatorHelperTest.java

示例4: unexpectedColonInArray

import org.eclipse.wst.validation.internal.provisional.core.IReporter; //导入方法依赖的package包/类
@Test
public void unexpectedColonInArray() throws Exception {
	IReporter reporter = validate("[\"a\":]");
	List messages = reporter.getMessages();
	Assert.assertEquals(1, messages.size());
	LocalizedMessage msg = (LocalizedMessage) messages.get(0);
	assertMessage(msg, "Unexpected token", 1, 1);
}
 
开发者ID:angelozerr,项目名称:eclipse-wtp-json,代码行数:9,代码来源:JSONSyntaxValidatorHelperTest.java

示例5: badObjectKey

import org.eclipse.wst.validation.internal.provisional.core.IReporter; //导入方法依赖的package包/类
@Test
@Ignore
public void badObjectKey() throws Exception {
	IReporter reporter = validate("{aa}");
	List messages = reporter.getMessages();
	Assert.assertEquals(1, messages.size());
	LocalizedMessage msg = (LocalizedMessage) messages.get(0);
	assertMessage(msg, "Expected object key but found undefined", 1, 1);
	// msg = (LocalizedMessage) messages.get(1);
	// assertMessage(msg, "Unexpected token", 1, 1);
}
 
开发者ID:angelozerr,项目名称:eclipse-wtp-json,代码行数:12,代码来源:JSONSyntaxValidatorHelperTest.java

示例6: noErrorsWithObject

import org.eclipse.wst.validation.internal.provisional.core.IReporter; //导入方法依赖的package包/类
@Test
public void noErrorsWithObject() throws Exception {
	IReporter reporter = validate("{}");
	List messages = reporter.getMessages();
	Assert.assertEquals(0, messages.size());
}
 
开发者ID:angelozerr,项目名称:eclipse-wtp-json,代码行数:7,代码来源:JSONSyntaxValidatorHelperTest.java

示例7: noErrorsWithArray

import org.eclipse.wst.validation.internal.provisional.core.IReporter; //导入方法依赖的package包/类
@Test
public void noErrorsWithArray() throws Exception {
	IReporter reporter = validate("[]");
	List messages = reporter.getMessages();
	Assert.assertEquals(0, messages.size());
}
 
开发者ID:angelozerr,项目名称:eclipse-wtp-json,代码行数:7,代码来源:JSONSyntaxValidatorHelperTest.java

示例8: objectsInArray

import org.eclipse.wst.validation.internal.provisional.core.IReporter; //导入方法依赖的package包/类
@Test
public void objectsInArray() throws Exception {
	IReporter reporter = validate("[{},{}]");
	List messages = reporter.getMessages();
	Assert.assertEquals(0, messages.size());
}
 
开发者ID:angelozerr,项目名称:eclipse-wtp-json,代码行数:7,代码来源:JSONSyntaxValidatorHelperTest.java


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