Пример #1
0
 public void load(Element root, String eNames, String eName, String oldName) {
   // new format using elements starting version 3.3.1
   if (root.getChild(eNames) != null) {
     @SuppressWarnings("unchecked")
     List<Element> l = root.getChild(eNames).getChildren(eName);
     Attribute a;
     String[] names = new String[l.size()];
     for (int i = 0; i < l.size(); i++) {
       Element name = l.get(i);
       if ((a = name.getAttribute(Xml.NAME)) != null) {
         names[i] = a.getValue();
       }
       // lengths use "VALUE"
       if ((a = name.getAttribute(Xml.VALUE)) != null) {
         names[i] = a.getValue();
       }
     }
     setNames(names);
   } // try old format
   else if (root.getChild(oldName) != null) {
     String[] names = root.getChildText(oldName).split("%%"); // NOI18N
     setNames(names);
   }
 }