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 } } }
final Annotation annot = ((ComponentCtrl) comp).getAnnotation(null, "format"); String pattern = null; if (annot != null) {
protected Object[] loadPropertyAnnotation(Component comp, String propName, String bindName) { ComponentCtrl compCtrl = (ComponentCtrl) comp; Annotation ann = compCtrl.getAnnotation(propName, bindName); if (ann != null) { final Map<String, String[]> attrs = ann.getAttributes(); //(tag, tagExpr)
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); } }
private void loadComponentAnnotation(Component comp, String annotName) { ComponentCtrl compCtrl = (ComponentCtrl) comp; Annotation ann = compCtrl.getAnnotation(null, annotName); if (ann != null) { Map<String, String[]> attrs = ann.getAttributes();
private ValidationMessages initValidationMessages(BindEvaluatorX evalx, Component comp, Binder binder) { final ComponentCtrl compCtrl = (ComponentCtrl) comp; final Annotation idanno = compCtrl.getAnnotation(VALIDATION_MESSAGES_ATTR, ID_ANNO); final Annotation initanno = compCtrl.getAnnotation(VALIDATION_MESSAGES_ATTR, INIT_ANNO); Object vmessages = null; String vname = null;
private Object initViewModel(BindEvaluatorX evalx, Component comp) { final ComponentCtrl compCtrl = (ComponentCtrl) comp; final Annotation idanno = compCtrl.getAnnotation(VIEW_MODEL_ATTR, ID_ANNO); final Annotation initanno = compCtrl.getAnnotation(VIEW_MODEL_ATTR, INIT_ANNO); String vmname = null; Object vm = null;
private AnnotateBinder initBinder(BindEvaluatorX evalx, Component comp) { final ComponentCtrl compCtrl = (ComponentCtrl) comp; final Annotation idanno = compCtrl.getAnnotation(BINDER_ATTR, ID_ANNO); final Annotation initanno = compCtrl.getAnnotation(BINDER_ATTR, INIT_ANNO); Object binder = null; String bname = null;