|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.clapper.util.cmdline.CommandLineUtility
org.clapper.curn.Tool
public class Tool
curn: Customizable Utilitarian RSS Notifier.
curn is an RSS reader. It scans a configured set of URLs, each one representing an RSS feed, and summarizes the results in an easy-to-read text format. curn keeps track of URLs it's seen before, using an on-disk cache; when using the cache, it will suppress displaying URLs it has already reported (though that behavior can be disabled). curn can be extended to use any RSS parser; by default, it uses the ROME parser.
This class is a command-line wrapper for curn. Run it with no parameters for a usage summary.
| Method Summary | |
|---|---|
protected void |
getCustomUsageInfo(org.clapper.util.cmdline.UsageInfo info)
Called by parseParams() to get the custom command-line options and parameters handled by the subclass. |
java.lang.String |
getPlugInName()
Get a displayable name for the plug-in. |
java.lang.String |
getPlugInSortKey()
Get the sort key for this plug-in. |
void |
initPlugIn()
Initialize the plug-in. |
static void |
main(java.lang.String[] args)
|
protected void |
parseCustomOption(char shortOption,
java.lang.String longOption,
java.util.Iterator<java.lang.String> it)
Called by parseParams() to handle any option it doesn't recognize. |
protected void |
processPostOptionCommandLine(java.util.Iterator<java.lang.String> it)
Called by parseParams() once option parsing is complete, this method must handle any additional parameters on the command line. |
protected void |
runCommand()
Run the curn tool. |
void |
runPostConfigPlugIn(CurnConfig config)
Called after the entire configuration has been read and parsed, but before any feeds are processed. |
| Methods inherited from class org.clapper.util.cmdline.CommandLineUtility |
|---|
execute, parseDoubleOptionArgument, parseDoubleOptionArgument, parseDoubleParameter, parseDoubleParameter, parseFloatOptionArgument, parseFloatOptionArgument, parseFloatParameter, parseFloatParameter, parseIntOptionArgument, parseIntOptionArgument, parseIntParameter, parseIntParameter |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static void main(java.lang.String[] args)
public java.lang.String getPlugInName()
PlugIn
getPlugInName in interface PlugInpublic java.lang.String getPlugInSortKey()
PlugIn
getPlugInSortKey in interface PlugIn
public void initPlugIn()
throws CurnException
PlugIn
initPlugIn in interface PlugInCurnException - on error
public void runPostConfigPlugIn(CurnConfig config)
throws CurnException
PostConfigPlugIn
runPostConfigPlugIn in interface PostConfigPlugInconfig - the parsed CurnConfig object
CurnException - on errorCurnConfig
protected void parseCustomOption(char shortOption,
java.lang.String longOption,
java.util.Iterator<java.lang.String> it)
throws org.clapper.util.cmdline.CommandLineUsageException,
java.util.NoSuchElementException
parseCustomOption in class org.clapper.util.cmdline.CommandLineUtilityshortOption - the short option character, or
UsageInfo.NO_SHORT_OPTION if there isn't
one (i.e., if this is a long-only option).longOption - the long option string, without any leading
"-" characters, or null if this is a short-only
optionit - the Iterator for the remainder of the
command line, for extracting parameters.
org.clapper.util.cmdline.CommandLineUsageException - on error
java.util.NoSuchElementException - overran the iterator (i.e., missing
parameter)
protected void processPostOptionCommandLine(java.util.Iterator<java.lang.String> it)
throws org.clapper.util.cmdline.CommandLineUsageException,
java.util.NoSuchElementException
Called by parseParams() once option parsing is complete, this method must handle any additional parameters on the command line. It's not necessary for the method to ensure that the iterator has the right number of strings left in it. If you attempt to pull too many parameters from the iterator, it'll throw a NoSuchElementException, which parseParams() traps and converts into a suitable error message. Similarly, if there are any parameters left in the iterator when this method returns, parseParams() throws an exception indicating that there are too many parameters on the command line.
This method is called unconditionally, even if there are no parameters left on the command line, so it's a useful place to do post-option consistency checks, as well.
processPostOptionCommandLine in class org.clapper.util.cmdline.CommandLineUtilityit - the Iterator for the remainder of the
command line
org.clapper.util.cmdline.CommandLineUsageException - on error
java.util.NoSuchElementException - attempt to iterate past end of args;
parseParams() automatically
handles this exception, so it's
safe for subclass implementations of
this method not to handle itprotected void getCustomUsageInfo(org.clapper.util.cmdline.UsageInfo info)
getCustomUsageInfo in class org.clapper.util.cmdline.CommandLineUtilityinfo - The UsageInfo object to fill.
protected void runCommand()
throws org.clapper.util.cmdline.CommandLineException
runCommand in class org.clapper.util.cmdline.CommandLineUtilityorg.clapper.util.cmdline.CommandLineException - error occurred
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||