org.basex.query.util
Class Err

java.lang.Object
  extended by org.basex.query.util.Err

public final class Err
extends Object

This class is supposed to support a consistent error output.

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

Method Summary
static void cast(Type t, Item it)
          Throws a numeric type exception.
static String chop(Object val)
          Chops the specified input and returns the string.
static void cmp(Item it1, Item it2)
          Throws a comparison exception.
static void date(byte[] i, Type t, String ex)
          Throws a date format exception.
static void empty(Expr e)
          Throws a empty sequence exception.
static void nodes(Expr ex)
          Throws a node exception.
static void num(String inf, Item it)
          Throws a numeric type exception.
static void or(Object[] err, Object... x)
          Throws an exception.
static void range(Type t, byte[] v)
          Throws a date range exception.
static void type(String inf, Type t, Item it)
          Throws a type exception.
static void value(Type t, Object v)
          Throws an invalid value exception.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

or

public static void or(Object[] err,
                      Object... x)
               throws QueryException
Throws an exception.

Parameters:
err - error message
x - extended info
Throws:
QueryException - query exception

type

public static void type(String inf,
                        Type t,
                        Item it)
                 throws QueryException
Throws a type exception.

Parameters:
inf - expression info
t - expected type
it - item
Throws:
QueryException - query exception

date

public static void date(byte[] i,
                        Type t,
                        String ex)
                 throws QueryException
Throws a date format exception.

Parameters:
i - input
t - expected type
ex - example format
Throws:
QueryException - query exception

value

public static void value(Type t,
                         Object v)
                  throws QueryException
Throws an invalid value exception.

Parameters:
t - expected type
v - value
Throws:
QueryException - query exception

range

public static void range(Type t,
                         byte[] v)
                  throws QueryException
Throws a date range exception.

Parameters:
t - expected type
v - value
Throws:
QueryException - query exception

empty

public static void empty(Expr e)
                  throws QueryException
Throws a empty sequence exception.

Parameters:
e - calling expression
Throws:
QueryException - query exception

cmp

public static void cmp(Item it1,
                       Item it2)
                throws QueryException
Throws a comparison exception.

Parameters:
it1 - first item
it2 - second item
Throws:
QueryException - query exception

num

public static void num(String inf,
                       Item it)
                throws QueryException
Throws a numeric type exception.

Parameters:
inf - expression info
it - item
Throws:
QueryException - query exception

nodes

public static void nodes(Expr ex)
                  throws QueryException
Throws a node exception.

Parameters:
ex - expression
Throws:
QueryException - query exception

cast

public static void cast(Type t,
                        Item it)
                 throws QueryException
Throws a numeric type exception.

Parameters:
t - expression cast type
it - item
Throws:
QueryException - query exception

chop

public static String chop(Object val)
Chops the specified input and returns the string.

Parameters:
val - input value
Returns:
chopped string