public abstract class GitFunction extends Object
Modifier and Type | Field and Description |
---|---|
protected GitConnector |
connector |
protected static int |
DEFAULT_PAGE_SIZE |
protected static String |
DELIMITER |
protected String |
name |
protected int |
pageSize |
protected static String |
REMOTE_BRANCH_PREFIX |
protected static Comparator<org.eclipse.jgit.lib.Ref> |
REVERSE_REF_COMPARATOR |
protected static String |
TAG_PREFIX |
Modifier | Constructor and Description |
---|---|
protected |
GitFunction(String name,
GitConnector connector) |
Modifier and Type | Method and Description |
---|---|
protected void |
addBranchesAsChildren(org.eclipse.jgit.api.Git git,
CallSpecification spec,
DocumentWriter writer)
Add the names of the branches as children of the current node.
|
protected void |
addCommitsAsChildren(org.eclipse.jgit.api.Git git,
CallSpecification spec,
DocumentWriter writer,
int pageSize)
Add the first page of commits in the history names of the tags as children of the current node.
|
protected void |
addCommitsAsPageOfChildren(org.eclipse.jgit.api.Git git,
org.eclipse.jgit.lib.Repository repository,
CallSpecification spec,
PageWriter writer,
PageKey pageKey)
Add an additional page of commits in the history names of the tags as children of the current node.
|
protected void |
addTagsAsChildren(org.eclipse.jgit.api.Git git,
CallSpecification spec,
DocumentWriter writer)
Add the names of the tags as children of the current node.
|
protected String |
authorName(org.eclipse.jgit.revwalk.RevCommit commit) |
protected String |
branchRefForName(String branchName)
Obtain the name of the branch reference
|
protected String |
branchRefForName(String branchName,
String remoteName)
Obtain the name of the branch reference
|
protected String |
commiterName(org.eclipse.jgit.revwalk.RevCommit commit) |
abstract Document |
execute(org.eclipse.jgit.lib.Repository repository,
org.eclipse.jgit.api.Git git,
CallSpecification spec,
DocumentWriter writer,
Values values) |
String |
getName()
Get the name of this function.
|
boolean |
isPaged() |
protected boolean |
isQueryable(CallSpecification callSpec) |
protected org.eclipse.jgit.lib.ObjectId |
resolveBranchOrTagOrCommitId(org.eclipse.jgit.lib.Repository repository,
String branchOrTagOrCommitId)
Resolve the branch name, tag name, or commit ID into the appropriate ObjectId.
|
String |
toString() |
protected static final String DELIMITER
protected static final String REMOTE_BRANCH_PREFIX
protected static final String TAG_PREFIX
protected static final int DEFAULT_PAGE_SIZE
protected static final Comparator<org.eclipse.jgit.lib.Ref> REVERSE_REF_COMPARATOR
protected final String name
protected final GitConnector connector
protected int pageSize
protected GitFunction(String name, GitConnector connector)
public String getName()
public boolean isPaged()
public abstract Document execute(org.eclipse.jgit.lib.Repository repository, org.eclipse.jgit.api.Git git, CallSpecification spec, DocumentWriter writer, Values values) throws org.eclipse.jgit.api.errors.GitAPIException, IOException
org.eclipse.jgit.api.errors.GitAPIException
IOException
protected String branchRefForName(String branchName)
branchName
- protected String branchRefForName(String branchName, String remoteName)
branchName
- remoteName
- the name of the remoteprotected org.eclipse.jgit.lib.ObjectId resolveBranchOrTagOrCommitId(org.eclipse.jgit.lib.Repository repository, String branchOrTagOrCommitId) throws IOException
remote
.repository
- the Repository object; may not be nullbranchOrTagOrCommitId
- the branch name, tag name, or commit ID; may not be nullIOException
- if there is a problem reading the Git repositoryprotected void addBranchesAsChildren(org.eclipse.jgit.api.Git git, CallSpecification spec, DocumentWriter writer) throws org.eclipse.jgit.api.errors.GitAPIException
git
- the Git object; may not be nullspec
- the call specification; may not be nullwriter
- the document writer for the current node; may not be nullorg.eclipse.jgit.api.errors.GitAPIException
- if there is a problem accessing the Git repositoryprotected void addTagsAsChildren(org.eclipse.jgit.api.Git git, CallSpecification spec, DocumentWriter writer) throws org.eclipse.jgit.api.errors.GitAPIException
git
- the Git object; may not be nullspec
- the call specification; may not be nullwriter
- the document writer for the current node; may not be nullorg.eclipse.jgit.api.errors.GitAPIException
- if there is a problem accessing the Git repositoryprotected void addCommitsAsChildren(org.eclipse.jgit.api.Git git, CallSpecification spec, DocumentWriter writer, int pageSize) throws org.eclipse.jgit.api.errors.GitAPIException
git
- the Git object; may not be nullspec
- the call specification; may not be nullwriter
- the document writer for the current node; may not be nullpageSize
- the number of commits to include, and the number of commits that will be in the next page (if there are
more commits)org.eclipse.jgit.api.errors.GitAPIException
- if there is a problem accessing the Git repositoryprotected void addCommitsAsPageOfChildren(org.eclipse.jgit.api.Git git, org.eclipse.jgit.lib.Repository repository, CallSpecification spec, PageWriter writer, PageKey pageKey) throws org.eclipse.jgit.api.errors.GitAPIException, IOException
git
- the Git object; may not be nullrepository
- the Repository object; may not be nullspec
- the call specification; may not be nullwriter
- the page writer for the current node; may not be nullpageKey
- the page key for this page; may not be nullorg.eclipse.jgit.api.errors.GitAPIException
- if there is a problem accessing the Git repositoryIOException
- if there is a problem reading the Git repositoryprotected boolean isQueryable(CallSpecification callSpec)
protected String authorName(org.eclipse.jgit.revwalk.RevCommit commit)
protected String commiterName(org.eclipse.jgit.revwalk.RevCommit commit)
Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.