| 59 | } |
| 60 | |
| 61 | private static List<String> splitOnComma(String str, int start, int end) { |
| 62 | int depth = 0; |
| 63 | StringBuilder current = new StringBuilder(); |
| 64 | List<String> split = new ArrayList<>(); |
| 65 | for (int i = start; i < end; i++) { |
| 66 | char c = str.charAt(i); |
| 67 | switch (c) { |
| 68 | case '<': |
| 69 | depth++; |
| 70 | break; |
| 71 | case '>': |
| 72 | depth--; |
| 73 | break; |
| 74 | case ',': |
| 75 | if (depth != 0) { |
| 76 | break; |
| 77 | } |
| 78 | split.add(current.toString().trim()); |
| 79 | current = new StringBuilder(); |
| 80 | continue; |
| 81 | } |
| 82 | current.append(c); |
| 83 | } |
| 84 | String last = current.toString().trim(); |
| 85 | if (last.length() != 0) { |
| 86 | split.add(last); |
| 87 | } |
| 88 | return split; |
| 89 | } |
| 90 | |
| 91 | /** |
| 92 | * Constructs a ConfigType from a base class type and a list of component ConfigTypes |