Interface ValidationRule<T>
- Type Parameters:
T- The manifest type this rule validates
- All Known Implementing Classes:
ActivitiesRequiredRule,CourseRequiredRule,CourseRequiredRule,DefaultOrganizationValidRule,DefaultOrganizationValidRule,DuplicateIdentifierRule,LaunchableResourceRequiredRule,LaunchUrlRequiredRule,LaunchUrlRequiredRule,LaunchUrlRequiredRule,ManifestIdentifierRequiredRule,OrganizationsRequiredRule,OrganizationsRequiredRule,OrphanedResourcesRule,PathSecurityRule,ResourceHrefRequiredRule,ResourceHrefRequiredRule,ResourceReferenceValidRule,ResourceReferenceValidRule,ResourcesRequiredRule,Scorm2004DuplicateIdentifierRule,Scorm2004OrphanedResourcesRule,Scorm2004PathSecurityRule,TitleRequiredRule,TitleRequiredRule
public interface ValidationRule<T>
Interface for individual validation rules that can be composed together. Each rule encapsulates a
single validation concern with spec traceability.
Rules are designed to be:
- Testable - each rule can be tested independently
- Reusable - common rules can be shared across validators
- Traceable - each rule references the specification it enforces
- Composable - rules are combined in validators via merge()
-
Method Summary
Modifier and TypeMethodDescriptionHuman-readable name of this rule for logging and debugging.Specification reference for traceability and documentation.Validates the manifest according to this rule.
-
Method Details
-
validate
Validates the manifest according to this rule.- Parameters:
manifest- The manifest to validate (must not be null)- Returns:
- ValidationResult with any issues found (never null)
- Throws:
IllegalArgumentException- if manifest is null
-
getRuleName
String getRuleName()Human-readable name of this rule for logging and debugging.- Returns:
- Rule name (e.g., "Resource Reference Validation")
-
getSpecReference
String getSpecReference()Specification reference for traceability and documentation. Used to trace validation back to spec requirements.- Returns:
- Spec reference (e.g., "SCORM 1.2 CAM Section 2.3.4")
-