Coverage report

  %line %branch
nl.toolforge.karma.core.location.LocationDescriptor
100% 
100% 

 1  
 /*
 2  
 Karma core - Core of the Karma application
 3  
 Copyright (C) 2004  Toolforge <www.toolforge.nl>
 4  
 
 5  
 This library is free software; you can redistribute it and/or
 6  
 modify it under the terms of the GNU Lesser General Public
 7  
 License as published by the Free Software Foundation; either
 8  
 version 2.1 of the License, or (at your option) any later version.
 9  
 
 10  
 This library is distributed in the hope that it will be useful,
 11  
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 12  
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 13  
 Lesser General Public License for more details.
 14  
 
 15  
 You should have received a copy of the GNU Lesser General Public
 16  
 License along with this library; if not, write to the Free Software
 17  
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 18  
 */
 19  
 package nl.toolforge.karma.core.location;
 20  
 
 21  
 import org.apache.commons.digester.Digester;
 22  
 
 23  
 import java.util.ArrayList;
 24  
 
 25  
 /**
 26  
  * Helper class to be able to read locations from an xml structure. This class is capable to handle all formats.
 27  
  *
 28  
  * @author D.A. Smedes
 29  
  * @version $Id: LocationDescriptor.java,v 1.7 2004/10/26 22:48:00 hippe Exp $
 30  
  */
 31  3248
 public class LocationDescriptor {
 32  
 
 33  3248
   private String id = null;
 34  3248
   private String type = null;
 35  
 
 36  3248
   private String host = null;
 37  3248
   private String port = null;
 38  3248
   private String repository = null;
 39  3248
   private String moduleOffset = null;
 40  3248
   private String protocol = null;
 41  
 
 42  
   public String getId() {
 43  3362
     return id;
 44  
   }
 45  
 
 46  
   public void setId(String id) {
 47  3248
     this.id = id;
 48  3248
   }
 49  
 
 50  
   public String getType() {
 51  2558
     return type;
 52  
   }
 53  
 
 54  
   public void setType(String type) {
 55  3248
     this.type = type;
 56  3248
   }
 57  
 
 58  
   public String getHost() {
 59  2558
     return host;
 60  
   }
 61  
 
 62  
   public void setHost(String host) {
 63  3248
     this.host = host;
 64  3248
   }
 65  
 
 66  
   public String getPort() {
 67  2558
     return port;
 68  
   }
 69  
 
 70  
   public void setPort(String port) {
 71  3184
     this.port = port;
 72  3184
   }
 73  
 
 74  
   public String getRepository() {
 75  2558
     return repository;
 76  
   }
 77  
 
 78  
   public void setRepository(String repository) {
 79  3248
     this.repository = repository;
 80  3248
   }
 81  
 
 82  
   public String getModuleOffset() {
 83  2558
     return moduleOffset;
 84  
   }
 85  
 
 86  
   public void setModuleOffset(String moduleOffset) {
 87  2712
     this.moduleOffset = moduleOffset;
 88  2712
   }
 89  
 
 90  
   public String getProtocol() {
 91  2558
     return protocol;
 92  
   }
 93  
 
 94  
   public void setProtocol(String protocol) {
 95  2980
     this.protocol = protocol;
 96  2980
   }
 97  
 
 98  
   /**
 99  
    * Creates a <code>Digester</code> to read xml structures for locations. This digester will create an
 100  
    * <code>ArrayList</code> of <code>LocationDescriptor</code> instances.
 101  
    *
 102  
    * @return A digester instance
 103  
    */
 104  
   public static Digester getDigester() {
 105  
 
 106  1490
     Digester digester = new Digester();
 107  
 
 108  1490
     digester.setNamespaceAware(true);
 109  
 
 110  2102
     digester.addObjectCreate("*/locations", ArrayList.class);
 111  
     
 112  1490
     digester.addObjectCreate("*/locations/location", LocationDescriptor.class);
 113  1490
     digester.addSetProperties("*/locations/location");
 114  
 
 115  1490
     digester.addCallMethod("*/locations/location/protocol", "setProtocol", 0);
 116  1490
     digester.addCallMethod("*/locations/location/host", "setHost", 0);
 117  1490
     digester.addCallMethod("*/locations/location/port", "setPort", 0);
 118  1490
     digester.addCallMethod("*/locations/location/repository", "setRepository", 0);
 119  1490
     digester.addCallMethod("*/locations/location/module-offset", "setModuleOffset", 0);
 120  1490
     digester.addSetNext("*/locations/location", "add");
 121  
 
 122  1490
     return digester;
 123  
   }
 124  
 
 125  
 }

This report is generated by jcoverage, Maven and Maven JCoverage Plugin.