KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > sun > share > configbean > customizers > webapp > ScopeMapping


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 /*
20  * ScopeMapping.java
21  *
22  * Created on February 4, 2004, 10:45 AM
23  */

24
25 package org.netbeans.modules.j2ee.sun.share.configbean.customizers.webapp;
26
27 import java.util.ResourceBundle JavaDoc;
28
29 import org.netbeans.modules.j2ee.sun.share.configbean.customizers.common.TextMapping;
30
31 /**
32  *
33  * @author Peter Williams
34  */

35 public final class ScopeMapping {
36     
37     /** Creates a new instance of ScopeMapping */
38     private ScopeMapping() {
39         // No instances of this class. It's a holder for a static list of
40
// TextMapping objects that represent various request scopes.
41
}
42     
43     /** resource bundle */
44     static final ResourceBundle JavaDoc webappBundle = ResourceBundle.getBundle(
45         "org.netbeans.modules.j2ee.sun.share.configbean.customizers.webapp.Bundle"); // NOI18N
46

47     // http scopes
48
private static final TextMapping scopeBlank =
49         new TextMapping("", ""); // NOI18N
50
private static final TextMapping scopeContextAttribute =
51         new TextMapping("context.attribute", webappBundle.getString("SCOPE_CONTEXT_ATTRIBUTE")); // NOI18N
52
private static final TextMapping scopeRequestHeader =
53         new TextMapping("request.header", webappBundle.getString("SCOPE_REQUEST_HEADER")); // NOI18N
54
private static final TextMapping scopeRequestParameter =
55         new TextMapping("request.parameter", webappBundle.getString("SCOPE_REQUEST_PARAMETER")); // NOI18N
56
private static final TextMapping scopeRequestCookie =
57         new TextMapping("request.cookie", webappBundle.getString("SCOPE_REQUEST_COOKIE")); // NOI18N
58
private static final TextMapping scopeRequestAttribute =
59         new TextMapping("request.attribute", webappBundle.getString("SCOPE_REQUEST_ATTRIBUTE")); // NOI18N
60
private static final TextMapping scopeSessionAttribute =
61         new TextMapping("session.attribute", webappBundle.getString("SCOPE_SESSION_ATTRIBUTE")); // NOI18N
62
private static final TextMapping scopeSessionId =
63         new TextMapping("session.id", webappBundle.getString("SCOPE_SESSION_ID")); // NOI18N
64

65     // match expressions
66
private static final TextMapping matchEquals =
67         new TextMapping("equals", webappBundle.getString("EXPR_EQUALS")); // NOI18N
68
private static final TextMapping matchGreater =
69         new TextMapping("greater", webappBundle.getString("EXPR_GREATER")); // NOI18N
70
private static final TextMapping matchLesser =
71         new TextMapping("lesser", webappBundle.getString("EXPR_LESSER")); // NOI18N
72
private static final TextMapping matchNotEquals =
73         new TextMapping("not-equals", webappBundle.getString("EXPR_NOT_EQUALS")); // NOI18N
74
private static final TextMapping matchInRange =
75         new TextMapping("in-range", webappBundle.getString("EXPR_IN_RANGE")); // NOI18N
76

77     /** xml <--> ui mapping for timeout scopes combo box */
78     private static final TextMapping [] scopeTypes = {
79         scopeBlank,
80         scopeContextAttribute,
81         scopeRequestHeader, scopeRequestParameter, scopeRequestCookie, scopeRequestAttribute,
82         scopeSessionAttribute,
83     };
84     
85     /** xml <--> ui mapping for refresh field scopes combo box */
86     private static final TextMapping [] keyScopeTypes = {
87         scopeBlank,
88         scopeContextAttribute,
89         scopeRequestHeader, scopeRequestParameter, scopeRequestCookie,
90         scopeSessionId, scopeSessionAttribute,
91     };
92
93     /** xml <--> ui mapping for match expresssions combo box */
94     private static final TextMapping [] matchExpressions = {
95         matchEquals, matchGreater, matchLesser, matchNotEquals, matchInRange,
96     };
97
98     /** Retrieves array associated with %scope ENTITY type from sun-web.dtd
99      * @return Array of TextMappings for the %scope field
100      */

101     public static TextMapping [] getScopeMappings() {
102         return scopeTypes;
103     }
104     
105     /** Retrieves array associated with %keyscope ENTITY type from sun-web.dtd
106      * @return Array of TextMappings for the %keyscope field
107      */

108     public static TextMapping [] getKeyScopeMappings() {
109         return keyScopeTypes;
110     }
111     
112     /** Retrieves array associated with %expr ENTITY type from sun-web.dtd
113      * @return Array of TextMappings for the %expr field
114      */

115     public static TextMapping [] getMatchExpressionMappings() {
116         return matchExpressions;
117     }
118     
119 }
120
Popular Tags