Examples of TaggedValuePointable


Examples of org.apache.vxquery.datamodel.accessors.TaggedValuePointable

        return new AbstractTaggedValueArgumentScalarEvaluator(args) {
            @Override
            protected void evaluate(TaggedValuePointable[] args, IPointable result) throws SystemException {
                try {
                    TaggedValuePointable tvp1 = args[0];
                    if (tvp1.getTag() != ValueTag.XS_INTEGER_TAG) {
                        throw new SystemException(ErrorCode.FORG0006);
                    }
                    tvp1.getValue(longp);
                    long start = longp.getLong();

                    TaggedValuePointable tvp2 = args[1];
                    if (tvp2.getTag() != ValueTag.XS_INTEGER_TAG) {
                        throw new SystemException(ErrorCode.FORG0006);
                    }
                    tvp2.getValue(longp);
                    long end = longp.getLong();

                    abvs.reset();
                    sb.reset(abvs);
                    if (start > end) {
View Full Code Here

Examples of org.apache.vxquery.datamodel.accessors.TaggedValuePointable

        final DynamicContext dCtx = (DynamicContext) ctx.getJobletContext().getGlobalJobData();

        return new AbstractTaggedValueArgumentScalarEvaluator(args) {
            @Override
            protected void evaluate(TaggedValuePointable[] args, IPointable result) throws SystemException {
                TaggedValuePointable tvp1 = args[0];
                TaggedValuePointable tvp2 = args[1];
                if (tvp1.getTag() == ValueTag.SEQUENCE_TAG) {
                    tvp1.getValue(seqp);
                    if (seqp.getEntryCount() == 0) {
                        result.set(tvp1);
                        return;
                    }
                    throw new SystemException(ErrorCode.XPTY0004);
                }
                if (tvp2.getTag() == ValueTag.SEQUENCE_TAG) {
                    tvp2.getValue(seqp);
                    if (seqp.getEntryCount() == 0) {
                        result.set(tvp2);
                        return;
                    }
                    throw new SystemException(ErrorCode.XPTY0004);
View Full Code Here

Examples of org.apache.vxquery.datamodel.accessors.TaggedValuePointable

                String namespaceURI;
                String localPart;

                // Only QName parameter.
                if (args.length == 1) {
                    TaggedValuePointable tvp1 = args[0];
                    if (tvp1.getTag() != ValueTag.XS_QNAME_TAG) {
                        throw new SystemException(ErrorCode.FORG0006);
                    }
                    tvp1.getValue(qnamep);
                    qnamep.getUri(urip);
                    qnamep.getLocalName(localnamep);
                    namespaceURI = FunctionHelper.getStringFromPointable(urip, bbis, di);
                    localPart = FunctionHelper.getStringFromPointable(localnamep, bbis, di);

                    // TODO Update to dynamic error.
                    throw new SystemException(ErrorCode.FOER0000);
                }

                // Only QName, description and optional error-object parameters.
                if (args.length > 1) {
                    TaggedValuePointable tvp1 = args[0];
                    if (tvp1.getTag() == ValueTag.SEQUENCE_TAG) {
                        tvp1.getValue(seqp);
                        if (seqp.getEntryCount() == 0) {
                            namespaceURI = "http://www.w3.org/2005/xqt-errors";
                            localPart = "FOER0000";
                        } else {
                            throw new SystemException(ErrorCode.FORG0006);
                        }
                    } else if (tvp1.getTag() == ValueTag.XS_QNAME_TAG) {
                        tvp1.getValue(qnamep);
                        qnamep.getUri(urip);
                        qnamep.getLocalName(localnamep);
                        namespaceURI = FunctionHelper.getStringFromPointable(urip, bbis, di);
                        localPart = FunctionHelper.getStringFromPointable(localnamep, bbis, di);
                    } else {
                        throw new SystemException(ErrorCode.FORG0006);
                    }

                    TaggedValuePointable tvp2 = args[1];
                    if (tvp2.getTag() != ValueTag.XS_STRING_TAG) {
                        throw new SystemException(ErrorCode.FORG0006);
                    }
                    tvp2.getValue(descriptionp);

                    if (args.length == 3) {
                        TaggedValuePointable tvp3 = args[2];
                        // TODO do something with last parameter.
                    }

                    // TODO Update to dynamic error.
                    throw new SystemException(ErrorCode.FOER0000);
View Full Code Here

Examples of org.apache.vxquery.datamodel.accessors.TaggedValuePointable

        final LongPointable longp = (LongPointable) LongPointable.FACTORY.createPointable();
        return new AbstractTaggedValueArgumentScalarEvaluator(args) {
            @Override
            protected void evaluate(TaggedValuePointable[] args, IPointable result) throws SystemException {
                try {
                    TaggedValuePointable tvp2 = args[1];
                    if (tvp2.getTag() != ValueTag.XS_INTEGER_TAG) {
                        throw new SystemException(ErrorCode.FORG0006);
                    }
                    tvp2.getValue(longp);

                    abvs.reset();
                    sb.reset(abvs);
                    TaggedValuePointable tvp1 = args[0];
                    TaggedValuePointable tvp3 = args[2];
                    if (tvp1.getTag() == ValueTag.SEQUENCE_TAG) {
                        tvp1.getValue(seq);
                        int seqLen = seq.getEntryCount();
                        if (longp.getLong() < 1) {
                            // Add to the beginning.
View Full Code Here

Examples of org.apache.vxquery.datamodel.accessors.TaggedValuePointable

    @Override
    protected void constructNode(DictionaryBuilder db, TaggedValuePointable[] args, IMutableValueStorage mvs)
            throws IOException, SystemException {
        enb.reset(mvs);
        TaggedValuePointable nameArg = args[0];
        if (nameArg.getTag() != ValueTag.XS_QNAME_TAG) {
            throw new SystemException(ErrorCode.XPST0081);
        }
        nameArg.getValue(namep);
        namep.getUri(strp);
        int uriCode = db.lookup(strp);
        namep.getPrefix(strp);
        int prefixCode = db.lookup(strp);
        namep.getLocalName(strp);
        int localCode = db.lookup(strp);
        enb.setName(uriCode, localCode, prefixCode);
        TaggedValuePointable valueArg = args[1];
        enb.startAttributeChunk();
        int index = processAttributes(valueArg, db);
        enb.endAttributeChunk();
        enb.startChildrenChunk();
        if (index >= 0) {
View Full Code Here

Examples of org.apache.vxquery.datamodel.accessors.TaggedValuePointable

    }

    private int processAttributes(TaggedValuePointable tvp, DictionaryBuilder db) throws IOException {
        if (tvp.getTag() == ValueTag.SEQUENCE_TAG) {
            tvp.getValue(seqp);
            TaggedValuePointable tempTvp = ppool.takeOne(TaggedValuePointable.class);
            for (int i = 0; i < seqp.getEntryCount(); ++i) {
                seqp.getEntry(i, tempTvp);
                if (!processIfAttribute(tempTvp, db)) {
                    return i;
                }
View Full Code Here

Examples of org.apache.vxquery.datamodel.accessors.TaggedValuePointable

            return false;
        }
        NodeTreePointable ntp = ppool.takeOne(NodeTreePointable.class);
        try {
            tvp.getValue(ntp);
            TaggedValuePointable innerTvp = ppool.takeOne(TaggedValuePointable.class);
            try {
                ntp.getRootNode(innerTvp);
                if (innerTvp.getTag() != ValueTag.ATTRIBUTE_NODE_TAG) {
                    return false;
                }
                AttributeNodePointable anp = ppool.takeOne(AttributeNodePointable.class);
                try {
                    innerTvp.getValue(anp);
                    copyAttribute(enb, db, ntp, anp);
                } finally {
                    ppool.giveBack(anp);
                }
                return true;
View Full Code Here

Examples of org.apache.vxquery.datamodel.accessors.TaggedValuePointable

    private void copyElement(ElementNodeBuilder enb, DictionaryBuilder db, NodeTreePointable ntp,
            ElementNodePointable enp) throws IOException {
        UTF8StringPointable strp = ppool.takeOne(UTF8StringPointable.class);
        SequencePointable seqp = ppool.takeOne(SequencePointable.class);
        AttributeNodePointable anp = ppool.takeOne(AttributeNodePointable.class);
        TaggedValuePointable tvp = ppool.takeOne(TaggedValuePointable.class);
        ElementNodePointable cenp = ppool.takeOne(ElementNodePointable.class);
        try {
            ElementNodeBuilder tempEnb = createENB();
            enb.startChild(tempEnb);
            enp.getName(cqp);
            int newURICode = recode(cqp.getNamespaceCode(), ntp, db, strp);
            int newPrefixCode = recode(cqp.getPrefixCode(), ntp, db, strp);
            int newLocalCode = recode(cqp.getLocalCode(), ntp, db, strp);
            tempEnb.setName(newURICode, newLocalCode, newPrefixCode);
            tempEnb.startAttributeChunk();
            if (enp.attributesChunkExists()) {
                enp.getAttributeSequence(ntp, seqp);
                for (int i = 0; i < seqp.getEntryCount(); ++i) {
                    seqp.getEntry(i, tvp);
                    tvp.getValue(anp);
                    copyAttribute(tempEnb, db, ntp, anp);
                }
            }
            tempEnb.endAttributeChunk();
            tempEnb.startChildrenChunk();
            if (enp.childrenChunkExists()) {
                enp.getChildrenSequence(ntp, seqp);
                for (int i = 0; i < seqp.getEntryCount(); ++i) {
                    seqp.getEntry(i, tvp);
                    byte nTag = tvp.getTag();
                    switch (nTag) {
                        case ValueTag.ELEMENT_NODE_TAG: {
                            tvp.getValue(cenp);
                            copyElement(tempEnb, db, ntp, cenp);
                            break;
                        }
                        case ValueTag.COMMENT_NODE_TAG:
                        case ValueTag.PI_NODE_TAG:
View Full Code Here

Examples of org.apache.vxquery.datamodel.accessors.TaggedValuePointable

    private void copyDocument(ElementNodeBuilder enb, DictionaryBuilder db, NodeTreePointable ntp,
            DocumentNodePointable dnp) throws IOException {
        SequencePointable seqp = ppool.takeOne(SequencePointable.class);
        AttributeNodePointable anp = ppool.takeOne(AttributeNodePointable.class);
        TaggedValuePointable tvp = ppool.takeOne(TaggedValuePointable.class);
        ElementNodePointable cenp = ppool.takeOne(ElementNodePointable.class);
        try {
            dnp.getContent(ntp, seqp);
            for (int i = 0; i < seqp.getEntryCount(); ++i) {
                seqp.getEntry(i, tvp);
                if (tvp.getTag() == ValueTag.ELEMENT_NODE_TAG) {
                    tvp.getValue(cenp);
                    copyElement(enb, db, ntp, cenp);
                    break;
                }
            }
        } finally {
View Full Code Here

Examples of org.apache.vxquery.datamodel.accessors.TaggedValuePointable

    private void processChildren(TaggedValuePointable tvp, int start, DictionaryBuilder db) throws IOException,
            SystemException {
        if (tvp.getTag() == ValueTag.SEQUENCE_TAG) {
            tvp.getValue(seqp);
            TaggedValuePointable tempTvp = ppool.takeOne(TaggedValuePointable.class);
            for (int i = start; i < seqp.getEntryCount(); ++i) {
                seqp.getEntry(i, tempTvp);
                processChild(tempTvp, db);
            }
            ppool.giveBack(tempTvp);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.