public class Parser extends Object
| Constructor and Description |
|---|
Parser() |
| Modifier and Type | Method and Description |
|---|---|
Object |
parseJsonNode(org.apache.kafka.connect.data.Schema schema,
com.fasterxml.jackson.databind.JsonNode input) |
Object |
parseString(org.apache.kafka.connect.data.Schema schema,
String input)
Method is used to parse String data to the proper Java types.
|
void |
registerTypeParser(org.apache.kafka.connect.data.Schema schema,
TypeParser typeParser)
Method is used to register a TypeParser for a given schema.
|
public final void registerTypeParser(org.apache.kafka.connect.data.Schema schema,
TypeParser typeParser)
schema - Schema to register to. This supports any logical type by checking Schema.name() and schema.type().typeParser - The type parser to register for schema.public Object parseString(org.apache.kafka.connect.data.Schema schema, String input)
schema - Input schema to parse the String data by.input - Java type specific to the schema supplied.org.apache.kafka.connect.errors.DataException - Exception is thrown when there is an exception thrown while parsing the input string.UnsupportedOperationException - Exception is thrown if there is no type parser registered for the schema.NullPointerException - Exception is thrown if the schema passed is not optional and a null input value is passed.public Object parseJsonNode(org.apache.kafka.connect.data.Schema schema, com.fasterxml.jackson.databind.JsonNode input)
Copyright © 2016–2017. All rights reserved.