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