01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright
03: * notice. All rights reserved.
04: */
05: package com.tc.config.schema.test;
06:
07: import com.tc.config.schema.builder.WebApplicationConfigBuilder;
08:
09: import java.util.HashMap;
10: import java.util.Map;
11:
12: /**
13: * Used to create a web-application config element.
14: */
15: public class WebApplicationConfigBuilderImpl extends BaseConfigBuilder
16: implements WebApplicationConfigBuilder {
17:
18: private static final String TAG_NAME = "web-application";
19: private static final String ATTRIBUTE_NAME = "synchronous-write";
20:
21: private Map attributes;
22:
23: public WebApplicationConfigBuilderImpl() {
24: super (5, new String[] { TAG_NAME });
25: attributes = new HashMap();
26: }
27:
28: public void setWebApplicationName(String name) {
29: setProperty(TAG_NAME, name);
30: }
31:
32: public void setWebApplicationAttributes(Map attributes) {
33: this .attributes.putAll(attributes);
34: }
35:
36: public String toString() {
37: return openElement(TAG_NAME, attributes)
38: + propertyAsString(TAG_NAME) + closeElement(TAG_NAME);
39: }
40:
41: }
|