1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package com.helger.schematron.pure.bound.xpath;
18
19 import java.util.List;
20
21 import javax.annotation.Nonnull;
22 import javax.annotation.concurrent.Immutable;
23 import javax.xml.xpath.XPathExpression;
24
25 import com.helger.commons.ValueEnforcer;
26 import com.helger.commons.annotation.ReturnsMutableCopy;
27 import com.helger.commons.collection.CollectionHelper;
28 import com.helger.commons.string.ToStringGenerator;
29 import com.helger.schematron.pure.model.PSRule;
30
31
32
33
34
35
36 @Immutable
37 public class PSXPathBoundRule
38 {
39 private final PSRule m_aRule;
40 private final String m_sRuleExpression;
41 private final XPathExpression m_aBoundRuleExpression;
42 private final List <PSXPathBoundAssertReport> m_aBoundAssertReports;
43
44 public PSXPathBoundRule (@Nonnull final PSRule aRule,
45 @Nonnull final String sRuleExpression,
46 @Nonnull final XPathExpression aBoundRuleExpression,
47 @Nonnull final List <PSXPathBoundAssertReport> aBoundAssertReports)
48 {
49 ValueEnforcer.notNull (aRule, "Rule");
50 ValueEnforcer.notEmpty (sRuleExpression, "RuleExpression");
51 ValueEnforcer.notNull (aBoundRuleExpression, "BoundRuleExpression");
52 ValueEnforcer.notNull (aBoundAssertReports, "BoundAssertReports");
53 m_aRule = aRule;
54 m_sRuleExpression = sRuleExpression;
55 m_aBoundRuleExpression = aBoundRuleExpression;
56 m_aBoundAssertReports = aBoundAssertReports;
57 }
58
59 @Nonnull
60 public PSRule getRule ()
61 {
62 return m_aRule;
63 }
64
65 @Nonnull
66 public String getRuleExpression ()
67 {
68 return m_sRuleExpression;
69 }
70
71 @Nonnull
72 public XPathExpression getBoundRuleExpression ()
73 {
74 return m_aBoundRuleExpression;
75 }
76
77 @Nonnull
78 @ReturnsMutableCopy
79 public List <PSXPathBoundAssertReport> getAllBoundAssertReports ()
80 {
81 return CollectionHelper.newList (m_aBoundAssertReports);
82 }
83
84 @Override
85 public String toString ()
86 {
87 return new ToStringGenerator (this).append ("rule", m_aRule)
88 .append ("ruleExpression", m_sRuleExpression)
89 .append ("boundRuleExpression", m_aBoundRuleExpression)
90 .append ("boundAssertReports", m_aBoundAssertReports)
91 .toString ();
92 }
93 }