Class ParserOptions
java.lang.Object
dev.jcputney.elearning.parser.api.ParserOptions
Configuration options for module parsing behavior. Controls validation strictness and other
parsing settings.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates parser options with default settings (strict mode enabled). -
Method Summary
Modifier and TypeMethodDescriptionGets the module size calculation setting.booleanChecks if strict validation mode is enabled.static ParserOptionslenient()Creates parser options with lenient mode enabled.setCalculateModuleSize(Boolean calculate) Sets whether to calculate module size (total disk size of all files).setStrictMode(boolean strict) Sets whether to use strict validation mode.booleanChecks if module size calculation is enabled based on this options object.static ParserOptionsstrict()Creates parser options with strict mode enabled.
-
Constructor Details
-
ParserOptions
public ParserOptions()Creates parser options with default settings (strict mode enabled).
-
-
Method Details
-
strict
Creates parser options with strict mode enabled. Parsing will fail on any validation errors.- Returns:
- ParserOptions configured for strict mode
-
lenient
Creates parser options with lenient mode enabled. Parsing will continue despite validation errors.- Returns:
- ParserOptions configured for lenient mode
-
isStrictMode
public boolean isStrictMode()Checks if strict validation mode is enabled.- Returns:
- true if strict mode is enabled
-
setStrictMode
Sets whether to use strict validation mode. In strict mode, parsing fails on any validation errors. In lenient mode, parsing continues despite errors.- Parameters:
strict- true for strict mode, false for lenient- Returns:
- this ParserOptions instance for method chaining
-
getCalculateModuleSize
Gets the module size calculation setting.- Returns:
- true to enable, false to disable, null to use system default
-
setCalculateModuleSize
Sets whether to calculate module size (total disk size of all files). If not explicitly set (null), uses system property or environment variable.- Parameters:
calculate- true to enable size calculation, false to disable, null for system default- Returns:
- this ParserOptions instance for method chaining
-
shouldCalculateModuleSize
public boolean shouldCalculateModuleSize()Checks if module size calculation is enabled based on this options object. Returns the explicit setting if present, otherwise falls back to system default.- Returns:
- true if size calculation should be performed
-