1 16 package org.apache.cocoon.selection; 17 18 import java.util.Map ; 19 20 import org.apache.avalon.framework.parameters.Parameters; 21 import org.apache.avalon.framework.thread.ThreadSafe; 22 23 50 public class SimpleSelector extends AbstractSwitchSelector implements ThreadSafe { 51 52 public Object getSelectorContext(Map objectModel, Parameters parameters) { 53 return parameters.getParameter("value", ""); 54 } 55 56 public boolean select(String expression, Object selectorContext) { 57 if (selectorContext == null) { 58 if (getLogger().isWarnEnabled()) 59 getLogger().warn("Value not set -- failing."); 60 return false; 61 } 62 63 return selectorContext.equals(expression); 64 } 65 66 } 67 | Popular Tags |