KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > config > schema > test > ParameterExpansionConfigBuilder


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.config.schema.test;
5
6 /**
7  * Allows you to build valid config for a parameter expansion entry. This class <strong>MUST NOT</strong> invoke the
8  * actual XML beans to do its work; one of its purposes is, in fact, to test that those beans are set up correctly.
9  */

10 public class ParameterExpansionConfigBuilder extends BaseConfigBuilder {
11
12   private final String JavaDoc matchType;
13   private final String JavaDoc expandParameters;
14   private final String JavaDoc query;
15
16   public static final String JavaDoc MATCH_TYPE_EXACT = "exact";
17   public static final String JavaDoc MATCH_TYPE_REGEX = "regex";
18
19   public ParameterExpansionConfigBuilder(String JavaDoc matchType, String JavaDoc expandParameters, String JavaDoc query) {
20     super(5, new String JavaDoc[0]);
21
22     this.matchType = matchType;
23     this.expandParameters = expandParameters;
24     this.query = query;
25   }
26
27   public String JavaDoc toString() {
28     String JavaDoc out = indent() + "<parameter-expansion";
29     if (this.matchType != null) out += " match-type=\"" + this.matchType + "\"";
30     if (this.expandParameters != null) out += " expand-parameters-in-positions=\"" + this.expandParameters+ "\"";
31     out += ">";
32     if (this.query != null) out += this.query;
33     out += "</parameter-expansion>\n";
34
35     return out;
36   }
37
38 }
39
Popular Tags