Class PackageStringParser
java.lang.Object
com.martiansoftware.jsap.StringParser
com.martiansoftware.jsap.stringparsers.PackageStringParser
A
StringParser for parsing Packages. The parse() method delegates the actual
parsing to Package.getPackage(String), and returns the resulting
Package object.
If Package.getPackage() returns null, a ParseException is
thrown.- Author:
- Marty Lamb
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PackageStringParserReturns aPackageStringParser.Parses the specified argument into a Package object.Methods inherited from class StringParser
setUp, tearDown
-
Constructor Details
-
PackageStringParser
public PackageStringParser()Deprecated.UsegetParser()or, even better,JSAP.PACKAGE_PARSER.Creates a new PackageStringParser
-
-
Method Details
-
getParser
Returns aPackageStringParser.Convenient access to the only instance returned by this method is available through
JSAP.PACKAGE_PARSER.- Returns:
- a
PackageStringParser.
-
parse
Parses the specified argument into a Package object. This method delegates the parsing toPackage.getPackage(String), and returns the resulting Package object. IfPackage.getPackage()returns null, a ParseException is thrown.- Specified by:
parsein classStringParser- Parameters:
arg- the argument to parse- Returns:
- a Package object representing the specified package.
- Throws:
ParseException- ifPackage.getPackage(arg)returns null.- See Also:
-
getParser()or, even better,JSAP.PACKAGE_PARSER.