/** * Get the revision of the specification item * * @return revision */ public int getRevision() { return this.id.getRevision(); }
/** * Get the revision of the specification item * * @return revision */ public int getRevision() { return this.id.getRevision(); }
@Override public int compareTo(final SpecificationItemId other) { int compared = this.getArtifactType().compareTo(other.getArtifactType()); if (compared == 0) { compared = this.getName().compareTo(other.getName()); if (compared == 0) { if (this.getRevision() > other.getRevision()) { compared = 1; } else if (this.getRevision() < other.getRevision()) { compared = -1; } } } return compared; } }
protected void renderSummary(final String indentation, final SpecificationItemId id) { this.stream.print(indentation); this.stream.print(" <summary title=\""); this.stream.print(id); this.stream.print("\">"); this.stream.print(this.item.isDefect() ? CROSS_MARK : CHECK_MARK); this.stream.print(" <b>"); this.stream.print(this.item.getTitleWithFallback()); this.stream.print("</b><small>, rev. "); this.stream.print(id.getRevision()); this.stream.print(", "); this.stream.print(id.getArtifactType()); this.stream.println("</small></summary>"); }
protected void renderSummary(final String indentation, final SpecificationItemId id) { this.stream.print(indentation); this.stream.print(" <summary title=\""); this.stream.print(id); this.stream.print("\">"); this.stream.print(this.item.isDefect() ? CROSS_MARK : CHECK_MARK); this.stream.print(" <b>"); this.stream.print(this.item.getTitleWithFallback()); this.stream.print("</b><small>, rev. "); this.stream.print(id.getRevision()); this.stream.print(", "); this.stream.print(id.getArtifactType()); this.stream.println("</small></summary>"); }
@Override public int compareTo(final SpecificationItemId other) { int compared = this.getArtifactType().compareTo(other.getArtifactType()); if (compared == 0) { compared = this.getName().compareTo(other.getName()); if (compared == 0) { if (this.getRevision() > other.getRevision()) { compared = 1; } else if (this.getRevision() < other.getRevision()) { compared = -1; } } } return compared; } }
/** * Create an instance of {@link MarkdownForwardingSpecificationItem} * * @param forward * the textual representation */ public MarkdownForwardingSpecificationItem(final String forward) { final int posForwardMarker = forward.indexOf(FORWARD_MARKER); final int posOriginalMarker = forward.indexOf(ORIGINAL_MARKER); this.skippedArtifactType = forward.substring(0, posForwardMarker).trim(); this.targetArtifactTypes = Arrays.asList(forward // .substring(posForwardMarker + FORWARD_MARKER.length(), posOriginalMarker) // .trim() // .split(",\\s*")); this.originalId = SpecificationItemId.parseId(forward // .substring(posOriginalMarker + ORIGINAL_MARKER.length()) // .trim()); this.skippedId = SpecificationItemId.createId(this.skippedArtifactType, this.originalId.getName(), this.originalId.getRevision()); }
/** * Create an instance of {@link MarkdownForwardingSpecificationItem} * * @param forward * the textual representation */ public MarkdownForwardingSpecificationItem(final String forward) { final int posForwardMarker = forward.indexOf(FORWARD_MARKER); final int posOriginalMarker = forward.indexOf(ORIGINAL_MARKER); this.skippedArtifactType = forward.substring(0, posForwardMarker).trim(); this.targetArtifactTypes = Arrays.asList(forward // .substring(posForwardMarker + FORWARD_MARKER.length(), posOriginalMarker) // .trim() // .split(",\\s*")); this.originalId = SpecificationItemId.parseId(forward // .substring(posOriginalMarker + ORIGINAL_MARKER.length()) // .trim()); this.skippedId = SpecificationItemId.createId(this.skippedArtifactType, this.originalId.getName(), this.originalId.getRevision()); }
private void writeCoveredIds(final List<SpecificationItemId> coveredIds) throws XMLStreamException { if (coveredIds.isEmpty()) { return; } this.writer.writeStartElement("providescoverage"); for (final SpecificationItemId coveredId : coveredIds) { this.writer.writeStartElement("provcov"); writeElement("linksto", coveredId.getArtifactType() + ":" + coveredId.getName()); writeElement("dstversion", coveredId.getRevision()); this.writer.writeEndElement(); } this.writer.writeEndElement(); }
private void writeCoveredIds(final List<SpecificationItemId> coveredIds) throws XMLStreamException { if (coveredIds.isEmpty()) { return; } this.writer.writeStartElement("providescoverage"); for (final SpecificationItemId coveredId : coveredIds) { this.writer.writeStartElement("provcov"); writeElement("linksto", coveredId.getArtifactType() + ":" + coveredId.getName()); writeElement("dstversion", coveredId.getRevision()); this.writer.writeEndElement(); } this.writer.writeEndElement(); }
private void linkToOutdatedOrPredated(final LinkedSpecificationItem item, final SpecificationItemId id, final List<LinkedSpecificationItem> coveredLinkedItems) { for (final LinkedSpecificationItem itemCoveredIgnoringVersion : coveredLinkedItems) { final int coveredItemRevision = itemCoveredIgnoringVersion.getRevision(); if (id.getRevision() < coveredItemRevision) { item.addLinkToItemWithStatus(itemCoveredIgnoringVersion, LinkStatus.OUTDATED); itemCoveredIgnoringVersion.addLinkToItemWithStatus(item, LinkStatus.COVERED_OUTDATED); } else if (id.getRevision() > coveredItemRevision) { item.addLinkToItemWithStatus(itemCoveredIgnoringVersion, LinkStatus.PREDATED); itemCoveredIgnoringVersion.addLinkToItemWithStatus(item, LinkStatus.COVERED_PREDATED); } else { throw new IllegalStateException("Used version-less match on a link to ID \"" + id + " but versions are identical."); } } } }
private void linkToOutdatedOrPredated(final LinkedSpecificationItem item, final SpecificationItemId id, final List<LinkedSpecificationItem> coveredLinkedItems) { for (final LinkedSpecificationItem itemCoveredIgnoringVersion : coveredLinkedItems) { final int coveredItemRevision = itemCoveredIgnoringVersion.getRevision(); if (id.getRevision() < coveredItemRevision) { item.addLinkToItemWithStatus(itemCoveredIgnoringVersion, LinkStatus.OUTDATED); itemCoveredIgnoringVersion.addLinkToItemWithStatus(item, LinkStatus.COVERED_OUTDATED); } else if (id.getRevision() > coveredItemRevision) { item.addLinkToItemWithStatus(itemCoveredIgnoringVersion, LinkStatus.PREDATED); itemCoveredIgnoringVersion.addLinkToItemWithStatus(item, LinkStatus.COVERED_PREDATED); } else { throw new IllegalStateException("Used version-less match on a link to ID \"" + id + " but versions are identical."); } } } }