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


@Documented
@Retention
@Target
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
 Class<?> creatableInModule
          Specify which module will have a "create" method for this proxy.
 String name
          The name of this proxy.
 Class<?> parentModule
          Specify the parent module / namespace for this proxy (if you want this proxy to be expose via "create", use creatableInModule() instead)
 String[] propertyAccessors
          Declares a list of dynamic property accessors for this proxy.
Example:
 

name

public abstract 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 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.DEFAULT.class

propertyAccessors

public abstract 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:
{}

parentModule

public abstract Class<?> parentModule
Specify the parent module / namespace for this proxy (if you want this proxy to be expose via "create", use creatableInModule() instead)

Default Value:
None (lives under the Titanium namespace)
Default:
org.appcelerator.kroll.annotations.Kroll.DEFAULT.class


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