Top Description Fields Constructors Methods
org.eclipse.jgit.notes

pack-priv final Class NoteParser

extends CanonicalTreeParser
Class Inheritance
Static Imports
org.eclipse.jgit.lib.Constants.OBJECT_ID_STRING_LENGTH, .Constants.encodeASCII, .FileMode.TREE, org.eclipse.jgit.util.RawParseUtils.parseHexInt4

Custom tree parser to select note bucket type and load it.

Field Summary

Modifier and TypeField and Description
private NonNoteEntry
private NonNoteEntry
private final int
private final int

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private boolean
private boolean
pack-priv static InMemoryNoteBucket

Returns:

bucket to holding the notes of the specified tree.
parse
(AbbreviatedObjectId
common hex digits that all notes within this tree share. The root tree has prefix.length() == 0, the first-level subtrees should be prefix.length()==2, etc.
prefix
,
final ObjectId
the tree to read from the repository.
treeId
,
final ObjectReader
reader to access the tree object.
reader
)

Parse a tree object into a NoteBucket instance.

private InMemoryNoteBucket
private int
private FanoutBucket
private LeafBucket
private boolean
private InMemoryNoteBucket
private void
Inherited from org.eclipse.jgit.treewalk.CanonicalTreeParser:
backcreateSubtreeIteratorcreateSubtreeIteratorcreateSubtreeIterator0eoffirstgetEntryAttributesNodegetParenthasIdidBufferidOffsetnextnextresetresetresetresetRoot

Field Detail

firstNonNoteback to summary
private NonNoteEntry firstNonNote
lastNonNoteback to summary
private NonNoteEntry lastNonNote
pathPaddingback to summary
private final int pathPadding
prefixLenback to summary
private final int prefixLen

Constructor Detail

NoteParserback to summary
private NoteParser(AbbreviatedObjectId prefix, ObjectReader r, ObjectId t) throws IncorrectObjectTypeException, IOException

Method Detail

isHexback to summary
private boolean isHex()
isTreeback to summary
private boolean isTree()
parseback to summary
pack-priv static InMemoryNoteBucket parse(AbbreviatedObjectId prefix, final ObjectId treeId, final ObjectReader reader) throws IOException

Parse a tree object into a NoteBucket 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:AbbreviatedObjectId

common hex digits that all notes within this tree share. The root tree has prefix.length() == 0, the first-level subtrees should be prefix.length()==2, etc.

treeId:ObjectId

the tree to read from the repository.

reader:ObjectReader

reader to access the tree object.

Returns:InMemoryNoteBucket

bucket to holding the notes of the specified tree.

Exceptions
IOException:
treeId cannot be accessed.
parseback to summary
private InMemoryNoteBucket parse()
parseFanoutCellback to summary
private int parseFanoutCell()
parseFanoutTreeback to summary
private FanoutBucket parseFanoutTree()
parseLeafTreeback to summary
private LeafBucket parseLeafTree()
parseObjectIdback to summary
private boolean parseObjectId(MutableObjectId id)
parseTreeback to summary
private InMemoryNoteBucket parseTree()
storeNonNoteback to summary
private void storeNonNote()