diff options
author | 2016-06-09 17:43:55 +0000 | |
---|---|---|
committer | 2016-06-10 07:51:39 +0000 | |
commit | 2ca9b721a24691670a5c9bcca8163285923f6d75 (patch) | |
tree | 2aa950cf8145befac0e1643946d68fc63edf6fc6 /src/main/java/com/google/devtools/build/lib/skylarkinterface/SkylarkSignature.java | |
parent | 8ac08bab725574475e95b28c7c7fe72aa0317ba1 (diff) |
Extract the @Param annotation from @SkylarkSignature
The @SkylarkCallable annotation is very limited and to extend it
it is best to share a similar API than the @SkylarkSignature annotation.
--
MOS_MIGRATED_REVID=124473056
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skylarkinterface/SkylarkSignature.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/skylarkinterface/SkylarkSignature.java | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skylarkinterface/SkylarkSignature.java b/src/main/java/com/google/devtools/build/lib/skylarkinterface/SkylarkSignature.java index afe8e9624e..4fc8ad1a4f 100644 --- a/src/main/java/com/google/devtools/build/lib/skylarkinterface/SkylarkSignature.java +++ b/src/main/java/com/google/devtools/build/lib/skylarkinterface/SkylarkSignature.java @@ -18,7 +18,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; - /** * An annotation to mark built-in keyword argument methods accessible from Skylark. * @@ -138,60 +137,4 @@ public @interface SkylarkSignature { * annotated function. */ boolean useEnvironment() default false; - - /** - * An annotation for parameters of Skylark built-in functions. - */ - @Retention(RetentionPolicy.RUNTIME) - public @interface Param { - - /** - * Name of the parameter, as viewed from Skylark. Used for named parameters and for generating - * documentation. - */ - String name(); - - /** - * Documentation of the parameter. - */ - String doc() default ""; - - /** - * Default value for the parameter, as a Skylark value (e.g. "False", "True", "[]", "None"). - */ - String defaultValue() default ""; - - /** - * Type of the parameter, e.g. {@link String}.class or - * {@link com.google.devtools.build.lib.syntax.SkylarkList}.class. - */ - Class<?> type() default Object.class; - - /** - * When {@link #type()} is a generic type (e.g., - * {@link com.google.devtools.build.lib.syntax.SkylarkList}), specify the type parameter (e.g. - * {@link String}.class} along with {@link com.google.devtools.build.lib.syntax.SkylarkList} for - * {@link #type()} to specify a list of strings). - */ - Class<?> generic1() default Object.class; - - /** - * Whether the name of a callback function can be given instead of a computed value. If a - * callback function is used then the value of this parameter will be computed only when - * actually requested. E.g., if a parameter {@code foo} of a function {@code bar} is passed a - * callback function, then only when the method {@code bar} actually asks for the value - * {@code foo}, replacing it by a - * {@link com.google.devtools.build.lib.syntax.SkylarkCallbackFunction} in between. - */ - boolean callbackEnabled() default false; - - /** - * If true, this parameter can be passed the "None" value. - */ - boolean noneable() default false; - - // TODO(bazel-team): parse the type from a single field in Skylark syntax, - // and allow a Union as "ThisType or ThatType or NoneType": - // String type() default "Object"; - } } |