String pattern = null; if (annot != null) { pattern = annot.getAttribute("value");
private void resolveInsertComponents(Collection<Component> comps, Map<String, Component> map) { for (Component comp : comps) { final Annotation annt = ((ComponentCtrl) comp).getAnnotation(null, "insert"); if (annt != null) { final String insertName = annt.getAttribute("value"); if (map.containsKey(insertName)) { throw new UiException("Duplicate insert name: " + insertName + " at Component " + comp); } map.put(insertName, comp); } resolveInsertComponents(comp.getChildren(), map); //recursive } } }
private void resolveDefineComponents(Collection<Component> comps, Map<String, Component> map) { if (!comps.isEmpty()) { Component comp = comps.iterator().next(); // join "define" components as children of "insert" component do { final Component nextRoot = comp.getNextSibling(); final Annotation annt = ((ComponentCtrl) comp).getAnnotation(null, "define"); if (annt != null) { final String joinId = annt.getAttribute("value"); final Component insertComp = map.get(joinId); if (insertComp != null) { comp.setParent(insertComp); } else { comp.detach(); //no where to insert } } resolveDefineComponents(comp.getChildren(), map); comp = nextRoot; } while (comp != null); } }
final String idExpr = idanno.getAttribute("value");