Package net.sf.saxon.value

Examples of net.sf.saxon.value.ObjectValue


    public Value transform(Object source, TransformationContext context) {
        // WORKAROUND for ClassCastException in ObjectValue.toJavaObject(float)
        if (source instanceof Float) {
            return new FloatValue(((Float)source).floatValue());
        }
        return new ObjectValue(source);
    }
View Full Code Here


    */

    public SequenceIterator iterate(XPathContext context) throws XPathException {
        SequenceIterator base = operand.iterate(context);

        ObjectValue stopper;
        if (!Cardinality.allowsZero(requiredCardinality)) {
            // To check for an empty sequence, we add a special item to the base
            // iteration, to ensure that the mapping function gets called at least
            // once. This item will cause an error if it is the first in the sequence,
            // and will be ignored otherwise.
            stopper = new ObjectValue(this);
            base = new AppendExpression.AppendIterator(base, stopper, context);
        }
        return new MappingIterator(base, this, null, base);
    }
View Full Code Here

    } else if(source instanceof BigDecimal) {
      result = new DecimalValue((BigDecimal)source);
    } else if(source instanceof String) {
      result = new StringValue(((String)source));
    } else {
      result = new ObjectValue(source);
    }
   
    return result;
  }
View Full Code Here

  public int getWeight() {
    return 10000;
  }

  public Value transform(Object source, TransformationContext context) {
    return new ObjectValue(source);
  }
View Full Code Here

                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

        } else if (source instanceof BigDecimal) {
            result = new DecimalValue((BigDecimal)source);
        } else if (source instanceof String) {
            result = new StringValue(((String)source));
        } else {
            result = new ObjectValue(source);
        }

        return result;
    }
View Full Code Here

        } else if (source instanceof BigDecimal) {
            result = new DecimalValue((BigDecimal)source);
        } else if (source instanceof String) {
            result = new StringValue(((String)source));
        } else {
            result = new ObjectValue(source);
        }

        return result;
    }
View Full Code Here

    public int getWeight() {
        return 10000;
    }

    public Value transform(Object source, TransformationContext context) {
        return new ObjectValue(source);
    }
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

        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

TOP

Related Classes of net.sf.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.