org.basex
Class BaseX

java.lang.Object
  extended by org.basex.BaseX
Direct Known Subclasses:
BaseXClient, BaseXClientNew

public class BaseX
extends java.lang.Object

This is the starter class for the stand-alone console mode. It executes all commands locally. Next, the class offers some utility methods which are used throughout the project. Add the '-h' option to get a list on all available command-line arguments.

Author:
Workgroup DBIS, University of Konstanz 2005-09, ISC License, Christian Gruen

Constructor Summary
BaseX(boolean sa)
          Constructor.
 
Method Summary
static java.lang.String bug(java.lang.Object... ext)
          Prints some information for an unexpected exception.
static boolean debug(java.lang.Exception ex)
          Global method for printing the exception stack trace if the Prop.debug flag is set.
static void debug(java.lang.Object str, java.lang.Object... ext)
          Global method for printing debug information if the Prop.debug flag is set.
static void err(java.lang.String string, java.lang.Object... ext)
          Global method for printing information to the standard output.
static void errln(java.lang.Object obj, java.lang.Object... ext)
          Global method for printing information to the standard output.
static java.lang.String flag(boolean flag)
          Returns an info message for the specified flag.
static byte[] inf(java.lang.Object str, java.lang.Object... ext)
          Global method, replacing all % characters (see TokenBuilder.add(Object, Object...) for details.
static java.lang.String info(java.lang.Object str, java.lang.Object... ext)
          Global method, replacing all % characters (see TokenBuilder.add(Object, Object...) for details.
static void main(java.lang.String[] args)
          Main method, launching the standalone console mode.
static java.lang.String name(java.lang.Class<?> o)
          Returns the class name of the specified object.
static java.lang.String name(java.lang.Object o)
          Returns the class name of the specified object.
static java.lang.Object notexpected(java.lang.Object... ext)
          Throws a runtime exception for an unexpected exception.
static java.lang.Object notimplemented(java.lang.Object... ext)
          Throws a runtime exception for an unimplemented method.
static void out(java.lang.Object str, java.lang.Object... ext)
          Global method for printing information to the standard output.
static void outln()
          Global method for printing a newline.
static void outln(java.lang.Object str, java.lang.Object... ext)
          Global method for printing information to the standard output.
 void run(java.lang.String[] args)
          Constructor.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseX

public BaseX(boolean sa)
Constructor.

Parameters:
sa - standalone flag
Method Detail

main

public static void main(java.lang.String[] args)
Main method, launching the standalone console mode. Use -h to get a list of optional command-line arguments.

Parameters:
args - command-line arguments

run

public void run(java.lang.String[] args)
Constructor.

Parameters:
args - command-line arguments

inf

public static byte[] inf(java.lang.Object str,
                         java.lang.Object... ext)
Global method, replacing all % characters (see TokenBuilder.add(Object, Object...) for details.

Parameters:
str - string to be extended
ext - text text extensions
Returns:
token

info

public static java.lang.String info(java.lang.Object str,
                                    java.lang.Object... ext)
Global method, replacing all % characters (see TokenBuilder.add(Object, Object...) for details.

Parameters:
str - string to be extended
ext - text text extensions
Returns:
extended string

debug

public static void debug(java.lang.Object str,
                         java.lang.Object... ext)
Global method for printing debug information if the Prop.debug flag is set.

Parameters:
str - debug string
ext - text optional extensions

debug

public static boolean debug(java.lang.Exception ex)
Global method for printing the exception stack trace if the Prop.debug flag is set.

Parameters:
ex - exception
Returns:
always false

err

public static void err(java.lang.String string,
                       java.lang.Object... ext)
Global method for printing information to the standard output.

Parameters:
string - debug string
ext - text optional extensions

errln

public static void errln(java.lang.Object obj,
                         java.lang.Object... ext)
Global method for printing information to the standard output.

Parameters:
obj - error string
ext - text optional extensions

out

public static void out(java.lang.Object str,
                       java.lang.Object... ext)
Global method for printing information to the standard output.

Parameters:
str - output string
ext - text optional extensions

outln

public static void outln(java.lang.Object str,
                         java.lang.Object... ext)
Global method for printing information to the standard output.

Parameters:
str - output string
ext - text optional extensions

outln

public static void outln()
Global method for printing a newline.


flag

public static java.lang.String flag(boolean flag)
Returns an info message for the specified flag.

Parameters:
flag - current flag status
Returns:
ON/OFF message

name

public static java.lang.String name(java.lang.Object o)
Returns the class name of the specified object.

Parameters:
o - object
Returns:
class name

name

public static java.lang.String name(java.lang.Class<?> o)
Returns the class name of the specified object.

Parameters:
o - object
Returns:
class name

notimplemented

public static java.lang.Object notimplemented(java.lang.Object... ext)
Throws a runtime exception for an unimplemented method.

Parameters:
ext - optional extension
Returns:
dummy object

notexpected

public static java.lang.Object notexpected(java.lang.Object... ext)
Throws a runtime exception for an unexpected exception.

Parameters:
ext - optional extension
Returns:
dummy object

bug

public static java.lang.String bug(java.lang.Object... ext)
Prints some information for an unexpected exception.

Parameters:
ext - optional extension
Returns:
dummy object