Beispiel #1
1
  /** @param config */
  public DecorateHandler(TagConfig config) {
    super(config);
    this.template = this.getRequiredAttribute("template");
    this.handlers = new HashMap();

    Iterator itr = this.findNextByType(DefineHandler.class);
    DefineHandler d = null;
    while (itr.hasNext()) {
      d = (DefineHandler) itr.next();
      this.handlers.put(d.getName(), d);
      if (log.isLoggable(Level.FINE)) {
        log.fine(tag + " found Define[" + d.getName() + "]");
      }
    }
    List paramC = new ArrayList();
    itr = this.findNextByType(ParamHandler.class);
    while (itr.hasNext()) {
      paramC.add(itr.next());
    }
    if (paramC.size() > 0) {
      this.params = new ParamHandler[paramC.size()];
      for (int i = 0; i < this.params.length; i++) {
        this.params[i] = (ParamHandler) paramC.get(i);
      }
    } else {
      this.params = null;
    }
  }
Beispiel #2
0
 public boolean apply(FaceletContext ctx, UIComponent parent, String name) throws IOException {
   if (name != null) {
     DefineHandler handler = (DefineHandler) this.handlers.get(name);
     if (handler != null) {
       handler.applyDefinition(ctx, parent);
       return true;
     } else {
       return false;
     }
   } else {
     this.nextHandler.apply(ctx, parent);
     return true;
   }
 }