All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.openqa.selenium.devtools.v90.debugger.model.CallFrame Maven / Gradle / Ivy

Go to download

Selenium automates browsers. That's it! What you do with that power is entirely up to you.

There is a newer version: 4.0.0-beta-4
Show newest version
package org.openqa.selenium.devtools.v90.debugger.model;

import org.openqa.selenium.Beta;
import org.openqa.selenium.json.JsonInput;

/**
 * JavaScript call frame. Array of call frames form the call stack.
 */
public class CallFrame {

    private final org.openqa.selenium.devtools.v90.debugger.model.CallFrameId callFrameId;

    private final java.lang.String functionName;

    private final java.util.Optional functionLocation;

    private final org.openqa.selenium.devtools.v90.debugger.model.Location location;

    private final java.lang.String url;

    private final java.util.List scopeChain;

    private final org.openqa.selenium.devtools.v90.runtime.model.RemoteObject _this;

    private final java.util.Optional returnValue;

    public CallFrame(org.openqa.selenium.devtools.v90.debugger.model.CallFrameId callFrameId, java.lang.String functionName, java.util.Optional functionLocation, org.openqa.selenium.devtools.v90.debugger.model.Location location, java.lang.String url, java.util.List scopeChain, org.openqa.selenium.devtools.v90.runtime.model.RemoteObject _this, java.util.Optional returnValue) {
        this.callFrameId = java.util.Objects.requireNonNull(callFrameId, "callFrameId is required");
        this.functionName = java.util.Objects.requireNonNull(functionName, "functionName is required");
        this.functionLocation = functionLocation;
        this.location = java.util.Objects.requireNonNull(location, "location is required");
        this.url = java.util.Objects.requireNonNull(url, "url is required");
        this.scopeChain = java.util.Objects.requireNonNull(scopeChain, "scopeChain is required");
        this._this = java.util.Objects.requireNonNull(_this, "this is required");
        this.returnValue = returnValue;
    }

    /**
     * Call frame identifier. This identifier is only valid while the virtual machine is paused.
     */
    public org.openqa.selenium.devtools.v90.debugger.model.CallFrameId getCallFrameId() {
        return callFrameId;
    }

    /**
     * Name of the JavaScript function called on this call frame.
     */
    public java.lang.String getFunctionName() {
        return functionName;
    }

    /**
     * Location in the source code.
     */
    public java.util.Optional getFunctionLocation() {
        return functionLocation;
    }

    /**
     * Location in the source code.
     */
    public org.openqa.selenium.devtools.v90.debugger.model.Location getLocation() {
        return location;
    }

    /**
     * JavaScript script name or url.
     */
    public java.lang.String getUrl() {
        return url;
    }

    /**
     * Scope chain for this call frame.
     */
    public java.util.List getScopeChain() {
        return scopeChain;
    }

    /**
     * `this` object for this call frame.
     */
    public org.openqa.selenium.devtools.v90.runtime.model.RemoteObject getThis() {
        return _this;
    }

    /**
     * The value being returned, if the function is at return point.
     */
    public java.util.Optional getReturnValue() {
        return returnValue;
    }

    private static CallFrame fromJson(JsonInput input) {
        org.openqa.selenium.devtools.v90.debugger.model.CallFrameId callFrameId = null;
        java.lang.String functionName = null;
        java.util.Optional functionLocation = java.util.Optional.empty();
        org.openqa.selenium.devtools.v90.debugger.model.Location location = null;
        java.lang.String url = null;
        java.util.List scopeChain = null;
        org.openqa.selenium.devtools.v90.runtime.model.RemoteObject _this = null;
        java.util.Optional returnValue = java.util.Optional.empty();
        input.beginObject();
        while (input.hasNext()) {
            switch(input.nextName()) {
                case "callFrameId":
                    callFrameId = input.read(org.openqa.selenium.devtools.v90.debugger.model.CallFrameId.class);
                    break;
                case "functionName":
                    functionName = input.nextString();
                    break;
                case "functionLocation":
                    functionLocation = java.util.Optional.ofNullable(input.read(org.openqa.selenium.devtools.v90.debugger.model.Location.class));
                    break;
                case "location":
                    location = input.read(org.openqa.selenium.devtools.v90.debugger.model.Location.class);
                    break;
                case "url":
                    url = input.nextString();
                    break;
                case "scopeChain":
                    scopeChain = input.read(new com.google.common.reflect.TypeToken>() {
                    }.getType());
                    break;
                case "this":
                    _this = input.read(org.openqa.selenium.devtools.v90.runtime.model.RemoteObject.class);
                    break;
                case "returnValue":
                    returnValue = java.util.Optional.ofNullable(input.read(org.openqa.selenium.devtools.v90.runtime.model.RemoteObject.class));
                    break;
                default:
                    input.skipValue();
                    break;
            }
        }
        input.endObject();
        return new CallFrame(callFrameId, functionName, functionLocation, location, url, scopeChain, _this, returnValue);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy