Ejemplo n.º 1
0
 public void setValue(String key, String value) {
   SimpleSet<String> set = childProperties.get(key);
   if (set != null) {
     for (String ChildKey : set) {
       int pos = getEntityPos(ChildKey);
       if (pos >= 0) {
         Object entity = stack.getKeyByIndex(pos);
         SendableEntityCreator creator = stack.getValueByIndex(pos);
         creator.setValue(entity, ChildKey, value, IdMap.NEW);
       }
     }
   }
 }
Ejemplo n.º 2
0
 /**
  * Add a new Reference Object to Stack.
  *
  * @param tag The new Tag
  * @param item new Reference Object
  * @param creator The Creator for the Item
  * @return XMLTokener Instance
  */
 public MapEntityStack withStack(String tag, Object item, SendableEntityCreator creator) {
   stack.add(item, creator);
   tags.add(tag);
   String[] properties = creator.getProperties();
   for (String property : properties) {
     int lastPos = property.lastIndexOf(IdMap.ENTITYSPLITTER);
     if (lastPos >= 0) {
       String prop;
       if (lastPos == property.length() - 1) {
         // Value of XML Entity like uni.
         prop = ".";
       } else {
         prop = property.substring(lastPos + 1);
       }
       int pos = childProperties.indexOf(prop);
       if (pos >= 0) {
         childProperties.getValueByIndex(pos).add(property);
       } else {
         SimpleSet<String> child = new SimpleSet<String>();
         child.add(property);
         childProperties.put(prop, child);
       }
     }
   }
   return this;
 }