All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.freedesktop.dbus.annotations.DBusProperty Maven / Gradle / Ivy

Go to download

Improved version of the DBus-Java library provided by freedesktop.org (https://dbus.freedesktop.org/doc/dbus-java/).

There is a newer version: 5.1.0
Show newest version
package org.freedesktop.dbus.annotations;

import org.freedesktop.dbus.types.Variant;

import java.lang.annotation.ElementType;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Appends information about properties in the interface. The annotated properties are added to the introspection data.
 * In case of complex type of the property please use {@link org.freedesktop.dbus.TypeRef}.
 * 

* Usage: *

*
 * {@literal @}DBusInterfaceName("com.example.Bar")
 * {@literal @}DBusProperty(name = "Name", type = String.class)
 * {@literal @}DBusProperty(name = "ListOfVariables", type = List.class, access = Access.READ)
 * {@literal @}DBusProperty(name = "MapOfStringList", type = ComplexTypeWithMapAndList.class, access = Access.READ)
 * public interface Bar extends DBusInterface {
 *
 *   // TypeRef allows to provide detailed information about type
 *   interface ComplexTypeWithMapAndList extends TypeRef<Map<String, List<String>>> {
 *   }
 * }
 * 
* * @see org.freedesktop.dbus.interfaces.DBusInterface * @see org.freedesktop.dbus.TypeRef */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) @Repeatable(DBusProperties.class) public @interface DBusProperty { /** * Property name * * @return name */ String name(); /** * type of the property, in case of complex types please create custom interface that extends {@link org.freedesktop.dbus.TypeRef} * * @return type */ Class type() default Variant.class; /** * Property access type * * @return access */ Access access() default Access.READ_WRITE; enum Access { READ("read"), READ_WRITE("readwrite"), WRITE("write"); private final String accessName; Access(String _accessName) { this.accessName = _accessName; } public String getAccessName() { return accessName; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy