Class CastingExpression

    • Constructor Detail

      • CastingExpression

        public CastingExpression​(Expression source,
                                 AtomicType target,
                                 boolean allowEmpty)
        Create a cast expression
        Parameters:
        source - expression giving the value to be converted
        target - the type to which the value is to be converted
        allowEmpty - true if the expression allows an empty sequence as input, producing an empty sequence as output. If false, an empty sequence is a type error.
    • Method Detail

      • getTargetPrimitiveType

        public AtomicType getTargetPrimitiveType()
        Get the primitive base type of the target type of the cast
        Returns:
        the primitive type of the target type
      • setTargetType

        public void setTargetType​(AtomicType type)
        Set the target type
        Parameters:
        type - the target type for the cast
      • getTargetType

        public AtomicType getTargetType()
        Get the target type (the result type)
        Returns:
        the target type
      • setAllowEmpty

        public void setAllowEmpty​(boolean allow)
        Say whether the expression accepts an empty sequence as input (producing an empty sequence as output)
        Parameters:
        allow - true if an empty sequence is accepted
      • allowsEmpty

        public boolean allowsEmpty()
        Ask whether the expression accepts an empty sequence as input (producing an empty sequence as output)
        Returns:
        true if an empty sequence is accepted
      • setOperandIsStringLiteral

        public void setOperandIsStringLiteral​(boolean option)
        Say whether the operand to the cast expression was supplied in the form of a string literal. This is relevant only for XPath 2.0 / XQuery 1.0, and then only when the target type is a QName or NOTATION.
        Parameters:
        option - true if the operand was supplied as a string literal
      • isOperandIsStringLiteral

        public boolean isOperandIsStringLiteral()
        Ask whether the operand to the cast expression was supplied in the form of a string literal. This is relevant only for XPath 2.0 / XQuery 1.0, and then only when the target type is a QName or NOTATION.
        Returns:
        true if the operand was supplied as a string literal
      • getConverter

        public Converter getConverter()
        Get the Converter allocated to implement this cast expression, if any
        Returns:
        the Converter if one has been statically allocated, or null if not
      • setNamespaceResolver

        public void setNamespaceResolver​(NamespaceResolver resolver)
        Set the namespace resolver, if any
        Parameters:
        resolver - the namespace resolver to be used if the target type is namespace-sensitive
      • getNamespaceResolver

        public NamespaceResolver getNamespaceResolver()
        Get the namespace resolver, if any
        Returns:
        the namespace resolver that was statically allocated if the target type is namespace-sensitive