Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Validation Framework not returning errors
Validation Framework not returning errors [message #218456] Tue, 29 July 2008 18:24
Philippe Sabourin is currently offline Philippe SabourinFriend
Messages: 28
Registered: July 2009
Junior Member

I'm trying to determine whether the file open in my editor has errors in
it. It's an XML file with a DTD defined, and when I erase part of a tag
(or the whole tag, if its required), the little red box shows up on the
right, and sometimes a marker shows up on the left. However, this method
always returns false. I call it in between switching from a source page to
a form page, which I only want viewable if there are no errors in the

private boolean hasErrors(){
Validator[] validators =
ValidationFramework.getDefault().getValidatorsFor(currentFil e);
for(Validator validator : validators){
ValidationResult result = validator.validate(currentFile,
IResourceDelta.CONTENT, null, null);
if(result.getSeverityError() > 0)
return true;
return false;

Any ideas?

PS: Reference from before: 654.html
Previous Topic:Force Eclipse to Publish?
Next Topic:Java EE Module spontaneously deselected in Project properties
Goto Forum:

Current Time: Tue Nov 21 01:03:29 GMT 2017

Powered by FUDForum. Page generated in 0.01571 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software