bpiwowar.argparser.handlers
Class BooleanHandler

java.lang.Object
  extended by bpiwowar.argparser.handlers.Handler
      extended by bpiwowar.argparser.handlers.GenericHandler
          extended by bpiwowar.argparser.handlers.GenericObjectsHandler
              extended by bpiwowar.argparser.handlers.BooleanHandler
Direct Known Subclasses:
BooleanHandler.NoSetValue

public class BooleanHandler
extends GenericObjectsHandler

Author:
bpiwowar

Nested Class Summary
static interface BooleanHandler.NoDefaultValue
          Used for a boolean-handled field when the boolean value must be specified
static class BooleanHandler.NoSetValue
          Use this handler if the boolean value must be explicitely given
 
Field Summary
 
Fields inherited from class bpiwowar.argparser.handlers.GenericObjectsHandler
nbExpectedValues
 
Fields inherited from class bpiwowar.argparser.handlers.GenericHandler
field, object
 
Constructor Summary
BooleanHandler(Object object, Field field)
           
 
Method Summary
 boolean getValue()
           
protected  Object getValue(ArgParser argParser, String arg)
           
 void optionSet()
           
 void setDefault(Boolean b)
          Set the default value
 void setValue(boolean value)
           
 String toString()
           
 
Methods inherited from class bpiwowar.argparser.handlers.GenericObjectsHandler
addValue, get, getAnnotation, newInstance, parse, process, process
 
Methods inherited from class bpiwowar.argparser.handlers.Handler
add, getLimitChecker, getLimitChecker, getRangeChecker, isHelpOption, processAnnotations, setPrefix, updateRangeChecker
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BooleanHandler

public BooleanHandler(Object object,
                      Field field)
Method Detail

getValue

public boolean getValue()

setValue

public void setValue(boolean value)

setDefault

public void setDefault(Boolean b)
Set the default value

Parameters:
b -

toString

public String toString()
Overrides:
toString in class Object

optionSet

public void optionSet()
Overrides:
optionSet in class GenericObjectsHandler

getValue

protected Object getValue(ArgParser argParser,
                          String arg)
                   throws ArgParseException
Overrides:
getValue in class GenericObjectsHandler
Throws:
ArgParseException


Copyright © 2013. All Rights Reserved.