Package com.volantis.xml.expression

Examples of com.volantis.xml.expression.Variable


    }

    // javadoc inherited
    public Variable declareVariable(ExpandedName name,
                                    Value initialValue) {
        Variable variable = null;

        if (variables.containsKey(name)) {
            throw new IllegalArgumentException(
                    "Variable " + name.getLocalName() + " in namespace \"" +
                    name.getNamespaceURI() + "\" already exists in this scope");
View Full Code Here


        return declareVariable(name, SimpleVariable.UNSET);
    }

    // javadoc inherited
    public Variable resolveVariable(ExpandedName name) {
        Variable variable = (Variable)variables.get(name);

        // Since the current scope doesn't have this variable defined in it
        // look for it in the enclosing scope, if there is one
        if ((variable == null) &&
                (enclosingScope != null)) {
View Full Code Here

        }
    }

    // javadoc inherited
    public Object getVariable(String variable) {
        Variable var = getCurrentScope().resolveVariable(expandName(variable));

        if (var == null) {
            throw new IllegalArgumentException(
                    "An attempt was made to get an unknown variable " +
                    variable);
        } else {
            return var.getValue();
        }
    }
View Full Code Here

        PositionScope pc = expressionContext.getPositionScope();

        // Declare an unitialized variable.
        InternalExpressionScope scope = (InternalExpressionScope)
                expressionContext.getCurrentScope();
        Variable variable = scope.declareVariable(variableName);

        // Iterate over the sequence.
        int length = sequence.getLength();

        for (int i = 1; i <= length; i += 1) {
            // Increment to the next position in the sequence
            pc.increment();

            // Get the item.
            try {
                variable.setValue(sequence.getItem(i));
            } catch (SequenceIndexOutOfBoundsException e) {
                throw new ExtendedSAXException(e);
            }

            // Replay the events through the dynamic process.
View Full Code Here

TOP

Related Classes of com.volantis.xml.expression.Variable

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.