-
Notifications
You must be signed in to change notification settings - Fork 188
/
StatementRuleContext.java
37 lines (22 loc) · 1.2 KB
/
StatementRuleContext.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package com.evolveum.axiom.lang.impl;
import java.util.Optional;
import java.util.function.Supplier;
import com.evolveum.axiom.api.AxiomIdentifier;
import com.evolveum.axiom.lang.api.AxiomBuiltIn.Item;
import com.evolveum.axiom.lang.api.AxiomItemDefinition;
import com.evolveum.axiom.lang.api.AxiomTypeDefinition;
import com.evolveum.axiom.lang.api.stmt.AxiomStatement;
public interface StatementRuleContext<V> {
<V> Optional<V> optionalChildValue(AxiomItemDefinition supertypeReference, Class<V> type);
<V> V requiredChildValue(AxiomItemDefinition supertypeReference, Class<V> type) throws AxiomSemanticException;
V requireValue() throws AxiomSemanticException;
Requirement<AxiomStatement<?>> requireGlobalItem(AxiomItemDefinition typeDefinition, AxiomIdentifier axiomIdentifier);
StatementRuleContext<V> apply(StatementRuleContext.Action<V> action);
StatementRuleContext<V> errorMessage(Supplier<RuleErrorMessage> errorFactory);
RuleErrorMessage error(String format, Object... arguments);
public interface Action<V> {
void apply(StatementContext<V> context) throws AxiomSemanticException;
}
AxiomTypeDefinition typeDefinition();
Optional<V> optionalValue();
}