8 Annotations

You can annotate your D-Bus methods as in figure 15 to provide hints to other users of your API. Common annotations are listed in table 2.


package org.freedesktop;
import org.freedesktop.dbus.UInt32;
import org.freedesktop.dbus.DBusInterface;

@org.freedesktop.DBus.Description("Some Methods");
public interface DBus extends DBusInterface
{
   @org.freedesktop.DBus.Description("Check if the name has an owner")
   public boolean NameHasOwner(String name);
   @org.freedesktop.DBus.Description("Request a name")
   @org.freedesktop.DBus.Deprecated()
   public UInt32 RequestName(String name, UInt32 flags);
}


Figure 15: An annotated method


Name Meaning


org.freedesktop.DBus.Description Provide a short 1-line description
of the method or interface.
org.freedesktop.DBus.Deprecated This method or interface is Deprecated.
org.freedesktop.DBus.Method.NoReply This method may be called and returned
without waiting for a reply.
org.freedesktop.DBus.Method.Error This method may throw the listed Exception
in addition to the standard ones.

Table 2: Common Annotations