예제 #1
0
  @Override
  public void loadXML(Element element, Properties context) {
    super.loadXML(element, context);

    Element[] cs = XMLUtilities.getChildren(element, KbXMLStoreConstants.TAG_FUNCTION);
    for (Element e : cs) {
      ELFunction f = new ELFunction();
      f.loadXML(e, context);
      addFunction(f);
    }
  }
예제 #2
0
 public void mergeFunctions(FunctionTagLib c, Change children) {
   Map<Object, ELFunction> functionMap = new HashMap<Object, ELFunction>();
   for (IELFunction f : getFunctions()) functionMap.put(((KbObject) f).getId(), (ELFunction) f);
   for (IELFunction f : c.getFunctions()) {
     ELFunction loaded = (ELFunction) f;
     ELFunction current = functionMap.get(loaded.getId());
     if (current == null) {
       addFunction(loaded);
       Change change = new Change(this, null, null, loaded);
       children.addChildren(Change.addChange(null, change));
     } else {
       List<Change> rc = current.merge(loaded);
       if (rc != null) children.addChildren(rc);
     }
   }
   for (ELFunction f : functionMap.values()) {
     ELFunction removed = f;
     synchronized (functions) {
       if (functions.contains(removed)) {
         continue;
       }
       functions.remove(removed.getName());
       functionArray = null;
     }
     Change change = new Change(this, null, removed, null);
     children.addChildren(Change.addChange(null, change));
   }
 }