Class GlobalParameterSet


  • public class GlobalParameterSet
    extends java.lang.Object
    A GlobalParameterSet is a set of parameters supplied when invoking a stylesheet or query. It is a collection of name-value pairs, the names being represented by StructuredQName objects. The values are objects, as supplied by the caller: conversion of the object to a required type takes place when the parameter is actually used.
    • Constructor Detail

      • GlobalParameterSet

        public GlobalParameterSet()
        Create an empty parameter set
      • GlobalParameterSet

        public GlobalParameterSet​(GlobalParameterSet parameterSet)
        Create a parameter set as a copy of an existing parameter set
        Parameters:
        parameterSet - the parameter set to be copied
    • Method Detail

      • put

        public void put​(StructuredQName qName,
                        GroundedValue value)
        Add a parameter to the ParameterSet
        Parameters:
        qName - The fingerprint of the parameter name.
        value - The value of the parameter, or null if the parameter is to be removed
      • get

        public GroundedValue get​(StructuredQName qName)
        Get a parameter
        Parameters:
        qName - The parameter name.
        Returns:
        The value of the parameter, or null if not defined
      • convertParameterValue

        public GroundedValue convertParameterValue​(StructuredQName qName,
                                                   SequenceType requiredType,
                                                   boolean convert,
                                                   XPathContext context)
                                            throws XPathException
        Get the value of a parameter, converted to the required type, or checked against the required type if no type conversion is in force
        Parameters:
        qName - the name of the parameter
        requiredType - the required type of the parameter
        convert - set to true if function conversion rules are to be applied, or to false if the value is simply to be checked against the required type
        context - dynamic evaluation context
        Returns:
        the value after conversion and type checking; or null if there is no value for this parameter
        Throws:
        XPathException - if the value is of the wrong type
      • clear

        public void clear()
        Clear all values
      • getKeys

        public java.util.Collection<StructuredQName> getKeys()
        Get all the keys that have been allocated
        Returns:
        the names of the parameter keys (QNames)
      • getNumberOfKeys

        public int getNumberOfKeys()
        Get the number of entries in the result of getKeys() that are significant
        Returns:
        the number of entries