public class Shortcuts extends AbstractList<String>
Shortcuts can be general-purpose, or can be of one or more "types" that define special usage for specific commands. For example, the "add" type is used by the "dependencies:add" command and the "attach" type is used by the "repositories:attach" command.
Shortcuts are defined per container, and are stored in a standard JVM properties file under "/configuration/sincerity/shortcuts.conf".
Container.getShortcuts()
Modifier and Type | Field and Description |
---|---|
static String |
SHORTCUT_PREFIX |
static int |
SHORTCUT_PREFIX_LENGTH |
static String |
SHORTCUT_TYPE_SEPARATOR |
modCount
Constructor and Description |
---|
Shortcuts(File file)
Loads the shortcuts.
|
Modifier and Type | Method and Description |
---|---|
void |
addArgument(String argument,
List<String> arguments)
Utility to add an arguments to a list of arguments while supporting
recursive expansion of shortcuts.
|
String |
get(int index) |
String[] |
get(String shortcut)
Retrieves a shortcut if it exists.
|
List<String> |
getByType(String type)
All shortcut identifiers by type.
|
int |
size() |
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
parallelStream, removeIf, stream
public static final String SHORTCUT_PREFIX
public static final String SHORTCUT_TYPE_SEPARATOR
public static final int SHORTCUT_PREFIX_LENGTH
public Shortcuts(File file) throws SincerityException
file
- The database file (usually
"/configuration/sincerity/shortcuts.conf")SincerityException
- In case of an errorpublic String[] get(String shortcut) throws SincerityException
shortcut
- The shortcut identifierSincerityException
- In case of an errorpublic List<String> getByType(String type)
type
- The typepublic void addArgument(String argument, List<String> arguments) throws SincerityException
argument
- The argument to addarguments
- The list to which we should add argumentsSincerityException
- In case of an errorpublic int size()
size
in interface Collection<String>
size
in interface List<String>
size
in class AbstractCollection<String>
Copyright © 2011-2016 Three Crickets LLC.