Class CastFunction

    • Constructor Detail

      • CastFunction

        public CastFunction()
    • Method Detail

      • convert

        protected abstract Literal convert​(ValueFactory vf,
                                           Value v)
                                    throws ValueExprEvaluationException
        Convert the supplied value to a literal of the function output datatype.
        Parameters:
        vf - the valueFactory to use
        v - a value that is not a string-typed literal, and not a literal of the same datatype as the function output datatype.
        Returns:
        a literal value of the function output datatype
        Throws:
        ValueExprEvaluationException - if an error occurs in conversion.
      • getXsdDatatype

        protected abstract IRI getXsdDatatype()
        Get the specific XML Schema datatype which this function returns.
        Returns:
        an XML Schema datatype IRI
      • getXsdName

        protected String getXsdName()
        Returns a prefixed name representation of the specific datatype that this function returns
        Returns:
        a prefixed name, e.g. 'xsd:integer'.
      • isValidForDatatype

        protected abstract boolean isValidForDatatype​(String lexicalValue)
        Verifies that the supplied lexical value is valid for the datatype.
        Parameters:
        lexicalValue - a lexical value
        Returns:
        true if the lexical value is valid for the datatype, false otherwise.