org.eclipse.wst.validation.internal.provisional.core.IValidator Java Examples

The following examples show how to use org.eclipse.wst.validation.internal.provisional.core.IValidator. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TypeScriptValidationHelper.java    From typescript.java with MIT License 6 votes vote down vote up
public static void validate(IIDETypeScriptFile tsFile, IReporter reporter, IValidator validator) {
	try {
		IIDETypeScriptProject tsProject = (IIDETypeScriptProject) tsFile.getProject();
		TypeScriptReporterCollector collector = new TypeScriptReporterCollector(tsFile, reporter, validator);
		if (tsProject.canSupport(CommandNames.SemanticDiagnosticsSync)) {
			boolean includeLinePosition = !tsProject.canSupport(CommandCapability.DiagnosticWithCategory);
			addDiagnostics(tsFile.semanticDiagnosticsSync(includeLinePosition), collector);
			addDiagnostics(tsFile.syntacticDiagnosticsSync(includeLinePosition), collector);
		} else {
			List<DiagnosticEvent> events = tsFile.geterr().get(5000, TimeUnit.MILLISECONDS);
			for (DiagnosticEvent event : events) {
				addDiagnostics(event.getBody(), collector);
			}
		}
	} catch (Throwable e) {
		Trace.trace(Trace.SEVERE, "Error while TypeScript validation.", e);
	}
}
 
Example #2
Source File: TypeScriptReporterCollector.java    From typescript.java with MIT License 4 votes vote down vote up
public TypeScriptReporterCollector(IIDETypeScriptFile tsFile, IReporter reporter, IValidator validator) {
	// this.tsProject = tsProject;
	this.tsFile = tsFile;
	this.reporter = reporter;
	this.validator = validator;
}
 
Example #3
Source File: ReporterMessagePlacementStrategy.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 4 votes vote down vote up
public ReporterMessagePlacementStrategy(IValidator validator,
    IReporter reporter) {
  this.validator = validator;
  this.reporter = reporter;
}