public class HtmlParser
extends java.lang.Object
MailMessage
.Modifier and Type | Method and Description |
---|---|
static java.util.List<MailComment> |
parse(MailMessage email,
java.util.Collection<Comment> comments,
java.lang.String changeUrl)
Parses comments from html email.
|
public static java.util.List<MailComment> parse(MailMessage email, java.util.Collection<Comment> comments, java.lang.String changeUrl)
This parser goes though all html elements in the email and checks for matching patterns. It keeps track of the last file and comments it encountered to know in which context a parsed comment belongs. It uses the href attributes of tags to identify comments sent out by Gerrit as these are generally more reliable then the text captions.
email
- the message as received from the email servicecomments
- a specific set of comments as sent out in the original notification email.
Comments are expected to be in the same order as they were sent out to in the email.changeUrl
- canonical change URL that points to the change on this Gerrit instance.
Example: https://go-review.googlesource.com/#/c/91570