Package org.exist.xquery

Examples of org.exist.xquery.DynamicCardinalityCheck


  /* (non-Javadoc)
   * @see org.exist.xquery.Function#setArguments(java.util.List)
   */
  public void setArguments(List<Expression> arguments) throws XPathException {
        Expression arg = arguments.get(0);
        arg = new DynamicCardinalityCheck(context, Cardinality.ZERO_OR_ONE, arg,
                new Error(Error.FUNC_PARAM_CARDINALITY, "1", mySignature));   
        if(!Type.subTypeOf(arg.returnsType(), Type.ATOMIC))
            {arg = new Atomize(context, arg);}
        steps.add(arg);
       
        arg = arguments.get(1);
        arg = new DynamicCardinalityCheck(context, Cardinality.EXACTLY_ONE, arg,
                new Error(Error.FUNC_PARAM_CARDINALITY, "2", mySignature));
        if(!Type.subTypeOf(arg.returnsType(), Type.ATOMIC))
            {arg = new Atomize(context, arg);}
        steps.add(arg);
       
        arg = arguments.get(2);
        arg = new DynamicCardinalityCheck(context, Cardinality.EXACTLY_ONE, arg,
                new Error(Error.FUNC_PARAM_CARDINALITY, "3", mySignature));
        if(!Type.subTypeOf(arg.returnsType(), Type.ATOMIC))
            {arg = new Atomize(context, arg);}
        steps.add(arg);
       
        if (arguments.size() == 4) {
            arg = arguments.get(3);
            arg = new DynamicCardinalityCheck(context, Cardinality.EXACTLY_ONE, arg,
                    new Error(Error.FUNC_PARAM_CARDINALITY, "4", mySignature));
            if(!Type.subTypeOf(arg.returnsType(), Type.ATOMIC))
                {arg = new Atomize(context, arg);}
            steps.add(arg);           
        }
View Full Code Here


     */
    public void setArguments(List<Expression> arguments) throws XPathException {
      steps.clear();
        for (Expression argument : arguments) {
          if (!(argument instanceof Placeholder)) {
              argument = new DynamicCardinalityCheck(context,
                  Cardinality.ZERO_OR_ONE, argument,
                  new Error(Error.FUNC_PARAM_CARDINALITY, "1", mySignature));
              if (!Type.subTypeOf(argument.returnsType(), Type.ATOMIC))
                  {argument = new Atomize(context, argument);}
          }
View Full Code Here

     */
    public void setArguments(List<Expression> arguments) throws XPathException {
        // wrap arguments into a cardinality check, so an error will be generated if
        // one of the arguments returns an empty sequence
        Expression arg = arguments.get(0);
        arg = new DynamicCardinalityCheck(context, Cardinality.ONE_OR_MORE, arg,
                new Error(Error.FUNC_PARAM_CARDINALITY, "1", mySignature));
        steps.add(arg);
       
        arg = arguments.get(1);
        arg = new DynamicCardinalityCheck(context, Cardinality.ONE_OR_MORE, arg,
                new Error(Error.FUNC_PARAM_CARDINALITY, "2", mySignature));
        steps.add(arg);
    }
View Full Code Here

     */
    public void setArguments(List<Expression> arguments) throws XPathException {
        // wrap arguments into a cardinality check, so an error will be generated if
        // one of the arguments returns an empty sequence
        Expression arg = arguments.get(0);
        arg = new DynamicCardinalityCheck(context, Cardinality.ZERO_OR_MORE, arg,
                new Error(Error.FUNC_PARAM_CARDINALITY, "1", mySignature));
        steps.add(arg);
       
        arg = arguments.get(1);
        arg = new DynamicCardinalityCheck(context, Cardinality.ZERO_OR_MORE, arg,
                new Error(Error.FUNC_PARAM_CARDINALITY, "2", mySignature));
        steps.add(arg);
    }
View Full Code Here

TOP

Related Classes of org.exist.xquery.DynamicCardinalityCheck

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.