Package xbird.xquery.expr.flwr

Examples of xbird.xquery.expr.flwr.GroupingSpec


            for(Item it : itor) {//TODO parallel map
                final int len = specs.length;
                final Item[] groupKeys = new Item[len];
                final Sequence[] rawKeys = new Sequence[len];
                for(int i = 0; i < len; i++) {
                    GroupingSpec spec = specs[i];
                    Sequence result = spec.getKeyExpr().eval(contextSeq, dynEnv);
                    Sequence atomized = result.atomize(dynEnv);
                    IFocus atomizedItor = atomized.iterator();

                    final Item groupKey;
                    if(atomizedItor.hasNext()) {
View Full Code Here


    [47] GroupByClause     ::= "group" "by" GroupingSpecList
    [48] GroupingSpecList ::= GroupingSpec ("," GroupingSpec)*
    ************************************************************************/
    final public Grouping parseGroupByClause() throws ParseException, XQueryException {
        final Grouping grouping = new Grouping();
        GroupingSpec spec = null;
        currentToken = jj_consume_token(GroupBy);
        //GroupingSpecList
        spec = parseGroupingSpec();
        grouping.addGroupingKey(spec);
        label_12: while(true) {
View Full Code Here

    /************************************************************************
    [49] GroupingSpec     ::= "$" VarName ("collation" URILiteral)?
    ************************************************************************/
    final public GroupingSpec parseGroupingSpec() throws ParseException, XQueryException {
        final GroupingSpec spec;
        currentToken = jj_consume_token(VariableIndicator);
        currentToken = jj_consume_token(VarName);
        String defaultNamespace = currentModule.getNamespace();
        if(defaultNamespace == null) {
            defaultNamespace = "";
        }
        QualifiedName vn = QNameUtil.parse(currentToken.image, namespaceContext, defaultNamespace);
        Variable var = currentModule.getVariable(vn);
        if(var == null) {
            error("err:XPST0008");
        }
        if(!(var instanceof ForVariable || var instanceof LetVariable)) {
            error("err:XQST0094");
        }
        BindingVariable bindingVar = (BindingVariable) var;
        spec = new GroupingSpec(bindingVar);
        locate(spec);
        switch(jj_nt.kind) {
            case Collation:
                // ("collation" URILiteral)?
                currentToken = jj_consume_token(Collation);
                currentToken = jj_consume_token(URILiteralToOperator);
                String collation = unquote(currentToken.image);
                if(collation != null) {
                    try {
                        URI url = new URI(collation);
                        spec.setCollation(url);
                    } catch (URISyntaxException e) {
                        error("err:XQST0046");
                    }
                }
                break;
View Full Code Here

TOP

Related Classes of xbird.xquery.expr.flwr.GroupingSpec

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.