| Modifier and Type | Field and Description |
|---|---|
| private static final byte[] | |
| private int | |
| private static final byte[] | |
| private int | nextPtr
Offset one past the current entry (first byte of next entry). |
| private int | |
| private byte[] |
| Access | Constructor and Description |
|---|---|
| public | |
| public | CanonicalTreeParser(final byte[]
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 '/'. prefix, final ObjectReader reader to load the tree data from. reader, final AnyObjectId identity of the tree being parsed; used only in exception
messages if data corruption is found. treeId)Create a new parser for a tree appearing in a subset of a repository. |
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void | back(int
number of entries to move the iterator by. Must be a positive,
non-zero integer. delta)Implements abstract org. Move to prior entry, populating this iterator with the entry data. |
| public CanonicalTreeParser | createSubtreeIterator(final ObjectReader
reader to load the tree data from. reader, final MutableObjectId temporary ObjectId buffer for use by this method. idBuffer)Overrides org. Create a new iterator for the current entry's subtree. |
| public CanonicalTreeParser | createSubtreeIterator(ObjectReader
reader to load the tree data from. reader)Implements abstract org. Create a new iterator for the current entry's subtree. |
| public final CanonicalTreeParser | Returns: a new parser that walks over the current subtree.reader to load the tree data from. reader, final AnyObjectId ObjectId of the tree to open. id)Back door to quickly create a subtree iterator for any subtree. |
| public boolean | eof()
Implements abstract org. Is this tree iterator at its EOF point (no more entries)? |
| private AttributesNode | |
| public boolean | first()
Implements abstract org. Is this tree iterator positioned on its first entry? |
| public AttributesNode | Returns: org. for the
current entry.org. used to parse the
.gitattributes entry.Retrieve the |
| public CanonicalTreeParser | Returns: the parent of this tree parser.
Deprecated
internal use only
Get the parent of this tree parser. |
| public boolean | hasId()
Implements abstract org. Whether the entry has a valid ObjectId. |
| public byte[] | idBuffer()
Implements abstract org. Get the byte array buffer object IDs must be copied out of. |
| public int | idOffset()
Implements abstract org. Get the position within |
| private static AttributesNode | |
| public CanonicalTreeParser | Returns: this iterator, or its parent, if the tree is at eof.Get this iterator, or its parent, if the tree is at eof. |
| public void | next(int
number of entries to move the iterator by. Must be a positive,
non-zero integer. delta)Implements abstract org. Move to next entry, populating this iterator with the entry data. |
| private static AttributesNode | |
| private void | |
| public void | |
| public void | reset(ObjectReader
reader to use during repository access. reader, AnyObjectId identity of the tree being parsed; used only in exception
messages if data corruption is found. id)Reset this parser to walk through the given tree. |
| public void | reset()
Overrides org. Position this iterator on the first entry. |
| public CanonicalTreeParser | Returns: the root level parser.reader to use during repository access. reader, final AnyObjectId identity of the tree being parsed; used only in exception
messages if data corruption is found. id)Reset this parser to walk through the given tree. |
| ATTRS | back to summary |
|---|---|
| private static final byte[] ATTRS | |
| currPtr | back to summary |
|---|---|
| private int currPtr First offset within | |
| EMPTY | back to summary |
|---|---|
| private static final byte[] EMPTY | |
| nextPtr | back to summary |
|---|---|
| private int nextPtr Offset one past the current entry (first byte of next entry). | |
| prevPtr | back to summary |
|---|---|
| private int prevPtr First offset within | |
| raw | back to summary |
|---|---|
| private byte[] raw | |
| CanonicalTreeParser | back to summary |
|---|---|
| public CanonicalTreeParser() Create a new parser. | |
| CanonicalTreeParser | back to summary |
|---|---|
| public CanonicalTreeParser(final byte[] prefix, final ObjectReader reader, final AnyObjectId treeId) throws IncorrectObjectTypeException, IOException Create a new parser for a tree appearing in a subset of a repository.
| |
| CanonicalTreeParser | back to summary |
|---|---|
| private CanonicalTreeParser(CanonicalTreeParser p) | |
| back | back to summary |
|---|---|
| public void back(int delta) Implements abstract org. Doc from org. Move to prior entry, populating this iterator with the entry data. The 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:
idBuffer() and idOffset()
when demanded.
| |
| createSubtreeIterator | back to summary |
|---|---|
| public CanonicalTreeParser createSubtreeIterator(final ObjectReader reader, final MutableObjectId idBuffer) throws IncorrectObjectTypeException, IOException Overrides org. Doc from org. Create a new iterator for the current entry's subtree.
The parent reference of the iterator must be
| |
| createSubtreeIterator | back to summary |
|---|---|
| public CanonicalTreeParser createSubtreeIterator(ObjectReader reader) throws IncorrectObjectTypeException, IOException Implements abstract org. Doc from org. Create a new iterator for the current entry's subtree.
The parent reference of the iterator must be
| |
| createSubtreeIterator0 | back to summary |
|---|---|
| public final CanonicalTreeParser createSubtreeIterator0(final ObjectReader reader, final AnyObjectId id) throws IOException Back door to quickly create a subtree iterator for any subtree. 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.
| |
| eof | back to summary |
|---|---|
| public boolean eof() Implements abstract org. Doc from org. Is this tree iterator at its EOF point (no more entries)? An iterator is at EOF if there is no current entry.
| |
| findAttributes | back to summary |
|---|---|
| private AttributesNode findAttributes(ObjectReader reader) throws IOException | |
| first | back to summary |
|---|---|
| public boolean first() Implements abstract org. Doc from org. Is this tree iterator positioned on its first entry?
An iterator is positioned on the first entry if
An empty iterator (one with no entries) will be
| |
| getEntryAttributesNode | back to summary |
|---|---|
| public AttributesNode getEntryAttributesNode(ObjectReader reader) throws IOException Retrieve the
| |
| getParent | back to summary |
|---|---|
| public CanonicalTreeParser getParent()
Deprecated internal use only Get the parent of this tree parser.
| |
| hasId | back to summary |
|---|---|
| public boolean hasId() Implements abstract org. Doc from org. Whether the entry has a valid ObjectId.
| |
| idBuffer | back to summary |
|---|---|
| public byte[] idBuffer() Implements abstract org. Doc from org. Get the byte array buffer object IDs must be copied out of. The 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.
| |
| idOffset | back to summary |
|---|---|
| public int idOffset() Implements abstract org. Doc from org. Get the position within
| |
| loadAttributes | back to summary |
|---|---|
| private static AttributesNode loadAttributes(ObjectReader reader, AnyObjectId id) throws IOException | |
| next | back to summary |
|---|---|
| public CanonicalTreeParser next() Get this iterator, or its parent, if the tree is at eof.
| |
| next | back to summary |
|---|---|
| public void next(int delta) Implements abstract org. Doc from org. Move to next entry, populating this iterator with the entry data. The 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:
idBuffer() and idOffset()
when demanded.
| |
| noAttributes | back to summary |
|---|---|
| private static AttributesNode noAttributes() | |
| parseEntry | back to summary |
|---|---|
| private void parseEntry() | |
| reset | back to summary |
|---|---|
| public void reset(byte[] treeData) Reset this parser to walk through the given tree data.
| |
| reset | back to summary |
|---|---|
| public void reset(ObjectReader reader, AnyObjectId id) throws IncorrectObjectTypeException, IOException Reset this parser to walk through the given tree.
| |
| reset | back to summary |
|---|---|
| public void reset() Overrides org. Doc from org. Position this iterator on the first entry.
The default implementation of this method uses
| |
| resetRoot | back to summary |
|---|---|
| public CanonicalTreeParser resetRoot(final ObjectReader reader, final AnyObjectId id) throws IncorrectObjectTypeException, IOException Reset this parser to walk through the given tree.
| |