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


@Documented
@Retention(value=SOURCE)
@Target(value=FIELD)
public static @interface Kroll.property

Declares a property to be exposed as part of this Kroll.proxy or Kroll.module.
Standard properties are automatically written and read into instance fields on the Kroll.proxy object.
Note that properties defined by this annotation are not exposed as getter or setter methods.
To generate both a getter/setter and property style, use a combination of Kroll.method and Kroll.getProperty / Kroll.setProperty
Example:

 @Kroll.property protected String username;
 

See Also:
get(), set(), name(), nativeConverter(), javascriptConverter(), @Kroll.method, @Kroll.getProperty, @Kroll.setProperty

Optional Element Summary
 boolean get
          Whether or not this property has "get" or read access
 java.lang.Class<? extends KrollJavascriptConverter> javascriptConverter
          Converter of Rhino/Javascript objects to Java objects suitable for use in Titanium
 java.lang.String name
          The name of this property in the API.
 java.lang.Class<? extends KrollNativeConverter> nativeConverter
          Converter of Java objects to Javascript objects suitable for use by the Rhino runtime
 boolean set
          Whether or not this property has "set", or write access
 

get

public abstract boolean get
Whether or not this property has "get" or read access

Default:
true

set

public abstract boolean set
Whether or not this property has "set", or write access

Default:
true

name

public abstract java.lang.String name
The name of this property in the API.

Default Value:
The property's name in java source
Default:
"__default_name__"

nativeConverter

public abstract java.lang.Class<? extends KrollNativeConverter> nativeConverter
Converter of Java objects to Javascript objects suitable for use by the Rhino runtime

The value should be the fully qualified name of a class that implements KrollNativeConverter. The class must also implement a static instance getter called getInstance().

See Also:
KrollNativeConverter
Default:
org.appcelerator.kroll.KrollConverter.class

javascriptConverter

public abstract java.lang.Class<? extends KrollJavascriptConverter> javascriptConverter
Converter of Rhino/Javascript objects to Java objects suitable for use in Titanium

The value should be the fully qualified name of a class that implements KrollJavascriptConverter. The class must also implement a static instance getter called getInstance().

See Also:
KrollJavascriptConverter
Default:
org.appcelerator.kroll.KrollConverter.class


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