1 | private StringBuffer generateIncludes(StringBuffer sb) { | | 1 | /** |
2 | for (Iterator it = systemInc.iterator(); it.hasNext(); ) { | | 2 | * Generates the association ends of the body of a class or interface. |
3 | String inc = (String) it.next(); | | 3 | * @param cls |
4 | sb.append("#include <"); | | 4 | * @param sb Where to put the result. |
5 | sb.append(inc).append('>').append(LINE_SEPARATOR); | | 5 | */ |
6 | } | | 6 | private void generateClassifierBodyTypedefs(Object cls, StringBuffer sb) { |
7 | // separate system from external headers | | 7 | if (generatorPass == HEADER_PASS) { |
8 | if (systemInc.size() > 0) sb.append(LINE_SEPARATOR); | | 8 | Collection publicTypedefStatements = |
9 | for (Iterator it = extInc.iterator(); it.hasNext(); ) { | | 9 | findTagValues(cls, TV_NAME_TYPEDEF_PUBLIC); |
10 | String inc = (String) it.next(); | | 10 | Collection protectedTypedefStatements = |
11 | sb.append("#include <"); | | 11 | findTagValues(cls, TV_NAME_TYPEDEF_PROTECTED); |
12 | sb.append(inc).append('>').append(LINE_SEPARATOR); | | 12 | Collection privateTypedefStatements = |
13 | } | | 13 | findTagValues(cls, TV_NAME_TYPEDEF_PRIVATE); |
14 | // separate external from local headers | | 14 | if (!publicTypedefStatements.isEmpty()) { |
15 | if (extInc.size() > 0) sb.append(LINE_SEPARATOR); | | 15 | sb.append(LINE_SEPARATOR).append(" public:") |
16 | for (Iterator it = localInc.iterator(); it.hasNext(); ) { | | 16 | .append(LINE_SEPARATOR).append(indent); |
17 | String inc = (String) it.next(); | | 17 | sb.append("// public type definitions for header defined " |
18 | sb.append("#include \"").append(inc).append("\"" + LINE_SEPARATOR); | | 18 | + "by Tag entries in ArgoUML").append(LINE_SEPARATOR); |
19 | } | | 19 | sb.append(indent); |
20 | return sb; | | 20 | sb.append("// Result: typedef <typedef_public> " |
21 | } | | 21 | + "<tag_value>;").append(LINE_SEPARATOR); |
| | | 22 | Iterator typedefEnum = publicTypedefStatements.iterator(); |
| | | 23 | |
| | | 24 | while (typedefEnum.hasNext()) { |
| | | 25 | sb.append(indent).append("typedef "); |
| | | 26 | sb.append(typedefEnum.next()) |
| | | 27 | .append(";").append(LINE_SEPARATOR); |
| | | 28 | } |
| | | 29 | } |
| | | 30 | if (!protectedTypedefStatements.isEmpty()) { |
| | | 31 | sb.append(LINE_SEPARATOR).append(" protected:") |
| | | 32 | .append(LINE_SEPARATOR).append(indent); |
| | | 33 | sb.append("// protected type definitions for header defined " |
| | | 34 | + "by Tag entries in ArgoUML").append(LINE_SEPARATOR); |
| | | 35 | sb.append(indent); |
| | | 36 | sb.append("// Result: typedef <typedef_protected> " |
| | | 37 | + "<tag_value>;").append(LINE_SEPARATOR); |
| | | 38 | Iterator typedefEnum = protectedTypedefStatements.iterator(); |
| | | 39 | |
| | | 40 | while (typedefEnum.hasNext()) { |
| | | 41 | sb.append(indent).append("typedef "); |
| | | 42 | sb.append(typedefEnum.next()) |
| | | 43 | .append(";").append(LINE_SEPARATOR); |
| | | 44 | } |
| | | 45 | } |
| | | 46 | if (!privateTypedefStatements.isEmpty()) { |
| | | 47 | sb.append(LINE_SEPARATOR).append(" private:") |
| | | 48 | .append(LINE_SEPARATOR).append(indent); |
| | | 49 | sb.append("// private type definitions for header defined " |
| | | 50 | + "by Tag entries in ArgoUML").append(LINE_SEPARATOR); |
| | | 51 | sb.append(indent); |
| | | 52 | sb.append("// Result: typedef <typedef_private> " |
| | | 53 | + "<tag_value>;").append(LINE_SEPARATOR); |
| | | 54 | Iterator typedefEnum = privateTypedefStatements.iterator(); |
| | | 55 | |
| | | 56 | while (typedefEnum.hasNext()) { |
| | | 57 | sb.append(indent).append("typedef "); |
| | | 58 | sb.append(typedefEnum.next()).append(";") |
| | | 59 | .append(LINE_SEPARATOR); |
| | | 60 | } |
| | | 61 | } |
| | | 62 | } |
| | | 63 | } |