Exemplo n.º 1
0
 @Override
 public void endElement(String uri, String localName, String qName) throws SAXException {
   if (localName.equals("name")) {
     if (theGod != null) {
       theGod.setName(lastValue);
     } else {
       thePantheon.setName(lastValue);
     }
   } else if (localName.equals("status")) {
     theGod.setStatus(lastValue);
   }
 }
Exemplo n.º 2
0
 @Override
 public void startElement(String uri, String localName, String qName, Attributes attributes)
     throws SAXException {
   if (localName.equals("God")) {
     theGod = new God();
     String id = attributes.getValue("id");
     God.getGodList().put(id, theGod);
     thePantheon = null;
   } else if (localName.equals("Pantheon")) {
     thePantheon = new Pantheon();
     String id = attributes.getValue("id");
     Pantheon.getPantheonList().put(id, thePantheon);
     theGod = null;
   } else if (localName.equals("Belongs")) {
     String id = attributes.getValue("id");
     Pantheon aPantheon = Pantheon.getPantheonList().get(id);
     theGod.getPantheon().add(aPantheon);
   }
 }