public int compare(Line arg0, Line arg1) { if(arg0.getLineNumber() == null) { return -1; } if(arg1.getLineNumber() == null) { return 1; } return arg0.getLineNumber() - arg1.getLineNumber(); } };
public void setSourceType(String sourceType) { this.sourceType = SourceType.valueOf(sourceType); }
public void setNotificationLevel(String notificationLevel) { this.notificationLevel = NotificationLevel.valueOf(notificationLevel); }
public void processMeta(FileMetadata file) { Classification gr = new Classification(); gr.setDescription(description); if (effort != null) { StoryPointEffort hours = new StoryPointEffort(); hours.setHours(effort); gr.setEffort(hours); } file.getDecorations().add(gr); } }
@Override protected List<AbstractDecoration> matchResults(FileMetadata meta) { // only process classification. List<AbstractDecoration> matched = super.matchResults(meta); List<AbstractDecoration> results = new ArrayList<AbstractDecoration>(1); if (matched != null && matched.size() > 0) { // create classification, with the same pattern. Classification cr = new Classification(); cr.setDescription(matchDescription); cr.setEffort(effort); cr.setPattern(matched.get(0).getPattern()); meta.getDecorations().add(cr); results.add(cr); } return results; } }
protected void createLineNumberMeta(final XmlMetadata meta, Integer lineNumber, String descripiton, Node match) { XmlLine result = new XmlLine(); result.setDescription(matchDescription); result.setLineNumber(lineNumber); result.setEffort(effort); result.setMatchedNode(match); for (ResultProcessor hint : hints) { hint.process(result); } meta.getDecorations().add(result); }
protected void createSummaryMeta(final XmlMetadata meta, String description, String match) { Summary result = new Summary(); result.setDescription(description); result.setPattern(match); result.setEffort(effort); for (ResultProcessor hint : hints) { hint.process(result); } meta.getDecorations().add(result); }
@Override public void process(AbstractDecoration result) { StrSubstitutor xpathSubstitutor = new StrSubstitutor(result.getContext()); String rst = xpathSubstitutor.replace(markdown); MarkdownHint mdh = new MarkdownHint(); mdh.setMarkdown(rst); result.getHints().add(mdh); } }
@Override public void process(AbstractDecoration result) { MarkdownHint mdh = new MarkdownHint(); mdh.setMarkdown(markdown); result.getHints().add(mdh); }
public void processMeta(FileMetadata file) { Link lr = new Link(); lr.setDescription(description); lr.setLink(link); file.getDecorations().add(lr); } }
public void processMeta(FileMetadata file) { Global gr = new Global(); gr.setDescription(description); gr.setEffort(effort); file.getDecorations().add(gr); } }
public void processMeta(FileMetadata file) { Summary gr = new Summary(); gr.setDescription(description); gr.setEffort(effort); file.getDecorations().add(gr); } }
@Override public boolean process(AbstractDecoration result) { Matcher matcher = regexPattern.matcher(result.getPattern()); while (matcher.find()) { LOG.debug("Matched: " + result.getPattern() + " as whitelist. "); return true; } return false; } }
@Override public boolean process(AbstractDecoration result) { if (result == null || !(result instanceof JavaLine)) { return false; } JavaLine javaLine = (JavaLine) result; // if the source type is not provided, apply to all source types. if (sourceType != null) { if (javaLine.getSourceType() != sourceType) { // not of interest. return false; } } return super.process(result); } }
@Override public int compare(Link o1, Link o2) { String link1 = StringUtils.removeEnd(o1.getLink(), "/"); String link2 = StringUtils.removeEnd(o2.getLink(), "/"); if (StringUtils.equals(link1, link2)) { return 0; } if (o1 == null || o2 == null) { return 1; } return o1.getLink().compareTo(o2.getLink()); } });
protected String buildSummary(T meta) { StringBuilder summary = new StringBuilder(); for (AbstractDecoration result : meta.getDecorations()) { if (result instanceof Classification) { summary.append("Classification: "+result.getDescription() + "<br />"); } if (result instanceof Summary) { summary.append(result.getDescription() + "<br />"); } } return summary.toString(); }
protected static int calcTotalChanges(JavaMetadata result) { int totalChanges = 0; Set<String> blkTemp = new HashSet<String>(); for (AbstractDecoration dr : result.getDecorations()) { if (dr instanceof JavaLine) { blkTemp.add("Blacklisted: " + dr.getPattern()); totalChanges++; } } return totalChanges; }
public void setAsText(String regex) { SourceType platformType = SourceType.valueOf(regex); setValue(platformType); } }
public void setAsText(String notification) { NotificationLevel notificationLevel = NotificationLevel.valueOf(notification); setValue(notificationLevel); } }
@Override public void process(AbstractDecoration result) { if (result == null || !(result instanceof JavaLine)) { // not of interest. return; } JavaLine javaLine = (JavaLine) result; // if the source type is not provided, apply to all source types. if (sourceType != null) { if (javaLine.getSourceType() != sourceType) { // not of interest. return; } } super.process(result); } }