Package com.powsybl.tools.autocompletion
Class OptionTypeMapper
- java.lang.Object
-
- com.powsybl.tools.autocompletion.OptionTypeMapper
-
public class OptionTypeMapper extends Object
Tries to guess option argument type, to guide autocompletion. Works based on option name or argument name.- Author:
- Geoffroy Jamgotchian
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
OptionTypeMapper.Key
-
Constructor Summary
Constructors Constructor Description OptionTypeMapper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OptionTypeMapper
add(OptionTypeMapper.Key key, OptionType optionType)
OptionTypeMapper
addArgNameMapping(String regex, OptionType optionType)
Maps a regex on the argument name to a specific typeOptionTypeMapper
addOptionNameMapping(String regex, OptionType optionType)
Maps a regex on the option name to a specific typevoid
map(BashCommand command)
void
map(BashOption option)
void
map(List<BashCommand> commands)
OptionTypeMapper
setDefaultType(OptionType defaultType)
Sets the type to be used as a fallback
-
-
-
Method Detail
-
add
public OptionTypeMapper add(OptionTypeMapper.Key key, OptionType optionType)
-
addOptionNameMapping
public OptionTypeMapper addOptionNameMapping(String regex, OptionType optionType)
Maps a regex on the option name to a specific type
-
addArgNameMapping
public OptionTypeMapper addArgNameMapping(String regex, OptionType optionType)
Maps a regex on the argument name to a specific type
-
setDefaultType
public OptionTypeMapper setDefaultType(OptionType defaultType)
Sets the type to be used as a fallback
-
map
public void map(BashOption option)
-
map
public void map(BashCommand command)
-
map
public void map(List<BashCommand> commands)
-
-