/** Parses an attribute value from a list of rules, returning null if there is no match for the given key. */ private static @Nullable String findAttributeInRules(String subpath, boolean isFolder, String key, List<AttributesRule> rules) { String value = null; // later rules override earlier ones for (AttributesRule rule : rules) { if (rule.isMatch(subpath, isFolder)) { for (Attribute attribute : rule.getAttributes()) { if (attribute.getKey().equals(key)) { value = attribute.getValue(); } } } } return value; } }
rules.add(new AttributesRule(txt.substring(0, patternEnd), txt.substring(patternEnd + 1).trim()));
if (rule.getPattern().startsWith(MACRO_PREFIX)) { expansions.put(rule.getPattern() .substring(MACRO_PREFIX.length()).trim(), rule.getAttributes());
this.attributes = parseAttributes(attributes);
this.attributes = parseAttributes(attributes);
while (ruleIterator.hasPrevious()) { AttributesRule rule = ruleIterator.previous(); if (rule.isMatch(entryPath, isDirectory)) { ListIterator<Attribute> attributeIte = rule.getAttributes() .listIterator(rule.getAttributes().size());
if (rule.getPattern().startsWith(MACRO_PREFIX)) { expansions.put(rule.getPattern() .substring(MACRO_PREFIX.length()).trim(), rule.getAttributes());
rules.add(new AttributesRule(txt.substring(0, patternEnd), txt.substring(patternEnd + 1).trim()));
this.attributes = parseAttributes(attributes);
/** Parses an attribute value from a list of rules, returning null if there is no match for the given key. */ private static @Nullable String findAttributeInRules(String subpath, boolean isFolder, String key, List<AttributesRule> rules) { String value = null; // later rules override earlier ones for (AttributesRule rule : rules) { if (rule.isMatch(subpath, isFolder)) { for (Attribute attribute : rule.getAttributes()) { if (attribute.getKey().equals(key)) { value = attribute.getValue(); } } } } return value; } }
if (rule.getPattern().startsWith(MACRO_PREFIX)) { expansions.put(rule.getPattern() .substring(MACRO_PREFIX.length()).trim(), rule.getAttributes());
rules.add(new AttributesRule(txt.substring(0, patternEnd), txt.substring(patternEnd + 1).trim()));
while (ruleIterator.hasPrevious()) { AttributesRule rule = ruleIterator.previous(); if (rule.isMatch(entryPath, isDirectory)) { ListIterator<Attribute> attributeIte = rule.getAttributes() .listIterator(rule.getAttributes().size());
while (ruleIterator.hasPrevious()) { AttributesRule rule = ruleIterator.previous(); if (rule.isMatch(entryPath, isDirectory)) { ListIterator<Attribute> attributeIte = rule.getAttributes() .listIterator(rule.getAttributes().size());