示例#1
0
 public Profile(Element el) {
   name = el.getAttribute("name");
   ids = new HashSet<String>();
   Node child = el.getFirstChild();
   while (child != null) {
     if (child.getNodeType() == Node.ELEMENT_NODE) {
       ids.add(((Element) child).getAttribute("id"));
     }
     child = child.getNextSibling();
   }
 }
示例#2
0
 public void appendTo(Element el) {
   Document doc = el.getOwnerDocument();
   Element p = doc.createElement("profile");
   p.setAttribute("name", name);
   Iterator<String> it = ids.iterator();
   while (it.hasNext()) {
     Element child = doc.createElement("enable");
     child.setAttribute("id", it.next());
     p.appendChild(child);
   }
   el.appendChild(p);
 }
示例#3
0
 public boolean has(String id) {
   return ids.contains(id);
 }
示例#4
0
 public void add(String id) {
   ids.add(id);
 }