-
Notifications
You must be signed in to change notification settings - Fork 226
Expand file tree
/
Copy pathExposedType.java
More file actions
39 lines (32 loc) · 1.02 KB
/
ExposedType.java
File metadata and controls
39 lines (32 loc) · 1.02 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
package org.python.expose;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.python.core.PyNewWrapper;
import org.python.core.PyObject;
import org.python.core.PyType;
/**
* Indicates a given class should be made visible to Python code as a builtin type.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface ExposedType {
/**
* @return the name to expose this item as. Defaults to the actual name of the class.
*/
String name() default "";
/**
* @return the base type of this type. Must be another class anotated with ExposedType. If
* unspecified, the base is set to object, or PyObject.class.
*/
Class base() default Object.class;
/**
* @return Whether this type allows subclassing.
*/
boolean isBaseType() default true;
/**
* Returns the __doc__ String for this type.
*/
String doc() default "";
}