Class ParseJsonFn

    • Constructor Detail

      • ParseJsonFn

        public ParseJsonFn()
    • Method Detail

      • eval

        protected Item eval​(java.lang.String input,
                            MapItem options,
                            XPathContext context)
                     throws XPathException
        Parse the JSON string according to supplied options
        Overrides:
        eval in class JsonToXMLFn
        Parameters:
        input - JSON input string
        options - options for the conversion as a map of xs:string : value pairs
        context - XPath evaluation context
        Returns:
        the result of the parsing, typically a map or array
        Throws:
        XPathException - if the syntax of the input is incorrect
      • parse

        public static Item parse​(java.lang.String input,
                                 java.util.Map<java.lang.String,​GroundedValue> options,
                                 XPathContext context)
                          throws XPathException
        Parse the JSON string according to supplied options
        Parameters:
        input - JSON input string
        options - options for the conversion as a map of xs:string : value pairs
        context - XPath evaluation context
        Returns:
        the result of the parsing, as an item (null in the case where the JSON input is "null")
        Throws:
        XPathException - if the syntax of the input is incorrect