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.Nullable;
21 import javax.annotation.concurrent.Immutable;
22 import javax.xml.xpath.XPathExpression;
23
24 import com.helger.commons.ValueEnforcer;
25 import com.helger.commons.collection.ext.ICommonsList;
26 import com.helger.commons.collection.ext.ICommonsMap;
27 import com.helger.commons.string.ToStringGenerator;
28 import com.helger.schematron.pure.model.PSAssertReport;
29
30
31
32
33
34
35 @Immutable
36 public class PSXPathBoundAssertReport
37 {
38 private final PSAssertReport m_aAssertReport;
39 private final String m_sTestExpression;
40 private final XPathExpression m_aBoundTestExpression;
41 private final ICommonsList <PSXPathBoundElement> m_aBoundContent;
42 private final ICommonsMap <String, PSXPathBoundDiagnostic> m_aBoundDiagnostics;
43
44 public PSXPathBoundAssertReport (@Nonnull final PSAssertReport aAssertReport,
45 @Nonnull final String sTestExpression,
46 @Nonnull final XPathExpression aBoundTestExpression,
47 @Nonnull final ICommonsList <PSXPathBoundElement> aBoundContent,
48 @Nonnull final ICommonsMap <String, PSXPathBoundDiagnostic> aBoundDiagnostics)
49 {
50 ValueEnforcer.notNull (aAssertReport, "AssertReport");
51 ValueEnforcer.notNull (sTestExpression, "TestExpression");
52 ValueEnforcer.notNull (aBoundTestExpression, "BoundTestExpression");
53 ValueEnforcer.notNull (aBoundContent, "BoundContent");
54 ValueEnforcer.notNull (aBoundDiagnostics, "BoundDiagnostics");
55 m_aAssertReport = aAssertReport;
56 m_sTestExpression = sTestExpression;
57 m_aBoundTestExpression = aBoundTestExpression;
58 m_aBoundContent = aBoundContent;
59 m_aBoundDiagnostics = aBoundDiagnostics;
60 }
61
62
63
64
65 @Nonnull
66 public PSAssertReport getAssertReport ()
67 {
68 return m_aAssertReport;
69 }
70
71
72
73
74
75 @Nonnull
76 public String getTestExpression ()
77 {
78 return m_sTestExpression;
79 }
80
81
82
83
84 @Nonnull
85 public XPathExpression getBoundTestExpression ()
86 {
87 return m_aBoundTestExpression;
88 }
89
90
91
92
93
94 @Nonnull
95 public ICommonsList <PSXPathBoundElement> getAllBoundContentElements ()
96 {
97 return m_aBoundContent.getClone ();
98 }
99
100
101
102
103
104
105
106
107 @Nullable
108 public PSXPathBoundDiagnostic getBoundDiagnosticOfID (@Nullable final String sID)
109 {
110 return m_aBoundDiagnostics.get (sID);
111 }
112
113 @Override
114 public String toString ()
115 {
116 return new ToStringGenerator (this).append ("assertReport", m_aAssertReport)
117 .append ("testExpression", m_sTestExpression)
118 .append ("boundTestExpression", m_aBoundTestExpression)
119 .append ("boundContent", m_aBoundContent)
120 .append ("boundDiagnostics", m_aBoundDiagnostics)
121 .getToString ();
122 }
123 }