01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.config.schema.test;
05:
06: /**
07: * Allows you to build valid config for a parameter expansion entry. This class <strong>MUST NOT</strong> invoke the
08: * actual XML beans to do its work; one of its purposes is, in fact, to test that those beans are set up correctly.
09: */
10: public class ParameterExpansionConfigBuilder extends BaseConfigBuilder {
11:
12: private final String matchType;
13: private final String expandParameters;
14: private final String query;
15:
16: public static final String MATCH_TYPE_EXACT = "exact";
17: public static final String MATCH_TYPE_REGEX = "regex";
18:
19: public ParameterExpansionConfigBuilder(String matchType,
20: String expandParameters, String query) {
21: super (5, new String[0]);
22:
23: this .matchType = matchType;
24: this .expandParameters = expandParameters;
25: this .query = query;
26: }
27:
28: public String toString() {
29: String out = indent() + "<parameter-expansion";
30: if (this .matchType != null)
31: out += " match-type=\"" + this .matchType + "\"";
32: if (this .expandParameters != null)
33: out += " expand-parameters-in-positions=\""
34: + this .expandParameters + "\"";
35: out += ">";
36: if (this .query != null)
37: out += this .query;
38: out += "</parameter-expansion>\n";
39:
40: return out;
41: }
42:
43: }
|