org.eclipse.jgit.lib
Class Tag

java.lang.Object
  extended by org.eclipse.jgit.lib.Tag

public class Tag
extends java.lang.Object

Represents a named reference to another Git object of any type.


Constructor Summary
Tag(Repository db)
          Construct a new, yet unnamed Tag.
Tag(Repository db, ObjectId id, java.lang.String refName, byte[] raw)
          Construct a Tag representing an existing with a known name referencing an known object.
 
Method Summary
 PersonIdent getAuthor()
           
 java.lang.String getMessage()
           
 ObjectId getObjId()
           
 java.lang.String getTag()
           
 PersonIdent getTagger()
           
 ObjectId getTagId()
           
 java.lang.String getType()
           
 void setAuthor(PersonIdent a)
          Set author of an annotated tag.
 void setMessage(java.lang.String m)
          Set the message of an annotated tag
 void setObjId(ObjectId objId)
          Set the id of the object this tag refers to.
 void setTag(java.lang.String tag)
          Set the name of this tag.
 void setTagger(PersonIdent tagger)
          Set the creator of this tag
 void setTagId(ObjectId tagId)
          Set SHA-1 of this tag.
 void setType(java.lang.String type)
          Set tag target type
 void tag()
          Store a tag.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Tag

public Tag(Repository db)
Construct a new, yet unnamed Tag.

Parameters:
db -

Tag

public Tag(Repository db,
           ObjectId id,
           java.lang.String refName,
           byte[] raw)
Construct a Tag representing an existing with a known name referencing an known object. This could be either a simple or annotated tag.

Parameters:
db - Repository
id - target id.
refName - tag name or null
raw - data of an annotated tag.
Method Detail

getAuthor

public PersonIdent getAuthor()
Returns:
tagger of a annotated tag or null

setAuthor

public void setAuthor(PersonIdent a)
Set author of an annotated tag.

Parameters:
a - author identifier as a PersonIdent

getMessage

public java.lang.String getMessage()
Returns:
comment of an annotated tag, or null

setMessage

public void setMessage(java.lang.String m)
Set the message of an annotated tag

Parameters:
m -

tag

public void tag()
         throws java.io.IOException
Store a tag. If author, message or type is set make the tag an annotated tag.

Throws:
java.io.IOException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getTagId

public ObjectId getTagId()
Returns:
SHA-1 of this tag (if annotated and stored).

setTagId

public void setTagId(ObjectId tagId)
Set SHA-1 of this tag. Used by writer.

Parameters:
tagId -

getTagger

public PersonIdent getTagger()
Returns:
creator of this tag.

setTagger

public void setTagger(PersonIdent tagger)
Set the creator of this tag

Parameters:
tagger -

getType

public java.lang.String getType()
Returns:
tag target type

setType

public void setType(java.lang.String type)
Set tag target type

Parameters:
type -

getTag

public java.lang.String getTag()
Returns:
name of the tag.

setTag

public void setTag(java.lang.String tag)
Set the name of this tag.

Parameters:
tag -

getObjId

public ObjectId getObjId()
Returns:
the SHA'1 of the object this tag refers to.

setObjId

public void setObjId(ObjectId objId)
Set the id of the object this tag refers to.

Parameters:
objId -