A command listener handles commands like “GetDatabaseList”, “GetUsers”, “DeleteUsers”, and so on. The CommandString class was introduced to let each command listener programmer think of their commands in the simplest way. The CommandString class is declared as:
public abstract class CommandString
The only constructors are declared as:
These two declarations combined mean that instances of this class can never be instantiated and derived classes must call the CommandString(String original) constructor with a valid String object as the parameter.
The most important action that instances of this class do is take the original String object and prepend the class name, including the package name, to the front of the String. This new value is then returned when the object’s toString() method is called.