1 16 package org.apache.cocoon.jxpath; 17 18 import java.util.Enumeration ; 19 20 import org.apache.cocoon.environment.Session; 21 import org.apache.commons.collections.EnumerationUtils; 22 import org.apache.commons.jxpath.DynamicPropertyHandler; 23 24 31 public class CocoonSessionHandler implements DynamicPropertyHandler { 32 33 public String [] getPropertyNames(Object session) { 34 final Enumeration e = ((Session) session).getAttributeNames(); 35 return (String []) EnumerationUtils.toList(e).toArray(); 36 } 37 38 public Object getProperty(Object session, String property) { 39 return ((Session) session).getAttribute(property); 40 } 41 42 public void setProperty(Object session, String property, Object value) { 43 ((Session) session).setAttribute(property, value); 44 } 45 } 46 | Popular Tags |