1 /* 2 * Copyright (C) 2010 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package com.android.monkeyrunner.doc; 17 18 import java.lang.annotation.ElementType; 19 import java.lang.annotation.Retention; 20 import java.lang.annotation.RetentionPolicy; 21 import java.lang.annotation.Target; 22 23 /** 24 * Indicates that the annotated method is a public API to expose to the 25 * scripting interface. Can be used to generate documentation of what 26 * methods are exposed and also can be used to enforce visibility of 27 * these methods in the scripting environment. 28 */ 29 @Retention(RetentionPolicy.RUNTIME) 30 @Target({ ElementType.METHOD, ElementType.CONSTRUCTOR, 31 ElementType.TYPE, ElementType.FIELD }) 32 public @interface MonkeyRunnerExported { 33 /** 34 * A documentation string for this method. 35 */ 36 String doc(); 37 38 /** 39 * The list of names for the keywords in this method in their proper positional order. 40 * 41 * For example: 42 * 43 * @MonkeyRunnerExported(args={"one", "two"}) 44 * public void foo(); 45 * 46 * would allow calls like this: 47 * foo(one=1, two=2) 48 * foo(1, 2) 49 */ 50 String[] args() default {}; 51 52 /** 53 * The list of documentation for the arguments. 54 */ 55 String[] argDocs() default {}; 56 57 /** 58 * The documentation for the return type of this method. 59 */ 60 String returns() default "returns nothing."; 61 }