KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > tool > codegen > internal > AppReplacementSet


1
2 /*
3  * Enhydra Java Application Server Project
4  *
5  * The contents of this file are subject to the Enhydra Public License
6  * Version 1.1 (the "License"); you may not use this file except in
7  * compliance with the License. You may obtain a copy of the License on
8  * the Enhydra web site ( http://www.enhydra.org/ ).
9  *
10  * Software distributed under the License is distributed on an "AS IS"
11  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
12  * the License for the specific terms governing rights and limitations
13  * under the License.
14  *
15  * The Initial Developer of the Enhydra Application Server is Lutris
16  * Technologies, Inc. The Enhydra Application Server and portions created
17  * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
18  * All Rights Reserved.
19  *
20  * Contributor(s):
21  * Paul Mahar
22  *
23  */

24 package org.enhydra.tool.codegen.internal;
25 //
26
import org.enhydra.tool.codegen.Constants;
27 import org.enhydra.tool.codegen.ProjectReplacementSet;
28 import org.enhydra.tool.common.ReplacementSet;
29 import org.enhydra.tool.common.Replacement;
30 import org.enhydra.tool.common.ToolException;
31 //
32

33 /**
34  * This class instantiates a set of default Replacements during
35  * initialization.
36  */

37 public class AppReplacementSet extends ProjectReplacementSet implements Constants {
38
39
40     /**
41      * Replacement key for the client type
42      */

43     public static final String JavaDoc CLIENT = "@CLIENT@"; // nores
44
/**
45      * Replacement key for the content type
46      */

47     public static final String JavaDoc CONTENT_TYPE = "@CONTENT_TYPE@"; // nores
48
/**
49      * Replacement key for the application class (proper case)
50      */

51     public static final String JavaDoc APP = "at_APP_at"; // nores
52

53
54     /**
55      * Create a default set of replacement operations. This is a convenience
56      * class that can be used as the basis for building custom replacement
57      * set within a generator.
58      */

59     public AppReplacementSet() {
60         super();
61         try {
62             this.add(new Replacement(AppReplacementSet.CLIENT,
63                                      TYPE_HTML.toUpperCase()));
64             this.add(new Replacement(AppReplacementSet.CONTENT_TYPE,
65                                      CONTENT_HTML));
66             this.add(new Replacement(AppReplacementSet.APP,
67                                      APP));
68
69         } catch (ToolException e) {
70             e.printStackTrace();
71         }
72     }
73
74 }
75
Popular Tags