Coverage Report - org.simpleframework.xml.stream.EventReader
 
Classes in this File Line Coverage Branch Coverage Complexity
EventReader
N/A
N/A
1
 
 1  
 /*
 2  
  * EventReader.java January 2010
 3  
  *
 4  
  * Copyright (C) 2010, 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>EventReader</code> interface is used to represent an XML
 23  
  * reader that can be used to read a source document. This provides
 24  
  * a convenient abstraction that can be used by any number of parser
 25  
  * implementations. In essence it is similar to the Streaming API for
 26  
  * XML, however other implementations can easily be adapted.
 27  
  * 
 28  
  * @author Niall Gallagher
 29  
  */
 30  
 interface EventReader {
 31  
 
 32  
    /**
 33  
     * This is used to take the next node from the document. This will
 34  
     * scan through the document, ignoring any comments to find the
 35  
     * next relevant XML event to acquire. Typically events will be
 36  
     * the start and end of an element, as well as any text nodes.
 37  
     * 
 38  
     * @return this returns the next event taken from the source XML
 39  
     */
 40  
    EventNode next() throws Exception;
 41  
    
 42  
    /**
 43  
     * This is used to peek at the node from the document. This will
 44  
     * scan through the document, ignoring any comments to find the
 45  
     * next relevant XML event to acquire. Typically events will be
 46  
     * the start and end of an element, as well as any text nodes.
 47  
     * 
 48  
     * @return this returns the next event taken from the source XML
 49  
     */
 50  
    EventNode peek() throws Exception;
 51  
 }