org.eclipse.jgit.revwalk
Class RevTag

java.lang.Object
  extended by org.eclipse.jgit.lib.AnyObjectId
      extended by org.eclipse.jgit.lib.ObjectId
          extended by org.eclipse.jgit.revwalk.RevObject
              extended by org.eclipse.jgit.revwalk.RevTag
All Implemented Interfaces:
java.lang.Comparable

public class RevTag
extends RevObject

An annotated tag.


Constructor Summary
protected RevTag(AnyObjectId id)
          Create a new tag reference.
 
Method Summary
 Tag asTag(RevWalk walk)
          Parse this tag buffer for display.
 java.lang.String getFullMessage()
          Parse the complete tag message and decode it to a string.
 RevObject getObject()
          Get a reference to the object this tag was placed on.
 java.lang.String getShortMessage()
          Parse the tag message and return the first "line" of it.
 PersonIdent getTaggerIdent()
          Parse the tagger identity from the raw buffer.
 java.lang.String getTagName()
          Get the name of this tag, from the tag header.
 int getType()
          Get Git object type.
 
Methods inherited from class org.eclipse.jgit.revwalk.RevObject
add, add, appendCoreFlags, equals, equals, getId, has, hasAll, hasAny, remove, remove, toString
 
Methods inherited from class org.eclipse.jgit.lib.ObjectId
equals, fromRaw, fromRaw, fromRaw, fromRaw, fromString, fromString, isId, toObjectId, toString, zeroId
 
Methods inherited from class org.eclipse.jgit.lib.AnyObjectId
abbreviate, abbreviate, compareTo, compareTo, copy, copyRawTo, copyRawTo, copyRawTo, copyRawTo, copyTo, copyTo, copyTo, copyTo, equals, getFirstByte, getName, hashCode, name, startsWith
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RevTag

protected RevTag(AnyObjectId id)
Create a new tag reference.

Parameters:
id - object name for the tag.
Method Detail

getType

public final int getType()
Description copied from class: RevObject
Get Git object type. See Constants.

Specified by:
getType in class RevObject
Returns:
object type

getTaggerIdent

public final PersonIdent getTaggerIdent()
Parse the tagger identity from the raw buffer.

This method parses and returns the content of the tagger line, after taking the tag's character set into account and decoding the tagger name and email address. This method is fairly expensive and produces a new PersonIdent instance on each invocation. Callers should invoke this method only if they are certain they will be outputting the result, and should cache the return value for as long as necessary to use all information from it.

Returns:
identity of the tagger (name, email) and the time the tag was made by the tagger; null if no tagger line was found.

getFullMessage

public final java.lang.String getFullMessage()
Parse the complete tag message and decode it to a string.

This method parses and returns the message portion of the tag buffer, after taking the tag's character set into account and decoding the buffer using that character set. This method is a fairly expensive operation and produces a new string on each invocation.

Returns:
decoded tag message as a string. Never null.

getShortMessage

public final java.lang.String getShortMessage()
Parse the tag message and return the first "line" of it.

The first line is everything up to the first pair of LFs. This is the "oneline" format, suitable for output in a single line display.

This method parses and returns the message portion of the tag buffer, after taking the tag's character set into account and decoding the buffer using that character set. This method is a fairly expensive operation and produces a new string on each invocation.

Returns:
decoded tag message as a string. Never null. The returned string does not contain any LFs, even if the first paragraph spanned multiple lines. Embedded LFs are converted to spaces.

asTag

public Tag asTag(RevWalk walk)
Parse this tag buffer for display.

Parameters:
walk - revision walker owning this reference.
Returns:
parsed tag.

getObject

public final RevObject getObject()
Get a reference to the object this tag was placed on.

Returns:
object this tag refers to.

getTagName

public final java.lang.String getTagName()
Get the name of this tag, from the tag header.

Returns:
name of the tag, according to the tag header.