Class AiccParser
java.lang.Object
dev.jcputney.elearning.parser.parsers.BaseParser<AiccMetadata,AiccManifest>
dev.jcputney.elearning.parser.parsers.AiccParser
- All Implemented Interfaces:
ModuleParser<AiccManifest>
Parses AICC (Aviation Industry CBT Committee) eLearning modules by handling both INI-style and
CSV-style files with specific extensions such as .crs, .des, .au, .cst, .ort, and .pre.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe file extension for the AICC assignable unit file.static final StringThe file extension for the AICC course file.static final StringThe file extension for the AICC course structure file.static final StringThe file extension for the AICC descriptor file.static final StringThe file extension for the AICC objectives relation table file.static final StringThe file extension for the AICC prerequisites file.Fields inherited from class dev.jcputney.elearning.parser.parsers.BaseParser
moduleFileProvider, options, XAPI_JS_FILE, XAPI_SEND_STATEMENT_FILE -
Constructor Summary
ConstructorsConstructorDescriptionAiccParser(FileAccess fileAccess) Default constructor for the AiccParser class.AiccParser(FileAccess fileAccess, ParserOptions options) Constructs an AiccParser with the specified FileAccess instance and parser options.AiccParser(ModuleFileProvider moduleFileProvider) Constructs an AiccParser with the specified ModuleFileProvider instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected Class<AiccManifest>Returns the class type representing the AICC manifest.parse()Parses the AICC module components and generates corresponding metadata.Parses the AICC manifest and returns an instance of AiccManifest.validate()Validates the AICC module without fully parsing it.Methods inherited from class dev.jcputney.elearning.parser.parsers.BaseParser
checkForXapi, getOptions, loadExternalMetadataIntoMetadata, parseManifest, parseXmlToObject
-
Field Details
-
CRS_EXTENSION
The file extension for the AICC course file.- See Also:
-
DES_EXTENSION
The file extension for the AICC descriptor file.- See Also:
-
AU_EXTENSION
The file extension for the AICC assignable unit file.- See Also:
-
CST_EXTENSION
The file extension for the AICC course structure file.- See Also:
-
ORT_EXTENSION
The file extension for the AICC objectives relation table file.- See Also:
-
PRE_EXTENSION
The file extension for the AICC prerequisites file.- See Also:
-
-
Constructor Details
-
AiccParser
Default constructor for the AiccParser class.- Parameters:
fileAccess- An instance of FileAccess for reading files.
-
AiccParser
Constructs an AiccParser with the specified FileAccess instance and parser options.- Parameters:
fileAccess- An instance of FileAccess for reading files.options- The parser options to control validation and calculation behavior.
-
AiccParser
Constructs an AiccParser with the specified ModuleFileProvider instance.- Parameters:
moduleFileProvider- An instance of ModuleFileProvider for reading files in the module package.
-
-
Method Details
-
validate
Validates the AICC module without fully parsing it. This method provides efficient validation by only parsing the manifest files and running structural validation checks.- Specified by:
validatein interfaceModuleParser<AiccManifest>- Overrides:
validatein classBaseParser<AiccMetadata,AiccManifest> - Returns:
- ValidationResult containing any errors or warnings found
-
parse
Parses the AICC module components and generates corresponding metadata. This method validates the presence of required data, such as title and launch URL, in the AICC module's course file, and constructs anAiccMetadatainstance based on parsed information.- Specified by:
parsein interfaceModuleParser<AiccManifest>- Specified by:
parsein classBaseParser<AiccMetadata,AiccManifest> - Returns:
- An instance of
AiccMetadatacontaining the parsed metadata for the AICC module. - Throws:
ModuleParsingException- If the module is missing required data, files, or an unexpected error occurs.ModuleException- If the module type can't be determined or there's an error parsing.
-
parseManifest
public AiccManifest parseManifest() throws IOException, ModuleParsingException, ManifestParseExceptionParses the AICC manifest and returns an instance of AiccManifest.- Returns:
- An instance of AiccManifest containing parsed data.
- Throws:
IOException- If an error occurs while reading files.ModuleParsingException- If an error occurs during parsing.ManifestParseException- If an error occurs while parsing the manifest.
-
getManifestClass
Returns the class type representing the AICC manifest.- Specified by:
getManifestClassin classBaseParser<AiccMetadata,AiccManifest> - Returns:
- The class type
AiccManifest.class.
-