org.basex.core.parse
Class CmdBuilder

java.lang.Object
  extended by org.basex.core.parse.CmdBuilder

public final class CmdBuilder
extends java.lang.Object

This class simplifies the composition of the string representation of a database command.

Author:
BaseX Team 2005-12, BSD License, Christian Gruen

Constructor Summary
CmdBuilder(Command c)
          Constructor.
 
Method Summary
 CmdBuilder arg(int arg)
          Adds the specified argument.
 CmdBuilder arg(java.lang.String key, int arg)
          Adds an argument with an optional prefix.
 CmdBuilder args()
          Returns a string representation of all arguments.
 CmdBuilder init()
          Initializes the builder with the class name of the command in upper case.
 CmdBuilder init(java.lang.String s)
          Initializes the builder with the specified string.
 java.lang.String toString()
           
 CmdBuilder xquery(int arg)
          Adds the specified argument as XQuery string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CmdBuilder

public CmdBuilder(Command c)
Constructor.

Parameters:
c - command
Method Detail

init

public CmdBuilder init()
Initializes the builder with the class name of the command in upper case.

Returns:
self instance

init

public CmdBuilder init(java.lang.String s)
Initializes the builder with the specified string.

Parameters:
s - command string
Returns:
self instance

args

public CmdBuilder args()
Returns a string representation of all arguments.

Returns:
self instance

xquery

public CmdBuilder xquery(int arg)
Adds the specified argument as XQuery string.

Parameters:
arg - argument index
Returns:
self instance

arg

public CmdBuilder arg(int arg)
Adds the specified argument.

Parameters:
arg - argument index
Returns:
self instance

arg

public CmdBuilder arg(java.lang.String key,
                      int arg)
Adds an argument with an optional prefix.

Parameters:
key - optional keyword prefix
arg - argument index
Returns:
self instance

toString

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