Example #1
0
 /**
  * Get the protocol name. If the protocol class has a ProtocolAnnotation, then get the protocol
  * name from the annotation; otherwise the class name is the protocol name.
  */
 public static String getProtocolName(Class<?> protocol) {
   if (protocol == null) {
     return null;
   }
   ProtocolInfo anno = protocol.getAnnotation(ProtocolInfo.class);
   return (anno == null) ? protocol.getName() : anno.protocolName();
 }