View Javadoc

1   /*
2    * Copyright 2008 FatWire Corporation. All Rights Reserved.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *    http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package com.fatwire.gst.foundation.facade.runtag.render;
18  
19  import java.util.Locale;
20  
21  public class CallElement extends TagRunnerWithRenderArguments {
22  
23      public static final String SCOPE_GLOBAL = "global";
24      public static final String SCOPE_LOCAL = "local";
25      public static final String SCOPE_STACKED = "stacked";
26  
27      public enum Scope {
28          GLOBAL, LOCAL, STACKED;
29          private final String v;
30  
31          Scope() {
32              v = name().toLowerCase(Locale.ENGLISH);
33          }
34  
35          /*
36           * (non-Javadoc)
37           * 
38           * @see java.lang.Enum#toString()
39           */
40          @Override
41          public String toString() {
42              return v;
43          }
44  
45      }
46  
47      public CallElement() {
48          super("RENDER.CALLELEMENT");
49      }
50  
51      public CallElement(final String element) {
52          super("RENDER.CALLELEMENT");
53          this.setElementName(element);
54      }
55  
56      public void setElementName(final String element) {
57          this.set("ELEMENTNAME", element);
58      }
59  
60      public void setScope(final String scope) {
61          this.set("SCOPED", scope);
62      }
63  
64      public void setScope(final Scope scope) {
65          this.set("SCOPE", scope.toString());
66      }
67  
68  }