Coverage Report - org.argouml.application.helpers.ApplicationVersion
 
Classes in this File Line Coverage Branch Coverage Complexity
ApplicationVersion
66%
8/12
25%
2/8
1
 
 1  
 /* $Id: ApplicationVersion.java 17811 2010-01-12 18:30:46Z linus $
 2  
  *****************************************************************************
 3  
  * Copyright (c) 2009 Contributors - see below
 4  
  * All rights reserved. This program and the accompanying materials
 5  
  * are made available under the terms of the Eclipse Public License v1.0
 6  
  * which accompanies this distribution, and is available at
 7  
  * http://www.eclipse.org/legal/epl-v10.html
 8  
  *
 9  
  * Contributors:
 10  
  *    mvw
 11  
  *****************************************************************************
 12  
  *
 13  
  * Some portions of this file was previously release using the BSD License:
 14  
  */
 15  
 
 16  
 // Copyright (c) 2007-2008 The Regents of the University of California. All
 17  
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 18  
 // software and its documentation without fee, and without a written
 19  
 // agreement is hereby granted, provided that the above copyright notice
 20  
 // and this paragraph appear in all copies. This software program and
 21  
 // documentation are copyrighted by The Regents of the University of
 22  
 // California. The software program and documentation are supplied "AS
 23  
 // IS", without any accompanying services from The Regents. The Regents
 24  
 // does not warrant that the operation of the program will be
 25  
 // uninterrupted or error-free. The end-user understands that the program
 26  
 // was developed for research purposes and is advised not to rely
 27  
 // exclusively on the program for any reason. IN NO EVENT SHALL THE
 28  
 // UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
 29  
 // SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
 30  
 // ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
 31  
 // THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
 32  
 // SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
 33  
 // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 34  
 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
 35  
 // PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
 36  
 // CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
 37  
 // UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 38  
 
 39  
 package org.argouml.application.helpers;
 40  
 
 41  
 /**
 42  
  * Receives the version of the application at initialisation time.
 43  
  * Also knows about website locations that depend on the version of ArgoUML.
 44  
  *
 45  
  * @author Michiel
 46  
  */
 47  900
 public class ApplicationVersion {
 48  
     /**
 49  
      * Version number.
 50  
      */
 51  
     private static String version;
 52  
     private static String stableVersion;
 53  
 
 54  
     /**
 55  
      * Retrieve the version number of the application.
 56  
      *
 57  
      * @return the version number.
 58  
      */
 59  
     public static String getVersion() {
 60  1017
         return version;
 61  
     }
 62  
     
 63  
     /**
 64  
      * Retrieve the online HTML manual of ArgoUML for a critic. 
 65  
      * You need to append the critic class-name.
 66  
      * This syntax is synchronized with:
 67  
      * <ol>
 68  
      * <li>Tags in the manual.
 69  
      * <li>Name of the ArgoUML site.
 70  
      * <li>How the manual is deployed on the site.
 71  
      * </ol>
 72  
      * so this must be updated when any of these change.
 73  
      *
 74  
      * @return the URL
 75  
      */
 76  
     public static String getManualForCritic() {
 77  97200
         return "http://argouml-stats.tigris.org/documentation/"
 78  
             + "manual-" 
 79  
             + stableVersion
 80  
             + "-single/argomanual.html#critics.";
 81  
     }
 82  
 
 83  
     /**
 84  
      * Retrieve the URL of the online manual of ArgoUML.
 85  
      * 
 86  
      * @return the URL
 87  
      */
 88  
     public static String getOnlineManual() {
 89  0
         return "http://argouml-stats.tigris.org/nonav/documentation/"
 90  
                 + "manual-" + stableVersion + "/";
 91  
     }
 92  
 
 93  
     /**
 94  
      * Retrieve the URL of the location for online support for ArgoUML.
 95  
      * 
 96  
      * @return the URL
 97  
      */
 98  
     public static String getOnlineSupport() {
 99  0
         return "http://argouml.tigris.org/nonav/support.html";
 100  
     }
 101  
 
 102  
     /**
 103  
      * Don't allow instantiation.
 104  
      */
 105  0
     private ApplicationVersion() {
 106  0
     }
 107  
 
 108  
     /**
 109  
      * @param v The version to set.
 110  
      * @param sv The stable version to set.
 111  
      */
 112  
     public static void init(String v, String sv) {
 113  900
         assert version == null;
 114  900
         version = v;
 115  900
         assert stableVersion == null;
 116  900
         stableVersion = sv;
 117  900
     }
 118  
 }