return this.readOnly;
}
- public Iterator getFeatureDescriptors(ELContext context, Object base) {
+ public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base) {
if (base != null && base.getClass().isArray()) {
FeatureDescriptor[] descs = new FeatureDescriptor[Array.getLength(base)];
for (int i = 0; i < descs.length; i++) {
package javax.el;
import java.beans.BeanInfo;
+import java.beans.FeatureDescriptor;
import java.beans.IntrospectionException;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
|| this.property(context, base, property).isReadOnly();
}
- public Iterator getFeatureDescriptors(ELContext context, Object base) {
+ public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base) {
if (context == null) {
throw new NullPointerException();
}
pds[i].setValue(RESOLVABLE_AT_DESIGN_TIME, Boolean.TRUE);
pds[i].setValue(TYPE, pds[i].getPropertyType());
}
- return Arrays.asList(pds).iterator();
+ return Arrays.asList((FeatureDescriptor[]) pds).iterator();
} catch (IntrospectionException e) {
//
}
return null;
}
- private final static class BeanProperties {
+ protected final static class BeanProperties {
private final Map<String, BeanProperty> properties;
private final Class<?> type;
}
}
- private final static class BeanProperty {
+ protected final static class BeanProperty {
private final Class type;
private final Class owner;
package javax.el;
+import java.beans.FeatureDescriptor;
import java.util.Iterator;
public class CompositeELResolver extends ELResolver {
return false;
}
- public Iterator getFeatureDescriptors(ELContext context, Object base) {
+ public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base) {
return new FeatureIterator(context, base, this.resolvers, this.size);
}
return null;
}
- private final static class FeatureIterator implements Iterator {
+ private final static class FeatureIterator implements Iterator<FeatureDescriptor> {
private final ELContext context;
return this.itr != null;
}
- public Object next() {
+ public FeatureDescriptor next() {
Object result = null;
if (this.itr != null) {
if (this.itr.hasNext()) {
}
}
}
- return result;
+ return (FeatureDescriptor) result;
}
public void remove() {
* @author Jacob Hookom [jacob/hookom.net]
*
*/
-public interface ELContextListener {
+public interface ELContextListener extends java.util.EventListener {
public void contextCreated(ELContextEvent event);
public abstract boolean isReadOnly(ELContext context, Object base, Object property) throws NullPointerException, PropertyNotFoundException, ELException;
- public abstract Iterator getFeatureDescriptors(ELContext context, Object base);
+ public abstract Iterator<java.beans.FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base);
public abstract Class<?> getCommonPropertyType(ELContext context, Object base);
}
return this.readOnly;
}
- public Iterator getFeatureDescriptors(ELContext context, Object base) {
+ public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base) {
if (base instanceof List) {
FeatureDescriptor[] descs = new FeatureDescriptor[((List) base).size()];
for (int i = 0; i < descs.length; i++) {
return this.readOnly;
}
- public Iterator getFeatureDescriptors(ELContext context, Object base) {
+ public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base) {
if (base instanceof Map) {
Iterator itr = ((Map) base).keySet().iterator();
- List feats = new ArrayList();
+ List<FeatureDescriptor> feats = new ArrayList<FeatureDescriptor>();
Object key;
FeatureDescriptor desc;
while (itr.hasNext()) {
* invalidated.
*/
- abstract public Enumeration getAttributeNamesInScope(int scope);
+ abstract public Enumeration<String> getAttributeNamesInScope(int scope);
/**
* The current value of the out object (a JspWriter).
return null;
}
- public Class<?> getType(ELContext context, Object base, Object property)
+ public Class getType(ELContext context, Object base, Object property)
throws NullPointerException, PropertyNotFoundException, ELException {
if (context == null) {
throw new NullPointerException();
return false;
}
- public Iterator getFeatureDescriptors(ELContext context, Object base) {
+ public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base) {
List<FeatureDescriptor> feats = new ArrayList<FeatureDescriptor>(
SCOPE_NAMES.length);
FeatureDescriptor feat;
return feats.iterator();
}
- public Class<?> getCommonPropertyType(ELContext context, Object base) {
+ public Class<String> getCommonPropertyType(ELContext context, Object base) {
if (base == null) {
return String.class;
}
return null;
}
- public Class<?> getType(ELContext context, Object base, Object property)
+ public Class getType(ELContext context, Object base, Object property)
throws NullPointerException, PropertyNotFoundException, ELException {
if (context == null) {
throw new NullPointerException();
return false;
}
- public Iterator getFeatureDescriptors(ELContext context, Object base) {
+ public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base) {
PageContext ctxt = (PageContext) context.getContext(JspContext.class);
- List list = new ArrayList();
+ List<FeatureDescriptor> list = new ArrayList<FeatureDescriptor>();
Enumeration e;
Object value;
String name;
}
}
- public Class<?> getCommonPropertyType(ELContext context, Object base) {
+ public Class<String> getCommonPropertyType(ELContext context, Object base) {
if (base == null) {
return String.class;
}
* or is an instance of the class specified
*/
public static final JspTag findAncestorWithClass(
- JspTag from, Class klass)
+ JspTag from, Class<?> klass)
{
boolean isInterface = false;
*/
public TagData(Object[] atts[]) {
if (atts == null) {
- attributes = new Hashtable();
+ attributes = new Hashtable<String, Object>();
} else {
- attributes = new Hashtable(atts.length);
+ attributes = new Hashtable<String, Object>(atts.length);
}
if (atts != null) {
for (int i = 0; i < atts.length; i++) {
- attributes.put(atts[i][0], atts[i][1]);
+ attributes.put((String) atts[i][0], atts[i][1]);
}
}
}
*
* @param attrs A hashtable to get the values from.
*/
- public TagData(Hashtable attrs) {
+ public TagData(Hashtable<String, Object> attrs) {
this.attributes = attrs;
}
*
*@return An enumeration of the attributes in a TagData
*/
- public java.util.Enumeration getAttributes() {
+ public java.util.Enumeration<String> getAttributes() {
return attributes.keys();
};
// private data
- private Hashtable attributes; // the tagname/value map
+ private Hashtable<String, Object> attributes; // the tagname/value map
}
}
+ /**
+ * Returns an array of TagLibraryInfo objects representing the entire set
+ * of tag libraries (including this TagLibraryInfo) imported by taglib
+ * directives in the translation unit that references this TagLibraryInfo.
+ * If a tag library is imported more than once and bound to different prefices,
+ * only the TagLibraryInfo bound to the first prefix must be included
+ * in the returned array.
+ *
+ * @return Array of TagLibraryInfo objects representing the entire set
+ * of tag libraries (including this TagLibraryInfo) imported by taglib
+ * directives in the translation unit that references this TagLibraryInfo.
+ * @since 2.1
+ */
+ public abstract javax.servlet.jsp.tagext.TagLibraryInfo[] getTagLibraryInfos();
+
+
// Protected fields
/**
*
* @param map A Map describing the init parameters
*/
- public void setInitParameters(Map map) {
+ public void setInitParameters(Map<String, Object> map) {
initParameters = map;
}
*
* @return The init parameters as an immutable map.
*/
- public Map getInitParameters() {
+ public Map<String, Object> getInitParameters() {
return initParameters;
}
}
// Private data
- private Map initParameters;
+ private Map<String, Object> initParameters;
}
public void setValue(String k, Object o) {
if (values == null) {
- values = new Hashtable();
+ values = new Hashtable<String, Object>();
}
values.put(k, o);
}
* or null or an empty Enumeration if no values have been set.
*/
- public Enumeration getValues() {
+ public Enumeration<String> getValues() {
if (values == null) {
return null;
}
// private fields
private Tag parent;
- private Hashtable values;
+ private Hashtable<String, Object> values;
/**
* The value of the id attribute of this tag; or null.
*/
private Hashtable tagFileMap;
private ParserController pc;
+ private PageInfo pi;
private Vector vec;
/**
*/
public ImplicitTagLibraryInfo(JspCompilationContext ctxt,
ParserController pc,
+ PageInfo pi,
String prefix,
String tagdir,
ErrorDispatcher err) throws JasperException {
super(prefix, null);
this.pc = pc;
+ this.pi = pi;
this.tagFileMap = new Hashtable();
this.vec = new Vector();
return tagFile;
}
+
+ public TagLibraryInfo[] getTagLibraryInfos() {
+ Collection coll = pi.getTaglibs();
+ return (TagLibraryInfo[]) coll.toArray(new TagLibraryInfo[0]);
+ }
+
}
new ImplicitTagLibraryInfo(
ctxt,
parserController,
+ pageInfo,
prefix,
tagdir,
err);
new TagLibraryInfoImpl(
ctxt,
parserController,
+ pageInfo,
prefix,
uri,
location,
}
if (impl == null) {
String[] location = ctxt.getTldLocation(uri);
- impl = new TagLibraryInfoImpl(ctxt, parserController,
+ impl = new TagLibraryInfoImpl(ctxt, parserController, pageInfo,
prefix, uri, location, err);
if (ctxt.getOptions().isCaching()) {
ctxt.getOptions().getCache().put(uri, impl);
if (pageInfo.getTaglib(urnTagdir) == null) {
pageInfo.addTaglib(urnTagdir,
new ImplicitTagLibraryInfo(ctxt,
- parserController, prefix, tagdir, err));
+ parserController, pageInfo, prefix, tagdir, err));
}
pageInfo.addPrefixMapping(prefix, urnTagdir);
}
import java.io.StringWriter;
import java.net.JarURLConnection;
import java.net.URL;
+import java.util.Collection;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Iterator;
private Hashtable jarEntries;
private JspCompilationContext ctxt;
+
+ private PageInfo pi;
private ErrorDispatcher err;
/**
* Constructor.
*/
- public TagLibraryInfoImpl(JspCompilationContext ctxt, ParserController pc,
+ public TagLibraryInfoImpl(JspCompilationContext ctxt, ParserController pc, PageInfo pi,
String prefix, String uriIn, String[] location, ErrorDispatcher err)
throws JasperException {
super(prefix, uriIn);
this.ctxt = ctxt;
this.parserController = pc;
+ this.pi = pi;
this.err = err;
InputStream in = null;
JarFile jarFile = null;
}
+ public TagLibraryInfo[] getTagLibraryInfos() {
+ Collection coll = pi.getTaglibs();
+ return (TagLibraryInfo[]) coll.toArray(new TagLibraryInfo[0]);
+ }
+
/*
* @param ctxt The JSP compilation context @param uri The TLD's uri @param
* in The TLD's input stream @param jarFileUrl The JAR file containing the
}
}
- public Enumeration getAttributeNamesInScope(int scope) {
+ public Enumeration<String> getAttributeNamesInScope(int scope) {
if (scope == PAGE_SCOPE) {
return pageAttributes.keys();
}
return context.getAttribute(name);
}
- public Enumeration getAttributeNamesInScope(final int scope) {
+ public Enumeration<String> getAttributeNamesInScope(final int scope) {
if (SecurityUtil.isPackageProtectionEnabled()) {
return (Enumeration) AccessController
.doPrivileged(new PrivilegedAction() {