Clover coverage report - Code Coverage for tapestry-annotations release 4.0-beta-2
Coverage timestamp: Sat Jul 9 2005 22:06:49 EDT
file stats: LOC: 93   Methods: 6
NCLOC: 43   Classes: 1
30 day Evaluation License registered to hlship@comcast.net Your 30 day evaluation period has expired. Please visit http://www.cenqua.com to obtain a licensed version of Clover
 
 Source file Conditionals Statements Methods TOTAL
AnnotationLocation.java 50% 66.7% 50% 60%
coverage coverage
 1    // Copyright 2005 The Apache Software Foundation
 2    //
 3    // Licensed under the Apache License, Version 2.0 (the "License");
 4    // you may not use this file except in compliance with the License.
 5    // You may obtain a copy of the License at
 6    //
 7    // http://www.apache.org/licenses/LICENSE-2.0
 8    //
 9    // Unless required by applicable law or agreed to in writing, software
 10    // distributed under the License is distributed on an "AS IS" BASIS,
 11    // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12    // See the License for the specific language governing permissions and
 13    // limitations under the License.
 14   
 15    package org.apache.tapestry.annotations;
 16   
 17    import org.apache.hivemind.Location;
 18    import org.apache.hivemind.Resource;
 19    import org.apache.hivemind.util.Defense;
 20   
 21    /**
 22    * Implementation of {@link org.apache.hivemind.Location} that is used to identify the class and/or
 23    * method and annotation. This is useful for line-precise exception reporting of errors related to
 24    * annotations.
 25    *
 26    * @author Howard Lewis Ship
 27    * @since 4.0
 28    */
 29    public class AnnotationLocation implements Location
 30    {
 31    private final Resource _resource;
 32   
 33    private final String _description;
 34   
 35  22 public AnnotationLocation(Resource resource, String description)
 36    {
 37  22 Defense.notNull(resource, "resource");
 38  22 Defense.notNull(description, "description");
 39   
 40  22 _resource = resource;
 41  22 _description = description;
 42    }
 43   
 44    /**
 45    * Returns the location's description.
 46    */
 47   
 48  10 public String toString()
 49    {
 50  10 return _description;
 51    }
 52   
 53    /**
 54    * Returns a resource corresponding to the Java class.
 55    */
 56   
 57  0 public Resource getResource()
 58    {
 59  0 return _resource;
 60    }
 61   
 62    /**
 63    * Always returns 0.
 64    */
 65   
 66  0 public int getLineNumber()
 67    {
 68  0 return 0;
 69    }
 70   
 71    /**
 72    * Always returns 0.
 73    */
 74   
 75  0 public int getColumnNumber()
 76    {
 77  0 return 0;
 78    }
 79   
 80  11 @Override
 81    public boolean equals(Object other)
 82    {
 83  11 if (other instanceof AnnotationLocation)
 84    {
 85  11 AnnotationLocation otherLocation = (AnnotationLocation) other;
 86   
 87  11 return _resource.equals(otherLocation._resource)
 88    && _description.equals(otherLocation._description);
 89    }
 90   
 91  0 return false;
 92    }
 93    }