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