org.appcelerator.kroll.annotations
Annotation Type Kroll.argument


@Documented
@Retention
@Target
public static @interface Kroll.argument

An optional annotation for arguments of a Kroll method. This annotation is retained at runtime so dynamic properties can check for optional arguments in their setters. Example:

@Kroll.method
 public sayHi(@Kroll.argument(optional=true) String name) {
    // say hi..
 }
 

See Also:
optional(), name()

Optional Element Summary
 String name
          The argument's name used in error messages and source code generation.
 boolean optional
          Marks this argument as optional.
The default value for the argument is pulled from the argument's default value provider.
 

name

public abstract String name
The argument's name used in error messages and source code generation.

Default Value:
The argument's name from Java source
Default:
"__default_name__"

optional

public abstract boolean optional
Marks this argument as optional.
The default value for the argument is pulled from the argument's default value provider.

Warning: Make sure that all optional arguments are annotated in your Kroll.method, or source code generation / binding may fail. If the Kroll.method has an optional argument in the middle of it's argument list, then all the methods after it should also be annotated as optional.

Default:
false


Copyright © 2010-2012 Appcelerator, Inc. Licensed under the Apache License 2.0