java.lang.Object
com.pervasive.datarush.operators.io.textfile.JsonHelper
A simple JSON helper utility
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic com.fasterxml.jackson.core.JsonParsercreateJsonParser(Reader input) Create a JsonParser with default feature valuesstatic com.fasterxml.jackson.core.JsonParsercreateJsonParser(Reader input, boolean... arguments) Create a JsonParser with custom feature values Order of JsonParser arguments: Feature.ALLOW_COMMENTS Feature.ALLOW_UNQUOTED_FIELD_NAMES Feature.ALLOW_SINGLE_QUOTES Feature.ALLOW_UNQUOTED_CONTROL_CHARS Feature.ALLOW_BACKSLASH_ESCAPING_ANY_CHARACTER Feature.ALLOW_NUMERIC_LEADING_ZEROS Feature.ALLOW_NON_NUMERIC_NUMBERSstatic com.fasterxml.jackson.core.JsonParsercreateLenientJsonParser(Reader input) Create a JsonParser with all features enabled.static com.fasterxml.jackson.databind.ObjectMappercreateObjectMapper(boolean... arguments) Order of ObjectMapper arguments: Feature.ALLOW_COMMENTS Feature.ALLOW_UNQUOTED_FIELD_NAMES Feature.ALLOW_SINGLE_QUOTES Feature.ALLOW_UNQUOTED_CONTROL_CHARS Feature.ALLOW_BACKSLASH_ESCAPING_ANY_CHARACTER Feature.ALLOW_NUMERIC_LEADING_ZEROS Feature.ALLOW_NON_NUMERIC_NUMBERS
-
Constructor Details
-
JsonHelper
public JsonHelper()
-
-
Method Details
-
createObjectMapper
public static com.fasterxml.jackson.databind.ObjectMapper createObjectMapper(boolean... arguments) Order of ObjectMapper arguments: Feature.ALLOW_COMMENTS Feature.ALLOW_UNQUOTED_FIELD_NAMES Feature.ALLOW_SINGLE_QUOTES Feature.ALLOW_UNQUOTED_CONTROL_CHARS Feature.ALLOW_BACKSLASH_ESCAPING_ANY_CHARACTER Feature.ALLOW_NUMERIC_LEADING_ZEROS Feature.ALLOW_NON_NUMERIC_NUMBERS- Parameters:
arguments- list of ObjectMapper features- Returns:
- objectMapper
-
createJsonParser
public static com.fasterxml.jackson.core.JsonParser createJsonParser(Reader input) throws IOException Create a JsonParser with default feature values- Parameters:
input- Reader to use for reading JSON content to parse- Returns:
- new JsonParser
- Throws:
IOException
-
createJsonParser
public static com.fasterxml.jackson.core.JsonParser createJsonParser(Reader input, boolean... arguments) throws IOException Create a JsonParser with custom feature values Order of JsonParser arguments: Feature.ALLOW_COMMENTS Feature.ALLOW_UNQUOTED_FIELD_NAMES Feature.ALLOW_SINGLE_QUOTES Feature.ALLOW_UNQUOTED_CONTROL_CHARS Feature.ALLOW_BACKSLASH_ESCAPING_ANY_CHARACTER Feature.ALLOW_NUMERIC_LEADING_ZEROS Feature.ALLOW_NON_NUMERIC_NUMBERS- Parameters:
input- Reader to use for reading JSON content to parsearguments- a boolean array with exactly 7 elements- Returns:
- new JsonParser
- Throws:
IOException
-
createLenientJsonParser
public static com.fasterxml.jackson.core.JsonParser createLenientJsonParser(Reader input) throws IOException Create a JsonParser with all features enabled.- Parameters:
input- Reader to use for reading JSON content to parse- Returns:
- new JsonParser
- Throws:
IOException
-