Coverage Report - com.damnhandy.uri.template.MalformedUriTemplateException
 
Classes in this File Line Coverage Branch Coverage Complexity
MalformedUriTemplateException
100%
7/7
N/A
1
 
 1  
 /*
 2  
  * Copyright 2013, Ryan J. McDonough
 3  
  *
 4  
  * Licensed under the Apache License, Version 2.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  *
 8  
  *     http://www.apache.org/licenses/LICENSE-2.0
 9  
  *
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13  
  * See the License for the specific language governing permissions and
 14  
  * limitations under the License.
 15  
  */
 16  
 package com.damnhandy.uri.template;
 17  
 
 18  
 /**
 19  
  * Raised when the the template processor encounters an issue parsing the URI template string. It indicates
 20  
  * the either the template itself is malformed, or an expression within the template is malformed.
 21  
  *
 22  
  * @author <a href="ryan@damnhandy.com">Ryan J. McDonough</a>
 23  
  * @version $Revision: 1.1 $
 24  
  * @since 2.0
 25  
  */
 26  
 public class MalformedUriTemplateException extends RuntimeException
 27  
 {
 28  
 
 29  
    /** The serialVersionUID */
 30  
    private static final long serialVersionUID = 5883174281977078450L;
 31  
 
 32  
    private final int location;
 33  
    /**
 34  
     * Create a new UriTemplateParseException.
 35  
     *
 36  
     * @param message
 37  
     * @param cause
 38  
     */
 39  
    public MalformedUriTemplateException(String message, final int location, Throwable cause)
 40  
    {
 41  12
       super(message, cause);
 42  12
       this.location = location;
 43  12
    }
 44  
 
 45  
    /**
 46  
     * Create a new UriTemplateParseException.
 47  
     *
 48  
     * @param message
 49  
     */
 50  
    public MalformedUriTemplateException(String message, int location)
 51  
    {
 52  58
       super(message);
 53  58
       this.location = location;
 54  58
    }
 55  
 
 56  
    public int getLocation()
 57  
    {
 58  2
       return this.location;
 59  
    }
 60  
 }