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 NonNoteEntryprivate NonNoteEntryprivate final intprivate final intFields inherited from class org.eclipse.jgit.treewalk.AbstractTreeIterator
attributesNode, DEFAULT_PATH_SIZE, mode, parent, path, pathLen, pathOffset, zeroid -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateNoteParser(AbbreviatedObjectId prefix, ObjectReader r, ObjectId t) -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanisHex()private booleanisTree()private InMemoryNoteBucketparse()(package private) static InMemoryNoteBucketparse(AbbreviatedObjectId prefix, ObjectId treeId, ObjectReader reader) Parse a tree object into aNoteBucketinstance.private intprivate FanoutBucketprivate LeafBucketprivate booleanprivate InMemoryNoteBucketprivate voidMethods inherited from class org.eclipse.jgit.treewalk.CanonicalTreeParser
back, createSubtreeIterator, createSubtreeIterator, createSubtreeIterator0, eof, first, getEntryAttributesNode, getParent, hasId, idBuffer, idOffset, next, next, reset, reset, reset, resetRootMethods 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 aNoteBucketinstance. 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-treeIdcannot be accessed.
-
parse
-
parseTree
-
parseLeafTree
-
parseObjectId
-
parseFanoutTree
-
parseFanoutCell
private int parseFanoutCell() -
storeNonNote
private void storeNonNote() -
isTree
private boolean isTree() -
isHex
private boolean isHex()
-