getAttributes() yields the ready processed
attributes for the current path represented by the
org.eclipse.jgit.treewalk.TreeWalk
The implementation is based on the specifications in http://git-scm.com/docs/gitattributes
| Modifier and Type | Field and Description |
|---|---|
| private final Supplier | |
| private static final List | BINARY_RULE_ATTRIBUTES
This is the default binary rule that is present in any git folder
|
| private static final String | |
| private final Map | |
| private final AttributesNode | |
| private final AttributesNode | |
| private static final String | |
| private final TreeWalk |
| Access | Constructor and Description |
|---|---|
| public | AttributesHandler(TreeWalk treeWalk)
Deprecated
since 6.1, use
AttributesHandler(TreeWalk, Supplier)
instead
Create an |
| public | AttributesHandler(TreeWalk treeWalk, Supplier<CanonicalTreeParser>
the tree to read .gitattributes from attributesTree)Create an |
| Modifier and Type | Method and Description |
|---|---|
| private static AttributesNode | attributesNode(TreeWalk
used to walk trees treeWalk, WorkingTreeIterator used to walk the working tree workingTreeIterator, DirCacheIterator used to walk the dircache dirCacheIterator, CanonicalTreeParser another tree otherTree)Get the |
| protected void | expandMacro(Attribute attr, Attributes
contains the (recursive) expanded and merged macro attributes
including the attribute iself result)Expand a macro |
| public Attributes | Returns: theorg. for the
current path represented by the
org. |
| protected void | mergeAttributes(AttributesNode
the node to scan for matches to entryPath node, String the path to test. The path must be relative to this attribute
node's own repository path, and in repository path format
(uses '/' and not '\'). entryPath, boolean true if the target item is a directory. isDirectory, Attributes that will hold the attributes matching this entry path. This
method will NOT override any existing entry in attributes. result)Merges the matching node attributes for an entry path. |
| private void | mergeGlobalAttributes(String
the path to test. The path must be relative to this attribute
node's own repository path, and in repository path format
(uses '/' and not '\'). entryPath, boolean true if the target item is a directory. isDirectory, Attributes that will hold the attributes matching this entry path. This
method will NOT override any existing entry in attributes. result)Merges the matching GLOBAL attributes for an entry path. |
| private void | mergeInfoAttributes(String
the path to test. The path must be relative to this attribute
node's own repository path, and in repository path format
(uses '/' and not '\'). entryPath, boolean true if the target item is a directory. isDirectory, Attributes that will hold the attributes matching this entry path. This
method will NOT override any existing entry in attributes. result)Merges the matching INFO attributes for an entry path. |
| private void | mergePerDirectoryEntryAttributes(String
the path to test. The path must be relative to this attribute
node's own repository path, and in repository path format
(uses '/' and not '\'). entryPath, int index of the '/' preceeding the current level, or -1 if none nameRoot, boolean true if the target item is a directory. isDirectory, WorkingTreeIterator the working tree iterator workingTreeIterator, DirCacheIterator the dircache iterator dirCacheIterator, CanonicalTreeParser another tree otherTree, Attributes that will hold the attributes matching this entry path. This
method will NOT override any existing entry in attributes. result)Merges the matching working directory attributes for an entry path. |
| private static <T extends AbstractTreeIterator> T | |
| private static <T extends AbstractTreeIterator> T |
| attributesTree | back to summary |
|---|---|
| private final Supplier<CanonicalTreeParser> attributesTree | |
| BINARY_RULE_ATTRIBUTES | back to summary |
|---|---|
| private static final List<Attribute> BINARY_RULE_ATTRIBUTES This is the default binary rule that is present in any git folder
| |
| BINARY_RULE_KEY | back to summary |
|---|---|
| private static final String BINARY_RULE_KEY | |
| expansions | back to summary |
|---|---|
| private final Map<String, List<Attribute>> expansions | |
| globalNode | back to summary |
|---|---|
| private final AttributesNode globalNode | |
| infoNode | back to summary |
|---|---|
| private final AttributesNode infoNode | |
| MACRO_PREFIX | back to summary |
|---|---|
| private static final String MACRO_PREFIX | |
| treeWalk | back to summary |
|---|---|
| private final TreeWalk treeWalk | |
| AttributesHandler | back to summary |
|---|---|
| public AttributesHandler(TreeWalk treeWalk) throws IOException
Deprecated since 6.1, use Create an
| |
| AttributesHandler | back to summary |
|---|---|
| public AttributesHandler(TreeWalk treeWalk, Supplier<CanonicalTreeParser> attributesTree) throws IOException Create an
| |
| attributesNode | back to summary |
|---|---|
| private static AttributesNode attributesNode(TreeWalk treeWalk, WorkingTreeIterator workingTreeIterator, DirCacheIterator dirCacheIterator, CanonicalTreeParser otherTree) throws IOException Get the This method implements the fallback mechanism between the index and the working tree depending on the operation type
| |
| expandMacro | back to summary |
|---|---|
| protected void expandMacro(Attribute attr, Attributes result) Expand a macro
| |
| getAttributes | back to summary |
|---|---|
| public Attributes getAttributes() throws IOException See
| |
| mergeAttributes | back to summary |
|---|---|
| protected void mergeAttributes(AttributesNode node, String entryPath, boolean isDirectory, Attributes result) Merges the matching node attributes for an entry path.
| |
| mergeGlobalAttributes | back to summary |
|---|---|
| private void mergeGlobalAttributes(String entryPath, boolean isDirectory, Attributes result) Merges the matching GLOBAL attributes for an entry path.
| |
| mergeInfoAttributes | back to summary |
|---|---|
| private void mergeInfoAttributes(String entryPath, boolean isDirectory, Attributes result) Merges the matching INFO attributes for an entry path.
| |
| mergePerDirectoryEntryAttributes | back to summary |
|---|---|
| private void mergePerDirectoryEntryAttributes(String entryPath, int nameRoot, boolean isDirectory, WorkingTreeIterator workingTreeIterator, DirCacheIterator dirCacheIterator, CanonicalTreeParser otherTree, Attributes result) throws IOException Merges the matching working directory attributes for an entry path.
| |
| parentOf | back to summary |
|---|---|
| private static <T extends AbstractTreeIterator> T parentOf(T node) | |
| rootOf | back to summary |
|---|---|
| private static <T extends AbstractTreeIterator> T rootOf(T node) | |