1 /* 2 * ASArg.java 3 * 4 * Copyright (c) 2006 David Holroyd 5 * 6 * Licensed under the Apache License, Version 2.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 */ 18 19 package uk.co.badgersinfoil.metaas.dom; 20 21 /** 22 * A parameter in a method or function definition. 23 * 24 * @see FunctionCommon#addParam(String, String) 25 * @see FunctionCommon#getArgs() 26 */ 27 public interface ASArg extends ScriptElement { 28 /** 29 * Returns the name of this ActionScript method argument 30 */ 31 public String getName(); 32 /** 33 * Returns the name of this parameter's type, or null if the parameter 34 * is untyped. 35 */ 36 public String getType(); 37 38 /** 39 * Defines the name of the type of object this parameter may 40 * reference. May be set to null, denoting that the value is 41 * untyped. 42 */ 43 public void setType(String string); 44 45 /** 46 * Specifies the compile-time-constant value that will be the default 47 * for the argument if no value is provided by the calling code. 48 */ 49 public void setDefault(String string); 50 51 /** 52 * Returns a String representation of the default value for the 53 * argument (if no value is provided by the calling code), or null if 54 * there is no default. 55 * 56 * @see #setDefault(String) 57 */ 58 public String getDefaultString(); 59 60 /** 61 * Returns true if this is a 'rest' parameter; an array that will hold 62 * remaning arguments passed after the other formal arguments. A 'rest' 63 * argument should always be the last one declared in the parameter 64 * list of a function or method. 65 */ 66 public boolean isRest(); 67 68 /** 69 * Returns the description of this parameter from the documentation 70 * comment attached to the enclosing method, or null, if there is no 71 * such comment, or it lacks a @<span/>param paragraph with a name 72 * matching this parameter. 73 */ 74 public String getDescriptionString(); 75 76 /** 77 * Defines the descriptive text for for this parameter in the 78 * documentation comment attached to the enclosing method. If null is 79 * given, any descriptive @<span/>param paragraph with a name 80 * matching this parameter will be removed from the method's 81 * documentation. 82 * 83 * @throws uk.co.badgersinfoil.metaas.SyntaxException if the given 84 * text contains an end-of-comment marker, or appears to 85 * include another tagged paragraph 86 * @see DocComment 87 */ 88 public void setDescription(String description); 89 }