Example usage for org.openqa.selenium.json JsonOutput name

List of usage examples for org.openqa.selenium.json JsonOutput name

Introduction

In this page you can find the example usage for org.openqa.selenium.json JsonOutput name.

Prototype

public JsonOutput name(String name) 

Source Link

Usage

From source file:io.appium.java_client.remote.NewAppiumSessionPayload.java

License:Apache License

private void writeMetaData(JsonOutput out) throws IOException {
    CharSource charSource = backingStore.asByteSource().asCharSource(UTF_8);
    try (Reader reader = charSource.openBufferedStream(); JsonInput input = json.newInput(reader)) {
        input.beginObject();/*from w  ww .  j  a v  a2  s. co  m*/
        while (input.hasNext()) {
            String name = input.nextName();
            switch (name) {
            case CAPABILITIES:
            case DESIRED_CAPABILITIES:
            case REQUIRED_CAPABILITIES:
                input.skipValue();
                break;

            default:
                out.name(name);
                out.write(input.read(Object.class));
                break;
            }
        }
    }
}