@Override
  public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext elContext, Object base) {

    List<FeatureDescriptor> featureDescriptors = new ArrayList<>();

    PageContext pageContext = (PageContext) elContext.getContext(JspContext.class);

    Enumeration<?> enumeration = pageContext.getAttributeNamesInScope(PageContext.PAGE_SCOPE);

    while (enumeration.hasMoreElements()) {
      String name = (String) enumeration.nextElement();

      Object value = pageContext.getAttribute(name, PageContext.PAGE_SCOPE);

      FeatureDescriptor featureDescriptor = getFeatureDescriptor(name, value, "page");

      featureDescriptors.add(featureDescriptor);
    }

    enumeration = pageContext.getAttributeNamesInScope(PageContext.REQUEST_SCOPE);

    while (enumeration.hasMoreElements()) {
      String name = (String) enumeration.nextElement();

      Object value = pageContext.getAttribute(name, PageContext.REQUEST_SCOPE);

      FeatureDescriptor featureDescriptor = getFeatureDescriptor(name, value, "request");

      featureDescriptors.add(featureDescriptor);
    }

    enumeration = pageContext.getAttributeNamesInScope(PageContext.SESSION_SCOPE);

    while (enumeration.hasMoreElements()) {
      String name = (String) enumeration.nextElement();

      Object value = pageContext.getAttribute(name, PageContext.SESSION_SCOPE);

      FeatureDescriptor featureDescriptor = getFeatureDescriptor(name, value, "session");

      featureDescriptors.add(featureDescriptor);
    }

    enumeration = pageContext.getAttributeNamesInScope(PageContext.APPLICATION_SCOPE);

    while (enumeration.hasMoreElements()) {
      String name = (String) enumeration.nextElement();

      Object value = pageContext.getAttribute(name, PageContext.APPLICATION_SCOPE);

      FeatureDescriptor featureDescriptor = getFeatureDescriptor(name, value, "application");

      featureDescriptors.add(featureDescriptor);
    }

    return featureDescriptors.iterator();
  }
예제 #2
0
 @SuppressWarnings({"unchecked", "rawtypes"})
 @Override
 public Enumeration getAttributeNamesInScope(int arg0) {
   // TODO R3Vx (minor) ji likely to be wrong. Wenn Variable auf null gesetzt wird, diese aber auch
   // in Parent ist,
   // wird ggf. die von Parent weitergeliefert
   return parentPageContext.getAttributeNamesInScope(arg0);
 }