Class XmlParser


  • public class XmlParser
    extends java.lang.Object
    Parses an XML-file specifying the 'annotations'. The XML must have the structure:
     <args>
         <option field="" method="" name="" usage="" metavar="" handler=""/>
         <argument field="" method="" usage="" metavar="" handler=""/>
     </args>
     
    Exactly one of the attributes 'field' or 'method' must be set. The 'handler' value specifies a full qualified class name.

    Example

     <args>
         <option field="recursive" name="-r" usage="recursively run something"/>
         <option field="out" name="-o" usage="output to this file" metavar="OUTPUT"/>
         <option method="setStr(String)" name="-str"/>
         <option field="data" name="-custom" handler="org.kohsuke.args4j.spi.BooleanOptionHandler" usage="boolean value for checking the custom handler"/>
         <argument field="arguments"/>
     <args>
     
    Author:
    Jan Materne
    • Constructor Summary

      Constructors 
      Constructor Description
      XmlParser()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void parse​(java.net.URL xml, CmdLineParser parser, java.lang.Object bean)  
      void parse​(org.xml.sax.InputSource xml, CmdLineParser parser, java.lang.Object bean)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • XmlParser

        public XmlParser()
    • Method Detail

      • parse

        public void parse​(java.net.URL xml,
                          CmdLineParser parser,
                          java.lang.Object bean)
      • parse

        public void parse​(org.xml.sax.InputSource xml,
                          CmdLineParser parser,
                          java.lang.Object bean)