View Javadoc
1   // ---------- Attention: Generated code, please do not modify! -----------  
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one or more
5    * contributor license agreements.  See the NOTICE file distributed with
6    * this work for additional information regarding copyright ownership.
7    * The ASF licenses this file to You under the Apache License, Version 2.0
8    * (the "License"); you may not use this file except in compliance with
9    * the License.  You may obtain a copy of the License at
10   *
11   *      http://www.apache.org/licenses/LICENSE-2.0
12   *
13   * Unless required by applicable law or agreed to in writing, software
14   * distributed under the License is distributed on an "AS IS" BASIS,
15   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   * See the License for the specific language governing permissions and
17   * limitations under the License.
18   */
19  
20  package org.apache.myfaces.tobago.component;
21  
22  import javax.faces.context.FacesContext;
23  import org.apache.myfaces.tobago.internal.component.AbstractUIScript;
24  import org.apache.myfaces.tobago.internal.util.ArrayUtils;
25  import org.apache.myfaces.tobago.internal.util.StringUtils;
26  import org.apache.myfaces.tobago.internal.util.Deprecation;
27  import javax.el.ELException;
28  import javax.faces.FacesException;
29  import java.util.ArrayList;
30  import java.util.List;
31  import javax.el.MethodExpression;
32  import javax.el.ValueExpression;
33  
34  /** 
35   This tag adds script files to include into the rendered page.
36    <br>
37    Some features are deprecated (because of CSP): This tag adds client side script to the rendered page.
38    * UIComponent class, generated from template {@code component.stg} with class
39    * {@link org.apache.myfaces.tobago.internal.taglib.component.ScriptTagDeclaration}.
40   */
41  public class UIScript
42      extends AbstractUIScript  {
43  
44    public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.Script";
45  
46    public static final String COMPONENT_FAMILY = "org.apache.myfaces.tobago.Script";
47  
48  
49    enum PropertyKeys {
50      file,
51      onunload,
52      onexit,
53      onsubmit,
54      script,
55      onload,
56    }
57  
58    public String getFamily() {
59      return COMPONENT_FAMILY;
60    }
61  
62  
63    /**
64    File name to include into the rendered page.
65  
66    */
67    public java.lang.String getFile() {
68      return (java.lang.String) getStateHelper().eval(PropertyKeys.file);
69    }
70  
71    public void setFile(java.lang.String file) {
72      getStateHelper().put(PropertyKeys.file, file);
73    }
74  
75    @Deprecated
76    public java.lang.String getOnunload() {
77      return (java.lang.String) getStateHelper().eval(PropertyKeys.onunload);
78    }
79  
80    @Deprecated
81    public void setOnunload(java.lang.String onunload) {
82        Deprecation.LOG.error("The attribute 'onunload' of 'UIScript' is deprecated. "
83            + "Please refer the documentation for further information.");
84      getStateHelper().put(PropertyKeys.onunload, onunload);
85    }
86  
87    @Deprecated
88    public java.lang.String getOnexit() {
89      return (java.lang.String) getStateHelper().eval(PropertyKeys.onexit);
90    }
91  
92    @Deprecated
93    public void setOnexit(java.lang.String onexit) {
94        Deprecation.LOG.error("The attribute 'onexit' of 'UIScript' is deprecated. "
95            + "Please refer the documentation for further information.");
96      getStateHelper().put(PropertyKeys.onexit, onexit);
97    }
98  
99    @Deprecated
100   public java.lang.String getOnsubmit() {
101     return (java.lang.String) getStateHelper().eval(PropertyKeys.onsubmit);
102   }
103 
104   @Deprecated
105   public void setOnsubmit(java.lang.String onsubmit) {
106       Deprecation.LOG.error("The attribute 'onsubmit' of 'UIScript' is deprecated. "
107           + "Please refer the documentation for further information.");
108     getStateHelper().put(PropertyKeys.onsubmit, onsubmit);
109   }
110 
111   @Deprecated
112   public java.lang.String getScript() {
113     return (java.lang.String) getStateHelper().eval(PropertyKeys.script);
114   }
115 
116   @Deprecated
117   public void setScript(java.lang.String script) {
118       Deprecation.LOG.error("The attribute 'script' of 'UIScript' is deprecated. "
119           + "Please refer the documentation for further information.");
120     getStateHelper().put(PropertyKeys.script, script);
121   }
122 
123   @Deprecated
124   public java.lang.String getOnload() {
125     return (java.lang.String) getStateHelper().eval(PropertyKeys.onload);
126   }
127 
128   @Deprecated
129   public void setOnload(java.lang.String onload) {
130       Deprecation.LOG.error("The attribute 'onload' of 'UIScript' is deprecated. "
131           + "Please refer the documentation for further information.");
132     getStateHelper().put(PropertyKeys.onload, onload);
133   }
134 
135 
136 }