Package org.eclipse.jgit.notes
Class NoteParser
java.lang.Object
org.eclipse.jgit.treewalk.AbstractTreeIterator
org.eclipse.jgit.treewalk.CanonicalTreeParser
org.eclipse.jgit.notes.NoteParser
Custom tree parser to select note bucket type and load it.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate NonNoteEntry
private NonNoteEntry
private final int
private final int
Fields inherited from class org.eclipse.jgit.treewalk.AbstractTreeIterator
attributesNode, DEFAULT_PATH_SIZE, mode, parent, path, pathLen, pathOffset, zeroid
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
NoteParser
(AbbreviatedObjectId prefix, ObjectReader r, ObjectId t) -
Method Summary
Modifier and TypeMethodDescriptionprivate boolean
isHex()
private boolean
isTree()
private InMemoryNoteBucket
parse()
(package private) static InMemoryNoteBucket
parse
(AbbreviatedObjectId prefix, ObjectId treeId, ObjectReader reader) Parse a tree object into aNoteBucket
instance.private int
private FanoutBucket
private LeafBucket
private boolean
private InMemoryNoteBucket
private void
Methods inherited from class org.eclipse.jgit.treewalk.CanonicalTreeParser
back, createSubtreeIterator, createSubtreeIterator, createSubtreeIterator0, eof, first, getEntryAttributesNode, getParent, hasId, idBuffer, idOffset, next, next, reset, reset, reset, resetRoot
Methods inherited from class org.eclipse.jgit.treewalk.AbstractTreeIterator
createEmptyTreeIterator, ensurePathCapacity, findFile, findFile, getEntryFileMode, getEntryObjectId, getEntryObjectId, getEntryPathBuffer, getEntryPathHashCode, getEntryPathLength, getEntryPathString, getEntryRawMode, getName, getNameLength, getNameOffset, growPath, idEqual, isWorkTree, needsStopWalk, pathCompare, pathCompare, skip, stopWalk, toString
-
Field Details
-
prefixLen
private final int prefixLen -
pathPadding
private final int pathPadding -
firstNonNote
-
lastNonNote
-
-
Constructor Details
-
NoteParser
private NoteParser(AbbreviatedObjectId prefix, ObjectReader r, ObjectId t) throws IncorrectObjectTypeException, IOException
-
-
Method Details
-
parse
static InMemoryNoteBucket parse(AbbreviatedObjectId prefix, ObjectId treeId, ObjectReader reader) throws IOException Parse a tree object into aNoteBucket
instance. The type of note tree is automatically detected by examining the items within the tree, and allocating the proper storage type based on the first note-like entry encountered. Since the method parses by guessing the type on the first element, malformed note trees can be read as the wrong type of tree. This method is not recursive, it parses the one tree given to it and returns the bucket. If there are subtrees for note storage, they are setup as lazy pointers that will be resolved at a later time.- Parameters:
prefix
- common hex digits that all notes within this tree share. The root tree hasprefix.length() == 0
, the first-level subtrees should beprefix.length()==2
, etc.treeId
- the tree to read from the repository.reader
- reader to access the tree object.- Returns:
- bucket to holding the notes of the specified tree.
- Throws:
IOException
-treeId
cannot be accessed.
-
parse
-
parseTree
-
parseLeafTree
-
parseObjectId
-
parseFanoutTree
-
parseFanoutCell
private int parseFanoutCell() -
storeNonNote
private void storeNonNote() -
isTree
private boolean isTree() -
isHex
private boolean isHex()
-