Package org.exist.xquery

Examples of org.exist.xquery.XPathException


                return (T)object;
            } else if (target == Object.class) {
                return (T)object;
            }

            throw new XPathException("cannot convert value of type " + Type.getTypeName(getType()) + " to Java object of type " + target.getName());
  }
View Full Code Here


  public static int getType(String name) throws XPathException {
    //if (name.equals("node"))
    //  return NODE;
    final int code = typeCodes.get(name);
    if (code == Object2IntHashMap.UNKNOWN_KEY)
      {throw new XPathException("Type: " + name + " is not defined");}
    return code;
  }
View Full Code Here

  public DateValue(String dateString) throws XPathException {
    super(dateString);
    try {
      if (calendar.getXMLSchemaType() != DatatypeConstants.DATE) {throw new IllegalStateException();}
    } catch (final IllegalStateException e) {
      throw new XPathException("xs:date must not have hour, minute or second fields set");
    }
  }
View Full Code Here

      case Type.STRING : {
              final DateValue dv = new DateValue(calendar);
        return new StringValue(dv.getStringValue());
      }
      default :
        throw new XPathException(ErrorCodes.FORG0001, "can not convert " +
            Type.getTypeName(getType()) + "('" + getStringValue() + "') to " +
            Type.getTypeName(requiredType));
    }
  }
View Full Code Here

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

        try {
            this.file = file;
            this.channel = new RandomAccessFile(file, "r").getChannel();
            this.buf = channel.map(MapMode.READ_ONLY, 0, channel.size());
        } catch(final IOException ioe) {
            throw new XPathException(ioe);
        }
    }
View Full Code Here

        if(args[0].isEmpty())
            return Sequence.EMPTY_SEQUENCE;

        //get the entry-filter function and check its types
        if(!(args[1].itemAt(0) instanceof FunctionReference))
            throw new XPathException("No entry-filter function provided.");
        entryFilterFunction = (FunctionReference)args[1].itemAt(0);
        FunctionSignature entryFilterFunctionSig = entryFilterFunction.getSignature();
        if(entryFilterFunctionSig.getArgumentCount() < 3)
            throw new XPathException("entry-filter function must take at least 3 arguments.");

        filterParam = args[2];
       
        //get the entry-data function and check its types
        if(!(args[3].itemAt(0) instanceof FunctionReference))
            throw new XPathException("No entry-data function provided.");
        entryDataFunction = (FunctionReference)args[3].itemAt(0);
        FunctionSignature entryDataFunctionSig = entryDataFunction.getSignature();
        if(entryDataFunctionSig.getArgumentCount() < 3)
            throw new XPathException("entry-data function must take at least 3 arguments");

        storeParam = args[4];
       
        BinaryValue compressedData = ((BinaryValue)args[0].itemAt(0));
       
        try {
      return processCompressedData(compressedData);
    } catch (XMLDBException e) {
      throw new XPathException(e);
    }
    }
View Full Code Here

                result = getCookie(request, cookieName, null);
            } else if(getSignature().getArgumentCount() == 2) {
                final Sequence defaultValues = args[1];
                result = getCookie(request, cookieName, defaultValues);
            } else {
                throw new XPathException(this, "Unknown function call: " + getSignature());
            }  
        } else {
            throw new XPathException(this, "Unknown function call: " + getSignature());
        }
       
        return result;
    }
View Full Code Here

                result = getParameter(request, paramName, null);
            } else if(getSignature().getArgumentCount() == 2) {
                final Sequence defaultValues = args[1];
                result = getParameter(request, paramName, defaultValues);
            } else {
                throw new XPathException(this, "Unknown function call: " + getSignature());
            }  
        } else {
            throw new XPathException(this, "Unknown function call: " + getSignature());
        }
       
        return result;
    }
View Full Code Here

      throw new NoViableAltException(LT(1), getFilename());
    }
    }
    }
   
        throw new XPathException("Processing stopped");
     
  }
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.