Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
MultiplicityNotation |
|
| 1.0;1 |
1 | /* $Id: MultiplicityNotation.java 18636 2010-08-12 08:08:19Z mvw $ | |
2 | ***************************************************************************** | |
3 | * Copyright (c) 2009-2010 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 | * dthompson | |
11 | * mvw | |
12 | ***************************************************************************** | |
13 | * | |
14 | * Some portions of this file was previously release using the BSD License: | |
15 | */ | |
16 | ||
17 | // Copyright (c) 2007 The Regents of the University of California. All | |
18 | // Rights Reserved. Permission to use, copy, modify, and distribute this | |
19 | // software and its documentation without fee, and without a written | |
20 | // agreement is hereby granted, provided that the above copyright notice | |
21 | // and this paragraph appear in all copies. This software program and | |
22 | // documentation are copyrighted by The Regents of the University of | |
23 | // California. The software program and documentation are supplied "AS | |
24 | // IS", without any accompanying services from The Regents. The Regents | |
25 | // does not warrant that the operation of the program will be | |
26 | // uninterrupted or error-free. The end-user understands that the program | |
27 | // was developed for research purposes and is advised not to rely | |
28 | // exclusively on the program for any reason. IN NO EVENT SHALL THE | |
29 | // UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, | |
30 | // SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, | |
31 | // ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF | |
32 | // THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF | |
33 | // SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY | |
34 | // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | |
35 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE | |
36 | // PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF | |
37 | // CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, | |
38 | // UPDATES, ENHANCEMENTS, OR MODIFICATIONS. | |
39 | ||
40 | package org.argouml.notation.providers; | |
41 | ||
42 | import org.argouml.model.Model; | |
43 | import org.argouml.notation.NotationProvider; | |
44 | ||
45 | /** | |
46 | * This abstract class forms the basis of all Notation providers | |
47 | * for the text shown in the Fig that represents a Multiplicity. | |
48 | * Subclass this for all languages. <p> | |
49 | * | |
50 | * This NotationProvider is a bit special, in that it does not | |
51 | * generate for the given UML element, but for its multiplicity. | |
52 | * | |
53 | * @author Michiel | |
54 | */ | |
55 | public abstract class MultiplicityNotation extends NotationProvider { | |
56 | ||
57 | /** | |
58 | * The constructor. | |
59 | * | |
60 | * @param multiplicityOwner the UML element that has a Multiplicity | |
61 | */ | |
62 | 0 | public MultiplicityNotation(Object multiplicityOwner) { |
63 | // If this fails, then there is a problem... | |
64 | // dthompson 29/12/2008: It seems that the returned value is | |
65 | // irrelevant here, so I assume that the purpose of this call | |
66 | // is just to throw an exception in case of a problem. | |
67 | /* mvw: Indeed. The intention of the constructor parameter is to prove | |
68 | * that there is a valid UML object to bind the notation to. | |
69 | * So, the next statement should fail on a null parameter, | |
70 | * and on anything that is not an object of which | |
71 | * we can retrieve the multiplicity. */ | |
72 | 0 | Model.getFacade().getMultiplicity(multiplicityOwner); |
73 | 0 | } |
74 | ||
75 | } |