/** * Creates an {@link OptionHandler} that handles the given {@link Option} annotation * and the {@link Setter} instance. */ protected OptionHandler createOptionHandler(OptionDef o, Setter setter) { checkNonNull(o, "OptionDef"); checkNonNull(setter, "Setter"); return OptionHandlerRegistry.getRegistry().createOptionHandler(this, o, setter); }
/** * Creates an {@link OptionHandler} that handles the given {@link Option} annotation * and the {@link Setter} instance. */ protected OptionHandler createOptionHandler(OptionDef o, Setter setter) { checkNonNull(o, "OptionDef"); checkNonNull(setter, "Setter"); return OptionHandlerRegistry.getRegistry().createOptionHandler(this, o, setter); }
/** * Registers a user-defined {@link OptionHandler} class with args4j. * * <p> * This method allows users to extend the behavior of args4j by writing * their own {@link OptionHandler} implementation. * * @param valueType * The specified handler is used when the field/method annotated by {@link Option} * is of this type. * @param handlerClass * This class must have the constructor that has the same signature as * {@link OptionHandler#OptionHandler(CmdLineParser, OptionDef, Setter)} * @throws NullPointerException if {@code valueType} or {@code handlerClass} is {@code null}. * @throws IllegalArgumentException if {@code handlerClass} is not a subtype of {@code OptionHandler}. * @deprecated You should use {@link OptionHandlerRegistry#registerHandler(java.lang.Class, java.lang.Class)} instead. */ public static void registerHandler( Class valueType, Class<? extends OptionHandler> handlerClass ) { checkNonNull(valueType, "valueType"); checkNonNull(handlerClass, "handlerClass"); OptionHandlerRegistry.getRegistry().registerHandler(valueType, handlerClass); }
/** * Registers a user-defined {@link OptionHandler} class with args4j. * * <p> * This method allows users to extend the behavior of args4j by writing * their own {@link OptionHandler} implementation. * * @param valueType * The specified handler is used when the field/method annotated by {@link Option} * is of this type. * @param handlerClass * This class must have the constructor that has the same signature as * {@link OptionHandler#OptionHandler(CmdLineParser, OptionDef, Setter)} * @throws NullPointerException if {@code valueType} or {@code handlerClass} is {@code null}. * @throws IllegalArgumentException if {@code handlerClass} is not a subtype of {@code OptionHandler}. * @deprecated You should use {@link OptionHandlerRegistry#registerHandler(java.lang.Class, java.lang.Class)} instead. */ public static void registerHandler( Class valueType, Class<? extends OptionHandler> handlerClass ) { checkNonNull(valueType, "valueType"); checkNonNull(handlerClass, "handlerClass"); OptionHandlerRegistry.getRegistry().registerHandler(valueType, handlerClass); }
public LoaderOptions() { OptionHandlerRegistry.getRegistry().registerHandler(Level.class, Log4jLevelOptionHandler.class); }
/** * Creates an {@link OptionHandler} that handles the given {@link Option} annotation * and the {@link Setter} instance. */ protected OptionHandler createOptionHandler(OptionDef o, Setter setter) { checkNonNull(o, "OptionDef"); checkNonNull(setter, "Setter"); return OptionHandlerRegistry.getRegistry().createOptionHandler(this, o, setter); }
/** * Creates an {@link OptionHandler} that handles the given {@link Option} annotation * and the {@link Setter} instance. */ protected OptionHandler createOptionHandler(OptionDef o, Setter setter) { checkNonNull(o, "OptionDef"); checkNonNull(setter, "Setter"); return OptionHandlerRegistry.getRegistry().createOptionHandler(this, o, setter); }
/** * Registers a user-defined {@link OptionHandler} class with args4j. * * <p> * This method allows users to extend the behavior of args4j by writing * their own {@link OptionHandler} implementation. * * @param valueType * The specified handler is used when the field/method annotated by {@link Option} * is of this type. * @param handlerClass * This class must have the constructor that has the same signature as * {@link OptionHandler#OptionHandler(CmdLineParser, OptionDef, Setter)} * @throws NullPointerException if {@code valueType} or {@code handlerClass} is {@code null}. * @throws IllegalArgumentException if {@code handlerClass} is not a subtype of {@code OptionHandler}. * @deprecated You should use {@link OptionHandlerRegistry#registerHandler(java.lang.Class, java.lang.Class)} instead. */ public static void registerHandler( Class valueType, Class<? extends OptionHandler> handlerClass ) { checkNonNull(valueType, "valueType"); checkNonNull(handlerClass, "handlerClass"); OptionHandlerRegistry.getRegistry().registerHandler(valueType, handlerClass); }
/** * Registers a user-defined {@link OptionHandler} class with args4j. * * <p> * This method allows users to extend the behavior of args4j by writing * their own {@link OptionHandler} implementation. * * @param valueType * The specified handler is used when the field/method annotated by {@link Option} * is of this type. * @param handlerClass * This class must have the constructor that has the same signature as * {@link OptionHandler#OptionHandler(CmdLineParser, OptionDef, Setter)} * @throws NullPointerException if {@code valueType} or {@code handlerClass} is {@code null}. * @throws IllegalArgumentException if {@code handlerClass} is not a subtype of {@code OptionHandler}. * @deprecated You should use {@link OptionHandlerRegistry#registerHandler(java.lang.Class, java.lang.Class)} instead. */ public static void registerHandler( Class valueType, Class<? extends OptionHandler> handlerClass ) { checkNonNull(valueType, "valueType"); checkNonNull(handlerClass, "handlerClass"); OptionHandlerRegistry.getRegistry().registerHandler(valueType, handlerClass); }