Class CommandLineSupport
java.lang.Object
org.fusesource.hawtbuf.proto.compiler.CommandLineSupport
Support utility that can be used to set the properties on any object
using command line arguments.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static String
converts strings like: test-enabled to testEnabledstatic String[]
setOptions
(Object target, String[] args) Sets the properties of an object given the command line args.
-
Constructor Details
-
CommandLineSupport
public CommandLineSupport()
-
-
Method Details
-
setOptions
Sets the properties of an object given the command line args. if args contains: --ack-mode=AUTO --url=tcp://localhost:61616 --persistent then it will try to call the following setters on the target object. target.setAckMode("AUTO"); target.setURL(new URI("tcp://localhost:61616") ); target.setPersistent(true); Notice the the proper conversion for the argument is determined by examining the setter argument type.- Parameters:
target
- the object that will have it's properties setargs
- the command line options- Returns:
- any arguments that are not valid options for the target
-
convertOptionToPropertyName
converts strings like: test-enabled to testEnabled- Parameters:
name
-- Returns:
-