Beispiel #1
0
 /**
  * Checks if the specified item is no empty sequence.
  *
  * @param it item to be checked
  * @param type expected type
  * @return specified item
  * @throws QueryException query exception
  */
 protected Item checkNoEmpty(final Item it, final Type type) throws QueryException {
   if (it != null) return it;
   throw EMPTYFOUND_X.get(info, type);
 }
Beispiel #2
0
 /**
  * Checks if the specified expression yields a string. Returns a value as token or throws an
  * exception.
  *
  * @param ex expression to be evaluated
  * @param qc query context
  * @return token
  * @throws QueryException query exception
  */
 protected final byte[] toToken(final Expr ex, final QueryContext qc) throws QueryException {
   final Item it = ex.atomItem(qc, info);
   if (it == null) throw EMPTYFOUND_X.get(info, AtomType.STR);
   return toToken(it);
 }