1 19 package org.netbeans.modules.websvc.wsdl.validator; 20 21 import java.io.IOException ; 22 import java.util.List ; 23 import org.netbeans.modules.xml.xam.Model; 24 import org.netbeans.modules.xml.xam.spi.Validation; 25 import org.netbeans.modules.xml.xam.spi.Validation.ValidationType; 26 import org.netbeans.modules.xml.xam.spi.Validator.ResultItem; 27 28 32 public class ValidationOutputWindowController { 33 34 35 public ValidationOutputWindowController() { 36 } 37 38 45 public List <ResultItem> validate(Model model) { 46 47 if (model!=null && !model.inSync()) { 49 try { 50 model.sync(); 51 } catch (IOException ioe) { 52 } 55 } 56 57 Validation validation = new Validation(); 58 validation.validate(model, ValidationType.COMPLETE); 59 List <ResultItem> validationResult = validation.getValidationResult(); 60 printGuidanceInformation(validationResult); 61 62 return validationResult; 63 } 64 65 66 67 private void printGuidanceInformation(List <ResultItem> guidanceInformation) { 68 ValidationOutputWindow guidanceOutputWindow = new ValidationOutputWindow(); 69 guidanceOutputWindow.displayValidationInformation(guidanceInformation); 70 } 71 72 73 } 74 | Popular Tags |