예제 #1
0
 @Override
 public void endElement(String uri, String name, String qName) {
   if (qName.equals("MessageId")) {
     builder.id(currentOrNull(currentText));
   } else if (qName.equals("ReceiptHandle")) {
     builder.receiptHandle(currentOrNull(currentText));
   } else if (qName.equals("MD5OfBody")) {
     builder.md5(HashCodes.fromBytes(base16().lowerCase().decode(currentOrNull(currentText))));
   } else if (qName.equals("Body")) {
     builder.body(currentOrNull(currentText));
   } else if (qName.equals("Name")) {
     this.name = currentOrNull(currentText);
   } else if (qName.equals("Value")) {
     builder.addAttribute(this.name, currentOrNull(currentText));
     this.name = null;
   }
   currentText = new StringBuilder();
 }
예제 #2
0
 @Override
 public Message getResult() {
   try {
     return builder.build();
   } catch (NullPointerException e) {
     return null;
   } finally {
     builder = Message.builder();
   }
 }