Clover coverage report - Maven Clover report
Coverage timestamp: Tue Sep 16 2008 01:16:37 EEST
file stats: LOC: 140   Methods: 9
NCLOC: 67   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
WsmlFlightValidator.java 0% 0% 0% 0%
coverage
 1    /*
 2    wsmo4j - a WSMO API and Reference Implementation
 3    Copyright (c) 2005, University of Innsbruck, Austria
 4    This library is free software; you can redistribute it and/or modify it under
 5    the terms of the GNU Lesser General Public License as published by the Free
 6    Software Foundation; either version 2.1 of the License, or (at your option)
 7    any later version.
 8    This library is distributed in the hope that it will be useful, but WITHOUT
 9    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 10    FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 11    details.
 12    You should have received a copy of the GNU Lesser General Public License along
 13    with this library; if not, write to the Free Software Foundation, Inc.,
 14    59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 15    */
 16    package org.deri.wsmo4j.validator;
 17   
 18   
 19    import java.util.*;
 20   
 21    import org.omwg.logicalexpression.*;
 22    import org.omwg.ontology.*;
 23    import org.wsmo.common.WSML;
 24    import org.wsmo.common.exception.*;
 25    import org.wsmo.factory.LogicalExpressionFactory;
 26    import org.wsmo.validator.ValidationError;
 27    import org.wsmo.validator.ValidationWarning;
 28   
 29   
 30    /**
 31    * Checks an ontology for wsml-flight validity.
 32    *
 33    * <pre>
 34    * Created on Aug 18, 2005
 35    * Committed by $Author: morcen $
 36    * $Source$,
 37    * </pre>
 38    *
 39    * @author Holger Lausen (holger.lausen@deri.org)
 40    * @author nathalie.steinmetz@deri.org
 41    * @version $Revision: 1946 $ $Date: 2007-04-02 15:13:28 +0300 (Mon, 02 Apr 2007) $
 42    */
 43    public class WsmlFlightValidator
 44    extends WsmlRuleValidator {
 45   
 46  0 public WsmlFlightValidator(LogicalExpressionFactory leFactory) {
 47  0 super(leFactory);
 48    }
 49   
 50    /**
 51    * Checks if an axiom is valid to wsml-flight.
 52    *
 53    * @see org.deri.wsmo4j.validator.WsmlRuleValidator#visitAxiom(org.omwg.ontology.Axiom)
 54    */
 55  0 protected void visitAxiom(Axiom axiom) {
 56  0 WsmlFlightExpressionValidator flightExprVal = new WsmlFlightExpressionValidator(axiom, leFactory, errors, this);
 57  0 WsmlRuleExpressionValidator ruleExprVal = new WsmlRuleExpressionValidator(axiom, errors, this);
 58  0 WsmlFullExpressionValidator fullExprVal = new WsmlFullExpressionValidator(axiom, errors);
 59  0 FunctionSymbolHelper fsHelper = new FunctionSymbolHelper(
 60    axiom, errors, WSML.WSML_FLIGHT, this);
 61  0 Iterator axioms = axiom.listDefinitions().iterator();
 62  0 while (axioms.hasNext()) {
 63  0 LogicalExpression le = (LogicalExpression) axioms.next();
 64  0 le.accept(fsHelper);
 65   
 66  0 le.accept(fullExprVal);
 67  0 ruleExprVal.setup();
 68  0 le.accept(ruleExprVal);
 69  0 flightExprVal.setup();
 70  0 le.accept(flightExprVal);
 71    }
 72    }
 73   
 74    /**
 75    * Checks if a concept is valid to wsml-flight.
 76    *
 77    * @see org.deri.wsmo4j.validator.WsmlRuleValidator#visitConcept(org.omwg.ontology.Concept)
 78    */
 79  0 protected void visitConcept(Concept concept) {
 80  0 super.visitConcept(concept);
 81    }
 82   
 83    /**
 84    * Checks if an instance is valid to wsml-flight.
 85    *
 86    * @see org.deri.wsmo4j.validator.WsmlRuleValidator#visitInstance(org.omwg.ontology.Instance)
 87    */
 88  0 protected void visitInstance(Instance instance) {
 89  0 super.visitInstance(instance);
 90    }
 91   
 92    /**
 93    * Checks if a relation is valid to wsml-flight.
 94    *
 95    * @see org.deri.wsmo4j.validator.WsmlRuleValidator#visitRelation(org.omwg.ontology.Relation)
 96    */
 97  0 protected void visitRelation(Relation relation) {
 98  0 super.visitRelation(relation);
 99    }
 100   
 101    /**
 102    * Checks if a relation instance is valid to wsml-flight.
 103    *
 104    * @throws InvalidModelException
 105    * @throws SynchronisationException
 106    * @see org.deri.wsmo4j.validator.WsmlRuleValidator#visitRelationInstance(org.omwg.ontology.RelationInstance)
 107    */
 108  0 protected void visitRelationInstance(RelationInstance relationInstance)
 109    throws SynchronisationException, InvalidModelException {
 110  0 super.visitRelationInstance(relationInstance);
 111    }
 112   
 113  0 public boolean isValid(LogicalExpression logExpr, List <ValidationError> errorMessages, List <ValidationWarning> warningMessages) {
 114  0 super.isValid(logExpr, errorMessages, warningMessages);
 115  0 errors = errorMessages;
 116  0 warnings = warningMessages;
 117  0 WsmlFlightExpressionValidator flightExprVal = new WsmlFlightExpressionValidator(null, leFactory, errors, this);
 118  0 WsmlRuleExpressionValidator ruleExprVal = new WsmlRuleExpressionValidator(null, errors, this);
 119  0 WsmlFullExpressionValidator fullExprVal = new WsmlFullExpressionValidator(null, errors);
 120  0 FunctionSymbolHelper fsHelper = new FunctionSymbolHelper(
 121    null, errors, WSML.WSML_FLIGHT, this);
 122   
 123  0 logExpr.accept(fsHelper);
 124  0 logExpr.accept(fullExprVal);
 125  0 ruleExprVal.setup();
 126  0 logExpr.accept(ruleExprVal);
 127  0 flightExprVal.setup();
 128  0 logExpr.accept(flightExprVal);
 129  0 return (errors.isEmpty());
 130    }
 131   
 132  0 public void setErrors(List <ValidationError> errors) {
 133  0 this.errors = errors;
 134    }
 135   
 136  0 public void setWarnings(List <ValidationWarning> warnings) {
 137  0 this.warnings = warnings;
 138    }
 139   
 140    }