forked from kohsuke/com4j
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathReturnValue.java
More file actions
79 lines (74 loc) · 2.1 KB
/
ReturnValue.java
File metadata and controls
79 lines (74 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
package com4j;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Specifies which method parameter in the COM method
* is used as the return value
*
* @author Kohsuke Kawaguchi (kk@kohsuke.org)
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface ReturnValue {
/**
* The index of the parameter with [retval] marker.
*
* <p>
* If 0, the retval parameter is the 1st parameter in the parameter list.
* The default value '-1' means the return value is the last parameter.
*
* <p>
* If the method has the return type <tt>void</tt>, the COM method
* is assumed to have no return value (regardless of this annotation.)
*/
int index() default -1;
/**
* True if the [retval] parameter is "in/out" (therefore it also shows up in the
* Java parameter list.) Otherwise, the return value is not a part of the
* Java parameter list.
*/
boolean inout() default false;
/**
* The native type to be unmarshalled.
*/
NativeType type() default NativeType.Default;
/**
* Indicates that the return value is actually a result from invoking
* default properties.
*
* <p>
* For example, when the underlying type definitions are as follows:
* <pre>
* interface IFoo {
* @VTID(10)
* IBar abc();
* }
* interface IBar {
* @DefaultProperty
* IZot def();
* }
* interface IZot {
* @
* int value(int index);
* }
* </pre>
* <p>
* The following method on the IFoo interface effectively works
* as a short-cut of the following chain:
* </p>
* <pre>
* IFoo {
* @ReturnValue(defaultPropertyThrough={IFoo.class,IBar.class})
* @VTID(10)
* int abc(int index);
* }
*
* // equivalent
* pFoo.value(5);
* pFoo.abc().def().value(5);
* </pre>
*/
Class<? extends Com4jObject>[] defaultPropertyThrough() default {};
}