Top Description Fields Constructors Methods
org.eclipse.jgit.lib

public Class TagBuilder

extends ObjectBuilder
Class Inheritance
Static Imports
java.nio.charset.StandardCharsets.UTF_8

Mutable builder to construct an annotated tag recording a project state. Applications should use this object when they need to manually construct a tag and want precise control over its fields. To read a tag object, construct a org.eclipse.jgit.revwalk.RevWalk and obtain a org.eclipse.jgit.revwalk.RevTag instance by calling org.eclipse.jgit.revwalk.RevWalk#parseTag(AnyObjectId).

Field Summary

Modifier and TypeField and Description
private static final byte[]
private static final byte[]
private static final byte[]
private static final byte[]
private ObjectId
private String
private int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public byte[]

Returns:

this object in the canonical annotated tag format, suitable for storage in a repository.
build
()

Implements abstract org.eclipse.jgit.lib.ObjectBuilder.build.

Format this builder's state as an annotated tag object.

public ObjectId

Returns:

the object this tag refers to.
getObjectId
()

Get the object this tag refers to.

public int

Returns:

the type of object this tag refers to.
getObjectType
()

Get the type of object this tag refers to.

public String

Returns:

short name of the tag (no refs/tags/ prefix).
getTag
()

Get short name of the tag (no refs/tags/ prefix).

public PersonIdent

Returns:

creator of this tag. May be null.
getTagger
()

Get creator of this tag.

public void
setObjectId(AnyObjectId
the object.
obj
,
int
the type of obj. Must be a valid type code.
objType
)

Set the object this tag refers to, and its type.

public void
setObjectId(RevObject
the object the tag will refer to.
obj
)

Set the object this tag refers to, and infer its type.

public void
setTag(String
new short name of the tag. This short name should not start with refs/ as typically a tag is stored under the reference derived from "refs/tags/" + getTag().
shortName
)

Set the name of this tag.

public void
setTagger(PersonIdent
the creator. May be null.
taggerIdent
)

Set the creator of this tag.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from org.eclipse.jgit.lib.ObjectBuilder:
getAuthorgetEncodinggetGpgSignaturegetMessagesetAuthorsetEncodingsetGpgSignaturesetMessagewriteEncodingwriteMultiLineHeader

Field Detail

hobjectback to summary
private static final byte[] hobject
htagback to summary
private static final byte[] htag
htaggerback to summary
private static final byte[] htagger
htypeback to summary
private static final byte[] htype
objectback to summary
private ObjectId object
tagback to summary
private String tag
typeback to summary
private int type

Constructor Detail

TagBuilderback to summary
public TagBuilder()

Method Detail

buildback to summary
public byte[] build() throws UnsupportedEncodingException

Implements abstract org.eclipse.jgit.lib.ObjectBuilder.build.

Format this builder's state as an annotated tag object.

Returns:byte[]

this object in the canonical annotated tag format, suitable for storage in a repository.

Annotations
@Override
Exceptions
UnsupportedEncodingException:

Doc from org.eclipse.jgit.lib.ObjectBuilder.build.

the encoding specified by getEncoding() is not supported by this Java runtime.

getObjectIdback to summary
public ObjectId getObjectId()

Get the object this tag refers to.

Returns:ObjectId

the object this tag refers to.

getObjectTypeback to summary
public int getObjectType()

Get the type of object this tag refers to.

Returns:int

the type of object this tag refers to.

getTagback to summary
public String getTag()

Get short name of the tag (no refs/tags/ prefix).

Returns:String

short name of the tag (no refs/tags/ prefix).

getTaggerback to summary
public PersonIdent getTagger()

Get creator of this tag.

Returns:PersonIdent

creator of this tag. May be null.

setObjectIdback to summary
public void setObjectId(AnyObjectId obj, int objType)

Set the object this tag refers to, and its type.

Parameters
obj:AnyObjectId

the object.

objType:int

the type of obj. Must be a valid type code.

setObjectIdback to summary
public void setObjectId(RevObject obj)

Set the object this tag refers to, and infer its type.

Parameters
obj:RevObject

the object the tag will refer to.

setTagback to summary
public void setTag(String shortName)

Set the name of this tag.

Parameters
shortName:String

new short name of the tag. This short name should not start with refs/ as typically a tag is stored under the reference derived from "refs/tags/" + getTag().

setTaggerback to summary
public void setTagger(PersonIdent taggerIdent)

Set the creator of this tag.

Parameters
taggerIdent:PersonIdent

the creator. May be null.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@SuppressWarnings:nls
@Override