Package org.daisy.cli
Class ShortFormResolver
java.lang.Object
org.daisy.cli.ShortFormResolver
Provides shorter names for factory identifiers, to be used in command line user interfaces.
The short forms are guaranteed to be consistent between executions as long as
the identifiers in the collection remains the same.
- Author:
- Joel HÃ¥kansson
-
Constructor Summary
ConstructorDescriptionShortFormResolver
(Collection<? extends Factory> obj) Creates a new ShortFormResolver for the supplied collection of factory objects. -
Method Summary
Modifier and TypeMethodDescriptiongetShortForm
(String id) Get the short form for the specified identifier.Gets all short forms.Resolves a short form.
-
Constructor Details
-
ShortFormResolver
Creates a new ShortFormResolver for the supplied collection of factory objects.- Parameters:
obj
- the factory objects to create short forms for
-
-
Method Details
-
getShortForms
Gets all short forms.- Returns:
- returns a list of short forms
-
getShortForm
Get the short form for the specified identifier.- Parameters:
id
- the identifier to get the short form for- Returns:
- returns the short form for the identifier, or null if the identifier does not have a short form
-
resolve
Resolves a short form.- Parameters:
shortForm
- the short form to resolve- Returns:
- returns the full id for the supplied short form, or null if the short form does not have an identifier
-