Skip to content

Commit 8cca4f3

Browse files
authored
Updated source files for version 1.9.8
1 parent d69e4ab commit 8cca4f3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+23782
-1196
lines changed

AndroidAppGenerator.java

Lines changed: 3293 additions & 0 deletions
Large diffs are not rendered by default.

AppGenerator.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import java.util.Vector;
2+
import java.io.*;
3+
4+
/* Package: Mobile */
5+
/******************************
6+
* Copyright (c) 2003,2020 Kevin Lano
7+
* This program and the accompanying materials are made available under the
8+
* terms of the Eclipse Public License 2.0 which is available at
9+
* http://www.eclipse.org/legal/epl-2.0
10+
*
11+
* SPDX-License-Identifier: EPL-2.0
12+
* *****************************/
13+
14+
15+
public abstract class AppGenerator
16+
{
17+
18+
public abstract void modelFacade(String packageName, Vector usecases, CGSpec cgs,
19+
Vector entities, Vector clouds, Vector types,
20+
int remoteCalls, boolean needsMaps, PrintWriter out);
21+
22+
public abstract void singlePageApp(UseCase uc, String appName, String image, CGSpec cgs, Vector types, Vector entities, PrintWriter out);
23+
24+
public abstract void listViewController(Entity e, PrintWriter out);
25+
26+
// public static void generateInternetAccessor(String packagename, PrintWriter out);
27+
28+
}

Association.java

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import java.util.List;
44

55
/******************************
6-
* Copyright (c) 2003,2019 Kevin Lano
6+
* Copyright (c) 2003,2020 Kevin Lano
77
* This program and the accompanying materials are made available under the
88
* terms of the Eclipse Public License 2.0 which is available at
99
* http://www.eclipse.org/legal/epl-2.0
@@ -36,13 +36,41 @@ public class Association extends ModelElement
3636

3737
public Association(Entity e1, Entity e2, int c1,
3838
int c2, String r1, String r2)
39-
{ super(e1.getName() + "_" + e2.getName());
39+
{ super(e1 + "_" + e2);
40+
4041
entity1 = e1;
4142
entity2 = e2;
4243
card1 = c1;
4344
card2 = c2;
4445
role1 = r1;
4546
role2 = r2;
47+
if (e1 == null)
48+
{ System.err.println("!!! FATAL ERROR: null class at association end 1");
49+
return;
50+
}
51+
if (e2 == null)
52+
{ System.err.println("!!! FATAL ERROR: null class at association end 2");
53+
return;
54+
}
55+
}
56+
57+
public Association(Entity e1, Entity e2, String r2)
58+
{ super(e1 + "_" + e2);
59+
60+
entity1 = e1;
61+
entity2 = e2;
62+
card1 = MANY;
63+
card2 = MANY;
64+
// role1 = r1;
65+
role2 = r2;
66+
/* if (e1 == null)
67+
{ System.err.println("!!! FATAL ERROR: null class at association end 1");
68+
return;
69+
}
70+
if (e2 == null)
71+
{ System.err.println("!!! FATAL ERROR: null class at association end 2");
72+
return;
73+
} */
4674
}
4775

4876
public Association(Entity e1, Attribute att)
@@ -294,6 +322,15 @@ public boolean isManyOne() // either way round
294322
card1 == ONE && card2 == MANY;
295323
}
296324

325+
public boolean isZeroOne()
326+
{ return card2 == ZEROONE; }
327+
328+
public boolean isOptional()
329+
{ return card2 == ZEROONE || card2 == MANY; }
330+
331+
public boolean isMandatory()
332+
{ return card2 == ONE || card2 > 1; }
333+
297334
public boolean isPersistent()
298335
{ return hasStereotype("persistent"); }
299336

@@ -596,13 +633,15 @@ public void generateJava(PrintWriter out)
596633

597634
if (qualifier != null)
598635
{ out.println("java.util.Map " + role2 + " = new java.util.HashMap();"); }
599-
else if (card2 == ONE)
636+
else if (card2 == ONE && entity2 != null)
600637
{ out.println(entity2.getName() + " " + role2 + ";"); }
601-
else
638+
else if (entity2 != null)
602639
{ out.println("List " +
603640
role2 + initialiser + "; // of " +
604641
entity2.getName());
605642
}
643+
else
644+
{ out.println("Object " + role2 + "; // Undefined class type"); }
606645
}
607646
} // not valid for a..b a > 0. Should be array then?
608647

0 commit comments

Comments
 (0)