From: Филимонов М. С. <tpa...@gm...> - 2009-05-13 15:26:56
|
Hi Stefan. My comments below. 13.05.2009, в 8:06, Stefan Bodewig написал(а): > class ValidationError { > readonly int line; // with a negative constant for UNKNOWN > readonly int column; // ditto > > readonly String message; > } > > .NET knows warnings in addition to errors, I'm not sure how we should > handle them. > > class ValidationResult { > readonly bool valid; > readonly Iterable/IEnumerable<ValidationError> errors; > } > I think warning is important what about use > IEnumerable<ValidationWarning> warnings > and > ValidationError : ValidationWarning > or > ValidationWarning : ValidationIncostistency , > ValidationError:ValidationIncostistency? > class Validator { > String schemaURI; // should that be an URI instead? probably > wouldn't > // work for DTDs then > Source[] schemaSources; > > ValidationResult validateSchema(); > ValidationResult validateInstance(Source); > } > > Since the Java code will be prettier if it uses different > implementations for DTDs and W3C Schema I suggest to add a factory > method > > class Validator { > static Validator forLanguage(String); > } What about pass enum not a string than user will know what validation sets are supported and didn't try to pass something not supported. |