AbstractParser
paramsan
AbstractParser: Represents the abstract interface for any parser object which parses weekly specials from a store.This class is only supposed to be used as a base/parent class for a "specific" parser.
use AbstractParser;
Perl5.10.0
Nothing
AbstractParser represents an abstract interface that any class implementing parsing weekly specials should inherit from in the project. As such, the child class should implement any abstract methods below, in particular GetSpecials
("GetSpecials").
Also see AbstractParserFactory on how to construct concrete Parser objects.
Used to set all verbose level for the parser, that is, all pertinent information, errors, warning, informational messages will be printed.
Used to set none verbose level for the parser, that is only errors (printed) are that will cause the module to die()..
Creates and returns an AbstractParser. For internal use only, an AbstractParser object is not supposed to be constructed.
None
A reference to an AbstractParser
The subclasses are supposed to implement this method.
$zipCode: Zipcode for which to retrieve the specials for.
This method should return A reference to an array of Specials in the following format,
[ [ItemName, ItemPrice], [ItemName, ItemPrice] ... ];
This is an abstract method and currently calls die() with the error messsage: "Abstract method GetSpecials not implemented\n"
$specialRef = $abstractParser->GetSpecials();
Returns the store name that this parser will parse specials for.
None
The storename as a string.
$storeName = $abstractParser->GetStoreName();
Returns the current verbosity level for the parser
None
The verbosity level. See "Class Variables" for the different verbosity values.
$verbosityLevel = $abstractParser->GetVerbosityLevel();
Sets the verbosity level for the parser.
$verbosityLevel The verbosity level. See "Class Variables" for the different verbosity values.
Nothing
$abstractParser->SetVerbosityLevel($AbstractParser::VERBOSITY_ALL);
Sets the store name for this parser. This is an internal method and to be used by the children classes.
$storeName: The store name.
Nothing
$abstractParser->_SetStoreName($storeName);