org.chromium.sdk/src/org/chromium/sdk/internal/protocolparser/JsonSubtypeCasting.java
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.protocolparser; |
|
6 |
|
7 import java.lang.annotation.ElementType; |
|
8 import java.lang.annotation.Retention; |
|
9 import java.lang.annotation.RetentionPolicy; |
|
10 import java.lang.annotation.Target; |
|
11 |
|
12 /** |
|
13 * Marks method as method casting to a subtype. Normally the method return type should be |
|
14 * some other json type, which serves as subtype; the subtype interface must extend |
|
15 * {@link JsonSubtype} (with correct generic parameter). |
|
16 * <p>However for types, annotated as <code>{@link JsonType#subtypesChosenManually()} = true</code>, |
|
17 * the method may return something other than json type; it also may return any json type (free of |
|
18 * mandatory {@link JsonSubtype} inheritance), provided that |
|
19 * <code>{@link #reinterpret()} = true</code>. |
|
20 */ |
|
21 @Retention(RetentionPolicy.RUNTIME) |
|
22 @Target({ ElementType.METHOD }) |
|
23 public @interface JsonSubtypeCasting { |
|
24 boolean reinterpret() default false; |
|
25 } |