Beispiel #1
0
 /**
  * Checks if a message has the requested attribute. The class of the required attribute has to be
  * the same. Subclasses will not be detected.
  *
  * @param message the message to check
  * @param attributeClass the attribute which should be included in the message
  * @throws Exception if the requested attribute is not included in the message
  */
 public <T extends Attribute> void checkForAttribute(
     final Message message, final Class<T> attributeClass) throws Exception {
   if (!message.hasAttribute(attributeClass)) {
     final String errorMessage =
         attributeClass.getSimpleName() + " attribute expected"; // $NON-NLS-1
     throw new Exception(errorMessage);
   }
 }