1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package com.helger.schematron.pure.validation;
18
19 import javax.annotation.Nonnull;
20 import javax.annotation.Nullable;
21 import javax.annotation.concurrent.NotThreadSafe;
22
23 import org.w3c.dom.Node;
24
25 import com.helger.commons.state.EContinue;
26 import com.helger.commons.state.EValidity;
27 import com.helger.schematron.pure.model.PSAssertReport;
28
29
30
31
32
33
34
35
36 @NotThreadSafe
37 public class PSValidationHandlerBreakOnFirstFailedAssert implements IPSPartialValidationHandler
38 {
39 private EValidity m_eValidity = EValidity.VALID;
40
41 @Override
42 @Nonnull
43 public EContinue onFailedAssert (@Nonnull final PSAssertReport aAssertReport,
44 @Nonnull final String sTestExpression,
45 @Nonnull final Node aRuleMatchingNode,
46 final int nNodeIndex,
47 @Nullable final Object aContext)
48 {
49 m_eValidity = EValidity.INVALID;
50 return EContinue.BREAK;
51 }
52
53
54
55
56
57
58 @Override
59 @Nonnull
60 public EValidity getValidity ()
61 {
62 return m_eValidity;
63 }
64 }