Package net.sf.jz3950.protocol.operation

Examples of net.sf.jz3950.protocol.operation.PresentOperation


                break;
            }
        }
        else if (node instanceof QueryModelAPTNode)
        {
            QueryModelAPTNode attributPlusTermNode = (QueryModelAPTNode) node;

            CQLRelation relation = null;

            if (attributPlusTermNode.getAttribute("bib-1.2") != null)
            {
                relation = new CQLRelation(attributPlusTermNode.getAttribute("bib-1.2").toString());
            }
            else
            {
                relation = new CQLRelation("=");
            }

            String qualifier = null;
            Object accessPointNode = attributPlusTermNode.getAttribute("bib-1.1");

            if (accessPointNode != null)
            {
                qualifier = accessPointNode.toString();
            }

            result = new CQLTermNode(qualifier, relation, attributPlusTermNode.getTerm().toString());
        }

        return result;
    }
View Full Code Here


        switch (currentToken)
        {
        case PrefixQuery.TOKEN_AND:
            // Consume the AND token
            currentToken = readToken(tokenizer);
            node = new QueryModelComplexNode(visitPrefixQuery(tokenizer, currentToken, namespaceId), visitPrefixQuery(tokenizer, currentToken, namespaceId), QueryModelComplexNode.COMPLEX_OP_AND);

            break;

        case PrefixQuery.TOKEN_OR:
            // Consume the OR token
            currentToken = readToken(tokenizer);
            node = new QueryModelComplexNode(visitPrefixQuery(tokenizer, currentToken, namespaceId), visitPrefixQuery(tokenizer, currentToken, namespaceId), QueryModelComplexNode.COMPLEX_OP_OR);

            break;

        case PrefixQuery.TOKEN_NOT:
            // Consume the NOT token
            currentToken = readToken(tokenizer);
            node = new QueryModelComplexNode(visitPrefixQuery(tokenizer, currentToken, namespaceId), visitPrefixQuery(tokenizer, currentToken, namespaceId), QueryModelComplexNode.COMPLEX_OP_ANDNOT);

            break;

        case PrefixQuery.TOKEN_TERM:
            // Must be a term with no attributes
View Full Code Here

            rpnStructure = createRPNStructure(nsNode.getRoot(), encoding, nsNode.getAttributeSet());
        }
        else if (node instanceof QueryModelComplexNode)
        {
            QueryModelComplexNode complexNode = (QueryModelComplexNode) node;

            rpnRpnOp_inline2_type rpnOp = new rpnRpnOp_inline2_type();
            rpnOp.rpn1 = createRPNStructure(complexNode.getLhs(), encoding, defaultNamespace);
            rpnOp.rpn2 = createRPNStructure(complexNode.getRhs(), encoding, defaultNamespace);
            rpnOp.op = new Operator_type();

            switch (complexNode.getOp())
            {
            case QueryModelComplexNode.COMPLEX_OP_AND:
                rpnOp.op.which = Operator_type.and_CID;
                rpnOp.op.o = new AsnNull();
View Full Code Here

        {
            CQLBooleanNode cbn = (CQLBooleanNode) node;

            if (cbn instanceof CQLAndNode)
            {
                result = new QueryModelComplexNode(translate(cbn.left), translate(cbn.right), QueryModelComplexNode.COMPLEX_OP_AND);
            }
            else if (cbn instanceof CQLOrNode)
            {
                result = new QueryModelComplexNode(translate(cbn.left), translate(cbn.right), QueryModelComplexNode.COMPLEX_OP_OR);
            }
            else if (cbn instanceof CQLNotNode)
            {
                result = new QueryModelComplexNode(translate(cbn.left), translate(cbn.right), QueryModelComplexNode.COMPLEX_OP_ANDNOT);
            }
            else if (cbn instanceof CQLProxNode)
            {
                result = new QueryModelComplexNode(translate(cbn.left), translate(cbn.right), QueryModelComplexNode.COMPLEX_OP_PROX);
            }
        }
        else if (node instanceof CQLTermNode)
        {
            logger.warn("FIXME: CQLTermNode will not be translated properly");
View Full Code Here

            String attributeSet = tokenizer.sval;

            // Consume the namespace value token
            currentToken = readToken(tokenizer);

            QueryModelNamespaceNode namespaceNode = new QueryModelNamespaceNode();
            result.setRoot(namespaceNode);
            namespaceNode.setAttributeSet(attributeSet);
            namespaceNode.setRoot(visitPrefixQuery(tokenizer, currentToken, attributeSet));
        }
        else
        {
            result.setRoot(visitPrefixQuery(tokenizer, currentToken, "bib-1"));
        }
View Full Code Here

        {
            rpnStructure = createRPNStructure(((QueryModel) node).getRoot(), encoding, defaultNamespace);
        }
        else if (node instanceof QueryModelNamespaceNode)
        {
            QueryModelNamespaceNode nsNode = (QueryModelNamespaceNode) node;

            rpnStructure = createRPNStructure(nsNode.getRoot(), encoding, nsNode.getAttributeSet());
        }
        else if (node instanceof QueryModelComplexNode)
        {
            QueryModelComplexNode complexNode = (QueryModelComplexNode) node;
View Full Code Here

            result = attributePlusTermNode;
        }
        else if (node instanceof CQLPrefixNode)
        {
            CQLPrefixNode prefixNode = (CQLPrefixNode) node;
            result = new QueryModelNamespaceNode(prefixNode.prefix.name, translate(((CQLPrefixNode) node).subtree));
        }

        return result;
    }
View Full Code Here

        {
            result = createCQLNode(((QueryModel) node).getRoot(), sourceNamespace, targetNamespace, complexSupport);
        }
        else if (node instanceof QueryModelNamespaceNode)
        {
            QueryModelNamespaceNode namespaceNode = (QueryModelNamespaceNode) node;

            if (complexSupport)
            {
                result = new CQLPrefixNode(namespaceNode.getAttributeSet(), namespaceNode.getAttributeSet(), createCQLNode(namespaceNode.getRoot(), namespaceNode.getAttributeSet(), targetNamespace, complexSupport));
            }
            else
            {
                result = createCQLNode(namespaceNode.getRoot(), namespaceNode.getAttributeSet(), targetNamespace, complexSupport);
            }
        }
        else if (node instanceof QueryModelComplexNode)
        {
            /*
 
View Full Code Here

        return result;
    }

    private static QueryModelNode visitPrefixQuery(StreamTokenizer tokenizer, int currentToken, String namespaceId) throws InvalidQueryException
    {
        QueryModelNode node = null;

        switch (currentToken)
        {
        case PrefixQuery.TOKEN_AND:
            // Consume the AND token
View Full Code Here

        return new QueryModel(translate(this.rootNode));
    }

    private QueryModelNode translate(CQLNode node)
    {
        QueryModelNode result = null;

        if (node instanceof CQLBooleanNode)
        {
            CQLBooleanNode cbn = (CQLBooleanNode) node;
View Full Code Here

TOP

Related Classes of net.sf.jz3950.protocol.operation.PresentOperation

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.