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 AiccMetadataextractMetadata(AiccManifest manifest, ValidationResult validation) Extracts metadata from a parsed and validated manifest.protected Class<AiccManifest>Returns the class type representing the AICC manifest.protected StringAbstract method to return the filename of the manifest for the specific parser.Parses the AICC manifest and returns an instance of AiccManifest.parseManifest(String manifestPath) Overrides base class parseManifest to ignore the filename parameter since AICC parsing requires multiple files (.crs, .des, .au, .cst).protected ValidationResultvalidateManifest(AiccManifest manifest) Validates a parsed manifest and returns validation results.Methods inherited from class dev.jcputney.elearning.parser.parsers.BaseParser
checkForXapi, getModuleType, getOptions, loadExternalMetadataIntoMetadata, parseAndValidate, parseOnly, 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
-
parseManifest
public AiccManifest parseManifest(String manifestPath) throws IOException, XMLStreamException, ManifestParseException Overrides base class parseManifest to ignore the filename parameter since AICC parsing requires multiple files (.crs, .des, .au, .cst).- Overrides:
parseManifestin classBaseParser<AiccMetadata,AiccManifest> - Parameters:
manifestPath- Ignored for AICC (uses multiple files)- Returns:
- An instance of AiccManifest containing parsed data
- Throws:
IOException- If an error occurs while reading filesXMLStreamException- Not thrown by AICC parserManifestParseException- If an error occurs while parsing the manifest
-
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.
-
validateManifest
Description copied from class:BaseParserValidates a parsed manifest and returns validation results. Subclasses implement this to use their parser-specific validators.- Specified by:
validateManifestin classBaseParser<AiccMetadata,AiccManifest> - Parameters:
manifest- The parsed manifest to validate- Returns:
- ValidationResult containing any errors or warnings
-
extractMetadata
protected AiccMetadata extractMetadata(AiccManifest manifest, ValidationResult validation) throws ModuleException Description copied from class:BaseParserExtracts metadata from a parsed and validated manifest.- Specified by:
extractMetadatain classBaseParser<AiccMetadata,AiccManifest> - Parameters:
manifest- The parsed manifestvalidation- The validation result (for reference during extraction)- Returns:
- Module-specific metadata
- Throws:
ModuleException- if metadata extraction fails
-
getManifestFileName
Description copied from class:BaseParserAbstract method to return the filename of the manifest for the specific parser.- Specified by:
getManifestFileNamein classBaseParser<AiccMetadata,AiccManifest> - Returns:
- The manifest filename (e.g., "imsmanifest.xml", "cmi5.xml")
-
getManifestClass
Returns the class type representing the AICC manifest.- Specified by:
getManifestClassin classBaseParser<AiccMetadata,AiccManifest> - Returns:
- The class type
AiccManifest.class.
-