com.dtolabs.rundeck.core.execution
Class ExecArg

java.lang.Object
  extended by com.dtolabs.rundeck.core.execution.ExecArg

public abstract class ExecArg
extends java.lang.Object

Represents a command-line argument, that may need to be quoted/escaped before use, and may contain a list of other arguments to be quoted.


Nested Class Summary
static interface ExecArg.Visitor
          Visitor to visit args
 
Constructor Summary
ExecArg()
           
 
Method Summary
abstract  void accept(ExecArg.Visitor converter)
          Accept a visitor
static ExecArg fromString(java.lang.String arg, boolean quoted)
           
abstract  java.util.List<ExecArg> getList()
          Return the sublist of args, if isList() returns true, null otherwise
abstract  java.lang.String getString()
          Return the string value of this argument if isList() returns false, null otherwise
abstract  boolean isList()
          Return true if this arg contains a list of other args
 boolean isQuoted()
          Return true if this arg should be quoted
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExecArg

public ExecArg()
Method Detail

isList

public abstract boolean isList()
Return true if this arg contains a list of other args

Returns:

getList

public abstract java.util.List<ExecArg> getList()
Return the sublist of args, if isList() returns true, null otherwise

Returns:

getString

public abstract java.lang.String getString()
Return the string value of this argument if isList() returns false, null otherwise

Returns:

accept

public abstract void accept(ExecArg.Visitor converter)
Accept a visitor

Parameters:
converter -

isQuoted

public boolean isQuoted()
Return true if this arg should be quoted

Returns:

fromString

public static ExecArg fromString(java.lang.String arg,
                                 boolean quoted)