Coverage Report - org.apache.maven.changelog.ChangeLog
 
Classes in this File Line Coverage Branch Coverage Complexity
ChangeLog
80% 
N/A 
1
 
 1  
 package org.apache.maven.changelog;
 2  
 
 3  
 /*
 4  
  * Copyright 2001-2006 The Apache Software Foundation.
 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 implied.
 15  
  * See the License for the specific language governing permissions and
 16  
  * limitations under the License.
 17  
  */
 18  
 
 19  
 // java imports
 20  
 
 21  
 import org.xml.sax.SAXException;
 22  
 
 23  
 import javax.xml.parsers.ParserConfigurationException;
 24  
 import javax.xml.parsers.SAXParser;
 25  
 import javax.xml.parsers.SAXParserFactory;
 26  
 import java.io.IOException;
 27  
 import java.io.InputStream;
 28  
 import java.util.ArrayList;
 29  
 import java.util.List;
 30  
 
 31  
 /**
 32  
  * Change log task. It uses a ChangeLogGenerator and ChangeLogParser to create
 33  
  * a Collection of ChangeLogEntry objects, which are used to produce an XML
 34  
  * output that represents the list of changes.
 35  
  *
 36  
  * @author <a href="mailto:glenn@somanetworks.com">Glenn McAllister</a>
 37  
  * @author <a href="mailto:jeff.martin@synamic.co.uk">Jeff Martin</a>
 38  
  * @author <a href="mailto:jason@zenplex.com">Jason van Zyl</a>
 39  
  * @author <a href="mailto:dion@multitask.com.au">dIon Gillard</a>
 40  
  * @author <a href="mailto:bodewig@apache.org">Stefan Bodewig</a>
 41  
  * @author <a href="mailto:peter@apache.org">Peter Donald</a>
 42  
  * @version $Id: ChangeLog.java 387745 2006-03-22 07:02:52 +0100 (on, 22 mar 2006) brett $
 43  
  */
 44  0
 public class ChangeLog
 45  
 {
 46  
     /**
 47  
      * parses a previously generated changelog xml document and return its changed sets
 48  
      *
 49  
      * @param stream the changelog xml document
 50  
      * @return changelog sets parsed from the xml document
 51  
      * @throws ParserConfigurationException when instantiation of the SAX parser failed
 52  
      * @throws SAXException                 when an error occurred while parsing the xml document
 53  
      * @throws IOException                  when an error occurred while accessing the xml document
 54  
      */
 55  
     public static List loadChangedSets( InputStream stream )
 56  
         throws ParserConfigurationException, SAXException, IOException
 57  
     {
 58  55
         SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
 59  
 
 60  55
         List changeLogSets = new ArrayList();
 61  
 
 62  55
         parser.parse( stream, new ChangeLogHandler( changeLogSets ) );
 63  
 
 64  55
         return changeLogSets;
 65  
     }
 66  
 } // end of ChangeLog