openrtb-core/src/main/java/com/google/openrtb/json/OpenRtbNativeJsonReader.java
public final NativeRequest.Builder readNativeRequest(JsonParser par) throws IOException {
    if (emptyToNull(par)) {
      return null;
    }
    NativeRequest.Builder req = NativeRequest.newBuilder();
    boolean rootNativeField = false;
    boolean firstField = true;
    for (startObject(par); endObject(par); par.nextToken()) {
      String fieldName = getCurrentName(par);
      if (par.nextToken() != JsonToken.VALUE_NULL) {
        if (firstField) {
          firstField = false;
          if ((rootNativeField = "native".equals(fieldName)) == true) {
            startObject(par);
            fieldName = getCurrentName(par);
            par.nextToken();
          }
        }
        if (par.getCurrentToken() != JsonToken.VALUE_NULL) {
          readNativeRequestField(par, req, fieldName);
        }
      }
    }
    if (rootNativeField && !endObject(par)) {
      par.nextToken();
    }
    return req;
  }
public final NativeRequest.Builder readNativeRequest(JsonParser par) throws IOException {
    if (emptyToNull(par)) {
      return null;
    }
    NativeRequest.Builder req = NativeRequest.newBuilder();
    boolean rootNativeField = false;
    boolean firstField = true;
    for (startObject(par); endObject(par); par.nextToken()) {
      String fieldName = getCurrentName(par);
      if (par.nextToken() != JsonToken.VALUE_NULL) {
        if (firstField) {
          firstField = false;
          if ((rootNativeField = "native".equals(fieldName)) == true) {
            startObject(par);
            fieldName = getCurrentName(par);
            par.nextToken();
          }
        }
        if (par.getCurrentToken() != JsonToken.VALUE_NULL) {
          readNativeRequestField(par, req, fieldName);
        }
      }
    }
    if (rootNativeField && !endObject(par)) {
      par.nextToken();
    }
    return req;
  }
public final NativeRequest . Builder readNativeRequest ( JsonParser par ) throws IOException { if ( emptyToNull ( par ) ) { return null ; } NativeRequest . Builder req = NativeRequest . newBuilder ( ) ; boolean rootNativeField = false ; boolean firstField = true ; for ( startObject ( par ) ; endObject ( par ) ; par . nextToken ( ) ) { String fieldName = getCurrentName ( par ) ; if ( par . nextToken ( ) != JsonToken . VALUE_NULL ) { if ( firstField ) { firstField = false ; if ( ( rootNativeField = "native" . equals ( fieldName ) ) == true ) { startObject ( par ) ; fieldName = getCurrentName ( par ) ; par . nextToken ( ) ; } } if ( par . getCurrentToken ( ) != JsonToken . VALUE_NULL ) { readNativeRequestField ( par , req , fieldName ) ; } } } if ( rootNativeField && ! endObject ( par ) ) { par . nextToken ( ) ; } return req ; }
Desserializes a {@link NativeRequest} from JSON, with a provided {@link JsonParser}
which allows several choices of input and encoding.
Desserializes a {