1 package com.helger.schematron;
2
3 import java.io.File;
4 import java.util.concurrent.atomic.AtomicBoolean;
5
6 import javax.annotation.Nonnull;
7 import javax.annotation.concurrent.ThreadSafe;
8
9 import com.helger.commons.ValueEnforcer;
10
11
12
13
14
15
16
17 @ThreadSafe
18 public final class SchematronDebug
19 {
20 private static final AtomicBoolean s_bSaveIntermediateXSLTFiles = new AtomicBoolean (false);
21 private static File s_aIntermediateMinifiedSCHFolder = new File ("test-minified");
22 private static File s_aIntermediateFinalXSLTFolder = new File ("test-final");
23 private static final AtomicBoolean s_aShowCreatedXSLT = new AtomicBoolean (false);
24 private static final AtomicBoolean s_aShowCreatedSVRL = new AtomicBoolean (false);
25 private static final AtomicBoolean s_aShowPreprocessedSchematron = new AtomicBoolean (false);
26 private static final AtomicBoolean s_aShowResolvedSourceSchematron = new AtomicBoolean (false);
27
28 private SchematronDebug ()
29 {}
30
31
32
33
34
35
36
37
38
39
40
41
42
43 public static void setDebugMode (final boolean bDebugMode)
44 {
45 setSaveIntermediateXSLTFiles (bDebugMode);
46 setShowCreatedXSLT (bDebugMode);
47 setShowCreatedSVRL (bDebugMode);
48 setShowResolvedSourceSchematron (bDebugMode);
49 setShowPreprocessedSchematron (bDebugMode);
50 }
51
52
53
54
55
56 public static final boolean isSaveIntermediateXSLTFiles ()
57 {
58 return s_bSaveIntermediateXSLTFiles.get ();
59 }
60
61 public static final void setSaveIntermediateXSLTFiles (final boolean bSaveIntermediateFiles)
62 {
63 s_bSaveIntermediateXSLTFiles.set (bSaveIntermediateFiles);
64 }
65
66
67
68
69
70
71 @Nonnull
72 public static final File getIntermediateMinifiedSCHFolder ()
73 {
74 return s_aIntermediateMinifiedSCHFolder;
75 }
76
77 public static final void setIntermediateMinifiedSCHFolder (@Nonnull final File aIntermediateMinifiedSCHFolder)
78 {
79 ValueEnforcer.notNull (aIntermediateMinifiedSCHFolder, "IntermediateMinifiedSCHFolder");
80 s_aIntermediateMinifiedSCHFolder = aIntermediateMinifiedSCHFolder;
81 }
82
83
84
85
86
87
88 @Nonnull
89 public static final File getIntermediateFinalXSLTFolder ()
90 {
91 return s_aIntermediateFinalXSLTFolder;
92 }
93
94 public static final void setIntermediateFinalXSLTFolder (@Nonnull final File aIntermediateFinalXSLTFolder)
95 {
96 ValueEnforcer.notNull (aIntermediateFinalXSLTFolder, "IntermediateFinalXSLTFolder");
97 s_aIntermediateFinalXSLTFolder = aIntermediateFinalXSLTFolder;
98 }
99
100 public static void setShowCreatedXSLT (final boolean bShow)
101 {
102 s_aShowCreatedXSLT.set (bShow);
103 }
104
105
106
107
108
109 public static boolean isShowCreatedXSLT ()
110 {
111 return s_aShowCreatedXSLT.get ();
112 }
113
114 public static void setShowCreatedSVRL (final boolean bShow)
115 {
116 s_aShowCreatedSVRL.set (bShow);
117 }
118
119
120
121
122 public static boolean isShowCreatedSVRL ()
123 {
124 return s_aShowCreatedSVRL.get ();
125 }
126
127 public static void setShowResolvedSourceSchematron (final boolean bShow)
128 {
129 s_aShowResolvedSourceSchematron.set (bShow);
130 }
131
132
133
134
135
136 public static boolean isShowResolvedSourceSchematron ()
137 {
138 return s_aShowResolvedSourceSchematron.get ();
139 }
140
141 public static void setShowPreprocessedSchematron (final boolean bShow)
142 {
143 s_aShowPreprocessedSchematron.set (bShow);
144 }
145
146
147
148
149
150 public static boolean isShowPreprocessedSchematron ()
151 {
152 return s_aShowPreprocessedSchematron.get ();
153 }
154 }