Module com.github.rvesse.airline
Class UserAliasesSource<C>
java.lang.Object
com.github.rvesse.airline.parser.aliases.UserAliasesSource<C>
- Type Parameters:
C
- Command type
Represents the source of user defined aliases
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ResourceLocator[]
Default user alias source locatorsprivate final String
private final List
<ResourceLocator> private final String
-
Constructor Summary
ConstructorsConstructorDescriptionUserAliasesSource
(String filename, String prefix, String... searchLocations) UserAliasesSource
(String filename, String prefix, List<ResourceLocator> locators, List<String> searchLocations) -
Method Summary
Modifier and TypeMethodDescriptionGets the filename of the configuration file that will be scanned for alias definitionsGets the locators that are used to resolve search locations to actual usable locationsGets the prefix that is used to distinguish alias definitions from other property definitions in the configuration fileGets the search locations where the configuration file may be located in order of preferenceload()
Loads the alias metadata based on the configured sources
-
Field Details
-
DEFAULT_LOCATORS
Default user alias source locators -
locators
-
searchLocations
-
filename
-
prefix
-
-
Constructor Details
-
UserAliasesSource
-
UserAliasesSource
-
-
Method Details
-
getFilename
Gets the filename of the configuration file that will be scanned for alias definitions- Returns:
- Configuration file name
-
getSearchLocations
Gets the search locations where the configuration file may be located in order of preference- Returns:
- Search locations in order of preference
-
getPrefix
Gets the prefix that is used to distinguish alias definitions from other property definitions in the configuration fileIf this is null/empty/blank then no prefix is in effect
- Returns:
- Prefix
-
getLocators
Gets the locators that are used to resolve search locations to actual usable locations- Returns:
- User alias locators
-
load
Loads the alias metadata based on the configured sources- Returns:
- Alias metadata
- Throws:
FileNotFoundException
- Thrown if unable to find a properties fileIOException
- Thrown if unable to read a properties file
-