Abstract plugin class for different parsers.
The JobDescriptionParserPlugin class is abstract which provide an interface for job description parsers. A job description parser should inherit this class and overwrite the JobDescriptionParserPlugin::Parse and JobDescriptionParserPlugin::UnParse methods. The inheriating class should add the job description languages that it supports to the 'supportedLanguages' member, formatted according to the GLUE2 JobDescription_t type (GFD-R-P.147). The created job description parser will then be available to the JobDescription::Parse, JobDescription::ParseFromFile and JobDescription::Assemble methods, adding the ability to parse and assemble job descriptions in the specified languages.
Using the methods in JobDescription class for parsing job descriptions is recommended, however it is also possible to use parser plugins directly, which can be done by loading them using the JobDescriptionParserPluginLoader class.
Since this class inheriates from the Plugin class, inheriating classes should be compiled as a loadable module. See xxx for information on creating loadable modules for ARC.
Parse string into JobDescription objects.
Parses the string argument source
into JobDescription objects. If the language
argument is specified the method will only parse the string if it supports that language - a JobDescriptionParserPluginResult object with status WrongLanguage is returned if language is not supported. Similar for the dialect
argument, if specified, string is only parsed if that dialect is known by parser. If the language
argument is not specified an attempt at parsing source
using any of the supported languages is tried. If parsing is successful the generated JobDescription objects is appended to the jobdescs
argument. If parsing is unsuccessful the jobdescs
argument is untouched, and details of the failure is returned.
Inheriating classes must extend this method. The extended method should parse the source
argument string into a JobDescription object, possibly into multiple objects. Some languages can contain multiple alternative views, in such cases alternatives should be added using the JobDescription::AddAlternative method. Only if parsing is successful should the generated JobDescription objects be added to the jobdescs
argument. Note: The only allowed modification of the jobdescs
list is adding elements. If the language
argument is specified parsing should only be initiated if the specified language is among the supported ones, if that is not the case WrongLanguage should be returned. If the language
argument For some languages different dialects exist (e.g. user- and GM- side xRSL), and if the dialect
argument is specified the parsing must strictly conform to that dialect. If the dialect is unknown WrongLanguage should be returned.
- Parameters
-
source | should contain a representation of job description as a string. |
jobdescs | a reference to a list of JobDescription object which parsed job descriptions should be appended to. |
language | if specified parse in specified language (if not supported WrongLanguage is returned). |
dialect | if specified parsing conforms strictly to specified dialect. |
- Returns
- A JobDescriptionParserPluginResult is returned indicating outcome of parsing.
- See also
- JobDescriptionParserPlugin::Assemble
-
JobDescriptionParserPluginResult