mirror of https://github.com/apache/nifi.git
NIFI-13156 Replaced JsonParser deprecated getCurrentName() with currentName()
This closes #8807 Signed-off-by: David Handermann <exceptionfactory@apache.org>
This commit is contained in:
parent
6b48e61295
commit
811a491ba5
|
@ -144,7 +144,7 @@ public abstract class AbstractJsonRowRecordReader implements RecordReader {
|
||||||
|
|
||||||
if (strategy == StartingFieldStrategy.NESTED_FIELD) {
|
if (strategy == StartingFieldStrategy.NESTED_FIELD) {
|
||||||
while (jsonParser.nextToken() != null) {
|
while (jsonParser.nextToken() != null) {
|
||||||
if (nestedFieldName.equals(jsonParser.getCurrentName())) {
|
if (nestedFieldName.equals(jsonParser.currentName())) {
|
||||||
logger.debug("Parsing starting at nested field [{}]", nestedFieldName);
|
logger.debug("Parsing starting at nested field [{}]", nestedFieldName);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -306,7 +306,7 @@ public abstract class AbstractJsonRowRecordReader implements RecordReader {
|
||||||
if (jsonParser.getCurrentToken() == JsonToken.FIELD_NAME) {
|
if (jsonParser.getCurrentToken() == JsonToken.FIELD_NAME) {
|
||||||
jsonParser.nextToken();
|
jsonParser.nextToken();
|
||||||
|
|
||||||
final String fieldName = jsonParser.getCurrentName();
|
final String fieldName = jsonParser.currentName();
|
||||||
final String fieldValue = jsonParser.getValueAsString();
|
final String fieldValue = jsonParser.getValueAsString();
|
||||||
|
|
||||||
if (captureFieldPredicate.test(fieldName, fieldValue)) {
|
if (captureFieldPredicate.test(fieldName, fieldValue)) {
|
||||||
|
|
|
@ -271,17 +271,17 @@ public class GetHubSpot extends AbstractProcessor {
|
||||||
final JsonGenerator jsonGenerator = JSON_FACTORY.createGenerator(out, JsonEncoding.UTF8)) {
|
final JsonGenerator jsonGenerator = JSON_FACTORY.createGenerator(out, JsonEncoding.UTF8)) {
|
||||||
boolean isCursorAvailable = false;
|
boolean isCursorAvailable = false;
|
||||||
while (jsonParser.nextToken() != null) {
|
while (jsonParser.nextToken() != null) {
|
||||||
if (jsonParser.getCurrentToken() == JsonToken.FIELD_NAME && jsonParser.getCurrentName()
|
if (jsonParser.getCurrentToken() == JsonToken.FIELD_NAME && jsonParser.currentName()
|
||||||
.equals("total")) {
|
.equals("total")) {
|
||||||
jsonParser.nextToken();
|
jsonParser.nextToken();
|
||||||
total.set(jsonParser.getIntValue());
|
total.set(jsonParser.getIntValue());
|
||||||
}
|
}
|
||||||
if (jsonParser.getCurrentToken() == JsonToken.FIELD_NAME && jsonParser.getCurrentName()
|
if (jsonParser.getCurrentToken() == JsonToken.FIELD_NAME && jsonParser.currentName()
|
||||||
.equals("results")) {
|
.equals("results")) {
|
||||||
jsonParser.nextToken();
|
jsonParser.nextToken();
|
||||||
jsonGenerator.copyCurrentStructure(jsonParser);
|
jsonGenerator.copyCurrentStructure(jsonParser);
|
||||||
}
|
}
|
||||||
final String fieldName = jsonParser.getCurrentName();
|
final String fieldName = jsonParser.currentName();
|
||||||
if (PAGING_CURSOR.equals(fieldName)) {
|
if (PAGING_CURSOR.equals(fieldName)) {
|
||||||
isCursorAvailable = true;
|
isCursorAvailable = true;
|
||||||
jsonParser.nextToken();
|
jsonParser.nextToken();
|
||||||
|
|
|
@ -570,7 +570,7 @@ public class QuerySalesforceObject extends AbstractProcessor {
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean nextTokenIs(JsonParser jsonParser, String value) throws IOException {
|
private boolean nextTokenIs(JsonParser jsonParser, String value) throws IOException {
|
||||||
return jsonParser.getCurrentToken() == JsonToken.FIELD_NAME && jsonParser.getCurrentName()
|
return jsonParser.getCurrentToken() == JsonToken.FIELD_NAME && jsonParser.currentName()
|
||||||
.equals(value) && jsonParser.nextToken() != null;
|
.equals(value) && jsonParser.nextToken() != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -376,7 +376,7 @@ public class GetShopify extends AbstractProcessor {
|
||||||
try (JsonParser jsonParser = JSON_FACTORY.createParser(response.body());
|
try (JsonParser jsonParser = JSON_FACTORY.createParser(response.body());
|
||||||
final JsonGenerator jsonGenerator = JSON_FACTORY.createGenerator(out, JsonEncoding.UTF8)) {
|
final JsonGenerator jsonGenerator = JSON_FACTORY.createGenerator(out, JsonEncoding.UTF8)) {
|
||||||
while (jsonParser.nextToken() != null) {
|
while (jsonParser.nextToken() != null) {
|
||||||
if (jsonParser.getCurrentToken() == JsonToken.FIELD_NAME && jsonParser.getCurrentName()
|
if (jsonParser.getCurrentToken() == JsonToken.FIELD_NAME && jsonParser.currentName()
|
||||||
.equals(resourceName)) {
|
.equals(resourceName)) {
|
||||||
jsonParser.nextToken();
|
jsonParser.nextToken();
|
||||||
jsonGenerator.writeStartArray();
|
jsonGenerator.writeStartArray();
|
||||||
|
|
|
@ -217,7 +217,7 @@ public class GetZendesk extends AbstractZendesk {
|
||||||
JsonGenerator generator = JSON_FACTORY.createGenerator(out, UTF8)) {
|
JsonGenerator generator = JSON_FACTORY.createGenerator(out, UTF8)) {
|
||||||
while (parser.nextToken() != null) {
|
while (parser.nextToken() != null) {
|
||||||
if (parser.getCurrentToken() == FIELD_NAME) {
|
if (parser.getCurrentToken() == FIELD_NAME) {
|
||||||
String fieldName = parser.getCurrentName();
|
String fieldName = parser.currentName();
|
||||||
parser.nextToken();
|
parser.nextToken();
|
||||||
if (zendeskResource.getResponseFieldName().equals(fieldName)) {
|
if (zendeskResource.getResponseFieldName().equals(fieldName)) {
|
||||||
int numberOfExtractedRecords = extractZendeskResourceData(parser, generator);
|
int numberOfExtractedRecords = extractZendeskResourceData(parser, generator);
|
||||||
|
|
Loading…
Reference in New Issue