KickJava   Java API By Example, From Geeks To Geeks.

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


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

5 package com.tc.config.schema.test;
6
7 import com.tc.config.schema.builder.WebApplicationConfigBuilder;
8
9 import java.util.HashMap JavaDoc;
10 import java.util.Map JavaDoc;
11
12 /**
13  * Used to create a web-application config element.
14  */

15 public class WebApplicationConfigBuilderImpl extends BaseConfigBuilder implements WebApplicationConfigBuilder {
16
17   private static final String JavaDoc TAG_NAME = "web-application";
18   private static final String JavaDoc ATTRIBUTE_NAME = "synchronous-write";
19
20   private Map JavaDoc attributes;
21
22   public WebApplicationConfigBuilderImpl() {
23     super(5, new String JavaDoc[] { TAG_NAME });
24     attributes = new HashMap JavaDoc();
25   }
26
27   public void setWebApplicationName(String JavaDoc name) {
28     setProperty(TAG_NAME, name);
29   }
30
31   public void setWebApplicationAttributes(Map JavaDoc attributes) {
32     this.attributes.putAll(attributes);
33   }
34
35   public String JavaDoc toString() {
36     return openElement(TAG_NAME, attributes) + propertyAsString(TAG_NAME) + closeElement(TAG_NAME);
37   }
38
39 }
40
Popular Tags