Top Description Methods
org.freedesktop.dbus.annotations

public @Interface DBusBoundProperty

extends Annotation
Annotations
@Target:METHOD
@Retention:RUNTIME
Imports
org.freedesktop.dbus.annotations.DBusProperty.Access, .PropertiesEmitsChangedSignal.EmitChangeSignal, org.freedesktop.dbus.interfaces.Properties, java.lang.annotation.ElementType, .Retention, .RetentionPolicy, .Target

Binds a setter or getter method to a DBus property, in a similar manner to the familiar JavaBeans pattern.

Using this annotation means you do not need to implement the Properties interface and provide your own handling of Properties#Get(String, String), Properties#GetAll(String) and Properties#Set(String, String, Object).

Each DBus property should map to either one or two methods. If it has DBusBoundProperty#access() of Access#READ then a single getter method should be created with no parameters. The type of property will be determined by the return type of the method, and the name of the property will be derived from the method name, with either the get or the is stripped off.

@DBusBoundProperty
public String getMyStringProperty();

@DBusBoundProperty
public boolean isMyBooleanProperty();
If it has DBusBoundProperty#access() of Access#WRITE then a single setter method should be created with a single parameter and no return type. The type of the property will be determined by that parameter, and the name of the property will be derived from the method name, with either the get or the is stripped off.
@DBusBoundProperty
public void setMyStringProperty(String _property);
If it has DBusBoundProperty#access() of Access#READ_WRITE, the both of the above methods should be provided.

Any of the name, type and access attributes that would normally be automatically determined, may be overridden using the corresponding annotation attributes.

It is allowed if you wish to mix use of DBusProperty and DBusBoundProperty as long as individual properties are not repeated.

See Also
org.freedesktop.dbus.interfaces.DBusInterface, org.freedesktop.dbus.annotations.DBusProperty, org.freedesktop.dbus.annotations.DBusProperties, org.freedesktop.dbus.TypeRef

Method Summary

Modifier and TypeMethod and Description
public DBusProperty.Access

Returns:

access
access
()

Property access type.

public PropertiesEmitsChangedSignal.EmitChangeSignal

Returns:

emitChangeSignal
emitChangeSignal
()

Annotation org.freedesktop.DBus.Property.EmitsChangedSignal.

public String

Returns:

name
name
()

Property name.

public Class<?>

Returns:

type
type
()

Type of the property, in case of complex types please create custom interface that extends org.freedesktop.dbus.TypeRef.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

accessback to summary
public DBusProperty.Access access()

Property access type. When Access#READ_WRITE, the access will be inferred from the method name, whether it is a setter or a getter.

Returns:DBusProperty.Access

access

emitChangeSignalback to summary
public PropertiesEmitsChangedSignal.EmitChangeSignal emitChangeSignal()

Annotation org.freedesktop.DBus.Property.EmitsChangedSignal. From DBUS Specification:
If set to false, the org.freedesktop.DBus.Properties.PropertiesChanged signal,
see the section called “org.freedesktop.DBus.Properties” is not guaranteed to be emitted if the property changes.

If set to const the property never changes value during the lifetime of the object it belongs to,
and hence the signal is never emitted for it.

If set to invalidates the signal is emitted but the value is not included in the signal.

If set to true the signal is emitted with the value included.
The value for the annotation defaults to true if the enclosing interface element does not specify the annotation. Otherwise it defaults to the value specified in the enclosing interface element.

This annotation is intended to be used by code generators to implement client-side caching of property values.
For all properties for which the annotation is set to const, invalidates or true the client may unconditionally
cache the values as the properties don't change or notifications are generated for them if they do.

Returns:PropertiesEmitsChangedSignal.EmitChangeSignal

emitChangeSignal

nameback to summary
public String name()

Property name. If not supplied, the property name will be inferred from the method. See class documentation for semantics.

Returns:String

name

typeback to summary
public Class<?> type()

Type of the property, in case of complex types please create custom interface that extends org.freedesktop.dbus.TypeRef. If not supplied, then the type will be inferred from either the return value of a getter, or the first parameter of a setter.

Returns:Class<?>

type