Search in sources :

Example 91 with JSONArray

use of com.oracle.truffle.tools.utils.json.JSONArray in project graal by oracle.

the class WorkspaceFoldersChangeEvent method getAdded.

/**
 * The array of added workspace folders.
 */
public List<WorkspaceFolder> getAdded() {
    final JSONArray json = jsonData.getJSONArray("added");
    final List<WorkspaceFolder> list = new ArrayList<>(json.length());
    for (int i = 0; i < json.length(); i++) {
        list.add(new WorkspaceFolder(json.getJSONObject(i)));
    }
    return Collections.unmodifiableList(list);
}
Also used : JSONArray(com.oracle.truffle.tools.utils.json.JSONArray) ArrayList(java.util.ArrayList)

Example 92 with JSONArray

use of com.oracle.truffle.tools.utils.json.JSONArray in project graal by oracle.

the class WorkspaceFoldersChangeEvent method create.

public static WorkspaceFoldersChangeEvent create(List<WorkspaceFolder> added, List<WorkspaceFolder> removed) {
    final JSONObject json = new JSONObject();
    JSONArray addedJsonArr = new JSONArray();
    for (WorkspaceFolder workspaceFolder : added) {
        addedJsonArr.put(workspaceFolder.jsonData);
    }
    json.put("added", addedJsonArr);
    JSONArray removedJsonArr = new JSONArray();
    for (WorkspaceFolder workspaceFolder : removed) {
        removedJsonArr.put(workspaceFolder.jsonData);
    }
    json.put("removed", removedJsonArr);
    return new WorkspaceFoldersChangeEvent(json);
}
Also used : JSONObject(com.oracle.truffle.tools.utils.json.JSONObject) JSONArray(com.oracle.truffle.tools.utils.json.JSONArray)

Example 93 with JSONArray

use of com.oracle.truffle.tools.utils.json.JSONArray in project graal by oracle.

the class UnregistrationParams method setUnregisterations.

public UnregistrationParams setUnregisterations(List<Unregistration> unregisterations) {
    final JSONArray json = new JSONArray();
    for (Unregistration unregistration : unregisterations) {
        json.put(unregistration.jsonData);
    }
    jsonData.put("unregisterations", json);
    return this;
}
Also used : JSONArray(com.oracle.truffle.tools.utils.json.JSONArray)

Example 94 with JSONArray

use of com.oracle.truffle.tools.utils.json.JSONArray in project graal by oracle.

the class UnregistrationParams method getUnregisterations.

public List<Unregistration> getUnregisterations() {
    final JSONArray json = jsonData.getJSONArray("unregisterations");
    final List<Unregistration> list = new ArrayList<>(json.length());
    for (int i = 0; i < json.length(); i++) {
        list.add(new Unregistration(json.getJSONObject(i)));
    }
    return Collections.unmodifiableList(list);
}
Also used : JSONArray(com.oracle.truffle.tools.utils.json.JSONArray) ArrayList(java.util.ArrayList)

Example 95 with JSONArray

use of com.oracle.truffle.tools.utils.json.JSONArray in project graal by oracle.

the class SignatureInformation method setParameters.

public SignatureInformation setParameters(List<ParameterInformation> parameters) {
    if (parameters != null) {
        final JSONArray json = new JSONArray();
        for (ParameterInformation parameterInformation : parameters) {
            json.put(parameterInformation.jsonData);
        }
        jsonData.put("parameters", json);
    }
    return this;
}
Also used : JSONArray(com.oracle.truffle.tools.utils.json.JSONArray)

Aggregations

JSONArray (com.oracle.truffle.tools.utils.json.JSONArray)195 JSONObject (com.oracle.truffle.tools.utils.json.JSONObject)85 ArrayList (java.util.ArrayList)74 DebugValue (com.oracle.truffle.api.debug.DebugValue)8 Params (com.oracle.truffle.tools.chromeinspector.commands.Params)8 Collection (java.util.Collection)7 List (java.util.List)7 DebugException (com.oracle.truffle.api.debug.DebugException)6 Source (com.oracle.truffle.api.source.Source)5 SourceSection (com.oracle.truffle.api.source.SourceSection)4 CommandProcessException (com.oracle.truffle.tools.chromeinspector.server.CommandProcessException)4 HashMap (java.util.HashMap)4 Location (com.oracle.truffle.tools.chromeinspector.types.Location)3 Script (com.oracle.truffle.tools.chromeinspector.types.Script)3 CPUSampler (com.oracle.truffle.tools.profiler.CPUSampler)3 CPUSamplerData (com.oracle.truffle.tools.profiler.CPUSamplerData)3 PrintWriter (java.io.PrintWriter)3 Map (java.util.Map)3 TruffleContext (com.oracle.truffle.api.TruffleContext)2 Breakpoint (com.oracle.truffle.api.debug.Breakpoint)2