equal
deleted
inserted
replaced
|
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
|
2 // Use of this source code is governed by a BSD-style license that can be |
|
3 // found in the LICENSE file. |
|
4 |
|
5 package org.chromium.sdk.internal.protocol; |
|
6 |
|
7 import java.util.List; |
|
8 |
|
9 import org.chromium.sdk.internal.protocol.data.ScriptHandle; |
|
10 import org.chromium.sdk.internal.protocol.data.ValueHandle; |
|
11 import org.chromium.sdk.internal.protocolparser.JsonProtocolParseException; |
|
12 import org.chromium.sdk.internal.protocolparser.JsonSubtypeCasting; |
|
13 import org.chromium.sdk.internal.protocolparser.JsonType; |
|
14 import org.json.simple.JSONObject; |
|
15 |
|
16 /** |
|
17 * This is empty base type for all command response body types. The actual type |
|
18 * depends on a particular command. Note that in JSON sometimes it is an array rather than object |
|
19 * (for scripts). |
|
20 */ |
|
21 @JsonType(subtypesChosenManually=true) |
|
22 public interface CommandResponseBody { |
|
23 @JsonSubtypeCasting |
|
24 BacktraceCommandBody asBacktraceCommandBody() throws JsonProtocolParseException; |
|
25 |
|
26 @JsonSubtypeCasting |
|
27 List<ScriptHandle> asScripts() throws JsonProtocolParseException; |
|
28 |
|
29 @JsonSubtypeCasting |
|
30 BreakpointBody asBreakpointBody() throws JsonProtocolParseException; |
|
31 |
|
32 @JsonSubtypeCasting |
|
33 // map refId -> ValueHandle |
|
34 JSONObject asLookupMap() throws JsonProtocolParseException; |
|
35 |
|
36 @JsonSubtypeCasting(reinterpret=true) |
|
37 ValueHandle asEvaluateBody() throws JsonProtocolParseException; |
|
38 |
|
39 @JsonSubtypeCasting |
|
40 ScopeBody asScopeBody() throws JsonProtocolParseException; |
|
41 |
|
42 @JsonSubtypeCasting |
|
43 VersionBody asVersionBody() throws JsonProtocolParseException; |
|
44 } |