1 19 20 package org.netbeans.modules.websvc.wsdl.validator; 21 22 import org.netbeans.api.xml.cookies.CookieObserver; 23 import org.netbeans.api.xml.cookies.ValidateXMLCookie; 24 import org.netbeans.modules.xml.retriever.catalog.Utilities; 25 import org.netbeans.modules.xml.wsdl.model.WSDLModelFactory; 26 import org.netbeans.modules.xml.xam.Model; 27 import org.netbeans.modules.xml.xam.ModelSource; 28 import org.openide.loaders.DataObject; 29 30 34 public class ValidateXMLCookieImpl implements ValidateXMLCookie{ 35 private DataObject dobj; 36 37 38 public ValidateXMLCookieImpl(DataObject dobj) { 39 this.dobj = dobj; 40 } 41 42 public boolean validateXML(CookieObserver observer) { 43 ValidationOutputWindowController validationController = 44 new ValidationOutputWindowController(); 45 validationController.validate(getModel()); 46 return true; 47 } 48 49 private Model getModel(){ 50 ModelSource modelSource = Utilities.getModelSource(dobj.getPrimaryFile(), 51 dobj.getPrimaryFile().canWrite()); 52 return WSDLModelFactory.getDefault().getModel(modelSource); 53 } 54 55 } 56 | Popular Tags |