Package org.corpus_tools.pepper.cli
Class PepperStarter
- java.lang.Object
-
- org.corpus_tools.pepper.cli.PepperStarter
-
public class PepperStarter extends Object
The main class to start Pepper from the Console.- Author:
- Florian
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPepperStarter.COMMAND
-
Field Summary
Fields Modifier and Type Field Description static intCONSOLE_WIDTHThe standard width of the output console of Pepper.static intCONSOLE_WIDTH_120The width of the output console of Pepper.static intCONSOLE_WIDTH_80The width of the output console of Pepper, when os is windows.static StringFILE_ENDING_PEPPERThis is the default ending of a Pepper workflow description file.static StringPROMPT
-
Constructor Summary
Constructors Constructor Description PepperStarter()Initializes an instance of PepperStarter without aPepperConnector.PepperStarter(PepperConnector pepperConnector)Initializes an instance of PepperStarter.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Stringclean()Cleans the current Pepper instance and especially removes the OSGi workspace, to set up a new one.Stringconf()voidconvert(String workFlowPath)Loads the passed workflow description file and starts the conversion.Stringdebug()Switches on/off the debug mode.Stringfitness()Returns a fitness report as a String.PepperConnectorgetPepper()PepperStarterConfigurationgetPepperConfiguration()static StringgetVersion()Resolves the current Pepper version from a file named version.properties in the pepper-lib jar file.Stringhelp()Help to all commands for PepperStringinstallAndStart(List<String> params)Installs and starts a new Pepper module(s).Stringlist()Returns a String containing a table with information about all available Pepper modules.Stringlist(String moduleSelector)Returns a String containing a table with information about the passed Pepper module.static voidmain(String[] args)Stringosgi()Opens the OSGi console via anOSGiConsoleobject and delegates to it.Stringremove(List<String> params)Removes an existing Pepper module(s).voidrunInteractive()Starts the interactive console of Pepper.StringselfTest()Deprecated.voidsetPepper(PepperConnector pepper)Sets a reference to Pepper via aPepperConnectorvoidsetPepperConfiguration(PepperStarterConfiguration pepperConf)Stringstart_osgi()Starts the OSGi environment.Stringstop_osgi()Stops the OSGi environment.
-
-
-
Field Detail
-
PROMPT
public static final String PROMPT
- See Also:
- Constant Field Values
-
FILE_ENDING_PEPPER
public static final String FILE_ENDING_PEPPER
This is the default ending of a Pepper workflow description file.- See Also:
- Constant Field Values
-
CONSOLE_WIDTH
public static final int CONSOLE_WIDTH
The standard width of the output console of Pepper.- See Also:
- Constant Field Values
-
CONSOLE_WIDTH_120
public static final int CONSOLE_WIDTH_120
The width of the output console of Pepper.- See Also:
- Constant Field Values
-
CONSOLE_WIDTH_80
public static final int CONSOLE_WIDTH_80
The width of the output console of Pepper, when os is windows.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PepperStarter
public PepperStarter()
Initializes an instance of PepperStarter without aPepperConnector. Make sure to call methodsetPepper(PepperConnector)right after calling the constructor.
-
PepperStarter
public PepperStarter(PepperConnector pepperConnector)
Initializes an instance of PepperStarter.- Parameters:
pepperConnector- aPepperConnectorobject via which thePepperStartercommunicates with aPepperinstance
-
-
Method Detail
-
getPepper
public PepperConnector getPepper()
- Returns:
- a reference to Pepper via a
PepperConnector
-
setPepper
public void setPepper(PepperConnector pepper)
Sets a reference to Pepper via aPepperConnector
-
getPepperConfiguration
public PepperStarterConfiguration getPepperConfiguration()
- Returns:
- configuration for
PepperStarter
-
setPepperConfiguration
public void setPepperConfiguration(PepperStarterConfiguration pepperConf)
- Parameters:
pepperConf- configuration forPepperStarter
-
help
public String help()
Help to all commands for Pepper- Returns:
-
list
public String list()
Returns a String containing a table with information about all available Pepper modules.- Returns:
-
list
public String list(String moduleSelector)
Returns a String containing a table with information about the passed Pepper module.- Parameters:
moduleSelector- either the name of a module or the number of a module- Returns:
-
start_osgi
public String start_osgi()
Starts the OSGi environment.
-
stop_osgi
public String stop_osgi()
Stops the OSGi environment.
-
clean
public String clean()
Cleans the current Pepper instance and especially removes the OSGi workspace, to set up a new one.- Returns:
-
debug
public String debug()
Switches on/off the debug mode.- Returns:
-
osgi
public String osgi()
Opens the OSGi console via anOSGiConsoleobject and delegates to it.
-
convert
public void convert(String workFlowPath)
Loads the passed workflow description file and starts the conversion.- Parameters:
workFlowPath-
-
installAndStart
public String installAndStart(List<String> params)
Installs and starts a new Pepper module(s).
-
selfTest
@Deprecated public String selfTest()
Deprecated.CallsPepperModule.isReadyToStart()for all Pepper modules.- Returns:
-
fitness
public String fitness()
Returns a fitness report as a String. This report contains a fitness value for each module and if a module is not fit, the report is expanded for a detailed report containing one value for each fitness feature.- Returns:
- fitness report
-
conf
public String conf()
- Returns:
- a String containing all Pepper configurations formatted as table
-
runInteractive
public void runInteractive()
Starts the interactive console of Pepper.
-
getVersion
public static String getVersion()
Resolves the current Pepper version from a file named version.properties in the pepper-lib jar file.- Returns:
- the current Pepper version
-
-