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


@Documented
@Retention(value=SOURCE)
@Target(value=TYPE)
public static @interface Kroll.proxy

Declares a Kroll proxy.

Proxies are the API interface between Javascript (Rhino) and Java. Proxy classes must use this or the module annotation to expose methods and properties, and must follow a few specific source patterns:

To expose a "create" method for this proxy, see creatableInModule()

See Also:
name(), creatableInModule(), propertyAccessors(), KrollProxy, @Kroll.module


Optional Element Summary
 java.lang.Class<?> creatableInModule
          Specify which module will have a "create" method for this proxy.
 java.lang.String name
          The name of this proxy.
 java.lang.String[] propertyAccessors
          Declares a list of dynamic property accessors for this proxy.
Example:
 

name

public abstract java.lang.String name
The name of this proxy. Used in debugging, toString(), and creatableInModule().

Default Value:
The name of the proxy class with the "Proxy" suffix removed.
Default:
"__default_name__"

creatableInModule

public abstract java.lang.Class<?> creatableInModule
Specify which module will have a "create" method for this proxy.

This will generate a "create" method that follows the pattern "create" + name of this proxy. For instance, if the name of your proxy class is LabelProxy, the create method would be named "createLabel".

See Also:
KrollProxy.handleCreationArgs(org.appcelerator.kroll.KrollModule, Object[]), KrollProxy.handleCreationDict(org.appcelerator.kroll.KrollDict)
Default Value:
None (don't generate a create method)
Default:
org.appcelerator.kroll.annotations.Kroll.proxy.DEFAULT.class

propertyAccessors

public abstract java.lang.String[] propertyAccessors
Declares a list of dynamic property accessors for this proxy.
Example:
 @Kroll.proxy(propertyAccessors={"property1", "property2", "property3"})
 

Default Value:
No dynamic property accessors are generated
Default:
{}


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