@@ -130,9 +130,10 @@ public void setResources(Resource... resources) {
130
130
* Properties. Depending on the {@link #setResolutionMethod(ResolutionMethod)} not all
131
131
* of the documents will be parsed.
132
132
* @param callback a callback to delegate to once matching documents are found
133
+ * @see #createYaml()
133
134
*/
134
135
protected void process (MatchCallback callback ) {
135
- Yaml yaml = new Yaml ( new StrictMapAppenderConstructor () );
136
+ Yaml yaml = createYaml ( );
136
137
for (Resource resource : this .resources ) {
137
138
boolean found = process (callback , yaml , resource );
138
139
if (this .resolutionMethod == ResolutionMethod .FIRST_FOUND && found ) {
@@ -141,6 +142,13 @@ protected void process(MatchCallback callback) {
141
142
}
142
143
}
143
144
145
+ /**
146
+ * Create the {@link Yaml} instance to use.
147
+ */
148
+ protected Yaml createYaml () {
149
+ return new Yaml (new StrictMapAppenderConstructor ());
150
+ }
151
+
144
152
private boolean process (MatchCallback callback , Yaml yaml , Resource resource ) {
145
153
int count = 0 ;
146
154
try {
@@ -331,7 +339,7 @@ public interface DocumentMatcher {
331
339
/**
332
340
* Status returned from {@link DocumentMatcher#matches(java.util.Properties)}
333
341
*/
334
- public static enum MatchStatus {
342
+ public enum MatchStatus {
335
343
336
344
/**
337
345
* A match was found.
@@ -360,7 +368,7 @@ public static MatchStatus getMostSpecific(MatchStatus a, MatchStatus b) {
360
368
/**
361
369
* Method to use for resolving resources.
362
370
*/
363
- public static enum ResolutionMethod {
371
+ public enum ResolutionMethod {
364
372
365
373
/**
366
374
* Replace values from earlier in the list.
@@ -382,7 +390,7 @@ public static enum ResolutionMethod {
382
390
/**
383
391
* A specialized {@link Constructor} that checks for duplicate keys.
384
392
*/
385
- private static class StrictMapAppenderConstructor extends Constructor {
393
+ protected static class StrictMapAppenderConstructor extends Constructor {
386
394
387
395
public StrictMapAppenderConstructor () {
388
396
super ();
0 commit comments