Clover coverage report - Maven Clover report
Coverage timestamp: Tue Sep 16 2008 01:16:37 EEST
file stats: LOC: 123   Methods: 7
NCLOC: 54   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
WsmlRuleValidator.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.Iterator;
 20    import java.util.List;
 21   
 22    import org.omwg.logicalexpression.LogicalExpression;
 23    import org.omwg.ontology.Axiom;
 24    import org.omwg.ontology.Concept;
 25    import org.omwg.ontology.Instance;
 26    import org.omwg.ontology.Relation;
 27    import org.omwg.ontology.RelationInstance;
 28    import org.wsmo.common.exception.InvalidModelException;
 29    import org.wsmo.common.exception.SynchronisationException;
 30    import org.wsmo.factory.LogicalExpressionFactory;
 31    import org.wsmo.validator.ValidationError;
 32    import org.wsmo.validator.ValidationWarning;
 33   
 34   
 35    /**
 36    * Checks an ontology for wsml-rule validity.
 37    *
 38    * <pre>
 39    * Created on Aug 18, 2005
 40    * Committed by $Author: morcen $
 41    * $Source$,
 42    * </pre>
 43    *
 44    * @author Holger Lausen (holger.lausen@deri.org)
 45    * @author nathalie.steinmetz@deri.org
 46    * @version $Revision: 1946 $ $Date: 2007-04-02 15:13:28 +0300 (Mon, 02 Apr 2007) $
 47    */
 48    public class WsmlRuleValidator
 49    extends WsmlFullValidator {
 50   
 51  0 public WsmlRuleValidator(LogicalExpressionFactory leFactory) {
 52  0 super(leFactory);
 53    }
 54   
 55    /**
 56    * Checks if an axiom is valid to wsml-rule.
 57    *
 58    * @see org.deri.wsmo4j.validator.WsmlFullValidator#visitAxiom(org.omwg.ontology.Axiom)
 59    */
 60  0 protected void visitAxiom(Axiom axiom) {
 61  0 WsmlRuleExpressionValidator ruleExprVal = new WsmlRuleExpressionValidator(axiom, errors, this);
 62  0 WsmlFullExpressionValidator fullExprVal = new WsmlFullExpressionValidator(axiom, errors);
 63  0 Iterator axioms = axiom.listDefinitions().iterator();
 64  0 while (axioms.hasNext()) {
 65  0 LogicalExpression le = (LogicalExpression) axioms.next();
 66  0 le.accept(fullExprVal);
 67  0 ruleExprVal.setup();
 68  0 le.accept(ruleExprVal);
 69    }
 70    }
 71   
 72    /**
 73    * Checks if a concept is valid to wsml-rule.
 74    *
 75    * @see org.deri.wsmo4j.validator.WsmlFullValidator#visitConcept(org.omwg.ontology.Concept)
 76    */
 77  0 protected void visitConcept(Concept concept) {
 78  0 super.visitConcept(concept);
 79    }
 80   
 81    /**
 82    * Checks if an instance is valid to wsml-rule.
 83    *
 84    * @see org.deri.wsmo4j.validator.WsmlFullValidator#visitInstance(org.omwg.ontology.Instance)
 85    */
 86  0 protected void visitInstance(Instance instance) {
 87  0 super.visitInstance(instance);
 88    }
 89   
 90    /**
 91    * Checks if a relation is valid to wsml-rule.
 92    *
 93    * @see org.deri.wsmo4j.validator.WsmlFullValidator#visitRelation(org.omwg.ontology.Relation)
 94    */
 95  0 protected void visitRelation(Relation relation) {
 96  0 super.visitRelation(relation);
 97    }
 98   
 99    /**
 100    * Checks if a relation instance is valid to wsml-rule.
 101    *
 102    * @throws InvalidModelException
 103    * @throws SynchronisationException
 104    * @see org.deri.wsmo4j.validator.WsmlFullValidator#visitRelationInstance(org.omwg.ontology.RelationInstance)
 105    */
 106  0 protected void visitRelationInstance(RelationInstance relationInstance)
 107    throws SynchronisationException, InvalidModelException {
 108  0 super.visitRelationInstance(relationInstance);
 109    }
 110   
 111  0 public boolean isValid(LogicalExpression logExpr, List <ValidationError> errorMessages, List <ValidationWarning> warningMessages) {
 112  0 super.isValid(logExpr, errorMessages, warningMessages);
 113  0 errors = errorMessages;
 114  0 warnings = warningMessages;
 115  0 WsmlRuleExpressionValidator ruleExprVal = new WsmlRuleExpressionValidator(null, errors, this);
 116  0 WsmlFullExpressionValidator fullExprVal = new WsmlFullExpressionValidator(null, errors);
 117  0 logExpr.accept(fullExprVal);
 118  0 ruleExprVal.setup();
 119  0 logExpr.accept(ruleExprVal);
 120  0 return (errors.isEmpty());
 121    }
 122   
 123    }