FileDocCategorySizeDatePackage
ImplicitObjectELResolver.javaAPI DocApache Tomcat 6.0.1419325Fri Jul 20 04:20:32 BST 2007javax.servlet.jsp.el

ImplicitObjectELResolver

public class ImplicitObjectELResolver extends ELResolver
since
2.1

Fields Summary
private static final String[]
SCOPE_NAMES
private static final int
APPLICATIONSCOPE
private static final int
COOKIE
private static final int
HEADER
private static final int
HEADERVALUES
private static final int
INITPARAM
private static final int
PAGECONTEXT
private static final int
PAGESCOPE
private static final int
PARAM
private static final int
PARAM_VALUES
private static final int
REQUEST_SCOPE
private static final int
SESSION_SCOPE
Constructors Summary
public ImplicitObjectELResolver()


      
        super();
    
Methods Summary
public java.lang.ClassgetCommonPropertyType(javax.el.ELContext context, java.lang.Object base)

        if (base == null) {
            return String.class;
        }
        return null;
    
public java.util.IteratorgetFeatureDescriptors(javax.el.ELContext context, java.lang.Object base)

        List<FeatureDescriptor> feats = new ArrayList<FeatureDescriptor>(
                SCOPE_NAMES.length);
        FeatureDescriptor feat;
        for (int i = 0; i < SCOPE_NAMES.length; i++) {
            feat = new FeatureDescriptor();
            feat.setDisplayName(SCOPE_NAMES[i]);
            feat.setExpert(false);
            feat.setHidden(false);
            feat.setName(SCOPE_NAMES[i]);
            feat.setPreferred(true);
            feat.setValue(RESOLVABLE_AT_DESIGN_TIME, Boolean.TRUE);
            feat.setValue(TYPE, String.class);
            feats.add(feat);
        }
        return feats.iterator();
    
public java.lang.ClassgetType(javax.el.ELContext context, java.lang.Object base, java.lang.Object property)

        if (context == null) {
            throw new NullPointerException();
        }

        if (base == null && property != null) {
            int idx = Arrays.binarySearch(SCOPE_NAMES, property.toString());
            if (idx >= 0) {
                context.setPropertyResolved(true);
            }
        }
        return null;
    
public java.lang.ObjectgetValue(javax.el.ELContext context, java.lang.Object base, java.lang.Object property)

        if (context == null) {
            throw new NullPointerException();
        }

        if (base == null && property != null) {
            int idx = Arrays.binarySearch(SCOPE_NAMES, property.toString());

            if (idx >= 0) {
                PageContext page = (PageContext) context
                        .getContext(JspContext.class);
                context.setPropertyResolved(true);
                switch (idx) {
                case APPLICATIONSCOPE:
                    return ScopeManager.get(page).getApplicationScope();
                case COOKIE:
                    return ScopeManager.get(page).getCookie();
                case HEADER:
                    return ScopeManager.get(page).getHeader();
                case HEADERVALUES:
                    return ScopeManager.get(page).getHeaderValues();
                case INITPARAM:
                    return ScopeManager.get(page).getInitParam();
                case PAGECONTEXT:
                    return ScopeManager.get(page).getPageContext();
                case PAGESCOPE:
                    return ScopeManager.get(page).getPageScope();
                case PARAM:
                    return ScopeManager.get(page).getParam();
                case PARAM_VALUES:
                    return ScopeManager.get(page).getParamValues();
                case REQUEST_SCOPE:
                    return ScopeManager.get(page).getRequestScope();
                case SESSION_SCOPE:
                    return ScopeManager.get(page).getSessionScope();
                }
            }
        }
        return null;
    
public booleanisReadOnly(javax.el.ELContext context, java.lang.Object base, java.lang.Object property)

        if (context == null) {
            throw new NullPointerException();
        }

        if (base == null && property != null) {
            int idx = Arrays.binarySearch(SCOPE_NAMES, property.toString());
            if (idx >= 0) {
                context.setPropertyResolved(true);
                return true;
            }
        }
        return false;
    
public voidsetValue(javax.el.ELContext context, java.lang.Object base, java.lang.Object property, java.lang.Object value)

        if (context == null) {
            throw new NullPointerException();
        }

        if (base == null && property != null) {
            int idx = Arrays.binarySearch(SCOPE_NAMES, property.toString());
            if (idx >= 0) {
                context.setPropertyResolved(true);
                throw new PropertyNotWritableException();
            }
        }