protoj.core
Class Instruction

java.lang.Object
  extended by protoj.core.Instruction

public final class Instruction
extends java.lang.Object

Value object that represents a single instruction to be carried out. An example of an instruction is: "mycommand -opt1 val1 -opt2 val2" where the instruction name is "mycommand" and the instruction opts is"-opt1 val1 -opt2 val2".

Typically many of these are contained in an InstructionChain instance and represent the result of parsing a chain of instructions specified at the command line.

Author:
Ashley Williams

Constructor Summary
Instruction(java.lang.String name, java.lang.String opts)
          See Instruction.
 
Method Summary
 java.lang.String getName()
          The name of the instruction.
 java.lang.String getOpts()
          The unparsed options for the instruction.
 java.lang.String getText()
          Returns a textual representation of this instruction suitable for the command line.
 boolean hasOpts()
          Returns true if this instruction has an options set.
 boolean isInitInstruction()
          Returns whether or not this instruction is the one that provides application initialization parameters , i.e.
 boolean isOptsInstruction()
          Returns whether or not this instruction is the one that provides system property options, i.e.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Instruction

public Instruction(java.lang.String name,
                   java.lang.String opts)
See Instruction.

Parameters:
name - the name of the instruction
opts - if there are no options then specify a null or an empty string - both result in an empty string being returned from getOpts().
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getText

public java.lang.String getText()
Returns a textual representation of this instruction suitable for the command line.

Returns:

getName

public java.lang.String getName()
The name of the instruction.

Returns:

getOpts

public java.lang.String getOpts()
The unparsed options for the instruction. Returns an empty string for no options.

Returns:

hasOpts

public boolean hasOpts()
Returns true if this instruction has an options set.

Returns:

isInitInstruction

public boolean isInitInstruction()
Returns whether or not this instruction is the one that provides application initialization parameters , i.e. the INIT instruction.

Returns:

isOptsInstruction

public boolean isOptsInstruction()
Returns whether or not this instruction is the one that provides system property options, i.e. the OPTS instruction. This is the name of the special instruction, so don't confuse it with the options to an instruction.

Returns: