Package org.pdf4j.saxon.value

Examples of org.pdf4j.saxon.value.ObjectValue


                connection = DriverManager.getConnection(dbString, userString, pwdString);
            } catch (Exception ex) {
                dynamicError("JDBC Connection Failure: " + ex.getMessage(), SaxonErrorCode.SXSQ0003, context);
            }

            return new ObjectValue(connection);

        }
View Full Code Here


     * @return the object, wrapped as an XdmAtomicValue
     */

    public XdmAtomicValue getExternalObject(Object object) {
        ExternalObjectType type = new ExternalObjectType(object.getClass(), processor.getUnderlyingConfiguration());
        return (XdmAtomicValue)XdmItem.wrap(new ObjectValue(object, type));
    }
View Full Code Here

            files = directory.listFiles(filter);
        }

        ObjectValue[] fileValues = new ObjectValue[files.length];
        for (int f=0; f<files.length; f++) {
            fileValues[f] = new ObjectValue(files[f]);
        }

        // If the URI requested suppression of errors, or that errors should be treated
        // as warnings, we set up a special ErrorListener to achieve this
View Full Code Here

                        files = file.listFiles(filter);
                    }

                    ObjectValue[] fileValues = new ObjectValue[files.length];
                    for (int f=0; f<files.length; f++) {
                        fileValues[f] = new ObjectValue(files[f]);
                    }

                    FileExpander expander = new FileExpander(params, pipe);
                    return new MappingIterator(new ArrayIterator(fileValues), expander);
                } else {
View Full Code Here

                    ItemType contextItemType = Type.ITEM_TYPE;
                    expr = visitor.typeCheck(expr, contextItemType);
                    pexpr.stackFrameMap = staticContext.getStackFrameMap();
                    ExpressionTool.allocateSlots(expr, pexpr.stackFrameMap.getNumberOfVariables(), pexpr.stackFrameMap);
                    pexpr.expression = expr;
                    return new Literal(new ObjectValue(pexpr));
                } catch (XPathException e) {
                    // If precompilation failed, try again at runtime
                    return this;
                }
            }
View Full Code Here

                dynamicError(
                    "First argument to saxon:eval must be an expression prepared using saxon:expression",
                        SaxonErrorCode.SXXF0001, context);
                return null;
            }
            ObjectValue obj = (ObjectValue)item;
            Object v = obj.getObject();
            if (!(v instanceof PreparedExpression)) {
                dynamicError(
                    "First argument to saxon:eval must be an expression prepared using saxon:expression",
                        SaxonErrorCode.SXXF0001, context);
                return null;
View Full Code Here

    */

    public Item evaluateItem(XPathContext c) throws XPathException {
        if (operation == EXPRESSION) {
            PreparedExpression pexpr = prepareExpression(c);
            return new ObjectValue(pexpr);
        } else if (operation == EVALUATE_NODE) {
            XPathContextMajor c2 = c.newCleanContext();
            PreparedExpression pexpr = prepareExpression(c2);
            c2.setOrigin(details);
            c2.openStackFrame(pexpr.stackFrameMap);
View Full Code Here

    public SequenceIterator iterate(XPathContext c) throws XPathException {
        PreparedExpression pexpr = prepareExpression(c);

        if (operation == EXPRESSION) {
            return SingletonIterator.makeIterator(new ObjectValue(pexpr));
        } else {
            XPathContextMajor c2 = c.newCleanContext();
            c2.setOrigin(details);
            c2.openStackFrame(pexpr.stackFrameMap);
            c2.setCurrentIterator(c.getCurrentIterator());
View Full Code Here

        count = 0;

        // initialise the array with data

        while (true) {
            ObjectValue tupleObject = (ObjectValue)base.next();
            if (tupleObject == null) {
                break;
            }
            ValueRepresentation[] tuple = (ValueRepresentation[])tupleObject.getObject();
            if (count==allocated) {
                allocated *= 2;
                Object[] nk2 = new Object[allocated * recordSize];
                System.arraycopy(nodeKeys, 0, nk2, 0, count * recordSize);
                nodeKeys = nk2;
            }
            int k = count*recordSize;
            nodeKeys[k] = new ObjectValue(tuple[0]);
                // this is the "item" that will be returned by the TupleIterator.
                // In general it is actually a sequence, so we wrap it in an ObjectValue
                // It subsequently gets unwrapped by the MappingFunction applied to the
                // output of the SortedTupleIterator.
            for (int n=1; n<=comparators.length; n++) {
View Full Code Here

    public Item evaluateItem(XPathContext context) throws XPathException {
        Value[] tuple = new Value[components.length];
        for (int i=0; i<components.length; i++) {
            tuple[i] = Value.asValue(ExpressionTool.evaluate(components[i], evaluationModes[i], context, 10));
        }
        return new ObjectValue(tuple);
    }
View Full Code Here

TOP

Related Classes of org.pdf4j.saxon.value.ObjectValue

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.