Exemple #1
0
 /**
  * this is fired when a tag end event is found on an xml document
  *
  * @param uri namespace for tag being processed
  * @param localName tag name
  * @param qName fully qualified tag name
  * @throws SAXException if parsing fails
  */
 @Override
 public void endElement(String uri, String localName, String qName) throws SAXException {
   // if a class element is ending
   if (qName.equalsIgnoreCase(TAG_NAME)) {
     // release the parsing context so that another object may take control of parsing operations
     mCtx.popHandler();
   }
 }
Exemple #2
0
 /**
  * this is fired when a tag start event is found on an xml document
  *
  * @param uri namespace for tag being processed
  * @param localName tag name
  * @param qName fully qualified name for tag
  * @param attributes tag attributes
  * @throws SAXException if parsing fails
  */
 @Override
 public void startElement(String uri, String localName, String qName, Attributes attributes)
     throws SAXException {
   // if a class is being parsed
   if (qName.equalsIgnoreCase(getTagName())) {
     // set class name from xml attributes
     mClassName = attributes.getValue(TAG_ATTRIBUTES.name.toString());
     // if an attribute is being parsed
   } else if (qName.equalsIgnoreCase(AttributeDescriptor.TAG_NAME)) {
     // create an attribute descriptor
     AttributeDescriptor attribute = new AttributeDescriptor();
     // add an attribute to this class
     mAttributes.add(attribute);
     // let the attribute parse itself
     mCtx.pushHandler(attribute);
     // forward event to new handler
     attribute.startElement(uri, localName, qName, attributes);
   }
 }