Package org.opengrok.indexer.analysis
Interface LangMap
- All Known Implementing Classes:
LangTreeMap
public interface LangMap
Represents an API for mapping file specifications versus languages and
getting the ctags options representation (--langmap-<LANG> or
--map-<LANG>) thereof.
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the specified mapping of a file specification to a language.voidclear()Removes all settings from this map.voidExclude the specified mapping of a file specification to any language.Gets an unmodifiable view of the current additions.Gets the transformation of the instance's mappings to ctags arguments.Gets an unmodifiable view of the current exclusions.mergeSecondary(LangMap other) Creates a new instance, merging the settings from the current instance overlaying a specifiedother.Gets an unmodifiable view of the current instance.
-
Method Details
-
clear
void clear()Removes all settings from this map. -
add
Adds the specified mapping of a file specification to a language. Any matching exclusion viaexclude(String)is undone.- Parameters:
fileSpec- a value starting with a period ('.') to specify a file extension; otherwise specifying a prefix.- Throws:
IllegalArgumentException- iffileSpecisnullor is an extension (i.e. starting with a period) but contains any other periods, as that is not ctags-compatible
-
exclude
Exclude the specified mapping of a file specification to any language. Any matching addition viaadd(String, String)is undone.- Throws:
IllegalArgumentException- iffileSpecisnull
-
getCtagsArgs
Gets the transformation of the instance's mappings to ctags arguments. -
mergeSecondary
Creates a new instance, merging the settings from the current instance overlaying a specifiedother. Additions from the current instance take precedence, and exclusions from theotheronly take effect if the current instance has no matching addition.- Parameters:
other- a defined instance- Returns:
- a defined instance
-
unmodifiable
LangMap unmodifiable()Gets an unmodifiable view of the current instance. -
getAdditions
Gets an unmodifiable view of the current additions. -
getExclusions
Gets an unmodifiable view of the current exclusions.
-