1 package hudson.scm; 2 3 import hudson.MarkupText; 4 import hudson.Util; 5 import hudson.model.AbstractBuild; 6 import hudson.model.User; 7 8 import java.util.Collection ; 9 import java.util.Collections ; 10 11 19 public abstract class ChangeLogSet<T extends ChangeLogSet.Entry> implements Iterable <T> { 20 21 24 public final AbstractBuild<?,?> build; 25 26 protected ChangeLogSet(AbstractBuild<?, ?> build) { 27 this.build = build; 28 } 29 30 33 public abstract boolean isEmptySet(); 34 35 38 public static ChangeLogSet<? extends ChangeLogSet.Entry> createEmpty(AbstractBuild build) { 39 return new CVSChangeLogSet(build,Collections.<CVSChangeLogSet.CVSChangeLog>emptyList()); 40 } 41 42 public static abstract class Entry { 43 private ChangeLogSet parent; 44 45 public ChangeLogSet getParent() { 46 return parent; 47 } 48 49 52 protected void setParent(ChangeLogSet parent) { 53 this.parent = parent; 54 } 55 56 65 public abstract String getMsg(); 66 67 73 public abstract User getAuthor(); 74 75 85 public abstract Collection <String > getAffectedPaths(); 86 87 90 public String getMsgAnnotated() { 91 MarkupText markup = new MarkupText(getMsgEscaped()); 92 for (ChangeLogAnnotator a : ChangeLogAnnotator.annotators) 93 a.annotate(parent.build,this,markup); 94 95 return markup.toString(); 96 } 97 98 101 public String getMsgEscaped() { 102 return Util.escape(getMsg()); 103 } 104 } 105 } 106 | Popular Tags |