public class JsonParser extends Object
Modifier and Type | Field and Description |
---|---|
static int |
ALLOW_ANY_TOP_LEVEL |
static int |
DEBUG |
static int |
LIBERAL |
static int |
UNESCAPE |
static int |
VALIDATE |
Constructor and Description |
---|
JsonParser(SourceLocator locator,
IntPredicate charChecker)
Create a JSON parser
|
Modifier and Type | Method and Description |
---|---|
int |
getFlags(MapItem options,
XPathContext context) |
void |
parse(String input,
MapItem options,
JsonHandler handler,
XPathContext context)
Parse the JSON string according to supplied options
|
public static final int UNESCAPE
public static final int ALLOW_ANY_TOP_LEVEL
public static final int LIBERAL
public static final int VALIDATE
public static final int DEBUG
public JsonParser(SourceLocator locator, IntPredicate charChecker)
locator
- the location (in a stylesheet or query) to be used in error messagescharChecker
- a predicate that determines which characters are acceptedpublic void parse(String input, MapItem options, JsonHandler handler, XPathContext context) throws XPathException
input
- JSON input stringoptions
- options for the conversion as a map of xs:string : value pairshandler
- event handler to which parsing events are notifiedcontext
- XPath evaluation contextXPathException
- if the syntax of the input is incorrectpublic int getFlags(MapItem options, XPathContext context) throws XPathException
XPathException
Copyright (c) 2004-2014 Saxonica Limited. All rights reserved.