|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eclipse.jgit.treewalk.AbstractTreeIterator
org.eclipse.jgit.treewalk.CanonicalTreeParser
public class CanonicalTreeParser
Parses raw Git trees from the canonical semi-text/semi-binary format.
| Field Summary |
|---|
| Fields inherited from class org.eclipse.jgit.treewalk.AbstractTreeIterator |
|---|
DEFAULT_PATH_SIZE, mode, path, pathLen, pathOffset, zeroid |
| Constructor Summary | |
|---|---|
CanonicalTreeParser()
Create a new parser. |
|
CanonicalTreeParser(byte[] prefix,
Repository repo,
AnyObjectId treeId,
WindowCursor curs)
Create a new parser for a tree appearing in a subset of a repository. |
|
| Method Summary | |
|---|---|
void |
back(int delta)
Move to prior entry, populating this iterator with the entry data. |
CanonicalTreeParser |
createSubtreeIterator(Repository repo)
Create a new iterator for the current entry's subtree. |
CanonicalTreeParser |
createSubtreeIterator(Repository repo,
MutableObjectId idBuffer,
WindowCursor curs)
Create a new iterator for the current entry's subtree. |
CanonicalTreeParser |
createSubtreeIterator0(Repository repo,
AnyObjectId id,
WindowCursor curs)
Back door to quickly create a subtree iterator for any subtree. |
boolean |
eof()
Is this tree iterator at its EOF point (no more entries)? |
boolean |
first()
Is this tree iterator positioned on its first entry? |
byte[] |
idBuffer()
Get the byte array buffer object IDs must be copied out of. |
int |
idOffset()
Get the position within AbstractTreeIterator.idBuffer() of this entry's ObjectId. |
CanonicalTreeParser |
next()
|
void |
next(int delta)
Move to next entry, populating this iterator with the entry data. |
void |
reset(byte[] treeData)
Reset this parser to walk through the given tree data. |
void |
reset(Repository repo,
AnyObjectId id,
WindowCursor curs)
Reset this parser to walk through the given tree. |
CanonicalTreeParser |
resetRoot(Repository repo,
AnyObjectId id,
WindowCursor curs)
Reset this parser to walk through the given tree. |
| Methods inherited from class org.eclipse.jgit.treewalk.AbstractTreeIterator |
|---|
createEmptyTreeIterator, ensurePathCapacity, getEntryFileMode, getEntryObjectId, getEntryObjectId, getEntryPathString, getEntryRawMode, getName, getNameLength, growPath, idEqual, pathCompare, skip, stopWalk |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CanonicalTreeParser()
public CanonicalTreeParser(byte[] prefix,
Repository repo,
AnyObjectId treeId,
WindowCursor curs)
throws IncorrectObjectTypeException,
java.io.IOException
prefix - position of this iterator in the repository tree. The value
may be null or the empty array to indicate the prefix is the
root of the repository. A trailing slash ('/') is
automatically appended if the prefix does not end in '/'.repo - repository to load the tree data from.treeId - identity of the tree being parsed; used only in exception
messages if data corruption is found.curs - a window cursor to use during data access from the repository.
MissingObjectException - the object supplied is not available from the repository.
IncorrectObjectTypeException - the object supplied as an argument is not actually a tree and
cannot be parsed as though it were a tree.
java.io.IOException - a loose object or pack file could not be read.| Method Detail |
|---|
public void reset(byte[] treeData)
treeData - the raw tree content.
public CanonicalTreeParser resetRoot(Repository repo,
AnyObjectId id,
WindowCursor curs)
throws IncorrectObjectTypeException,
java.io.IOException
repo - repository to load the tree data from.id - identity of the tree being parsed; used only in exception
messages if data corruption is found.curs - window cursor to use during repository access.
MissingObjectException - the object supplied is not available from the repository.
IncorrectObjectTypeException - the object supplied as an argument is not actually a tree and
cannot be parsed as though it were a tree.
java.io.IOException - a loose object or pack file could not be read.public CanonicalTreeParser next()
public void reset(Repository repo,
AnyObjectId id,
WindowCursor curs)
throws IncorrectObjectTypeException,
java.io.IOException
repo - repository to load the tree data from.id - identity of the tree being parsed; used only in exception
messages if data corruption is found.curs - window cursor to use during repository access.
MissingObjectException - the object supplied is not available from the repository.
IncorrectObjectTypeException - the object supplied as an argument is not actually a tree and
cannot be parsed as though it were a tree.
java.io.IOException - a loose object or pack file could not be read.
public CanonicalTreeParser createSubtreeIterator(Repository repo,
MutableObjectId idBuffer,
WindowCursor curs)
throws IncorrectObjectTypeException,
java.io.IOException
AbstractTreeIterator
The parent reference of the iterator must be this, otherwise
the caller would not be able to exit out of the subtree iterator
correctly and return to continue walking this.
createSubtreeIterator in class AbstractTreeIteratorrepo - repository to load the tree data from.idBuffer - temporary ObjectId buffer for use by this method.curs - window cursor to use during repository access.
IncorrectObjectTypeException - the current entry is not actually a tree and cannot be parsed
as though it were a tree.
java.io.IOException - a loose object or pack file could not be read.
public final CanonicalTreeParser createSubtreeIterator0(Repository repo,
AnyObjectId id,
WindowCursor curs)
throws java.io.IOException
Don't use this unless you are ObjectWalk. The method is meant to be called only once the current entry has been identified as a tree and its identity has been converted into an ObjectId.
repo - repository to load the tree data from.id - ObjectId of the tree to open.curs - window cursor to use during repository access.
java.io.IOException - a loose object or pack file could not be read.
public CanonicalTreeParser createSubtreeIterator(Repository repo)
throws IncorrectObjectTypeException,
java.io.IOException
AbstractTreeIterator
The parent reference of the iterator must be this,
otherwise the caller would not be able to exit out of the subtree
iterator correctly and return to continue walking this.
createSubtreeIterator in class AbstractTreeIteratorrepo - repository to load the tree data from.
IncorrectObjectTypeException - the current entry is not actually a tree and cannot be parsed
as though it were a tree.
java.io.IOException - a loose object or pack file could not be read.public byte[] idBuffer()
AbstractTreeIteratorThe id buffer contains the bytes necessary to construct an ObjectId for the current entry of this iterator. The buffer can be the same buffer for all entries, or it can be a unique buffer per-entry. Implementations are encouraged to expose their private buffer whenever possible to reduce garbage generation and copying costs.
idBuffer in class AbstractTreeIteratorAbstractTreeIterator.getEntryObjectId()public int idOffset()
AbstractTreeIteratorAbstractTreeIterator.idBuffer() of this entry's ObjectId.
idOffset in class AbstractTreeIteratorAbstractTreeIterator.idBuffer() where the
ObjectId must be copied out of.public boolean first()
AbstractTreeIterator
An iterator is positioned on the first entry if back(1)
would be an invalid request as there is no entry before the current one.
An empty iterator (one with no entries) will be
first() && eof().
first in class AbstractTreeIteratorpublic boolean eof()
AbstractTreeIteratorAn iterator is at EOF if there is no current entry.
eof in class AbstractTreeIteratorpublic void next(int delta)
AbstractTreeIteratorThe delta indicates how many moves forward should occur. The most common delta is 1 to move to the next entry.
Implementations must populate the following members:
AbstractTreeIterator.modeAbstractTreeIterator.path (from AbstractTreeIterator.pathOffset to AbstractTreeIterator.pathLen)AbstractTreeIterator.pathLenAbstractTreeIterator.idBuffer() and AbstractTreeIterator.idOffset()
when demanded.
next in class AbstractTreeIteratordelta - number of entries to move the iterator by. Must be a positive,
non-zero integer.public void back(int delta)
AbstractTreeIteratorThe delta indicates how many moves backward should occur.The most common delta is 1 to move to the prior entry.
Implementations must populate the following members:
AbstractTreeIterator.modeAbstractTreeIterator.path (from AbstractTreeIterator.pathOffset to AbstractTreeIterator.pathLen)AbstractTreeIterator.pathLenAbstractTreeIterator.idBuffer() and AbstractTreeIterator.idOffset()
when demanded.
back in class AbstractTreeIteratordelta - number of entries to move the iterator by. Must be a positive,
non-zero integer.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||