boolean errorSeen = false ;
boolean warningSeen = false ;
// What to finally report.
Violation vError = null ;
Violation vWarning = null ;
Violation xvSub = null ;
for ( ; iter.hasNext() ; )
{
Violation v = iter.next();
int code = v.getViolationCode() ;
boolean isError = v.isError() ;
// Ignore these.
if ( code == Violation.LOWERCASE_PREFERRED
||
code == Violation.PERCENT_ENCODING_SHOULD_BE_UPPERCASE
||
code == Violation.SCHEME_PATTERN_MATCH_FAILED
)
continue ;
// Anything we want to reprioritise?
// [nothing at present]
// Remember first error and first warning.
if ( isError )
{
errorSeen = true ;
if ( vError == null )
// Remember first error
vError = v ;
}
else
{
warningSeen = true ;
if ( vWarning == null )
vWarning = v ;
}
String msg = v.getShortMessage();
String iriStr = iri.toString();
// Ideally, we might want to output all messages relating to this IRI
// then cause the error or continue.
// But that's tricky given the current errorhandler architecture.