You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by st...@apache.org on 2019/05/04 21:29:41 UTC
svn commit: r1858615 [3/32] - in /geronimo/specs/branches/jakarta:
geronimo-jakarta-jsp_spec/
geronimo-jakarta-jsp_spec/src/main/java/jakarta/servlet/jsp/
geronimo-jakarta-jsp_spec/src/main/java/jakarta/servlet/jsp/el/
geronimo-jakarta-jsp_spec/src/mai...
Modified: geronimo/specs/branches/jakarta/geronimo-jakarta-jsp_spec/src/main/java/jakarta/servlet/jsp/el/ImplicitObjectELResolver.java
URL: http://svn.apache.org/viewvc/geronimo/specs/branches/jakarta/geronimo-jakarta-jsp_spec/src/main/java/jakarta/servlet/jsp/el/ImplicitObjectELResolver.java?rev=1858615&r1=1858614&r2=1858615&view=diff
==============================================================================
--- geronimo/specs/branches/jakarta/geronimo-jakarta-jsp_spec/src/main/java/jakarta/servlet/jsp/el/ImplicitObjectELResolver.java (original)
+++ geronimo/specs/branches/jakarta/geronimo-jakarta-jsp_spec/src/main/java/jakarta/servlet/jsp/el/ImplicitObjectELResolver.java Sat May 4 21:29:39 2019
@@ -15,30 +15,29 @@
* limitations under the License.
*/
-package javax.servlet.jsp.el;
+package jakarta.servlet.jsp.el;
import java.beans.FeatureDescriptor;
import java.util.AbstractMap;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Enumeration;
-import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.Objects;
import java.util.Set;
import java.util.Vector;
import javax.el.ELContext;
-import javax.el.ELException;
import javax.el.ELResolver;
-import javax.el.PropertyNotFoundException;
import javax.el.PropertyNotWritableException;
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-import javax.servlet.jsp.JspContext;
-import javax.servlet.jsp.PageContext;
+import jakarta.servlet.http.Cookie;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpSession;
+import jakarta.servlet.jsp.JspContext;
+import jakarta.servlet.jsp.PageContext;
/**
*
@@ -46,56 +45,49 @@ import javax.servlet.jsp.PageContext;
*/
public class ImplicitObjectELResolver extends ELResolver {
- private enum Scope {
- APPLICATIONSCOPE("applicationScope"),
- COOKIE("cookie"),
- HEADER("header"),
- HEADERVALUES("headerValues"),
- INITPARAM("initParam"),
- PAGECONTEXT("pageContext"),
- PAGESCOPE("pageScope"),
- PARAM("param"),
- PARAM_VALUES("paramValues"),
- REQUEST_SCOPE("requestScope"),
- SESSION_SCOPE("sessionScope");
-
- private final String name;
-
- private Scope(String name) {
- this.name = name;
- }
-
- public String toString() {
- return name;
- }
- }
-
- private final static Map<String, Scope> SCOPE_MAP = new HashMap<String, Scope>();
-
- static {
- for (Scope scope : Scope.values()) {
- SCOPE_MAP.put(scope.toString(), scope);
- }
- }
+ private static final String[] SCOPE_NAMES = new String[] {
+ "applicationScope", "cookie", "header", "headerValues",
+ "initParam", "pageContext", "pageScope", "param", "paramValues",
+ "requestScope", "sessionScope" };
+
+ private static final int APPLICATIONSCOPE = 0;
+
+ private static final int COOKIE = 1;
+
+ private static final int HEADER = 2;
+
+ private static final int HEADERVALUES = 3;
+
+ private static final int INITPARAM = 4;
+
+ private static final int PAGECONTEXT = 5;
+
+ private static final int PAGESCOPE = 6;
+
+ private static final int PARAM = 7;
+
+ private static final int PARAM_VALUES = 8;
+
+ private static final int REQUEST_SCOPE = 9;
+
+ private static final int SESSION_SCOPE = 10;
public ImplicitObjectELResolver() {
super();
}
- public Object getValue(ELContext context, Object base, Object property)
- throws NullPointerException, PropertyNotFoundException, ELException {
- if (context == null) {
- throw new NullPointerException();
- }
+ @Override
+ public Object getValue(ELContext context, Object base, Object property) {
+ Objects.requireNonNull(context);
if (base == null && property != null) {
- Scope scope = SCOPE_MAP.get(property.toString());
+ int idx = Arrays.binarySearch(SCOPE_NAMES, property.toString());
- if (scope != null) {
+ if (idx >= 0) {
PageContext page = (PageContext) context
.getContext(JspContext.class);
- context.setPropertyResolved(true);
- switch (scope) {
+ context.setPropertyResolved(base, property);
+ switch (idx) {
case APPLICATIONSCOPE:
return ScopeManager.get(page).getApplicationScope();
case COOKIE:
@@ -124,64 +116,58 @@ public class ImplicitObjectELResolver ex
return null;
}
- public Class getType(ELContext context, Object base, Object property)
- throws NullPointerException, PropertyNotFoundException, ELException {
- if (context == null) {
- throw new NullPointerException();
- }
+ @Override
+ @SuppressWarnings({ "unchecked", "rawtypes" }) // TCK signature test fails with generics
+ public Class getType(ELContext context, Object base, Object property) {
+ Objects.requireNonNull(context);
if (base == null && property != null) {
- Scope scope = SCOPE_MAP.get(property.toString());
- if (scope != null) {
- context.setPropertyResolved(true);
+ int idx = Arrays.binarySearch(SCOPE_NAMES, property.toString());
+ if (idx >= 0) {
+ context.setPropertyResolved(base, property);
}
}
return null;
}
+ @Override
public void setValue(ELContext context, Object base, Object property,
- Object value) throws NullPointerException,
- PropertyNotFoundException, PropertyNotWritableException,
- ELException {
- if (context == null) {
- throw new NullPointerException();
- }
+ Object value) {
+ Objects.requireNonNull(context);
if (base == null && property != null) {
- Scope scope = SCOPE_MAP.get(property.toString());
- if (scope != null) {
- context.setPropertyResolved(true);
+ int idx = Arrays.binarySearch(SCOPE_NAMES, property.toString());
+ if (idx >= 0) {
+ context.setPropertyResolved(base, property);
throw new PropertyNotWritableException();
}
}
}
- public boolean isReadOnly(ELContext context, Object base, Object property)
- throws NullPointerException, PropertyNotFoundException, ELException {
- if (context == null) {
- throw new NullPointerException();
- }
+ @Override
+ public boolean isReadOnly(ELContext context, Object base, Object property) {
+ Objects.requireNonNull(context);
if (base == null && property != null) {
- Scope scope = SCOPE_MAP.get(property.toString());
- if (scope != null) {
- context.setPropertyResolved(true);
+ int idx = Arrays.binarySearch(SCOPE_NAMES, property.toString());
+ if (idx >= 0) {
+ context.setPropertyResolved(base, property);
return true;
}
}
return false;
}
+ @Override
public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base) {
- Scope[] scopes = Scope.values();
- List<FeatureDescriptor> feats = new ArrayList<FeatureDescriptor>(scopes.length);
+ List<FeatureDescriptor> feats = new ArrayList<>(SCOPE_NAMES.length);
FeatureDescriptor feat;
- for (int i = 0; i < scopes.length; i++) {
+ for (int i = 0; i < SCOPE_NAMES.length; i++) {
feat = new FeatureDescriptor();
- feat.setDisplayName(scopes[i].toString());
+ feat.setDisplayName(SCOPE_NAMES[i]);
feat.setExpert(false);
feat.setHidden(false);
- feat.setName(scopes[i].toString());
+ feat.setName(SCOPE_NAMES[i]);
feat.setPreferred(true);
feat.setValue(RESOLVABLE_AT_DESIGN_TIME, Boolean.TRUE);
feat.setValue(TYPE, String.class);
@@ -190,6 +176,7 @@ public class ImplicitObjectELResolver ex
return feats.iterator();
}
+ @Override
public Class<String> getCommonPropertyType(ELContext context, Object base) {
if (base == null) {
return String.class;
@@ -198,29 +185,29 @@ public class ImplicitObjectELResolver ex
}
private static class ScopeManager {
- private final static String MNGR_KEY = ScopeManager.class.getName();
+ private static final String MNGR_KEY = ScopeManager.class.getName();
private final PageContext page;
- private Map applicationScope;
+ private Map<String,Object> applicationScope;
- private Map cookie;
+ private Map<String,Cookie> cookie;
- private Map header;
+ private Map<String,String> header;
- private Map headerValues;
+ private Map<String,String[]> headerValues;
- private Map initParam;
+ private Map<String,String> initParam;
- private Map pageScope;
+ private Map<String,Object> pageScope;
- private Map param;
+ private Map<String,String> param;
- private Map paramValues;
+ private Map<String,String[]> paramValues;
- private Map requestScope;
+ private Map<String,Object> requestScope;
- private Map sessionScope;
+ private Map<String,Object> sessionScope;
public ScopeManager(PageContext page) {
this.page = page;
@@ -235,21 +222,25 @@ public class ImplicitObjectELResolver ex
return mngr;
}
- public Map getApplicationScope() {
+ public Map<String,Object> getApplicationScope() {
if (this.applicationScope == null) {
- this.applicationScope = new ScopeMap() {
+ this.applicationScope = new ScopeMap<Object>() {
+ @Override
protected void setAttribute(String name, Object value) {
page.getServletContext().setAttribute(name, value);
}
+ @Override
protected void removeAttribute(String name) {
page.getServletContext().removeAttribute(name);
}
- protected Enumeration getAttributeNames() {
+ @Override
+ protected Enumeration<String> getAttributeNames() {
return page.getServletContext().getAttributeNames();
}
+ @Override
protected Object getAttribute(String name) {
return page.getServletContext().getAttribute(name);
}
@@ -258,14 +249,15 @@ public class ImplicitObjectELResolver ex
return this.applicationScope;
}
- public Map getCookie() {
+ public Map<String,Cookie> getCookie() {
if (this.cookie == null) {
- this.cookie = new ScopeMap() {
- protected Enumeration getAttributeNames() {
+ this.cookie = new ScopeMap<Cookie>() {
+ @Override
+ protected Enumeration<String> getAttributeNames() {
Cookie[] c = ((HttpServletRequest) page.getRequest())
.getCookies();
if (c != null) {
- Vector v = new Vector();
+ Vector<String> v = new Vector<>();
for (int i = 0; i < c.length; i++) {
v.add(c[i].getName());
}
@@ -274,7 +266,8 @@ public class ImplicitObjectELResolver ex
return null;
}
- protected Object getAttribute(String name) {
+ @Override
+ protected Cookie getAttribute(String name) {
Cookie[] c = ((HttpServletRequest) page.getRequest())
.getCookies();
if (c != null) {
@@ -292,15 +285,17 @@ public class ImplicitObjectELResolver ex
return this.cookie;
}
- public Map getHeader() {
+ public Map<String,String> getHeader() {
if (this.header == null) {
- this.header = new ScopeMap() {
- protected Enumeration getAttributeNames() {
+ this.header = new ScopeMap<String>() {
+ @Override
+ protected Enumeration<String> getAttributeNames() {
return ((HttpServletRequest) page.getRequest())
.getHeaderNames();
}
- protected Object getAttribute(String name) {
+ @Override
+ protected String getAttribute(String name) {
return ((HttpServletRequest) page.getRequest())
.getHeader(name);
}
@@ -309,24 +304,26 @@ public class ImplicitObjectELResolver ex
return this.header;
}
- public Map getHeaderValues() {
+ public Map<String,String[]> getHeaderValues() {
if (this.headerValues == null) {
- this.headerValues = new ScopeMap() {
- protected Enumeration getAttributeNames() {
+ this.headerValues = new ScopeMap<String[]>() {
+ @Override
+ protected Enumeration<String> getAttributeNames() {
return ((HttpServletRequest) page.getRequest())
.getHeaderNames();
}
- protected Object getAttribute(String name) {
- Enumeration e = ((HttpServletRequest) page.getRequest())
- .getHeaders(name);
+ @Override
+ protected String[] getAttribute(String name) {
+ Enumeration<String> e =
+ ((HttpServletRequest) page.getRequest())
+ .getHeaders(name);
if (e != null) {
- List list = new ArrayList();
+ List<String> list = new ArrayList<>();
while (e.hasMoreElements()) {
- list.add(e.nextElement().toString());
+ list.add(e.nextElement());
}
- return (String[]) list.toArray(new String[list
- .size()]);
+ return list.toArray(new String[list.size()]);
}
return null;
}
@@ -336,14 +333,16 @@ public class ImplicitObjectELResolver ex
return this.headerValues;
}
- public Map getInitParam() {
+ public Map<String,String> getInitParam() {
if (this.initParam == null) {
- this.initParam = new ScopeMap() {
- protected Enumeration getAttributeNames() {
+ this.initParam = new ScopeMap<String>() {
+ @Override
+ protected Enumeration<String> getAttributeNames() {
return page.getServletContext().getInitParameterNames();
}
- protected Object getAttribute(String name) {
+ @Override
+ protected String getAttribute(String name) {
return page.getServletContext().getInitParameter(name);
}
};
@@ -355,22 +354,26 @@ public class ImplicitObjectELResolver ex
return this.page;
}
- public Map getPageScope() {
+ public Map<String,Object> getPageScope() {
if (this.pageScope == null) {
- this.pageScope = new ScopeMap() {
+ this.pageScope = new ScopeMap<Object>() {
+ @Override
protected void setAttribute(String name, Object value) {
page.setAttribute(name, value);
}
+ @Override
protected void removeAttribute(String name) {
page.removeAttribute(name);
}
- protected Enumeration getAttributeNames() {
- return page
- .getAttributeNamesInScope(PageContext.PAGE_SCOPE);
+ @Override
+ protected Enumeration<String> getAttributeNames() {
+ return page.getAttributeNamesInScope(
+ PageContext.PAGE_SCOPE);
}
+ @Override
protected Object getAttribute(String name) {
return page.getAttribute(name);
}
@@ -379,14 +382,16 @@ public class ImplicitObjectELResolver ex
return this.pageScope;
}
- public Map getParam() {
+ public Map<String,String> getParam() {
if (this.param == null) {
- this.param = new ScopeMap() {
- protected Enumeration getAttributeNames() {
+ this.param = new ScopeMap<String>() {
+ @Override
+ protected Enumeration<String> getAttributeNames() {
return page.getRequest().getParameterNames();
}
- protected Object getAttribute(String name) {
+ @Override
+ protected String getAttribute(String name) {
return page.getRequest().getParameter(name);
}
};
@@ -394,14 +399,16 @@ public class ImplicitObjectELResolver ex
return this.param;
}
- public Map getParamValues() {
+ public Map<String,String[]> getParamValues() {
if (this.paramValues == null) {
- this.paramValues = new ScopeMap() {
- protected Object getAttribute(String name) {
+ this.paramValues = new ScopeMap<String[]>() {
+ @Override
+ protected String[] getAttribute(String name) {
return page.getRequest().getParameterValues(name);
}
- protected Enumeration getAttributeNames() {
+ @Override
+ protected Enumeration<String> getAttributeNames() {
return page.getRequest().getParameterNames();
}
};
@@ -409,21 +416,25 @@ public class ImplicitObjectELResolver ex
return this.paramValues;
}
- public Map getRequestScope() {
+ public Map<String,Object> getRequestScope() {
if (this.requestScope == null) {
- this.requestScope = new ScopeMap() {
+ this.requestScope = new ScopeMap<Object>() {
+ @Override
protected void setAttribute(String name, Object value) {
page.getRequest().setAttribute(name, value);
}
+ @Override
protected void removeAttribute(String name) {
page.getRequest().removeAttribute(name);
}
- protected Enumeration getAttributeNames() {
+ @Override
+ protected Enumeration<String> getAttributeNames() {
return page.getRequest().getAttributeNames();
}
+ @Override
protected Object getAttribute(String name) {
return page.getRequest().getAttribute(name);
}
@@ -432,14 +443,16 @@ public class ImplicitObjectELResolver ex
return this.requestScope;
}
- public Map getSessionScope() {
+ public Map<String,Object> getSessionScope() {
if (this.sessionScope == null) {
- this.sessionScope = new ScopeMap() {
+ this.sessionScope = new ScopeMap<Object>() {
+ @Override
protected void setAttribute(String name, Object value) {
((HttpServletRequest) page.getRequest()).getSession()
.setAttribute(name, value);
}
+ @Override
protected void removeAttribute(String name) {
HttpSession session = page.getSession();
if (session != null) {
@@ -447,7 +460,8 @@ public class ImplicitObjectELResolver ex
}
}
- protected Enumeration getAttributeNames() {
+ @Override
+ protected Enumeration<String> getAttributeNames() {
HttpSession session = page.getSession();
if (session != null) {
return session.getAttributeNames();
@@ -455,6 +469,7 @@ public class ImplicitObjectELResolver ex
return null;
}
+ @Override
protected Object getAttribute(String name) {
HttpSession session = page.getSession();
if (session != null) {
@@ -468,32 +483,64 @@ public class ImplicitObjectELResolver ex
}
}
- private abstract static class ScopeMap extends AbstractMap {
+ private abstract static class ScopeMap<V> extends AbstractMap<String,V> {
- protected abstract Enumeration getAttributeNames();
+ protected abstract Enumeration<String> getAttributeNames();
- protected abstract Object getAttribute(String name);
+ protected abstract V getAttribute(String name);
+ @SuppressWarnings("unused")
protected void removeAttribute(String name) {
throw new UnsupportedOperationException();
}
+ @SuppressWarnings("unused")
protected void setAttribute(String name, Object value) {
throw new UnsupportedOperationException();
}
- public final Set entrySet() {
- Enumeration e = getAttributeNames();
- Set set = new HashSet();
+ @Override
+ public final Set<Map.Entry<String,V>> entrySet() {
+ Enumeration<String> e = getAttributeNames();
+ Set<Map.Entry<String, V>> set = new HashSet<>();
if (e != null) {
while (e.hasMoreElements()) {
- set.add(new ScopeEntry((String) e.nextElement()));
+ set.add(new ScopeEntry(e.nextElement()));
}
}
return set;
}
- private class ScopeEntry implements Map.Entry {
+ @Override
+ public final int size() {
+ int size = 0;
+ Enumeration<String> e = getAttributeNames();
+ if (e != null) {
+ while (e.hasMoreElements()) {
+ e.nextElement();
+ size++;
+ }
+ }
+ return size;
+ }
+
+ @Override
+ public final boolean containsKey(Object key) {
+ if (key == null) {
+ return false;
+ }
+ Enumeration<String> e = getAttributeNames();
+ if (e != null) {
+ while (e.hasMoreElements()) {
+ if (key.equals(e.nextElement())) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ private class ScopeEntry implements Map.Entry<String,V> {
private final String key;
@@ -501,15 +548,18 @@ public class ImplicitObjectELResolver ex
this.key = key;
}
- public Object getKey() {
- return (Object) this.key;
+ @Override
+ public String getKey() {
+ return this.key;
}
- public Object getValue() {
+ @Override
+ public V getValue() {
return getAttribute(this.key);
}
- public Object setValue(Object value) {
+ @Override
+ public V setValue(Object value) {
if (value == null) {
removeAttribute(this.key);
} else {
@@ -518,43 +568,42 @@ public class ImplicitObjectELResolver ex
return null;
}
+ @Override
public boolean equals(Object obj) {
return (obj != null && this.hashCode() == obj.hashCode());
}
+ @Override
public int hashCode() {
return this.key.hashCode();
}
}
- public final Object get(Object key) {
+ @Override
+ public final V get(Object key) {
if (key != null) {
- return getAttribute(key.toString());
+ return getAttribute((String) key);
}
return null;
}
- public final Object put(Object key, Object value) {
- if (key == null) {
- throw new NullPointerException();
- }
+ @Override
+ public final V put(String key, V value) {
+ Objects.requireNonNull(key);
if (value == null) {
- this.removeAttribute(key.toString());
+ this.removeAttribute(key);
} else {
- this.setAttribute(key.toString(), value);
+ this.setAttribute(key, value);
}
return null;
}
- public final Object remove(Object key) {
- if (key == null) {
- throw new NullPointerException();
- }
- this.removeAttribute(key.toString());
+ @Override
+ public final V remove(Object key) {
+ Objects.requireNonNull(key);
+ this.removeAttribute((String) key);
return null;
}
-
}
-
}
Modified: geronimo/specs/branches/jakarta/geronimo-jakarta-jsp_spec/src/main/java/jakarta/servlet/jsp/el/ScopedAttributeELResolver.java
URL: http://svn.apache.org/viewvc/geronimo/specs/branches/jakarta/geronimo-jakarta-jsp_spec/src/main/java/jakarta/servlet/jsp/el/ScopedAttributeELResolver.java?rev=1858615&r1=1858614&r2=1858615&view=diff
==============================================================================
--- geronimo/specs/branches/jakarta/geronimo-jakarta-jsp_spec/src/main/java/jakarta/servlet/jsp/el/ScopedAttributeELResolver.java (original)
+++ geronimo/specs/branches/jakarta/geronimo-jakarta-jsp_spec/src/main/java/jakarta/servlet/jsp/el/ScopedAttributeELResolver.java Sat May 4 21:29:39 2019
@@ -1,199 +1,238 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package javax.servlet.jsp.el;
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package jakarta.servlet.jsp.el;
import java.beans.FeatureDescriptor;
import java.util.ArrayList;
-import java.util.Collection;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.List;
+import java.util.Objects;
+import javax.el.ELClass;
import javax.el.ELContext;
-import javax.el.ELException;
import javax.el.ELResolver;
-import javax.el.PropertyNotFoundException;
-import javax.el.PropertyNotWritableException;
-import javax.servlet.jsp.JspContext;
-import javax.servlet.jsp.PageContext;
+import javax.el.ImportHandler;
+import jakarta.servlet.jsp.JspContext;
+import jakarta.servlet.jsp.PageContext;
+/**
+*
+* @since 2.1
+*/
public class ScopedAttributeELResolver extends ELResolver {
- public ScopedAttributeELResolver() {
- super();
- }
-
- public Object getValue(ELContext context, Object base, Object property)
- throws NullPointerException, PropertyNotFoundException, ELException {
- if (context == null) {
- throw new NullPointerException();
- }
-
- if (base == null) {
- context.setPropertyResolved(true);
- if (property != null) {
- String key = property.toString();
- PageContext page = (PageContext) context
- .getContext(JspContext.class);
- return page.findAttribute(key);
- }
- }
-
- return null;
- }
-
- public Class<Object> getType(ELContext context, Object base, Object property)
- throws NullPointerException, PropertyNotFoundException, ELException {
- if (context == null) {
- throw new NullPointerException();
- }
-
- if (base == null) {
- context.setPropertyResolved(true);
- return Object.class;
- }
-
- return null;
- }
-
- public void setValue(ELContext context, Object base, Object property,
- Object value) throws NullPointerException,
- PropertyNotFoundException, PropertyNotWritableException,
- ELException {
- if (context == null) {
- throw new NullPointerException();
- }
-
- if (base == null) {
- context.setPropertyResolved(true);
- if (property != null) {
- String key = property.toString();
- PageContext page = (PageContext) context
- .getContext(JspContext.class);
- int scope = page.getAttributesScope(key);
- if (scope != 0) {
- page.setAttribute(key, value, scope);
- } else {
- page.setAttribute(key, value);
- }
- }
- }
- }
-
- public boolean isReadOnly(ELContext context, Object base, Object property)
- throws NullPointerException, PropertyNotFoundException, ELException {
- if (context == null) {
- throw new NullPointerException();
- }
-
- if (base == null) {
- context.setPropertyResolved(true);
- }
-
- return false;
- }
-
- public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base) {
-
- PageContext ctxt = (PageContext) context.getContext(JspContext.class);
- List<FeatureDescriptor> list = new ArrayList<FeatureDescriptor>();
- Enumeration e;
- Object value;
- String name;
-
- e = ctxt.getAttributeNamesInScope(PageContext.PAGE_SCOPE);
- while (e.hasMoreElements()) {
- name = (String) e.nextElement();
- value = ctxt.getAttribute(name, PageContext.PAGE_SCOPE);
- FeatureDescriptor descriptor = new FeatureDescriptor();
- descriptor.setName(name);
- descriptor.setDisplayName(name);
- descriptor.setExpert(false);
- descriptor.setHidden(false);
- descriptor.setPreferred(true);
- descriptor.setShortDescription("page scoped attribute");
- descriptor.setValue("type", value.getClass());
- descriptor.setValue("resolvableAtDesignTime", Boolean.FALSE);
- list.add(descriptor);
- }
-
- e = ctxt.getAttributeNamesInScope(PageContext.REQUEST_SCOPE);
- while (e.hasMoreElements()) {
- name = (String) e.nextElement();
- value = ctxt.getAttribute(name, PageContext.REQUEST_SCOPE);
- FeatureDescriptor descriptor = new FeatureDescriptor();
- descriptor.setName(name);
- descriptor.setDisplayName(name);
- descriptor.setExpert(false);
- descriptor.setHidden(false);
- descriptor.setPreferred(true);
- descriptor.setShortDescription("request scope attribute");
- descriptor.setValue("type", value.getClass());
- descriptor.setValue("resolvableAtDesignTime", Boolean.FALSE);
- list.add(descriptor);
- }
-
- if (ctxt.getSession() != null) {
- e = ctxt.getAttributeNamesInScope(PageContext.SESSION_SCOPE);
- while (e.hasMoreElements()) {
- name = (String) e.nextElement();
- value = ctxt.getAttribute(name, PageContext.SESSION_SCOPE);
- FeatureDescriptor descriptor = new FeatureDescriptor();
- descriptor.setName(name);
- descriptor.setDisplayName(name);
- descriptor.setExpert(false);
- descriptor.setHidden(false);
- descriptor.setPreferred(true);
- descriptor.setShortDescription("session scoped attribute");
- descriptor.setValue("type", value.getClass());
- descriptor.setValue("resolvableAtDesignTime", Boolean.FALSE);
- list.add(descriptor);
- }
- }
-
- e = ctxt.getAttributeNamesInScope(PageContext.APPLICATION_SCOPE);
- while (e.hasMoreElements()) {
- name = (String) e.nextElement();
- value = ctxt.getAttribute(name, PageContext.APPLICATION_SCOPE);
- FeatureDescriptor descriptor = new FeatureDescriptor();
- descriptor.setName(name);
- descriptor.setDisplayName(name);
- descriptor.setExpert(false);
- descriptor.setHidden(false);
- descriptor.setPreferred(true);
- descriptor.setShortDescription("application scoped attribute");
- descriptor.setValue("type", value.getClass());
- descriptor.setValue("resolvableAtDesignTime", Boolean.FALSE);
- list.add(descriptor);
- }
- return list.iterator();
- }
-
- private static void appendEnumeration(Collection c, Enumeration e) {
- while (e.hasMoreElements()) {
- c.add(e.nextElement());
- }
- }
-
- public Class<String> getCommonPropertyType(ELContext context, Object base) {
- if (base == null) {
- return String.class;
- }
- return null;
- }
+ // Indicates if a performance short-cut is available
+ private static final Class<?> AST_IDENTIFIER_KEY;
+
+ static {
+ Class<?> key = null;
+ try {
+ key = Class.forName("org.apache.el.parser.AstIdentifier");
+ } catch (Exception e) {
+ // Ignore: Expected if not running on Tomcat. Not a problem since
+ // this just allows a short-cut.
+ }
+ AST_IDENTIFIER_KEY = key;
+ }
+
+ @Override
+ public Object getValue(ELContext context, Object base, Object property) {
+ Objects.requireNonNull(context);
+
+ Object result = null;
+
+ if (base == null) {
+ context.setPropertyResolved(base, property);
+ if (property != null) {
+ String key = property.toString();
+ PageContext page = (PageContext) context.getContext(JspContext.class);
+ result = page.findAttribute(key);
+
+ if (result == null) {
+ boolean resolveClass = true;
+ // Performance short-cut available when running on Tomcat
+ if (AST_IDENTIFIER_KEY != null) {
+ // Tomcat will set this key to Boolean.TRUE if the
+ // identifier is a stand-alone identifier (i.e.
+ // identifier) rather than part of an AstValue (i.e.
+ // identifier.something). Imports do not need to be
+ // checked if this is a stand-alone identifier
+ Boolean value = (Boolean) context.getContext(AST_IDENTIFIER_KEY);
+ if (value != null && value.booleanValue()) {
+ resolveClass = false;
+ }
+ }
+ // This might be the name of an imported class
+ ImportHandler importHandler = context.getImportHandler();
+ if (importHandler != null) {
+ Class<?> clazz = null;
+ if (resolveClass) {
+ clazz = importHandler.resolveClass(key);
+ }
+ if (clazz != null) {
+ result = new ELClass(clazz);
+ }
+ if (result == null) {
+ // This might be the name of an imported static field
+ clazz = importHandler.resolveStatic(key);
+ if (clazz != null) {
+ try {
+ result = clazz.getField(key).get(null);
+ } catch (IllegalArgumentException | IllegalAccessException |
+ NoSuchFieldException | SecurityException e) {
+ // Most (all?) of these should have been
+ // prevented by the checks when the import
+ // was defined.
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return result;
+ }
+
+ @Override
+ public Class<Object> getType(ELContext context, Object base, Object property) {
+ Objects.requireNonNull(context);
+
+ if (base == null) {
+ context.setPropertyResolved(base, property);
+ return Object.class;
+ }
+
+ return null;
+ }
+
+ @Override
+ public void setValue(ELContext context, Object base, Object property, Object value) {
+ Objects.requireNonNull(context);
+
+ if (base == null) {
+ context.setPropertyResolved(base, property);
+ if (property != null) {
+ String key = property.toString();
+ PageContext page = (PageContext) context.getContext(JspContext.class);
+ int scope = page.getAttributesScope(key);
+ if (scope != 0) {
+ page.setAttribute(key, value, scope);
+ } else {
+ page.setAttribute(key, value);
+ }
+ }
+ }
+ }
+
+ @Override
+ public boolean isReadOnly(ELContext context, Object base, Object property) {
+ Objects.requireNonNull(context);
+
+ if (base == null) {
+ context.setPropertyResolved(base, property);
+ }
+
+ return false;
+ }
+
+ @Override
+ public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base) {
+
+ PageContext ctxt = (PageContext) context.getContext(JspContext.class);
+ List<FeatureDescriptor> list = new ArrayList<>();
+ Enumeration<String> e;
+ Object value;
+ String name;
+
+ e = ctxt.getAttributeNamesInScope(PageContext.PAGE_SCOPE);
+ while (e.hasMoreElements()) {
+ name = e.nextElement();
+ value = ctxt.getAttribute(name, PageContext.PAGE_SCOPE);
+ FeatureDescriptor descriptor = new FeatureDescriptor();
+ descriptor.setName(name);
+ descriptor.setDisplayName(name);
+ descriptor.setExpert(false);
+ descriptor.setHidden(false);
+ descriptor.setPreferred(true);
+ descriptor.setShortDescription("page scoped attribute");
+ descriptor.setValue("type", value.getClass());
+ descriptor.setValue("resolvableAtDesignTime", Boolean.FALSE);
+ list.add(descriptor);
+ }
+
+ e = ctxt.getAttributeNamesInScope(PageContext.REQUEST_SCOPE);
+ while (e.hasMoreElements()) {
+ name = e.nextElement();
+ value = ctxt.getAttribute(name, PageContext.REQUEST_SCOPE);
+ FeatureDescriptor descriptor = new FeatureDescriptor();
+ descriptor.setName(name);
+ descriptor.setDisplayName(name);
+ descriptor.setExpert(false);
+ descriptor.setHidden(false);
+ descriptor.setPreferred(true);
+ descriptor.setShortDescription("request scope attribute");
+ descriptor.setValue("type", value.getClass());
+ descriptor.setValue("resolvableAtDesignTime", Boolean.FALSE);
+ list.add(descriptor);
+ }
+
+ if (ctxt.getSession() != null) {
+ e = ctxt.getAttributeNamesInScope(PageContext.SESSION_SCOPE);
+ while (e.hasMoreElements()) {
+ name = e.nextElement();
+ value = ctxt.getAttribute(name, PageContext.SESSION_SCOPE);
+ FeatureDescriptor descriptor = new FeatureDescriptor();
+ descriptor.setName(name);
+ descriptor.setDisplayName(name);
+ descriptor.setExpert(false);
+ descriptor.setHidden(false);
+ descriptor.setPreferred(true);
+ descriptor.setShortDescription("session scoped attribute");
+ descriptor.setValue("type", value.getClass());
+ descriptor.setValue("resolvableAtDesignTime", Boolean.FALSE);
+ list.add(descriptor);
+ }
+ }
+
+ e = ctxt.getAttributeNamesInScope(PageContext.APPLICATION_SCOPE);
+ while (e.hasMoreElements()) {
+ name = e.nextElement();
+ value = ctxt.getAttribute(name, PageContext.APPLICATION_SCOPE);
+ FeatureDescriptor descriptor = new FeatureDescriptor();
+ descriptor.setName(name);
+ descriptor.setDisplayName(name);
+ descriptor.setExpert(false);
+ descriptor.setHidden(false);
+ descriptor.setPreferred(true);
+ descriptor.setShortDescription("application scoped attribute");
+ descriptor.setValue("type", value.getClass());
+ descriptor.setValue("resolvableAtDesignTime", Boolean.FALSE);
+ list.add(descriptor);
+ }
+ return list.iterator();
+ }
+
+ @Override
+ public Class<String> getCommonPropertyType(ELContext context, Object base) {
+ if (base == null) {
+ return String.class;
+ }
+ return null;
+ }
}
Modified: geronimo/specs/branches/jakarta/geronimo-jakarta-jsp_spec/src/main/java/jakarta/servlet/jsp/el/VariableResolver.java
URL: http://svn.apache.org/viewvc/geronimo/specs/branches/jakarta/geronimo-jakarta-jsp_spec/src/main/java/jakarta/servlet/jsp/el/VariableResolver.java?rev=1858615&r1=1858614&r2=1858615&view=diff
==============================================================================
--- geronimo/specs/branches/jakarta/geronimo-jakarta-jsp_spec/src/main/java/jakarta/servlet/jsp/el/VariableResolver.java (original)
+++ geronimo/specs/branches/jakarta/geronimo-jakarta-jsp_spec/src/main/java/jakarta/servlet/jsp/el/VariableResolver.java Sat May 4 21:29:39 2019
@@ -1,51 +1,51 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package javax.servlet.jsp.el;
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package jakarta.servlet.jsp.el;
/**
- * <p>This class is used to customize the way an ExpressionEvaluator resolves
- * variable references at evaluation time. For example, instances of this class can
- * implement their own variable lookup mechanisms, or introduce the
- * notion of "implicit variables" which override any other variables.
- * An instance of this class should be passed when evaluating
- * an expression.</p>
- *
- * <p>An instance of this class includes the context against which resolution
- * will happen</p>
+ * <p>
+ * This class is used to customize the way an ExpressionEvaluator resolves
+ * variable references at evaluation time. For example, instances of this class
+ * can implement their own variable lookup mechanisms, or introduce the notion
+ * of "implicit variables" which override any other variables. An instance of
+ * this class should be passed when evaluating an expression.
+ * </p>
+ * <p>
+ * An instance of this class includes the context against which resolution will
+ * happen
+ * </p>
*
* @since 2.0
- * @deprecated
+ * @deprecated As of JSP 2.1, replaced by javax.el.ELResolver
*/
-public interface VariableResolver
-{
- //-------------------------------------
- /**
- * Resolves the specified variable.
- * Returns null if the variable is not found.
- *
- * @param pName the name of the variable to resolve
- * @return the result of the variable resolution
- *
- * @throws ELException if a failure occurred while trying to resolve
- * the given variable
- **/
- public Object resolveVariable (String pName)
- throws ELException;
-
- //-------------------------------------
+@SuppressWarnings("dep-ann")
+// TCK signature test fails with annotation
+public interface VariableResolver {
+
+ /**
+ * Resolves the specified variable. Returns null if the variable is not
+ * found.
+ *
+ * @param pName
+ * the name of the variable to resolve
+ * @return the result of the variable resolution
+ * @throws ELException
+ * if a failure occurred while trying to resolve the given
+ * variable
+ */
+ public Object resolveVariable(String pName) throws ELException;
}
Modified: geronimo/specs/branches/jakarta/geronimo-jakarta-jsp_spec/src/main/java/jakarta/servlet/jsp/el/package.html
URL: http://svn.apache.org/viewvc/geronimo/specs/branches/jakarta/geronimo-jakarta-jsp_spec/src/main/java/jakarta/servlet/jsp/el/package.html?rev=1858615&r1=1858614&r2=1858615&view=diff
==============================================================================
--- geronimo/specs/branches/jakarta/geronimo-jakarta-jsp_spec/src/main/java/jakarta/servlet/jsp/el/package.html (original)
+++ geronimo/specs/branches/jakarta/geronimo-jakarta-jsp_spec/src/main/java/jakarta/servlet/jsp/el/package.html Sat May 4 21:29:39 2019
@@ -2,7 +2,7 @@
<html>
<head>
<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
+ Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
@@ -27,11 +27,11 @@ The JavaServer Pages(tm) (JSP) 2.0 speci
API for evaluating "EL Expressions". As of JSP 2.0, EL expressions can
be placed directly in the template text of JSP pages and tag files.
<p>
-This package contains a number of classes and interfaces that describe
-and define programmatic access to the Expression Language evaluator.
-This API can also be used by an implementation of JSP to evaluate the
-expressions, but other implementations, like open-coding into Java
-bytecodes, are allowed. This package is intended to have no dependencies
-on other portions of the JSP 2.0 specification.
+This package contains a number of classes and interfaces that describe
+and define programmatic access to the Expression Language evaluator.
+This API can also be used by an implementation of JSP to evaluate the
+expressions, but other implementations, like open-coding into Java
+bytecodes, are allowed. This package is intended to have no dependencies
+on other portions of the JSP 2.0 specification.
</body>
</html>
Modified: geronimo/specs/branches/jakarta/geronimo-jakarta-jsp_spec/src/main/java/jakarta/servlet/jsp/package.html
URL: http://svn.apache.org/viewvc/geronimo/specs/branches/jakarta/geronimo-jakarta-jsp_spec/src/main/java/jakarta/servlet/jsp/package.html?rev=1858615&r1=1858614&r2=1858615&view=diff
==============================================================================
--- geronimo/specs/branches/jakarta/geronimo-jakarta-jsp_spec/src/main/java/jakarta/servlet/jsp/package.html (original)
+++ geronimo/specs/branches/jakarta/geronimo-jakarta-jsp_spec/src/main/java/jakarta/servlet/jsp/package.html Sat May 4 21:29:39 2019
@@ -2,7 +2,7 @@
<html>
<head>
<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
+ Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
Modified: geronimo/specs/branches/jakarta/geronimo-jakarta-jsp_spec/src/main/java/jakarta/servlet/jsp/tagext/BodyContent.java
URL: http://svn.apache.org/viewvc/geronimo/specs/branches/jakarta/geronimo-jakarta-jsp_spec/src/main/java/jakarta/servlet/jsp/tagext/BodyContent.java?rev=1858615&r1=1858614&r2=1858615&view=diff
==============================================================================
--- geronimo/specs/branches/jakarta/geronimo-jakarta-jsp_spec/src/main/java/jakarta/servlet/jsp/tagext/BodyContent.java (original)
+++ geronimo/specs/branches/jakarta/geronimo-jakarta-jsp_spec/src/main/java/jakarta/servlet/jsp/tagext/BodyContent.java Sat May 4 21:29:39 2019
@@ -1,96 +1,86 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-package javax.servlet.jsp.tagext;
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package jakarta.servlet.jsp.tagext;
+import java.io.IOException;
import java.io.Reader;
import java.io.Writer;
-import java.io.IOException;
-import javax.servlet.jsp.*;
+
+import jakarta.servlet.jsp.JspWriter;
/**
* An encapsulation of the evaluation of the body of an action so it is
- * available to a tag handler. BodyContent is a subclass of JspWriter.
- *
+ * available to a tag handler. BodyContent is a subclass of JspWriter.
* <p>
- * Note that the content of BodyContent is the result of evaluation, so
- * it will not contain actions and the like, but the result of their
- * invocation.
- *
+ * Note that the content of BodyContent is the result of evaluation, so it will
+ * not contain actions and the like, but the result of their invocation.
* <p>
- * BodyContent has methods to convert its contents into
- * a String, to read its contents, and to clear the contents.
- *
+ * BodyContent has methods to convert its contents into a String, to read its
+ * contents, and to clear the contents.
* <p>
- * The buffer size of a BodyContent object is unbounded. A
- * BodyContent object cannot be in autoFlush mode. It is not possible to
- * invoke flush on a BodyContent object, as there is no backing stream.
- *
+ * The buffer size of a BodyContent object is unbounded. A BodyContent object
+ * cannot be in autoFlush mode. It is not possible to invoke flush on a
+ * BodyContent object, as there is no backing stream.
* <p>
- * Instances of BodyContent are created by invoking the pushBody and
- * popBody methods of the PageContext class. A BodyContent is enclosed
- * within another JspWriter (maybe another BodyContent object) following
- * the structure of their associated actions.
- *
+ * Instances of BodyContent are created by invoking the pushBody and popBody
+ * methods of the PageContext class. A BodyContent is enclosed within another
+ * JspWriter (maybe another BodyContent object) following the structure of their
+ * associated actions.
* <p>
- * A BodyContent is made available to a BodyTag through a setBodyContent()
- * call. The tag handler can use the object until after the call to
- * doEndTag().
+ * A BodyContent is made available to a BodyTag through a setBodyContent() call.
+ * The tag handler can use the object until after the call to doEndTag().
*/
-
public abstract class BodyContent extends JspWriter {
-
+
/**
- * Protected constructor.
- *
- * Unbounded buffer, no autoflushing.
+ * Protected constructor. Unbounded buffer, no autoflushing.
*
- * @param e the enclosing JspWriter
+ * @param e
+ * the enclosing JspWriter
*/
-
protected BodyContent(JspWriter e) {
- super(UNBOUNDED_BUFFER , false);
- this.enclosingWriter = e;
+ super(UNBOUNDED_BUFFER, false);
+ this.enclosingWriter = e;
}
/**
* Redefined flush() so it is not legal.
- *
* <p>
- * It is not valid to flush a BodyContent because there is no backing
- * stream behind it.
+ * It is not valid to flush a BodyContent because there is no backing stream
+ * behind it.
*
- * @throws IOException always thrown
+ * @throws IOException
+ * always thrown
*/
-
+ @Override
public void flush() throws IOException {
- throw new IOException("Illegal to flush within a custom tag");
+ throw new IOException("Illegal to flush within a custom tag");
}
/**
* Clear the body without throwing any exceptions.
*/
-
public void clearBody() {
- try {
- this.clear();
- } catch (IOException ex) {
- // TODO -- clean this one up.
- throw new Error("internal error!;");
- }
+ try {
+ this.clear();
+ } catch (IOException ex) {
+ // TODO -- clean this one up.
+ throw new Error("internal error!;");
+ }
}
/**
@@ -100,40 +90,36 @@ public abstract class BodyContent extend
*/
public abstract Reader getReader();
-
/**
* Return the value of the BodyContent as a String.
*
* @return the value of the BodyContent as a String
*/
public abstract String getString();
-
/**
- * Write the contents of this BodyContent into a Writer.
- * Subclasses may optimize common invocation patterns.
+ * Write the contents of this BodyContent into a Writer. Subclasses may
+ * optimize common invocation patterns.
*
- * @param out The writer into which to place the contents of
- * this body evaluation
- * @throws IOException if an I/O error occurred while writing the
- * contents of this BodyContent to the given Writer
+ * @param out
+ * The writer into which to place the contents of this body
+ * evaluation
+ * @throws IOException
+ * if an I/O error occurred while writing the contents of this
+ * BodyContent to the given Writer
*/
-
public abstract void writeOut(Writer out) throws IOException;
-
/**
* Get the enclosing JspWriter.
*
* @return the enclosing JspWriter passed at construction time
*/
-
public JspWriter getEnclosingWriter() {
- return enclosingWriter;
+ return enclosingWriter;
}
-
// private fields
- private JspWriter enclosingWriter;
- }
+ private final JspWriter enclosingWriter;
+}
Modified: geronimo/specs/branches/jakarta/geronimo-jakarta-jsp_spec/src/main/java/jakarta/servlet/jsp/tagext/BodyTag.java
URL: http://svn.apache.org/viewvc/geronimo/specs/branches/jakarta/geronimo-jakarta-jsp_spec/src/main/java/jakarta/servlet/jsp/tagext/BodyTag.java?rev=1858615&r1=1858614&r2=1858615&view=diff
==============================================================================
--- geronimo/specs/branches/jakarta/geronimo-jakarta-jsp_spec/src/main/java/jakarta/servlet/jsp/tagext/BodyTag.java (original)
+++ geronimo/specs/branches/jakarta/geronimo-jakarta-jsp_spec/src/main/java/jakarta/servlet/jsp/tagext/BodyTag.java Sat May 4 21:29:39 2019
@@ -1,186 +1,162 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-package javax.servlet.jsp.tagext;
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package jakarta.servlet.jsp.tagext;
+
+import jakarta.servlet.jsp.JspException;
-import javax.servlet.jsp.*;
/**
- * The BodyTag interface extends IterationTag by defining additional
- * methods that let a tag handler manipulate the content of evaluating its body.
- *
+ * The BodyTag interface extends IterationTag by defining additional methods
+ * that let a tag handler manipulate the content of evaluating its body.
* <p>
- * It is the responsibility of the tag handler to manipulate the body
- * content. For example the tag handler may take the body content,
- * convert it into a String using the bodyContent.getString
- * method and then use it. Or the tag handler may take the body
- * content and write it out into its enclosing JspWriter using
- * the bodyContent.writeOut method.
- *
- * <p> A tag handler that implements BodyTag is treated as one that
- * implements IterationTag, except that the doStartTag method can
- * return SKIP_BODY, EVAL_BODY_INCLUDE or EVAL_BODY_BUFFERED.
- *
+ * It is the responsibility of the tag handler to manipulate the body content.
+ * For example the tag handler may take the body content, convert it into a
+ * String using the bodyContent.getString method and then use it. Or the tag
+ * handler may take the body content and write it out into its enclosing
+ * JspWriter using the bodyContent.writeOut method.
+ * <p>
+ * A tag handler that implements BodyTag is treated as one that implements
+ * IterationTag, except that the doStartTag method can return SKIP_BODY,
+ * EVAL_BODY_INCLUDE or EVAL_BODY_BUFFERED.
+ * <p>
+ * If EVAL_BODY_INCLUDE is returned, then evaluation happens as in IterationTag.
+ * <p>
+ * If EVAL_BODY_BUFFERED is returned, then a BodyContent object will be created
+ * (by code generated by the JSP compiler) to capture the body evaluation. The
+ * code generated by the JSP compiler obtains the BodyContent object by calling
+ * the pushBody method of the current pageContext, which additionally has the
+ * effect of saving the previous out value. The page compiler returns this
+ * object by calling the popBody method of the PageContext class; the call also
+ * restores the value of out.
+ * <p>
+ * The interface provides one new property with a setter method and one new
+ * action method.
+ * <p>
+ * <B>Properties</B>
+ * <p>
+ * There is a new property: bodyContent, to contain the BodyContent object,
+ * where the JSP Page implementation object will place the evaluation (and
+ * reevaluation, if appropriate) of the body. The setter method (setBodyContent)
+ * will only be invoked if doStartTag() returns EVAL_BODY_BUFFERED and the
+ * corresponding action element does not have an empty body.
+ * <p>
+ * <B>Methods</B>
+ * <p>
+ * In addition to the setter method for the bodyContent property, there is a new
+ * action method: doInitBody(), which is invoked right after setBodyContent()
+ * and before the body evaluation. This method is only invoked if doStartTag()
+ * returns EVAL_BODY_BUFFERED.
+ * <p>
+ * <B>Lifecycle</B>
+ * <p>
+ * Lifecycle details are described by the transition diagram below. Exceptions
+ * that are thrown during the computation of doStartTag(), setBodyContent(),
+ * doInitBody(), BODY, doAfterBody() interrupt the execution sequence and are
+ * propagated up the stack, unless the tag handler implements the
+ * TryCatchFinally interface; see that interface for details.
* <p>
- * If EVAL_BODY_INCLUDE is returned, then evaluation happens
- * as in IterationTag.
- *
+ * <IMG src="doc-files/BodyTagProtocol.gif"
+ * alt="Lifecycle Details Transition Diagram for BodyTag">
* <p>
- * If EVAL_BODY_BUFFERED is returned, then a BodyContent object will be
- * created (by code generated by the JSP compiler) to capture the body
- * evaluation.
- * The code generated by the JSP compiler obtains the BodyContent object by
- * calling the pushBody method of the current pageContext, which
- * additionally has the effect of saving the previous out value.
- * The page compiler returns this object by calling the popBody
- * method of the PageContext class;
- * the call also restores the value of out.
- *
+ * <B>Empty and Non-Empty Action</B>
* <p>
- * The interface provides one new property with a setter method and one
- * new action method.
- *
- * <p><B>Properties</B>
- * <p> There is a new property: bodyContent, to contain the BodyContent
- * object, where the JSP Page implementation object will place the
- * evaluation (and reevaluation, if appropriate) of the body. The setter
- * method (setBodyContent) will only be invoked if doStartTag() returns
- * EVAL_BODY_BUFFERED and the corresponding action element does not have
- * an empty body.
- *
- * <p><B>Methods</B>
- * <p> In addition to the setter method for the bodyContent property, there
- * is a new action method: doInitBody(), which is invoked right after
- * setBodyContent() and before the body evaluation. This method is only
- * invoked if doStartTag() returns EVAL_BODY_BUFFERED.
- *
- * <p><B>Lifecycle</B>
- * <p> Lifecycle details are described by the transition diagram below.
- * Exceptions that are thrown during the computation of doStartTag(),
- * setBodyContent(), doInitBody(), BODY, doAfterBody() interrupt the
- * execution sequence and are propagated up the stack, unless the
- * tag handler implements the TryCatchFinally interface; see that
- * interface for details.
- * <p>
- * <IMG src="doc-files/BodyTagProtocol.gif"
- * alt="Lifecycle Details Transition Diagram for BodyTag"/>
- *
- * <p><B>Empty and Non-Empty Action</B>
- * <p> If the TagLibraryDescriptor file indicates that the action must
- * always have an empty element body, by an <body-content> entry
- * of "empty", then the doStartTag() method must return SKIP_BODY.
- * Otherwise, the doStartTag() method may return SKIP_BODY,
- * EVAL_BODY_INCLUDE, or EVAL_BODY_BUFFERED.
- *
- * <p>Note that which methods are invoked after the doStartTag() depends on
- * both the return value and on if the custom action element is empty
- * or not in the JSP page, not how it's declared in the TLD.
- *
+ * If the TagLibraryDescriptor file indicates that the action must always have
+ * an empty element body, by an <body-content> entry of "empty", then the
+ * doStartTag() method must return SKIP_BODY. Otherwise, the doStartTag() method
+ * may return SKIP_BODY, EVAL_BODY_INCLUDE, or EVAL_BODY_BUFFERED.
+ * <p>
+ * Note that which methods are invoked after the doStartTag() depends on both
+ * the return value and on if the custom action element is empty or not in the
+ * JSP page, not how it's declared in the TLD.
* <p>
* If SKIP_BODY is returned the body is not evaluated, and doEndTag() is
* invoked.
- *
* <p>
- * If EVAL_BODY_INCLUDE is returned, and the custom action element is not
- * empty, setBodyContent() is not invoked,
- * doInitBody() is not invoked, the body is evaluated and
- * "passed through" to the current out, doAfterBody() is invoked
- * and then, after zero or more iterations, doEndTag() is invoked.
- * If the custom action element is empty, only doStart() and
- * doEndTag() are invoked.
- *
+ * If EVAL_BODY_INCLUDE is returned, and the custom action element is not empty,
+ * setBodyContent() is not invoked, doInitBody() is not invoked, the body is
+ * evaluated and "passed through" to the current out, doAfterBody() is invoked
+ * and then, after zero or more iterations, doEndTag() is invoked. If the custom
+ * action element is empty, only doStart() and doEndTag() are invoked.
* <p>
* If EVAL_BODY_BUFFERED is returned, and the custom action element is not
- * empty, setBodyContent() is invoked,
- * doInitBody() is invoked, the body is evaluated, doAfterBody() is
- * invoked, and then, after zero or more iterations, doEndTag() is invoked.
- * If the custom action element is empty, only doStart() and doEndTag()
- * are invoked.
+ * empty, setBodyContent() is invoked, doInitBody() is invoked, the body is
+ * evaluated, doAfterBody() is invoked, and then, after zero or more iterations,
+ * doEndTag() is invoked. If the custom action element is empty, only doStart()
+ * and doEndTag() are invoked.
*/
-
public interface BodyTag extends IterationTag {
/**
- * Deprecated constant that has the same value as EVAL_BODY_BUFFERED
- * and EVAL_BODY_AGAIN. This name has been marked as deprecated
- * to encourage the use of the two different terms, which are much
- * more descriptive.
+ * Deprecated constant that has the same value as EVAL_BODY_BUFFERED and
+ * EVAL_BODY_AGAIN. This name has been marked as deprecated to encourage the
+ * use of the two different terms, which are much more descriptive.
*
- * @deprecated As of Java JSP API 1.2, use BodyTag.EVAL_BODY_BUFFERED
- * or IterationTag.EVAL_BODY_AGAIN.
+ * @deprecated As of Java JSP API 1.2, use BodyTag.EVAL_BODY_BUFFERED or
+ * IterationTag.EVAL_BODY_AGAIN.
*/
-
- public final static int EVAL_BODY_TAG = 2;
+ @SuppressWarnings("dep-ann")
+ // TCK signature test fails with annotation
+ public static final int EVAL_BODY_TAG = 2;
/**
- * Request the creation of new buffer, a BodyContent on which to
- * evaluate the body of this tag.
- *
- * Returned from doStartTag when it implements BodyTag.
- * This is an illegal return value for doStartTag when the class
+ * Request the creation of new buffer, a BodyContent on which to evaluate
+ * the body of this tag. Returned from doStartTag when it implements
+ * BodyTag. This is an illegal return value for doStartTag when the class
* does not implement BodyTag.
*/
-
- public final static int EVAL_BODY_BUFFERED = 2;
-
+ public static final int EVAL_BODY_BUFFERED = 2;
/**
- * Set the bodyContent property.
- * This method is invoked by the JSP page implementation object at
- * most once per action invocation.
- * This method will be invoked before doInitBody.
- * This method will not be invoked for empty tags or for non-empty
- * tags whose doStartTag() method returns SKIP_BODY or EVAL_BODY_INCLUDE.
- *
+ * Set the bodyContent property. This method is invoked by the JSP page
+ * implementation object at most once per action invocation. This method
+ * will be invoked before doInitBody. This method will not be invoked for
+ * empty tags or for non-empty tags whose doStartTag() method returns
+ * SKIP_BODY or EVAL_BODY_INCLUDE.
* <p>
- * When setBodyContent is invoked, the value of the implicit object out
- * has already been changed in the pageContext object. The BodyContent
- * object passed will have not data on it but may have been reused
- * (and cleared) from some previous invocation.
- *
+ * When setBodyContent is invoked, the value of the implicit object out has
+ * already been changed in the pageContext object. The BodyContent object
+ * passed will have not data on it but may have been reused (and cleared)
+ * from some previous invocation.
* <p>
* The BodyContent object is available and with the appropriate content
- * until after the invocation of the doEndTag method, at which case it
- * may be reused.
+ * until after the invocation of the doEndTag method, at which case it may
+ * be reused.
*
- * @param b the BodyContent
+ * @param b
+ * the BodyContent
* @see #doInitBody
* @see #doAfterBody
*/
-
void setBodyContent(BodyContent b);
-
/**
- * Prepare for evaluation of the body.
- * This method is invoked by the JSP page implementation object
- * after setBodyContent and before the first time
- * the body is to be evaluated.
- * This method will not be invoked for empty tags or for non-empty
- * tags whose doStartTag() method returns SKIP_BODY or EVAL_BODY_INCLUDE.
- *
+ * Prepare for evaluation of the body. This method is invoked by the JSP
+ * page implementation object after setBodyContent and before the first time
+ * the body is to be evaluated. This method will not be invoked for empty
+ * tags or for non-empty tags whose doStartTag() method returns SKIP_BODY or
+ * EVAL_BODY_INCLUDE.
* <p>
* The JSP container will resynchronize the values of any AT_BEGIN and
* NESTED variables (defined by the associated TagExtraInfo or TLD) after
* the invocation of doInitBody().
*
- * @throws JspException if an error occurred while processing this tag
+ * @throws JspException
+ * if an error occurred while processing this tag
* @see #doAfterBody
*/
-
void doInitBody() throws JspException;
-
}
Modified: geronimo/specs/branches/jakarta/geronimo-jakarta-jsp_spec/src/main/java/jakarta/servlet/jsp/tagext/BodyTagSupport.java
URL: http://svn.apache.org/viewvc/geronimo/specs/branches/jakarta/geronimo-jakarta-jsp_spec/src/main/java/jakarta/servlet/jsp/tagext/BodyTagSupport.java?rev=1858615&r1=1858614&r2=1858615&view=diff
==============================================================================
--- geronimo/specs/branches/jakarta/geronimo-jakarta-jsp_spec/src/main/java/jakarta/servlet/jsp/tagext/BodyTagSupport.java (original)
+++ geronimo/specs/branches/jakarta/geronimo-jakarta-jsp_spec/src/main/java/jakarta/servlet/jsp/tagext/BodyTagSupport.java Sat May 4 21:29:39 2019
@@ -1,133 +1,129 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-package javax.servlet.jsp.tagext;
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package jakarta.servlet.jsp.tagext;
-import javax.servlet.jsp.JspException;
-import javax.servlet.jsp.JspWriter;
+import jakarta.servlet.jsp.JspException;
+import jakarta.servlet.jsp.JspWriter;
/**
* A base class for defining tag handlers implementing BodyTag.
- *
* <p>
- * The BodyTagSupport class implements the BodyTag interface and adds
- * additional convenience methods including getter methods for the
- * bodyContent property and methods to get at the previous out JspWriter.
- *
+ * The BodyTagSupport class implements the BodyTag interface and adds additional
+ * convenience methods including getter methods for the bodyContent property and
+ * methods to get at the previous out JspWriter.
* <p>
- * Many tag handlers will extend BodyTagSupport and only redefine a
- * few methods.
+ * Many tag handlers will extend BodyTagSupport and only redefine a few methods.
*/
-
public class BodyTagSupport extends TagSupport implements BodyTag {
+ private static final long serialVersionUID = -7235752615580319833L;
+
/**
- * Default constructor, all subclasses are required to only define
- * a public constructor with the same signature, and to call the
- * superclass constructor.
- *
- * This constructor is called by the code generated by the JSP
+ * Default constructor, all subclasses are required to only define a public
+ * constructor with the same signature, and to call the superclass
+ * constructor. This constructor is called by the code generated by the JSP
* translator.
*/
-
public BodyTagSupport() {
- super();
+ super();
}
/**
* Default processing of the start tag returning EVAL_BODY_BUFFERED.
*
* @return EVAL_BODY_BUFFERED
- * @throws JspException if an error occurred while processing this tag
+ * @throws JspException
+ * if an error occurred while processing this tag
* @see BodyTag#doStartTag
*/
-
+ @Override
public int doStartTag() throws JspException {
return EVAL_BODY_BUFFERED;
}
-
/**
* Default processing of the end tag returning EVAL_PAGE.
*
* @return EVAL_PAGE
- * @throws JspException if an error occurred while processing this tag
+ * @throws JspException
+ * if an error occurred while processing this tag
* @see Tag#doEndTag
*/
-
+ @Override
public int doEndTag() throws JspException {
- return super.doEndTag();
+ return super.doEndTag();
}
-
// Actions related to body evaluation
/**
* Prepare for evaluation of the body: stash the bodyContent away.
*
- * @param b the BodyContent
+ * @param b
+ * the BodyContent
* @see #doAfterBody
* @see #doInitBody()
* @see BodyTag#setBodyContent
*/
-
+ @Override
public void setBodyContent(BodyContent b) {
- this.bodyContent = b;
+ this.bodyContent = b;
}
-
/**
* Prepare for evaluation of the body just before the first body evaluation:
* no action.
*
- * @throws JspException if an error occurred while processing this tag
+ * @throws JspException
+ * if an error occurred while processing this tag
* @see #setBodyContent
* @see #doAfterBody
* @see BodyTag#doInitBody
*/
-
+ @Override
public void doInitBody() throws JspException {
+ // NOOP by default
}
-
/**
* After the body evaluation: do not reevaluate and continue with the page.
* By default nothing is done with the bodyContent data (if any).
*
* @return SKIP_BODY
- * @throws JspException if an error occurred while processing this tag
+ * @throws JspException
+ * if an error occurred while processing this tag
* @see #doInitBody
* @see BodyTag#doAfterBody
*/
-
+ @Override
public int doAfterBody() throws JspException {
- return SKIP_BODY;
+ return SKIP_BODY;
}
-
/**
* Release state.
*
* @see Tag#release
*/
-
+ @Override
public void release() {
- bodyContent = null;
+ bodyContent = null;
- super.release();
+ super.release();
}
/**
@@ -135,20 +131,17 @@ public class BodyTagSupport extends TagS
*
* @return the body content.
*/
-
public BodyContent getBodyContent() {
- return bodyContent;
+ return bodyContent;
}
-
/**
* Get surrounding out JspWriter.
*
* @return the enclosing JspWriter, from the bodyContent.
*/
-
public JspWriter getPreviousOut() {
- return bodyContent.getEnclosingWriter();
+ return bodyContent.getEnclosingWriter();
}
// protected fields
@@ -156,5 +149,5 @@ public class BodyTagSupport extends TagS
/**
* The current BodyContent for this BodyTag.
*/
- protected BodyContent bodyContent;
+ protected transient BodyContent bodyContent;
}
Modified: geronimo/specs/branches/jakarta/geronimo-jakarta-jsp_spec/src/main/java/jakarta/servlet/jsp/tagext/DynamicAttributes.java
URL: http://svn.apache.org/viewvc/geronimo/specs/branches/jakarta/geronimo-jakarta-jsp_spec/src/main/java/jakarta/servlet/jsp/tagext/DynamicAttributes.java?rev=1858615&r1=1858614&r2=1858615&view=diff
==============================================================================
--- geronimo/specs/branches/jakarta/geronimo-jakarta-jsp_spec/src/main/java/jakarta/servlet/jsp/tagext/DynamicAttributes.java (original)
+++ geronimo/specs/branches/jakarta/geronimo-jakarta-jsp_spec/src/main/java/jakarta/servlet/jsp/tagext/DynamicAttributes.java Sat May 4 21:29:39 2019
@@ -14,39 +14,39 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package javax.servlet.jsp.tagext;
+package jakarta.servlet.jsp.tagext;
-import javax.servlet.jsp.JspException;
+import jakarta.servlet.jsp.JspException;
/**
* For a tag to declare that it accepts dynamic attributes, it must implement
- * this interface. The entry for the tag in the Tag Library Descriptor must
+ * this interface. The entry for the tag in the Tag Library Descriptor must
* also be configured to indicate dynamic attributes are accepted.
* <br>
* For any attribute that is not declared in the Tag Library Descriptor for
- * this tag, instead of getting an error at translation time, the
+ * this tag, instead of getting an error at translation time, the
* <code>setDynamicAttribute()</code> method is called, with the name and
- * value of the attribute. It is the responsibility of the tag to
+ * value of the attribute. It is the responsibility of the tag to
* remember the names and values of the dynamic attributes.
*
* @since 2.0
*/
public interface DynamicAttributes {
-
+
/**
* Called when a tag declared to accept dynamic attributes is passed
* an attribute that is not declared in the Tag Library Descriptor.
- *
+ *
* @param uri the namespace of the attribute, or null if in the default
* namespace.
* @param localName the name of the attribute being set.
* @param value the value of the attribute
* @throws JspException if the tag handler wishes to
- * signal that it does not accept the given attribute. The
+ * signal that it does not accept the given attribute. The
* container must not call doStartTag() or doTag() for this tag.
*/
public void setDynamicAttribute(
- String uri, String localName, Object value )
+ String uri, String localName, Object value )
throws JspException;
-
+
}
Modified: geronimo/specs/branches/jakarta/geronimo-jakarta-jsp_spec/src/main/java/jakarta/servlet/jsp/tagext/FunctionInfo.java
URL: http://svn.apache.org/viewvc/geronimo/specs/branches/jakarta/geronimo-jakarta-jsp_spec/src/main/java/jakarta/servlet/jsp/tagext/FunctionInfo.java?rev=1858615&r1=1858614&r2=1858615&view=diff
==============================================================================
--- geronimo/specs/branches/jakarta/geronimo-jakarta-jsp_spec/src/main/java/jakarta/servlet/jsp/tagext/FunctionInfo.java (original)
+++ geronimo/specs/branches/jakarta/geronimo-jakarta-jsp_spec/src/main/java/jakarta/servlet/jsp/tagext/FunctionInfo.java Sat May 4 21:29:39 2019
@@ -14,14 +14,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
-package javax.servlet.jsp.tagext;
+
+package jakarta.servlet.jsp.tagext;
/**
* Information for a function in a Tag Library.
* This class is instantiated from the Tag Library Descriptor file (TLD)
* and is available only at translation time.
- *
+ *
* @since 2.0
*/
public class FunctionInfo {
@@ -35,8 +35,7 @@ public class FunctionInfo {
*/
public FunctionInfo(String name, String klass, String signature) {
-
- this.name = name;
+ this.name = name;
this.functionClass = klass;
this.functionSignature = signature;
}
@@ -48,7 +47,7 @@ public class FunctionInfo {
*/
public String getName() {
- return name;
+ return name;
}
/**
@@ -74,8 +73,7 @@ public class FunctionInfo {
/*
* fields
*/
-
- private String name;
- private String functionClass;
- private String functionSignature;
+ private final String name;
+ private final String functionClass;
+ private final String functionSignature;
}
Modified: geronimo/specs/branches/jakarta/geronimo-jakarta-jsp_spec/src/main/java/jakarta/servlet/jsp/tagext/IterationTag.java
URL: http://svn.apache.org/viewvc/geronimo/specs/branches/jakarta/geronimo-jakarta-jsp_spec/src/main/java/jakarta/servlet/jsp/tagext/IterationTag.java?rev=1858615&r1=1858614&r2=1858615&view=diff
==============================================================================
--- geronimo/specs/branches/jakarta/geronimo-jakarta-jsp_spec/src/main/java/jakarta/servlet/jsp/tagext/IterationTag.java (original)
+++ geronimo/specs/branches/jakarta/geronimo-jakarta-jsp_spec/src/main/java/jakarta/servlet/jsp/tagext/IterationTag.java Sat May 4 21:29:39 2019
@@ -15,9 +15,10 @@
* limitations under the License.
*/
-package javax.servlet.jsp.tagext;
+package jakarta.servlet.jsp.tagext;
+
+import jakarta.servlet.jsp.JspException;
-import javax.servlet.jsp.*;
/**
* The IterationTag interface extends Tag by defining one additional
@@ -50,11 +51,11 @@ import javax.servlet.jsp.*;
*
* <p>
* <IMG src="doc-files/IterationTagProtocol.gif"
- * alt="Lifecycle Details Transition Diagram for IterationTag"/>
+ * alt="Lifecycle Details Transition Diagram for IterationTag">
*
* <p><B>Empty and Non-Empty Action</B>
* <p> If the TagLibraryDescriptor file indicates that the action must
- * always have an empty element body, by a <body-content> entry of
+ * always have an empty element body, by a <body-content> entry of
* "empty", then the doStartTag() method must return SKIP_BODY.
*
* <p>Note that which methods are invoked after the doStartTag() depends on
@@ -67,8 +68,8 @@ import javax.servlet.jsp.*;
*
* <p>
* If EVAL_BODY_INCLUDE is returned, and the custom action element is not
- * empty, the body is evaluated and "passed through" to the current out,
- * then doAfterBody() is invoked and, after zero or more iterations,
+ * empty, the body is evaluated and "passed through" to the current out,
+ * then doAfterBody() is invoked and, after zero or more iterations,
* doEndTag() is invoked.
*/
@@ -80,10 +81,10 @@ public interface IterationTag extends Ta
*
* For compatibility with JSP 1.1, the value is carefully selected
* to be the same as the, now deprecated, BodyTag.EVAL_BODY_TAG,
- *
+ *
*/
-
- public final static int EVAL_BODY_AGAIN = 2;
+
+ public static final int EVAL_BODY_AGAIN = 2;
/**
* Process body (re)evaluation. This method is invoked by the
@@ -99,7 +100,7 @@ public interface IterationTag extends Ta
*
* <p>
* If this tag handler implements BodyTag and doAfterBody returns
- * SKIP_BODY, the value of out will be restored using the popBody
+ * SKIP_BODY, the value of out will be restored using the popBody
* method in pageContext prior to invoking doEndTag.
*
* <p>