1 | private String items2Msg(String preface, Collection<T> items) { | | 1 | /** |
2 | StringBuffer msg = new StringBuffer(preface); | | 2 | * Generates the association ends of the body of a class or interface. |
3 | for (T item : items) { | | 3 | * @param cls |
4 | msg.append("\t"); | | 4 | * @param sb Where to put the result. |
5 | msg.append(item.toString()); | | 5 | */ |
6 | msg.append("\n"); | | 6 | private void generateClassifierBodyTypedefs(Object cls, StringBuffer sb) { |
7 | } | | 7 | if (generatorPass == HEADER_PASS) { |
8 | return msg.toString(); | | 8 | Collection publicTypedefStatements = |
9 | } | | 9 | findTagValues(cls, TV_NAME_TYPEDEF_PUBLIC); |
| | | 10 | Collection protectedTypedefStatements = |
| | | 11 | findTagValues(cls, TV_NAME_TYPEDEF_PROTECTED); |
| | | 12 | Collection privateTypedefStatements = |
| | | 13 | findTagValues(cls, TV_NAME_TYPEDEF_PRIVATE); |
| | | 14 | if (!publicTypedefStatements.isEmpty()) { |
| | | 15 | sb.append(LINE_SEPARATOR).append(" public:") |
| | | 16 | .append(LINE_SEPARATOR).append(indent); |
| | | 17 | sb.append("// public type definitions for header defined " |
| | | 18 | + "by Tag entries in ArgoUML").append(LINE_SEPARATOR); |
| | | 19 | sb.append(indent); |
| | | 20 | sb.append("// Result: typedef <typedef_public> " |
| | | 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 | } |