Clover coverage report - Maven Clover report
Coverage timestamp: Tue Sep 16 2008 01:16:37 EEST
file stats: LOC: 65   Methods: 3
NCLOC: 29   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
AttributeErrorImpl.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    import org.omwg.ontology.Attribute;
 19    import org.wsmo.common.*;
 20    import org.wsmo.validator.AttributeError;
 21   
 22    public class AttributeErrorImpl extends ValidationErrorImpl implements AttributeError {
 23   
 24    private Attribute attribute = null;
 25   
 26   
 27  0 public AttributeErrorImpl(Entity entity, Attribute attribute, String reason, String variant) {
 28  0 super(entity, reason, variant);
 29  0 this.attribute = attribute;
 30    }
 31   
 32    /**
 33    *
 34    * @see org.wsmo.validator.AttributeError#getAttribute()
 35    * @return String representation of the attribute in which the violation occured
 36    */
 37  0 public Attribute getAttribute() {
 38  0 return attribute;
 39    }
 40   
 41    /**
 42    * Formats the String representation of the ValidationError.
 43    *
 44    * @see java.lang.Object#toString()
 45    */
 46  0 public String toString() {
 47  0 String id = "<Identifier>";
 48   
 49    //short id if possible:
 50  0 if (getEntity() != null) {
 51  0 id = getEntity().getIdentifier().toString();
 52  0 if (getEntity().getIdentifier()instanceof IRI) {
 53  0 id = ((IRI)getEntity().getIdentifier()).getLocalName();
 54    }
 55    }
 56    //short for variant if possible
 57  0 String shortVariant = getViolatesVariant();
 58  0 if (getViolatesVariant().lastIndexOf('/') != -1) {
 59  0 shortVariant = getViolatesVariant().substring(getViolatesVariant().lastIndexOf('/') + 1);
 60    }
 61  0 return id + ":\n" + getReason() + "\n(violated variant: " +
 62    shortVariant + ")";
 63    }
 64   
 65    }