Coverage Report - org.simpleframework.xml.stream.Position
 
Classes in this File Line Coverage Branch Coverage Complexity
Position
N/A
N/A
1
 
 1  
 /*
 2  
  * Position.java July 2006
 3  
  *
 4  
  * Copyright (C) 2006, Niall Gallagher <niallg@users.sf.net>
 5  
  *
 6  
  * Licensed under the Apache License, Version 2.0 (the "License");
 7  
  * you may not use this file except in compliance with the License.
 8  
  * You may obtain a copy of the License at
 9  
  *
 10  
  *     http://www.apache.org/licenses/LICENSE-2.0
 11  
  *
 12  
  * Unless required by applicable law or agreed to in writing, software
 13  
  * distributed under the License is distributed on an "AS IS" BASIS,
 14  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 
 15  
  * implied. See the License for the specific language governing 
 16  
  * permissions and limitations under the License.
 17  
  */
 18  
 
 19  
 package org.simpleframework.xml.stream;
 20  
 
 21  
 /**
 22  
  * The <code>Position</code> object is used to acquire the position
 23  
  * of the read cursor within the XML file. This allows exceptions to
 24  
  * be thrown with the line number so that the XML can be debugged. 
 25  
  * 
 26  
  * @author Niall Gallagher
 27  
  */ 
 28  
 public interface Position {
 29  
 
 30  
    /**
 31  
     * This is the actual line number within the read XML document. 
 32  
     * The line number allows any problems within the source XML
 33  
     * document to be debugged if it does not match the schema. 
 34  
     * This will return -1 if the line number cannot be determined.
 35  
     *
 36  
     * @return this returns the line number of an XML event 
 37  
     */        
 38  
    int getLine();
 39  
 
 40  
    /**
 41  
     * This provides a textual description of the position the 
 42  
     * read cursor is at within the XML document. This allows the
 43  
     * position to be embedded within the exception thrown.
 44  
     *
 45  
     * @return this returns a textual description of the position
 46  
     */ 
 47  
    String toString();   
 48  
 }