org.basex.query.xquery.util
Class Err

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

public final class Err
extends java.lang.Object

This class is supposed to support a consistent error output.

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

Method Summary
static Item cast(Type t, Item it)
          Throws a numeric type exception.
static int cmp(Item it1, Item it2)
          Throws a comparison exception.
static Item date(Type t, java.lang.String ex)
          Throws a date format exception.
static Item dur(java.lang.String inf, Item it)
          Throws a duration type exception.
static Item empty(Expr ex)
          Throws a empty sequence exception.
static Item nodes(Expr ex)
          Throws a node exception.
static Item num(java.lang.String inf, Item it)
          Throws a numeric type exception.
static Item or(java.lang.Object[] err, java.lang.Object... x)
          Throws an exception.
static Item or(java.lang.String err, java.lang.Object... x)
          Throws an exception.
static Item range(Type t, byte[] v)
          Throws a date range exception.
static Item seq(Expr e, Expr ex)
          Throws a sequence exception.
static Item type(java.lang.String inf, Type t, Item it)
          Throws a type exception.
static Item value(Type t, java.lang.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

cast

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

Parameters:
t - expression cast type
it - item
Returns:
dummy item
Throws:
XQException - evaluation exception

cmp

public static int cmp(Item it1,
                      Item it2)
               throws XQException
Throws a comparison exception.

Parameters:
it1 - first item
it2 - second item
Returns:
dummy value
Throws:
XQException - evaluation exception

date

public static Item date(Type t,
                        java.lang.String ex)
                 throws XQException
Throws a date format exception.

Parameters:
t - expected type
ex - example format
Returns:
dummy item
Throws:
XQException - evaluation exception

dur

public static Item dur(java.lang.String inf,
                       Item it)
                throws XQException
Throws a duration type exception.

Parameters:
inf - expression info
it - item
Returns:
dummy item
Throws:
XQException - evaluation exception

empty

public static Item empty(Expr ex)
                  throws XQException
Throws a empty sequence exception.

Parameters:
ex - expression
Returns:
dummy item
Throws:
XQException - evaluation exception

nodes

public static Item nodes(Expr ex)
                  throws XQException
Throws a node exception.

Parameters:
ex - expression
Returns:
dummy item
Throws:
XQException - evaluation exception

num

public static Item num(java.lang.String inf,
                       Item it)
                throws XQException
Throws a numeric type exception.

Parameters:
inf - expression info
it - item
Returns:
dummy item
Throws:
XQException - evaluation exception

or

public static Item or(java.lang.Object[] err,
                      java.lang.Object... x)
               throws XQException
Throws an exception.

Parameters:
err - error message
x - extended info
Returns:
dummy item
Throws:
XQException - evaluation exception

or

public static Item or(java.lang.String err,
                      java.lang.Object... x)
               throws XQException
Throws an exception.

Parameters:
err - error message
x - extended info
Returns:
dummy item
Throws:
XQException - evaluation exception

range

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

Parameters:
t - expected type
v - value
Returns:
dummy item
Throws:
XQException - evaluation exception

seq

public static Item seq(Expr e,
                       Expr ex)
                throws XQException
Throws a sequence exception.

Parameters:
e - sequence item
ex - expression
Returns:
dummy item
Throws:
XQException - evaluation exception

type

public static Item type(java.lang.String inf,
                        Type t,
                        Item it)
                 throws XQException
Throws a type exception.

Parameters:
t - expected type
inf - expression info
it - item
Returns:
dummy item
Throws:
XQException - evaluation exception

value

public static Item value(Type t,
                         java.lang.Object v)
                  throws XQException
Throws an invalid value exception.

Parameters:
t - expected type
v - value
Returns:
dummy item
Throws:
XQException - evaluation exception