예제 #1
0
 /**
  * This method is notified when the end of an element is reached. Does nothing, by default.
  * Specifies whether element is a positional or named argument.
  *
  * @param uri is a Namespace uri. If the element has no Namespace uri or no Namespace
  *     processing is being performed, it is treated as an empty string.
  * @param localName is the local name. If no Namespace processing is being performed
  *     parameter is treated as an empty string.
  * @param qName is the qualified name. If none are available, parameter is treated as an
  *     empty string.
  * @throws SAXException for any SAX exception.
  */
 public void endElement(String uri, String localName, String qName) throws SAXException {
   if (qName.equals("positionalArgument")) {
     ap.addPositionalArgument(aname, adescription, atype);
   }
   if (qName.equals("namedArgument")) {
     ap.addNamedArgument(aname, adescription, atype, adefault, ashorthand);
   }
 }
예제 #2
0
        /**
         * This method is used at the beginning of every element in the XML document. All contents
         * of an element are reported, in order, prior to the invocation of the corresponding
         * endElement() method.
         *
         * @param uri is an empty string if the element has no Namespace URI or Namespace processing
         *     is not being performed. Otherwise, parameter is treated as a Namespace.
         * @param localName if Namespace processing is not being performed, parameter is an empty
         *     string.
         * @param qName represents the qualified name and if no qualified names are available,
         *     parameter is an empty string.
         * @param attributes are attached to the xml elements. This parameter is treated as an empty
         *     Attributes object, if no attributes are available.
         * @throws SAXException for any SAX exception.
         */
        public void startElement(String uri, String localName, String qName, Attributes attributes)
            throws SAXException {

          if (qName.equals("arguments")) {
            ap.addProgram(aname, adescription);
          }

          if (qName.equalsIgnoreCase("name")) {
            name = true;
          }

          if (qName.equalsIgnoreCase("type")) {
            type = true;
          }

          if (qName.equalsIgnoreCase("description")) {
            description = true;
          }

          if (qName.equalsIgnoreCase("default")) {
            defaults = true;
          }
          if (qName.equalsIgnoreCase("shorthand")) {
            shorthand = true;
          }
        }