Пример #1
0
 /**
  * Get the DBus member or property name.
  *
  * @param method The method.
  */
 public static String getName(Method method) {
   BusMethod busMethod = method.getAnnotation(BusMethod.class);
   if (busMethod != null && busMethod.name().length() > 0) {
     return busMethod.name();
   }
   BusSignal busSignal = method.getAnnotation(BusSignal.class);
   if (busSignal != null && busSignal.name().length() > 0) {
     return busSignal.name();
   }
   BusProperty busProperty = method.getAnnotation(BusProperty.class);
   if (busProperty != null) {
     if (busProperty.name().length() > 0) {
       return busProperty.name();
     } else {
       /* The rest of the method name following the "get" or "set" prefix. */
       return method.getName().substring(3);
     }
   }
   return method.getName();
 }