Clover coverage report - Maven Clover report
Coverage timestamp: Tue Sep 16 2008 01:16:37 EEST
file stats: LOC: 116   Methods: 2
NCLOC: 52   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
NodeWebService.java 0% 0% 0% 0%
coverage
 1    /*
 2    wsmo4j - a WSMO API and Reference Implementation
 3   
 4    Copyright (c) 2004-2005, OntoText Lab. / SIRMA
 5   
 6    This library is free software; you can redistribute it and/or modify it under
 7    the terms of the GNU Lesser General Public License as published by the Free
 8    Software Foundation; either version 2.1 of the License, or (at your option)
 9    any later version.
 10    This library is distributed in the hope that it will be useful, but WITHOUT
 11    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 12    FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 13    details.
 14    You should have received a copy of the GNU Lesser General Public License along
 15    with this library; if not, write to the Free Software Foundation, Inc.,
 16    59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 17    */
 18    package com.ontotext.wsmo4j.parser.xml;
 19   
 20    /**
 21    * <p>Title: WSMO4J</p>
 22    * <p>Description: WSMO API and a Reference Implementation</p>
 23    * <p>Copyright: Copyright (c) 2004-2005</p>
 24    * <p>Company: OntoText Lab. / SIRMA </p>
 25    * @author not attributable
 26    * @version 1.0
 27    *
 28    */
 29   
 30    import java.util.*;
 31   
 32    import org.w3c.dom.*;
 33    import org.wsmo.common.*;
 34    import org.wsmo.common.exception.*;
 35    import org.wsmo.service.*;
 36    import org.wsmo.wsml.*;
 37   
 38    import com.ontotext.wsmo4j.serializer.xml.*;
 39   
 40    /**
 41    * Helper type to serialize/deserialize xml element web service
 42    *
 43    * @author not attributable
 44    */
 45    class NodeWebService {
 46  0 static WebService deserialize(Node xmlNode, WsmlXmlParser parser)
 47    throws InvalidModelException, ParserException {
 48  0 if (xmlNode == null || parser == null || xmlNode.getNodeName() != "webService"
 49    || xmlNode.getNodeType() != Element.ELEMENT_NODE) {
 50  0 throw new IllegalArgumentException();
 51    }
 52   
 53  0 WebService webService = null;
 54  0 IRI webServiceIri = parser.getFactory().createIRI(
 55    WsmlXmlHelper.getAttrValue(xmlNode, "name"));
 56  0 webService = parser.getFactory().createWebService(webServiceIri);
 57  0 NodeTopEntity.processTopEntityNode(webService, xmlNode, parser);
 58   
 59  0 NodeList nodes = xmlNode.getChildNodes();
 60  0 for (int i = 0; i < nodes.getLength(); i++) {
 61  0 Node node = nodes.item(i);
 62  0 if (node.getNodeName() == "nonFunctionalProperties") {
 63  0 NodeNFP.deserialize(webService, node, parser);
 64    }
 65  0 else if (node.getNodeName() == "capability") {
 66  0 webService.setCapability(NodeCapability.deserialize(node, parser));
 67    }
 68  0 else if (node.getNodeName() == "interface") {
 69  0 webService.addInterface(NodeInterface.deserialize(node, parser));
 70    }
 71    }
 72   
 73  0 return webService;
 74    }
 75   
 76  0 static Element serialize(WebService webService, WsmlXmlSerializer serializer) {
 77  0 Element webServiceElement = serializer.createElement("webService");
 78  0 webServiceElement.setAttribute("name", webService.getIdentifier().toString());
 79  0 NodeTopEntity.serializeTopEntity(webServiceElement, webService, serializer);
 80   
 81  0 if (!webService.listNFPValues().isEmpty()) {
 82  0 NodeNFP.serialize(webServiceElement, webService, serializer);
 83    }
 84   
 85  0 webServiceElement.appendChild(NodeCapability.serialize(webService.getCapability(), serializer));
 86   
 87  0 if (!webService.listInterfaces().isEmpty()) {
 88  0 for (Iterator i = webService.listInterfaces().iterator(); i.hasNext();) {
 89  0 Interface intrface = (Interface) i.next();
 90  0 webServiceElement.appendChild(NodeInterface.serialize(intrface, serializer));
 91    }
 92    }
 93   
 94  0 return webServiceElement;
 95    }
 96    }
 97   
 98    /*
 99    * $Log$
 100    * Revision 1.2 2006/03/29 11:20:51 vassil_momtchev
 101    * mediator support added; some code refactored; minor bugs fixed
 102    *
 103    * Revision 1.1 2005/11/28 14:03:48 vassil_momtchev
 104    * package refactored from com.ontotext.wsmo4j.xmlparser to com.ontotext.wsmo4j.parser.xml
 105    *
 106    * Revision 1.5 2005/09/16 14:02:45 alex_simov
 107    * Identifier.asString() removed, use Object.toString() instead
 108    * (Implementations MUST override toString())
 109    *
 110    * Revision 1.4 2005/08/31 09:24:22 vassil_momtchev
 111    * add InvalidModelException and ParserException to LogicalExpressionFactory::createLogixExpression methods
 112    *
 113    * Revision 1.3 2005/08/08 08:24:40 vassil_momtchev
 114    * javadoc added, bugfixes
 115    *
 116    */