(Element model, Container view)
| 360 | } |
| 361 | |
| 362 | private void build(Element model, Container view) { |
| 363 | List<Element> children = getChildren(model); |
| 364 | int len = children.size(); |
| 365 | for (int i = 0; i < len; i++) { |
| 366 | Element child = children.get(i); |
| 367 | if (child.isTextElement()) { |
| 368 | continue; |
| 369 | } |
| 370 | String tagName = child.getTagName(); |
| 371 | |
| 372 | Component cmp; |
| 373 | if (tagName.startsWith("$")) { |
| 374 | String pname = tagName.substring(1); |
| 375 | if (!parameters.containsKey(pname)) { |
| 376 | throw new IllegalArgumentException("Missing parameter " + pname); |
| 377 | } |
| 378 | cmp = parameters.get(pname); |
| 379 | decorate(child, cmp); |
| 380 | } else { |
| 381 | cmp = getFactory().newComponent(child); |
| 382 | decorate(child, cmp); |
| 383 | } |
| 384 | |
| 385 | Object constraint = getFactory().newConstraint(view, model, cmp, child); |
| 386 | view.add(constraint, cmp); |
| 387 | if (cmp instanceof Container) { |
| 388 | build(child, (Container) cmp); |
| 389 | } |
| 390 | |
| 391 | } |
| 392 | } |
| 393 | |
| 394 | private void reset() { |
| 395 | view = null; |
no test coverage detected