Interface PrerequisiteExpression
- All Known Implementing Classes:
AndExpression,ItemReference,NotExpression,OrExpression,ParseError
public sealed interface PrerequisiteExpression
permits AndExpression, OrExpression, NotExpression, ItemReference, ParseError
Represents a parsed prerequisite expression in AICC script format.
SCORM 1.2 prerequisites use AICC script syntax which supports:
&- AND operator (all referenced items must be completed)|- OR operator (at least one referenced item must be completed)~- NOT operator (referenced item must NOT be completed)- Parentheses for grouping expressions
- Item identifiers referencing other items in the manifest
Example expressions:
ITEM-001- Simple reference to a single itemITEM-001 & ITEM-002- Both items must be completedITEM-001 | ITEM-002- Either item must be completed~ITEM-001- Item must NOT be completed(ITEM-001 & ITEM-002) | ITEM-003- Grouped expression
This is a sealed interface with the following implementations:
AndExpression- Represents an AND of multiple expressionsOrExpression- Represents an OR of multiple expressionsNotExpression- Represents negation of an expressionItemReference- Represents a reference to an item identifierParseError- Represents a parse error for invalid expressions
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceVisitor pattern for processing prerequisite expressions. -
Method Summary
Modifier and TypeMethodDescription<T> Taccept(PrerequisiteExpression.Visitor<T> visitor) Accepts a visitor to process this expression.
-
Method Details
-
accept
Accepts a visitor to process this expression.- Type Parameters:
T- the return type of the visitor- Parameters:
visitor- the visitor to accept- Returns:
- the result of the visitor processing this expression
-