public class XmlParser
extends java.lang.Object
<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.
<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>
Constructor and Description |
---|
XmlParser() |
Modifier and Type | Method and Description |
---|---|
private java.lang.reflect.AccessibleObject |
findMethodOrField(java.lang.Object bean,
java.lang.String field,
java.lang.String method)
Finds a
Method or Method in the bean
instance with the requested name. |
void |
parse(org.xml.sax.InputSource xml,
CmdLineParser parser,
java.lang.Object bean) |
void |
parse(java.net.URL xml,
CmdLineParser parser,
java.lang.Object bean) |
public void parse(java.net.URL xml, CmdLineParser parser, java.lang.Object bean)
public void parse(org.xml.sax.InputSource xml, CmdLineParser parser, java.lang.Object bean)
private java.lang.reflect.AccessibleObject findMethodOrField(java.lang.Object bean, java.lang.String field, java.lang.String method) throws java.lang.SecurityException, java.lang.NoSuchFieldException, java.lang.NoSuchMethodException, java.lang.ClassNotFoundException
Method
or Method
in the bean
instance with the requested name.bean
- bean instancefield
- name of the field (field XOR method must be specified)method
- name of the method (field XOR method must be specified)java.lang.SecurityException
java.lang.NoSuchFieldException
java.lang.NoSuchMethodException
java.lang.ClassNotFoundException