Package org.exist.xquery

Examples of org.exist.xquery.XPathException


    @Override
    protected void verifyString(String str) throws XPathException {

        if((str.length() & 1) != 0) {
            throw new XPathException(ErrorCodes.FORG0001, "A hexBinary value must contain an even number of characters");
        }

        if(!getMatcher(str).matches()) {
            throw new XPathException(ErrorCodes.FORG0001, "Invalid hexadecimal digit");
        }
    }
View Full Code Here


            return results;
        }
        catch(IOException ioe)
        {
            LOG.error(ioe.getMessage(), ioe);
            throw new XPathException(this, ioe.getMessage(), ioe);
        }
        finally
        {
            if(tis != null)
            {
View Full Code Here

     * a subtype of node.
     */
    @Override
    public void add(Item item) throws XPathException {
        if (!Type.subTypeOf(item.getType(), Type.NODE))
            {throw new XPathException("item has wrong type");}
        add((NodeProxy) item);
    }
View Full Code Here

     * @throws XPathException
     */
    @Override
    public void addAll(Sequence other) throws XPathException {
        if (!other.isEmpty() && !Type.subTypeOf(other.getItemType(), Type.NODE))
            {throw new XPathException("sequence argument is not a node sequence");}
        if (Type.subTypeOf(other.getItemType(), Type.NODE))
          {addAll((NodeSet) other);}
        for (final SequenceIterator i = other.iterate(); i.hasNext();) {
            add(i.nextItem());
        }
View Full Code Here

  public TimeValue(String timeValue) throws XPathException {
    super(timeValue);
    try {
      if (calendar.getXMLSchemaType() != DatatypeConstants.TIME) {throw new IllegalStateException();}
    } catch (final IllegalStateException e) {
      throw new XPathException("xs:time instance must not have year, month or day fields set");
    }
  }
View Full Code Here

      case Type.STRING :
        return new StringValue(getStringValue());
      case Type.UNTYPED_ATOMIC :
        return new UntypedAtomicValue(getStringValue());
      default :
        throw new XPathException(
          "Type error: cannot cast xs:time to "
            + Type.getTypeName(requiredType));
    }
  }
View Full Code Here

      case Type.TIME:
        return new DayTimeDurationValue(getTimeInMillis() - ((TimeValue) other).getTimeInMillis());
      case Type.DAY_TIME_DURATION:
        return ((DayTimeDurationValue) other).negate().plus(this);
      default:
        throw new XPathException(
            "Operand to minus should be of type xs:time or xdt:dayTimeDuration; got: "
              + Type.getTypeName(other.getType()));
    }
  }
View Full Code Here

  public ComputableValue plus(ComputableValue other) throws XPathException {
    if (other.getType() == Type.DAY_TIME_DURATION) {
      return other.plus(this);
    }
    throw new XPathException(
      "Operand to plus should be of type xdt:dayTimeDuration; got: "
        + Type.getTypeName(other.getType()));
  }
View Full Code Here

            return BinaryValueFromInputStream.getInstance(context, new Base64BinaryValueType(), new ByteArrayInputStream(baos.toByteArray()));
        }
        catch(IOException ioe)
        {
            throw new XPathException(this, ioe.getMessage());
        }
    }
View Full Code Here

    public GYearValue(String timeValue) throws XPathException {
        super(timeValue);
        try {
            if (calendar.getXMLSchemaType() != DatatypeConstants.GYEAR) {throw new IllegalStateException();}
        } catch (final IllegalStateException e) {
            throw new XPathException("xs:time instance must not have year, month or day fields set");
        }
    }
View Full Code Here

TOP

Related Classes of org.exist.xquery.XPathException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.