Class PackageStringParser


  • public class PackageStringParser
    extends StringParser
    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:
    StringParser, Package
    • Constructor Detail

      • PackageStringParser

        public PackageStringParser()
        Deprecated.
        Use getParser() or, even better, JSAP.PACKAGE_PARSER.
        Creates a new PackageStringParser
    • Method Detail

      • parse

        public java.lang.Object parse​(java.lang.String arg)
                               throws ParseException
        Parses the specified argument into a Package object. This method delegates the parsing to Package.getPackage(String), and returns the resulting Package object. If Package.getPackage() returns null, a ParseException is thrown.
        Specified by:
        parse in class StringParser
        Parameters:
        arg - the argument to parse
        Returns:
        a Package object representing the specified package.
        Throws:
        ParseException - if Package.getPackage(arg) returns null.
        See Also:
        Package, StringParser.parse(String)