Package org.exist.xquery

Examples of org.exist.xquery.XPathException


 
  public DurationValue(String str) throws XPathException {
    try {
      this.duration = TimeUtils.getInstance().newDuration(StringValue.trimWhitespace(str));
    } catch (final IllegalArgumentException e) {
      throw new XPathException(ErrorCodes.FORG0001, "cannot construct " + Type.getTypeName(this.getItemType()) +
          " from \"" + str + "\"");           
    }
  }
View Full Code Here


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

  public boolean compareTo(Collator collator, int operator, AtomicValue other) throws XPathException {   
    switch (operator) {
      case Constants.EQ :
      {
        if (!(DurationValue.class.isAssignableFrom(other.getClass())))
          {throw new XPathException(ErrorCodes.XPTY0004, "invalid operand type: " + Type.getTypeName(other.getType()));}
        //TODO : upgrade so that P365D is *not* equal to P1Y
        boolean r = duration.equals(((DurationValue)other).duration);
        //confirm strict equality to work around the JDK standard behaviour
        if (r)
          {r = r & areReallyEqual(getCanonicalDuration(), ((DurationValue)other).getCanonicalDuration());}
        return r;
      }
      case Constants.NEQ :
      {
        if (!(DurationValue.class.isAssignableFrom(other.getClass())))
          {throw new XPathException(ErrorCodes.XPTY0004, "invalid operand type: " + Type.getTypeName(other.getType()));}
        //TODO : upgrade so that P365D is *not* equal to P1Y
        boolean r = duration.equals(((DurationValue)other).duration);
        //confirm strict equality to work around the JDK standard behaviour
        if (r)
          {r = r & areReallyEqual(getCanonicalDuration(), ((DurationValue)other).getCanonicalDuration());}
        return !r;
      }
      case Constants.LT :     
      case Constants.LTEQ :     
      case Constants.GT :
      case Constants.GTEQ :
        throw new XPathException(ErrorCodes.XPTY0004, "" + Type.getTypeName(other.getType()) + " type can not be ordered");
      default :
        throw new IllegalArgumentException("Unknown comparison operator");
   
  }
View Full Code Here

   
  }

  public int compareTo(Collator collator, AtomicValue other) throws XPathException {
    if (!(DurationValue.class.isAssignableFrom(other.getClass())))
      {throw new XPathException(ErrorCodes.XPTY0004, "invalid operand type: " + Type.getTypeName(other.getType()));}
    //TODO : what to do with the collator ?
    return duration.compare(((DurationValue)other).duration);
  }
View Full Code Here

    //TODO : what to do with the collator ?
    return duration.compare(((DurationValue)other).duration);
  }

  public AtomicValue max(Collator collator, AtomicValue other) throws XPathException {
    throw new XPathException(ErrorCodes.XPTY0004, "invalid operation on " + Type.getTypeName(this.getType()));
  }
View Full Code Here

  public AtomicValue max(Collator collator, AtomicValue other) throws XPathException {
    throw new XPathException(ErrorCodes.XPTY0004, "invalid operation on " + Type.getTypeName(this.getType()));
  }

  public AtomicValue min(Collator collator, AtomicValue other) throws XPathException {
    throw new XPathException(ErrorCodes.XPTY0004, "invalid operation on " + Type.getTypeName(this.getType()));
  }
View Full Code Here

  public AtomicValue min(Collator collator, AtomicValue other) throws XPathException {
    throw new XPathException(ErrorCodes.XPTY0004, "invalid operation on " + Type.getTypeName(this.getType()));
  }

  public ComputableValue plus(ComputableValue other) throws XPathException {
    throw new XPathException(ErrorCodes.XPTY0004, "invalid operation on " + Type.getTypeName(this.getType()))
  }
View Full Code Here

  public ComputableValue plus(ComputableValue other) throws XPathException {
    throw new XPathException(ErrorCodes.XPTY0004, "invalid operation on " + Type.getTypeName(this.getType()))
  }
 
  public ComputableValue minus(ComputableValue other) throws XPathException {
    throw new XPathException(ErrorCodes.XPTY0004, "invalid operation on " + Type.getTypeName(this.getType()));
  }
View Full Code Here

  public ComputableValue minus(ComputableValue other) throws XPathException {
    throw new XPathException(ErrorCodes.XPTY0004, "invalid operation on " + Type.getTypeName(this.getType()));
  }
 
  public ComputableValue mult(ComputableValue other) throws XPathException
    throw new XPathException(ErrorCodes.XPTY0004, "invalid operation on " + Type.getTypeName(this.getType()));     
  }
View Full Code Here

  public ComputableValue mult(ComputableValue other) throws XPathException
    throw new XPathException(ErrorCodes.XPTY0004, "invalid operation on " + Type.getTypeName(this.getType()));     
  }

  public ComputableValue div(ComputableValue other) throws XPathException
    throw new XPathException(ErrorCodes.XPTY0004, "invalid operation on " + Type.getTypeName(this.getType()));       
  }
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.