Contains the basic command infrastructure, including the default implementations of the CommandParser and several InputProcessors.
Writing commands for the debugger is actually very easy.
The first step is to create the initial version of the class that
will implement the Command
interface. This is most
easily done by extending the AbstractCommand
abstract
class and providing the implementation for the abstract methods. Note
that you may name this class whatever is suitable for you, as the
name of the command and the name of the implementing class are not at
all related.
Next, add the fully-qualified name of the class to a plain text
file called com.bluemarsh.jswat.command.Command
, which
should be located in META-INF/services
in your module
.jar
file. See the NetBeans OpenAPIs documentation under
"Services & Lookup" for more information on services
and how to define them.
The final step is to add properties to the
Bundle.properties
file in the package containing your
command class. These two properties must be named
<name>_Description
and
<name>_Help
, where <name> is the string
returned from the getName()
method of your command
class.
As with commands, writing input processors is quite easy.
First, create the initial version of the class that will implement
the InputProcessor
interface.
Next, add the fully-qualified name of the class to a plain text
file called com.bluemarsh.jswat.command.InputProcessor
,
which should be located in META-INF/services
in your
module .jar
file. See the NetBeans OpenAPIs
documentation under "Services & Lookup" for more
information on services and how to define them.
Note that the ordering of the InputProcessor
implementations listed in the above file is important. The order that
the input processors are listed is the order in which they are
executed by the command parser. NetBeans allows changing the order of
service entries, which you can read about in the "Services &
Lookup" section of the OpenAPI documentation.
While this is possible, it is quite unlikely that you will want to write your own command parser, as there is little value in doing so. Nonetheless, below is an explanation of how to go about doing this.
Start by creating the initial version of the class that will
implement the CommandParser
interface. This is most
easily done by extending the AbstractCommandParser
abstract class and providing the implementation for the abstract
methods.
Next, add the fully-qualified name of the class to a plain text
file called com.bluemarsh.jswat.command.CommandParser
,
which should be located in META-INF/services
in your
module .jar
file. See the NetBeans OpenAPIs
documentation under "Services & Lookup" for more
information on services and how to define them.
Note that in order to replace the implementation that is included in the debugger, you will need to "remove" it from the list of services. See the API documentation mentioned above for an example of how this is done.